From 67f5db7b85a89ae74f038dc541f659c6d35c59b5 Mon Sep 17 00:00:00 2001 From: Bastian Date: Fri, 29 Apr 2016 12:52:48 +0200 Subject: [PATCH] * Update GraphiQL JS library --- Resources/Public/Scripts/graphiql.min.js | 35 ++++++++++++------------ 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/Resources/Public/Scripts/graphiql.min.js b/Resources/Public/Scripts/graphiql.min.js index 235e805..19ecefc 100644 --- a/Resources/Public/Scripts/graphiql.min.js +++ b/Resources/Public/Scripts/graphiql.min.js @@ -1,17 +1,18 @@ -!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;o0&&(a=t[t.length-1]);var r=void 0,c=void 0;a?"Search Results"===a.name?(r=a.name,c=_react2.default.createElement(SearchDoc,{searchValue:a.searchValue,schema:e,onClickType:this.handleClickTypeOrField,onClickField:this.handleClickTypeOrField})):(r=a.name,c=(0,_graphql.isType)(a)?_react2.default.createElement(TypeDoc,{key:a.name,type:a,onClickType:this.handleClickTypeOrField,onClickField:this.handleClickTypeOrField}):_react2.default.createElement(FieldDoc,{key:a.name,field:a,onClickType:this.handleClickTypeOrField})):e&&(r="Documentation Explorer",c=_react2.default.createElement(SchemaDoc,{schema:e,onClickType:this.handleClickTypeOrField}));var n=void 0;1===t.length?n="Schema":t.length>1&&(n=t[t.length-2].name);var l=_react2.default.createElement("div",{className:"spinner-container"},_react2.default.createElement("div",{className:"spinner"})),o=c&&(c.type===SearchDoc||c.type===SchemaDoc);return _react2.default.createElement("div",{className:"doc-explorer"},_react2.default.createElement("div",{className:"doc-explorer-title-bar"},n&&_react2.default.createElement("div",{className:"doc-explorer-back",onClick:this.handleNavBackClick},n),_react2.default.createElement("div",{className:"doc-explorer-title"},r),_react2.default.createElement("div",{className:"doc-explorer-rhs"},this.props.children)),_react2.default.createElement("div",{className:"doc-explorer-contents"},_react2.default.createElement(SearchBox,{isShown:o,onSearch:this.handleSearch}),this.props.schema?c:l))}},{key:"showDoc",value:function(e){var t=this.state.navStack,a=t.length>0&&t[t.length-1]===e;a||(t=t.concat([e])),this.setState({navStack:t})}},{key:"showSearch",value:function(e){var t=this.state.navStack,a=t.length>0&&t[t.length-1];a?a.searchValue!==e.searchValue&&(t=t.slice(0,-1).concat([e])):t=t.concat([e]),this.setState({navStack:t})}}]),t}(_react2.default.Component);DocExplorer.propTypes={schema:_react.PropTypes.instanceOf(_graphql.GraphQLSchema)};var SearchBox=function(e){function t(e){_classCallCheck(this,t);var a=_possibleConstructorReturn(this,Object.getPrototypeOf(t).call(this,e));return a.handleChange=function(e){a.setState({value:e.target.value}),a._debouncedOnSearch()},a.state={value:null},a._debouncedOnSearch=(0,_debounce2.default)(200,function(){a.props.onSearch(a.state.value)}),a}return _inherits(t,e),_createClass(t,[{key:"shouldComponentUpdate",value:function(e,t){return e.isShown!==this.props.isShown||t.value!==this.state.value}},{key:"render",value:function(){return _react2.default.createElement("div",null,this.props.isShown&&_react2.default.createElement("label",{className:"search-box-outer"},_react2.default.createElement("input",{className:"search-box-input",onChange:this.handleChange,type:"text",value:this.state.value,placeholder:"Search the schema ..."})))}}]),t}(_react2.default.Component);SearchBox.propTypes={isShown:_react.PropTypes.bool,onSearch:_react.PropTypes.func};var SearchDoc=function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,Object.getPrototypeOf(t).apply(this,arguments))}return _inherits(t,e),_createClass(t,[{key:"shouldComponentUpdate",value:function(e){return this.props.schema!==e.schema||this.props.searchValue!==e.searchValue}},{key:"render",value:function(){var e=this,t=this.props.searchValue,a=this.props.schema,r=this.props.onClickType,c=this.props.onClickField,n=a.getTypeMap(),l=[],o=[],s=Object.keys(n),i=!0,p=!1,u=void 0;try{for(var d,m=function(){var a=d.value;if(l.length+o.length>=100)return"break";var s=n[a],i=[];e._isMatch(a,t)&&i.push("Type Name"),i.length&&l.push(_react2.default.createElement("div",{className:"doc-category-item"},_react2.default.createElement(TypeLink,{type:s,onClick:r}))),s.getFields&&!function(){var a=s.getFields();Object.keys(a).forEach(function(n){var l=a[n];if(e._isMatch(n,t))o.push(_react2.default.createElement("div",{className:"doc-category-item"},_react2.default.createElement("a",{className:"field-name",onClick:function(e){return c(l,s,e)}},l.name)," on ",_react2.default.createElement(TypeLink,{type:s,onClick:r})));else if(l.args&&l.args.length){var i=l.args.filter(function(a){return e._isMatch(a.name,t)});i.length>0&&o.push(_react2.default.createElement("div",{className:"doc-category-item"},_react2.default.createElement("a",{className:"field-name",onClick:function(e){return c(l,s,e)}},l.name),"(",_react2.default.createElement("span",null,i.map(function(e){return _react2.default.createElement("span",{className:"arg",key:e.name},_react2.default.createElement("span",{className:"arg-name"},e.name),": ",_react2.default.createElement(TypeLink,{type:e.type,onClick:r}))})),")"," on ",_react2.default.createElement(TypeLink,{type:s,onClick:r})))}})}()},h=s[Symbol.iterator]();!(i=(d=h.next()).done);i=!0){var f=m();if("break"===f)break}}catch(y){p=!0,u=y}finally{try{!i&&h.return&&h.return()}finally{if(p)throw u}}return 0===l.length&&0===o.length?_react2.default.createElement("span",{className:"doc-alert-text"},"No results found."):_react2.default.createElement("div",null,_react2.default.createElement("div",{className:"doc-category"},(l.length>0||o.length>0)&&_react2.default.createElement("div",{className:"doc-category-title"},"search results"),l,o))}},{key:"_isMatch",value:function(e,t){try{var a=t.replace(/[^_0-9A-Za-z]/g,function(e){return"\\"+e});return-1!==e.search(new RegExp(a,"i"))}catch(r){return-1!==e.toLowerCase().indexOf(t.toLowerCase())}}}]),t}(_react2.default.Component);SearchDoc.propTypes={schema:_react.PropTypes.object,searchValue:_react.PropTypes.string,onClickType:_react.PropTypes.func,onClickField:_react.PropTypes.func};var SchemaDoc=function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,Object.getPrototypeOf(t).apply(this,arguments))}return _inherits(t,e),_createClass(t,[{key:"shouldComponentUpdate",value:function(e){return this.props.schema!==e.schema}},{key:"render",value:function(){var e=this.props.schema,t=e.getQueryType(),a=e.getMutationType&&e.getMutationType(),r=e.getSubscriptionType&&e.getSubscriptionType();return _react2.default.createElement("div",null,_react2.default.createElement(Description,{className:"doc-type-description",markdown:"A GraphQL schema provides a root type for each kind of operation."}),_react2.default.createElement("div",{className:"doc-category"},_react2.default.createElement("div",{className:"doc-category-title"},"root types"),_react2.default.createElement("div",{className:"doc-category-item"},_react2.default.createElement("span",{className:"keyword"},"query"),": ",_react2.default.createElement(TypeLink,{type:t,onClick:this.props.onClickType})),a&&_react2.default.createElement("div",{className:"doc-category-item"},_react2.default.createElement("span",{className:"keyword"},"mutation"),": ",_react2.default.createElement(TypeLink,{type:a,onClick:this.props.onClickType})),r&&_react2.default.createElement("div",{className:"doc-category-item"},_react2.default.createElement("span",{className:"keyword"},"subscription"),": ",_react2.default.createElement(TypeLink,{type:r,onClick:this.props.onClickType}))))}}]),t}(_react2.default.Component);SchemaDoc.propTypes={schema:_react.PropTypes.object,onClickType:_react.PropTypes.func};var TypeDoc=function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,Object.getPrototypeOf(t).apply(this,arguments))}return _inherits(t,e),_createClass(t,[{key:"shouldComponentUpdate",value:function(e){return this.props.type!==e.type}},{key:"render",value:function(){var e=this.props.type,t=this.props.onClickType,a=this.props.onClickField,r=void 0,c=void 0;e instanceof _graphql.GraphQLUnionType?(r="possible types",c=e.getPossibleTypes()):e instanceof _graphql.GraphQLInterfaceType?(r="implementations",c=e.getPossibleTypes()):e instanceof _graphql.GraphQLObjectType&&(r="implements",c=e.getInterfaces());var n=void 0;c&&c.length>0&&(n=_react2.default.createElement("div",{className:"doc-category"},_react2.default.createElement("div",{className:"doc-category-title"},r),c.map(function(e){return _react2.default.createElement("div",{key:e.name,className:"doc-category-item"},_react2.default.createElement(TypeLink,{type:e,onClick:t}))})));var l=void 0;e.getFields&&!function(){var r=e.getFields(),c=Object.keys(r).map(function(e){return r[e]});l=_react2.default.createElement("div",{className:"doc-category"},_react2.default.createElement("div",{className:"doc-category-title"},"fields"),c.map(function(r){var c=void 0;return r.args&&r.args.length>0&&(c=r.args.map(function(e){return _react2.default.createElement("span",{className:"arg",key:e.name},_react2.default.createElement("span",{className:"arg-name"},e.name),": ",_react2.default.createElement(TypeLink,{type:e.type,onClick:t}))})),_react2.default.createElement("div",{key:r.name,className:"doc-category-item"},_react2.default.createElement("a",{className:"field-name",onClick:function(t){return a(r,e,t)}},r.name),c&&["(",_react2.default.createElement("span",{key:"args"},c),")"],": ",_react2.default.createElement(TypeLink,{type:r.type,onClick:t}))}))}();var o=void 0;return e instanceof _graphql.GraphQLEnumType&&(o=_react2.default.createElement("div",{className:"doc-category"},_react2.default.createElement("div",{className:"doc-category-title"},"values"),e.getValues().map(function(e){return _react2.default.createElement("div",{key:e.name,className:"doc-category-item"},_react2.default.createElement("div",{className:"enum-value"},e.name),_react2.default.createElement(Description,{className:"doc-value-description",markdown:e.description}))}))),_react2.default.createElement("div",null,_react2.default.createElement(Description,{className:"doc-type-description",markdown:e.description||"No Description"}),e instanceof _graphql.GraphQLObjectType&&n,l,o,!(e instanceof _graphql.GraphQLObjectType)&&n)}}]),t}(_react2.default.Component);TypeDoc.propTypes={type:_react.PropTypes.object,onClickType:_react.PropTypes.func,onClickField:_react.PropTypes.func};var FieldDoc=function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,Object.getPrototypeOf(t).apply(this,arguments))}return _inherits(t,e),_createClass(t,[{key:"shouldComponentUpdate",value:function(e){return this.props.field!==e.field}},{key:"render",value:function(){var e=this,t=this.props.field,a=void 0;return t.args&&t.args.length>0&&(a=_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("span",{className:"arg-name"},t.name),": ",_react2.default.createElement(TypeLink,{type:t.type,onClick:e.props.onClickType})),_react2.default.createElement(Description,{className:"doc-value-description",markdown:t.description}))}))),_react2.default.createElement("div",null,_react2.default.createElement(Description,{className:"doc-type-description",markdown:t.description||"No Description"}),_react2.default.createElement("div",{className:"doc-category"},_react2.default.createElement("div",{className:"doc-category-title"},"type"),_react2.default.createElement(TypeLink,{type:t.type,onClick:this.props.onClickType})),a)}}]),t}(_react2.default.Component);FieldDoc.propTypes={field:_react.PropTypes.object,onClickType:_react.PropTypes.func};var TypeLink=function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,Object.getPrototypeOf(t).apply(this,arguments))}return _inherits(t,e),_createClass(t,[{key:"shouldComponentUpdate",value:function(e){return this.props.type!==e.type}},{key:"render",value:function(){return renderType(this.props.type,this.props.onClick)}}]),t}(_react2.default.Component);TypeLink.propTypes={type:_react.PropTypes.object,onClick:_react.PropTypes.func};var Description=function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,Object.getPrototypeOf(t).apply(this,arguments))}return _inherits(t,e),_createClass(t,[{key:"shouldComponentUpdate",value:function(e){return this.props.markdown!==e.markdown}},{key:"render",value:function(){var e=this.props.markdown;if(!e)return _react2.default.createElement("div",null);var t=(0,_marked2.default)(e,{sanitize:!0});return _react2.default.createElement("div",{className:this.props.className,dangerouslySetInnerHTML:{__html:t}})}}]),t}(_react2.default.Component);Description.propTypes={markdown:_react.PropTypes.string,className:_react.PropTypes.string}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utility/debounce":10,graphql:152,marked:214}],2:[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.ExecuteButton=void 0;var _createClass=function(){function e(e,t){for(var n=0;n1,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 u=void 0;!this.props.isRunning&&o||(u=this._onClick);var a=void 0;return this.props.isRunning||!o||n||(a=this._onOptionsOpen),_react2.default.createElement("div",{className:"execute-button-wrap"},_react2.default.createElement("button",{className:"execute-button",onMouseDown:a,onClick:u,title:"Execute Query (Ctrl-Enter)"},_react2.default.createElement("svg",{width:"34",height:"34"},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"}))),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:{})},{}],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)}function isPromise(e){return"object"===("undefined"==typeof e?"undefined":_typeof(e))&&"function"==typeof e.then}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?"symbol":typeof e},_extends=Object.assign||function(e){for(var t=1;t0&&!function(){var t=e.queryEditorComponent.getCodeMirror();t.operation(function(){var e=t.getCursor(),o=t.indexFromPos(e);t.setValue(n);var i=0,a=r.map(function(e){var r=e.index,n=e.string;return t.markText(t.posFromIndex(r+i),t.posFromIndex(r+(i+=n.length)),{className:"autoInsertedLeaf",clearOnEnter:!0,title:"Automatically added leaf fields"})});setTimeout(function(){return a.forEach(function(e){return e.clear()})},7e3);var s=o;r.forEach(function(e){var t=e.index,r=e.string;o>t&&(s+=r.length)}),t.setCursor(t.posFromIndex(s))})}(),n}},{key:"_ensureOfSchema",value:function(){var e=this;if(void 0===this.state.schema){var t=this.props.fetcher,r=t({query:_introspectionQueries.introspectionQuery});return isPromise(r)?void r.then(function(e){if(e.data)return e;var n=t({query:_introspectionQueries.introspectionQuerySansSubscriptions});if(!isPromise(r))throw new Error("Fetcher did not return a Promise for introspection.");return n}).then(function(t){if(void 0===e.state.schema)if(t&&t.data){var r=(0,_graphql.buildClientSchema)(t.data),n=(0,_getQueryFacts2.default)(r,e.state.query);e.setState(_extends({schema:r},n))}else{var o="string"==typeof t?t:JSON.stringify(t,null,2);e.setState({response:o})}}).catch(function(t){e.setState({response:t&&(t.stack||String(t))})}):void this.setState({response:"Fetcher did not return a Promise for introspection."})}}},{key:"_storageGet",value:function(e){return this._storage&&this._storage.getItem("graphiql:"+e)}},{key:"_storageSet",value:function(e,t){this._storage&&this._storage.setItem("graphiql:"+e,t)}},{key:"_fetchQuery",value:function(e,t,r,n){var o=this,i=this.props.fetcher,a=i({query:e,variables:t,operationName:r});if(isPromise(a))a.then(n).catch(function(e){o.setState({isWaitingForResponse:!1,response:e&&(e.stack||String(e))})});else{if(isObservable(a)){var s=a.subscribe({next:n,error:function(e){o.setState({isWaitingForResponse:!1,response:e&&(e.stack||String(e)),subscription:null})},complete:function(){o.setState({isWaitingForResponse:!1,subscription:null})}});return s}this.setState({isWaitingForResponse:!1,response:"Fetcher did not return Promise or Observable."})}}},{key:"_runQueryAtCursor",value:function(){if(this.state.subscription)return void this.handleStopQuery();var e=void 0,t=this.state.operations;if(t){var r=this.queryEditorComponent.getCodeMirror();if(r.hasFocus())for(var n=r.getCursor(),o=r.indexFromPos(n),i=0;i=o){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,getDefaultFieldNames:_react.PropTypes.func};var _initialiseProps=function(){var e=this;this.handleRunQuery=function(t){e._editorQueryID++;var r=e._editorQueryID,n=e.autoCompleteLeafs()||e.state.query,o=e.state.variables,i=e.state.operationName;if(t&&t!==i){i=t;var a=e.props.onEditOperationName;a&&a(i)}var s=e._fetchQuery(n,o,i,function(t){r===e._editorQueryID&&e.setState({isWaitingForResponse:!1,response:JSON.stringify(t,null,2)})});e.setState({isWaitingForResponse:!0,response:null,subscription:s,operationName:i})},this.handleStopQuery=function(){var t=e.state.subscription;e.setState({isWaitingForResponse:!1,subscription:null}),t&&t.unsubscribe()},this._keyHandler=function(t){(t.metaKey||t.ctrlKey)&&13===t.keyCode&&(t.preventDefault(),e._runQueryAtCursor()); -},this.handlePrettifyQuery=function(){var t=(0,_graphql.print)((0,_graphql.parse)(e.state.query)),r=e.queryEditorComponent.getCodeMirror();r.setValue(t)},this.handleEditQuery=function(t){return e.state.schema&&e._updateQueryFacts(t),e.setState({query:t}),e.props.onEditQuery?e.props.onEditQuery(t):void 0},this._updateQueryFacts=(0,_debounce2.default)(150,function(t){var r=(0,_getQueryFacts2.default)(e.state.schema,t);if(r){var n=(0,_getSelectedOperationName2.default)(e.state.operations,e.state.operationName,r.operations),o=e.props.onEditOperationName;o&&n!==e.state.operationName&&o(n),e.setState(_extends({operationName:n},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._onClickHintInformation=function(t){if("typeName"===t.target.className){var r=t.target.innerHTML,n=e.state.schema;n&&!function(){var t=n.getType(r);t&&e.setState({docExplorerOpen:!0},function(){e.docExplorerComponent.showDoc(t)})}()}},this.handleToggleDocs=function(){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),n=function(t){if(0===t.buttons)return o();var n=_reactDom2.default.findDOMNode(e.editorBarComponent),i=t.clientX-(0,_elementPosition.getLeft)(n)-r,a=n.clientWidth-i;e.setState({editorFlex:i/a})},o=function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(){document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",o),n=null,o=null});document.addEventListener("mousemove",n),document.addEventListener("mouseup",o)}},this.handleDocsResizeStart=function(t){t.preventDefault();var r=e.state.docExplorerWidth,n=t.clientX-(0,_elementPosition.getLeft)(t.target),o=function(t){if(0===t.buttons)return i();var r=_reactDom2.default.findDOMNode(e),o=t.clientX-(0,_elementPosition.getLeft)(r)-n,a=r.clientWidth-o;100>a?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",o),document.removeEventListener("mouseup",i),o=null,i=null});document.addEventListener("mousemove",o),document.addEventListener("mouseup",i)},this.handleVariableResizeStart=function(t){t.preventDefault();var r=!1,n=e.state.variableEditorOpen,o=e.state.variableEditorHeight,i=t.clientY-(0,_elementPosition.getTop)(t.target),a=function(t){if(0===t.buttons)return s();r=!0;var n=_reactDom2.default.findDOMNode(e.editorBarComponent),a=t.clientY-(0,_elementPosition.getTop)(n)-i,u=n.clientHeight-a;60>u?e.setState({variableEditorOpen:!1,variableEditorHeight:o}):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:!n}),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.ToolbarButton=_ToolbarButton.ToolbarButton,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 IDE for writing, validating, and\n# testing GraphQL queries.\n#\n# Type queries into this side of the screen, and you will\n# see intelligent typeaheads aware of the current GraphQL type schema and\n# live syntax and validation errors highlighted within the text.\n#\n# To bring up the auto-complete at any point, just press Ctrl-Space.\n#\n# Press the run button above, or Cmd-Enter to execute the query, and the result\n# will appear in the pane to the right.\n\n"}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utility/CodeMirrorSizer":9,"../utility/debounce":10,"../utility/elementPosition":11,"../utility/fillLeafs":12,"../utility/find":13,"../utility/getQueryFacts":14,"../utility/getSelectedOperationName":15,"../utility/introspectionQueries":16,"./DocExplorer":1,"./ExecuteButton":2,"./QueryEditor":4,"./ResultViewer":5,"./ToolbarButton":6,"./VariableEditor":7,graphql:152}],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}),exports.QueryEditor=void 0;var _createClass=function(){function e(e,t){for(var o=0;o=65&&90>=r||!t.shiftKey&&r>=48&&57>=r||t.shiftKey&&189===r||t.shiftKey&&50===r||t.shiftKey&&57===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;this.editor=(0,_codemirror2.default)(_reactDom2.default.findDOMNode(this),{value:this.props.value||"",lineNumbers:!0,tabSize:2,mode:"graphql",theme:"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},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})},"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){this.ignoreChangeEvent=!0,this.props.schema!==e.schema&&(this.editor.options.lint.schema=this.props.schema,this.editor.options.hintOptions.schema=this.props.schema,_codemirror2.default.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(){return _react2.default.createElement("div",{className:"query-editor"})}},{key:"getCodeMirror",value:function(){return this.editor}}]),t}(_react2.default.Component);QueryEditor.propTypes={schema:_react.PropTypes.instanceOf(_graphql.GraphQLSchema),value:_react.PropTypes.string,onEdit:_react.PropTypes.func,onHintInformationRender:_react.PropTypes.func}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utility/onHasCompletion":17,codemirror:59,"codemirror-graphql/hint":39,"codemirror-graphql/lint":40,"codemirror-graphql/mode":41,"codemirror/addon/comment/comment":49,"codemirror/addon/edit/closebrackets":50,"codemirror/addon/edit/matchbrackets":51,"codemirror/addon/fold/brace-fold":52,"codemirror/addon/fold/foldgutter":54,"codemirror/addon/hint/show-hint":55,"codemirror/addon/lint/lint":56,"codemirror/keymap/sublime":58,graphql:152}],5:[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&&90>=r||!t.shiftKey&&r>=48&&57>=r||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;this.editor=(0,_codemirror2.default)(_reactDom2.default.findDOMNode(this),{value:this.props.value||"",lineNumbers:!0,tabSize:2,mode:"graphql-variables",theme:"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})},"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){this.ignoreChangeEvent=!0,this.props.variableToType!==e.variableToType&&(this.editor.options.lint.variableToType=this.props.variableToType,this.editor.options.hintOptions.variableToType=this.props.variableToType,_codemirror2.default.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(){return _react2.default.createElement("div",{className:"codemirrorWrap"})}},{key:"getCodeMirror",value:function(){return this.editor}}]),t}(_react2.default.Component);VariableEditor.propTypes={variableToType:_react.PropTypes.object,value:_react.PropTypes.string,onEdit:_react.PropTypes.func,onHintInformationRender:_react.PropTypes.func}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utility/onHasCompletion":17,codemirror:59,"codemirror-graphql/variables/hint":46,"codemirror-graphql/variables/lint":47,"codemirror-graphql/variables/mode":48,"codemirror/addon/edit/closebrackets":50,"codemirror/addon/edit/matchbrackets":51,"codemirror/addon/fold/brace-fold":52,"codemirror/addon/fold/foldgutter":54,"codemirror/addon/hint/show-hint":55,"codemirror/addon/lint/lint":56,"codemirror/keymap/sublime":58}],8:[function(require,module,exports){"use strict";module.exports=require("./components/GraphiQL").GraphiQL},{"./components/GraphiQL":3}],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")}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function e(e,t){for(var r=0;r'+renderType(r.type)+"":"";o.innerHTML='
'+("

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

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

",t&&t(o)})}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 _codemirror=require("codemirror"),_codemirror2=_interopRequireDefault(_codemirror),_graphql=require("graphql"),_marked=require("marked"),_marked2=_interopRequireDefault(_marked)},{codemirror:59,graphql:152,marked:214}],18:[function(require,module,exports){module.exports={default:require("core-js/library/fn/array/from"),__esModule:!0}},{"core-js/library/fn/array/from":61}],19:[function(require,module,exports){module.exports={default:require("core-js/library/fn/get-iterator"),__esModule:!0}},{"core-js/library/fn/get-iterator":62}],20:[function(require,module,exports){module.exports={default:require("core-js/library/fn/is-iterable"),__esModule:!0}},{"core-js/library/fn/is-iterable":63}],21:[function(require,module,exports){module.exports={default:require("core-js/library/fn/map"),__esModule:!0}},{"core-js/library/fn/map":64}],22:[function(require,module,exports){module.exports={default:require("core-js/library/fn/object/assign"),__esModule:!0}},{"core-js/library/fn/object/assign":65}],23:[function(require,module,exports){module.exports={default:require("core-js/library/fn/object/create"),__esModule:!0}},{"core-js/library/fn/object/create":66}],24:[function(require,module,exports){module.exports={default:require("core-js/library/fn/object/define-property"),__esModule:!0}},{"core-js/library/fn/object/define-property":67}],25:[function(require,module,exports){module.exports={default:require("core-js/library/fn/object/get-own-property-descriptor"),__esModule:!0}},{"core-js/library/fn/object/get-own-property-descriptor":68}],26:[function(require,module,exports){module.exports={default:require("core-js/library/fn/object/keys"),__esModule:!0}},{"core-js/library/fn/object/keys":69}],27:[function(require,module,exports){module.exports={default:require("core-js/library/fn/object/set-prototype-of"),__esModule:!0}},{"core-js/library/fn/object/set-prototype-of":70}],28:[function(require,module,exports){module.exports={default:require("core-js/library/fn/promise"),__esModule:!0}},{"core-js/library/fn/promise":71}],29:[function(require,module,exports){module.exports={default:require("core-js/library/fn/set"),__esModule:!0}},{"core-js/library/fn/set":72}],30:[function(require,module,exports){"use strict";exports.default=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},exports.__esModule=!0},{}],31:[function(require,module,exports){"use strict";var _Object$defineProperty=require("babel-runtime/core-js/object/define-property").default;exports.default=function(){function e(e,r){for(var t=0;t=0;a--)e(r[a])}exports.__esModule=!0,exports.default=forEachState,module.exports=exports.default},{}],43:[function(require,module,exports){"use strict";function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function hintList(t,r,e,n,i){var o=filterAndSortList(i,normalizeText(n.string));if(o){var l=null!==n.type&&/"|\w/.test(n.string[0])?n.start:n.end,u={list:o,from:_codemirror2.default.Pos(e.line,l),to:_codemirror2.default.Pos(e.line,n.end)};return _codemirror2.default.signal(t,"hasCompletion",t,u,n),u}}function filterAndSortList(t,r){var e=r?t.map(function(t){return{proximity:getProximity(normalizeText(t.text),r),entry:t}}).filter(function(t){return t.proximity<=2}).sort(function(t,r){return t.proximity-r.proximity||t.entry.text.length-r.entry.text.length}).map(function(t){return t.entry}):t;return e.length>0?e:t}function normalizeText(t){return t.toLowerCase().replace(/\W/g,"")}function getProximity(t,r){var e=lexicalDistance(r,t);return t.length>r.length&&(e-=t.length-r.length-1,e+=0===t.indexOf(r)?0:.5),e}function lexicalDistance(t,r){var e=void 0,n=void 0,i=[],o=t.length,l=r.length;for(e=0;o>=e;e++)i[e]=[e];for(n=1;l>=n;n++)i[0][n]=n;for(e=1;o>=e;e++)for(n=1;l>=n;n++){var u=t[e-1]===r[n-1]?0:1;i[e][n]=Math.min(i[e-1][n]+1,i[e][n-1]+1,i[e-1][n-1]+u),e>1&&n>1&&t[e-1]===r[n-2]&&t[e-2]===r[n-1]&&(i[e][n]=Math.min(i[e][n],i[e-2][n-2]+u))}return i[o][l]}exports.__esModule=!0,exports.default=hintList;var _codemirror=require("codemirror"),_codemirror2=_interopRequireDefault(_codemirror);module.exports=exports.default},{codemirror:59}],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){return kind===e?(lex(),!0):void 0}function ch(){strLen>end&&(end++,code=end===strLen?0:string.charCodeAt(end))}function lex(){for(lastEnd=end;9===code||10===code||13===code||32===code;)ch();if(0===code)return void(kind="EOF");switch(start=end,code){case 34:return kind="String",readString();case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return kind="Number",readNumber();case 102:if("false"!==string.slice(start,start+5))break;return end+=4,ch(),void(kind="Boolean");case 110:if("null"!==string.slice(start,start+4))break;return end+=3,ch(),void(kind="Null");case 116:if("true"!==string.slice(start,start+4))break;return end+=3,ch(),void(kind="Boolean")}kind=string[start],ch()}function readString(){for(ch();34!==code&&code>31;)if(ch(),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.");if(34===code)return void ch();throw syntaxError("Unterminated string.")}function readHex(){if(code>=48&&57>=code||code>=65&&70>=code||code>=97&&102>=code)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(48>code||code>57)throw syntaxError("Expected decimal digit.");do ch();while(code>=48&&57>=code)}exports.__esModule=!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;module.exports=exports.default},{}],45:[function(require,module,exports){"use strict";function onlineParser(e){var t=e.eatWhitespace,n=e.LexRules,r=e.ParseRules;return{startState:function(){var e={level:0};return pushRule(r,e,"Document"),e},getToken:function(e){function t(t,n){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(e,u){return getToken(t,n,r,this,e,u)})}}function opt(e){return{ofRule:e}}function list(e,t){return{ofRule:e,isList:!0,separator:t}}function butNot(e,t){var n=e.match;return e.match=function(e){return n(e)&&t.every(function(t){return!t.match(e)})},e}function t(e,t){return{style:t,match:function(t){return t.kind===e}}}function p(e,t){return{style:t||"punctuation",match:function(t){return"Punctuation"===t.kind&&t.value===e}}}function getToken(e,t,n,r,u,a){if(a.needsAdvance&&(a.needsAdvance=!1,advanceRule(a,!0)),u.sol()&&(a.indentLevel=Math.floor(u.indentation()/r.config.tabSize)),e(u))return"ws";if(r.lineComment&&u.match(r.lineComment))return u.skipToEnd(),"comment";var s=lex(t,u);if(!s)return u.match(/\S+/),"invalidchar";if(saveState(a),"Punctuation"===s.kind)if(/^[{([]/.test(s.value))a.levels=(a.levels||[]).concat(a.indentLevel+1);else if(/^[})\]]/.test(s.value)){var i=a.levels=(a.levels||[]).slice(0,-1);i.length>0&&i[i.length-1]=0;a--){var m=o[a].from(),c=o[a].to();m.line>=i||(c.line>=i&&(c=l(i,0)),i=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,o,r){r||(r=t);var a=this,m=a.getModeAt(e),c=r.lineComment||m.lineComment;if(!c)return void((r.blockCommentStart||m.blockCommentStart)&&(r.fullLines=!0,a.blockComment(e,o,r)));var f=a.getLine(e.line);if(null!=f){var g=Math.min(0!=o.ch||o.line==e.line?o.line+1:o.line,a.lastLine()+1),s=null==r.padding?" ":r.padding,d=r.commentBlankLines||e.line==o.line;a.operation(function(){if(r.indent){ -for(var t=null,o=e.line;g>o;++o){var m=a.getLine(o),f=m.slice(0,n(m));(null==t||t.length>f.length)&&(t=f)}for(var o=e.line;g>o;++o){var m=a.getLine(o),u=t.length;(d||i.test(m))&&(m.slice(0,u)!=t&&(u=n(m)),a.replaceRange(t+c+s,l(o,0),l(o,u)))}}else for(var o=e.line;g>o;++o)(d||i.test(a.getLine(o)))&&a.replaceRange(c+s,l(o,0))})}}),e.defineExtension("blockComment",function(e,n,o){o||(o=t);var r=this,a=r.getModeAt(e),m=o.blockCommentStart||a.blockCommentStart,c=o.blockCommentEnd||a.blockCommentEnd;if(!m||!c)return void((o.lineComment||a.lineComment)&&0!=o.fullLines&&r.lineComment(e,n,o));var f=Math.min(n.line,r.lastLine());f!=e.line&&0==n.ch&&i.test(r.getLine(f))&&--f;var g=null==o.padding?" ":o.padding;e.line>f||r.operation(function(){if(0!=o.fullLines){var t=i.test(r.getLine(f));r.replaceRange(g+c,l(f)),r.replaceRange(m+g,l(e.line,0));var s=o.blockCommentLead||a.blockCommentLead;if(null!=s)for(var d=e.line+1;f>=d;++d)(d!=f||t)&&r.replaceRange(s+g,l(d,0))}else r.replaceRange(c,n),r.replaceRange(m,e)})}),e.defineExtension("uncomment",function(e,n,o){o||(o=t);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=o.lineComment||m.lineComment,s=[],d=null==o.padding?" ":o.padding;e:if(g){for(var u=f;c>=u;++u){var h=a.getLine(u),v=h.indexOf(g);if(v>-1&&!/comment/.test(a.getTokenTypeAt(l(u,v+1)))&&(v=-1),-1==v&&(u!=c||u==f)&&i.test(h))break e;if(v>-1&&i.test(h.slice(0,v)))break e;s.push(h)}if(a.operation(function(){for(var e=f;c>=e;++e){var n=s[e-f],t=n.indexOf(g),i=t+g.length;0>t||(n.slice(i,i+d.length)==d&&(i+=d.length),r=!0,a.replaceRange("",l(e,t),l(e,i)))}}),r)return!0}var C=o.blockCommentStart||m.blockCommentStart,p=o.blockCommentEnd||m.blockCommentEnd;if(!C||!p)return!1;var b=o.blockCommentLead||m.blockCommentLead,k=a.getLine(f),L=c==f?k:a.getLine(c),x=k.indexOf(C),R=L.lastIndexOf(p);if(-1==R&&f!=c&&(L=a.getLine(--c),R=L.lastIndexOf(p)),-1==x||-1==R||!/comment/.test(a.getTokenTypeAt(l(f,x+1)))||!/comment/.test(a.getTokenTypeAt(l(c,R+1))))return!1;var O=k.lastIndexOf(C,e.ch),E=-1==O?-1:k.slice(0,e.ch).indexOf(p,O+C.length);if(-1!=O&&-1!=E&&E+p.length!=e.ch)return!1;E=L.indexOf(p,n.ch);var M=L.slice(n.ch).lastIndexOf(C,E-n.ch);return O=-1==E||-1==M?-1:n.ch+M,-1!=E&&-1!=O&&O!=n.ch?!1:(a.operation(function(){a.replaceRange("",l(c,R-(d&&L.slice(R-d.length,R)==d?d.length:0)),l(c,R+p.length));var e=x+C.length;if(d&&k.slice(e,e+d.length)==d&&(e+=d.length),a.replaceRange("",l(f,x),l(f,e)),b)for(var n=f+1;c>=n;++n){var t=a.getLine(n),o=t.indexOf(b);if(-1!=o&&!i.test(t.slice(0,o))){var r=o+b.length;d&&t.slice(r,r+d.length)==d&&(r+=d.length),a.replaceRange("",l(n,o),l(n,r))}}}),!0)})})},{"../../lib/codemirror":59}],50:[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 t(e,t){return"pairs"==t&&"string"==typeof e?e:"object"==typeof e&&null!=e[t]?e[t]:u[t]}function n(e){return function(t){return s(t,e)}}function r(e){var t=e.state.closeBrackets;if(!t)return null;var n=e.getModeAt(e.getCursor());return n.closeBrackets||t}function i(n){var i=r(n);if(!i||n.getOption("disableInput"))return e.Pass;for(var a=t(i,"pairs"),o=n.listSelections(),s=0;s=0;s--){var f=o[s].head;n.replaceRange("",h(f.line,f.ch-1),h(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 h(t.anchor.line,t.anchor.ch+(n?-1:1)),head:new h(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"),c=s.indexOf(i);if(-1==c)return e.Pass;for(var u,d,g=t(a,"triples"),p=s.charAt(c+1)==i,v=n.listSelections(),m=c%2==0,b=0;b1&&g.indexOf(i)>=0&&n.getRange(h(P.line,P.ch-2),P)==i+i&&(P.ch<=2||n.getRange(h(P.line,P.ch-3),h(P.line,P.ch-2))!=i))x="addFour";else if(p){if(e.isWordChar(d)||!f(n,P,i))return e.Pass;x="both"}else{if(!m||n.getLine(P.line).length!=P.ch&&!l(d,s)&&!/\s/.test(d))return e.Pass;x="both"}else x=g.indexOf(i)>=0&&n.getRange(P,h(P.line,P.ch+3))==i+i+i?"skipThree":"skip";if(u){if(u!=x)return e.Pass}else u=x}var S=c%2?s.charAt(c-1):i,k=c%2?i:s.charAt(c+1);n.operation(function(){if("skip"==u)n.execCommand("goCharRight");else if("skipThree"==u)for(var e=0;3>e;e++)n.execCommand("goCharRight");else if("surround"==u){for(var t=n.getSelections(),e=0;e-1&&n%2==1}function c(e,t){var n=e.getRange(h(t.line,t.ch-1),h(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}}var u={pairs:"()[]{}''\"\"",triples:"",explode:"[]{}"},h=e.Pos;e.defineOption("autoCloseBrackets",!1,function(t,n,r){r&&r!=e.Init&&(t.removeKeyMap(g),t.state.closeBrackets=null),n&&(t.state.closeBrackets=n,t.addKeyMap(g))});for(var d=u.pairs+"`",g={Backspace:i,Enter:a},p=0;p=0&&c[o.text.charAt(f)]||c[o.text.charAt(++f)];if(!l)return null;var u=">"==l.charAt(1)?1:-1;if(i&&u>0!=(f==t.ch))return null;var h=e.getTokenTypeAt(a(t.line,f+1)),s=n(e,a(t.line,f+(u>0?1:0)),u,h||null,r);return null==s?null:{from:a(t.line,f),to:s&&s.pos,match:s&&s.ch==l.charAt(0),forward:u>0}}function n(e,t,n,i,r){for(var o=r&&r.maxScanLineLength||1e4,f=r&&r.maxScanLines||1e3,l=[],u=r&&r.bracketRegex?r.bracketRegex:/[(){}[\]]/,h=n>0?Math.min(t.line+f,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-f),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-(0>n?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)l.push(p);else{if(!l.length)return{pos:a(s,d),ch:p};l.pop()}}}}}return s-n==(n>0?e.lastLine():e.firstLine())?!1:null}function i(e,n,i){for(var r=e.state.matchBrackets.maxHighlightLineLength||1e3,c=[],f=e.listSelections(),l=0;l",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},f=null;e.defineOption("matchBrackets",!1,function(t,n,i){i&&i!=e.Init&&t.off("cursorActivity",r),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":59}],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";e.registerHelper("fold","brace",function(r,n){function t(t){for(var i=n.ch,s=0;;){var u=0>=i?-1:f.lastIndexOf(t,i-1);if(-1!=u){if(1==s&&u=v;++v)for(var p=r.getLine(v),m=v==l?i:0;;){var P=p.indexOf(s,m),k=p.indexOf(u,m);if(0>P&&(P=p.length),0>k&&(k=p.length),m=Math.min(P,k),m==p.length)break;if(r.getTokenTypeAt(e.Pos(v,m+1))==o)if(m==P)++c;else if(!--c){a=v,d=m;break e}++m}if(null!=a&&(l!=a||d!=i))return{from:e.Pos(l,i),to:e.Pos(a,d)}}}),e.registerHelper("fold","import",function(r,n){function t(n){if(nr.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);o>=i;++i){var l=r.getLine(i),f=l.indexOf(";");if(-1!=f)return{startCh:t.end,end:e.Pos(i,f)}}}var i,n=n.line,o=t(n);if(!o||t(n-1)||(i=t(n-2))&&i.end.line==n-1)return null;for(var l=o.end;;){var f=t(l.line+1);if(null==f)break;l=f.end}return{from:r.clipPos(e.Pos(n,o.startCh+1)),to:l}}),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 n=n.line,i=t(n);if(null==i||null!=t(n-1))return null;for(var o=n;;){var l=t(o+1);if(null==l)break;++o}return{from:e.Pos(n,i+1),to:r.clipPos(e.Pos(o))}})})},{"../../lib/codemirror":59}],53:[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,f){function l(n){var e=d(o,i);if(!e||e.to.line-e.from.lineo.firstLine();)i=n.Pos(i.line-1,0),a=l(!1);if(a&&!a.cleared&&"unfold"!==f){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:!0,__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=e;e++)o.foldCode(n.Pos(e,0),null,"fold")})},n.commands.unfoldAll=function(o){o.operation(function(){for(var e=o.firstLine(),r=o.lastLine();r>=e;e++)o.foldCode(n.Pos(e,0),null,"unfold")})},n.registerHelper("fold","combine",function(){var n=Array.prototype.slice.call(arguments,0);return function(o,e){for(var r=0;r=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 p)o[s]=p[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,f=0;f0){var A=C.bottom-C.top,x=g.top-(g.bottom-C.top);if(x-A>0)h.style.top=(y=g.top-A)+"px",w=!1;else if(A>H){h.style.height=H-5+"px",h.style.top=(y=g.bottom-C.top)+"px";var S=r.getCursor();e.from.ch!=S.ch&&(g=r.cursorCoords(S),h.style.left=(v=g.left)+"px",C=h.getBoundingClientRect())}}var T=C.right-k;if(T>0&&(C.right-C.left>k&&(h.style.width=k-5+"px",T-=C.right-C.left-k),h.style.left=(v=g.left-T)+"px"),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 M;r.on("blur",this.onBlur=function(){M=setTimeout(function(){i.close()},100)}),r.on("focus",this.onFocus=function(){clearTimeout(M)})}var F=r.getScrollInfo();return r.on("scroll",this.onScroll=function(){var t=r.getScrollInfo(),e=r.getWrapperElement().getBoundingClientRect(),n=y+F.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+F.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;n1)){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:0>i&&(i=e?0:this.data.list.length-1),this.selectedHint!=i){var n=this.hints.childNodes[this.selectedHint];n.className=n.className.replace(" "+u,""),n=this.hints.childNodes[this.selectedHint=i],n.className+=" "+u,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:l}),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":59}],56:[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),u=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}}return l?void 0:clearInterval(u)},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;i-1)return f=n(h,c,f),{from:i(o.line,f),to:i(o.line,f+s.length)}}else{var h=e.getLine(o.line).slice(o.ch),c=l(h),f=c.indexOf(t);if(f>-1)return f=n(h,c,f)+o.ch,{from:i(o.line,f),to:i(o.line,f+s.length)}}}:this.matches=function(){};else{var c=s.split("\n");this.matches=function(t,n){var r=h.length-1;if(t){if(n.line-(h.length-1)=1;--f,--s)if(h[f]!=l(e.getLine(s)))return;var u=e.getLine(s),a=u.length-c[0].length;if(l(u.slice(a))!=h[0])return;return{from:i(s,a),to:o}}if(!(n.line+(h.length-1)>e.lastLine())){var u=e.getLine(n.line),a=u.length-c[0].length;if(l(u.slice(a))==h[0]){for(var g=i(n.line,a),s=n.line+1,f=1;r>f;++f,++s)if(h[f]!=l(e.getLine(s)))return;if(l(e.getLine(s).slice(0,c[r].length))==h[r])return{from:g,to:i(s,c[r].length)}}}}}}}function n(e,t,n){if(e.length==t.length)return n;for(var i=Math.min(n,e.length);;){var r=e.slice(0,i).toLowerCase().length;if(n>r)++i;else{if(!(r>n))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(){return this.atOccurrence?this.pos.from:void 0},to:function(){return this.atOccurrence?this.pos.to:void 0},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":59}],58:[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(0>r&&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=0>r?0:o.length,c=0;l!=s;l+=r,c++){var f=o.charAt(0>r?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&&0>r&&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):0>n?r.from():r.to()})}function r(t,n){return t.isReadOnly()?e.Pass:void t.operation(function(){for(var e=t.listSelections().length,r=[],o=-1,i=0;e>i;i++){var a=t.listSelections()[i].head;if(!(a.line<=o)){var l=h(a.line+(n?0:1),0);t.replaceRange("\n",l,null,"+insertLine"),t.indentLine(l.line,null,!0),r.push({head:l,anchor:l}),o=a.line+1}}t.setSelections(r)})}function o(t,n){for(var r=n.ch,o=r,i=t.getLine(n.line);r&&e.isWordChar(i.charAt(r-1));)--r;for(;oe?-1:e==t?0:1}),t.replaceRange(f,s,c),r&&e.push({anchor:s,head:c})}r&&t.setSelections(e,0)})}function l(t,n){t.operation(function(){for(var r=t.listSelections(),i=[],a=[],l=0;l=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-";u[f["Alt-Left"]="goSubwordLeft"]=function(e){n(e,-1)},u[f["Alt-Right"]="goSubwordRight"]=function(e){n(e,1)};var m=d?"Ctrl-Alt-":"Ctrl-";u[f[m+"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[m+"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[v+"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--,o>l?r.push(l,s):r.length&&(r[r.length-1]=s),o=s}t.operation(function(){for(var e=r.length-2;e>=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;rn;n++){var r=e.listSelections()[n];r.empty()?e.replaceRange(e.getLine(r.head.line)+"\n",h(r.head.line,0)):e.replaceRange(e.getRange(r.from(),r.to()),r.from())}e.scrollIntoView()})},f[p+"T"]="transposeChars",u[f.F9="sortLines"]=function(e){a(e,!0)},u[f[p+"F9"]="sortLinesInsensitive"]=function(e){a(e,!1)},u[f.F2="nextBookmark"]=function(e){var t=e.state.sublimeBookmarks;if(t)for(;t.length;){var n=t.shift(),r=n.find();if(r)return t.push(n),e.setSelection(r.from,r.to)}},u[f["Shift-F2"]="prevBookmark"]=function(e){var t=e.state.sublimeBookmarks;if(t)for(;t.length;){t.unshift(t.pop());var n=t[t.length-1].find();if(n)return e.setSelection(n.from,n.to);t.pop()}},u[f[p+"F2"]="toggleBookmark"]=function(e){for(var t=e.listSelections(),n=e.state.sublimeBookmarks||(e.state.sublimeBookmarks=[]),r=0;r=0;n--)e.replaceRange("",t[n].anchor,h(t[n].to().line),"+delete");e.scrollIntoView()})},u[f[S+p+"U"]="upcaseAtCursor"]=function(e){l(e,function(e){return e.toUpperCase()})},u[f[S+p+"L"]="downcaseAtCursor"]=function(e){l(e,function(e){return e.toLowerCase()})},u[f[S+p+"Space"]="setSublimeMark"]=function(e){e.state.sublimeMark&&e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor())},u[f[S+p+"A"]="selectToSublimeMark"]=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&e.setSelection(e.getCursor(),t)},u[f[S+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[S+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[S+p+"Y"]="sublimeYank"]=function(e){null!=e.state.sublimeKilled&&e.replaceSelection(e.state.sublimeKilled,null,"paste")},f[S+p+"G"]="clearBookmarks",u[f[S+p+"C"]="showInCenter"]=function(e){var t=e.cursorCoords(null,"local");e.scrollTo(null,(t.top+t.bottom)/2-e.getScrollInfo().clientHeight/2)},u[f["Shift-Alt-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["Shift-Alt-Down"]="selectLinesDownward"]=function(e){e.operation(function(){for(var t=e.listSelections(),n=0;nwo&&setTimeout(function(){a.display.input.reset(!0)},20),Ut(this),$i(),wt(this),this.curOp.forceUpdate=!0,qn(this,i),n.autofocus&&!Wo||a.hasFocus()?setTimeout(Fi(vr,this),20):mr(this);for(var c in el)el.hasOwnProperty(c)&&el[c](this,n[c],tl);C(this),n.finishInit&&n.finishInit(this);for(var h=0;hwo&&(n.gutters.style.zIndex=-1,n.scroller.style.paddingRight=0),xo||vo&&Wo||(n.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(n.wrapper):e(n.wrapper)),n.viewFrom=n.viewTo=t.first,n.reportedViewFrom=n.reportedViewTo=t.first,n.view=[],n.renderedView=null,n.externalMeasured=null,n.viewOffset=0,n.lastWrapHeight=n.lastWrapWidth=0,n.updateLineNumbers=null,n.nativeBarWidth=n.barHeight=n.barWidth=0,n.scrollbarsClipped=!1,n.lineNumWidth=n.lineNumInnerWidth=n.lineNumChars=null,n.alignWidgets=!1,n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null,n.maxLine=null,n.maxLineLength=0,n.maxLineChanged=!1,n.wheelDX=n.wheelDY=n.wheelStartX=n.wheelStartY=null,n.shift=!1,n.selForContextMenu=null,n.activeTouch=null,r.init(n)}function r(t){t.doc.mode=e.getMode(t.options,t.doc.modeOption),n(t)}function n(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.frontier=e.doc.first,Re(e,100),e.state.modeGen++,e.curOp&&Et(e)}function i(e){e.options.lineWrapping?(Zl(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(ql(e.display.wrapper,"CodeMirror-wrap"),f(e)),l(e),Et(e),st(e),setTimeout(function(){y(e)},100)}function o(e){var t=yt(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/bt(e.display)-3);return function(i){if(Cn(e.doc,i))return 0;var o=0;if(i.widgets)for(var l=0;lt.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)})}function d(e){var t=Hi(e.gutters,"CodeMirror-linenumbers");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function p(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+Ke(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:n,scrollHeight:n+Xe(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}function g(e,t,r){this.cm=r;var n=this.vert=Ui("div",[Ui("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=Ui("div",[Ui("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(n),e(i),Wl(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),Wl(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,bo&&8>wo&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function v(){}function m(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&ql(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new e.scrollbarModel[t.options.scrollbarStyle](function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),Wl(e,"mousedown",function(){t.state.focused&&setTimeout(function(){t.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,r){"horizontal"==r?ir(t,e):nr(t,e)},t),t.display.scrollbars.addClass&&Zl(t.display.wrapper,t.display.scrollbars.addClass)}function y(e,t){t||(t=p(e));var r=e.display.barWidth,n=e.display.barHeight;b(e,t);for(var i=0;4>i&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&O(e),b(e,p(e)),r=e.display.barWidth,n=e.display.barHeight}function b(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}function w(e,t,r){var n=r&&null!=r.top?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-Ve(e));var i=r&&null!=r.bottom?r.bottom:n+e.wrapper.clientHeight,o=ri(t,n),l=ri(t,i);if(r&&r.ensure){var s=r.ensure.from.line,a=r.ensure.to.line;o>s?(o=s,l=ri(t,ni(Zn(t,s))+e.wrapper.clientHeight)):Math.min(a,t.lastLine())>=l&&(o=ri(t,ni(Zn(t,a))-e.wrapper.clientHeight),l=a)}return{from:o,to:Math.max(l,o+1)}}function x(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=L(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",l=0;l=r.viewFrom&&t.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==Gt(e))return!1;C(e)&&(zt(e),t.dims=H(e));var i=n.first+n.size,o=Math.max(t.visible.from-e.options.viewportMargin,n.first),l=Math.min(i,t.visible.to+e.options.viewportMargin);r.viewFroml&&r.viewTo-l<20&&(l=Math.min(i,r.viewTo)),Io&&(o=wn(e.doc,o),l=xn(e.doc,l));var s=o!=r.viewFrom||l!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;Bt(e,o,l),r.viewOffset=ni(Zn(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var a=Gt(e);if(!s&&0==a&&!t.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var u=ji();return a>4&&(r.lineDiv.style.display="none"),P(e,r.updateLineNumbers,t.dims),a>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,u&&ji()!=u&&u.offsetHeight&&u.focus(),Vi(r.cursorDiv),Vi(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,s&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,Re(e,400)),r.updateLineNumbers=null,!0}function N(e,t){for(var r=t.viewport,n=!0;(n&&e.options.lineWrapping&&t.oldDisplayWidth!=Ye(e)||(r&&null!=r.top&&(r={top:Math.min(e.doc.height+Ke(e.display)-_e(e),r.top)}),t.visible=w(e.display,e.doc,r),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&M(e,t);n=!1){O(e);var i=p(e);Pe(e),y(e,i),A(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 W(e,t){var r=new T(e,t);if(M(e,r)){O(e),N(e,r);var n=p(e);Pe(e),y(e,n),A(e,n),r.finish()}}function A(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+Xe(e)+"px"}function O(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;nwo){var l=o.node.offsetTop+o.node.offsetHeight;i=l-r,r=l}else{var s=o.node.getBoundingClientRect();i=s.bottom-s.top}var a=o.line.height-i;if(2>i&&(i=yt(t)),(a>.001||-.001>a)&&(ei(o.line,i),D(o.line),o.rest))for(var u=0;u=t&&h.lineNumber;h.changes&&(Hi(h.changes,"gutter")>-1&&(f=!1),E(e,h,u,r)),f&&(Vi(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(S(e.options,u)))),s=h.node.nextSibling}else{var d=V(e,h,u,r);l.insertBefore(d,s)}u+=h.size}for(;s;)s=n(s)}function E(e,t,r,n){for(var i=0;iwo&&(e.node.style.zIndex=2)),e.node}function z(e){var t=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;if(t&&(t+=" CodeMirror-linebackground"),e.background)t?e.background.className=t:(e.background.parentNode.removeChild(e.background),e.background=null);else if(t){var r=I(e);e.background=r.insertBefore(Ui("div",null,t),r.firstChild)}}function F(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):Fn(e,t)}function R(e,t){var r=t.text.className,n=F(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,B(t)):r&&(t.text.className=r)}function B(e){z(e),e.line.wrapClass?I(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var t=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=t||""}function G(e,t,r,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=I(t);t.gutterBackground=Ui("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var i=I(t),l=t.gutter=Ui("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(l),i.insertBefore(l,t.text),t.line.gutterClass&&(l.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=l.appendChild(Ui("div",S(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var s=0;s1)if(Ro&&Ro.join("\n")==t){if(n.ranges.length%Ro.length==0){a=[];for(var u=0;u=0;u--){var c=n.ranges[u],h=c.from(),f=c.to();c.empty()&&(r&&r>0?h=zo(h.line,h.ch-r):e.state.overwrite&&!l&&(f=zo(f.line,Math.min(Zn(o,f.line).text.length,f.ch+Di(s).length))));var d=e.curOp.updateInput,p={from:h,to:f,text:a?a[u%a.length]:s,origin:i||(l?"paste":e.state.cutIncoming?"cut":"+input")};Tr(e.doc,p),Li(e,"inputRead",e,p)}t&&!l&&J(e,t),zr(e),e.curOp.updateInput=d,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function Q(e,t){var r=e.clipboardData&&e.clipboardData.getData("text/plain");return r?(e.preventDefault(),t.isReadOnly()||t.options.disableInput||Wt(t,function(){Z(t,r,0,null,"paste")}),!0):void 0}function J(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=Rr(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Zn(e.doc,i.head.line).text.slice(0,i.head.ch))&&(l=Rr(e,i.head.line,"smart"));l&&Li(e,"electricInput",e,i.head.line)}}}function ee(e){for(var t=[],r=[],n=0;ni?u.map:c[i],l=0;li?e.line:e.rest[i]),h=o[l]+n;return(0>n||s!=t)&&(h=o[l+(n?1:0)]),zo(a,h)}}}var i=e.text.firstChild,o=!1;if(!t||!Yl(i,t))return le(zo(ti(e.line),0),!0);if(t==i&&(o=!0,t=i.childNodes[r],r=0,!t)){var l=e.rest?Di(e.rest):e.line;return le(zo(ti(l),l.text.length),o)}var s=3==t.nodeType?t:null,a=t;for(s||1!=t.childNodes.length||3!=t.firstChild.nodeType||(s=t.firstChild,r&&(r=s.nodeValue.length));a.parentNode!=i;)a=a.parentNode;var u=e.measure,c=u.maps,h=n(s,a,r);if(h)return le(h,o);for(var f=a.nextSibling,d=s?s.nodeValue.length-r:0;f;f=f.nextSibling){if(h=n(f,f.firstChild,0))return le(zo(h.line,h.ch-d),o);d+=f.textContent.length}for(var p=a.previousSibling,d=r;p;p=p.previousSibling){if(h=n(p,p.firstChild,-1))return le(zo(h.line,h.ch+d),o);d+=f.textContent.length}}function ue(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""==r&&(r=t.textContent.replace(/\u200b/g,"")),void(s+=r);var c,h=t.getAttribute("cm-marker");if(h){var f=e.findMarks(zo(n,0),zo(i+1,0),o(+h));return void(f.length&&(c=f[0].find())&&(s+=Qn(e.doc,c.from,c.to).join(u)))}if("false"==t.getAttribute("contenteditable"))return;for(var d=0;d=0){var l=$(o.from(),i.from()),s=_(o.to(),i.to()),a=o.empty()?i.from()==i.head:o.from()==o.head;t>=n&&--t,e.splice(--n,2,new he(a?s:l,a?l:s))}}return new ce(e,t)}function de(e,t){return new ce([new he(e,t||e)],0)}function pe(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function ge(e,t){if(t.liner?zo(r,Zn(e,r).text.length):ve(t,Zn(e,t.line).text.length)}function ve(e,t){var r=e.ch;return null==r||r>t?zo(e.line,t):0>r?zo(e.line,0):e}function me(e,t){return t>=e.first&&t=t.ch:s.to>t.ch))){if(i&&(Dl(a,"beforeCursorEnter"),a.explicitlyCleared)){if(o.markedSpans){--l;continue}break}if(!a.atomic)continue;if(r){var u,c=a.find(0>n?1:-1);if((0>n?a.inclusiveRight:a.inclusiveLeft)&&(c=He(e,c,-n,c&&c.line==t.line?o:null)),c&&c.line==t.line&&(u=Fo(c,r))&&(0>n?0>u:u>0))return Oe(e,c,t,n,i)}var h=a.find(0>n?-1:1);return(0>n?a.inclusiveLeft:a.inclusiveRight)&&(h=He(e,h,n,h.line==t.line?o:null)),h?Oe(e,h,t,n,i):null}}return t}function De(e,t,r,n,i){var o=n||1,l=Oe(e,t,r,o,i)||!i&&Oe(e,t,r,o,!0)||Oe(e,t,r,-o,i)||!i&&Oe(e,t,r,-o,!0);return l?l:(e.cantEdit=!0,zo(e.first,0))}function He(e,t,r,n){return 0>r&&0==t.ch?t.line>e.first?ge(e,zo(t.line-1)):null:r>0&&t.ch==(n||Zn(e,t.line)).text.length?t.line=e.display.viewTo||s.to().linet&&(t=0),t=Math.round(t),n=Math.round(n),s.appendChild(Ui("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px; top: "+t+"px; width: "+(null==r?c-e:r)+"px; height: "+(n-t)+"px"))}function i(t,r,i){function o(r,n){return ft(e,zo(t,r),"div",h,n)}var s,a,h=Zn(l,t),f=h.text.length;return eo(ii(h),r||0,null==i?f:i,function(e,t,l){var h,d,p,g=o(e,"left");if(e==t)h=g,d=p=g.left;else{if(h=o(t-1,"right"),"rtl"==l){var v=g;g=h,h=v}d=g.left,p=h.right}null==r&&0==e&&(d=u),h.top-g.top>3&&(n(d,g.top,null,g.bottom),d=u,g.bottoma.bottom||h.bottom==a.bottom&&h.right>a.right)&&(a=h),u+1>d&&(d=u),n(d,h.top,p-d,h.bottom)}),{start:s,end:a}}var o=e.display,l=e.doc,s=document.createDocumentFragment(),a=je(e.display),u=a.left,c=Math.max(o.sizerWidth,Ye(e)-o.sizer.offsetLeft)-a.right,h=t.from(),f=t.to();if(h.line==f.line)i(h.line,h.ch,f.ch);else{var d=Zn(l,h.line),p=Zn(l,f.line),g=yn(d)==yn(p),v=i(h.line,h.ch,g?d.text.length+1:null).end,m=i(f.line,g?0:null,f.ch).start;g&&(v.top0?t.blinker=setInterval(function(){t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Re(e,t){e.doc.mode.startState&&e.doc.frontier=e.display.viewTo)){var r=+new Date+e.options.workTime,n=sl(t.mode,Ue(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=Pn(e,o,s?sl(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 h=!l||l.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),f=0;!h&&fr?(Re(e,e.options.workDelay),!0):void 0}),i.length&&Wt(e,function(){for(var t=0;tl;--s){if(s<=o.first)return o.first;var a=Zn(o,s-1);if(a.stateAfter&&(!r||s<=o.frontier))return s;var u=Rl(a.text,null,e.options.tabSize);(null==i||n>u)&&(i=s-1,n=u)}return i}function Ue(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return!0;var o=Ge(e,t,r),l=o>n.first&&Zn(n,o-1).stateAfter;return l=l?sl(n.mode,l):al(n.mode),n.iter(o,t,function(r){In(e,r.text,l);var s=o==t-1||o%5==0||o>=i.viewFrom&&o2&&o.push((a.bottom+u.top)/2-r.top)}}o.push(r.bottom-r.top)}}function qe(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[n],cache:e.measure.caches[n],before:!0}}function Ze(e,t){t=yn(t);var r=ti(t),n=e.display.externalMeasured=new Ht(e.doc,t,r);n.lineN=r;var i=n.built=Fn(e,n);return n.text=i.pre,Ki(e.display.lineMeasure,i.pre),n}function Qe(e,t,r,n){return tt(e,et(e,t),r,n)}function Je(e,t){if(t>=e.display.viewFrom&&t=r.lineN&&tt?(i=0,o=1,l="left"):u>t?(i=t-a,o=i+1):(s==e.length-3||t==u&&e[s+3]>t)&&(o=u-a,i=o-1,t>=u&&(l="right")),null!=i){if(n=e[s+2],a==u&&r==(n.insertLeft?"left":"right")&&(l=r),"left"==r&&0==i)for(;s&&e[s-2]==e[s-3]&&e[s-1].insertLeft;)n=e[(s-=3)+2],l="left";if("right"==r&&i==u-a)for(;sc;c++){for(;s&&Gi(t.line.text.charAt(o.coverStart+s));)--s;for(;o.coverStart+awo&&0==s&&a==o.coverEnd-o.coverStart)i=l.parentNode.getBoundingClientRect();else if(bo&&e.options.lineWrapping){var h=Vl(l,s,a).getClientRects();i=h.length?h["right"==n?h.length-1:0]:Vo}else i=Vl(l,s,a).getBoundingClientRect()||Vo;if(i.left||i.right||0==s)break;a=s,s-=1,u="right"}bo&&11>wo&&(i=it(e.display.measure,i))}else{s>0&&(u=n="right");var h;i=e.options.lineWrapping&&(h=l.getClientRects()).length>1?h["right"==n?h.length-1:0]:l.getBoundingClientRect()}if(bo&&9>wo&&!s&&(!i||!i.left&&!i.right)){var f=l.parentNode.getClientRects()[0];i=f?{left:f.left,right:f.left+bt(e.display),top:f.top,bottom:f.bottom}:Vo}for(var d=i.top-t.rect.top,p=i.bottom-t.rect.top,g=(d+p)/2,v=t.view.measure.heights,c=0;cr.from?l(e-1):l(e,n)}n=n||Zn(e.doc,t.line),i||(i=et(e,n));var a=ii(n),u=t.ch;if(!a)return l(u);var c=uo(a,u),h=s(u,c);return null!=os&&(h.other=s(u,os)),h}function pt(e,t){var r=0,t=ge(e.doc,t);e.options.lineWrapping||(r=bt(e.display)*t.ch);var n=Zn(e.doc,t.line),i=ni(n)+Ve(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function gt(e,t,r,n){var i=zo(e,t);return i.xRel=n,r&&(i.outside=!0),i}function vt(e,t,r){var n=e.doc;if(r+=e.display.viewOffset,0>r)return gt(n.first,0,!0,-1);var i=ri(n,r),o=n.first+n.size-1;if(i>o)return gt(n.first+n.size-1,Zn(n,o).text.length,!0,1);0>t&&(t=0);for(var l=Zn(n,i);;){var s=mt(e,l,i,t,r),a=vn(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=ti(l=u.to.line)}}function mt(e,t,r,n,i){function o(n){var i=dt(e,zo(r,n),"line",t,u);return s=!0,l>i.bottom?i.left-a:lv)return gt(r,d,m,1);for(;;){if(c?d==f||d==ho(t,f,1):1>=d-f){for(var y=p>n||v-n>=n-p?f:d,b=n-(y==f?p:v);Gi(t.text.charAt(y));)++y;var w=gt(r,y,y==f?g:m,-1>b?-1:b>1?1:0);return w}var x=Math.ceil(h/2),C=f+x;if(c){C=f;for(var S=0;x>S;++S)C=ho(t,C,1)}var L=o(C);L>n?(d=C,v=L,(m=s)&&(v+=1e3),h=x):(f=C,p=L,g=s,h-=x)}}function yt(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Bo){Bo=Ui("pre");for(var t=0;49>t;++t)Bo.appendChild(document.createTextNode("x")),Bo.appendChild(Ui("br"));Bo.appendChild(document.createTextNode("x"))}Ki(e.measure,Bo);var r=Bo.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),Vi(e.measure),r||1}function bt(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=Ui("span","xxxxxxxxxx"),r=Ui("pre",[t]);Ki(e.measure,r);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function wt(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:++jo},Ko?Ko.ops.push(e.curOp):e.curOp.ownsGroup=Ko={ops:[e.curOp],delayedCallbacks:[]}}function xt(e){var t=e.delayedCallbacks,r=0;do{for(;r=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new T(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Tt(e){e.updatedDisplay=e.mustUpdate&&M(e.cm,e.update)}function kt(e){var t=e.cm,r=t.display;e.updatedDisplay&&O(t),e.barMeasure=p(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Qe(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+Xe(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Ye(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function Mt(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLefto;o=n){var l=new Ht(e.doc,Zn(e.doc,o),o);n=o+l.size,i.push(l)}return i}function Et(e,t,r,n){null==t&&(t=e.doc.first),null==r&&(r=e.doc.first+e.doc.size),n||(n=0);var i=e.display;if(n&&rt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Io&&wn(e.doc,t)i.viewFrom?zt(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)zt(e);else if(t<=i.viewFrom){var o=Rt(e,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):zt(e)}else if(r>=i.viewTo){var o=Rt(e,t,t,-1);o?(i.view=i.view.slice(0,o.index),i.viewTo=o.lineN):zt(e)}else{var l=Rt(e,t,t,-1),s=Rt(e,r,r+n,1);l&&s?(i.view=i.view.slice(0,l.index).concat(Pt(e,l.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=n):zt(e)}var a=i.externalMeasured;a&&(r=i.lineN&&t=n.viewTo)){var o=n.view[Ft(e,t)];if(null!=o.node){var l=o.changes||(o.changes=[]);-1==Hi(l,r)&&l.push(r)}}}function zt(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Ft(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,0>t)return null;for(var r=e.display.view,n=0;nt)return n}function Rt(e,t,r,n){var i,o=Ft(e,t),l=e.display.view;if(!Io||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var s=0,a=e.display.viewFrom;o>s;s++)a+=l[s].size;if(a!=t){if(n>0){if(o==l.length-1)return null;i=a+l[o].size-t,o++}else i=a-t;t+=i,r+=i}for(;wn(e.doc,r)!=r;){if(o==(0>n?0:l.length-1))return null;r+=n*l[o-(0>n?1:0)].size,o+=n}return{index:o,lineN:r}}function Bt(e,t,r){var n=e.display,i=n.view;0==i.length||t>=n.viewTo||r<=n.viewFrom?(n.view=Pt(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=Pt(e,t,n.viewFrom).concat(n.view):n.viewFromr&&(n.view=n.view.slice(0,Ft(e,r)))),n.viewTo=r}function Gt(e){for(var t=e.display.view,r=0,n=0;n400}var i=e.display;Wl(i.scroller,"mousedown",At(e,Yt)),bo&&11>wo?Wl(i.scroller,"dblclick",At(e,function(t){if(!ki(e,t)){var r=Xt(e,t);if(r&&!Qt(e,t)&&!jt(e.display,t)){kl(t);var n=e.findWordAt(r);we(e.doc,n.anchor,n.head)}}})):Wl(i.scroller,"dblclick",function(t){ki(e,t)||kl(t)}),Po||Wl(i.scroller,"contextmenu",function(t){yr(e,t)});var o,l={end:0};Wl(i.scroller,"touchstart",function(t){if(!ki(e,t)&&!r(t)){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)}}),Wl(i.scroller,"touchmove",function(){i.activeTouch&&(i.activeTouch.moved=!0)}),Wl(i.scroller,"touchend",function(r){var o=i.activeTouch;if(o&&!jt(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 he(s,s):!o.prev.prev||n(o,o.prev.prev)?e.findWordAt(s):new he(zo(s.line,0),ge(e.doc,zo(s.line+1,0))),e.setSelection(l.anchor,l.head),e.focus(),kl(r)}t()}),Wl(i.scroller,"touchcancel",t),Wl(i.scroller,"scroll",function(){i.scroller.clientHeight&&(nr(e,i.scroller.scrollTop),ir(e,i.scroller.scrollLeft,!0),Dl(e,"scroll",e))}),Wl(i.scroller,"mousewheel",function(t){or(e,t)}),Wl(i.scroller,"DOMMouseScroll",function(t){or(e,t)}),Wl(i.wrapper,"scroll",function(){i.wrapper.scrollTop=i.wrapper.scrollLeft=0}),i.dragFunctions={enter:function(t){ki(e,t)||Nl(t)},over:function(t){ki(e,t)||(tr(e,t),Nl(t))},start:function(t){er(e,t)},drop:At(e,Jt),leave:function(t){ki(e,t)||rr(e)}};var s=i.input.getField();Wl(s,"keyup",function(t){dr.call(e,t)}),Wl(s,"keydown",At(e,hr)),Wl(s,"keypress",At(e,pr)),Wl(s,"focus",Fi(vr,e)),Wl(s,"blur",Fi(mr,e))}function Vt(t,r,n){var i=n&&n!=e.Init;if(!r!=!i){var o=t.display.dragFunctions,l=r?Wl:Ol;l(t.display.scroller,"dragstart",o.start),l(t.display.scroller,"dragenter",o.enter),l(t.display.scroller,"dragover",o.over),l(t.display.scroller,"dragleave",o.leave),l(t.display.scroller,"drop",o.drop)}}function Kt(e){var t=e.display;t.lastWrapHeight==t.wrapper.clientHeight&&t.lastWrapWidth==t.wrapper.clientWidth||(t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}function jt(e,t){for(var r=xi(t);r!=e.wrapper;r=r.parentNode)if(!r||1==r.nodeType&&"true"==r.getAttribute("cm-ignore-events")||r.parentNode==e.sizer&&r!=e.mover)return!0}function Xt(e,t,r,n){var i=e.display;if(!r&&"true"==xi(t).getAttribute("cm-not-content"))return null;var o,l,s=i.lineSpace.getBoundingClientRect();try{o=t.clientX-s.left,l=t.clientY-s.top}catch(t){return null}var a,u=vt(e,o,l);if(n&&1==u.xRel&&(a=Zn(e.doc,u.line).text).length==u.ch){var c=Rl(a,a.length,e.options.tabSize)-a.length;u=zo(u.line,Math.max(0,Math.round((o-je(e.display).left)/bt(e.display))-c))}return u}function Yt(e){var t=this,r=t.display;if(!(ki(t,e)||r.activeTouch&&r.input.supportsTouch())){if(r.shift=e.shiftKey,jt(r,e))return void(xo||(r.scroller.draggable=!1,setTimeout(function(){r.scroller.draggable=!0},100)));if(!Qt(t,e)){var n=Xt(t,e);switch(window.focus(),Ci(e)){case 1:t.state.selectingText?t.state.selectingText(e):n?_t(t,e,n):xi(e)==r.scroller&&kl(e);break;case 2:xo&&(t.state.lastMiddleDown=+new Date),n&&we(t.doc,n),setTimeout(function(){r.input.focus()},20),kl(e);break;case 3:Po?yr(t,e):gr(t)}}}}function _t(e,t,r){bo?setTimeout(Fi(q,e),0):e.curOp.focus=ji();var n,i=+new Date;Uo&&Uo.time>i-400&&0==Fo(Uo.pos,r)?n="triple":Go&&Go.time>i-400&&0==Fo(Go.pos,r)?(n="double",Uo={time:i,pos:r}):(n="single",Go={time:i,pos:r});var o,l=e.doc.sel,s=Ao?t.metaKey:t.ctrlKey;e.options.dragDrop&&Jl&&!e.isReadOnly()&&"single"==n&&(o=l.contains(r))>-1&&(Fo((o=l.ranges[o]).from(),r)<0||r.xRel>0)&&(Fo(o.to(),r)>0||r.xRel<0)?$t(e,t,r,s):qt(e,t,r,n,s)}function $t(e,t,r,n){var i=e.display,o=+new Date,l=At(e,function(s){xo&&(i.scroller.draggable=!1),e.state.draggingText=!1,Ol(document,"mouseup",l),Ol(i.scroller,"drop",l),Math.abs(t.clientX-s.clientX)+Math.abs(t.clientY-s.clientY)<10&&(kl(s),!n&&+new Date-200=p;p++){var m=Zn(u,p).text,y=Bl(m,a,o);a==d?i.push(new he(zo(p,y),zo(p,y))):m.length>y&&i.push(new he(zo(p,y),zo(p,Bl(m,d,o))))}i.length||i.push(new he(r,r)),ke(u,fe(f.ranges.slice(0,h).concat(i),h),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b=c,w=b.anchor,x=t;if("single"!=n){if("double"==n)var C=e.findWordAt(t);else var C=new he(zo(t.line,0),ge(u,zo(t.line+1,0)));Fo(C.anchor,w)>0?(x=C.head,w=$(b.from(),C.anchor)):(x=C.anchor,w=_(b.to(),C.head))}var i=f.ranges.slice(0);i[h]=new he(ge(u,w),x),ke(u,fe(i,h),zl)}}function l(t){var r=++y,i=Xt(e,t,!0,"rect"==n);if(i)if(0!=Fo(i,v)){e.curOp.focus=ji(),o(i);var s=w(a,u);(i.line>=s.to||i.linem.bottom?20:0;c&&setTimeout(At(e,function(){y==r&&(a.scroller.scrollTop+=c,l(t))}),50)}}function s(t){e.state.selectingText=!1,y=1/0,kl(t),a.input.focus(),Ol(document,"mousemove",b),Ol(document,"mouseup",x),u.history.lastSelOrigin=null}var a=e.display,u=e.doc;kl(t);var c,h,f=u.sel,d=f.ranges;if(i&&!t.shiftKey?(h=u.sel.contains(r),c=h>-1?d[h]:new he(r,r)):(c=u.sel.primary(),h=u.sel.primIndex),t.altKey)n="rect",i||(c=new he(r,r)),r=Xt(e,t,!0,!0),h=-1;else if("double"==n){var p=e.findWordAt(r);c=e.display.shift||u.extend?be(u,c,p.anchor,p.head):p}else if("triple"==n){var g=new he(zo(r.line,0),ge(u,zo(r.line+1,0)));c=e.display.shift||u.extend?be(u,c,g.anchor,g.head):g}else c=be(u,c,r);i?-1==h?(h=d.length,ke(u,fe(d.concat([c]),h),{scroll:!1,origin:"*mouse"})):d.length>1&&d[h].empty()&&"single"==n&&!t.shiftKey?(ke(u,fe(d.slice(0,h).concat(d.slice(h+1)),0),{scroll:!1,origin:"*mouse"}),f=u.sel):Ce(u,h,c,zl):(h=0,ke(u,new ce([c],0),zl),f=u.sel);var v=r,m=a.wrapper.getBoundingClientRect(),y=0,b=At(e,function(e){Ci(e)?l(e):s(e)}),x=At(e,s);e.state.selectingText=x,Wl(document,"mousemove",b),Wl(document,"mouseup",x)}function Zt(e,t,r,n){try{var i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&kl(t);var l=e.display,s=l.lineDiv.getBoundingClientRect();if(o>s.bottom||!Ni(e,r))return wi(t);o-=s.top-l.viewOffset;for(var a=0;a=i){var c=ri(e.doc,o),h=e.options.gutters[a];return Dl(e,r,e,c,h,t),wi(t)}}}function Qt(e,t){return Zt(e,t,"gutterClick",!0)}function Jt(e){var t=this;if(rr(t),!ki(t,e)&&!jt(t.display,e)){kl(e),bo&&(Xo=+new Date);var r=Xt(t,e,!0),n=e.dataTransfer.files;if(r&&!t.isReadOnly())if(n&&n.length&&window.FileReader&&window.File)for(var i=n.length,o=Array(i),l=0,s=function(e,n){if(!t.options.allowDropFileTypes||-1!=Hi(t.options.allowDropFileTypes,e.type)){var s=new FileReader;s.onload=At(t,function(){var e=s.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),o[n]=e,++l==i){r=ge(t.doc,r);var a={from:r,to:r,text:t.doc.splitLines(o.join(t.doc.lineSeparator())), -origin:"paste"};Tr(t.doc,a),Te(t.doc,de(r,Qo(a)))}}),s.readAsText(e)}},a=0;i>a;++a)s(n[a],a);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1)return t.state.draggingText(e),void setTimeout(function(){t.display.input.focus()},20);try{var o=e.dataTransfer.getData("Text");if(o){if(t.state.draggingText&&!(Ao?e.altKey:e.ctrlKey))var u=t.listSelections();if(Me(t.doc,de(r,r)),u)for(var a=0;al.clientWidth,a=l.scrollHeight>l.clientHeight;if(n&&s||i&&a){if(i&&Ao&&xo)e:for(var u=t.target,c=o.view;u!=l;u=u.parentNode)for(var h=0;hf?d=Math.max(0,d+f-50):p=Math.min(e.doc.height,p+f+50),W(e,{top:d,bottom:p})}20>Yo&&(null==o.wheelStartX?(o.wheelStartX=l.scrollLeft,o.wheelStartY=l.scrollTop,o.wheelDX=n,o.wheelDY=i,setTimeout(function(){if(null!=o.wheelStartX){var e=l.scrollLeft-o.wheelStartX,t=l.scrollTop-o.wheelStartY,r=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null,r&&(_o=(_o*Yo+r)/(Yo+1),++Yo)}},200)):(o.wheelDX+=n,o.wheelDY+=i))}}function lr(e,t,r){if("string"==typeof t&&(t=ul[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)!=El}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}function sr(e,t,r){for(var n=0;nwo&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=16==r||e.shiftKey;var n=ur(t,e);Lo&&(Zo=n?r:null,!n&&88==r&&!rs&&(Ao?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),18!=r||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||fr(t)}}function fr(e){function t(e){18!=e.keyCode&&e.altKey||(ql(r,"CodeMirror-crosshair"),Ol(document,"keyup",t),Ol(document,"mouseover",t))}var r=e.display.lineDiv;Zl(r,"CodeMirror-crosshair"),Wl(document,"keyup",t),Wl(document,"mouseover",t)}function dr(e){16==e.keyCode&&(this.doc.sel.shift=!1),ki(this,e)}function pr(e){var t=this;if(!(jt(t.display,e)||ki(t,e)||e.ctrlKey&&!e.altKey||Ao&&e.metaKey)){var r=e.keyCode,n=e.charCode;if(Lo&&r==Zo)return Zo=null,void kl(e);if(!Lo||e.which&&!(e.which<10)||!ur(t,e)){var i=String.fromCharCode(null==n?r:n);cr(t,e,i)||t.display.input.onKeyPress(e)}}}function gr(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,mr(e))},100)}function vr(e){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(Dl(e,"focus",e),e.state.focused=!0,Zl(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),xo&&setTimeout(function(){e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Fe(e))}function mr(e){e.state.delayingBlurEvent||(e.state.focused&&(Dl(e,"blur",e),e.state.focused=!1,ql(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function yr(e,t){jt(e.display,t)||br(e,t)||ki(e,t,"contextmenu")||e.display.input.onContextMenu(t)}function br(e,t){return Ni(e,"gutterContextMenu")?Zt(e,t,"gutterContextMenu",!1):!1}function wr(e,t){if(Fo(e,t.from)<0)return e;if(Fo(e,t.to)<=0)return Qo(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+=Qo(t).ch-t.to.ch),zo(r,n)}function xr(e,t){for(var r=[],n=0;n=0;--i)kr(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text});else kr(e,t)}}function kr(e,t){if(1!=t.text.length||""!=t.text[0]||0!=Fo(t.from,t.to)){var r=xr(e,t);ui(e,t,r,e.cm?e.cm.curOp.id:NaN),Wr(e,t,r,on(e,t));var n=[];$n(e,function(e,r){r||-1!=Hi(n,e.history)||(bi(e.history,t),n.push(e.history)),Wr(e,t,null,on(e,t))})}}function Mr(e,t,r){if(!e.cm||!e.cm.state.suppressEdits){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;--a){var h=n.changes[a];if(h.origin=t,c&&!Lr(e,h,!1))return void(l.length=0);u.push(li(e,h));var f=a?xr(e,h):Di(l);Wr(e,h,f,sn(e,h)),!a&&e.cm&&e.cm.scrollIntoView({from:h.from,to:Qo(h)});var d=[];$n(e,function(e,t){t||-1!=Hi(d,e.history)||(bi(e.history,h),d.push(e.history)),Wr(e,h,null,sn(e,h))})}}}}function Nr(e,t){if(0!=t&&(e.first+=t,e.sel=new ce(Pi(e.sel.ranges,function(e){return new he(zo(e.anchor.line+t,e.anchor.ch),zo(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){Et(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:zo(o,Zn(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Qn(e,t.from,t.to),r||(r=xr(e,t)),e.cm?Ar(e.cm,t,n):Xn(e,t,n),Me(e,r,Il)}}function Ar(e,t,r){var n=e.doc,i=e.display,l=t.from,s=t.to,a=!1,u=l.line;e.options.lineWrapping||(u=ti(yn(Zn(n,l.line))),n.iter(u,s.line+1,function(e){return e==i.maxLine?(a=!0,!0):void 0})),n.sel.contains(t.from,t.to)>-1&&Mi(e),Xn(n,t,r,o(e)),e.options.lineWrapping||(n.iter(u,l.line+t.text.length,function(e){var t=h(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,a=!1)}),a&&(e.curOp.updateMaxLine=!0)),n.frontier=Math.min(n.frontier,l.line),Re(e,400);var c=t.text.length-(s.line-l.line)-1;t.full?Et(e):l.line!=s.line||1!=t.text.length||jn(e.doc,t)?Et(e,l.line,s.line+1,c):It(e,l.line,"text");var f=Ni(e,"changes"),d=Ni(e,"change");if(d||f){var p={from:l,to:s,text:t.text,removed:t.removed,origin:t.origin};d&&Li(e,"change",e,p),f&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(p)}e.display.selForContextMenu=null}function Or(e,t,r,n,i){if(n||(n=r),Fo(n,r)<0){var o=n;n=r,r=o}"string"==typeof t&&(t=e.splitLines(t)),Tr(e,{from:r,to:n,text:t,origin:i})}function Dr(e,t){if(!ki(e,"scrollCursorIntoView")){var r=e.display,n=r.sizer.getBoundingClientRect(),i=null;if(t.top+n.top<0?i=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!Mo){var o=Ui("div","​",null,"position: absolute; top: "+(t.top-r.viewOffset-Ve(e.display))+"px; height: "+(t.bottom-t.top+Xe(e)+r.barHeight)+"px; left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}function Hr(e,t,r,n){null==n&&(n=0);for(var i=0;5>i;i++){var o=!1,l=dt(e,t),s=r&&r!=t?dt(e,r):l,a=Er(e,Math.min(l.left,s.left),Math.min(l.top,s.top)-n,Math.max(l.left,s.left),Math.max(l.bottom,s.bottom)+n),u=e.doc.scrollTop,c=e.doc.scrollLeft;if(null!=a.scrollTop&&(nr(e,a.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(o=!0)),null!=a.scrollLeft&&(ir(e,a.scrollLeft),Math.abs(e.doc.scrollLeft-c)>1&&(o=!0)),!o)break}return l}function Pr(e,t,r,n,i){var o=Er(e,t,r,n,i);null!=o.scrollTop&&nr(e,o.scrollTop),null!=o.scrollLeft&&ir(e,o.scrollLeft)}function Er(e,t,r,n,i){var o=e.display,l=yt(e.display);0>r&&(r=0);var s=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:o.scroller.scrollTop,a=_e(e),u={};i-r>a&&(i=r+a);var c=e.doc.height+Ke(o),h=l>r,f=i>c-l;if(s>r)u.scrollTop=h?0:r;else if(i>s+a){var d=Math.min(r,(f?c:i)-a);d!=s&&(u.scrollTop=d)}var p=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:o.scroller.scrollLeft,g=Ye(e)-(e.options.fixedGutter?o.gutters.offsetWidth:0),v=n-t>g;return v&&(n=t+g),10>t?u.scrollLeft=0:p>t?u.scrollLeft=Math.max(0,t-(v?0:10)):n>g+p-3&&(u.scrollLeft=n+(v?0:10)-g),u}function Ir(e,t,r){null==t&&null==r||Fr(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 zr(e){Fr(e);var t=e.getCursor(),r=t,n=t;e.options.lineWrapping||(r=t.ch?zo(t.line,t.ch-1):t,n=zo(t.line,t.ch+1)),e.curOp.scrollToPos={from:r,to:n,margin:e.options.cursorScrollMargin,isCursor:!0}}function Fr(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=pt(e,t.from),n=pt(e,t.to),i=Er(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 Rr(e,t,r,n){var i,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?i=Ue(e,t):r="prev");var l=e.options.tabSize,s=Zn(o,t),a=Rl(s.text,null,l);s.stateAfter&&(s.stateAfter=null);var u,c=s.text.match(/^\s*/)[0];if(n||/\S/.test(s.text)){if("smart"==r&&(u=o.mode.indent(i,s.text.slice(c.length),s.text),u==El||u>150)){if(!n)return;r="prev"}}else u=0,r="not";"prev"==r?u=t>o.first?Rl(Zn(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="",f=0;if(e.options.indentWithTabs)for(var d=Math.floor(u/l);d;--d)f+=l,h+=" ";if(u>f&&(h+=Oi(u-f)),h!=c)return Or(o,h,zo(t,0),zo(t,c.length),"+input"),s.stateAfter=null,!0;for(var d=0;d=0;t--)Or(e.doc,"",n[t].from,n[t].to,"+delete");zr(e)})}function Ur(e,t,r,n,i){function o(){var t=s+r;return t=e.first+e.size?!1:(s=t,c=Zn(e,t))}function l(e){var t=(i?ho:fo)(c,a,r,!0);if(null==t){if(e||!o())return!1;a=i?(0>r?io:no)(c):0>r?c.text.length:0}else a=t;return!0}var s=t.line,a=t.ch,u=r,c=Zn(e,s);if("char"==n)l();else if("column"==n)l(!0);else if("word"==n||"group"==n)for(var h=null,f="group"==n,d=e.cm&&e.cm.getHelper(t,"wordChars"),p=!0;!(0>r)||l(!p);p=!1){var g=c.text.charAt(a)||"\n",v=Ri(g,d)?"w":f&&"\n"==g?"n":!f||/\s/.test(g)?null:"p";if(!f||p||v||(v="s"),h&&h!=v){0>r&&(r=1,l());break}if(v&&(h=v),r>0&&!l(!p))break}var m=De(e,zo(s,a),t,u,!0);return Fo(t,m)||(m.hitSide=!0),m}function Vr(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);i=t.top+r*(s-(0>r?1.5:.5)*yt(e.display))}else"line"==n&&(i=r>0?t.bottom+3:t.top-3);for(;;){var a=vt(e,l,i);if(!a.outside)break;if(0>r?0>=i:i>=o.height){a.hitSide=!0;break}i+=5*r}return a}function Kr(t,r,n,i){e.defaults[t]=r,n&&(el[t]=i?function(e,t,r){r!=tl&&n(e,t,r)}:n)}function jr(e){for(var t,r,n,i,o=e.split(/-(?!$)/),e=o[o.length-1],l=0;l0||0==l&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=Ui("span",[o.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(mn(e,t.line,t,r,o)||t.line!=r.line&&mn(e,r.line,t,r,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Io=!0}o.addToHistory&&ui(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var s,a=t.line,u=e.cm;if(e.iter(a,r.line+1,function(e){u&&o.collapsed&&!u.options.lineWrapping&&yn(e)==u.display.maxLine&&(s=!0),o.collapsed&&a!=t.line&&ei(e,0),tn(e,new Qr(o,a==t.line?t.ch:null,a==r.line?r.ch:null)),++a}),o.collapsed&&e.iter(t.line,r.line+1,function(t){Cn(e,t)&&ei(t,0)}),o.clearOnEnter&&Wl(o,"beforeCursorEnter",function(){o.clear()}),o.readOnly&&(Eo=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++gl,o.atomic=!0),u){if(s&&(u.curOp.updateMaxLine=!0),o.collapsed)Et(u,t.line,r.line+1);else if(o.className||o.title||o.startStyle||o.endStyle||o.css)for(var c=t.line;c<=r.line;c++)It(u,c,"text");o.atomic&&We(u.doc),Li(u,"markerAdded",u,o)}return o}function _r(e,t,r,n,i){n=zi(n),n.shared=!1;var o=[Yr(e,t,r,n,i)],l=o[0],s=n.widgetNode;return $n(e,function(e){s&&(n.widgetNode=s.cloneNode(!0)),o.push(Yr(e,ge(e,t),ge(e,r),n,i));for(var a=0;a=t:o.to>t);(n||(n=[])).push(new Qr(l,o.from,a?null:o.to))}}return n}function nn(e,t,r){if(e)for(var n,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 h=0;hh;++h)p.push(g);p.push(a)}return p}function ln(e){for(var t=0;t0)){var c=[a,1],h=Fo(u.from,s.from),f=Fo(u.to,s.to);(0>h||!l.inclusiveLeft&&!h)&&c.push({from:u.from,to:s.from}),(f>0||!l.inclusiveRight&&!f)&&c.push({from:s.to,to:u.to}),i.splice.apply(i,c),a+=c.length-1}}return i}function un(e){var t=e.markedSpans;if(t){for(var r=0;r=0&&0>=h||0>=c&&h>=0)&&(0>=c&&(Fo(u.to,r)>0||a.marker.inclusiveRight&&i.inclusiveLeft)||c>=0&&(Fo(u.from,n)<0||a.marker.inclusiveLeft&&i.inclusiveRight)))return!0}}}function yn(e){for(var t;t=gn(e);)e=t.find(-1,!0).line;return e}function bn(e){for(var t,r;t=vn(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function wn(e,t){var r=Zn(e,t),n=yn(r);return r==n?t:ti(n)}function xn(e,t){if(t>e.lastLine())return t;var r,n=Zn(e,t);if(!Cn(e,n))return t;for(;r=vn(n);)n=r.find(1,!0).line;return ti(n)+1}function Cn(e,t){var r=Io&&t.markedSpans;if(r)for(var n,i=0;io;o++){i&&(i[0]=e.innerMode(t,n).mode);var l=t.token(r,n);if(r.pos>r.start)return l}throw new Error("Mode "+t.name+" failed to advance stream.")}function Dn(e,t,r,n){function i(e){return{start:h.start,end:h.pos,string:h.current(),type:o||null,state:e?sl(l.mode,c):c}}var o,l=e.doc,s=l.mode;t=ge(l,t);var a,u=Zn(l,t.line),c=Ue(e,t.line,r),h=new pl(u.text,e.options.tabSize);for(n&&(a=[]);(n||h.pose.options.maxHighlightLength?(s=!1,l&&In(e,t,n,h.pos),h.pos=t.length,a=null):a=Wn(On(r,h,n,f),o),f){var d=f[0].name;d&&(a="m-"+(a?d+" "+a:d))}if(!s||c!=a){for(;uu;){var n=i[a];n>e&&i.splice(a,1,e,i[a+1],n),a+=2,u=Math.min(e,n)}if(t)if(s.opaque)i.splice(r,a-r,e,"cm-overlay "+t),a=r+2;else for(;a>r;r+=2){var o=i[r+1];i[r+1]=(o?o+" ":"")+"cm-overlay "+t}},o)}return{styles:i,classes:o.bgClass||o.textClass?o:null}}function En(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=Ue(e,ti(t)),i=Pn(e,t,t.text.length>e.options.maxHighlightLength?sl(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 In(e,t,r,n){var i=e.doc.mode,o=new pl(t,e.options.tabSize);for(o.start=o.pos=n||0,""==t&&An(i,r);!o.eol();)On(i,o,r),o.start=o.pos}function zn(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?xl:wl;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function Fn(e,t){var r=Ui("span",null,null,xo?"padding-right: .1px":null),n={pre:Ui("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,splitSpaces:(bo||xo)&&e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o,l=i?t.rest[i-1]:t.line;n.pos=0,n.addToken=Bn,Qi(e.display.measure)&&(o=ii(l))&&(n.addToken=Un(n.addToken,o)),n.map=[];var s=t!=e.display.externalMeasured&&ti(l);Kn(l,n,En(e,l,s)),l.styleClasses&&(l.styleClasses.bgClass&&(n.bgClass=Yi(l.styleClasses.bgClass,n.bgClass||"")),l.styleClasses.textClass&&(n.textClass=Yi(l.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(Zi(e.display.measure))),0==i?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}return xo&&/\bcm-tab\b/.test(n.content.lastChild.className)&&(n.content.className="cm-tab-wrap-hack"),Dl(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=Yi(n.pre.className,n.textClass||"")),n}function Rn(e){var t=Ui("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Bn(e,t,r,n,i,o,l){if(t){var s=e.splitSpaces?t.replace(/ {3,}/g,Gn):t,a=e.cm.state.specialChars,u=!1;if(a.test(t))for(var c=document.createDocumentFragment(),h=0;;){a.lastIndex=h;var f=a.exec(t),d=f?f.index-h:t.length-h;if(d){var p=document.createTextNode(s.slice(h,h+d));bo&&9>wo?c.appendChild(Ui("span",[p])):c.appendChild(p),e.map.push(e.pos,e.pos+d,p),e.col+=d,e.pos+=d}if(!f)break;if(h+=d+1," "==f[0]){var g=e.cm.options.tabSize,v=g-e.col%g,p=c.appendChild(Ui("span",Oi(v),"cm-tab"));p.setAttribute("role","presentation"),p.setAttribute("cm-text"," "),e.col+=v}else if("\r"==f[0]||"\n"==f[0]){var p=c.appendChild(Ui("span","\r"==f[0]?"␍":"␤","cm-invalidchar"));p.setAttribute("cm-text",f[0]),e.col+=1}else{var p=e.cm.options.specialCharPlaceholder(f[0]);p.setAttribute("cm-text",f[0]),bo&&9>wo?c.appendChild(Ui("span",[p])):c.appendChild(p),e.col+=1}e.map.push(e.pos,e.pos+1,p),e.pos++}else{e.col+=t.length;var c=document.createTextNode(s);e.map.push(e.pos,e.pos+t.length,c),bo&&9>wo&&(u=!0),e.pos+=t.length}if(r||n||i||u||l){var m=r||"";n&&(m+=n),i&&(m+=i);var y=Ui("span",[c],m,l);return o&&(y.title=o),e.content.appendChild(y)}e.content.appendChild(c)}}function Gn(e){for(var t=" ",r=0;ru&&f.from<=u)break}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 Vn(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}function Kn(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var l,s,a,u,c,h,f,d=i.length,p=0,g=1,v="",m=0;;){if(m==p){a=u=c=h=s="",f=null,m=1/0;for(var y,b=[],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&&(y||(y=[])).push(C.endStyle,x.to),C.title&&!h&&(h=C.title),C.collapsed&&(!f||dn(f.marker,C)<0)&&(f=x)):x.from>p&&m>x.from&&(m=x.from)}if(y)for(var w=0;w=d)break;for(var S=Math.min(d,m);;){if(v){var L=p+v.length;if(!f){var T=L>S?v.slice(0,S-p):v;t.addToken(t,T,l?l+a:a,c,p+T.length==m?u:"",h,s)}if(L>=S){v=v.slice(S-p),p=S;break}p=L,c=""}v=i.slice(o,o=r[g++]),l=zn(r[g++],t.cm.options)}}else for(var g=1;gr;++r)o.push(new bl(u[r],i(r),n));return o}var s=t.from,a=t.to,u=t.text,c=Zn(e,s.line),h=Zn(e,a.line),f=Di(u),d=i(u.length-1),p=a.line-s.line;if(t.full)e.insert(0,l(0,u.length)),e.remove(u.length,e.size-u.length);else if(jn(e,t)){var g=l(0,u.length-1);o(h,h.text,d),p&&e.remove(s.line,p),g.length&&e.insert(s.line,g)}else if(c==h)if(1==u.length)o(c,c.text.slice(0,s.ch)+f+c.text.slice(a.ch),d);else{var g=l(1,u.length-1);g.push(new bl(f+c.text.slice(a.ch),d,n)),o(c,c.text.slice(0,s.ch)+u[0],i(0)),e.insert(s.line+1,g)}else if(1==u.length)o(c,c.text.slice(0,s.ch)+u[0]+h.text.slice(a.ch),i(0)),e.remove(s.line+1,p);else{o(c,c.text.slice(0,s.ch)+u[0],i(0)),o(h,f+h.text.slice(a.ch),d);var g=l(1,u.length-1);p>1&&e.remove(s.line+1,p-1),e.insert(s.line+1,g)}Li(e,"change",e,t)}function Yn(e){this.lines=e,this.parent=null;for(var t=0,r=0;tt||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(o>t){r=i;break}t-=o}return r.lines[t]}function Qn(e,t,r){var n=[],i=t.line;return e.iter(t.line,r.line+1,function(e){var o=e.text;i==r.line&&(o=o.slice(0,r.ch)),i==t.line&&(o=o.slice(t.ch)), -n.push(o),++i}),n}function Jn(e,t,r){var n=[];return e.iter(t,r,function(e){n.push(e.text)}),n}function ei(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function ti(e){if(null==e.parent)return null;for(var t=e.parent,r=Hi(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var i=0;n.children[i]!=t;++i)r+=n.children[i].chunkSize();return r+t.first}function ri(e,t){var r=e.first;e:do{for(var n=0;nt){e=i;continue e}t-=o,r+=i.chunkSize()}return r}while(!e.lines);for(var n=0;nt)break;t-=s}return r+n}function ni(e){e=yn(e);for(var t=0,r=e.parent,n=0;n1&&!e.done[e.done.length-2].ranges?(e.done.pop(),Di(e.done)):void 0}function ui(e,t,r,n){var i=e.history;i.undone.length=0;var o,l=+new Date;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>l-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=ai(i,i.lastOp==n))){var s=Di(o.changes);0==Fo(t.from,t.to)&&0==Fo(t.from,s.to)?s.to=Qo(t):o.changes.push(li(e,t))}else{var a=Di(i.done);for(a&&a.ranges||fi(e.sel,i.done),o={changes:[li(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=l,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,s||Dl(e,"historyAdded")}function ci(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 hi(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||ci(e,o,Di(i.done),t))?i.done[i.done.length-1]=t:fi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=r,n&&n.clearRedo!==!1&&si(i.undone)}function fi(e,t){var r=Di(t);r&&r.ranges&&r.equals(e)||t.push(e)}function di(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 pi(e){if(!e)return null;for(var t,r=0;r-1&&(Di(s)[h]=c[h],delete c[h])}}}return i}function mi(e,t,r,n){r0?n.slice():Al:n||Al}function Li(e,t){function r(e){return function(){e.apply(null,o)}}var n=Si(e,t,!1);if(n.length){var i,o=Array.prototype.slice.call(arguments,2);Ko?i=Ko.delayedCallbacks:Hl?i=Hl:(i=Hl=[],setTimeout(Ti,0));for(var l=0;l0}function Wi(e){e.prototype.on=function(e,t){Wl(this,e,t)},e.prototype.off=function(e,t){Ol(this,e,t)}}function Ai(){this.id=null}function Oi(e){for(;Gl.length<=e;)Gl.push(Di(Gl)+" ");return Gl[e]}function Di(e){return e[e.length-1]}function Hi(e,t){for(var r=0;r-1&&jl(e)?!0:t.test(e):jl(e)}function Bi(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function Gi(e){return e.charCodeAt(0)>=768&&Xl.test(e)}function Ui(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;o0;--t)e.removeChild(e.firstChild);return e}function Ki(e,t){return Vi(e).appendChild(t)}function ji(){for(var e=document.activeElement;e&&e.root&&e.root.activeElement;)e=e.root.activeElement;return e}function Xi(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function Yi(e,t){for(var r=e.split(" "),n=0;n2&&!(bo&&8>wo))}var r=_l?Ui("span","​"):Ui("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function Qi(e){if(null!=$l)return $l;var t=Ki(e,document.createTextNode("AخA")),r=Vl(t,0,1).getBoundingClientRect();if(!r||r.left==r.right)return!1;var n=Vl(t,1,2).getBoundingClientRect();return $l=n.right-r.right<3}function Ji(e){if(null!=ns)return ns;var t=Ki(e,Ui("span","x")),r=t.getBoundingClientRect(),n=Vl(t,0,1).getBoundingClientRect();return ns=Math.abs(r.left-n.left)>1}function eo(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 to(e){return e.level%2?e.to:e.from}function ro(e){return e.level%2?e.from:e.to}function no(e){var t=ii(e);return t?to(t[0]):0}function io(e){var t=ii(e);return t?ro(Di(t)):e.text.length}function oo(e,t){var r=Zn(e.doc,t),n=yn(r);n!=r&&(t=ti(n));var i=ii(n),o=i?i[0].level%2?io(n):no(n):0;return zo(t,o)}function lo(e,t){for(var r,n=Zn(e.doc,t);r=vn(n);)n=r.find(1,!0).line,t=null;var i=ii(n),o=i?i[0].level%2?no(n):io(n):n.text.length;return zo(null==t?ti(n):t,o)}function so(e,t){var r=oo(e,t.line),n=Zn(e.doc,r.line),i=ii(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 zo(r.line,l?0:o)}return r}function ao(e,t,r){var n=e[0].level;return t==n?!0:r==n?!1:r>t}function uo(e,t){os=null;for(var r,n=0;nt)return n;if(i.from==t||i.to==t){if(null!=r)return ao(e,i.level,e[r].level)?(i.from!=i.to&&(os=r),n):(i.from!=i.to&&(os=n),r);r=n}}return r}function co(e,t,r,n){if(!n)return t+r;do t+=r;while(t>0&&Gi(e.text.charAt(t)));return t}function ho(e,t,r,n){var i=ii(e);if(!i)return fo(e,t,r,n);for(var o=uo(i,t),l=i[o],s=co(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?co(e,l.to,-1,n):co(e,l.from,1,n)}}function fo(e,t,r,n){var i=t+r;if(n)for(;i>0&&Gi(e.text.charAt(i));)i+=r;return 0>i||i>e.text.length?null:i}var po=navigator.userAgent,go=navigator.platform,vo=/gecko\/\d/i.test(po),mo=/MSIE \d/.test(po),yo=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(po),bo=mo||yo,wo=bo&&(mo?document.documentMode||6:yo[1]),xo=/WebKit\//.test(po),Co=xo&&/Qt\/\d+\.\d+/.test(po),So=/Chrome\//.test(po),Lo=/Opera\//.test(po),To=/Apple Computer/.test(navigator.vendor),ko=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(po),Mo=/PhantomJS/.test(po),No=/AppleWebKit/.test(po)&&/Mobile\/\w+/.test(po),Wo=No||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(po),Ao=No||/Mac/.test(go),Oo=/win/i.test(go),Do=Lo&&po.match(/Version\/(\d*\.\d*)/);Do&&(Do=Number(Do[1])),Do&&Do>=15&&(Lo=!1,xo=!0);var Ho=Ao&&(Co||Lo&&(null==Do||12.11>Do)),Po=vo||bo&&wo>=9,Eo=!1,Io=!1;g.prototype=zi({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}},setScrollLeft:function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz)},setScrollTop:function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert)},zeroWidthHack:function(){var e=Ao&&!ko?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Ai,this.disableVert=new Ai},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)},clear:function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)}},g.prototype),v.prototype=zi({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},v.prototype),e.scrollbarModel={native:g,null:v},T.prototype.signal=function(e,t){Ni(e,t)&&this.events.push(arguments)},T.prototype.finish=function(){for(var e=0;e=9&&r.hasSelection&&(r.hasSelection=null),r.poll()}),Wl(o,"paste",function(e){ki(n,e)||Q(e,n)||(n.state.pasteIncoming=!0,r.fastPoll())}),Wl(o,"cut",t),Wl(o,"copy",t),Wl(e.scroller,"paste",function(t){jt(e,t)||ki(n,t)||(n.state.pasteIncoming=!0,r.focus())}),Wl(e.lineSpace,"selectstart",function(t){jt(e,t)||kl(t)}),Wl(o,"compositionstart",function(){var e=n.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:e,range:n.markText(e,n.getCursor("to"),{className:"CodeMirror-composing"})}}),Wl(o,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},prepareSelection:function(){var e=this.cm,t=e.display,r=e.doc,n=Ee(e);if(e.options.moveInputWithCursor){var i=dt(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},showSelection:function(e){var t=this.cm,r=t.display;Ki(r.cursorDiv,e.cursors),Ki(r.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},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=rs&&(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&&Ul(this.textarea),bo&&wo>=9&&(this.hasSelection=l)}else e||(this.prevInput=this.textarea.value="",bo&&wo>=9&&(this.hasSelection=null));this.inaccurateSelection=t}},getField:function(){return this.textarea},supportsTouch:function(){return!1},focus:function(){if("nocursor"!=this.cm.options.readOnly&&(!Wo||ji()!=this.textarea))try{this.textarea.focus()}catch(e){}},blur:function(){this.textarea.blur()},resetPosition:function(){this.wrapper.style.top=this.wrapper.style.left=0},receivedFocus:function(){this.slowPoll()},slowPoll:function(){var e=this;e.pollingFast||e.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},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)},poll:function(){var e=this.cm,t=this.textarea,r=this.prevInput;if(this.contextMenuPending||!e.state.focused||ts(t)&&!r&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var n=t.value;if(n==r&&!e.somethingSelected())return!1;if(bo&&wo>=9&&this.hasSelection===n||Ao&&/[\uf700-\uf7ff]/.test(n))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var i=n.charCodeAt(0);if(8203!=i||r||(r="​"),8666==i)return this.reset(),this.cm.execCommand("undo")}for(var o=0,l=Math.min(r.length,n.length);l>o&&r.charCodeAt(o)==n.charCodeAt(o);)++o;var s=this;return Wt(e,function(){Z(e,n.slice(o),r.length-o,null,s.composing?"*compose":null),n.length>1e3||n.indexOf("\n")>-1?t.value=s.prevInput="":s.prevInput=n,s.composing&&(s.composing.range.clear(),s.composing.range=e.markText(s.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ensurePolled:function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},onKeyPress:function(){bo&&wo>=9&&(this.hasSelection=null),this.fastPoll()},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=h,l.style.cssText=c,bo&&9>wo&&o.scrollbars.setScrollTop(o.scroller.scrollTop=a),null!=l.selectionStart){(!bo||bo&&9>wo)&&t();var e=0,r=function(){o.selForContextMenu==i.doc.sel&&0==l.selectionStart&&l.selectionEnd>0&&"​"==n.prevInput?At(i,ul.selectAll)(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=Xt(i,e),a=o.scroller.scrollTop;if(s&&!Lo){var u=i.options.resetSelectionOnContextMenu;u&&-1==i.doc.sel.contains(s)&&At(i,ke)(i.doc,de(s),Il);var c=l.style.cssText,h=n.wrapper.style.cssText;n.wrapper.style.cssText="position: absolute";var f=n.wrapper.getBoundingClientRect();if(l.style.cssText="position: absolute; width: 30px; height: 30px; top: "+(e.clientY-f.top-5)+"px; left: "+(e.clientX-f.left-5)+"px; z-index: 1000; background: "+(bo?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",xo)var d=window.scrollY;if(o.input.focus(),xo&&window.scrollTo(null,d),o.input.reset(),i.somethingSelected()||(l.value=n.prevInput=" "),n.contextMenuPending=!0,o.selForContextMenu=i.doc.sel,clearTimeout(o.detectingSelectAll),bo&&wo>=9&&t(),Po){Nl(e);var p=function(){Ol(window,"mouseup",p),setTimeout(r,20)};Wl(window,"mouseup",p)}else setTimeout(r,50)}},readOnlyChanged:function(e){e||this.reset()},setUneditable:Ei,needsContentAttribute:!1},re.prototype),ie.prototype=zi({init:function(e){function t(e){if(!ki(n,e)){if(n.somethingSelected())Ro=n.getSelections(),"cut"==e.type&&n.replaceSelection("",null,"cut");else{if(!n.options.lineWiseCopyCut)return;var t=ee(n);Ro=t.text,"cut"==e.type&&n.operation(function(){n.setSelections(t.ranges,0,Il),n.replaceSelection("",null,"cut")})}if(e.clipboardData&&!No)e.preventDefault(),e.clipboardData.clearData(),e.clipboardData.setData("text/plain",Ro.join("\n"));else{var r=ne(),i=r.firstChild;n.display.lineSpace.insertBefore(r,n.display.lineSpace.firstChild),i.value=Ro.join("\n");var o=document.activeElement;Ul(i),setTimeout(function(){n.display.lineSpace.removeChild(r),o.focus()},50)}}}var r=this,n=r.cm,i=r.div=e.lineDiv;te(i),Wl(i,"paste",function(e){ki(n,e)||Q(e,n)}),Wl(i,"compositionstart",function(e){var t=e.data;if(r.composing={sel:n.doc.sel,data:t,startData:t},t){var i=n.doc.sel.primary(),o=n.getLine(i.head.line),l=o.indexOf(t,Math.max(0,i.head.ch-t.length));l>-1&&l<=i.head.ch&&(r.composing.sel=de(zo(i.head.line,l),zo(i.head.line,l+t.length)))}}),Wl(i,"compositionupdate",function(e){r.composing.data=e.data}),Wl(i,"compositionend",function(e){var t=r.composing;t&&(e.data==t.startData||/\u200b/.test(e.data)||(t.data=e.data),setTimeout(function(){t.handled||r.applyComposition(t),r.composing==t&&(r.composing=null)},50))}),Wl(i,"touchstart",function(){r.forceCompositionEnd()}),Wl(i,"input",function(){r.composing||!n.isReadOnly()&&r.pollContent()||Wt(r.cm,function(){Et(n)})}),Wl(i,"copy",t),Wl(i,"cut",t)},prepareSelection:function(){var e=Ee(this.cm,!1);return e.focus=this.cm.state.focused,e},showSelection:function(e){e&&this.cm.display.view.length&&(e.focus&&this.showPrimarySelection(),this.showMultipleSelections(e))},showPrimarySelection:function(){var e=window.getSelection(),t=this.cm.doc.sel.primary(),r=se(this.cm,e.anchorNode,e.anchorOffset),n=se(this.cm,e.focusNode,e.focusOffset);if(!r||r.bad||!n||n.bad||0!=Fo($(r,n),t.from())||0!=Fo(_(r,n),t.to())){var i=oe(this.cm,t.from()),o=oe(this.cm,t.to());if(i||o){var l=this.cm.display.view,s=e.rangeCount&&e.getRangeAt(0);if(i){if(!o){var a=l[l.length-1].measure,u=a.maps?a.maps[a.maps.length-1]:a.map;o={node:u[u.length-1],offset:u[u.length-2]-u[u.length-3]}}}else i={node:l[0].measure.map[2],offset:0};try{var c=Vl(i.node,i.offset,o.offset,o.node)}catch(h){}c&&(!vo&&this.cm.state.focused?(e.collapse(i.node,i.offset),c.collapsed||e.addRange(c)):(e.removeAllRanges(),e.addRange(c)),s&&null==e.anchorNode?e.addRange(s):vo&&this.startGracePeriod()),this.rememberSelection()}}},startGracePeriod:function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){e.cm.curOp.selectionChanged=!0})},20)},showMultipleSelections:function(e){Ki(this.cm.display.cursorDiv,e.cursors),Ki(this.cm.display.selectionDiv,e.selection)},rememberSelection:function(){var e=window.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},selectionInEditor:function(){var e=window.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return Yl(this.div,t)},focus:function(){"nocursor"!=this.cm.options.readOnly&&this.div.focus()},blur:function(){this.div.blur()},getField:function(){return this.div},supportsTouch:function(){return!0},receivedFocus:function(){function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))}var t=this;this.selectionInEditor()?this.pollSelection():Wt(this.cm,function(){t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,e)},selectionChanged:function(){var e=window.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},pollSelection:function(){if(!this.composing&&!this.gracePeriod&&this.selectionChanged()){var e=window.getSelection(),t=this.cm;this.rememberSelection();var r=se(t,e.anchorNode,e.anchorOffset),n=se(t,e.focusNode,e.focusOffset);r&&n&&Wt(t,function(){ke(t.doc,de(r,n),Il),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)})}},pollContent:function(){var e=this.cm,t=e.display,r=e.doc.sel.primary(),n=r.from(),i=r.to();if(n.linet.viewTo-1)return!1;var o;if(n.line==t.viewFrom||0==(o=Ft(e,n.line)))var l=ti(t.view[0].line),s=t.view[0].node;else var l=ti(t.view[o].line),s=t.view[o-1].node.nextSibling;var a=Ft(e,i.line);if(a==t.view.length-1)var u=t.viewTo-1,c=t.lineDiv.lastChild;else var u=ti(t.view[a+1].line)-1,c=t.view[a+1].node.previousSibling;for(var h=e.doc.splitLines(ue(e,s,c,l,u)),f=Qn(e.doc,zo(l,0),zo(u,Zn(e.doc,u).text.length));h.length>1&&f.length>1;)if(Di(h)==Di(f))h.pop(),f.pop(),u--;else{if(h[0]!=f[0])break;h.shift(),f.shift(),l++}for(var d=0,p=0,g=h[0],v=f[0],m=Math.min(g.length,v.length);m>d&&g.charCodeAt(d)==v.charCodeAt(d);)++d;for(var y=Di(h),b=Di(f),w=Math.min(y.length-(1==h.length?d:0),b.length-(1==f.length?d:0));w>p&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)++p;h[h.length-1]=y.slice(0,y.length-p),h[0]=h[0].slice(d);var x=zo(l,d),C=zo(u,f.length?Di(f).length-p:0);return h.length>1||h[0]||Fo(x,C)?(Or(e.doc,h,x,C,"+input"),!0):void 0},ensurePolled:function(){this.forceCompositionEnd()},reset:function(){this.forceCompositionEnd()},forceCompositionEnd:function(){this.composing&&!this.composing.handled&&(this.applyComposition(this.composing),this.composing.handled=!0,this.div.blur(),this.div.focus())},applyComposition:function(e){this.cm.isReadOnly()?At(this.cm,Et)(this.cm):e.data&&e.data!=e.startData&&At(this.cm,Z)(this.cm,e.data,0,e.sel)},setUneditable:function(e){e.contentEditable="false"},onKeyPress:function(e){e.preventDefault(),this.cm.isReadOnly()||At(this.cm,Z)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0)},readOnlyChanged:function(e){this.div.contentEditable=String("nocursor"!=e)},onContextMenu:Ei,resetPosition:Ei,needsContentAttribute:!0},ie.prototype),e.inputStyles={textarea:re,contenteditable:ie},ce.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t=0&&Fo(e,n.to())<=0)return r}return-1}},he.prototype={from:function(){return $(this.anchor,this.head)},to:function(){return _(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var Bo,Go,Uo,Vo={left:0,right:0,top:0,bottom:0},Ko=null,jo=0,Xo=0,Yo=0,_o=null;bo?_o=-.53:vo?_o=15:So?_o=-.7:To&&(_o=-1/3);var $o=function(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}};e.wheelEventPixels=function(e){var t=$o(e);return t.x*=_o,t.y*=_o,t};var qo=new Ai,Zo=null,Qo=e.changeEnd=function(e){return e.text?zo(e.from.line+e.text.length-1,Di(e.text).length+(1==e.text.length?e.from.ch:0)):e.to};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,t){var r=this.options,n=r[e];r[e]==t&&"mode"!=e||(r[e]=t,el.hasOwnProperty(e)&&At(this,el[e])(this,t,n))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Xr(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,r=0;rr&&(Rr(this,i.head.line,e,!0),r=i.head.line,n==this.doc.sel.primIndex&&zr(this));else{var o=i.from(),l=i.to(),s=Math.max(r,o.line);r=Math.min(this.lastLine(),l.line-(l.ch?0:1))+1;for(var a=s;r>a;++a)Rr(this,a,e);var u=this.doc.sel.ranges;0==o.ch&&t.length==u.length&&u[n].from().ch>0&&Ce(this.doc,n,new he(o,u[n].to()),Il)}}}),getTokenAt:function(e,t){return Dn(this,e,t)},getLineTokens:function(e,t){return Dn(this,zo(e),t,!0)},getTokenTypeAt:function(e){e=ge(this.doc,e);var t,r=En(this,Zn(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]s?t:0==s?null:t.slice(0,s-1)},getModeAt:function(t){var r=this.doc.mode;return r.innerMode?e.innerMode(r,this.getTokenAt(t).state).mode:r},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!ll.hasOwnProperty(t))return r;var n=ll[t],i=this.getModeAt(e);if("string"==typeof i[t])n[i[t]]&&r.push(n[i[t]]);else if(i[t])for(var o=0;oi&&(e=i,n=!0),r=Zn(this.doc,e)}else r=e;return ct(this,r,{top:0,left:0},t||"page").top+(n?this.doc.height-ni(r):0)},defaultTextHeight:function(){return yt(this.display)},defaultCharWidth:function(){return bt(this.display)},setGutterMarker:Ot(function(e,t,r){return Br(this.doc,e,"gutter",function(e){var n=e.gutterMarkers||(e.gutterMarkers={});return n[t]=r,!r&&Bi(n)&&(e.gutterMarkers=null),!0})}),clearGutter:Ot(function(e){var t=this,r=t.doc,n=r.first;r.iter(function(r){r.gutterMarkers&&r.gutterMarkers[e]&&(r.gutterMarkers[e]=null,It(t,n,"gutter"),Bi(r.gutterMarkers)&&(r.gutterMarkers=null)),++n})}),lineInfo:function(e){if("number"==typeof e){if(!me(this.doc,e))return null;var t=e;if(e=Zn(this.doc,e),!e)return null}else{var t=ti(e);if(null==t)return null}return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o=this.display;e=dt(this,ge(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&&Pr(this,s,l,s+t.offsetWidth,l+t.offsetHeight)},triggerOnKeyDown:Ot(hr),triggerOnKeyPress:Ot(pr),triggerOnKeyUp:dr,execCommand:function(e){return ul.hasOwnProperty(e)?ul[e].call(null,this):void 0},triggerElectric:Ot(function(e){J(this,e)}),findPosH:function(e,t,r,n){var i=1;0>t&&(i=-1,t=-t);for(var o=0,l=ge(this.doc,e);t>o&&(l=Ur(this.doc,l,i,r,n),!l.hitSide);++o);return l},moveH:Ot(function(e,t){var r=this;r.extendSelectionsBy(function(n){return r.display.shift||r.doc.extend||n.empty()?Ur(r.doc,n.head,e,t,r.options.rtlMoveVisually):0>e?n.from():n.to()},Fl)}),deleteH:Ot(function(e,t){var r=this.doc.sel,n=this.doc;r.somethingSelected()?n.replaceSelection("",null,"+delete"):Gr(this,function(r){var i=Ur(n,r.head,e,t,!1);return 0>e?{from:i,to:r.head}:{from:r.head,to:i}})}),findPosV:function(e,t,r,n){var i=1,o=n;0>t&&(i=-1,t=-t);for(var l=0,s=ge(this.doc,e);t>l;++l){var a=dt(this,s,"div");if(null==o?o=a.left:a.left=o,s=Vr(this,a,i,r),s.hitSide)break}return s},moveV:Ot(function(e,t){var r=this,n=this.doc,i=[],o=!r.display.shift&&!n.extend&&n.sel.somethingSelected();if(n.extendSelectionsBy(function(l){if(o)return 0>e?l.from():l.to();var s=dt(r,l.head,"div");null!=l.goalColumn&&(s.left=l.goalColumn),i.push(s.left);var a=Vr(r,s,e,t);return"page"==t&&l==n.sel.primary()&&Ir(r,null,ft(r,a,"div").top-s.top),a},Fl),i.length)for(var l=0;l0&&s(r.charAt(n-1));)--n;for(;i.5)&&l(this),Dl(this,"refresh",this)}),swapDoc:Ot(function(e){var t=this.doc;return t.cm=null,qn(this,e),st(this),this.display.input.reset(),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Li(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}},Wi(e);var Jo=e.defaults={},el=e.optionHandlers={},tl=e.Init={toString:function(){return"CodeMirror.Init"}};Kr("value","",function(e,t){e.setValue(t)},!0),Kr("mode",null,function(e,t){e.doc.modeOption=t,r(e)},!0),Kr("indentUnit",2,r,!0),Kr("indentWithTabs",!1),Kr("smartIndent",!0),Kr("tabSize",4,function(e){n(e),st(e),Et(e)},!0),Kr("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(-1==o)break;i=o+t.length,r.push(zo(n,o))}n++});for(var i=r.length-1;i>=0;i--)Or(e.doc,t,r[i],zo(r[i].line,r[i].ch+t.length))}}),Kr("specialChars",/[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(t,r,n){t.state.specialChars=new RegExp(r.source+(r.test(" ")?"":"| "),"g"),n!=e.Init&&t.refresh()}),Kr("specialCharPlaceholder",Rn,function(e){e.refresh()},!0),Kr("electricChars",!0),Kr("inputStyle",Wo?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),Kr("rtlMoveVisually",!Oo),Kr("wholeLineUpdateBefore",!0),Kr("theme","default",function(e){s(e),a(e)},!0),Kr("keyMap","default",function(t,r,n){var i=Xr(r),o=n!=e.Init&&Xr(n);o&&o.detach&&o.detach(t,i),i.attach&&i.attach(t,o||null)}),Kr("extraKeys",null),Kr("lineWrapping",!1,i,!0),Kr("gutters",[],function(e){d(e.options),a(e)},!0),Kr("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?L(e.display)+"px":"0",e.refresh()},!0),Kr("coverGutterNextToScrollbar",!1,function(e){y(e)},!0),Kr("scrollbarStyle","native",function(e){m(e),y(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),Kr("lineNumbers",!1,function(e){d(e.options),a(e)},!0),Kr("firstLineNumber",1,a,!0),Kr("lineNumberFormatter",function(e){return e},a,!0),Kr("showCursorWhenSelecting",!1,Pe,!0),Kr("resetSelectionOnContextMenu",!0),Kr("lineWiseCopyCut",!0),Kr("readOnly",!1,function(e,t){"nocursor"==t?(mr(e),e.display.input.blur(),e.display.disabled=!0):e.display.disabled=!1,e.display.input.readOnlyChanged(t)}),Kr("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),Kr("dragDrop",!0,Vt),Kr("allowDropFileTypes",null),Kr("cursorBlinkRate",530),Kr("cursorScrollMargin",0),Kr("cursorHeight",1,Pe,!0),Kr("singleCursorHeightPerLine",!0,Pe,!0),Kr("workTime",100),Kr("workDelay",100),Kr("flattenSpans",!0,n,!0),Kr("addModeClass",!1,n,!0),Kr("pollInterval",100),Kr("undoDepth",200,function(e,t){e.doc.history.undoDepth=t}),Kr("historyEventDelay",1250),Kr("viewportMargin",10,function(e){e.refresh()},!0),Kr("maxHighlightLength",1e4,n,!0),Kr("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),Kr("tabindex",null,function(e,t){e.display.input.getField().tabIndex=t||""}),Kr("autofocus",null);var rl=e.modes={},nl=e.mimeModes={};e.defineMode=function(t,r){e.defaults.mode||"null"==t||(e.defaults.mode=t),arguments.length>2&&(r.dependencies=Array.prototype.slice.call(arguments,2)),rl[t]=r},e.defineMIME=function(e,t){nl[e]=t},e.resolveMode=function(t){if("string"==typeof t&&nl.hasOwnProperty(t))t=nl[t];else if(t&&"string"==typeof t.name&&nl.hasOwnProperty(t.name)){var r=nl[t.name];"string"==typeof r&&(r={name:r}),t=Ii(r,t),t.name=r.name}else if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return e.resolveMode("application/xml");return"string"==typeof t?{name:t}:t||{name:"null"}},e.getMode=function(t,r){var r=e.resolveMode(r),n=rl[r.name];if(!n)return e.getMode(t,"text/plain");var i=n(t,r);if(il.hasOwnProperty(r.name)){var o=il[r.name];for(var l in o)o.hasOwnProperty(l)&&(i.hasOwnProperty(l)&&(i["_"+l]=i[l]),i[l]=o[l])}if(i.name=r.name,r.helperType&&(i.helperType=r.helperType),r.modeProps)for(var l in r.modeProps)i[l]=r.modeProps[l];return i},e.defineMode("null",function(){return{token:function(e){e.skipToEnd()}}}),e.defineMIME("text/plain","null");var il=e.modeExtensions={};e.extendMode=function(e,t){var r=il.hasOwnProperty(e)?il[e]:il[e]={};zi(t,r)},e.defineExtension=function(t,r){e.prototype[t]=r},e.defineDocExtension=function(e,t){Sl.prototype[e]=t},e.defineOption=Kr;var ol=[];e.defineInitHook=function(e){ol.push(e)};var ll=e.helpers={};e.registerHelper=function(t,r,n){ll.hasOwnProperty(t)||(ll[t]=e[t]={_global:[]}),ll[t][r]=n},e.registerGlobalHelper=function(t,r,n,i){e.registerHelper(t,r,i),ll[t]._global.push({pred:n,val:i})};var sl=e.copyState=function(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},al=e.startState=function(e,t,r){return e.startState?e.startState(t,r):!0};e.innerMode=function(e,t){for(;e.innerMode;){var r=e.innerMode(t);if(!r||r.mode==e)break;t=r.state,e=r.mode}return r||{mode:e,state:t}};var ul=e.commands={selectAll:function(e){e.setSelection(zo(e.firstLine(),0),zo(e.lastLine()),Il)},singleSelection:function(e){e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Il)},killLine:function(e){Gr(e,function(t){if(t.empty()){var r=Zn(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line0)i=new zo(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),zo(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var l=Zn(e.doc,i.line-1).text;l&&e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),zo(i.line-1,l.length-1),zo(i.line,1),"+transpose")}r.push(new he(i,i))}e.setSelections(r)})},newlineAndIndent:function(e){Wt(e,function(){for(var t=e.listSelections().length,r=0;t>r;r++){var n=e.listSelections()[r];e.replaceRange(e.doc.lineSeparator(),n.anchor,n.head,"+input"),e.indentLine(n.from().line+1,null,!0)}zr(e)})},toggleOverwrite:function(e){e.toggleOverwrite()}},cl=e.keyMap={};cl.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},cl.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},cl.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars"},cl.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},cl.default=Ao?cl.macDefault:cl.pcDefault,e.normalizeKeyMap=function(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if("..."==n){delete e[r];continue}for(var i=Pi(r.split(" "),jr),o=0;o=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.post},eatSpace:function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);return t>-1?(this.pos=t,!0):void 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);return i(o)==i(e)?(t!==!1&&(this.pos+=e.length),!0):void 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}}};var gl=0,vl=e.TextMarker=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++gl};Wi(vl),vl.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&wt(e),Ni(this,"clear")){var r=this.find();r&&Li(this,"clear",r.from,r.to)}for(var n=null,i=null,o=0;oe.display.maxLineLength&&(e.display.maxLine=a,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=n&&e&&this.collapsed&&Et(e,n,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&We(e.doc)),e&&Li(e,"markerCleared",e,this),t&&Ct(e),this.parent&&this.parent.clear()}},vl.prototype.find=function(e,t){null==e&&"bookmark"==this.type&&(e=1);for(var r,n,i=0;ir;++r){var i=this.lines[r];this.height-=i.height,Nn(i),Li(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;ne;++e)if(r(this.lines[e]))return!0}},_n.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var r=0;re){var o=Math.min(t,i-e),l=n.height;if(n.removeInner(e,o),this.height-=l-n.height,i==o&&(this.children.splice(r--,1),n.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Yn))){var s=[];this.collapse(s),this.children=[new Yn(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t=e){if(i.insertInner(e,t,r),i.lines&&i.lines.length>50){for(;i.lines.length>50;){var l=i.lines.splice(i.lines.length-25,25),s=new Yn(l);i.height-=s.height,this.children.splice(n+1,0,s),s.parent=this}this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),r=new _n(t);if(e.parent){e.size-=r.size,e.height-=r.height;var n=Hi(e.parent.children,e);e.parent.children.splice(n+1,0,r)}else{var i=new _n(e.children);i.parent=e,e.children=[i,r],e=i}r.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var n=0;ne){var l=Math.min(t,o-e);if(i.iterN(e,l,r))return!0;if(0==(t-=l))break;e=0}else e-=o}}};var Cl=0,Sl=e.Doc=function(e,t,r,n){if(!(this instanceof Sl))return new Sl(e,t,r,n);null==r&&(r=0),_n.call(this,[new Yn([new bl("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=r;var i=zo(r,0);this.sel=de(i),this.history=new oi(null),this.id=++Cl,this.modeOption=t,this.lineSep=n,this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Xn(this,{from:i,to:i,text:e}),ke(this,de(i),Il)};Sl.prototype=Ii(_n.prototype,{constructor:Sl,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,n=0;n=0;o--)Tr(this,n[o]);s?Te(this,s):this.cm&&zr(this.cm)}),undo:Dt(function(){Mr(this,"undo")}),redo:Dt(function(){Mr(this,"redo")}),undoSelection:Dt(function(){Mr(this,"undo",!0)}),redoSelection:Dt(function(){Mr(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=ge(this,e),t=ge(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;sa.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-=i,void++r)}),ge(this,zo(r,t))},indexFromPos:function(e){e=ge(this,e);var t=e.ch;return e.linet&&(t=e.from),null!=e.to&&e.tos||s>=t)return l+(t-o);l+=s-o,l+=r-l%r,o=s+1}},Bl=e.findColumn=function(e,t,r){for(var n=0,i=0;;){var o=e.indexOf(" ",n);-1==o&&(o=e.length);var l=o-n;if(o==e.length||i+l>=t)return n+Math.min(l,t-i);if(i+=o-n,i+=r-i%r,n=o+1,i>=t)return n}},Gl=[""],Ul=function(e){e.select()};No?Ul=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:bo&&(Ul=function(e){try{e.select()}catch(t){}});var Vl,Kl=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,jl=e.isWordChar=function(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||Kl.test(e))},Xl=/[\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]/;Vl=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(i){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};var Yl=e.contains=function(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do if(11==t.nodeType&&(t=t.host),t==e)return!0;while(t=t.parentNode)};bo&&11>wo&&(ji=function(){try{return document.activeElement}catch(e){return document.body}});var _l,$l,ql=e.rmClass=function(e,t){var r=e.className,n=Xi(t).exec(r);if(n){var i=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(i?n[1]+i:"")}},Zl=e.addClass=function(e,t){var r=e.className;Xi(t).test(r)||(e.className+=(r?" ":"")+t)},Ql=!1,Jl=function(){if(bo&&9>wo)return!1;var e=Ui("div");return"draggable"in e||"dragDrop"in e}(),es=e.splitLines=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],n=e.length;n>=t;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),l=o.indexOf("\r");-1!=l?(r.push(o.slice(0,l)),t+=l+1):(r.push(o),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},ts=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(r){}return t&&t.parentElement()==e?0!=t.compareEndPoints("StartToEnd",t):!1},rs=function(){var e=Ui("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),ns=null,is=e.keyNames={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};!function(){for(var e=0;10>e;e++)is[e+48]=is[e+96]=String(e);for(var e=65;90>=e;e++)is[e]=String.fromCharCode(e);for(var e=1;12>=e;e++)is[e+111]=is[e+63235]="F"+e}();var os,ls=function(){function e(e){return 247>=e?r.charAt(e):e>=1424&&1524>=e?"R":e>=1536&&1773>=e?n.charAt(e-1536):e>=1774&&2220>=e?"r":e>=8192&&8203>=e?"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="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",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,c=r.length,h=[],f=0;c>f;++f)h.push(n=e(r.charCodeAt(f)));for(var f=0,d=u;c>f;++f){var n=h[f];"m"==n?h[f]=d:d=n}for(var f=0,p=u;c>f;++f){var n=h[f];"1"==n&&"r"==p?h[f]="n":l.test(n)&&(p=n,"r"==n&&(h[f]="R"))}for(var f=1,d=h[0];c-1>f;++f){var n=h[f];"+"==n&&"1"==d&&"1"==h[f+1]?h[f]="1":","!=n||d!=h[f+1]||"1"!=d&&"n"!=d||(h[f]=d),d=n}for(var f=0;c>f;++f){var n=h[f];if(","==n)h[f]="N";else if("%"==n){for(var g=f+1;c>g&&"%"==h[g];++g);for(var v=f&&"!"==h[f-1]||c>g&&"1"==h[g]?"1":"N",m=f;g>m;++m)h[m]=v;f=g-1}}for(var f=0,p=u;c>f;++f){var n=h[f];"L"==p&&"1"==n?h[f]="L":l.test(n)&&(p=n)}for(var f=0;c>f;++f)if(o.test(h[f])){for(var g=f+1;c>g&&o.test(h[g]);++g);for(var y="L"==(f?h[f-1]:u),b="L"==(c>g?h[g]:u),v=y||b?"L":"R",m=f;g>m;++m)h[m]=v;f=g-1}for(var w,x=[],f=0;c>f;)if(s.test(h[f])){var C=f;for(++f;c>f&&s.test(h[f]);++f);x.push(new t(0,C,f))}else{var S=f,L=x.length;for(++f;c>f&&"L"!=h[f];++f);for(var m=S;f>m;)if(a.test(h[m])){m>S&&x.splice(L,0,new t(1,S,m));var T=m;for(++m;f>m&&a.test(h[m]);++m);x.splice(L,0,new t(2,T,m)),S=m}else++m;f>S&&x.splice(L,0,new t(1,S,f))}return 1==x[0].level&&(w=r.match(/^\s+/))&&(x[0].from=w[0].length,x.unshift(new t(0,0,w[0].length))),1==Di(x).level&&(w=r.match(/\s+$/))&&(Di(x).to-=w[0].length,x.push(new t(0,c-w[0].length,c))),2==x[0].level&&x.unshift(new t(1,x[0].to,x[0].to)),x[0].level!=Di(x).level&&x.push(new t(x[0].level,c,c)),x}}();return e.version="5.13.2",e})},{}],60:[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){return/^(?:operator|sof|keyword c|case|new|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(r||0)))}e.defineMode("javascript",function(r,n){function a(e){for(var t,r=!1,n=!1;null!=(t=e.next());){if(!r){if("/"==t&&!n)return;"["==t?n=!0:n&&"]"==t&&(n=!1)}r=!r&&"\\"==t}}function i(e,t,r){return he=e,we=r,t}function o(e,r){var n=e.next();if('"'==n||"'"==n)return r.tokenize=c(n),r.tokenize(e,r);if("."==n&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return i("number","number");if("."==n&&e.match(".."))return i("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return i(n);if("="==n&&e.eat(">"))return i("=>","operator");if("0"==n&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),i("number","number");if("0"==n&&e.eat(/o/i))return e.eatWhile(/[0-7]/i),i("number","number");if("0"==n&&e.eat(/b/i))return e.eatWhile(/[01]/i),i("number","number");if(/\d/.test(n))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),i("number","number");if("/"==n)return e.eat("*")?(r.tokenize=u,u(e,r)):e.eat("/")?(e.skipToEnd(),i("comment","comment")):t(e,r,1)?(a(e),e.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),i("regexp","string-2")):(e.eatWhile(Ae),i("operator","operator",e.current()));if("`"==n)return r.tokenize=l,l(e,r);if("#"==n)return e.skipToEnd(),i("error","error");if(Ae.test(n))return e.eatWhile(Ae),i("operator","operator",e.current());if(Ie.test(n)){e.eatWhile(Ie);var o=e.current(),s=ze.propertyIsEnumerable(o)&&ze[o];return s&&"."!=r.lastType?i(s.type,s.style,o):i("variable","variable",o)}}function c(e){return function(t,r){var n,a=!1;if(Me&&"@"==t.peek()&&t.match(Te))return r.tokenize=o,i("jsonld-keyword","meta");for(;null!=(n=t.next())&&(n!=e||a);)a=!a&&"\\"==n;return a||(r.tokenize=o),i("string","string")}}function u(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=o;break}n="*"==r}return i("comment","comment")}function l(e,t){for(var r,n=!1;null!=(r=e.next());){if(!n&&("`"==r||"$"==r&&e.eat("{"))){t.tokenize=o;break}n=!n&&"\\"==r}return i("quasi","string-2",e.current())}function s(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var r=e.string.indexOf("=>",e.start);if(!(0>r)){for(var n=0,a=!1,i=r-1;i>=0;--i){var o=e.string.charAt(i),c=$e.indexOf(o);if(c>=0&&3>c){if(!n){++i;break}if(0==--n)break}else if(c>=3&&6>c)++n;else if(Ie.test(o))a=!0;else{if(/["'\/]/.test(o))return;if(a&&!n){++i;break}}}a&&!n&&(t.fatArrowAt=i)}}function f(e,t,r,n,a,i){this.indented=e,this.column=t,this.type=r,this.prev=a,this.info=i,null!=n&&(this.align=n)}function d(e,t){for(var r=e.localVars;r;r=r.next)if(r.name==t)return!0;for(var n=e.context;n;n=n.prev)for(var r=n.vars;r;r=r.next)if(r.name==t)return!0}function p(e,t,r,n,a){var i=e.cc;for(Ce.state=e,Ce.stream=a,Ce.marked=null,Ce.cc=i,Ce.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){var o=i.length?i.pop():Ve?j:g;if(o(r,n)){for(;i.length&&i[i.length-1].lex;)i.pop()();return Ce.marked?Ce.marked:"variable"==r&&d(e,n)?"variable-2":t}}}function m(){for(var e=arguments.length-1;e>=0;e--)Ce.cc.push(arguments[e])}function v(){return m.apply(null,arguments),!0}function y(e){function t(t){for(var r=t;r;r=r.next)if(r.name==e)return!0;return!1}var r=Ce.state;if(Ce.marked="def",r.context){if(t(r.localVars))return;r.localVars={name:e,next:r.localVars}}else{if(t(r.globalVars))return;n.globalVars&&(r.globalVars={name:e,next:r.globalVars})}}function k(){Ce.state.context={prev:Ce.state.context,vars:Ce.state.localVars},Ce.state.localVars=We}function b(){Ce.state.localVars=Ce.state.context.vars,Ce.state.context=Ce.state.context.prev}function x(e,t){var r=function(){var r=Ce.state,n=r.indented;if("stat"==r.lexical.type)n=r.lexical.indented;else for(var a=r.lexical;a&&")"==a.type&&a.align;a=a.prev)n=a.indented;r.lexical=new f(n,Ce.stream.column(),e,null,r.lexical,t)};return r.lex=!0,r}function h(){var e=Ce.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function w(e){function t(r){return r==e?v():";"==e?m():v(t)}return t}function g(e,t){return"var"==e?v(x("vardef",t.length),Q,w(";"),h):"keyword a"==e?v(x("form"),j,g,h):"keyword b"==e?v(x("form"),g,h):"{"==e?v(x("}"),G,h):";"==e?v():"if"==e?("else"==Ce.state.lexical.info&&Ce.state.cc[Ce.state.cc.length-1]==h&&Ce.state.cc.pop()(),v(x("form"),j,g,h,_)):"function"==e?v(ie):"for"==e?v(x("form"),ee,g,h):"variable"==e?v(x("stat"),S):"switch"==e?v(x("form"),j,x("}","switch"),w("{"),G,h,h):"case"==e?v(j,w(":")):"default"==e?v(w(":")):"catch"==e?v(x("form"),k,w("("),oe,w(")"),g,h,b):"class"==e?v(x("form"),ce,h):"export"==e?v(x("stat"),fe,h):"import"==e?v(x("stat"),de,h):"module"==e?v(x("form"),R,x("}"),w("{"),G,h,h):m(x("stat"),j,w(";"),h)}function j(e){return V(e,!1)}function M(e){return V(e,!0)}function V(e,t){if(Ce.state.fatArrowAt==Ce.stream.start){var r=t?C:q;if("("==e)return v(k,x(")"),D(R,")"),h,w("=>"),r,b);if("variable"==e)return m(k,R,w("=>"),r,b)}var n=t?A:z;return qe.hasOwnProperty(e)?v(n):"function"==e?v(ie,n):"keyword c"==e?v(t?I:E):"("==e?v(x(")"),E,be,w(")"),h,n):"operator"==e||"spread"==e?v(t?M:j):"["==e?v(x("]"),ye,h,n):"{"==e?F(B,"}",null,n):"quasi"==e?m(T,n):"new"==e?v(W(t)):v()}function E(e){return e.match(/[;\}\)\],]/)?m():m(j)}function I(e){return e.match(/[;\}\)\],]/)?m():m(M)}function z(e,t){return","==e?v(j):A(e,t,!1)}function A(e,t,r){var n=0==r?z:A,a=0==r?j:M;return"=>"==e?v(k,r?C:q,b):"operator"==e?/\+\+|--/.test(t)?v(n):"?"==t?v(j,w(":"),a):v(a):"quasi"==e?m(T,n):";"!=e?"("==e?F(M,")","call",n):"."==e?v(N,n):"["==e?v(x("]"),E,w("]"),h,n):void 0:void 0}function T(e,t){return"quasi"!=e?m():"${"!=t.slice(t.length-2)?v(T):v(j,$)}function $(e){return"}"==e?(Ce.marked="string-2",Ce.state.tokenize=l,v(T)):void 0}function q(e){return s(Ce.stream,Ce.state),m("{"==e?g:j)}function C(e){return s(Ce.stream,Ce.state),m("{"==e?g:M)}function W(e){return function(t){return"."==t?v(e?P:O):m(e?M:j)}}function O(e,t){return"target"==t?(Ce.marked="keyword",v(z)):void 0}function P(e,t){return"target"==t?(Ce.marked="keyword",v(A)):void 0}function S(e){return":"==e?v(h,g):m(z,w(";"),h)}function N(e){return"variable"==e?(Ce.marked="property",v()):void 0}function B(e,t){return"variable"==e||"keyword"==Ce.style?(Ce.marked="property",v("get"==t||"set"==t?H:U)):"number"==e||"string"==e?(Ce.marked=Me?"property":Ce.style+" property",v(U)):"jsonld-keyword"==e?v(U):"modifier"==e?v(B):"["==e?v(j,w("]"),U):"spread"==e?v(j):void 0}function H(e){return"variable"!=e?m(U):(Ce.marked="property",v(ie))}function U(e){return":"==e?v(M):"("==e?m(ie):void 0}function D(e,t){function r(n){if(","==n){var a=Ce.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),v(e,r)}return n==t?v():v(w(t))}return function(n){return n==t?v():m(e,r)}}function F(e,t,r){for(var n=3;n!?|~^]/,Te=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,$e="([{}])",qe={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0},Ce={state:null,column:null,marked:null,cc:null},We={name:"this",next:{name:"arguments"}};return h.lex=!0,{startState:function(e){var t={tokenize:o,lastType:"sof",cc:[],lexical:new f((e||0)-ge,0,"block",!1),localVars:n.localVars,context:n.localVars&&{vars:n.localVars},indented:e||0};return n.globalVars&&"object"==typeof n.globalVars&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),s(e,t)),t.tokenize!=u&&e.eatSpace())return null;var r=t.tokenize(e,t);return"comment"==he?r:(t.lastType="operator"!=he||"++"!=we&&"--"!=we?he:"incdec",p(t,r,he,we,e))},indent:function(t,r){if(t.tokenize==u)return e.Pass;if(t.tokenize!=o)return 0;var a=r&&r.charAt(0),i=t.lexical;if(!/^\s*else\b/.test(r))for(var c=t.cc.length-1;c>=0;--c){var l=t.cc[c];if(l==h)i=i.prev;else if(l!=_)break}"stat"==i.type&&"}"==a&&(i=i.prev),je&&")"==i.type&&"stat"==i.prev.type&&(i=i.prev);var s=i.type,f=a==s;return"vardef"==s?i.indented+("operator"==t.lastType||","==t.lastType?i.info+1:0):"form"==s&&"{"==a?i.indented:"form"==s?i.indented+ge:"stat"==s?i.indented+(xe(t,r)?je||ge:0):"switch"!=i.info||f||0==n.doubleIndentSwitch?i.align?i.column+(f?0:1):i.indented+(f?0:ge):i.indented+(/^(?:case|default)\b/.test(r)?ge:2*ge)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:Ve?null:"/*",blockCommentEnd:Ve?null:"*/",lineComment:Ve?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:Ve?"json":"javascript",jsonldMode:Me,jsonMode:Ve,expressionAllowed:t,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=j&&t!=M||e.cc.pop()}}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})})},{"../../lib/codemirror":59}],61:[function(require,module,exports){require("../../modules/es6.string.iterator"),require("../../modules/es6.array.from"),module.exports=require("../../modules/$.core").Array.from},{"../../modules/$.core":81,"../../modules/es6.array.from":129,"../../modules/es6.string.iterator":139}],62:[function(require,module,exports){require("../modules/web.dom.iterable"),require("../modules/es6.string.iterator"),module.exports=require("../modules/core.get-iterator")},{"../modules/core.get-iterator":127,"../modules/es6.string.iterator":139,"../modules/web.dom.iterable":142}],63:[function(require,module,exports){require("../modules/web.dom.iterable"),require("../modules/es6.string.iterator"),module.exports=require("../modules/core.is-iterable")},{"../modules/core.is-iterable":128,"../modules/es6.string.iterator":139,"../modules/web.dom.iterable":142}],64:[function(require,module,exports){require("../modules/es6.object.to-string"),require("../modules/es6.string.iterator"),require("../modules/web.dom.iterable"),require("../modules/es6.map"),require("../modules/es7.map.to-json"),module.exports=require("../modules/$.core").Map},{"../modules/$.core":81,"../modules/es6.map":131,"../modules/es6.object.to-string":136,"../modules/es6.string.iterator":139,"../modules/es7.map.to-json":140,"../modules/web.dom.iterable":142}],65:[function(require,module,exports){require("../../modules/es6.object.assign"),module.exports=require("../../modules/$.core").Object.assign},{"../../modules/$.core":81,"../../modules/es6.object.assign":132}],66:[function(require,module,exports){var $=require("../../modules/$");module.exports=function(e,r){return $.create(e,r)}},{"../../modules/$":103}],67:[function(require,module,exports){var $=require("../../modules/$");module.exports=function(e,r,u){return $.setDesc(e,r,u)}},{"../../modules/$":103}],68:[function(require,module,exports){var $=require("../../modules/$");require("../../modules/es6.object.get-own-property-descriptor"),module.exports=function(e,r){return $.getDesc(e,r)}},{"../../modules/$":103,"../../modules/es6.object.get-own-property-descriptor":133}],69:[function(require,module,exports){require("../../modules/es6.object.keys"),module.exports=require("../../modules/$.core").Object.keys},{"../../modules/$.core":81,"../../modules/es6.object.keys":134}],70:[function(require,module,exports){require("../../modules/es6.object.set-prototype-of"),module.exports=require("../../modules/$.core").Object.setPrototypeOf},{"../../modules/$.core":81,"../../modules/es6.object.set-prototype-of":135}],71:[function(require,module,exports){require("../modules/es6.object.to-string"),require("../modules/es6.string.iterator"),require("../modules/web.dom.iterable"),require("../modules/es6.promise"),module.exports=require("../modules/$.core").Promise},{"../modules/$.core":81,"../modules/es6.object.to-string":136,"../modules/es6.promise":137,"../modules/es6.string.iterator":139,"../modules/web.dom.iterable":142}],72:[function(require,module,exports){require("../modules/es6.object.to-string"),require("../modules/es6.string.iterator"),require("../modules/web.dom.iterable"),require("../modules/es6.set"),require("../modules/es7.set.to-json"),module.exports=require("../modules/$.core").Set},{"../modules/$.core":81,"../modules/es6.object.to-string":136,"../modules/es6.set":138,"../modules/es6.string.iterator":139,"../modules/es7.set.to-json":141,"../modules/web.dom.iterable":142}],73:[function(require,module,exports){module.exports=function(o){if("function"!=typeof o)throw TypeError(o+" is not a function!");return o}},{}],74:[function(require,module,exports){module.exports=function(){}},{}],75:[function(require,module,exports){var isObject=require("./$.is-object");module.exports=function(e){if(!isObject(e))throw TypeError(e+" is not an object!");return e}},{"./$.is-object":96}],76:[function(require,module,exports){var cof=require("./$.cof"),TAG=require("./$.wks")("toStringTag"),ARG="Arguments"==cof(function(){return arguments}());module.exports=function(e){var n,r,t;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=(n=Object(e))[TAG])?r:ARG?cof(n):"Object"==(t=cof(n))&&"function"==typeof n.callee?"Arguments":t}},{"./$.cof":77,"./$.wks":125}],77:[function(require,module,exports){var toString={}.toString;module.exports=function(t){return toString.call(t).slice(8,-1)}},{}],78:[function(require,module,exports){"use strict";var $=require("./$"),hide=require("./$.hide"),redefineAll=require("./$.redefine-all"),ctx=require("./$.ctx"),strictNew=require("./$.strict-new"),defined=require("./$.defined"),forOf=require("./$.for-of"),$iterDefine=require("./$.iter-define"),step=require("./$.iter-step"),ID=require("./$.uid")("id"),$has=require("./$.has"),isObject=require("./$.is-object"),setSpecies=require("./$.set-species"),DESCRIPTORS=require("./$.descriptors"),isExtensible=Object.isExtensible||isObject,SIZE=DESCRIPTORS?"_s":"size",id=0,fastKey=function(e,t){if(!isObject(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!$has(e,ID)){if(!isExtensible(e))return"F";if(!t)return"E";hide(e,ID,++id)}return"O"+e[ID]},getEntry=function(e,t){var r,i=fastKey(t);if("F"!==i)return e._i[i];for(r=e._f;r;r=r.n)if(r.k==t)return r};module.exports={getConstructor:function(e,t,r,i){var n=e(function(e,s){strictNew(e,n,t),e._i=$.create(null),e._f=void 0,e._l=void 0,e[SIZE]=0,void 0!=s&&forOf(s,r,e[i],e)});return redefineAll(n.prototype,{clear:function(){for(var e=this,t=e._i,r=e._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete t[r.i];e._f=e._l=void 0,e[SIZE]=0},delete:function(e){var t=this,r=getEntry(t,e);if(r){var i=r.n,n=r.p;delete t._i[r.i],r.r=!0,n&&(n.n=i),i&&(i.p=n),t._f==r&&(t._f=i),t._l==r&&(t._l=n),t[SIZE]--}return!!r},forEach:function(e){for(var t,r=ctx(e,arguments.length>1?arguments[1]:void 0,3);t=t?t.n:this._f;)for(r(t.v,t.k,this);t&&t.r;)t=t.p},has:function(e){return!!getEntry(this,e)}}),DESCRIPTORS&&$.setDesc(n.prototype,"size",{get:function(){return defined(this[SIZE])}}),n},def:function(e,t,r){var i,n,s=getEntry(e,t);return s?s.v=r:(e._l=s={i:n=fastKey(t,!0),k:t,v:r,p:i=e._l,n:void 0,r:!1},e._f||(e._f=s),i&&(i.n=s),e[SIZE]++,"F"!==n&&(e._i[n]=s)),e},getEntry:getEntry,setStrong:function(e,t,r){$iterDefine(e,t,function(e,t){this._t=e,this._k=t,this._l=void 0},function(){for(var e=this,t=e._k,r=e._l;r&&r.r;)r=r.p;return e._t&&(e._l=r=r?r.n:e._t._f)?"keys"==t?step(0,r.k):"values"==t?step(0,r.v):step(0,[r.k,r.v]):(e._t=void 0,step(1))},r?"entries":"values",!r,!0),setSpecies(t)}}},{"./$":103,"./$.ctx":82,"./$.defined":83,"./$.descriptors":84,"./$.for-of":88,"./$.has":90,"./$.hide":91,"./$.is-object":96,"./$.iter-define":99,"./$.iter-step":101,"./$.redefine-all":109,"./$.set-species":113,"./$.strict-new":117,"./$.uid":124}],79:[function(require,module,exports){var forOf=require("./$.for-of"),classof=require("./$.classof");module.exports=function(r){return function(){if(classof(this)!=r)throw TypeError(r+"#toJSON isn't generic");var o=[];return forOf(this,!1,o.push,o),o}}},{"./$.classof":76,"./$.for-of":88}],80:[function(require,module,exports){"use strict";var $=require("./$"),global=require("./$.global"),$export=require("./$.export"),fails=require("./$.fails"),hide=require("./$.hide"),redefineAll=require("./$.redefine-all"),forOf=require("./$.for-of"),strictNew=require("./$.strict-new"),isObject=require("./$.is-object"),setToStringTag=require("./$.set-to-string-tag"),DESCRIPTORS=require("./$.descriptors");module.exports=function(e,r,t,i,o,s){var n=global[e],c=n,u=o?"set":"add",a=c&&c.prototype,f={};return DESCRIPTORS&&"function"==typeof c&&(s||a.forEach&&!fails(function(){(new c).entries().next()}))?(c=r(function(r,t){strictNew(r,c,e),r._c=new n,void 0!=t&&forOf(t,o,r[u],r)}),$.each.call("add,clear,delete,forEach,get,has,set,keys,values,entries".split(","),function(e){var r="add"==e||"set"==e;e in a&&(!s||"clear"!=e)&&hide(c.prototype,e,function(t,i){if(!r&&s&&!isObject(t))return"get"==e?void 0:!1;var o=this._c[e](0===t?0:t,i);return r?this:o})}),"size"in a&&$.setDesc(c.prototype,"size",{get:function(){return this._c.size}})):(c=i.getConstructor(r,e,o,u),redefineAll(c.prototype,t)),setToStringTag(c,e),f[e]=c,$export($export.G+$export.W+$export.F,f),s||i.setStrong(c,e,o),c}},{"./$":103,"./$.descriptors":84,"./$.export":86,"./$.fails":87,"./$.for-of":88,"./$.global":89,"./$.hide":91,"./$.is-object":96,"./$.redefine-all":109,"./$.set-to-string-tag":114,"./$.strict-new":117}],81:[function(require,module,exports){var core=module.exports={version:"1.2.6"};"number"==typeof __e&&(__e=core)},{}],82:[function(require,module,exports){var aFunction=require("./$.a-function");module.exports=function(n,r,t){if(aFunction(n),void 0===r)return n;switch(t){case 1:return function(t){return n.call(r,t)};case 2:return function(t,u){return n.call(r,t,u)};case 3:return function(t,u,e){return n.call(r,t,u,e)}}return function(){return n.apply(r,arguments)}}},{"./$.a-function":73}],83:[function(require,module,exports){module.exports=function(o){if(void 0==o)throw TypeError("Can't call method on "+o);return o}},{}],84:[function(require,module,exports){module.exports=!require("./$.fails")(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},{"./$.fails":87}],85:[function(require,module,exports){var isObject=require("./$.is-object"),document=require("./$.global").document,is=isObject(document)&&isObject(document.createElement);module.exports=function(e){return is?document.createElement(e):{}}},{"./$.global":89,"./$.is-object":96}],86:[function(require,module,exports){var global=require("./$.global"),core=require("./$.core"),ctx=require("./$.ctx"),PROTOTYPE="prototype",$export=function(o,r,e){var t,n,p,x=o&$export.F,c=o&$export.G,$=o&$export.S,l=o&$export.P,i=o&$export.B,P=o&$export.W,u=c?core:core[r]||(core[r]={}),O=c?global:$?global[r]:(global[r]||{})[PROTOTYPE];c&&(e=r);for(t in e)n=!x&&O&&t in O,n&&t in u||(p=n?O[t]:e[t],u[t]=c&&"function"!=typeof O[t]?e[t]:i&&n?ctx(p,global):P&&O[t]==p?function(o){var r=function(r){return this instanceof o?new o(r):o(r)};return r[PROTOTYPE]=o[PROTOTYPE],r}(p):l&&"function"==typeof p?ctx(Function.call,p):p,l&&((u[PROTOTYPE]||(u[PROTOTYPE]={}))[t]=p))};$export.F=1,$export.G=2,$export.S=4,$export.P=8,$export.B=16,$export.W=32,module.exports=$export},{"./$.core":81,"./$.ctx":82,"./$.global":89}],87:[function(require,module,exports){module.exports=function(r){try{return!!r()}catch(t){return!0}}},{}],88:[function(require,module,exports){var ctx=require("./$.ctx"),call=require("./$.iter-call"),isArrayIter=require("./$.is-array-iter"),anObject=require("./$.an-object"),toLength=require("./$.to-length"),getIterFn=require("./core.get-iterator-method");module.exports=function(e,r,t,i){var o,a,n,l=getIterFn(e),c=ctx(t,i,r?2:1),u=0;if("function"!=typeof l)throw TypeError(e+" is not iterable!");if(isArrayIter(l))for(o=toLength(e.length);o>u;u++)r?c(anObject(a=e[u])[0],a[1]):c(e[u]);else for(n=l.call(e);!(a=n.next()).done;)call(n,c,a.value,r)}},{"./$.an-object":75,"./$.ctx":82,"./$.is-array-iter":95,"./$.iter-call":97,"./$.to-length":122,"./core.get-iterator-method":126}],89:[function(require,module,exports){var global=module.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=global)},{}],90:[function(require,module,exports){var hasOwnProperty={}.hasOwnProperty;module.exports=function(r,e){return hasOwnProperty.call(r,e)}},{}],91:[function(require,module,exports){var $=require("./$"),createDesc=require("./$.property-desc");module.exports=require("./$.descriptors")?function(e,r,t){return $.setDesc(e,r,createDesc(1,t))}:function(e,r,t){return e[r]=t,e}},{"./$":103,"./$.descriptors":84, -"./$.property-desc":108}],92:[function(require,module,exports){module.exports=require("./$.global").document&&document.documentElement},{"./$.global":89}],93:[function(require,module,exports){module.exports=function(e,r,l){var a=void 0===l;switch(r.length){case 0:return a?e():e.call(l);case 1:return a?e(r[0]):e.call(l,r[0]);case 2:return a?e(r[0],r[1]):e.call(l,r[0],r[1]);case 3:return a?e(r[0],r[1],r[2]):e.call(l,r[0],r[1],r[2]);case 4:return a?e(r[0],r[1],r[2],r[3]):e.call(l,r[0],r[1],r[2],r[3])}return e.apply(l,r)}},{}],94:[function(require,module,exports){var cof=require("./$.cof");module.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==cof(e)?e.split(""):Object(e)}},{"./$.cof":77}],95:[function(require,module,exports){var Iterators=require("./$.iterators"),ITERATOR=require("./$.wks")("iterator"),ArrayProto=Array.prototype;module.exports=function(r){return void 0!==r&&(Iterators.Array===r||ArrayProto[ITERATOR]===r)}},{"./$.iterators":102,"./$.wks":125}],96:[function(require,module,exports){module.exports=function(o){return"object"==typeof o?null!==o:"function"==typeof o}},{}],97:[function(require,module,exports){var anObject=require("./$.an-object");module.exports=function(r,t,e,a){try{return a?t(anObject(e)[0],e[1]):t(e)}catch(c){var n=r.return;throw void 0!==n&&anObject(n.call(r)),c}}},{"./$.an-object":75}],98:[function(require,module,exports){"use strict";var $=require("./$"),descriptor=require("./$.property-desc"),setToStringTag=require("./$.set-to-string-tag"),IteratorPrototype={};require("./$.hide")(IteratorPrototype,require("./$.wks")("iterator"),function(){return this}),module.exports=function(r,t,e){r.prototype=$.create(IteratorPrototype,{next:descriptor(1,e)}),setToStringTag(r,t+" Iterator")}},{"./$":103,"./$.hide":91,"./$.property-desc":108,"./$.set-to-string-tag":114,"./$.wks":125}],99:[function(require,module,exports){"use strict";var LIBRARY=require("./$.library"),$export=require("./$.export"),redefine=require("./$.redefine"),hide=require("./$.hide"),has=require("./$.has"),Iterators=require("./$.iterators"),$iterCreate=require("./$.iter-create"),setToStringTag=require("./$.set-to-string-tag"),getProto=require("./$").getProto,ITERATOR=require("./$.wks")("iterator"),BUGGY=!([].keys&&"next"in[].keys()),FF_ITERATOR="@@iterator",KEYS="keys",VALUES="values",returnThis=function(){return this};module.exports=function(e,r,t,i,n,s,u){$iterCreate(t,r,i);var o,a,T=function(e){if(!BUGGY&&e in E)return E[e];switch(e){case KEYS:return function(){return new t(this,e)};case VALUES:return function(){return new t(this,e)}}return function(){return new t(this,e)}},R=r+" Iterator",h=n==VALUES,A=!1,E=e.prototype,$=E[ITERATOR]||E[FF_ITERATOR]||n&&E[n],f=$||T(n);if($){var I=getProto(f.call(new e));setToStringTag(I,R,!0),!LIBRARY&&has(E,FF_ITERATOR)&&hide(I,ITERATOR,returnThis),h&&$.name!==VALUES&&(A=!0,f=function(){return $.call(this)})}if(LIBRARY&&!u||!BUGGY&&!A&&E[ITERATOR]||hide(E,ITERATOR,f),Iterators[r]=f,Iterators[R]=returnThis,n)if(o={values:h?f:T(VALUES),keys:s?f:T(KEYS),entries:h?T("entries"):f},u)for(a in o)a in E||redefine(E,a,o[a]);else $export($export.P+$export.F*(BUGGY||A),r,o);return o}},{"./$":103,"./$.export":86,"./$.has":90,"./$.hide":91,"./$.iter-create":98,"./$.iterators":102,"./$.library":104,"./$.redefine":110,"./$.set-to-string-tag":114,"./$.wks":125}],100:[function(require,module,exports){var ITERATOR=require("./$.wks")("iterator"),SAFE_CLOSING=!1;try{var riter=[7][ITERATOR]();riter.return=function(){SAFE_CLOSING=!0},Array.from(riter,function(){throw 2})}catch(e){}module.exports=function(r,t){if(!t&&!SAFE_CLOSING)return!1;var n=!1;try{var e=[7],i=e[ITERATOR]();i.next=function(){n=!0},e[ITERATOR]=function(){return i},r(e)}catch(u){}return n}},{"./$.wks":125}],101:[function(require,module,exports){module.exports=function(e,n){return{value:n,done:!!e}}},{}],102:[function(require,module,exports){module.exports={}},{}],103:[function(require,module,exports){var $Object=Object;module.exports={create:$Object.create,getProto:$Object.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:$Object.getOwnPropertyDescriptor,setDesc:$Object.defineProperty,setDescs:$Object.defineProperties,getKeys:$Object.keys,getNames:$Object.getOwnPropertyNames,getSymbols:$Object.getOwnPropertySymbols,each:[].forEach}},{}],104:[function(require,module,exports){module.exports=!0},{}],105:[function(require,module,exports){var head,last,notify,global=require("./$.global"),macrotask=require("./$.task").set,Observer=global.MutationObserver||global.WebKitMutationObserver,process=global.process,Promise=global.Promise,isNode="process"==require("./$.cof")(process),flush=function(){var e,o,s;for(isNode&&(e=process.domain)&&(process.domain=null,e.exit());head;)o=head.domain,s=head.fn,o&&o.enter(),s(),o&&o.exit(),head=head.next;last=void 0,e&&e.enter()};if(isNode)notify=function(){process.nextTick(flush)};else if(Observer){var toggle=1,node=document.createTextNode("");new Observer(flush).observe(node,{characterData:!0}),notify=function(){node.data=toggle=-toggle}}else notify=Promise&&Promise.resolve?function(){Promise.resolve().then(flush)}:function(){macrotask.call(global,flush)};module.exports=function(e){var o={fn:e,next:void 0,domain:isNode&&process.domain};last&&(last.next=o),head||(head=o,notify()),last=o}},{"./$.cof":77,"./$.global":89,"./$.task":119}],106:[function(require,module,exports){var $=require("./$"),toObject=require("./$.to-object"),IObject=require("./$.iobject");module.exports=require("./$.fails")(function(){var e=Object.assign,t={},r={},o=Symbol(),c="abcdefghijklmnopqrst";return t[o]=7,c.split("").forEach(function(e){r[e]=e}),7!=e({},t)[o]||Object.keys(e({},r)).join("")!=c})?function(e,t){for(var r=toObject(e),o=arguments,c=o.length,n=1,i=$.getKeys,b=$.getSymbols,s=$.isEnum;c>n;)for(var a,j=IObject(o[n++]),u=b?i(j).concat(b(j)):i(j),l=u.length,f=0;l>f;)s.call(j,a=u[f++])&&(r[a]=j[a]);return r}:Object.assign},{"./$":103,"./$.fails":87,"./$.iobject":94,"./$.to-object":123}],107:[function(require,module,exports){var $export=require("./$.export"),core=require("./$.core"),fails=require("./$.fails");module.exports=function(e,r){var o=(core.Object||{})[e]||Object[e],t={};t[e]=r(o),$export($export.S+$export.F*fails(function(){o(1)}),"Object",t)}},{"./$.core":81,"./$.export":86,"./$.fails":87}],108:[function(require,module,exports){module.exports=function(e,r){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:r}}},{}],109:[function(require,module,exports){var redefine=require("./$.redefine");module.exports=function(e,r){for(var n in r)redefine(e,n,r[n]);return e}},{"./$.redefine":110}],110:[function(require,module,exports){module.exports=require("./$.hide")},{"./$.hide":91}],111:[function(require,module,exports){module.exports=Object.is||function(e,t){return e===t?0!==e||1/e===1/t:e!=e&&t!=t}},{}],112:[function(require,module,exports){var getDesc=require("./$").getDesc,isObject=require("./$.is-object"),anObject=require("./$.an-object"),check=function(e,t){if(anObject(e),!isObject(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};module.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,c){try{c=require("./$.ctx")(Function.call,getDesc(Object.prototype,"__proto__").set,2),c(e,[]),t=!(e instanceof Array)}catch(r){t=!0}return function(e,r){return check(e,r),t?e.__proto__=r:c(e,r),e}}({},!1):void 0),check:check}},{"./$":103,"./$.an-object":75,"./$.ctx":82,"./$.is-object":96}],113:[function(require,module,exports){"use strict";var core=require("./$.core"),$=require("./$"),DESCRIPTORS=require("./$.descriptors"),SPECIES=require("./$.wks")("species");module.exports=function(e){var r=core[e];DESCRIPTORS&&r&&!r[SPECIES]&&$.setDesc(r,SPECIES,{configurable:!0,get:function(){return this}})}},{"./$":103,"./$.core":81,"./$.descriptors":84,"./$.wks":125}],114:[function(require,module,exports){var def=require("./$").setDesc,has=require("./$.has"),TAG=require("./$.wks")("toStringTag");module.exports=function(e,r,a){e&&!has(e=a?e:e.prototype,TAG)&&def(e,TAG,{configurable:!0,value:r})}},{"./$":103,"./$.has":90,"./$.wks":125}],115:[function(require,module,exports){var global=require("./$.global"),SHARED="__core-js_shared__",store=global[SHARED]||(global[SHARED]={});module.exports=function(o){return store[o]||(store[o]={})}},{"./$.global":89}],116:[function(require,module,exports){var anObject=require("./$.an-object"),aFunction=require("./$.a-function"),SPECIES=require("./$.wks")("species");module.exports=function(e,n){var r,t=anObject(e).constructor;return void 0===t||void 0==(r=anObject(t)[SPECIES])?n:aFunction(r)}},{"./$.a-function":73,"./$.an-object":75,"./$.wks":125}],117:[function(require,module,exports){module.exports=function(e,r,o){if(!(e instanceof r))throw TypeError(o+": use the 'new' operator!");return e}},{}],118:[function(require,module,exports){var toInteger=require("./$.to-integer"),defined=require("./$.defined");module.exports=function(e){return function(r,t){var n,i,d=String(defined(r)),o=toInteger(t),u=d.length;return 0>o||o>=u?e?"":void 0:(n=d.charCodeAt(o),55296>n||n>56319||o+1===u||(i=d.charCodeAt(o+1))<56320||i>57343?e?d.charAt(o):n:e?d.slice(o,o+2):(n-55296<<10)+(i-56320)+65536)}}},{"./$.defined":83,"./$.to-integer":120}],119:[function(require,module,exports){var defer,channel,port,ctx=require("./$.ctx"),invoke=require("./$.invoke"),html=require("./$.html"),cel=require("./$.dom-create"),global=require("./$.global"),process=global.process,setTask=global.setImmediate,clearTask=global.clearImmediate,MessageChannel=global.MessageChannel,counter=0,queue={},ONREADYSTATECHANGE="onreadystatechange",run=function(){var e=+this;if(queue.hasOwnProperty(e)){var n=queue[e];delete queue[e],n()}},listner=function(e){run.call(e.data)};setTask&&clearTask||(setTask=function(e){for(var n=[],t=1;arguments.length>t;)n.push(arguments[t++]);return queue[++counter]=function(){invoke("function"==typeof e?e:Function(e),n)},defer(counter),counter},clearTask=function(e){delete queue[e]},"process"==require("./$.cof")(process)?defer=function(e){process.nextTick(ctx(run,e,1))}:MessageChannel?(channel=new MessageChannel,port=channel.port2,channel.port1.onmessage=listner,defer=ctx(port.postMessage,port,1)):global.addEventListener&&"function"==typeof postMessage&&!global.importScripts?(defer=function(e){global.postMessage(e+"","*")},global.addEventListener("message",listner,!1)):defer=ONREADYSTATECHANGE in cel("script")?function(e){html.appendChild(cel("script"))[ONREADYSTATECHANGE]=function(){html.removeChild(this),run.call(e)}}:function(e){setTimeout(ctx(run,e,1),0)}),module.exports={set:setTask,clear:clearTask}},{"./$.cof":77,"./$.ctx":82,"./$.dom-create":85,"./$.global":89,"./$.html":92,"./$.invoke":93}],120:[function(require,module,exports){var ceil=Math.ceil,floor=Math.floor;module.exports=function(o){return isNaN(o=+o)?0:(o>0?floor:ceil)(o)}},{}],121:[function(require,module,exports){var IObject=require("./$.iobject"),defined=require("./$.defined");module.exports=function(e){return IObject(defined(e))}},{"./$.defined":83,"./$.iobject":94}],122:[function(require,module,exports){var toInteger=require("./$.to-integer"),min=Math.min;module.exports=function(e){return e>0?min(toInteger(e),9007199254740991):0}},{"./$.to-integer":120}],123:[function(require,module,exports){var defined=require("./$.defined");module.exports=function(e){return Object(defined(e))}},{"./$.defined":83}],124:[function(require,module,exports){var id=0,px=Math.random();module.exports=function(o){return"Symbol(".concat(void 0===o?"":o,")_",(++id+px).toString(36))}},{}],125:[function(require,module,exports){var store=require("./$.shared")("wks"),uid=require("./$.uid"),Symbol=require("./$.global").Symbol;module.exports=function(r){return store[r]||(store[r]=Symbol&&Symbol[r]||(Symbol||uid)("Symbol."+r))}},{"./$.global":89,"./$.shared":115,"./$.uid":124}],126:[function(require,module,exports){var classof=require("./$.classof"),ITERATOR=require("./$.wks")("iterator"),Iterators=require("./$.iterators");module.exports=require("./$.core").getIteratorMethod=function(r){return void 0!=r?r[ITERATOR]||r["@@iterator"]||Iterators[classof(r)]:void 0}},{"./$.classof":76,"./$.core":81,"./$.iterators":102,"./$.wks":125}],127:[function(require,module,exports){var anObject=require("./$.an-object"),get=require("./core.get-iterator-method");module.exports=require("./$.core").getIterator=function(e){var r=get(e);if("function"!=typeof r)throw TypeError(e+" is not iterable!");return anObject(r.call(e))}},{"./$.an-object":75,"./$.core":81,"./core.get-iterator-method":126}],128:[function(require,module,exports){var classof=require("./$.classof"),ITERATOR=require("./$.wks")("iterator"),Iterators=require("./$.iterators");module.exports=require("./$.core").isIterable=function(r){var e=Object(r);return void 0!==e[ITERATOR]||"@@iterator"in e||Iterators.hasOwnProperty(classof(e))}},{"./$.classof":76,"./$.core":81,"./$.iterators":102,"./$.wks":125}],129:[function(require,module,exports){"use strict";var ctx=require("./$.ctx"),$export=require("./$.export"),toObject=require("./$.to-object"),call=require("./$.iter-call"),isArrayIter=require("./$.is-array-iter"),toLength=require("./$.to-length"),getIterFn=require("./core.get-iterator-method");$export($export.S+$export.F*!require("./$.iter-detect")(function(e){Array.from(e)}),"Array",{from:function(e){var r,t,o,i,n=toObject(e),a="function"==typeof this?this:Array,c=arguments,l=c.length,u=l>1?c[1]:void 0,$=void 0!==u,f=0,g=getIterFn(n);if($&&(u=ctx(u,l>2?c[2]:void 0,2)),void 0==g||a==Array&&isArrayIter(g))for(r=toLength(n.length),t=new a(r);r>f;f++)t[f]=$?u(n[f],f):n[f];else for(i=g.call(n),t=new a;!(o=i.next()).done;f++)t[f]=$?call(i,u,[o.value,f],!0):o.value;return t.length=f,t}})},{"./$.ctx":82,"./$.export":86,"./$.is-array-iter":95,"./$.iter-call":97,"./$.iter-detect":100,"./$.to-length":122,"./$.to-object":123,"./core.get-iterator-method":126}],130:[function(require,module,exports){"use strict";var addToUnscopables=require("./$.add-to-unscopables"),step=require("./$.iter-step"),Iterators=require("./$.iterators"),toIObject=require("./$.to-iobject");module.exports=require("./$.iter-define")(Array,"Array",function(e,t){this._t=toIObject(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,s=this._i++;return!e||s>=e.length?(this._t=void 0,step(1)):"keys"==t?step(0,s):"values"==t?step(0,e[s]):step(0,[s,e[s]])},"values"),Iterators.Arguments=Iterators.Array,addToUnscopables("keys"),addToUnscopables("values"),addToUnscopables("entries")},{"./$.add-to-unscopables":74,"./$.iter-define":99,"./$.iter-step":101,"./$.iterators":102,"./$.to-iobject":121}],131:[function(require,module,exports){"use strict";var strong=require("./$.collection-strong");require("./$.collection")("Map",function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},{get:function(t){var n=strong.getEntry(this,t);return n&&n.v},set:function(t,n){return strong.def(this,0===t?0:t,n)}},strong,!0)},{"./$.collection":80,"./$.collection-strong":78}],132:[function(require,module,exports){var $export=require("./$.export");$export($export.S+$export.F,"Object",{assign:require("./$.object-assign")})},{"./$.export":86,"./$.object-assign":106}],133:[function(require,module,exports){var toIObject=require("./$.to-iobject");require("./$.object-sap")("getOwnPropertyDescriptor",function(t){return function(e,r){return t(toIObject(e),r)}})},{"./$.object-sap":107,"./$.to-iobject":121}],134:[function(require,module,exports){var toObject=require("./$.to-object");require("./$.object-sap")("keys",function(e){return function(t){return e(toObject(t))}})},{"./$.object-sap":107,"./$.to-object":123}],135:[function(require,module,exports){var $export=require("./$.export");$export($export.S,"Object",{setPrototypeOf:require("./$.set-proto").set})},{"./$.export":86,"./$.set-proto":112}],136:[function(require,module,exports){},{}],137:[function(require,module,exports){"use strict";var Wrapper,$=require("./$"),LIBRARY=require("./$.library"),global=require("./$.global"),ctx=require("./$.ctx"),classof=require("./$.classof"),$export=require("./$.export"),isObject=require("./$.is-object"),anObject=require("./$.an-object"),aFunction=require("./$.a-function"),strictNew=require("./$.strict-new"),forOf=require("./$.for-of"),setProto=require("./$.set-proto").set,same=require("./$.same-value"),SPECIES=require("./$.wks")("species"),speciesConstructor=require("./$.species-constructor"),asap=require("./$.microtask"),PROMISE="Promise",process=global.process,isNode="process"==classof(process),P=global[PROMISE],testResolve=function(e){var r=new P(function(){});return e&&(r.constructor=Object),P.resolve(r)===r},USE_NATIVE=function(){function e(r){var t=new P(r);return setProto(t,e.prototype),t}var r=!1;try{if(r=P&&P.resolve&&testResolve(),setProto(e,P),e.prototype=$.create(P.prototype,{constructor:{value:e}}),e.resolve(5).then(function(){})instanceof e||(r=!1),r&&require("./$.descriptors")){var t=!1;P.resolve($.setDesc({},"then",{get:function(){t=!0}})),r=t}}catch(o){r=!1}return r}(),sameConstructor=function(e,r){return LIBRARY&&e===P&&r===Wrapper?!0:same(e,r)},getConstructor=function(e){var r=anObject(e)[SPECIES];return void 0!=r?r:e},isThenable=function(e){var r;return isObject(e)&&"function"==typeof(r=e.then)?r:!1},PromiseCapability=function(e){var r,t;this.promise=new e(function(e,o){if(void 0!==r||void 0!==t)throw TypeError("Bad Promise constructor");r=e,t=o}),this.resolve=aFunction(r),this.reject=aFunction(t)},perform=function(e){try{e()}catch(r){return{error:r}}},notify=function(e,r){if(!e.n){e.n=!0;var t=e.c;asap(function(){for(var o=e.v,n=1==e.s,i=0,s=function(r){var t,i,s=n?r.ok:r.fail,c=r.resolve,a=r.reject;try{s?(n||(e.h=!0),t=s===!0?o:s(o),t===r.promise?a(TypeError("Promise-chain cycle")):(i=isThenable(t))?i.call(t,c,a):c(t)):a(o)}catch(u){a(u)}};t.length>i;)s(t[i++]);t.length=0,e.n=!1,r&&setTimeout(function(){var r,t,n=e.p;isUnhandled(n)&&(isNode?process.emit("unhandledRejection",o,n):(r=global.onunhandledrejection)?r({promise:n,reason:o}):(t=global.console)&&t.error&&t.error("Unhandled promise rejection",o)),e.a=void 0},1)})}},isUnhandled=function(e){var r,t=e._d,o=t.a||t.c,n=0;if(t.h)return!1;for(;o.length>n;)if(r=o[n++],r.fail||!isUnhandled(r.promise))return!1;return!0},$reject=function(e){var r=this;r.d||(r.d=!0,r=r.r||r,r.v=e,r.s=2,r.a=r.c.slice(),notify(r,!0))},$resolve=function(e){var r,t=this;if(!t.d){t.d=!0,t=t.r||t;try{if(t.p===e)throw TypeError("Promise can't be resolved itself");(r=isThenable(e))?asap(function(){var o={r:t,d:!1};try{r.call(e,ctx($resolve,o,1),ctx($reject,o,1))}catch(n){$reject.call(o,n)}}):(t.v=e,t.s=1,notify(t,!1))}catch(o){$reject.call({r:t,d:!1},o)}}};USE_NATIVE||(P=function(e){aFunction(e);var r=this._d={p:strictNew(this,P,PROMISE),c:[],a:void 0,s:0,d:!1,v:void 0,h:!1,n:!1};try{e(ctx($resolve,r,1),ctx($reject,r,1))}catch(t){$reject.call(r,t)}},require("./$.redefine-all")(P.prototype,{then:function(e,r){var t=new PromiseCapability(speciesConstructor(this,P)),o=t.promise,n=this._d;return t.ok="function"==typeof e?e:!0,t.fail="function"==typeof r&&r,n.c.push(t),n.a&&n.a.push(t),n.s&¬ify(n,!1),o},catch:function(e){return this.then(void 0,e)}})),$export($export.G+$export.W+$export.F*!USE_NATIVE,{Promise:P}),require("./$.set-to-string-tag")(P,PROMISE),require("./$.set-species")(PROMISE),Wrapper=require("./$.core")[PROMISE],$export($export.S+$export.F*!USE_NATIVE,PROMISE,{reject:function(e){var r=new PromiseCapability(this),t=r.reject;return t(e),r.promise}}),$export($export.S+$export.F*(!USE_NATIVE||testResolve(!0)),PROMISE,{resolve:function(e){if(e instanceof P&&sameConstructor(e.constructor,this))return e;var r=new PromiseCapability(this),t=r.resolve;return t(e),r.promise}}),$export($export.S+$export.F*!(USE_NATIVE&&require("./$.iter-detect")(function(e){P.all(e).catch(function(){})})),PROMISE,{all:function(e){var r=getConstructor(this),t=new PromiseCapability(r),o=t.resolve,n=t.reject,i=[],s=perform(function(){forOf(e,!1,i.push,i);var t=i.length,s=Array(t);t?$.each.call(i,function(e,i){var c=!1;r.resolve(e).then(function(e){c||(c=!0,s[i]=e,--t||o(s))},n)}):o(s)});return s&&n(s.error),t.promise},race:function(e){var r=getConstructor(this),t=new PromiseCapability(r),o=t.reject,n=perform(function(){forOf(e,!1,function(e){r.resolve(e).then(t.resolve,o)})});return n&&o(n.error),t.promise}})},{"./$":103,"./$.a-function":73,"./$.an-object":75,"./$.classof":76,"./$.core":81,"./$.ctx":82,"./$.descriptors":84,"./$.export":86,"./$.for-of":88,"./$.global":89,"./$.is-object":96,"./$.iter-detect":100,"./$.library":104,"./$.microtask":105,"./$.redefine-all":109,"./$.same-value":111,"./$.set-proto":112,"./$.set-species":113,"./$.set-to-string-tag":114,"./$.species-constructor":116,"./$.strict-new":117,"./$.wks":125}],138:[function(require,module,exports){"use strict";var strong=require("./$.collection-strong");require("./$.collection")("Set",function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},{add:function(t){return strong.def(this,t=0===t?0:t,t)}},strong)},{"./$.collection":80,"./$.collection-strong":78}],139:[function(require,module,exports){"use strict";var $at=require("./$.string-at")(!0);require("./$.iter-define")(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,i=this._t,e=this._i;return e>=i.length?{value:void 0,done:!0}:(t=$at(i,e),this._i+=t.length,{value:t,done:!1})})},{"./$.iter-define":99,"./$.string-at":118}],140:[function(require,module,exports){var $export=require("./$.export");$export($export.P,"Map",{toJSON:require("./$.collection-to-json")("Map")})},{"./$.collection-to-json":79,"./$.export":86}],141:[function(require,module,exports){var $export=require("./$.export");$export($export.P,"Set",{toJSON:require("./$.collection-to-json")("Set")})},{"./$.collection-to-json":79,"./$.export":86}],142:[function(require,module,exports){require("./es6.array.iterator");var Iterators=require("./$.iterators");Iterators.NodeList=Iterators.HTMLCollection=Iterators.Array},{"./$.iterators":102,"./es6.array.iterator":130}],143:[function(require,module,exports){"use strict";var _get=require("babel-runtime/helpers/get").default,_inherits=require("babel-runtime/helpers/inherits").default,_classCallCheck=require("babel-runtime/helpers/class-call-check").default;Object.defineProperty(exports,"__esModule",{value:!0});var _language=require("../language"),GraphQLError=function(e){function r(e,t,i,n,o){_classCallCheck(this,r),_get(Object.getPrototypeOf(r.prototype),"constructor",this).call(this,e),this.message=e,Object.defineProperty(this,"stack",{value:i||e}),Object.defineProperty(this,"nodes",{value:t}),Object.defineProperty(this,"source",{get:function(){if(n)return n;if(t&&t.length>0){var e=t[0];return e&&e.loc&&e.loc.source}}}),Object.defineProperty(this,"positions",{get:function(){if(o)return o;if(t){var e=t.map(function(e){return e.loc&&e.loc.start});if(e.some(function(e){return e}))return e}}}),Object.defineProperty(this,"locations",{get:function(){var e=this;return this.positions&&this.source?this.positions.map(function(r){return(0,_language.getLocation)(e.source,r)}):void 0}})}return _inherits(r,e),r}(Error);exports.GraphQLError=GraphQLError},{"../language":158,"babel-runtime/helpers/class-call-check":30,"babel-runtime/helpers/get":33,"babel-runtime/helpers/inherits":34}],144:[function(require,module,exports){"use strict";function formatError(e){return(0,_jsutilsInvariant2.default)(e,"Received null or undefined error."),{message:e.message,locations:e.locations}}var _interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.formatError=formatError;var _jsutilsInvariant=require("../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant)},{"../jsutils/invariant":154,"babel-runtime/helpers/interop-require-default":35}],145:[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":143,"./formatError":144,"./locatedError":146,"./syntaxError":147}],146:[function(require,module,exports){"use strict";function locatedError(r,e){var o=r?r.message||String(r):"An unknown error occurred.",a=r?r.stack:null,t=new _GraphQLError.GraphQLError(o,e,a);return t.originalError=r,t}Object.defineProperty(exports,"__esModule",{value:!0}),exports.locatedError=locatedError;var _GraphQLError=require("./GraphQLError")},{"./GraphQLError":143}],147:[function(require,module,exports){"use strict";function syntaxError(r,n,o){var t=(0,_languageLocation.getLocation)(r,n),a=new _GraphQLError.GraphQLError("Syntax Error "+r.name+" ("+t.line+":"+t.column+") "+o+"\n\n"+highlightSourceAtLocation(r,t),void 0,void 0,r,[n]);return a}function highlightSourceAtLocation(r,n){var o=n.line,t=(o-1).toString(),a=o.toString(),e=(o+1).toString(),i=e.length,l=r.body.split(/\r\n|[\n\r]/g);return(o>=2?lpad(i,t)+": "+l[o-2]+"\n":"")+lpad(i,a)+": "+l[o-1]+"\n"+Array(2+i+n.column).join(" ")+"^\n"+(o0?{errors:l}:(0,_executionExecute.execute)(e,o,a,u,t))}).catch(function(e){return{errors:[e]}})}var _Promise=require("babel-runtime/core-js/promise").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.graphql=graphql;var _languageSource=require("./language/source"),_languageParser=require("./language/parser"),_validationValidate=require("./validation/validate"),_executionExecute=require("./execution/execute")},{"./execution/execute":148,"./language/parser":162,"./language/source":164,"./validation/validate":213,"babel-runtime/core-js/promise":28}],152:[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,"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,"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,"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,"print",{enumerable:!0,get:function(){return _language.print}}),Object.defineProperty(exports,"visit",{enumerable:!0,get:function(){return _language.visit}}),Object.defineProperty(exports,"Kind",{enumerable:!0,get:function(){return _language.Kind}}),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}});var _validation=require("./validation");Object.defineProperty(exports,"validate",{enumerable:!0,get:function(){return _validation.validate}}),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,"extendSchema",{enumerable:!0,get:function(){return _utilities.extendSchema}}),Object.defineProperty(exports,"printSchema",{enumerable:!0,get:function(){return _utilities.printSchema}}),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,"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}})},{"./error":145,"./execution":149,"./graphql":151,"./language":158,"./type":168,"./utilities":179,"./validation":187}],153:[function(require,module,exports){"use strict";function find(e,t){for(var r=0;r":127>e?JSON.stringify(String.fromCharCode(e)):'"\\u'+("00"+e.toString(16).toUpperCase()).slice(-4)+'"'}function readToken(e,r){var n=e.body,a=n.length,o=positionAfterWhitespace(n,r);if(o>=a)return makeToken(TokenKind.EOF,o,o);var c=charCodeAt.call(n,o);if(32>c&&9!==c&&10!==c&&13!==c)throw(0,_error.syntaxError)(e,o,"Invalid character "+printCharCode(c)+".");switch(c){case 33:return makeToken(TokenKind.BANG,o,o+1);case 36:return makeToken(TokenKind.DOLLAR,o,o+1);case 40:return makeToken(TokenKind.PAREN_L,o,o+1);case 41:return makeToken(TokenKind.PAREN_R,o,o+1);case 46:if(46===charCodeAt.call(n,o+1)&&46===charCodeAt.call(n,o+2))return makeToken(TokenKind.SPREAD,o,o+3);break;case 58:return makeToken(TokenKind.COLON,o,o+1);case 61:return makeToken(TokenKind.EQUALS,o,o+1);case 64:return makeToken(TokenKind.AT,o,o+1);case 91:return makeToken(TokenKind.BRACKET_L,o,o+1);case 93:return makeToken(TokenKind.BRACKET_R,o,o+1);case 123:return makeToken(TokenKind.BRACE_L,o,o+1);case 124:return makeToken(TokenKind.PIPE,o,o+1);case 125:return makeToken(TokenKind.BRACE_R,o,o+1);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(e,o);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return readNumber(e,o,c);case 34:return readString(e,o)}throw(0,_error.syntaxError)(e,o,"Unexpected character "+printCharCode(c)+".")}function positionAfterWhitespace(e,r){for(var n=e.length,a=r;n>a;){var o=charCodeAt.call(e,a);if(65279===o||9===o||32===o||10===o||13===o||44===o)++a;else{if(35!==o)break;for(++a;n>a&&null!==(o=charCodeAt.call(e,a))&&(o>31||9===o)&&10!==o&&13!==o;)++a}}return a}function readNumber(e,r,n){var a=e.body,o=n,c=r,t=!1;if(45===o&&(o=charCodeAt.call(a,++c)),48===o){if(o=charCodeAt.call(a,++c),o>=48&&57>=o)throw(0,_error.syntaxError)(e,c,"Invalid number, unexpected digit after 0: "+printCharCode(o)+".")}else c=readDigits(e,c,o),o=charCodeAt.call(a,c);return 46===o&&(t=!0,o=charCodeAt.call(a,++c),c=readDigits(e,c,o),o=charCodeAt.call(a,c)),69!==o&&101!==o||(t=!0,o=charCodeAt.call(a,++c),43!==o&&45!==o||(o=charCodeAt.call(a,++c)),c=readDigits(e,c,o)),makeToken(t?TokenKind.FLOAT:TokenKind.INT,r,c,slice.call(a,r,c))}function readDigits(e,r,n){var a=e.body,o=r,c=n;if(c>=48&&57>=c){do c=charCodeAt.call(a,++o);while(c>=48&&57>=c);return o}throw(0,_error.syntaxError)(e,o,"Invalid number, expected digit but got: "+printCharCode(c)+".")}function readString(e,r){for(var n=e.body,a=r+1,o=a,c=0,t="";ac&&9!==c)throw(0,_error.syntaxError)(e,a,"Invalid character within String: "+printCharCode(c)+".");if(++a,92===c){switch(t+=slice.call(n,o,a-1),c=charCodeAt.call(n,a)){case 34:t+='"';break;case 47:t+="/";break;case 92:t+="\\";break;case 98:t+="\b";break;case 102:t+="\f";break;case 110:t+="\n";break;case 114:t+="\r";break;case 116:t+=" ";break;case 117:var i=uniCharCode(charCodeAt.call(n,a+1),charCodeAt.call(n,a+2),charCodeAt.call(n,a+3),charCodeAt.call(n,a+4));if(0>i)throw(0,_error.syntaxError)(e,a,"Invalid character escape sequence: "+("\\u"+n.slice(a+1,a+5)+"."));t+=String.fromCharCode(i),a+=4;break;default:throw(0,_error.syntaxError)(e,a,"Invalid character escape sequence: \\"+String.fromCharCode(c)+".")}++a,o=a}}if(34!==c)throw(0,_error.syntaxError)(e,a,"Unterminated string.");return t+=slice.call(n,o,a),makeToken(TokenKind.STRING,r,a+1,t)}function uniCharCode(e,r,n,a){return char2hex(e)<<12|char2hex(r)<<8|char2hex(n)<<4|char2hex(a)}function char2hex(e){return e>=48&&57>=e?e-48:e>=65&&70>=e?e-55:e>=97&&102>=e?e-87:-1}function readName(e,r){for(var n=e.body,a=n.length,o=r+1,c=0;o!==a&&null!==(c=charCodeAt.call(n,o))&&(95===c||c>=48&&57>=c||c>=65&&90>=c||c>=97&&122>=c);)++o;return makeToken(TokenKind.NAME,r,o,slice.call(n,r,o))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.lex=lex,exports.getTokenDesc=getTokenDesc,exports.getTokenKindDesc=getTokenKindDesc;var _error=require("../error"),TokenKind={EOF:1,BANG:2,DOLLAR:3,PAREN_L:4,PAREN_R:5,SPREAD:6,COLON:7,EQUALS:8,AT:9,BRACKET_L:10,BRACKET_R:11,BRACE_L:12,PIPE:13,BRACE_R:14,NAME:15,INT:16,FLOAT:17,STRING:18};exports.TokenKind=TokenKind;var tokenDescription={};tokenDescription[TokenKind.EOF]="EOF",tokenDescription[TokenKind.BANG]="!",tokenDescription[TokenKind.DOLLAR]="$",tokenDescription[TokenKind.PAREN_L]="(",tokenDescription[TokenKind.PAREN_R]=")",tokenDescription[TokenKind.SPREAD]="...",tokenDescription[TokenKind.COLON]=":",tokenDescription[TokenKind.EQUALS]="=",tokenDescription[TokenKind.AT]="@",tokenDescription[TokenKind.BRACKET_L]="[",tokenDescription[TokenKind.BRACKET_R]="]",tokenDescription[TokenKind.BRACE_L]="{",tokenDescription[TokenKind.PIPE]="|",tokenDescription[TokenKind.BRACE_R]="}",tokenDescription[TokenKind.NAME]="Name",tokenDescription[TokenKind.INT]="Int",tokenDescription[TokenKind.FLOAT]="Float",tokenDescription[TokenKind.STRING]="String";var charCodeAt=String.prototype.charCodeAt,slice=String.prototype.slice},{"../error":145}],161:[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+" fields must be an object with field names as keys or a function which returns such an object.");var s={};return a.forEach(function(t){assertValidName(t);var a=_extends({},n[t],{name:t});(0,_jsutilsInvariant2.default)(!a.hasOwnProperty("isDeprecated"),e+"."+t+' should provide "deprecationReason" instead of "isDeprecated".'),(0,_jsutilsInvariant2.default)(isOutputType(a.type),e+"."+t+" field type must be Output Type but "+("got: "+a.type+".")),a.args?((0,_jsutilsInvariant2.default)(isPlainObj(a.args),e+"."+t+" args must be an object with argument names as keys."),a.args=_Object$keys(a.args).map(function(n){assertValidName(n);var s=a.args[n];return(0,_jsutilsInvariant2.default)(isInputType(s.type),e+"."+t+"("+n+":) argument type must be "+("Input Type but got: "+s.type+".")),{name:n,description:void 0===s.description?null:s.description,type:s.type,defaultValue:void 0===s.defaultValue?null:s.defaultValue}})):a.args=[],s[t]=a}),s}function isPlainObj(e){return e&&"object"==typeof e&&!Array.isArray(e)}function addImplementationToInterfaces(e){e.getInterfaces().forEach(function(t){t._implementations.push(e)})}function getTypeOf(e,t,n){for(var a=n.getPossibleTypes(),s=0;s0,e+" values must be an object with value names as keys."),n.map(function(n){assertValidName(n);var a=t[n];return(0,_jsutilsInvariant2.default)(isPlainObj(a),e+"."+n+' must refer to an object with a "value" key '+("representing an internal value but got: "+a+".")),(0,_jsutilsInvariant2.default)(!a.hasOwnProperty("isDeprecated"),e+"."+n+' should provide "deprecationReason" instead of "isDeprecated".'),{name:n,description:a.description,deprecationReason:a.deprecationReason,value:(0,_jsutilsIsNullish2.default)(a.value)?n:a.value}})}function assertValidName(e){(0,_jsutilsInvariant2.default)(NAME_RX.test(e),'Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "'+e+'" does not.')}var _createClass=require("babel-runtime/helpers/create-class").default,_classCallCheck=require("babel-runtime/helpers/class-call-check").default,_extends=require("babel-runtime/helpers/extends").default,_Object$keys=require("babel-runtime/core-js/object/keys").default,_Map=require("babel-runtime/core-js/map").default,_Object$create=require("babel-runtime/core-js/object/create").default,_interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.isType=isType,exports.isInputType=isInputType,exports.isOutputType=isOutputType,exports.isLeafType=isLeafType,exports.isCompositeType=isCompositeType,exports.isAbstractType=isAbstractType,exports.getNullableType=getNullableType,exports.getNamedType=getNamedType;var _jsutilsInvariant=require("../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant),_jsutilsIsNullish=require("../jsutils/isNullish"),_jsutilsIsNullish2=_interopRequireDefault(_jsutilsIsNullish),_jsutilsKeyMap=require("../jsutils/keyMap"),_jsutilsKeyMap2=_interopRequireDefault(_jsutilsKeyMap),_languageKinds=require("../language/kinds"),GraphQLScalarType=function(){function e(t){_classCallCheck(this,e),(0,_jsutilsInvariant2.default)(t.name,"Type must be named."),assertValidName(t.name),this.name=t.name,this.description=t.description,(0,_jsutilsInvariant2.default)("function"==typeof t.serialize,this+' must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.'),(t.parseValue||t.parseLiteral)&&(0,_jsutilsInvariant2.default)("function"==typeof t.parseValue&&"function"==typeof t.parseLiteral,this+' must provide both "parseValue" and "parseLiteral" functions.'),this._scalarConfig=t}return _createClass(e,[{key:"serialize",value:function(e){var t=this._scalarConfig.serialize;return t(e)}},{key:"parseValue",value:function(e){var t=this._scalarConfig.parseValue;return t?t(e):null}},{key:"parseLiteral",value:function(e){var t=this._scalarConfig.parseLiteral;return t?t(e):null}},{key:"toString",value:function(){return this.name}}]),e}();exports.GraphQLScalarType=GraphQLScalarType;var GraphQLObjectType=function(){function e(t){_classCallCheck(this,e),(0,_jsutilsInvariant2.default)(t.name,"Type must be named."),assertValidName(t.name),this.name=t.name,this.description=t.description,t.isTypeOf&&(0,_jsutilsInvariant2.default)("function"==typeof t.isTypeOf,this+' must provide "isTypeOf" as a function.'),this.isTypeOf=t.isTypeOf,this._typeConfig=t,addImplementationToInterfaces(this)}return _createClass(e,[{key:"getFields",value:function(){return this._fields||(this._fields=defineFieldMap(this,this._typeConfig.fields))}},{key:"getInterfaces",value:function(){return this._interfaces||(this._interfaces=defineInterfaces(this,this._typeConfig.interfaces))}},{key:"toString",value:function(){return this.name}}]),e}();exports.GraphQLObjectType=GraphQLObjectType;var GraphQLInterfaceType=function(){function e(t){_classCallCheck(this,e),(0,_jsutilsInvariant2.default)(t.name,"Type must be named."),assertValidName(t.name),this.name=t.name,this.description=t.description,t.resolveType&&(0,_jsutilsInvariant2.default)("function"==typeof t.resolveType,this+' must provide "resolveType" as a function.'),this.resolveType=t.resolveType,this._typeConfig=t,this._implementations=[]}return _createClass(e,[{key:"getFields",value:function(){return this._fields||(this._fields=defineFieldMap(this,this._typeConfig.fields))}},{key:"getPossibleTypes",value:function(){return this._implementations}},{key:"isPossibleType",value:function(e){var t=this._possibleTypes||(this._possibleTypes=(0,_jsutilsKeyMap2.default)(this.getPossibleTypes(),function(e){return e.name}));return Boolean(t[e.name])}},{key:"getObjectType",value:function(e,t){var n=this.resolveType;return n?n(e,t):getTypeOf(e,t,this)}},{key:"toString",value:function(){return this.name}}]),e}();exports.GraphQLInterfaceType=GraphQLInterfaceType;var GraphQLUnionType=function(){function e(t){var n=this;_classCallCheck(this,e),(0,_jsutilsInvariant2.default)(t.name,"Type must be named."),assertValidName(t.name),this.name=t.name,this.description=t.description,t.resolveType&&(0,_jsutilsInvariant2.default)("function"==typeof t.resolveType,this+' must provide "resolveType" as a function.'),this.resolveType=t.resolveType,(0,_jsutilsInvariant2.default)(Array.isArray(t.types)&&t.types.length>0,"Must provide Array of types for Union "+t.name+"."),t.types.forEach(function(e){(0,_jsutilsInvariant2.default)(e instanceof GraphQLObjectType,n+" may only contain Object types, it cannot contain: "+e+"."),"function"!=typeof n.resolveType&&(0,_jsutilsInvariant2.default)("function"==typeof e.isTypeOf,"Union Type "+n+' does not provide a "resolveType" function '+("and possible Type "+e+' does not provide a "isTypeOf" ')+"function. There is no way to resolve this possible type during execution.")}),this._types=t.types,this._typeConfig=t}return _createClass(e,[{key:"getPossibleTypes",value:function(){return this._types}},{key:"isPossibleType",value:function(e){var t=this._possibleTypeNames;return t||(this._possibleTypeNames=t=this.getPossibleTypes().reduce(function(e,t){return e[t.name]=!0,e},{})),t[e.name]===!0}},{key:"getObjectType",value:function(e,t){var n=this._typeConfig.resolveType;return n?n(e,t):getTypeOf(e,t,this)}},{key:"toString",value:function(){return this.name}}]),e}();exports.GraphQLUnionType=GraphQLUnionType;var GraphQLEnumType=function(){function e(t){_classCallCheck(this,e),this.name=t.name,assertValidName(t.name),this.description=t.description,this._values=defineEnumValues(this,t.values),this._enumConfig=t}return _createClass(e,[{key:"getValues",value:function(){return this._values}},{key:"serialize",value:function(e){var t=this._getValueLookup().get(e);return t?t.name:null}},{key:"parseValue",value:function(e){if("string"==typeof e){var t=this._getNameLookup()[e];if(t)return t.value}}},{key:"parseLiteral",value:function(e){if(e.kind===_languageKinds.ENUM){var t=this._getNameLookup()[e.value];if(t)return t.value}}},{key:"_getValueLookup",value:function(){var e=this;return this._valueLookup||!function(){var t=new _Map;e.getValues().forEach(function(e){t.set(e.value,e)}),e._valueLookup=t}(),this._valueLookup}},{key:"_getNameLookup",value:function(){var e=this;return this._nameLookup||!function(){var t=_Object$create(null);e.getValues().forEach(function(e){t[e.name]=e}),e._nameLookup=t}(),this._nameLookup}},{key:"toString",value:function(){return this.name}}]),e}();exports.GraphQLEnumType=GraphQLEnumType;var GraphQLInputObjectType=function(){function e(t){_classCallCheck(this,e),(0,_jsutilsInvariant2.default)(t.name,"Type must be named."),assertValidName(t.name),this.name=t.name,this.description=t.description,this._typeConfig=t}return _createClass(e,[{key:"getFields",value:function(){return this._fields||(this._fields=this._defineFieldMap())}},{key:"_defineFieldMap",value:function(){var e=this,t=resolveMaybeThunk(this._typeConfig.fields);(0,_jsutilsInvariant2.default)(isPlainObj(t),this+" fields must be an object with field names as keys or a function which returns such an object.");var n=_Object$keys(t);(0,_jsutilsInvariant2.default)(n.length>0,this+" 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){assertValidName(n);var s=_extends({},t[n],{name:n});(0,_jsutilsInvariant2.default)(isInputType(s.type),e+"."+n+" field type must be Input Type but "+("got: "+s.type+".")),a[n]=s}),a}},{key:"toString",value:function(){return this.name}}]),e}();exports.GraphQLInputObjectType=GraphQLInputObjectType;var GraphQLList=function(){function e(t){_classCallCheck(this,e),(0,_jsutilsInvariant2.default)(isType(t),"Can only create List of a GraphQLType but got: "+t+"."),this.ofType=t}return _createClass(e,[{key:"toString",value:function(){return"["+String(this.ofType)+"]"}}]),e}();exports.GraphQLList=GraphQLList;var GraphQLNonNull=function(){function e(t){_classCallCheck(this,e),(0,_jsutilsInvariant2.default)(isType(t)&&!(t instanceof e),"Can only create NonNull of a Nullable GraphQLType but got: "+t+"."),this.ofType=t}return _createClass(e,[{key:"toString",value:function(){return this.ofType.toString()+"!"}}]),e}();exports.GraphQLNonNull=GraphQLNonNull;var NAME_RX=/^[_a-zA-Z][_a-zA-Z0-9]*$/},{"../jsutils/invariant":154,"../jsutils/isNullish":155,"../jsutils/keyMap":156,"../language/kinds":159,"babel-runtime/core-js/map":21,"babel-runtime/core-js/object/create":23,"babel-runtime/core-js/object/keys":26,"babel-runtime/helpers/class-call-check":30,"babel-runtime/helpers/create-class":31,"babel-runtime/helpers/extends":32,"babel-runtime/helpers/interop-require-default":35}],167:[function(require,module,exports){"use strict";var _classCallCheck=require("babel-runtime/helpers/class-call-check").default;Object.defineProperty(exports,"__esModule",{value:!0});var _definition=require("./definition"),_scalars=require("./scalars"),GraphQLDirective=function e(i){_classCallCheck(this,e),this.name=i.name,this.description=i.description,this.args=i.args||[],this.onOperation=Boolean(i.onOperation),this.onFragment=Boolean(i.onFragment),this.onField=Boolean(i.onField)};exports.GraphQLDirective=GraphQLDirective;var GraphQLIncludeDirective=new GraphQLDirective({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",args:[{name:"if",type:new _definition.GraphQLNonNull(_scalars.GraphQLBoolean),description:"Included when true."}],onOperation:!1,onFragment:!0,onField:!0});exports.GraphQLIncludeDirective=GraphQLIncludeDirective;var GraphQLSkipDirective=new GraphQLDirective({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",args:[{name:"if",type:new _definition.GraphQLNonNull(_scalars.GraphQLBoolean),description:"Skipped when true."}],onOperation:!1,onFragment:!0,onField:!0});exports.GraphQLSkipDirective=GraphQLSkipDirective},{"./definition":166,"./scalars":170,"babel-runtime/helpers/class-call-check":30}],168:[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,"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 _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}})},{"./definition":166,"./scalars":170,"./schema":171}],169:[function(require,module,exports){"use strict";var _Object$keys=require("babel-runtime/core-js/object/keys").default,_interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0});var _jsutilsIsNullish=require("../jsutils/isNullish"),_jsutilsIsNullish2=_interopRequireDefault(_jsutilsIsNullish),_utilitiesAstFromValue=require("../utilities/astFromValue"),_languagePrinter=require("../language/printer"),_definition=require("./definition"),_scalars=require("./scalars"),__Schema=new _definition.GraphQLObjectType({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields: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()}}}}});exports.__Schema=__Schema;var __Directive=new _definition.GraphQLObjectType({name:"__Directive",description:"A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL’s execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.",fields: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||[]}},onOperation:{type:new _definition.GraphQLNonNull(_scalars.GraphQLBoolean)},onFragment:{type:new _definition.GraphQLNonNull(_scalars.GraphQLBoolean)},onField:{type:new _definition.GraphQLNonNull(_scalars.GraphQLBoolean)}}}}),__Type=new _definition.GraphQLObjectType({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name 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){return e instanceof _definition.GraphQLObjectType?e.getInterfaces():void 0}},possibleTypes:{type:new _definition.GraphQLList(new _definition.GraphQLNonNull(__Type)),resolve:function(e){return e instanceof _definition.GraphQLInterfaceType||e instanceof _definition.GraphQLUnionType?e.getPossibleTypes():void 0}},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=new _definition.GraphQLObjectType({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields: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),resolve:function(e){return!(0,_jsutilsIsNullish2.default)(e.deprecationReason)}},deprecationReason:{type:_scalars.GraphQLString}}}}),__InputValue=new _definition.GraphQLObjectType({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields: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,_jsutilsIsNullish2.default)(e.defaultValue)?null:(0,_languagePrinter.print)((0,_utilitiesAstFromValue.astFromValue)(e.defaultValue,e))}}}}}),__EnumValue=new _definition.GraphQLObjectType({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:function(){return{name:{type:new _definition.GraphQLNonNull(_scalars.GraphQLString)},description:{type:_scalars.GraphQLString},isDeprecated:{type:new _definition.GraphQLNonNull(_scalars.GraphQLBoolean),resolve:function(e){return!(0,_jsutilsIsNullish2.default)(e.deprecationReason)}},deprecationReason:{type:_scalars.GraphQLString}}}}),TypeKind={SCALAR:"SCALAR",OBJECT:"OBJECT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",INPUT_OBJECT:"INPUT_OBJECT",LIST:"LIST",NON_NULL:"NON_NULL"};exports.TypeKind=TypeKind;var __TypeKind=new _definition.GraphQLEnumType({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:TypeKind.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:TypeKind.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:TypeKind.INTERFACE,description:"Indicates this type is an interface. `fields` 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."}}}),SchemaMetaFieldDef={name:"__schema",type:new _definition.GraphQLNonNull(__Schema),description:"Access the current type schema of this server.",args:[],resolve:function(e,i,n){var t=n.schema;return t}};exports.SchemaMetaFieldDef=SchemaMetaFieldDef;var 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){var t=i.name,r=n.schema;return function(){return r.getType(t)}()}};exports.TypeMetaFieldDef=TypeMetaFieldDef;var 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){var t=n.parentType;return t.name}};exports.TypeNameMetaFieldDef=TypeNameMetaFieldDef},{"../jsutils/isNullish":155,"../language/printer":163,"../utilities/astFromValue":173,"./definition":166,"./scalars":170,"babel-runtime/core-js/object/keys":26,"babel-runtime/helpers/interop-require-default":35}],170:[function(require,module,exports){"use strict";function coerceInt(e){var a=Number(e);return a===a&&MAX_INT>=a&&a>=MIN_INT?(0>a?Math.ceil:Math.floor)(a):null}function coerceFloat(e){var a=Number(e);return a===a?a:null}Object.defineProperty(exports,"__esModule",{value:!0});var _definition=require("./definition"),_language=require("../language"),MAX_INT=2147483647,MIN_INT=-2147483648,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===_language.Kind.INT){var a=parseInt(e.value,10);if(MAX_INT>=a&&a>=MIN_INT)return a}return null}});exports.GraphQLInt=GraphQLInt;var 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===_language.Kind.FLOAT||e.kind===_language.Kind.INT?parseFloat(e.value):null}});exports.GraphQLFloat=GraphQLFloat;var 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===_language.Kind.STRING?e.value:null}});exports.GraphQLString=GraphQLString;var 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===_language.Kind.BOOLEAN?e.value:null}});exports.GraphQLBoolean=GraphQLBoolean;var 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===_language.Kind.STRING||e.kind===_language.Kind.INT?e.value:null}});exports.GraphQLID=GraphQLID},{"../language":158,"./definition":166}],171:[function(require,module,exports){"use strict";function typeMapReducer(e,t){for(var i=!0;i;){var r=e,n=t;if(a=void 0,i=!1,!n)return r;if(!(n instanceof _definition.GraphQLList||n instanceof _definition.GraphQLNonNull)){if(r[n.name])return(0,_jsutilsInvariant2.default)(r[n.name]===n,"Schema must contain unique named types but contains multiple "+('types named "'+n+'".')),r;r[n.name]=n;var a=r;return(n instanceof _definition.GraphQLUnionType||n instanceof _definition.GraphQLInterfaceType)&&(a=n.getPossibleTypes().reduce(typeMapReducer,a)),n instanceof _definition.GraphQLObjectType&&(a=n.getInterfaces().reduce(typeMapReducer,a)),(n instanceof _definition.GraphQLObjectType||n instanceof _definition.GraphQLInterfaceType||n instanceof _definition.GraphQLInputObjectType)&&!function(){var e=n.getFields();_Object$keys(e).forEach(function(t){var i=e[t];if(i.args){var r=i.args.map(function(e){return e.type});a=r.reduce(typeMapReducer,a)}a=typeMapReducer(a,i.type)})}(),a}e=r,t=n.ofType,i=!0}}function assertObjectImplementsInterface(e,t){var i=e.getFields(),r=t.getFields();_Object$keys(r).forEach(function(n){var a=i[n],s=r[n];(0,_jsutilsInvariant2.default)(a,'"'+t+'" expects field "'+n+'" but "'+e+'" does not provide it.'),(0,_jsutilsInvariant2.default)((0,_utilitiesTypeComparators.isTypeSubTypeOf)(a.type,s.type),t+"."+n+' expects type "'+s.type+'" but '+(e+"."+n+' provides type "'+a.type+'".')),s.args.forEach(function(i){var r=i.name,s=(0,_jsutilsFind2.default)(a.args,function(e){return e.name===r});(0,_jsutilsInvariant2.default)(s,t+"."+n+' expects argument "'+r+'" but '+(e+"."+n+" does not provide it.")),(0,_jsutilsInvariant2.default)((0,_utilitiesTypeComparators.isEqualType)(i.type,s.type),t+"."+n+"("+r+':) expects type "'+i.type+'" '+("but "+e+"."+n+"("+r+":) provides ")+('type "'+s.type+'".'))}),a.args.forEach(function(i){var r=i.name,a=(0,_jsutilsFind2.default)(s.args,function(e){return e.name===r});a||(0,_jsutilsInvariant2.default)(!(i.type instanceof _definition.GraphQLNonNull),e+"."+n+"("+r+":) is of required type "+('"'+i.type+'" but is not also provided by the ')+("interface "+t+"."+n+"."))})})}var _createClass=require("babel-runtime/helpers/create-class").default,_classCallCheck=require("babel-runtime/helpers/class-call-check").default,_Object$keys=require("babel-runtime/core-js/object/keys").default,_interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0});var _definition=require("./definition"),_directives=require("./directives"),_introspection=require("./introspection"),_jsutilsFind=require("../jsutils/find"),_jsutilsFind2=_interopRequireDefault(_jsutilsFind),_jsutilsInvariant=require("../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant),_utilitiesTypeComparators=require("../utilities/typeComparators"),GraphQLSchema=function(){function e(t){var i=this;_classCallCheck(this,e),(0,_jsutilsInvariant2.default)("object"==typeof t,"Must provide configuration object."),(0,_jsutilsInvariant2.default)(t.query instanceof _definition.GraphQLObjectType,"Schema query must be Object Type but got: "+t.query+"."),this._queryType=t.query,(0,_jsutilsInvariant2.default)(!t.mutation||t.mutation instanceof _definition.GraphQLObjectType,"Schema mutation must be Object Type if provided but "+("got: "+t.mutation+".")),this._mutationType=t.mutation,(0,_jsutilsInvariant2.default)(!t.subscription||t.subscription instanceof _definition.GraphQLObjectType,"Schema subscription must be Object Type if provided but "+("got: "+t.subscription+".")),this._subscriptionType=t.subscription,(0,_jsutilsInvariant2.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: "+t.directives+".")),this._directives=t.directives||[_directives.GraphQLIncludeDirective,_directives.GraphQLSkipDirective],this._typeMap=[this.getQueryType(),this.getMutationType(),this.getSubscriptionType(),_introspection.__Schema].reduce(typeMapReducer,{}),_Object$keys(this._typeMap).forEach(function(e){var t=i._typeMap[e];t instanceof _definition.GraphQLObjectType&&t.getInterfaces().forEach(function(e){return assertObjectImplementsInterface(t,e)})})}return _createClass(e,[{key:"getQueryType",value:function(){return this._queryType}},{key:"getMutationType",value:function(){return this._mutationType}},{key:"getSubscriptionType",value:function(){return this._subscriptionType}},{key:"getTypeMap",value:function(){return this._typeMap}},{key:"getType",value:function(e){return this.getTypeMap()[e]}},{key:"getDirectives",value:function(){return this._directives}},{key:"getDirective",value:function(e){return(0,_jsutilsFind2.default)(this.getDirectives(),function(t){return t.name===e})}}]),e}();exports.GraphQLSchema=GraphQLSchema},{"../jsutils/find":153,"../jsutils/invariant":154,"../utilities/typeComparators":184,"./definition":166,"./directives":167,"./introspection":169,"babel-runtime/core-js/object/keys":26,"babel-runtime/helpers/class-call-check":30,"babel-runtime/helpers/create-class":31,"babel-runtime/helpers/interop-require-default":35}],172:[function(require,module,exports){"use strict";function getFieldDef(e,t,i){var n=i.name.value;return n===_typeIntrospection.SchemaMetaFieldDef.name&&e.getQueryType()===t?_typeIntrospection.SchemaMetaFieldDef:n===_typeIntrospection.TypeMetaFieldDef.name&&e.getQueryType()===t?_typeIntrospection.TypeMetaFieldDef:n===_typeIntrospection.TypeNameMetaFieldDef.name&&(t instanceof _typeDefinition.GraphQLObjectType||t instanceof _typeDefinition.GraphQLInterfaceType||t instanceof _typeDefinition.GraphQLUnionType)?_typeIntrospection.TypeNameMetaFieldDef:t instanceof _typeDefinition.GraphQLObjectType||t instanceof _typeDefinition.GraphQLInterfaceType?t.getFields()[n]:void 0}var _createClass=require("babel-runtime/helpers/create-class").default,_classCallCheck=require("babel-runtime/helpers/class-call-check").default,_interopRequireWildcard=require("babel-runtime/helpers/interop-require-wildcard").default,_interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0});var _languageKinds=require("../language/kinds"),Kind=_interopRequireWildcard(_languageKinds),_typeDefinition=require("../type/definition"),_typeIntrospection=require("../type/introspection"),_typeFromAST=require("./typeFromAST"),_jsutilsFind=require("../jsutils/find"),_jsutilsFind2=_interopRequireDefault(_jsutilsFind),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._getFieldDef=i||getFieldDef}return _createClass(e,[{key:"getType",value:function(){return this._typeStack.length>0?this._typeStack[this._typeStack.length-1]:void 0}},{key:"getParentType",value:function(){return this._parentTypeStack.length>0?this._parentTypeStack[this._parentTypeStack.length-1]:void 0}},{key:"getInputType",value:function(){return this._inputTypeStack.length>0?this._inputTypeStack[this._inputTypeStack.length-1]:void 0}},{key:"getFieldDef",value:function(){return this._fieldDefStack.length>0?this._fieldDefStack[this._fieldDefStack.length-1]:void 0}},{key:"getDirective",value:function(){return this._directive}},{key:"getArgument",value:function(){return this._argument}},{key:"enter",value:function(e){var t=this._schema;switch(e.kind){case Kind.SELECTION_SET:var i=(0,_typeDefinition.getNamedType)(this.getType()),n=void 0;(0,_typeDefinition.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,c=s?(0,_typeFromAST.typeFromAST)(t,s):this.getType();this._typeStack.push(c);break;case Kind.VARIABLE_DEFINITION:var u=(0,_typeFromAST.typeFromAST)(t,e.type);this._inputTypeStack.push(u);break;case Kind.ARGUMENT:var o=void 0,y=void 0,_=this.getDirective()||this.getFieldDef();_&&(o=(0,_jsutilsFind2.default)(_.args,function(t){return t.name===e.name.value}),o&&(y=o.type)),this._argument=o,this._inputTypeStack.push(y);break;case Kind.LIST:var l=(0,_typeDefinition.getNullableType)(this.getInputType());this._inputTypeStack.push(l instanceof _typeDefinition.GraphQLList?l.ofType:void 0);break;case Kind.OBJECT_FIELD:var h=(0,_typeDefinition.getNamedType)(this.getInputType()),d=void 0;if(h instanceof _typeDefinition.GraphQLInputObjectType){var T=h.getFields()[e.name.value];d=T?T.type:void 0}this._inputTypeStack.push(d)}}},{key:"leave",value: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()}}}]),e}();exports.TypeInfo=TypeInfo},{"../jsutils/find":153,"../language/kinds":159,"../type/definition":166,"../type/introspection":169,"./typeFromAST":185,"babel-runtime/helpers/class-call-check":30,"babel-runtime/helpers/create-class":31,"babel-runtime/helpers/interop-require-default":35,"babel-runtime/helpers/interop-require-wildcard":36}],173:[function(require,module,exports){"use strict";function astFromValue(e,i){var n=!0;e:for(;n;){var a=e,t=i;r=u=s=l=o=void 0,n=!1;var r=a;if(!(t instanceof _typeDefinition.GraphQLNonNull)){if((0,_jsutilsIsNullish2.default)(r))return null;if(Array.isArray(r)){var u=function(){var e=t instanceof _typeDefinition.GraphQLList?t.ofType:null;return{v:{kind:_languageKinds.LIST,values:r.map(function(i){var n=astFromValue(i,e);return(0,_jsutilsInvariant2.default)(n,"Could not create AST item."),n})}}}();if("object"==typeof u)return u.v}else if(t instanceof _typeDefinition.GraphQLList){e=r,i=t.ofType,n=!0;continue e}if("boolean"==typeof r)return{kind:_languageKinds.BOOLEAN,value:r};if("number"==typeof r){var s=String(r),l=/^[0-9]+$/.test(s);return l?t===_typeScalars.GraphQLFloat?{kind:_languageKinds.FLOAT,value:s+".0"}:{kind:_languageKinds.INT,value:s}:{kind:_languageKinds.FLOAT,value:s}}if("string"==typeof r)return t instanceof _typeDefinition.GraphQLEnumType&&/^[_a-zA-Z][_a-zA-Z0-9]*$/.test(r)?{kind:_languageKinds.ENUM,value:r}:{kind:_languageKinds.STRING,value:JSON.stringify(r).slice(1,-1)};(0,_jsutilsInvariant2.default)("object"==typeof r&&null!==r);var o=[];return _Object$keys(r).forEach(function(e){var i=void 0;if(t instanceof _typeDefinition.GraphQLInputObjectType){var n=t.getFields()[e];i=n&&n.type}var a=astFromValue(r[e],i);a&&o.push({kind:_languageKinds.OBJECT_FIELD,name:{kind:_languageKinds.NAME,value:e},value:a})}),{kind:_languageKinds.OBJECT,fields:o}}e=r,i=t.ofType,n=!0}}var _Object$keys=require("babel-runtime/core-js/object/keys").default,_interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.astFromValue=astFromValue;var _jsutilsInvariant=require("../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant),_jsutilsIsNullish=require("../jsutils/isNullish"),_jsutilsIsNullish2=_interopRequireDefault(_jsutilsIsNullish),_languageKinds=require("../language/kinds"),_typeDefinition=require("../type/definition"),_typeScalars=require("../type/scalars")},{"../jsutils/invariant":154,"../jsutils/isNullish":155,"../language/kinds":159,"../type/definition":166,"../type/scalars":170,"babel-runtime/core-js/object/keys":26,"babel-runtime/helpers/interop-require-default":35}],174:[function(require,module,exports){"use strict";function buildWrappedType(e,n){if(n.kind===_languageKinds.LIST_TYPE)return new _type.GraphQLList(buildWrappedType(e,n.type));if(n.kind===_languageKinds.NON_NULL_TYPE){var r=buildWrappedType(e,n.type);return(0,_jsutilsInvariant2.default)(!(r instanceof _type.GraphQLNonNull),"No nesting nonnull."),new _type.GraphQLNonNull(r)}return e}function getNamedTypeAST(e){for(var n=e;n.kind===_languageKinds.LIST_TYPE||n.kind===_languageKinds.NON_NULL_TYPE;)n=n.type;return n}function buildASTSchema(e,n,r,t){function u(e){var n=i(e.name.value);return(0,_jsutilsInvariant2.default)(n instanceof _type.GraphQLObjectType,"AST must provide object type."),n}function a(e){var n=getNamedTypeAST(e).name.value,r=i(n);return buildWrappedType(r,e)}function i(e){if(m[e])return m[e];if(!g[e])throw new Error("Type "+e+" not found in document");var n=l(g[e]);if(!n)throw new Error("Nothing constructed for "+e);return m[e]=n,n}function l(e){if(!e)throw new Error("def must be defined");switch(e.kind){case _languageKinds.OBJECT_TYPE_DEFINITION:return s(e);case _languageKinds.INTERFACE_TYPE_DEFINITION:return f(e);case _languageKinds.ENUM_TYPE_DEFINITION:return c(e);case _languageKinds.UNION_TYPE_DEFINITION:return d(e);case _languageKinds.SCALAR_TYPE_DEFINITION:return y(e);case _languageKinds.INPUT_OBJECT_TYPE_DEFINITION:return T(e);default:throw new Error(e.kind+" not supported")}}function s(e){var n=e.name.value,r={name:n,fields:function(){return o(e)},interfaces:function(){return p(e)}};return new _type.GraphQLObjectType(r)}function o(e){return(0,_jsutilsKeyValMap2.default)(e.fields,function(e){return e.name.value},function(e){return{type:a(e.type),args:_(e.arguments)}})}function p(e){return e.interfaces.map(function(e){return a(e)})}function _(e){return(0,_jsutilsKeyValMap2.default)(e,function(e){return e.name.value},function(e){var n=a(e.type);return{type:n,defaultValue:(0,_valueFromAST.valueFromAST)(e.defaultValue,n)}})}function f(e){var n=e.name.value,r={name:n,resolveType:function(){return null},fields:function(){return o(e)}};return new _type.GraphQLInterfaceType(r)}function c(e){var n=new _type.GraphQLEnumType({name:e.name.value,values:(0,_jsutilsKeyValMap2.default)(e.values,function(e){return e.name.value},function(){return{}})});return n}function d(e){return new _type.GraphQLUnionType({name:e.name.value,resolveType:function(){return null},types:e.types.map(function(e){return a(e)})})}function y(e){return new _type.GraphQLScalarType({name:e.name.value,serialize:function(){return null},parseValue:function(){return!1},parseLiteral:function(){return!1}})}function T(e){return new _type.GraphQLInputObjectType({name:e.name.value,fields:function(){return _(e.fields)}})}if(!e)throw new Error("must pass in ast");if(!n)throw new Error("must pass in query type");for(var I=[],E=0;E0&&e.reportError(new _error.GraphQLError(badValueMessage(r.name.value,a.type,(0,_languagePrinter.print)(r.value),t),[r.value]))}return!1}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.badValueMessage=badValueMessage,exports.ArgumentsOfCorrectType=ArgumentsOfCorrectType;var _error=require("../../error"),_languagePrinter=require("../../language/printer"),_utilitiesIsValidLiteralValue=require("../../utilities/isValidLiteralValue")},{"../../error":145,"../../language/printer":163,"../../utilities/isValidLiteralValue":182}],189:[function(require,module,exports){"use strict";function defaultForNonNullArgMessage(e,r,a){return'Variable "$'+e+'" of type "'+r+'" is required and will not '+('use the default value. Perhaps you meant to use type "'+a+'".')}function badValueForDefaultArgMessage(e,r,a,t){var l=t?"\n"+t.join("\n"):"";return'Variable "$'+e+" has invalid default value "+a+"."+l}function DefaultValuesOfCorrectType(e){return{VariableDefinition:function(r){var a=r.variable.name.value,t=r.defaultValue,l=e.getInputType();if(l instanceof _typeDefinition.GraphQLNonNull&&t&&e.reportError(new _error.GraphQLError(defaultForNonNullArgMessage(a,l,l.ofType),[t])),l&&t){var u=(0,_utilitiesIsValidLiteralValue.isValidLiteralValue)(l,t);u&&u.length>0&&e.reportError(new _error.GraphQLError(badValueForDefaultArgMessage(a,l,(0,_languagePrinter.print)(t),u),[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"),_languagePrinter=require("../../language/printer"),_typeDefinition=require("../../type/definition"),_utilitiesIsValidLiteralValue=require("../../utilities/isValidLiteralValue")},{"../../error":145,"../../language/printer":163,"../../type/definition":166,"../../utilities/isValidLiteralValue":182}],190:[function(require,module,exports){"use strict";function undefinedFieldMessage(e,n,t){var r='Cannot query field "'+e+'" on type "'+n+'".',i=5;if(0!==t.length){var o=t.slice(0,i).map(function(e){return'"'+e+'"'}).join(", ");t.length>i&&(o+=", and "+(t.length-i)+" other types"),r+=" However, this field exists on "+o+".",r+=" Perhaps you meant to use an inline fragment?"}return r}function FieldsOnCorrectType(e){return{Field:function(n){var t=e.getParentType();if(t){var r=e.getFieldDef();if(!r){var i=[];(0,_typeDefinition.isAbstractType)(t)&&(i=getSiblingInterfacesIncludingField(t,n.name.value),i=i.concat(getImplementationsIncludingField(t,n.name.value))),e.reportError(new _error.GraphQLError(undefinedFieldMessage(n.name.value,t.name,i),[n]))}}}}}function getImplementationsIncludingField(e,n){return e.getPossibleTypes().filter(function(e){return void 0!==e.getFields()[n]}).map(function(e){return e.name}).sort()}function getSiblingInterfacesIncludingField(e,n){var t=e.getPossibleTypes().filter(function(e){return e instanceof _typeDefinition.GraphQLObjectType}),r=t.reduce(function(e,t){return t.getInterfaces().forEach(function(t){void 0!==t.getFields()[n]&&(void 0===e[t.name]&&(e[t.name]=0),e[t.name]+=1)}),e},{});return _Object$keys(r).sort(function(e,n){return r[n]-r[e]})}var _Object$keys=require("babel-runtime/core-js/object/keys").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.undefinedFieldMessage=undefinedFieldMessage,exports.FieldsOnCorrectType=FieldsOnCorrectType;var _error=require("../../error"),_typeDefinition=require("../../type/definition")},{"../../error":145,"../../type/definition":166,"babel-runtime/core-js/object/keys":26}],191:[function(require,module,exports){"use strict";function inlineFragmentOnNonCompositeErrorMessage(e){return'Fragment cannot condition on non composite type "'+e+'".'}function fragmentOnNonCompositeErrorMessage(e,n){return'Fragment "'+e+'" cannot condition on non composite '+('type "'+n+'".')}function FragmentsOnCompositeTypes(e){return{InlineFragment:function(n){var r=e.getType();n.typeCondition&&r&&!(0,_typeDefinition.isCompositeType)(r)&&e.reportError(new _error.GraphQLError(inlineFragmentOnNonCompositeErrorMessage((0,_languagePrinter.print)(n.typeCondition)),[n.typeCondition]))},FragmentDefinition:function(n){var r=e.getType();r&&!(0,_typeDefinition.isCompositeType)(r)&&e.reportError(new _error.GraphQLError(fragmentOnNonCompositeErrorMessage(n.name.value,(0,_languagePrinter.print)(n.typeCondition)),[n.typeCondition]))}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.inlineFragmentOnNonCompositeErrorMessage=inlineFragmentOnNonCompositeErrorMessage,exports.fragmentOnNonCompositeErrorMessage=fragmentOnNonCompositeErrorMessage,exports.FragmentsOnCompositeTypes=FragmentsOnCompositeTypes;var _error=require("../../error"),_languagePrinter=require("../../language/printer"),_typeDefinition=require("../../type/definition")},{"../../error":145,"../../language/printer":163,"../../type/definition":166}],192:[function(require,module,exports){"use strict";function unknownArgMessage(e,n,r){return'Unknown argument "'+e+'" on field "'+n+'" of '+('type "'+r+'".')}function unknownDirectiveArgMessage(e,n){return'Unknown argument "'+e+'" on directive "@'+n+'".'}function KnownArgumentNames(e){return{Argument:function(n,r,i,t,a){var u=a[a.length-1];if(u.kind===_languageKinds.FIELD){var s=e.getFieldDef();if(s){var o=(0,_jsutilsFind2.default)(s.args,function(e){return e.name===n.name.value});if(!o){var g=e.getParentType();(0,_jsutilsInvariant2.default)(g), -e.reportError(new _error.GraphQLError(unknownArgMessage(n.name.value,s.name,g.name),[n]))}}}else if(u.kind===_languageKinds.DIRECTIVE){var l=e.getDirective();if(l){var f=(0,_jsutilsFind2.default)(l.args,function(e){return e.name===n.name.value});f||e.reportError(new _error.GraphQLError(unknownDirectiveArgMessage(n.name.value,l.name),[n]))}}}}}var _interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.unknownArgMessage=unknownArgMessage,exports.unknownDirectiveArgMessage=unknownDirectiveArgMessage,exports.KnownArgumentNames=KnownArgumentNames;var _error=require("../../error"),_jsutilsFind=require("../../jsutils/find"),_jsutilsFind2=_interopRequireDefault(_jsutilsFind),_jsutilsInvariant=require("../../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant),_languageKinds=require("../../language/kinds")},{"../../error":145,"../../jsutils/find":153,"../../jsutils/invariant":154,"../../language/kinds":159,"babel-runtime/helpers/interop-require-default":35}],193:[function(require,module,exports){"use strict";function unknownDirectiveMessage(e){return'Unknown directive "'+e+'".'}function misplacedDirectiveMessage(e,r){return'Directive "'+e+'" may not be used on "'+r+'".'}function KnownDirectives(e){return{Directive:function(r,i,n,a,s){var t=(0,_jsutilsFind2.default)(e.getSchema().getDirectives(),function(e){return e.name===r.name.value});if(!t)return void e.reportError(new _error.GraphQLError(unknownDirectiveMessage(r.name.value),[r]));var o=s[s.length-1];switch(o.kind){case _languageKinds.OPERATION_DEFINITION:t.onOperation||e.reportError(new _error.GraphQLError(misplacedDirectiveMessage(r.name.value,"operation"),[r]));break;case _languageKinds.FIELD:t.onField||e.reportError(new _error.GraphQLError(misplacedDirectiveMessage(r.name.value,"field"),[r]));break;case _languageKinds.FRAGMENT_SPREAD:case _languageKinds.INLINE_FRAGMENT:case _languageKinds.FRAGMENT_DEFINITION:t.onFragment||e.reportError(new _error.GraphQLError(misplacedDirectiveMessage(r.name.value,"fragment"),[r]))}}}}var _interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.unknownDirectiveMessage=unknownDirectiveMessage,exports.misplacedDirectiveMessage=misplacedDirectiveMessage,exports.KnownDirectives=KnownDirectives;var _error=require("../../error"),_jsutilsFind=require("../../jsutils/find"),_jsutilsFind2=_interopRequireDefault(_jsutilsFind),_languageKinds=require("../../language/kinds")},{"../../error":145,"../../jsutils/find":153,"../../language/kinds":159,"babel-runtime/helpers/interop-require-default":35}],194:[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":145}],195:[function(require,module,exports){"use strict";function unknownTypeMessage(e){return'Unknown type "'+e+'".'}function KnownTypeNames(e){return{ObjectTypeDefinition:function(){return!1},InterfaceTypeDefinition:function(){return!1},UnionTypeDefinition:function(){return!1},InputObjectTypeDefinition:function(){return!1},NamedType:function(n){var r=n.name.value,t=e.getSchema().getType(r);t||e.reportError(new _error.GraphQLError(unknownTypeMessage(r),[n]))}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.unknownTypeMessage=unknownTypeMessage,exports.KnownTypeNames=KnownTypeNames;var _error=require("../../error")},{"../../error":145}],196:[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===_languageKinds.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"),_languageKinds=require("../../language/kinds")},{"../../error":145,"../../language/kinds":159}],197:[function(require,module,exports){"use strict";function cycleErrorMessage(e,r){var t=r.length?" via "+r.join(", "):"";return'Cannot spread fragment "'+e+'" within itself'+t+"."}function NoFragmentCycles(e){function r(o){var c=o.name.value;t[c]=!0;var i=e.getFragmentSpreads(o);if(0!==i.length){a[c]=n.length;for(var l=0;l1)for(var n=0;n0)return[[t,S.map(function(e){var r=_slicedToArray(e,1),t=r[0];return t})],S.reduce(function(e,r){var t=_slicedToArray(r,2),a=t[1];return e.concat(a)},[u]),S.reduce(function(e,r){var t=_slicedToArray(r,3),a=t[2];return e.concat(a)},[f])]}}}var a=new PairSet;return{SelectionSet:{leave:function(t){var a=collectFieldASTsAndDefs(e,e.getParentType(),t),i=r(a);i.forEach(function(r){var t=_slicedToArray(r,3),a=_slicedToArray(t[0],2),i=a[0],n=a[1],s=t[1],l=t[2];return e.reportError(new _error.GraphQLError(fieldsConflictMessage(i,n),s.concat(l)))})}}}}function sameArguments(e,r){return e.length!==r.length?!1:e.every(function(e){var t=(0,_jsutilsFind2.default)(r,function(r){return r.name.value===e.name.value});return t?sameValue(e.value,t.value):!1})}function sameValue(e,r){return!e&&!r||(0,_languagePrinter.print)(e)===(0,_languagePrinter.print)(r)}function collectFieldASTsAndDefs(e,r,t,a,i){for(var n=a||{},s=i||{},l=0;l/g,">").replace(/"/g,""").replace(/'/g,"'")}function i(e){return e.replace(/&([#\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(c.message+"",!0)+"
";throw c}}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;c>u;u++)h=i[u],a=h.length,h=h.replace(/^ *([*+-]|\d+\.) +/,""),~h.indexOf("\n ")&&(a-=h.length,h=this.options.pedantic?h.replace(/^ {1,4}/gm,""):h.replace(new RegExp("^ {1,"+a+"}","gm"),"")),this.options.smartLists&&u!==c-1&&(o=p.bullet.exec(i[u+1])[0],l===o||l.length>1&&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;r>s;s++)t=e.charCodeAt(s),Math.random()>.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(s){return""}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:"))return""}var l='
    "},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;e0&&(a=t[t.length-1]);var r=void 0,c=void 0;a?"Search Results"===a.name?(r=a.name,c=_react2.default.createElement(SearchDoc,{searchValue:a.searchValue,schema:e,onClickType:this.handleClickTypeOrField,onClickField:this.handleClickTypeOrField})):(r=a.name,c=(0,_graphql.isType)(a)?_react2.default.createElement(TypeDoc,{key:a.name,type:a,onClickType:this.handleClickTypeOrField,onClickField:this.handleClickTypeOrField}):_react2.default.createElement(FieldDoc,{key:a.name,field:a,onClickType:this.handleClickTypeOrField})):e&&(r="Documentation Explorer",c=_react2.default.createElement(SchemaDoc,{schema:e,onClickType:this.handleClickTypeOrField}));var n=void 0;1===t.length?n="Schema":t.length>1&&(n=t[t.length-2].name);var l=_react2.default.createElement("div",{className:"spinner-container"},_react2.default.createElement("div",{className:"spinner"})),o=c&&(c.type===SearchDoc||c.type===SchemaDoc);return _react2.default.createElement("div",{className:"doc-explorer"},_react2.default.createElement("div",{className:"doc-explorer-title-bar"},n&&_react2.default.createElement("div",{className:"doc-explorer-back",onClick:this.handleNavBackClick},n),_react2.default.createElement("div",{className:"doc-explorer-title"},r),_react2.default.createElement("div",{className:"doc-explorer-rhs"},this.props.children)),_react2.default.createElement("div",{className:"doc-explorer-contents"},_react2.default.createElement(SearchBox,{isShown:o,onSearch:this.handleSearch}),this.props.schema?c:l))}},{key:"showDoc",value:function(e){var t=this.state.navStack,a=t.length>0&&t[t.length-1]===e;a||(t=t.concat([e])),this.setState({navStack:t})}},{key:"showSearch",value:function(e){var t=this.state.navStack,a=t.length>0&&t[t.length-1];a?a.searchValue!==e.searchValue&&(t=t.slice(0,-1).concat([e])):t=t.concat([e]),this.setState({navStack:t})}}]),t}(_react2.default.Component);DocExplorer.propTypes={schema:_react.PropTypes.instanceOf(_graphql.GraphQLSchema)};var SearchBox=function(e){function t(e){_classCallCheck(this,t);var a=_possibleConstructorReturn(this,Object.getPrototypeOf(t).call(this,e));return a.handleChange=function(e){a.setState({value:e.target.value}),a._debouncedOnSearch()},a.state={value:null},a._debouncedOnSearch=(0,_debounce2.default)(200,function(){a.props.onSearch(a.state.value)}),a}return _inherits(t,e),_createClass(t,[{key:"shouldComponentUpdate",value:function(e,t){return e.isShown!==this.props.isShown||t.value!==this.state.value}},{key:"render",value:function(){return _react2.default.createElement("div",null,this.props.isShown&&_react2.default.createElement("label",{className:"search-box-outer"},_react2.default.createElement("input",{className:"search-box-input",onChange:this.handleChange,type:"text",value:this.state.value,placeholder:"Search the schema ..."})))}}]),t}(_react2.default.Component);SearchBox.propTypes={isShown:_react.PropTypes.bool,onSearch:_react.PropTypes.func};var SearchDoc=function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,Object.getPrototypeOf(t).apply(this,arguments))}return _inherits(t,e),_createClass(t,[{key:"shouldComponentUpdate",value:function(e){return this.props.schema!==e.schema||this.props.searchValue!==e.searchValue}},{key:"render",value:function(){var e=this,t=this.props.searchValue,a=this.props.schema,r=this.props.onClickType,c=this.props.onClickField,n=a.getTypeMap(),l=[],o=[],s=Object.keys(n),i=!0,p=!1,u=void 0;try{for(var d,m=function(){var a=d.value;if(l.length+o.length>=100)return"break";var s=n[a],i=[];e._isMatch(a,t)&&i.push("Type Name"),i.length&&l.push(_react2.default.createElement("div",{className:"doc-category-item"},_react2.default.createElement(TypeLink,{type:s,onClick:r}))),s.getFields&&!function(){var a=s.getFields();Object.keys(a).forEach(function(n){var l=a[n];if(e._isMatch(n,t))o.push(_react2.default.createElement("div",{className:"doc-category-item"},_react2.default.createElement("a",{className:"field-name",onClick:function(e){return c(l,s,e)}},l.name)," on ",_react2.default.createElement(TypeLink,{type:s,onClick:r})));else if(l.args&&l.args.length){var i=l.args.filter(function(a){return e._isMatch(a.name,t)});i.length>0&&o.push(_react2.default.createElement("div",{className:"doc-category-item"},_react2.default.createElement("a",{className:"field-name",onClick:function(e){return c(l,s,e)}},l.name),"(",_react2.default.createElement("span",null,i.map(function(e){return _react2.default.createElement("span",{className:"arg",key:e.name},_react2.default.createElement("span",{className:"arg-name"},e.name),": ",_react2.default.createElement(TypeLink,{type:e.type,onClick:r}))})),")"," on ",_react2.default.createElement(TypeLink,{type:s,onClick:r})))}})}()},h=s[Symbol.iterator]();!(i=(d=h.next()).done);i=!0){var f=m();if("break"===f)break}}catch(y){p=!0,u=y}finally{try{!i&&h.return&&h.return()}finally{if(p)throw u}}return 0===l.length&&0===o.length?_react2.default.createElement("span",{className:"doc-alert-text"},"No results found."):_react2.default.createElement("div",null,_react2.default.createElement("div",{className:"doc-category"},(l.length>0||o.length>0)&&_react2.default.createElement("div",{className:"doc-category-title"},"search results"),l,o))}},{key:"_isMatch",value:function(e,t){try{var a=t.replace(/[^_0-9A-Za-z]/g,function(e){return"\\"+e});return-1!==e.search(new RegExp(a,"i"))}catch(r){return-1!==e.toLowerCase().indexOf(t.toLowerCase())}}}]),t}(_react2.default.Component);SearchDoc.propTypes={schema:_react.PropTypes.object,searchValue:_react.PropTypes.string,onClickType:_react.PropTypes.func,onClickField:_react.PropTypes.func};var SchemaDoc=function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,Object.getPrototypeOf(t).apply(this,arguments))}return _inherits(t,e),_createClass(t,[{key:"shouldComponentUpdate",value:function(e){return this.props.schema!==e.schema}},{key:"render",value:function(){var e=this.props.schema,t=e.getQueryType(),a=e.getMutationType&&e.getMutationType(),r=e.getSubscriptionType&&e.getSubscriptionType();return _react2.default.createElement("div",null,_react2.default.createElement(Description,{className:"doc-type-description",markdown:"A GraphQL schema provides a root type for each kind of operation."}),_react2.default.createElement("div",{className:"doc-category"},_react2.default.createElement("div",{className:"doc-category-title"},"root types"),_react2.default.createElement("div",{className:"doc-category-item"},_react2.default.createElement("span",{className:"keyword"},"query"),": ",_react2.default.createElement(TypeLink,{type:t,onClick:this.props.onClickType})),a&&_react2.default.createElement("div",{className:"doc-category-item"},_react2.default.createElement("span",{className:"keyword"},"mutation"),": ",_react2.default.createElement(TypeLink,{type:a,onClick:this.props.onClickType})),r&&_react2.default.createElement("div",{className:"doc-category-item"},_react2.default.createElement("span",{className:"keyword"},"subscription"),": ",_react2.default.createElement(TypeLink,{type:r,onClick:this.props.onClickType}))))}}]),t}(_react2.default.Component);SchemaDoc.propTypes={schema:_react.PropTypes.object,onClickType:_react.PropTypes.func};var TypeDoc=function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,Object.getPrototypeOf(t).apply(this,arguments))}return _inherits(t,e),_createClass(t,[{key:"shouldComponentUpdate",value:function(e){return this.props.type!==e.type}},{key:"render",value:function(){var e=this.props.type,t=this.props.onClickType,a=this.props.onClickField,r=void 0,c=void 0;e instanceof _graphql.GraphQLUnionType?(r="possible types",c=e.getPossibleTypes()):e instanceof _graphql.GraphQLInterfaceType?(r="implementations",c=e.getPossibleTypes()):e instanceof _graphql.GraphQLObjectType&&(r="implements",c=e.getInterfaces());var n=void 0;c&&c.length>0&&(n=_react2.default.createElement("div",{className:"doc-category"},_react2.default.createElement("div",{className:"doc-category-title"},r),c.map(function(e){return _react2.default.createElement("div",{key:e.name,className:"doc-category-item"},_react2.default.createElement(TypeLink,{type:e,onClick:t}))})));var l=void 0;e.getFields&&!function(){var r=e.getFields(),c=Object.keys(r).map(function(e){return r[e]});l=_react2.default.createElement("div",{className:"doc-category"},_react2.default.createElement("div",{className:"doc-category-title"},"fields"),c.map(function(r){var c=void 0;return r.args&&r.args.length>0&&(c=r.args.map(function(e){return _react2.default.createElement("span",{className:"arg",key:e.name},_react2.default.createElement("span",{className:"arg-name"},e.name),": ",_react2.default.createElement(TypeLink,{type:e.type,onClick:t}))})),_react2.default.createElement("div",{key:r.name,className:"doc-category-item"},_react2.default.createElement("a",{className:"field-name",onClick:function(t){return a(r,e,t)}},r.name),c&&["(",_react2.default.createElement("span",{key:"args"},c),")"],": ",_react2.default.createElement(TypeLink,{type:r.type,onClick:t}))}))}();var o=void 0;return e instanceof _graphql.GraphQLEnumType&&(o=_react2.default.createElement("div",{className:"doc-category"},_react2.default.createElement("div",{className:"doc-category-title"},"values"),e.getValues().map(function(e){return _react2.default.createElement("div",{key:e.name,className:"doc-category-item"},_react2.default.createElement("div",{className:"enum-value"},e.name),_react2.default.createElement(Description,{className:"doc-value-description",markdown:e.description}))}))),_react2.default.createElement("div",null,_react2.default.createElement(Description,{className:"doc-type-description",markdown:e.description||"No Description"}),e instanceof _graphql.GraphQLObjectType&&n,l,o,!(e instanceof _graphql.GraphQLObjectType)&&n)}}]),t}(_react2.default.Component);TypeDoc.propTypes={type:_react.PropTypes.object,onClickType:_react.PropTypes.func,onClickField:_react.PropTypes.func};var FieldDoc=function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,Object.getPrototypeOf(t).apply(this,arguments))}return _inherits(t,e),_createClass(t,[{key:"shouldComponentUpdate",value:function(e){return this.props.field!==e.field}},{key:"render",value:function(){var e=this,t=this.props.field,a=void 0;return t.args&&t.args.length>0&&(a=_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("span",{className:"arg-name"},t.name),": ",_react2.default.createElement(TypeLink,{type:t.type,onClick:e.props.onClickType})),_react2.default.createElement(Description,{className:"doc-value-description",markdown:t.description}))}))),_react2.default.createElement("div",null,_react2.default.createElement(Description,{className:"doc-type-description",markdown:t.description||"No Description"}),_react2.default.createElement("div",{className:"doc-category"},_react2.default.createElement("div",{className:"doc-category-title"},"type"),_react2.default.createElement(TypeLink,{type:t.type,onClick:this.props.onClickType})),a)}}]),t}(_react2.default.Component);FieldDoc.propTypes={field:_react.PropTypes.object,onClickType:_react.PropTypes.func};var TypeLink=function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,Object.getPrototypeOf(t).apply(this,arguments))}return _inherits(t,e),_createClass(t,[{key:"shouldComponentUpdate",value:function(e){return this.props.type!==e.type}},{key:"render",value:function(){return renderType(this.props.type,this.props.onClick)}}]),t}(_react2.default.Component);TypeLink.propTypes={type:_react.PropTypes.object,onClick:_react.PropTypes.func};var Description=function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,Object.getPrototypeOf(t).apply(this,arguments))}return _inherits(t,e),_createClass(t,[{key:"shouldComponentUpdate",value:function(e){return this.props.markdown!==e.markdown}},{key:"render",value:function(){var e=this.props.markdown;if(!e)return _react2.default.createElement("div",null);var t=(0,_marked2.default)(e,{sanitize:!0});return _react2.default.createElement("div",{className:this.props.className,dangerouslySetInnerHTML:{__html:t}})}}]),t}(_react2.default.Component);Description.propTypes={markdown:_react.PropTypes.string,className:_react.PropTypes.string}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utility/debounce":10,graphql:49,marked:246}],2:[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.ExecuteButton=void 0;var _createClass=function(){function e(e,t){for(var n=0;n1,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 u=void 0;!this.props.isRunning&&o||(u=this._onClick);var a=void 0;return this.props.isRunning||!o||n||(a=this._onOptionsOpen),_react2.default.createElement("div",{className:"execute-button-wrap"},_react2.default.createElement("button",{className:"execute-button",onMouseDown:a,onClick:u,title:"Execute Query (Ctrl-Enter)"},_react2.default.createElement("svg",{width:"34",height:"34"},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"}))),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:{})},{}],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)}function isPromise(e){return"object"===("undefined"==typeof e?"undefined":_typeof(e))&&"function"==typeof e.then}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?"symbol":typeof e},_extends=Object.assign||function(e){for(var t=1;t0&&!function(){var t=e.queryEditorComponent.getCodeMirror();t.operation(function(){var e=t.getCursor(),o=t.indexFromPos(e);t.setValue(n);var i=0,a=r.map(function(e){var r=e.index,n=e.string;return t.markText(t.posFromIndex(r+i),t.posFromIndex(r+(i+=n.length)),{className:"autoInsertedLeaf",clearOnEnter:!0,title:"Automatically added leaf fields"})});setTimeout(function(){return a.forEach(function(e){return e.clear()})},7e3);var s=o;r.forEach(function(e){var t=e.index,r=e.string;o>t&&(s+=r.length)}),t.setCursor(t.posFromIndex(s))})}(),n}},{key:"_ensureOfSchema",value:function(){var e=this;if(void 0===this.state.schema){var t=this.props.fetcher,r=t({query:_introspectionQueries.introspectionQuery});return isPromise(r)?void r.then(function(e){if(e.data)return e;var n=t({query:_introspectionQueries.introspectionQuerySansSubscriptions});if(!isPromise(r))throw new Error("Fetcher did not return a Promise for introspection.");return n}).then(function(t){if(void 0===e.state.schema)if(t&&t.data){var r=(0,_graphql.buildClientSchema)(t.data),n=(0,_getQueryFacts2.default)(r,e.state.query);e.setState(_extends({schema:r},n))}else{var o="string"==typeof t?t:JSON.stringify(t,null,2);e.setState({response:o})}}).catch(function(t){e.setState({response:t&&(t.stack||String(t))})}):void this.setState({response:"Fetcher did not return a Promise for introspection."})}}},{key:"_storageGet",value:function(e){return this._storage&&this._storage.getItem("graphiql:"+e)}},{key:"_storageSet",value:function(e,t){this._storage&&this._storage.setItem("graphiql:"+e,t)}},{key:"_fetchQuery",value:function(e,t,r,n){var o=this,i=this.props.fetcher,a=i({query:e,variables:t,operationName:r});if(isPromise(a))a.then(n).catch(function(e){o.setState({isWaitingForResponse:!1,response:e&&(e.stack||String(e))})});else{if(isObservable(a)){var s=a.subscribe({next:n,error:function(e){o.setState({isWaitingForResponse:!1,response:e&&(e.stack||String(e)),subscription:null})},complete:function(){o.setState({isWaitingForResponse:!1,subscription:null})}});return s}this.setState({isWaitingForResponse:!1,response:"Fetcher did not return Promise or Observable."})}}},{key:"_runQueryAtCursor",value:function(){if(this.state.subscription)return void this.handleStopQuery();var e=void 0,t=this.state.operations;if(t){var r=this.queryEditorComponent.getCodeMirror();if(r.hasFocus())for(var n=r.getCursor(),o=r.indexFromPos(n),i=0;i=o){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,getDefaultFieldNames:_react.PropTypes.func};var _initialiseProps=function(){var e=this;this.handleRunQuery=function(t){e._editorQueryID++;var r=e._editorQueryID,n=e.autoCompleteLeafs()||e.state.query,o=e.state.variables,i=e.state.operationName;if(t&&t!==i){i=t;var a=e.props.onEditOperationName;a&&a(i)}var s=e._fetchQuery(n,o,i,function(t){r===e._editorQueryID&&e.setState({isWaitingForResponse:!1,response:JSON.stringify(t,null,2)})});e.setState({isWaitingForResponse:!0,response:null,subscription:s,operationName:i})},this.handleStopQuery=function(){var t=e.state.subscription;e.setState({isWaitingForResponse:!1,subscription:null}),t&&t.unsubscribe()},this._keyHandler=function(t){(t.metaKey||t.ctrlKey)&&13===t.keyCode&&(t.preventDefault(),e._runQueryAtCursor()); +},this.handlePrettifyQuery=function(){var t=(0,_graphql.print)((0,_graphql.parse)(e.state.query)),r=e.queryEditorComponent.getCodeMirror();r.setValue(t)},this.handleEditQuery=function(t){return e.state.schema&&e._updateQueryFacts(t),e.setState({query:t}),e.props.onEditQuery?e.props.onEditQuery(t):void 0},this._updateQueryFacts=(0,_debounce2.default)(150,function(t){var r=(0,_getQueryFacts2.default)(e.state.schema,t);if(r){var n=(0,_getSelectedOperationName2.default)(e.state.operations,e.state.operationName,r.operations),o=e.props.onEditOperationName;o&&n!==e.state.operationName&&o(n),e.setState(_extends({operationName:n},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._onClickHintInformation=function(t){if("typeName"===t.target.className){var r=t.target.innerHTML,n=e.state.schema;n&&!function(){var t=n.getType(r);t&&e.setState({docExplorerOpen:!0},function(){e.docExplorerComponent.showDoc(t)})}()}},this.handleToggleDocs=function(){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),n=function(t){if(0===t.buttons)return o();var n=_reactDom2.default.findDOMNode(e.editorBarComponent),i=t.clientX-(0,_elementPosition.getLeft)(n)-r,a=n.clientWidth-i;e.setState({editorFlex:i/a})},o=function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(){document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",o),n=null,o=null});document.addEventListener("mousemove",n),document.addEventListener("mouseup",o)}},this.handleDocsResizeStart=function(t){t.preventDefault();var r=e.state.docExplorerWidth,n=t.clientX-(0,_elementPosition.getLeft)(t.target),o=function(t){if(0===t.buttons)return i();var r=_reactDom2.default.findDOMNode(e),o=t.clientX-(0,_elementPosition.getLeft)(r)-n,a=r.clientWidth-o;100>a?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",o),document.removeEventListener("mouseup",i),o=null,i=null});document.addEventListener("mousemove",o),document.addEventListener("mouseup",i)},this.handleVariableResizeStart=function(t){t.preventDefault();var r=!1,n=e.state.variableEditorOpen,o=e.state.variableEditorHeight,i=t.clientY-(0,_elementPosition.getTop)(t.target),a=function(t){if(0===t.buttons)return s();r=!0;var n=_reactDom2.default.findDOMNode(e.editorBarComponent),a=t.clientY-(0,_elementPosition.getTop)(n)-i,u=n.clientHeight-a;60>u?e.setState({variableEditorOpen:!1,variableEditorHeight:o}):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:!n}),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.ToolbarButton=_ToolbarButton.ToolbarButton,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 IDE for writing, validating, and\n# testing GraphQL queries.\n#\n# Type queries into this side of the screen, and you will\n# see intelligent typeaheads aware of the current GraphQL type schema and\n# live syntax and validation errors highlighted within the text.\n#\n# To bring up the auto-complete at any point, just press Ctrl-Space.\n#\n# Press the run button above, or Cmd-Enter to execute the query, and the result\n# will appear in the pane to the right.\n\n"}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utility/CodeMirrorSizer":9,"../utility/debounce":10,"../utility/elementPosition":11,"../utility/fillLeafs":12,"../utility/find":13,"../utility/getQueryFacts":14,"../utility/getSelectedOperationName":15,"../utility/introspectionQueries":16,"./DocExplorer":1,"./ExecuteButton":2,"./QueryEditor":4,"./ResultViewer":5,"./ToolbarButton":6,"./VariableEditor":7,graphql:49}],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}),exports.QueryEditor=void 0;var _createClass=function(){function e(e,t){for(var o=0;o=65&&90>=r||!t.shiftKey&&r>=48&&57>=r||t.shiftKey&&189===r||t.shiftKey&&50===r||t.shiftKey&&57===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;this.editor=(0,_codemirror2.default)(_reactDom2.default.findDOMNode(this),{value:this.props.value||"",lineNumbers:!0,tabSize:2,mode:"graphql",theme:"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},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})},"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){this.ignoreChangeEvent=!0,this.props.schema!==e.schema&&(this.editor.options.lint.schema=this.props.schema,this.editor.options.hintOptions.schema=this.props.schema,_codemirror2.default.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(){return _react2.default.createElement("div",{className:"query-editor"})}},{key:"getCodeMirror",value:function(){return this.editor}}]),t}(_react2.default.Component);QueryEditor.propTypes={schema:_react.PropTypes.instanceOf(_graphql.GraphQLSchema),value:_react.PropTypes.string,onEdit:_react.PropTypes.func,onHintInformationRender:_react.PropTypes.func}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utility/onHasCompletion":17,codemirror:38,"codemirror-graphql/hint":18,"codemirror-graphql/lint":19,"codemirror-graphql/mode":20,"codemirror/addon/comment/comment":28,"codemirror/addon/edit/closebrackets":29,"codemirror/addon/edit/matchbrackets":30,"codemirror/addon/fold/brace-fold":31,"codemirror/addon/fold/foldgutter":33,"codemirror/addon/hint/show-hint":34,"codemirror/addon/lint/lint":35,"codemirror/keymap/sublime":37,graphql:49}],5:[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&&90>=r||!t.shiftKey&&r>=48&&57>=r||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;this.editor=(0,_codemirror2.default)(_reactDom2.default.findDOMNode(this),{value:this.props.value||"",lineNumbers:!0,tabSize:2,mode:"graphql-variables",theme:"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})},"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){this.ignoreChangeEvent=!0,this.props.variableToType!==e.variableToType&&(this.editor.options.lint.variableToType=this.props.variableToType,this.editor.options.hintOptions.variableToType=this.props.variableToType,_codemirror2.default.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(){return _react2.default.createElement("div",{className:"codemirrorWrap"})}},{key:"getCodeMirror",value:function(){return this.editor}}]),t}(_react2.default.Component);VariableEditor.propTypes={variableToType:_react.PropTypes.object,value:_react.PropTypes.string,onEdit:_react.PropTypes.func,onHintInformationRender:_react.PropTypes.func}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utility/onHasCompletion":17,codemirror:38,"codemirror-graphql/variables/hint":25,"codemirror-graphql/variables/lint":26,"codemirror-graphql/variables/mode":27,"codemirror/addon/edit/closebrackets":29,"codemirror/addon/edit/matchbrackets":30,"codemirror/addon/fold/brace-fold":31,"codemirror/addon/fold/foldgutter":33,"codemirror/addon/hint/show-hint":34,"codemirror/addon/lint/lint":35,"codemirror/keymap/sublime":37}],8:[function(require,module,exports){"use strict";module.exports=require("./components/GraphiQL").GraphiQL},{"./components/GraphiQL":3}],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")}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function e(e,t){for(var r=0;r'+renderType(r.type)+"":"";o.innerHTML='
    '+("

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

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

    ",t&&t(o)})}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 _codemirror=require("codemirror"),_codemirror2=_interopRequireDefault(_codemirror),_graphql=require("graphql"),_marked=require("marked"),_marked2=_interopRequireDefault(_marked)},{codemirror:38,graphql:49,marked:246}],18:[function(require,module,exports){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function canUseDirective(e,t){var i=t.locations;switch(e){case"Query":return-1!==i.indexOf("QUERY");case"Mutation":return-1!==i.indexOf("MUTATION");case"Subscription":return-1!==i.indexOf("SUBSCRIPTION");case"Field":return-1!==i.indexOf("FIELD");case"FragmentDefinition":return-1!==i.indexOf("FRAGMENT_DEFINITION");case"FragmentSpread":return-1!==i.indexOf("FRAGMENT_SPREAD");case"InlineFragment":return-1!==i.indexOf("INLINE_FRAGMENT")}return!1}function getTypeInfo(e,t){var i={type:null,parentType:null,inputType:null,directiveDef:null,fieldDef:null,argDef:null,argDefs:null,objectFieldDefs:null};return _utilsForEachState2.default(t,function(t){switch(t.kind){case"Query":case"ShortQuery":i.type=e.getQueryType();break;case"Mutation":i.type=e.getMutationType();break;case"Subscription":i.type=e.getSubscriptionType();break;case"InlineFragment":case"FragmentDefinition":t.type&&(i.type=e.getType(t.type));break;case"Field":i.fieldDef=i.type&&t.name?getFieldDef(e,i.parentType,t.name):null,i.type=i.fieldDef&&i.fieldDef.type;break;case"SelectionSet":i.parentType=_graphql.getNamedType(i.type);break;case"Directive":i.directiveDef=t.name&&e.getDirective(t.name);break;case"Arguments":i.argDefs="Field"===t.prevState.kind?i.fieldDef&&i.fieldDef.args:"Directive"===t.prevState.kind?i.directiveDef&&i.directiveDef.args:null;break;case"Argument":if(i.argDef=null,i.argDefs)for(var n=0;n=0;a--)e(r[a])}exports.__esModule=!0,exports.default=forEachState,module.exports=exports.default},{}],22:[function(require,module,exports){"use strict";function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function hintList(t,r,e,n,i){var o=filterAndSortList(i,normalizeText(n.string));if(o){var l=null!==n.type&&/"|\w/.test(n.string[0])?n.start:n.end,u={list:o,from:_codemirror2.default.Pos(e.line,l),to:_codemirror2.default.Pos(e.line,n.end)};return _codemirror2.default.signal(t,"hasCompletion",t,u,n),u}}function filterAndSortList(t,r){var e=r?t.map(function(t){return{proximity:getProximity(normalizeText(t.text),r),entry:t}}).filter(function(t){return t.proximity<=2}).sort(function(t,r){return t.proximity-r.proximity||t.entry.text.length-r.entry.text.length}).map(function(t){return t.entry}):t;return e.length>0?e:t}function normalizeText(t){return t.toLowerCase().replace(/\W/g,"")}function getProximity(t,r){var e=lexicalDistance(r,t);return t.length>r.length&&(e-=t.length-r.length-1,e+=0===t.indexOf(r)?0:.5),e}function lexicalDistance(t,r){var e=void 0,n=void 0,i=[],o=t.length,l=r.length;for(e=0;o>=e;e++)i[e]=[e];for(n=1;l>=n;n++)i[0][n]=n;for(e=1;o>=e;e++)for(n=1;l>=n;n++){var u=t[e-1]===r[n-1]?0:1;i[e][n]=Math.min(i[e-1][n]+1,i[e][n-1]+1,i[e-1][n-1]+u),e>1&&n>1&&t[e-1]===r[n-2]&&t[e-2]===r[n-1]&&(i[e][n]=Math.min(i[e][n],i[e-2][n-2]+u))}return i[o][l]}exports.__esModule=!0,exports.default=hintList;var _codemirror=require("codemirror"),_codemirror2=_interopRequireDefault(_codemirror);module.exports=exports.default},{codemirror:38}],23:[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){return kind===e?(lex(),!0):void 0}function ch(){strLen>end&&(end++,code=end===strLen?0:string.charCodeAt(end))}function lex(){for(lastEnd=end;9===code||10===code||13===code||32===code;)ch();if(0===code)return void(kind="EOF");switch(start=end,code){case 34:return kind="String",readString();case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return kind="Number",readNumber();case 102:if("false"!==string.slice(start,start+5))break;return end+=4,ch(),void(kind="Boolean");case 110:if("null"!==string.slice(start,start+4))break;return end+=3,ch(),void(kind="Null");case 116:if("true"!==string.slice(start,start+4))break;return end+=3,ch(),void(kind="Boolean")}kind=string[start],ch()}function readString(){for(ch();34!==code&&code>31;)if(ch(),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.");if(34===code)return void ch();throw syntaxError("Unterminated string.")}function readHex(){if(code>=48&&57>=code||code>=65&&70>=code||code>=97&&102>=code)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(48>code||code>57)throw syntaxError("Expected decimal digit.");do ch();while(code>=48&&57>=code)}exports.__esModule=!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;module.exports=exports.default},{}],24:[function(require,module,exports){"use strict";function onlineParser(e){var t=e.eatWhitespace,n=e.LexRules,r=e.ParseRules;return{startState:function(){var e={level:0};return pushRule(r,e,"Document"),e},getToken:function(e){function t(t,n){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(e,u){return getToken(t,n,r,this,e,u)})}}function opt(e){return{ofRule:e}}function list(e,t){return{ofRule:e,isList:!0,separator:t}}function butNot(e,t){var n=e.match;return e.match=function(e){return n(e)&&t.every(function(t){return!t.match(e)})},e}function t(e,t){return{style:t,match:function(t){return t.kind===e}}}function p(e,t){return{style:t||"punctuation",match:function(t){return"Punctuation"===t.kind&&t.value===e}}}function getToken(e,t,n,r,u,a){if(a.needsAdvance&&(a.needsAdvance=!1,advanceRule(a,!0)),u.sol()&&(a.indentLevel=Math.floor(u.indentation()/r.config.tabSize)),e(u))return"ws";if(r.lineComment&&u.match(r.lineComment))return u.skipToEnd(),"comment";var s=lex(t,u);if(!s)return u.match(/\S+/),"invalidchar";if(saveState(a),"Punctuation"===s.kind)if(/^[{([]/.test(s.value))a.levels=(a.levels||[]).concat(a.indentLevel+1);else if(/^[})\]]/.test(s.value)){var i=a.levels=(a.levels||[]).slice(0,-1);i.length>0&&i[i.length-1]=0;a--){var m=o[a].from(),c=o[a].to();m.line>=i||(c.line>=i&&(c=l(i,0)),i=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,o,r){r||(r=t);var a=this,m=a.getModeAt(e),c=r.lineComment||m.lineComment;if(!c)return void((r.blockCommentStart||m.blockCommentStart)&&(r.fullLines=!0,a.blockComment(e,o,r)));var f=a.getLine(e.line);if(null!=f){var g=Math.min(0!=o.ch||o.line==e.line?o.line+1:o.line,a.lastLine()+1),s=null==r.padding?" ":r.padding,d=r.commentBlankLines||e.line==o.line;a.operation(function(){if(r.indent){for(var t=null,o=e.line;g>o;++o){var m=a.getLine(o),f=m.slice(0,n(m));(null==t||t.length>f.length)&&(t=f)}for(var o=e.line;g>o;++o){var m=a.getLine(o),u=t.length;(d||i.test(m))&&(m.slice(0,u)!=t&&(u=n(m)),a.replaceRange(t+c+s,l(o,0),l(o,u)))}}else for(var o=e.line;g>o;++o)(d||i.test(a.getLine(o)))&&a.replaceRange(c+s,l(o,0))})}}),e.defineExtension("blockComment",function(e,n,o){o||(o=t);var r=this,a=r.getModeAt(e),m=o.blockCommentStart||a.blockCommentStart,c=o.blockCommentEnd||a.blockCommentEnd;if(!m||!c)return void((o.lineComment||a.lineComment)&&0!=o.fullLines&&r.lineComment(e,n,o));var f=Math.min(n.line,r.lastLine());f!=e.line&&0==n.ch&&i.test(r.getLine(f))&&--f;var g=null==o.padding?" ":o.padding;e.line>f||r.operation(function(){if(0!=o.fullLines){var t=i.test(r.getLine(f));r.replaceRange(g+c,l(f)),r.replaceRange(m+g,l(e.line,0));var s=o.blockCommentLead||a.blockCommentLead;if(null!=s)for(var d=e.line+1;f>=d;++d)(d!=f||t)&&r.replaceRange(s+g,l(d,0))}else r.replaceRange(c,n),r.replaceRange(m,e)})}),e.defineExtension("uncomment",function(e,n,o){o||(o=t);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=o.lineComment||m.lineComment,s=[],d=null==o.padding?" ":o.padding;e:if(g){for(var u=f;c>=u;++u){var h=a.getLine(u),v=h.indexOf(g);if(v>-1&&!/comment/.test(a.getTokenTypeAt(l(u,v+1)))&&(v=-1),-1==v&&(u!=c||u==f)&&i.test(h))break e;if(v>-1&&i.test(h.slice(0,v)))break e;s.push(h)}if(a.operation(function(){for(var e=f;c>=e;++e){var n=s[e-f],t=n.indexOf(g),i=t+g.length;0>t||(n.slice(i,i+d.length)==d&&(i+=d.length),r=!0,a.replaceRange("",l(e,t),l(e,i)))}}),r)return!0}var C=o.blockCommentStart||m.blockCommentStart,p=o.blockCommentEnd||m.blockCommentEnd;if(!C||!p)return!1;var b=o.blockCommentLead||m.blockCommentLead,k=a.getLine(f),L=c==f?k:a.getLine(c),x=k.indexOf(C),R=L.lastIndexOf(p);if(-1==R&&f!=c&&(L=a.getLine(--c),R=L.lastIndexOf(p)),-1==x||-1==R||!/comment/.test(a.getTokenTypeAt(l(f,x+1)))||!/comment/.test(a.getTokenTypeAt(l(c,R+1))))return!1;var O=k.lastIndexOf(C,e.ch),E=-1==O?-1:k.slice(0,e.ch).indexOf(p,O+C.length);if(-1!=O&&-1!=E&&E+p.length!=e.ch)return!1;E=L.indexOf(p,n.ch);var M=L.slice(n.ch).lastIndexOf(C,E-n.ch);return O=-1==E||-1==M?-1:n.ch+M,-1!=E&&-1!=O&&O!=n.ch?!1:(a.operation(function(){a.replaceRange("",l(c,R-(d&&L.slice(R-d.length,R)==d?d.length:0)),l(c,R+p.length));var e=x+C.length;if(d&&k.slice(e,e+d.length)==d&&(e+=d.length),a.replaceRange("",l(f,x),l(f,e)),b)for(var n=f+1;c>=n;++n){var t=a.getLine(n),o=t.indexOf(b);if(-1!=o&&!i.test(t.slice(0,o))){var r=o+b.length;d&&t.slice(r,r+d.length)==d&&(r+=d.length),a.replaceRange("",l(n,o),l(n,r))}}}),!0)})})},{"../../lib/codemirror":38}],29:[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 t(e,t){return"pairs"==t&&"string"==typeof e?e:"object"==typeof e&&null!=e[t]?e[t]:u[t]}function n(e){return function(t){return s(t,e)}}function r(e){var t=e.state.closeBrackets;if(!t)return null;var n=e.getModeAt(e.getCursor());return n.closeBrackets||t}function i(n){var i=r(n);if(!i||n.getOption("disableInput"))return e.Pass;for(var a=t(i,"pairs"),o=n.listSelections(),s=0;s=0;s--){var f=o[s].head;n.replaceRange("",h(f.line,f.ch-1),h(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 h(t.anchor.line,t.anchor.ch+(n?-1:1)),head:new h(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"),c=s.indexOf(i);if(-1==c)return e.Pass;for(var u,d,g=t(a,"triples"),p=s.charAt(c+1)==i,v=n.listSelections(),m=c%2==0,b=0;b1&&g.indexOf(i)>=0&&n.getRange(h(P.line,P.ch-2),P)==i+i&&(P.ch<=2||n.getRange(h(P.line,P.ch-3),h(P.line,P.ch-2))!=i))x="addFour";else if(p){if(e.isWordChar(d)||!f(n,P,i))return e.Pass;x="both"}else{if(!m||n.getLine(P.line).length!=P.ch&&!l(d,s)&&!/\s/.test(d))return e.Pass;x="both"}else x=g.indexOf(i)>=0&&n.getRange(P,h(P.line,P.ch+3))==i+i+i?"skipThree":"skip";if(u){if(u!=x)return e.Pass}else u=x}var S=c%2?s.charAt(c-1):i,k=c%2?i:s.charAt(c+1);n.operation(function(){if("skip"==u)n.execCommand("goCharRight");else if("skipThree"==u)for(var e=0;3>e;e++)n.execCommand("goCharRight");else if("surround"==u){for(var t=n.getSelections(),e=0;e-1&&n%2==1}function c(e,t){var n=e.getRange(h(t.line,t.ch-1),h(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}}var u={pairs:"()[]{}''\"\"",triples:"",explode:"[]{}"},h=e.Pos;e.defineOption("autoCloseBrackets",!1,function(t,n,r){r&&r!=e.Init&&(t.removeKeyMap(g),t.state.closeBrackets=null),n&&(t.state.closeBrackets=n,t.addKeyMap(g))});for(var d=u.pairs+"`",g={Backspace:i,Enter:a},p=0;p=0&&c[o.text.charAt(f)]||c[o.text.charAt(++f)];if(!l)return null;var u=">"==l.charAt(1)?1:-1;if(i&&u>0!=(f==t.ch))return null;var h=e.getTokenTypeAt(a(t.line,f+1)),s=n(e,a(t.line,f+(u>0?1:0)),u,h||null,r);return null==s?null:{from:a(t.line,f),to:s&&s.pos,match:s&&s.ch==l.charAt(0),forward:u>0}}function n(e,t,n,i,r){for(var o=r&&r.maxScanLineLength||1e4,f=r&&r.maxScanLines||1e3,l=[],u=r&&r.bracketRegex?r.bracketRegex:/[(){}[\]]/,h=n>0?Math.min(t.line+f,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-f),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-(0>n?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)l.push(p);else{if(!l.length)return{pos:a(s,d),ch:p};l.pop()}}}}}return s-n==(n>0?e.lastLine():e.firstLine())?!1:null}function i(e,n,i){for(var r=e.state.matchBrackets.maxHighlightLineLength||1e3,c=[],f=e.listSelections(),l=0;l",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},f=null;e.defineOption("matchBrackets",!1,function(t,n,i){i&&i!=e.Init&&t.off("cursorActivity",r),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":38}],31:[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 i=n.ch,s=0;;){var u=0>=i?-1:f.lastIndexOf(t,i-1);if(-1!=u){if(1==s&&u=v;++v)for(var p=r.getLine(v),m=v==l?i:0;;){var P=p.indexOf(s,m),k=p.indexOf(u,m);if(0>P&&(P=p.length),0>k&&(k=p.length),m=Math.min(P,k),m==p.length)break;if(r.getTokenTypeAt(e.Pos(v,m+1))==o)if(m==P)++c;else if(!--c){a=v,d=m;break e}++m}if(null!=a&&(l!=a||d!=i))return{from:e.Pos(l,i),to:e.Pos(a,d)}}}),e.registerHelper("fold","import",function(r,n){function t(n){if(nr.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);o>=i;++i){var l=r.getLine(i),f=l.indexOf(";");if(-1!=f)return{startCh:t.end,end:e.Pos(i,f)}}}var i,n=n.line,o=t(n);if(!o||t(n-1)||(i=t(n-2))&&i.end.line==n-1)return null;for(var l=o.end;;){var f=t(l.line+1);if(null==f)break;l=f.end}return{from:r.clipPos(e.Pos(n,o.startCh+1)),to:l}}),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 n=n.line,i=t(n);if(null==i||null!=t(n-1))return null;for(var o=n;;){var l=t(o+1);if(null==l)break;++o}return{from:e.Pos(n,i+1),to:r.clipPos(e.Pos(o))}})})},{"../../lib/codemirror":38}],32:[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,f){function l(n){var e=d(o,i);if(!e||e.to.line-e.from.lineo.firstLine();)i=n.Pos(i.line-1,0),a=l(!1);if(a&&!a.cleared&&"unfold"!==f){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:!0,__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=e;e++)o.foldCode(n.Pos(e,0),null,"fold")})},n.commands.unfoldAll=function(o){o.operation(function(){for(var e=o.firstLine(),r=o.lastLine();r>=e;e++)o.foldCode(n.Pos(e,0),null,"unfold")})},n.registerHelper("fold","combine",function(){var n=Array.prototype.slice.call(arguments,0);return function(o,e){for(var r=0;r=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 p)o[s]=p[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,f=0;f0){var A=C.bottom-C.top,x=g.top-(g.bottom-C.top);if(x-A>0)h.style.top=(y=g.top-A)+"px",w=!1;else if(A>H){h.style.height=H-5+"px",h.style.top=(y=g.bottom-C.top)+"px";var S=r.getCursor();e.from.ch!=S.ch&&(g=r.cursorCoords(S),h.style.left=(v=g.left)+"px",C=h.getBoundingClientRect())}}var T=C.right-k;if(T>0&&(C.right-C.left>k&&(h.style.width=k-5+"px",T-=C.right-C.left-k),h.style.left=(v=g.left-T)+"px"),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 M;r.on("blur",this.onBlur=function(){M=setTimeout(function(){i.close()},100)}),r.on("focus",this.onFocus=function(){clearTimeout(M)})}var F=r.getScrollInfo();return r.on("scroll",this.onScroll=function(){var t=r.getScrollInfo(),e=r.getWrapperElement().getBoundingClientRect(),n=y+F.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+F.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;n1)){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:0>i&&(i=e?0:this.data.list.length-1),this.selectedHint!=i){var n=this.hints.childNodes[this.selectedHint];n.className=n.className.replace(" "+u,""),n=this.hints.childNodes[this.selectedHint=i],n.className+=" "+u,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:l}),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":38}],35:[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),u=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}}return l?void 0:clearInterval(u)},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;i-1)return f=n(h,c,f),{from:i(o.line,f),to:i(o.line,f+s.length)}}else{var h=e.getLine(o.line).slice(o.ch),c=l(h),f=c.indexOf(t);if(f>-1)return f=n(h,c,f)+o.ch,{from:i(o.line,f),to:i(o.line,f+s.length)}}}:this.matches=function(){};else{var c=s.split("\n");this.matches=function(t,n){var r=h.length-1;if(t){if(n.line-(h.length-1)=1;--f,--s)if(h[f]!=l(e.getLine(s)))return;var u=e.getLine(s),a=u.length-c[0].length;if(l(u.slice(a))!=h[0])return;return{from:i(s,a),to:o}}if(!(n.line+(h.length-1)>e.lastLine())){var u=e.getLine(n.line),a=u.length-c[0].length;if(l(u.slice(a))==h[0]){for(var g=i(n.line,a),s=n.line+1,f=1;r>f;++f,++s)if(h[f]!=l(e.getLine(s)))return;if(l(e.getLine(s).slice(0,c[r].length))==h[r])return{from:g,to:i(s,c[r].length)}}}}}}}function n(e,t,n){if(e.length==t.length)return n;for(var i=Math.min(n,e.length);;){var r=e.slice(0,i).toLowerCase().length;if(n>r)++i;else{if(!(r>n))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(){return this.atOccurrence?this.pos.from:void 0},to:function(){return this.atOccurrence?this.pos.to:void 0},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":38}],37:[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(0>r&&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=0>r?0:o.length,c=0;l!=s;l+=r,c++){var f=o.charAt(0>r?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&&0>r&&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):0>n?r.from():r.to()})}function r(t,n){return t.isReadOnly()?e.Pass:void t.operation(function(){for(var e=t.listSelections().length,r=[],o=-1,i=0;e>i;i++){var a=t.listSelections()[i].head;if(!(a.line<=o)){var l=h(a.line+(n?0:1),0);t.replaceRange("\n",l,null,"+insertLine"),t.indentLine(l.line,null,!0),r.push({head:l,anchor:l}),o=a.line+1}}t.setSelections(r)})}function o(t,n){for(var r=n.ch,o=r,i=t.getLine(n.line);r&&e.isWordChar(i.charAt(r-1));)--r;for(;oe?-1:e==t?0:1}),t.replaceRange(f,s,c),r&&e.push({anchor:s,head:c})}r&&t.setSelections(e,0)})}function l(t,n){t.operation(function(){for(var r=t.listSelections(),i=[],a=[],l=0;l=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-";u[f["Alt-Left"]="goSubwordLeft"]=function(e){n(e,-1)},u[f["Alt-Right"]="goSubwordRight"]=function(e){n(e,1)};var m=d?"Ctrl-Alt-":"Ctrl-";u[f[m+"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[m+"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[v+"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--,o>l?r.push(l,s):r.length&&(r[r.length-1]=s),o=s}t.operation(function(){for(var e=r.length-2;e>=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;rn;n++){var r=e.listSelections()[n];r.empty()?e.replaceRange(e.getLine(r.head.line)+"\n",h(r.head.line,0)):e.replaceRange(e.getRange(r.from(),r.to()),r.from())}e.scrollIntoView()})},f[p+"T"]="transposeChars",u[f.F9="sortLines"]=function(e){a(e,!0)},u[f[p+"F9"]="sortLinesInsensitive"]=function(e){a(e,!1)},u[f.F2="nextBookmark"]=function(e){var t=e.state.sublimeBookmarks;if(t)for(;t.length;){var n=t.shift(),r=n.find();if(r)return t.push(n),e.setSelection(r.from,r.to)}},u[f["Shift-F2"]="prevBookmark"]=function(e){var t=e.state.sublimeBookmarks;if(t)for(;t.length;){t.unshift(t.pop());var n=t[t.length-1].find();if(n)return e.setSelection(n.from,n.to);t.pop()}},u[f[p+"F2"]="toggleBookmark"]=function(e){for(var t=e.listSelections(),n=e.state.sublimeBookmarks||(e.state.sublimeBookmarks=[]),r=0;r=0;n--)e.replaceRange("",t[n].anchor,h(t[n].to().line),"+delete");e.scrollIntoView()})},u[f[S+p+"U"]="upcaseAtCursor"]=function(e){l(e,function(e){return e.toUpperCase()})},u[f[S+p+"L"]="downcaseAtCursor"]=function(e){l(e,function(e){return e.toLowerCase()})},u[f[S+p+"Space"]="setSublimeMark"]=function(e){e.state.sublimeMark&&e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor())},u[f[S+p+"A"]="selectToSublimeMark"]=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&e.setSelection(e.getCursor(),t)},u[f[S+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[S+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[S+p+"Y"]="sublimeYank"]=function(e){null!=e.state.sublimeKilled&&e.replaceSelection(e.state.sublimeKilled,null,"paste")},f[S+p+"G"]="clearBookmarks",u[f[S+p+"C"]="showInCenter"]=function(e){var t=e.cursorCoords(null,"local");e.scrollTo(null,(t.top+t.bottom)/2-e.getScrollInfo().clientHeight/2)},u[f["Shift-Alt-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["Shift-Alt-Down"]="selectLinesDownward"]=function(e){e.operation(function(){for(var t=e.listSelections(),n=0;nwo&&setTimeout(function(){a.display.input.reset(!0)},20),Ut(this),$i(),wt(this),this.curOp.forceUpdate=!0,qn(this,i),n.autofocus&&!Wo||a.hasFocus()?setTimeout(Fi(vr,this),20):mr(this);for(var c in el)el.hasOwnProperty(c)&&el[c](this,n[c],tl);C(this),n.finishInit&&n.finishInit(this);for(var h=0;hwo&&(n.gutters.style.zIndex=-1,n.scroller.style.paddingRight=0),xo||vo&&Wo||(n.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(n.wrapper):e(n.wrapper)),n.viewFrom=n.viewTo=t.first,n.reportedViewFrom=n.reportedViewTo=t.first,n.view=[],n.renderedView=null,n.externalMeasured=null,n.viewOffset=0,n.lastWrapHeight=n.lastWrapWidth=0,n.updateLineNumbers=null,n.nativeBarWidth=n.barHeight=n.barWidth=0,n.scrollbarsClipped=!1,n.lineNumWidth=n.lineNumInnerWidth=n.lineNumChars=null,n.alignWidgets=!1,n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null,n.maxLine=null,n.maxLineLength=0,n.maxLineChanged=!1,n.wheelDX=n.wheelDY=n.wheelStartX=n.wheelStartY=null,n.shift=!1,n.selForContextMenu=null,n.activeTouch=null,r.init(n)}function r(t){t.doc.mode=e.getMode(t.options,t.doc.modeOption),n(t)}function n(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.frontier=e.doc.first,Re(e,100),e.state.modeGen++,e.curOp&&Et(e)}function i(e){e.options.lineWrapping?(Zl(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(ql(e.display.wrapper,"CodeMirror-wrap"),f(e)),l(e),Et(e),st(e),setTimeout(function(){y(e)},100)}function o(e){var t=yt(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/bt(e.display)-3);return function(i){if(Cn(e.doc,i))return 0;var o=0;if(i.widgets)for(var l=0;lt.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)})}function d(e){var t=Hi(e.gutters,"CodeMirror-linenumbers");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function p(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+Ke(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:n,scrollHeight:n+Xe(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}function g(e,t,r){this.cm=r;var n=this.vert=Ui("div",[Ui("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=Ui("div",[Ui("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(n),e(i),Wl(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),Wl(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,bo&&8>wo&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function v(){}function m(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&ql(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new e.scrollbarModel[t.options.scrollbarStyle](function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),Wl(e,"mousedown",function(){t.state.focused&&setTimeout(function(){t.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,r){"horizontal"==r?ir(t,e):nr(t,e)},t),t.display.scrollbars.addClass&&Zl(t.display.wrapper,t.display.scrollbars.addClass)}function y(e,t){t||(t=p(e));var r=e.display.barWidth,n=e.display.barHeight;b(e,t);for(var i=0;4>i&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&O(e),b(e,p(e)),r=e.display.barWidth,n=e.display.barHeight}function b(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}function w(e,t,r){var n=r&&null!=r.top?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-Ve(e));var i=r&&null!=r.bottom?r.bottom:n+e.wrapper.clientHeight,o=ri(t,n),l=ri(t,i);if(r&&r.ensure){var s=r.ensure.from.line,a=r.ensure.to.line;o>s?(o=s,l=ri(t,ni(Zn(t,s))+e.wrapper.clientHeight)):Math.min(a,t.lastLine())>=l&&(o=ri(t,ni(Zn(t,a))-e.wrapper.clientHeight),l=a)}return{from:o,to:Math.max(l,o+1)}}function x(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=L(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",l=0;l=r.viewFrom&&t.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==Gt(e))return!1;C(e)&&(zt(e),t.dims=H(e));var i=n.first+n.size,o=Math.max(t.visible.from-e.options.viewportMargin,n.first),l=Math.min(i,t.visible.to+e.options.viewportMargin);r.viewFroml&&r.viewTo-l<20&&(l=Math.min(i,r.viewTo)),Io&&(o=wn(e.doc,o),l=xn(e.doc,l));var s=o!=r.viewFrom||l!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;Bt(e,o,l),r.viewOffset=ni(Zn(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var a=Gt(e);if(!s&&0==a&&!t.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var u=ji();return a>4&&(r.lineDiv.style.display="none"),P(e,r.updateLineNumbers,t.dims),a>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,u&&ji()!=u&&u.offsetHeight&&u.focus(),Vi(r.cursorDiv),Vi(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,s&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,Re(e,400)),r.updateLineNumbers=null,!0}function N(e,t){for(var r=t.viewport,n=!0;(n&&e.options.lineWrapping&&t.oldDisplayWidth!=Ye(e)||(r&&null!=r.top&&(r={top:Math.min(e.doc.height+Ke(e.display)-_e(e),r.top)}),t.visible=w(e.display,e.doc,r),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&M(e,t);n=!1){O(e);var i=p(e);Pe(e),y(e,i),A(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 W(e,t){var r=new T(e,t);if(M(e,r)){O(e),N(e,r);var n=p(e);Pe(e),y(e,n),A(e,n),r.finish()}}function A(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+Xe(e)+"px"}function O(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;nwo){var l=o.node.offsetTop+o.node.offsetHeight;i=l-r,r=l}else{var s=o.node.getBoundingClientRect();i=s.bottom-s.top}var a=o.line.height-i;if(2>i&&(i=yt(t)),(a>.001||-.001>a)&&(ei(o.line,i),D(o.line),o.rest))for(var u=0;u=t&&h.lineNumber;h.changes&&(Hi(h.changes,"gutter")>-1&&(f=!1),E(e,h,u,r)),f&&(Vi(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(S(e.options,u)))),s=h.node.nextSibling}else{var d=V(e,h,u,r);l.insertBefore(d,s)}u+=h.size}for(;s;)s=n(s)}function E(e,t,r,n){for(var i=0;iwo&&(e.node.style.zIndex=2)),e.node}function z(e){var t=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;if(t&&(t+=" CodeMirror-linebackground"),e.background)t?e.background.className=t:(e.background.parentNode.removeChild(e.background),e.background=null);else if(t){var r=I(e);e.background=r.insertBefore(Ui("div",null,t),r.firstChild)}}function F(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):Fn(e,t)}function R(e,t){var r=t.text.className,n=F(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,B(t)):r&&(t.text.className=r)}function B(e){z(e),e.line.wrapClass?I(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var t=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=t||""}function G(e,t,r,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=I(t);t.gutterBackground=Ui("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var i=I(t),l=t.gutter=Ui("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(l),i.insertBefore(l,t.text),t.line.gutterClass&&(l.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=l.appendChild(Ui("div",S(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var s=0;s1)if(Ro&&Ro.join("\n")==t){if(n.ranges.length%Ro.length==0){a=[];for(var u=0;u=0;u--){var c=n.ranges[u],h=c.from(),f=c.to();c.empty()&&(r&&r>0?h=zo(h.line,h.ch-r):e.state.overwrite&&!l&&(f=zo(f.line,Math.min(Zn(o,f.line).text.length,f.ch+Di(s).length))));var d=e.curOp.updateInput,p={from:h,to:f,text:a?a[u%a.length]:s,origin:i||(l?"paste":e.state.cutIncoming?"cut":"+input")};Tr(e.doc,p),Li(e,"inputRead",e,p)}t&&!l&&J(e,t),zr(e),e.curOp.updateInput=d,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function Q(e,t){var r=e.clipboardData&&e.clipboardData.getData("text/plain");return r?(e.preventDefault(),t.isReadOnly()||t.options.disableInput||Wt(t,function(){Z(t,r,0,null,"paste")}),!0):void 0}function J(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=Rr(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Zn(e.doc,i.head.line).text.slice(0,i.head.ch))&&(l=Rr(e,i.head.line,"smart"));l&&Li(e,"electricInput",e,i.head.line)}}}function ee(e){for(var t=[],r=[],n=0;ni?u.map:c[i],l=0;li?e.line:e.rest[i]),h=o[l]+n;return(0>n||s!=t)&&(h=o[l+(n?1:0)]),zo(a,h)}}}var i=e.text.firstChild,o=!1;if(!t||!Yl(i,t))return le(zo(ti(e.line),0),!0);if(t==i&&(o=!0,t=i.childNodes[r],r=0,!t)){var l=e.rest?Di(e.rest):e.line;return le(zo(ti(l),l.text.length),o)}var s=3==t.nodeType?t:null,a=t;for(s||1!=t.childNodes.length||3!=t.firstChild.nodeType||(s=t.firstChild,r&&(r=s.nodeValue.length));a.parentNode!=i;)a=a.parentNode;var u=e.measure,c=u.maps,h=n(s,a,r);if(h)return le(h,o);for(var f=a.nextSibling,d=s?s.nodeValue.length-r:0;f;f=f.nextSibling){if(h=n(f,f.firstChild,0))return le(zo(h.line,h.ch-d),o);d+=f.textContent.length}for(var p=a.previousSibling,d=r;p;p=p.previousSibling){if(h=n(p,p.firstChild,-1))return le(zo(h.line,h.ch+d),o);d+=f.textContent.length}}function ue(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""==r&&(r=t.textContent.replace(/\u200b/g,"")),void(s+=r);var c,h=t.getAttribute("cm-marker");if(h){var f=e.findMarks(zo(n,0),zo(i+1,0),o(+h));return void(f.length&&(c=f[0].find())&&(s+=Qn(e.doc,c.from,c.to).join(u)))}if("false"==t.getAttribute("contenteditable"))return;for(var d=0;d=0){var l=$(o.from(),i.from()),s=_(o.to(),i.to()),a=o.empty()?i.from()==i.head:o.from()==o.head;t>=n&&--t,e.splice(--n,2,new he(a?s:l,a?l:s))}}return new ce(e,t)}function de(e,t){return new ce([new he(e,t||e)],0)}function pe(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function ge(e,t){if(t.liner?zo(r,Zn(e,r).text.length):ve(t,Zn(e,t.line).text.length)}function ve(e,t){var r=e.ch;return null==r||r>t?zo(e.line,t):0>r?zo(e.line,0):e}function me(e,t){return t>=e.first&&t=t.ch:s.to>t.ch))){if(i&&(Dl(a,"beforeCursorEnter"),a.explicitlyCleared)){if(o.markedSpans){--l;continue}break}if(!a.atomic)continue;if(r){var u,c=a.find(0>n?1:-1);if((0>n?a.inclusiveRight:a.inclusiveLeft)&&(c=He(e,c,-n,c&&c.line==t.line?o:null)),c&&c.line==t.line&&(u=Fo(c,r))&&(0>n?0>u:u>0))return Oe(e,c,t,n,i)}var h=a.find(0>n?-1:1);return(0>n?a.inclusiveLeft:a.inclusiveRight)&&(h=He(e,h,n,h.line==t.line?o:null)),h?Oe(e,h,t,n,i):null}}return t}function De(e,t,r,n,i){var o=n||1,l=Oe(e,t,r,o,i)||!i&&Oe(e,t,r,o,!0)||Oe(e,t,r,-o,i)||!i&&Oe(e,t,r,-o,!0);return l?l:(e.cantEdit=!0, +zo(e.first,0))}function He(e,t,r,n){return 0>r&&0==t.ch?t.line>e.first?ge(e,zo(t.line-1)):null:r>0&&t.ch==(n||Zn(e,t.line)).text.length?t.line=e.display.viewTo||s.to().linet&&(t=0),t=Math.round(t),n=Math.round(n),s.appendChild(Ui("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px; top: "+t+"px; width: "+(null==r?c-e:r)+"px; height: "+(n-t)+"px"))}function i(t,r,i){function o(r,n){return ft(e,zo(t,r),"div",h,n)}var s,a,h=Zn(l,t),f=h.text.length;return eo(ii(h),r||0,null==i?f:i,function(e,t,l){var h,d,p,g=o(e,"left");if(e==t)h=g,d=p=g.left;else{if(h=o(t-1,"right"),"rtl"==l){var v=g;g=h,h=v}d=g.left,p=h.right}null==r&&0==e&&(d=u),h.top-g.top>3&&(n(d,g.top,null,g.bottom),d=u,g.bottoma.bottom||h.bottom==a.bottom&&h.right>a.right)&&(a=h),u+1>d&&(d=u),n(d,h.top,p-d,h.bottom)}),{start:s,end:a}}var o=e.display,l=e.doc,s=document.createDocumentFragment(),a=je(e.display),u=a.left,c=Math.max(o.sizerWidth,Ye(e)-o.sizer.offsetLeft)-a.right,h=t.from(),f=t.to();if(h.line==f.line)i(h.line,h.ch,f.ch);else{var d=Zn(l,h.line),p=Zn(l,f.line),g=yn(d)==yn(p),v=i(h.line,h.ch,g?d.text.length+1:null).end,m=i(f.line,g?0:null,f.ch).start;g&&(v.top0?t.blinker=setInterval(function(){t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Re(e,t){e.doc.mode.startState&&e.doc.frontier=e.display.viewTo)){var r=+new Date+e.options.workTime,n=sl(t.mode,Ue(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=Pn(e,o,s?sl(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 h=!l||l.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),f=0;!h&&fr?(Re(e,e.options.workDelay),!0):void 0}),i.length&&Wt(e,function(){for(var t=0;tl;--s){if(s<=o.first)return o.first;var a=Zn(o,s-1);if(a.stateAfter&&(!r||s<=o.frontier))return s;var u=Rl(a.text,null,e.options.tabSize);(null==i||n>u)&&(i=s-1,n=u)}return i}function Ue(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return!0;var o=Ge(e,t,r),l=o>n.first&&Zn(n,o-1).stateAfter;return l=l?sl(n.mode,l):al(n.mode),n.iter(o,t,function(r){In(e,r.text,l);var s=o==t-1||o%5==0||o>=i.viewFrom&&o2&&o.push((a.bottom+u.top)/2-r.top)}}o.push(r.bottom-r.top)}}function qe(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[n],cache:e.measure.caches[n],before:!0}}function Ze(e,t){t=yn(t);var r=ti(t),n=e.display.externalMeasured=new Ht(e.doc,t,r);n.lineN=r;var i=n.built=Fn(e,n);return n.text=i.pre,Ki(e.display.lineMeasure,i.pre),n}function Qe(e,t,r,n){return tt(e,et(e,t),r,n)}function Je(e,t){if(t>=e.display.viewFrom&&t=r.lineN&&tt?(i=0,o=1,l="left"):u>t?(i=t-a,o=i+1):(s==e.length-3||t==u&&e[s+3]>t)&&(o=u-a,i=o-1,t>=u&&(l="right")),null!=i){if(n=e[s+2],a==u&&r==(n.insertLeft?"left":"right")&&(l=r),"left"==r&&0==i)for(;s&&e[s-2]==e[s-3]&&e[s-1].insertLeft;)n=e[(s-=3)+2],l="left";if("right"==r&&i==u-a)for(;sc;c++){for(;s&&Gi(t.line.text.charAt(o.coverStart+s));)--s;for(;o.coverStart+awo&&0==s&&a==o.coverEnd-o.coverStart)i=l.parentNode.getBoundingClientRect();else if(bo&&e.options.lineWrapping){var h=Vl(l,s,a).getClientRects();i=h.length?h["right"==n?h.length-1:0]:Vo}else i=Vl(l,s,a).getBoundingClientRect()||Vo;if(i.left||i.right||0==s)break;a=s,s-=1,u="right"}bo&&11>wo&&(i=it(e.display.measure,i))}else{s>0&&(u=n="right");var h;i=e.options.lineWrapping&&(h=l.getClientRects()).length>1?h["right"==n?h.length-1:0]:l.getBoundingClientRect()}if(bo&&9>wo&&!s&&(!i||!i.left&&!i.right)){var f=l.parentNode.getClientRects()[0];i=f?{left:f.left,right:f.left+bt(e.display),top:f.top,bottom:f.bottom}:Vo}for(var d=i.top-t.rect.top,p=i.bottom-t.rect.top,g=(d+p)/2,v=t.view.measure.heights,c=0;cr.from?l(e-1):l(e,n)}n=n||Zn(e.doc,t.line),i||(i=et(e,n));var a=ii(n),u=t.ch;if(!a)return l(u);var c=uo(a,u),h=s(u,c);return null!=os&&(h.other=s(u,os)),h}function pt(e,t){var r=0,t=ge(e.doc,t);e.options.lineWrapping||(r=bt(e.display)*t.ch);var n=Zn(e.doc,t.line),i=ni(n)+Ve(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function gt(e,t,r,n){var i=zo(e,t);return i.xRel=n,r&&(i.outside=!0),i}function vt(e,t,r){var n=e.doc;if(r+=e.display.viewOffset,0>r)return gt(n.first,0,!0,-1);var i=ri(n,r),o=n.first+n.size-1;if(i>o)return gt(n.first+n.size-1,Zn(n,o).text.length,!0,1);0>t&&(t=0);for(var l=Zn(n,i);;){var s=mt(e,l,i,t,r),a=vn(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=ti(l=u.to.line)}}function mt(e,t,r,n,i){function o(n){var i=dt(e,zo(r,n),"line",t,u);return s=!0,l>i.bottom?i.left-a:lv)return gt(r,d,m,1);for(;;){if(c?d==f||d==ho(t,f,1):1>=d-f){for(var y=p>n||v-n>=n-p?f:d,b=n-(y==f?p:v);Gi(t.text.charAt(y));)++y;var w=gt(r,y,y==f?g:m,-1>b?-1:b>1?1:0);return w}var x=Math.ceil(h/2),C=f+x;if(c){C=f;for(var S=0;x>S;++S)C=ho(t,C,1)}var L=o(C);L>n?(d=C,v=L,(m=s)&&(v+=1e3),h=x):(f=C,p=L,g=s,h-=x)}}function yt(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Bo){Bo=Ui("pre");for(var t=0;49>t;++t)Bo.appendChild(document.createTextNode("x")),Bo.appendChild(Ui("br"));Bo.appendChild(document.createTextNode("x"))}Ki(e.measure,Bo);var r=Bo.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),Vi(e.measure),r||1}function bt(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=Ui("span","xxxxxxxxxx"),r=Ui("pre",[t]);Ki(e.measure,r);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function wt(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:++jo},Ko?Ko.ops.push(e.curOp):e.curOp.ownsGroup=Ko={ops:[e.curOp],delayedCallbacks:[]}}function xt(e){var t=e.delayedCallbacks,r=0;do{for(;r=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new T(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Tt(e){e.updatedDisplay=e.mustUpdate&&M(e.cm,e.update)}function kt(e){var t=e.cm,r=t.display;e.updatedDisplay&&O(t),e.barMeasure=p(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Qe(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+Xe(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Ye(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function Mt(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLefto;o=n){var l=new Ht(e.doc,Zn(e.doc,o),o);n=o+l.size,i.push(l)}return i}function Et(e,t,r,n){null==t&&(t=e.doc.first),null==r&&(r=e.doc.first+e.doc.size),n||(n=0);var i=e.display;if(n&&rt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Io&&wn(e.doc,t)i.viewFrom?zt(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)zt(e);else if(t<=i.viewFrom){var o=Rt(e,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):zt(e)}else if(r>=i.viewTo){var o=Rt(e,t,t,-1);o?(i.view=i.view.slice(0,o.index),i.viewTo=o.lineN):zt(e)}else{var l=Rt(e,t,t,-1),s=Rt(e,r,r+n,1);l&&s?(i.view=i.view.slice(0,l.index).concat(Pt(e,l.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=n):zt(e)}var a=i.externalMeasured;a&&(r=i.lineN&&t=n.viewTo)){var o=n.view[Ft(e,t)];if(null!=o.node){var l=o.changes||(o.changes=[]);-1==Hi(l,r)&&l.push(r)}}}function zt(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Ft(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,0>t)return null;for(var r=e.display.view,n=0;nt)return n}function Rt(e,t,r,n){var i,o=Ft(e,t),l=e.display.view;if(!Io||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var s=0,a=e.display.viewFrom;o>s;s++)a+=l[s].size;if(a!=t){if(n>0){if(o==l.length-1)return null;i=a+l[o].size-t,o++}else i=a-t;t+=i,r+=i}for(;wn(e.doc,r)!=r;){if(o==(0>n?0:l.length-1))return null;r+=n*l[o-(0>n?1:0)].size,o+=n}return{index:o,lineN:r}}function Bt(e,t,r){var n=e.display,i=n.view;0==i.length||t>=n.viewTo||r<=n.viewFrom?(n.view=Pt(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=Pt(e,t,n.viewFrom).concat(n.view):n.viewFromr&&(n.view=n.view.slice(0,Ft(e,r)))),n.viewTo=r}function Gt(e){for(var t=e.display.view,r=0,n=0;n400}var i=e.display;Wl(i.scroller,"mousedown",At(e,Yt)),bo&&11>wo?Wl(i.scroller,"dblclick",At(e,function(t){if(!ki(e,t)){var r=Xt(e,t);if(r&&!Qt(e,t)&&!jt(e.display,t)){kl(t);var n=e.findWordAt(r);we(e.doc,n.anchor,n.head)}}})):Wl(i.scroller,"dblclick",function(t){ki(e,t)||kl(t)}),Po||Wl(i.scroller,"contextmenu",function(t){yr(e,t)});var o,l={end:0};Wl(i.scroller,"touchstart",function(t){if(!ki(e,t)&&!r(t)){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)}}),Wl(i.scroller,"touchmove",function(){i.activeTouch&&(i.activeTouch.moved=!0)}),Wl(i.scroller,"touchend",function(r){var o=i.activeTouch;if(o&&!jt(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 he(s,s):!o.prev.prev||n(o,o.prev.prev)?e.findWordAt(s):new he(zo(s.line,0),ge(e.doc,zo(s.line+1,0))),e.setSelection(l.anchor,l.head),e.focus(),kl(r)}t()}),Wl(i.scroller,"touchcancel",t),Wl(i.scroller,"scroll",function(){i.scroller.clientHeight&&(nr(e,i.scroller.scrollTop),ir(e,i.scroller.scrollLeft,!0),Dl(e,"scroll",e))}),Wl(i.scroller,"mousewheel",function(t){or(e,t)}),Wl(i.scroller,"DOMMouseScroll",function(t){or(e,t)}),Wl(i.wrapper,"scroll",function(){i.wrapper.scrollTop=i.wrapper.scrollLeft=0}),i.dragFunctions={enter:function(t){ki(e,t)||Nl(t)},over:function(t){ki(e,t)||(tr(e,t),Nl(t))},start:function(t){er(e,t)},drop:At(e,Jt),leave:function(t){ki(e,t)||rr(e)}};var s=i.input.getField();Wl(s,"keyup",function(t){dr.call(e,t)}),Wl(s,"keydown",At(e,hr)),Wl(s,"keypress",At(e,pr)),Wl(s,"focus",Fi(vr,e)),Wl(s,"blur",Fi(mr,e))}function Vt(t,r,n){var i=n&&n!=e.Init;if(!r!=!i){var o=t.display.dragFunctions,l=r?Wl:Ol;l(t.display.scroller,"dragstart",o.start),l(t.display.scroller,"dragenter",o.enter),l(t.display.scroller,"dragover",o.over),l(t.display.scroller,"dragleave",o.leave),l(t.display.scroller,"drop",o.drop)}}function Kt(e){var t=e.display;t.lastWrapHeight==t.wrapper.clientHeight&&t.lastWrapWidth==t.wrapper.clientWidth||(t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}function jt(e,t){for(var r=xi(t);r!=e.wrapper;r=r.parentNode)if(!r||1==r.nodeType&&"true"==r.getAttribute("cm-ignore-events")||r.parentNode==e.sizer&&r!=e.mover)return!0}function Xt(e,t,r,n){var i=e.display;if(!r&&"true"==xi(t).getAttribute("cm-not-content"))return null;var o,l,s=i.lineSpace.getBoundingClientRect();try{o=t.clientX-s.left,l=t.clientY-s.top}catch(t){return null}var a,u=vt(e,o,l);if(n&&1==u.xRel&&(a=Zn(e.doc,u.line).text).length==u.ch){var c=Rl(a,a.length,e.options.tabSize)-a.length;u=zo(u.line,Math.max(0,Math.round((o-je(e.display).left)/bt(e.display))-c))}return u}function Yt(e){var t=this,r=t.display;if(!(ki(t,e)||r.activeTouch&&r.input.supportsTouch())){if(r.shift=e.shiftKey,jt(r,e))return void(xo||(r.scroller.draggable=!1,setTimeout(function(){r.scroller.draggable=!0},100)));if(!Qt(t,e)){var n=Xt(t,e);switch(window.focus(),Ci(e)){case 1:t.state.selectingText?t.state.selectingText(e):n?_t(t,e,n):xi(e)==r.scroller&&kl(e);break;case 2:xo&&(t.state.lastMiddleDown=+new Date),n&&we(t.doc,n),setTimeout(function(){r.input.focus()},20),kl(e);break;case 3:Po?yr(t,e):gr(t)}}}}function _t(e,t,r){bo?setTimeout(Fi(q,e),0):e.curOp.focus=ji();var n,i=+new Date;Uo&&Uo.time>i-400&&0==Fo(Uo.pos,r)?n="triple":Go&&Go.time>i-400&&0==Fo(Go.pos,r)?(n="double",Uo={time:i,pos:r}):(n="single",Go={time:i,pos:r});var o,l=e.doc.sel,s=Ao?t.metaKey:t.ctrlKey;e.options.dragDrop&&Jl&&!e.isReadOnly()&&"single"==n&&(o=l.contains(r))>-1&&(Fo((o=l.ranges[o]).from(),r)<0||r.xRel>0)&&(Fo(o.to(),r)>0||r.xRel<0)?$t(e,t,r,s):qt(e,t,r,n,s)}function $t(e,t,r,n){var i=e.display,o=+new Date,l=At(e,function(s){xo&&(i.scroller.draggable=!1),e.state.draggingText=!1,Ol(document,"mouseup",l),Ol(i.scroller,"drop",l),Math.abs(t.clientX-s.clientX)+Math.abs(t.clientY-s.clientY)<10&&(kl(s),!n&&+new Date-200=p;p++){var m=Zn(u,p).text,y=Bl(m,a,o);a==d?i.push(new he(zo(p,y),zo(p,y))):m.length>y&&i.push(new he(zo(p,y),zo(p,Bl(m,d,o))))}i.length||i.push(new he(r,r)),ke(u,fe(f.ranges.slice(0,h).concat(i),h),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b=c,w=b.anchor,x=t;if("single"!=n){if("double"==n)var C=e.findWordAt(t);else var C=new he(zo(t.line,0),ge(u,zo(t.line+1,0)));Fo(C.anchor,w)>0?(x=C.head,w=$(b.from(),C.anchor)):(x=C.anchor,w=_(b.to(),C.head))}var i=f.ranges.slice(0);i[h]=new he(ge(u,w),x),ke(u,fe(i,h),zl)}}function l(t){var r=++y,i=Xt(e,t,!0,"rect"==n);if(i)if(0!=Fo(i,v)){e.curOp.focus=ji(),o(i);var s=w(a,u);(i.line>=s.to||i.linem.bottom?20:0;c&&setTimeout(At(e,function(){y==r&&(a.scroller.scrollTop+=c,l(t))}),50)}}function s(t){e.state.selectingText=!1,y=1/0,kl(t),a.input.focus(),Ol(document,"mousemove",b),Ol(document,"mouseup",x),u.history.lastSelOrigin=null}var a=e.display,u=e.doc;kl(t);var c,h,f=u.sel,d=f.ranges;if(i&&!t.shiftKey?(h=u.sel.contains(r),c=h>-1?d[h]:new he(r,r)):(c=u.sel.primary(),h=u.sel.primIndex),t.altKey)n="rect",i||(c=new he(r,r)),r=Xt(e,t,!0,!0),h=-1;else if("double"==n){var p=e.findWordAt(r);c=e.display.shift||u.extend?be(u,c,p.anchor,p.head):p}else if("triple"==n){var g=new he(zo(r.line,0),ge(u,zo(r.line+1,0)));c=e.display.shift||u.extend?be(u,c,g.anchor,g.head):g}else c=be(u,c,r);i?-1==h?(h=d.length,ke(u,fe(d.concat([c]),h),{scroll:!1,origin:"*mouse"})):d.length>1&&d[h].empty()&&"single"==n&&!t.shiftKey?(ke(u,fe(d.slice(0,h).concat(d.slice(h+1)),0),{scroll:!1,origin:"*mouse"}),f=u.sel):Ce(u,h,c,zl):(h=0,ke(u,new ce([c],0),zl),f=u.sel);var v=r,m=a.wrapper.getBoundingClientRect(),y=0,b=At(e,function(e){Ci(e)?l(e):s(e)}),x=At(e,s);e.state.selectingText=x,Wl(document,"mousemove",b),Wl(document,"mouseup",x)}function Zt(e,t,r,n){try{var i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&kl(t);var l=e.display,s=l.lineDiv.getBoundingClientRect();if(o>s.bottom||!Ni(e,r))return wi(t);o-=s.top-l.viewOffset;for(var a=0;a=i){var c=ri(e.doc,o),h=e.options.gutters[a];return Dl(e,r,e,c,h,t),wi(t)}}}function Qt(e,t){return Zt(e,t,"gutterClick",!0)}function Jt(e){var t=this;if(rr(t),!ki(t,e)&&!jt(t.display,e)){kl(e),bo&&(Xo=+new Date);var r=Xt(t,e,!0),n=e.dataTransfer.files;if(r&&!t.isReadOnly())if(n&&n.length&&window.FileReader&&window.File)for(var i=n.length,o=Array(i),l=0,s=function(e,n){if(!t.options.allowDropFileTypes||-1!=Hi(t.options.allowDropFileTypes,e.type)){var s=new FileReader;s.onload=At(t,function(){var e=s.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),o[n]=e,++l==i){r=ge(t.doc,r);var a={from:r,to:r,text:t.doc.splitLines(o.join(t.doc.lineSeparator())),origin:"paste"};Tr(t.doc,a),Te(t.doc,de(r,Qo(a)))}}),s.readAsText(e)}},a=0;i>a;++a)s(n[a],a);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1)return t.state.draggingText(e),void setTimeout(function(){t.display.input.focus()},20);try{var o=e.dataTransfer.getData("Text");if(o){if(t.state.draggingText&&!(Ao?e.altKey:e.ctrlKey))var u=t.listSelections();if(Me(t.doc,de(r,r)),u)for(var a=0;al.clientWidth,a=l.scrollHeight>l.clientHeight;if(n&&s||i&&a){if(i&&Ao&&xo)e:for(var u=t.target,c=o.view;u!=l;u=u.parentNode)for(var h=0;hf?d=Math.max(0,d+f-50):p=Math.min(e.doc.height,p+f+50),W(e,{top:d,bottom:p})}20>Yo&&(null==o.wheelStartX?(o.wheelStartX=l.scrollLeft,o.wheelStartY=l.scrollTop,o.wheelDX=n,o.wheelDY=i,setTimeout(function(){if(null!=o.wheelStartX){var e=l.scrollLeft-o.wheelStartX,t=l.scrollTop-o.wheelStartY,r=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null,r&&(_o=(_o*Yo+r)/(Yo+1),++Yo)}},200)):(o.wheelDX+=n,o.wheelDY+=i))}}function lr(e,t,r){if("string"==typeof t&&(t=ul[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)!=El}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}function sr(e,t,r){for(var n=0;nwo&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=16==r||e.shiftKey;var n=ur(t,e);Lo&&(Zo=n?r:null,!n&&88==r&&!rs&&(Ao?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),18!=r||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||fr(t)}}function fr(e){function t(e){18!=e.keyCode&&e.altKey||(ql(r,"CodeMirror-crosshair"),Ol(document,"keyup",t),Ol(document,"mouseover",t))}var r=e.display.lineDiv;Zl(r,"CodeMirror-crosshair"),Wl(document,"keyup",t),Wl(document,"mouseover",t)}function dr(e){16==e.keyCode&&(this.doc.sel.shift=!1),ki(this,e)}function pr(e){var t=this;if(!(jt(t.display,e)||ki(t,e)||e.ctrlKey&&!e.altKey||Ao&&e.metaKey)){var r=e.keyCode,n=e.charCode;if(Lo&&r==Zo)return Zo=null,void kl(e);if(!Lo||e.which&&!(e.which<10)||!ur(t,e)){var i=String.fromCharCode(null==n?r:n);cr(t,e,i)||t.display.input.onKeyPress(e)}}}function gr(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,mr(e))},100)}function vr(e){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(Dl(e,"focus",e),e.state.focused=!0,Zl(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),xo&&setTimeout(function(){e.display.input.reset(!0); +},20)),e.display.input.receivedFocus()),Fe(e))}function mr(e){e.state.delayingBlurEvent||(e.state.focused&&(Dl(e,"blur",e),e.state.focused=!1,ql(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function yr(e,t){jt(e.display,t)||br(e,t)||ki(e,t,"contextmenu")||e.display.input.onContextMenu(t)}function br(e,t){return Ni(e,"gutterContextMenu")?Zt(e,t,"gutterContextMenu",!1):!1}function wr(e,t){if(Fo(e,t.from)<0)return e;if(Fo(e,t.to)<=0)return Qo(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+=Qo(t).ch-t.to.ch),zo(r,n)}function xr(e,t){for(var r=[],n=0;n=0;--i)kr(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text});else kr(e,t)}}function kr(e,t){if(1!=t.text.length||""!=t.text[0]||0!=Fo(t.from,t.to)){var r=xr(e,t);ui(e,t,r,e.cm?e.cm.curOp.id:NaN),Wr(e,t,r,on(e,t));var n=[];$n(e,function(e,r){r||-1!=Hi(n,e.history)||(bi(e.history,t),n.push(e.history)),Wr(e,t,null,on(e,t))})}}function Mr(e,t,r){if(!e.cm||!e.cm.state.suppressEdits){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;--a){var h=n.changes[a];if(h.origin=t,c&&!Lr(e,h,!1))return void(l.length=0);u.push(li(e,h));var f=a?xr(e,h):Di(l);Wr(e,h,f,sn(e,h)),!a&&e.cm&&e.cm.scrollIntoView({from:h.from,to:Qo(h)});var d=[];$n(e,function(e,t){t||-1!=Hi(d,e.history)||(bi(e.history,h),d.push(e.history)),Wr(e,h,null,sn(e,h))})}}}}function Nr(e,t){if(0!=t&&(e.first+=t,e.sel=new ce(Pi(e.sel.ranges,function(e){return new he(zo(e.anchor.line+t,e.anchor.ch),zo(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){Et(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:zo(o,Zn(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Qn(e,t.from,t.to),r||(r=xr(e,t)),e.cm?Ar(e.cm,t,n):Xn(e,t,n),Me(e,r,Il)}}function Ar(e,t,r){var n=e.doc,i=e.display,l=t.from,s=t.to,a=!1,u=l.line;e.options.lineWrapping||(u=ti(yn(Zn(n,l.line))),n.iter(u,s.line+1,function(e){return e==i.maxLine?(a=!0,!0):void 0})),n.sel.contains(t.from,t.to)>-1&&Mi(e),Xn(n,t,r,o(e)),e.options.lineWrapping||(n.iter(u,l.line+t.text.length,function(e){var t=h(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,a=!1)}),a&&(e.curOp.updateMaxLine=!0)),n.frontier=Math.min(n.frontier,l.line),Re(e,400);var c=t.text.length-(s.line-l.line)-1;t.full?Et(e):l.line!=s.line||1!=t.text.length||jn(e.doc,t)?Et(e,l.line,s.line+1,c):It(e,l.line,"text");var f=Ni(e,"changes"),d=Ni(e,"change");if(d||f){var p={from:l,to:s,text:t.text,removed:t.removed,origin:t.origin};d&&Li(e,"change",e,p),f&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(p)}e.display.selForContextMenu=null}function Or(e,t,r,n,i){if(n||(n=r),Fo(n,r)<0){var o=n;n=r,r=o}"string"==typeof t&&(t=e.splitLines(t)),Tr(e,{from:r,to:n,text:t,origin:i})}function Dr(e,t){if(!ki(e,"scrollCursorIntoView")){var r=e.display,n=r.sizer.getBoundingClientRect(),i=null;if(t.top+n.top<0?i=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!Mo){var o=Ui("div","​",null,"position: absolute; top: "+(t.top-r.viewOffset-Ve(e.display))+"px; height: "+(t.bottom-t.top+Xe(e)+r.barHeight)+"px; left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}function Hr(e,t,r,n){null==n&&(n=0);for(var i=0;5>i;i++){var o=!1,l=dt(e,t),s=r&&r!=t?dt(e,r):l,a=Er(e,Math.min(l.left,s.left),Math.min(l.top,s.top)-n,Math.max(l.left,s.left),Math.max(l.bottom,s.bottom)+n),u=e.doc.scrollTop,c=e.doc.scrollLeft;if(null!=a.scrollTop&&(nr(e,a.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(o=!0)),null!=a.scrollLeft&&(ir(e,a.scrollLeft),Math.abs(e.doc.scrollLeft-c)>1&&(o=!0)),!o)break}return l}function Pr(e,t,r,n,i){var o=Er(e,t,r,n,i);null!=o.scrollTop&&nr(e,o.scrollTop),null!=o.scrollLeft&&ir(e,o.scrollLeft)}function Er(e,t,r,n,i){var o=e.display,l=yt(e.display);0>r&&(r=0);var s=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:o.scroller.scrollTop,a=_e(e),u={};i-r>a&&(i=r+a);var c=e.doc.height+Ke(o),h=l>r,f=i>c-l;if(s>r)u.scrollTop=h?0:r;else if(i>s+a){var d=Math.min(r,(f?c:i)-a);d!=s&&(u.scrollTop=d)}var p=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:o.scroller.scrollLeft,g=Ye(e)-(e.options.fixedGutter?o.gutters.offsetWidth:0),v=n-t>g;return v&&(n=t+g),10>t?u.scrollLeft=0:p>t?u.scrollLeft=Math.max(0,t-(v?0:10)):n>g+p-3&&(u.scrollLeft=n+(v?0:10)-g),u}function Ir(e,t,r){null==t&&null==r||Fr(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 zr(e){Fr(e);var t=e.getCursor(),r=t,n=t;e.options.lineWrapping||(r=t.ch?zo(t.line,t.ch-1):t,n=zo(t.line,t.ch+1)),e.curOp.scrollToPos={from:r,to:n,margin:e.options.cursorScrollMargin,isCursor:!0}}function Fr(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=pt(e,t.from),n=pt(e,t.to),i=Er(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 Rr(e,t,r,n){var i,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?i=Ue(e,t):r="prev");var l=e.options.tabSize,s=Zn(o,t),a=Rl(s.text,null,l);s.stateAfter&&(s.stateAfter=null);var u,c=s.text.match(/^\s*/)[0];if(n||/\S/.test(s.text)){if("smart"==r&&(u=o.mode.indent(i,s.text.slice(c.length),s.text),u==El||u>150)){if(!n)return;r="prev"}}else u=0,r="not";"prev"==r?u=t>o.first?Rl(Zn(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="",f=0;if(e.options.indentWithTabs)for(var d=Math.floor(u/l);d;--d)f+=l,h+=" ";if(u>f&&(h+=Oi(u-f)),h!=c)return Or(o,h,zo(t,0),zo(t,c.length),"+input"),s.stateAfter=null,!0;for(var d=0;d=0;t--)Or(e.doc,"",n[t].from,n[t].to,"+delete");zr(e)})}function Ur(e,t,r,n,i){function o(){var t=s+r;return t=e.first+e.size?!1:(s=t,c=Zn(e,t))}function l(e){var t=(i?ho:fo)(c,a,r,!0);if(null==t){if(e||!o())return!1;a=i?(0>r?io:no)(c):0>r?c.text.length:0}else a=t;return!0}var s=t.line,a=t.ch,u=r,c=Zn(e,s);if("char"==n)l();else if("column"==n)l(!0);else if("word"==n||"group"==n)for(var h=null,f="group"==n,d=e.cm&&e.cm.getHelper(t,"wordChars"),p=!0;!(0>r)||l(!p);p=!1){var g=c.text.charAt(a)||"\n",v=Ri(g,d)?"w":f&&"\n"==g?"n":!f||/\s/.test(g)?null:"p";if(!f||p||v||(v="s"),h&&h!=v){0>r&&(r=1,l());break}if(v&&(h=v),r>0&&!l(!p))break}var m=De(e,zo(s,a),t,u,!0);return Fo(t,m)||(m.hitSide=!0),m}function Vr(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);i=t.top+r*(s-(0>r?1.5:.5)*yt(e.display))}else"line"==n&&(i=r>0?t.bottom+3:t.top-3);for(;;){var a=vt(e,l,i);if(!a.outside)break;if(0>r?0>=i:i>=o.height){a.hitSide=!0;break}i+=5*r}return a}function Kr(t,r,n,i){e.defaults[t]=r,n&&(el[t]=i?function(e,t,r){r!=tl&&n(e,t,r)}:n)}function jr(e){for(var t,r,n,i,o=e.split(/-(?!$)/),e=o[o.length-1],l=0;l0||0==l&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=Ui("span",[o.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(mn(e,t.line,t,r,o)||t.line!=r.line&&mn(e,r.line,t,r,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Io=!0}o.addToHistory&&ui(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var s,a=t.line,u=e.cm;if(e.iter(a,r.line+1,function(e){u&&o.collapsed&&!u.options.lineWrapping&&yn(e)==u.display.maxLine&&(s=!0),o.collapsed&&a!=t.line&&ei(e,0),tn(e,new Qr(o,a==t.line?t.ch:null,a==r.line?r.ch:null)),++a}),o.collapsed&&e.iter(t.line,r.line+1,function(t){Cn(e,t)&&ei(t,0)}),o.clearOnEnter&&Wl(o,"beforeCursorEnter",function(){o.clear()}),o.readOnly&&(Eo=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++gl,o.atomic=!0),u){if(s&&(u.curOp.updateMaxLine=!0),o.collapsed)Et(u,t.line,r.line+1);else if(o.className||o.title||o.startStyle||o.endStyle||o.css)for(var c=t.line;c<=r.line;c++)It(u,c,"text");o.atomic&&We(u.doc),Li(u,"markerAdded",u,o)}return o}function _r(e,t,r,n,i){n=zi(n),n.shared=!1;var o=[Yr(e,t,r,n,i)],l=o[0],s=n.widgetNode;return $n(e,function(e){s&&(n.widgetNode=s.cloneNode(!0)),o.push(Yr(e,ge(e,t),ge(e,r),n,i));for(var a=0;a=t:o.to>t);(n||(n=[])).push(new Qr(l,o.from,a?null:o.to))}}return n}function nn(e,t,r){if(e)for(var n,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 h=0;hh;++h)p.push(g);p.push(a)}return p}function ln(e){for(var t=0;t0)){var c=[a,1],h=Fo(u.from,s.from),f=Fo(u.to,s.to);(0>h||!l.inclusiveLeft&&!h)&&c.push({from:u.from,to:s.from}),(f>0||!l.inclusiveRight&&!f)&&c.push({from:s.to,to:u.to}),i.splice.apply(i,c),a+=c.length-1}}return i}function un(e){var t=e.markedSpans;if(t){for(var r=0;r=0&&0>=h||0>=c&&h>=0)&&(0>=c&&(Fo(u.to,r)>0||a.marker.inclusiveRight&&i.inclusiveLeft)||c>=0&&(Fo(u.from,n)<0||a.marker.inclusiveLeft&&i.inclusiveRight)))return!0}}}function yn(e){for(var t;t=gn(e);)e=t.find(-1,!0).line;return e}function bn(e){for(var t,r;t=vn(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function wn(e,t){var r=Zn(e,t),n=yn(r);return r==n?t:ti(n)}function xn(e,t){if(t>e.lastLine())return t;var r,n=Zn(e,t);if(!Cn(e,n))return t;for(;r=vn(n);)n=r.find(1,!0).line;return ti(n)+1}function Cn(e,t){var r=Io&&t.markedSpans;if(r)for(var n,i=0;io;o++){i&&(i[0]=e.innerMode(t,n).mode);var l=t.token(r,n);if(r.pos>r.start)return l}throw new Error("Mode "+t.name+" failed to advance stream.")}function Dn(e,t,r,n){function i(e){return{start:h.start,end:h.pos,string:h.current(),type:o||null,state:e?sl(l.mode,c):c}}var o,l=e.doc,s=l.mode;t=ge(l,t);var a,u=Zn(l,t.line),c=Ue(e,t.line,r),h=new pl(u.text,e.options.tabSize);for(n&&(a=[]);(n||h.pose.options.maxHighlightLength?(s=!1,l&&In(e,t,n,h.pos),h.pos=t.length,a=null):a=Wn(On(r,h,n,f),o),f){var d=f[0].name;d&&(a="m-"+(a?d+" "+a:d))}if(!s||c!=a){for(;uu;){var n=i[a];n>e&&i.splice(a,1,e,i[a+1],n),a+=2,u=Math.min(e,n)}if(t)if(s.opaque)i.splice(r,a-r,e,"cm-overlay "+t),a=r+2;else for(;a>r;r+=2){var o=i[r+1];i[r+1]=(o?o+" ":"")+"cm-overlay "+t}},o)}return{styles:i,classes:o.bgClass||o.textClass?o:null}}function En(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=Ue(e,ti(t)),i=Pn(e,t,t.text.length>e.options.maxHighlightLength?sl(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 In(e,t,r,n){var i=e.doc.mode,o=new pl(t,e.options.tabSize);for(o.start=o.pos=n||0,""==t&&An(i,r);!o.eol();)On(i,o,r),o.start=o.pos}function zn(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?xl:wl;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function Fn(e,t){var r=Ui("span",null,null,xo?"padding-right: .1px":null),n={pre:Ui("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,splitSpaces:(bo||xo)&&e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o,l=i?t.rest[i-1]:t.line;n.pos=0,n.addToken=Bn,Qi(e.display.measure)&&(o=ii(l))&&(n.addToken=Un(n.addToken,o)),n.map=[];var s=t!=e.display.externalMeasured&&ti(l);Kn(l,n,En(e,l,s)),l.styleClasses&&(l.styleClasses.bgClass&&(n.bgClass=Yi(l.styleClasses.bgClass,n.bgClass||"")),l.styleClasses.textClass&&(n.textClass=Yi(l.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(Zi(e.display.measure))),0==i?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}return xo&&/\bcm-tab\b/.test(n.content.lastChild.className)&&(n.content.className="cm-tab-wrap-hack"),Dl(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=Yi(n.pre.className,n.textClass||"")),n}function Rn(e){var t=Ui("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Bn(e,t,r,n,i,o,l){if(t){var s=e.splitSpaces?t.replace(/ {3,}/g,Gn):t,a=e.cm.state.specialChars,u=!1;if(a.test(t))for(var c=document.createDocumentFragment(),h=0;;){a.lastIndex=h;var f=a.exec(t),d=f?f.index-h:t.length-h;if(d){var p=document.createTextNode(s.slice(h,h+d));bo&&9>wo?c.appendChild(Ui("span",[p])):c.appendChild(p),e.map.push(e.pos,e.pos+d,p),e.col+=d,e.pos+=d}if(!f)break;if(h+=d+1," "==f[0]){var g=e.cm.options.tabSize,v=g-e.col%g,p=c.appendChild(Ui("span",Oi(v),"cm-tab"));p.setAttribute("role","presentation"),p.setAttribute("cm-text"," "),e.col+=v}else if("\r"==f[0]||"\n"==f[0]){var p=c.appendChild(Ui("span","\r"==f[0]?"␍":"␤","cm-invalidchar"));p.setAttribute("cm-text",f[0]),e.col+=1}else{var p=e.cm.options.specialCharPlaceholder(f[0]);p.setAttribute("cm-text",f[0]),bo&&9>wo?c.appendChild(Ui("span",[p])):c.appendChild(p),e.col+=1}e.map.push(e.pos,e.pos+1,p),e.pos++}else{e.col+=t.length;var c=document.createTextNode(s);e.map.push(e.pos,e.pos+t.length,c),bo&&9>wo&&(u=!0),e.pos+=t.length}if(r||n||i||u||l){var m=r||"";n&&(m+=n),i&&(m+=i);var y=Ui("span",[c],m,l);return o&&(y.title=o),e.content.appendChild(y)}e.content.appendChild(c)}}function Gn(e){for(var t=" ",r=0;ru&&f.from<=u)break}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 Vn(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}function Kn(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var l,s,a,u,c,h,f,d=i.length,p=0,g=1,v="",m=0;;){if(m==p){a=u=c=h=s="",f=null,m=1/0;for(var y,b=[],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&&(y||(y=[])).push(C.endStyle,x.to),C.title&&!h&&(h=C.title),C.collapsed&&(!f||dn(f.marker,C)<0)&&(f=x)):x.from>p&&m>x.from&&(m=x.from)}if(y)for(var w=0;w=d)break;for(var S=Math.min(d,m);;){if(v){var L=p+v.length;if(!f){var T=L>S?v.slice(0,S-p):v;t.addToken(t,T,l?l+a:a,c,p+T.length==m?u:"",h,s)}if(L>=S){v=v.slice(S-p),p=S;break}p=L,c=""}v=i.slice(o,o=r[g++]),l=zn(r[g++],t.cm.options)}}else for(var g=1;gr;++r)o.push(new bl(u[r],i(r),n));return o}var s=t.from,a=t.to,u=t.text,c=Zn(e,s.line),h=Zn(e,a.line),f=Di(u),d=i(u.length-1),p=a.line-s.line;if(t.full)e.insert(0,l(0,u.length)),e.remove(u.length,e.size-u.length);else if(jn(e,t)){var g=l(0,u.length-1);o(h,h.text,d),p&&e.remove(s.line,p),g.length&&e.insert(s.line,g)}else if(c==h)if(1==u.length)o(c,c.text.slice(0,s.ch)+f+c.text.slice(a.ch),d);else{var g=l(1,u.length-1);g.push(new bl(f+c.text.slice(a.ch),d,n)),o(c,c.text.slice(0,s.ch)+u[0],i(0)),e.insert(s.line+1,g)}else if(1==u.length)o(c,c.text.slice(0,s.ch)+u[0]+h.text.slice(a.ch),i(0)),e.remove(s.line+1,p);else{o(c,c.text.slice(0,s.ch)+u[0],i(0)),o(h,f+h.text.slice(a.ch),d);var g=l(1,u.length-1);p>1&&e.remove(s.line+1,p-1),e.insert(s.line+1,g)}Li(e,"change",e,t)}function Yn(e){this.lines=e,this.parent=null;for(var t=0,r=0;tt||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(o>t){r=i;break}t-=o}return r.lines[t]}function Qn(e,t,r){var n=[],i=t.line;return e.iter(t.line,r.line+1,function(e){var o=e.text;i==r.line&&(o=o.slice(0,r.ch)),i==t.line&&(o=o.slice(t.ch)),n.push(o),++i}),n}function Jn(e,t,r){var n=[];return e.iter(t,r,function(e){n.push(e.text)}),n}function ei(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function ti(e){if(null==e.parent)return null;for(var t=e.parent,r=Hi(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var i=0;n.children[i]!=t;++i)r+=n.children[i].chunkSize();return r+t.first}function ri(e,t){var r=e.first;e:do{for(var n=0;nt){e=i;continue e}t-=o,r+=i.chunkSize()}return r}while(!e.lines);for(var n=0;nt)break;t-=s}return r+n}function ni(e){e=yn(e);for(var t=0,r=e.parent,n=0;n1&&!e.done[e.done.length-2].ranges?(e.done.pop(),Di(e.done)):void 0}function ui(e,t,r,n){var i=e.history;i.undone.length=0;var o,l=+new Date;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>l-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=ai(i,i.lastOp==n))){var s=Di(o.changes);0==Fo(t.from,t.to)&&0==Fo(t.from,s.to)?s.to=Qo(t):o.changes.push(li(e,t))}else{var a=Di(i.done);for(a&&a.ranges||fi(e.sel,i.done),o={changes:[li(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=l,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,s||Dl(e,"historyAdded")}function ci(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 hi(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||ci(e,o,Di(i.done),t))?i.done[i.done.length-1]=t:fi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=r,n&&n.clearRedo!==!1&&si(i.undone)}function fi(e,t){var r=Di(t);r&&r.ranges&&r.equals(e)||t.push(e)}function di(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 pi(e){if(!e)return null;for(var t,r=0;r-1&&(Di(s)[h]=c[h],delete c[h])}}}return i}function mi(e,t,r,n){r0?n.slice():Al:n||Al}function Li(e,t){function r(e){return function(){e.apply(null,o)}}var n=Si(e,t,!1);if(n.length){var i,o=Array.prototype.slice.call(arguments,2);Ko?i=Ko.delayedCallbacks:Hl?i=Hl:(i=Hl=[],setTimeout(Ti,0));for(var l=0;l0}function Wi(e){e.prototype.on=function(e,t){Wl(this,e,t)},e.prototype.off=function(e,t){Ol(this,e,t)}}function Ai(){this.id=null}function Oi(e){for(;Gl.length<=e;)Gl.push(Di(Gl)+" "); +return Gl[e]}function Di(e){return e[e.length-1]}function Hi(e,t){for(var r=0;r-1&&jl(e)?!0:t.test(e):jl(e)}function Bi(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function Gi(e){return e.charCodeAt(0)>=768&&Xl.test(e)}function Ui(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;o0;--t)e.removeChild(e.firstChild);return e}function Ki(e,t){return Vi(e).appendChild(t)}function ji(){for(var e=document.activeElement;e&&e.root&&e.root.activeElement;)e=e.root.activeElement;return e}function Xi(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function Yi(e,t){for(var r=e.split(" "),n=0;n2&&!(bo&&8>wo))}var r=_l?Ui("span","​"):Ui("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function Qi(e){if(null!=$l)return $l;var t=Ki(e,document.createTextNode("AخA")),r=Vl(t,0,1).getBoundingClientRect();if(!r||r.left==r.right)return!1;var n=Vl(t,1,2).getBoundingClientRect();return $l=n.right-r.right<3}function Ji(e){if(null!=ns)return ns;var t=Ki(e,Ui("span","x")),r=t.getBoundingClientRect(),n=Vl(t,0,1).getBoundingClientRect();return ns=Math.abs(r.left-n.left)>1}function eo(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 to(e){return e.level%2?e.to:e.from}function ro(e){return e.level%2?e.from:e.to}function no(e){var t=ii(e);return t?to(t[0]):0}function io(e){var t=ii(e);return t?ro(Di(t)):e.text.length}function oo(e,t){var r=Zn(e.doc,t),n=yn(r);n!=r&&(t=ti(n));var i=ii(n),o=i?i[0].level%2?io(n):no(n):0;return zo(t,o)}function lo(e,t){for(var r,n=Zn(e.doc,t);r=vn(n);)n=r.find(1,!0).line,t=null;var i=ii(n),o=i?i[0].level%2?no(n):io(n):n.text.length;return zo(null==t?ti(n):t,o)}function so(e,t){var r=oo(e,t.line),n=Zn(e.doc,r.line),i=ii(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 zo(r.line,l?0:o)}return r}function ao(e,t,r){var n=e[0].level;return t==n?!0:r==n?!1:r>t}function uo(e,t){os=null;for(var r,n=0;nt)return n;if(i.from==t||i.to==t){if(null!=r)return ao(e,i.level,e[r].level)?(i.from!=i.to&&(os=r),n):(i.from!=i.to&&(os=n),r);r=n}}return r}function co(e,t,r,n){if(!n)return t+r;do t+=r;while(t>0&&Gi(e.text.charAt(t)));return t}function ho(e,t,r,n){var i=ii(e);if(!i)return fo(e,t,r,n);for(var o=uo(i,t),l=i[o],s=co(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?co(e,l.to,-1,n):co(e,l.from,1,n)}}function fo(e,t,r,n){var i=t+r;if(n)for(;i>0&&Gi(e.text.charAt(i));)i+=r;return 0>i||i>e.text.length?null:i}var po=navigator.userAgent,go=navigator.platform,vo=/gecko\/\d/i.test(po),mo=/MSIE \d/.test(po),yo=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(po),bo=mo||yo,wo=bo&&(mo?document.documentMode||6:yo[1]),xo=/WebKit\//.test(po),Co=xo&&/Qt\/\d+\.\d+/.test(po),So=/Chrome\//.test(po),Lo=/Opera\//.test(po),To=/Apple Computer/.test(navigator.vendor),ko=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(po),Mo=/PhantomJS/.test(po),No=/AppleWebKit/.test(po)&&/Mobile\/\w+/.test(po),Wo=No||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(po),Ao=No||/Mac/.test(go),Oo=/win/i.test(go),Do=Lo&&po.match(/Version\/(\d*\.\d*)/);Do&&(Do=Number(Do[1])),Do&&Do>=15&&(Lo=!1,xo=!0);var Ho=Ao&&(Co||Lo&&(null==Do||12.11>Do)),Po=vo||bo&&wo>=9,Eo=!1,Io=!1;g.prototype=zi({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}},setScrollLeft:function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz)},setScrollTop:function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert)},zeroWidthHack:function(){var e=Ao&&!ko?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Ai,this.disableVert=new Ai},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)},clear:function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)}},g.prototype),v.prototype=zi({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},v.prototype),e.scrollbarModel={native:g,null:v},T.prototype.signal=function(e,t){Ni(e,t)&&this.events.push(arguments)},T.prototype.finish=function(){for(var e=0;e=9&&r.hasSelection&&(r.hasSelection=null),r.poll()}),Wl(o,"paste",function(e){ki(n,e)||Q(e,n)||(n.state.pasteIncoming=!0,r.fastPoll())}),Wl(o,"cut",t),Wl(o,"copy",t),Wl(e.scroller,"paste",function(t){jt(e,t)||ki(n,t)||(n.state.pasteIncoming=!0,r.focus())}),Wl(e.lineSpace,"selectstart",function(t){jt(e,t)||kl(t)}),Wl(o,"compositionstart",function(){var e=n.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:e,range:n.markText(e,n.getCursor("to"),{className:"CodeMirror-composing"})}}),Wl(o,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},prepareSelection:function(){var e=this.cm,t=e.display,r=e.doc,n=Ee(e);if(e.options.moveInputWithCursor){var i=dt(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},showSelection:function(e){var t=this.cm,r=t.display;Ki(r.cursorDiv,e.cursors),Ki(r.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},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=rs&&(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&&Ul(this.textarea),bo&&wo>=9&&(this.hasSelection=l)}else e||(this.prevInput=this.textarea.value="",bo&&wo>=9&&(this.hasSelection=null));this.inaccurateSelection=t}},getField:function(){return this.textarea},supportsTouch:function(){return!1},focus:function(){if("nocursor"!=this.cm.options.readOnly&&(!Wo||ji()!=this.textarea))try{this.textarea.focus()}catch(e){}},blur:function(){this.textarea.blur()},resetPosition:function(){this.wrapper.style.top=this.wrapper.style.left=0},receivedFocus:function(){this.slowPoll()},slowPoll:function(){var e=this;e.pollingFast||e.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},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)},poll:function(){var e=this.cm,t=this.textarea,r=this.prevInput;if(this.contextMenuPending||!e.state.focused||ts(t)&&!r&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var n=t.value;if(n==r&&!e.somethingSelected())return!1;if(bo&&wo>=9&&this.hasSelection===n||Ao&&/[\uf700-\uf7ff]/.test(n))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var i=n.charCodeAt(0);if(8203!=i||r||(r="​"),8666==i)return this.reset(),this.cm.execCommand("undo")}for(var o=0,l=Math.min(r.length,n.length);l>o&&r.charCodeAt(o)==n.charCodeAt(o);)++o;var s=this;return Wt(e,function(){Z(e,n.slice(o),r.length-o,null,s.composing?"*compose":null),n.length>1e3||n.indexOf("\n")>-1?t.value=s.prevInput="":s.prevInput=n,s.composing&&(s.composing.range.clear(),s.composing.range=e.markText(s.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ensurePolled:function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},onKeyPress:function(){bo&&wo>=9&&(this.hasSelection=null),this.fastPoll()},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=h,l.style.cssText=c,bo&&9>wo&&o.scrollbars.setScrollTop(o.scroller.scrollTop=a),null!=l.selectionStart){(!bo||bo&&9>wo)&&t();var e=0,r=function(){o.selForContextMenu==i.doc.sel&&0==l.selectionStart&&l.selectionEnd>0&&"​"==n.prevInput?At(i,ul.selectAll)(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=Xt(i,e),a=o.scroller.scrollTop;if(s&&!Lo){var u=i.options.resetSelectionOnContextMenu;u&&-1==i.doc.sel.contains(s)&&At(i,ke)(i.doc,de(s),Il);var c=l.style.cssText,h=n.wrapper.style.cssText;n.wrapper.style.cssText="position: absolute";var f=n.wrapper.getBoundingClientRect();if(l.style.cssText="position: absolute; width: 30px; height: 30px; top: "+(e.clientY-f.top-5)+"px; left: "+(e.clientX-f.left-5)+"px; z-index: 1000; background: "+(bo?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",xo)var d=window.scrollY;if(o.input.focus(),xo&&window.scrollTo(null,d),o.input.reset(),i.somethingSelected()||(l.value=n.prevInput=" "),n.contextMenuPending=!0,o.selForContextMenu=i.doc.sel,clearTimeout(o.detectingSelectAll),bo&&wo>=9&&t(),Po){Nl(e);var p=function(){Ol(window,"mouseup",p),setTimeout(r,20)};Wl(window,"mouseup",p)}else setTimeout(r,50)}},readOnlyChanged:function(e){e||this.reset()},setUneditable:Ei,needsContentAttribute:!1},re.prototype),ie.prototype=zi({init:function(e){function t(e){if(!ki(n,e)){if(n.somethingSelected())Ro=n.getSelections(),"cut"==e.type&&n.replaceSelection("",null,"cut");else{if(!n.options.lineWiseCopyCut)return;var t=ee(n);Ro=t.text,"cut"==e.type&&n.operation(function(){n.setSelections(t.ranges,0,Il),n.replaceSelection("",null,"cut")})}if(e.clipboardData&&!No)e.preventDefault(),e.clipboardData.clearData(),e.clipboardData.setData("text/plain",Ro.join("\n"));else{var r=ne(),i=r.firstChild;n.display.lineSpace.insertBefore(r,n.display.lineSpace.firstChild),i.value=Ro.join("\n");var o=document.activeElement;Ul(i),setTimeout(function(){n.display.lineSpace.removeChild(r),o.focus()},50)}}}var r=this,n=r.cm,i=r.div=e.lineDiv;te(i),Wl(i,"paste",function(e){ki(n,e)||Q(e,n)}),Wl(i,"compositionstart",function(e){var t=e.data;if(r.composing={sel:n.doc.sel,data:t,startData:t},t){var i=n.doc.sel.primary(),o=n.getLine(i.head.line),l=o.indexOf(t,Math.max(0,i.head.ch-t.length));l>-1&&l<=i.head.ch&&(r.composing.sel=de(zo(i.head.line,l),zo(i.head.line,l+t.length)))}}),Wl(i,"compositionupdate",function(e){r.composing.data=e.data}),Wl(i,"compositionend",function(e){var t=r.composing;t&&(e.data==t.startData||/\u200b/.test(e.data)||(t.data=e.data),setTimeout(function(){t.handled||r.applyComposition(t),r.composing==t&&(r.composing=null)},50))}),Wl(i,"touchstart",function(){r.forceCompositionEnd()}),Wl(i,"input",function(){r.composing||!n.isReadOnly()&&r.pollContent()||Wt(r.cm,function(){Et(n)})}),Wl(i,"copy",t),Wl(i,"cut",t)},prepareSelection:function(){var e=Ee(this.cm,!1);return e.focus=this.cm.state.focused,e},showSelection:function(e){e&&this.cm.display.view.length&&(e.focus&&this.showPrimarySelection(),this.showMultipleSelections(e))},showPrimarySelection:function(){var e=window.getSelection(),t=this.cm.doc.sel.primary(),r=se(this.cm,e.anchorNode,e.anchorOffset),n=se(this.cm,e.focusNode,e.focusOffset);if(!r||r.bad||!n||n.bad||0!=Fo($(r,n),t.from())||0!=Fo(_(r,n),t.to())){var i=oe(this.cm,t.from()),o=oe(this.cm,t.to());if(i||o){var l=this.cm.display.view,s=e.rangeCount&&e.getRangeAt(0);if(i){if(!o){var a=l[l.length-1].measure,u=a.maps?a.maps[a.maps.length-1]:a.map;o={node:u[u.length-1],offset:u[u.length-2]-u[u.length-3]}}}else i={node:l[0].measure.map[2],offset:0};try{var c=Vl(i.node,i.offset,o.offset,o.node)}catch(h){}c&&(!vo&&this.cm.state.focused?(e.collapse(i.node,i.offset),c.collapsed||e.addRange(c)):(e.removeAllRanges(),e.addRange(c)),s&&null==e.anchorNode?e.addRange(s):vo&&this.startGracePeriod()),this.rememberSelection()}}},startGracePeriod:function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){e.cm.curOp.selectionChanged=!0})},20)},showMultipleSelections:function(e){Ki(this.cm.display.cursorDiv,e.cursors),Ki(this.cm.display.selectionDiv,e.selection)},rememberSelection:function(){var e=window.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},selectionInEditor:function(){var e=window.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return Yl(this.div,t)},focus:function(){"nocursor"!=this.cm.options.readOnly&&this.div.focus()},blur:function(){this.div.blur()},getField:function(){return this.div},supportsTouch:function(){return!0},receivedFocus:function(){function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))}var t=this;this.selectionInEditor()?this.pollSelection():Wt(this.cm,function(){t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,e)},selectionChanged:function(){var e=window.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},pollSelection:function(){if(!this.composing&&!this.gracePeriod&&this.selectionChanged()){var e=window.getSelection(),t=this.cm;this.rememberSelection();var r=se(t,e.anchorNode,e.anchorOffset),n=se(t,e.focusNode,e.focusOffset);r&&n&&Wt(t,function(){ke(t.doc,de(r,n),Il),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)})}},pollContent:function(){var e=this.cm,t=e.display,r=e.doc.sel.primary(),n=r.from(),i=r.to();if(n.linet.viewTo-1)return!1;var o;if(n.line==t.viewFrom||0==(o=Ft(e,n.line)))var l=ti(t.view[0].line),s=t.view[0].node;else var l=ti(t.view[o].line),s=t.view[o-1].node.nextSibling;var a=Ft(e,i.line);if(a==t.view.length-1)var u=t.viewTo-1,c=t.lineDiv.lastChild;else var u=ti(t.view[a+1].line)-1,c=t.view[a+1].node.previousSibling;for(var h=e.doc.splitLines(ue(e,s,c,l,u)),f=Qn(e.doc,zo(l,0),zo(u,Zn(e.doc,u).text.length));h.length>1&&f.length>1;)if(Di(h)==Di(f))h.pop(),f.pop(),u--;else{if(h[0]!=f[0])break;h.shift(),f.shift(),l++}for(var d=0,p=0,g=h[0],v=f[0],m=Math.min(g.length,v.length);m>d&&g.charCodeAt(d)==v.charCodeAt(d);)++d;for(var y=Di(h),b=Di(f),w=Math.min(y.length-(1==h.length?d:0),b.length-(1==f.length?d:0));w>p&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)++p;h[h.length-1]=y.slice(0,y.length-p),h[0]=h[0].slice(d);var x=zo(l,d),C=zo(u,f.length?Di(f).length-p:0);return h.length>1||h[0]||Fo(x,C)?(Or(e.doc,h,x,C,"+input"),!0):void 0},ensurePolled:function(){this.forceCompositionEnd()},reset:function(){this.forceCompositionEnd()},forceCompositionEnd:function(){this.composing&&!this.composing.handled&&(this.applyComposition(this.composing),this.composing.handled=!0,this.div.blur(),this.div.focus())},applyComposition:function(e){this.cm.isReadOnly()?At(this.cm,Et)(this.cm):e.data&&e.data!=e.startData&&At(this.cm,Z)(this.cm,e.data,0,e.sel)},setUneditable:function(e){e.contentEditable="false"},onKeyPress:function(e){e.preventDefault(),this.cm.isReadOnly()||At(this.cm,Z)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0)},readOnlyChanged:function(e){this.div.contentEditable=String("nocursor"!=e)},onContextMenu:Ei,resetPosition:Ei,needsContentAttribute:!0},ie.prototype),e.inputStyles={textarea:re,contenteditable:ie},ce.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t=0&&Fo(e,n.to())<=0)return r}return-1}},he.prototype={from:function(){return $(this.anchor,this.head)},to:function(){return _(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var Bo,Go,Uo,Vo={left:0,right:0,top:0,bottom:0},Ko=null,jo=0,Xo=0,Yo=0,_o=null;bo?_o=-.53:vo?_o=15:So?_o=-.7:To&&(_o=-1/3);var $o=function(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}};e.wheelEventPixels=function(e){var t=$o(e);return t.x*=_o,t.y*=_o,t};var qo=new Ai,Zo=null,Qo=e.changeEnd=function(e){return e.text?zo(e.from.line+e.text.length-1,Di(e.text).length+(1==e.text.length?e.from.ch:0)):e.to};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,t){var r=this.options,n=r[e];r[e]==t&&"mode"!=e||(r[e]=t,el.hasOwnProperty(e)&&At(this,el[e])(this,t,n))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Xr(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,r=0;rr&&(Rr(this,i.head.line,e,!0),r=i.head.line,n==this.doc.sel.primIndex&&zr(this));else{var o=i.from(),l=i.to(),s=Math.max(r,o.line);r=Math.min(this.lastLine(),l.line-(l.ch?0:1))+1;for(var a=s;r>a;++a)Rr(this,a,e);var u=this.doc.sel.ranges;0==o.ch&&t.length==u.length&&u[n].from().ch>0&&Ce(this.doc,n,new he(o,u[n].to()),Il)}}}),getTokenAt:function(e,t){return Dn(this,e,t)},getLineTokens:function(e,t){return Dn(this,zo(e),t,!0)},getTokenTypeAt:function(e){e=ge(this.doc,e);var t,r=En(this,Zn(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]s?t:0==s?null:t.slice(0,s-1)},getModeAt:function(t){var r=this.doc.mode;return r.innerMode?e.innerMode(r,this.getTokenAt(t).state).mode:r},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!ll.hasOwnProperty(t))return r;var n=ll[t],i=this.getModeAt(e);if("string"==typeof i[t])n[i[t]]&&r.push(n[i[t]]);else if(i[t])for(var o=0;oi&&(e=i,n=!0),r=Zn(this.doc,e)}else r=e;return ct(this,r,{top:0,left:0},t||"page").top+(n?this.doc.height-ni(r):0)},defaultTextHeight:function(){return yt(this.display)},defaultCharWidth:function(){return bt(this.display)},setGutterMarker:Ot(function(e,t,r){return Br(this.doc,e,"gutter",function(e){var n=e.gutterMarkers||(e.gutterMarkers={});return n[t]=r,!r&&Bi(n)&&(e.gutterMarkers=null),!0})}),clearGutter:Ot(function(e){var t=this,r=t.doc,n=r.first;r.iter(function(r){r.gutterMarkers&&r.gutterMarkers[e]&&(r.gutterMarkers[e]=null,It(t,n,"gutter"),Bi(r.gutterMarkers)&&(r.gutterMarkers=null)),++n})}),lineInfo:function(e){if("number"==typeof e){if(!me(this.doc,e))return null;var t=e;if(e=Zn(this.doc,e),!e)return null}else{var t=ti(e);if(null==t)return null}return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o=this.display;e=dt(this,ge(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&&Pr(this,s,l,s+t.offsetWidth,l+t.offsetHeight)},triggerOnKeyDown:Ot(hr),triggerOnKeyPress:Ot(pr),triggerOnKeyUp:dr,execCommand:function(e){return ul.hasOwnProperty(e)?ul[e].call(null,this):void 0},triggerElectric:Ot(function(e){J(this,e)}),findPosH:function(e,t,r,n){var i=1;0>t&&(i=-1,t=-t);for(var o=0,l=ge(this.doc,e);t>o&&(l=Ur(this.doc,l,i,r,n),!l.hitSide);++o);return l},moveH:Ot(function(e,t){var r=this;r.extendSelectionsBy(function(n){return r.display.shift||r.doc.extend||n.empty()?Ur(r.doc,n.head,e,t,r.options.rtlMoveVisually):0>e?n.from():n.to()},Fl)}),deleteH:Ot(function(e,t){var r=this.doc.sel,n=this.doc;r.somethingSelected()?n.replaceSelection("",null,"+delete"):Gr(this,function(r){var i=Ur(n,r.head,e,t,!1);return 0>e?{from:i,to:r.head}:{from:r.head,to:i}})}),findPosV:function(e,t,r,n){var i=1,o=n;0>t&&(i=-1,t=-t);for(var l=0,s=ge(this.doc,e);t>l;++l){var a=dt(this,s,"div");if(null==o?o=a.left:a.left=o,s=Vr(this,a,i,r),s.hitSide)break}return s},moveV:Ot(function(e,t){var r=this,n=this.doc,i=[],o=!r.display.shift&&!n.extend&&n.sel.somethingSelected();if(n.extendSelectionsBy(function(l){if(o)return 0>e?l.from():l.to();var s=dt(r,l.head,"div");null!=l.goalColumn&&(s.left=l.goalColumn),i.push(s.left);var a=Vr(r,s,e,t);return"page"==t&&l==n.sel.primary()&&Ir(r,null,ft(r,a,"div").top-s.top),a},Fl),i.length)for(var l=0;l0&&s(r.charAt(n-1));)--n;for(;i.5)&&l(this),Dl(this,"refresh",this)}),swapDoc:Ot(function(e){var t=this.doc;return t.cm=null,qn(this,e),st(this),this.display.input.reset(),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Li(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}},Wi(e);var Jo=e.defaults={},el=e.optionHandlers={},tl=e.Init={toString:function(){return"CodeMirror.Init"}};Kr("value","",function(e,t){e.setValue(t)},!0),Kr("mode",null,function(e,t){e.doc.modeOption=t,r(e)},!0),Kr("indentUnit",2,r,!0),Kr("indentWithTabs",!1),Kr("smartIndent",!0),Kr("tabSize",4,function(e){n(e),st(e),Et(e)},!0),Kr("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(-1==o)break;i=o+t.length,r.push(zo(n,o))}n++});for(var i=r.length-1;i>=0;i--)Or(e.doc,t,r[i],zo(r[i].line,r[i].ch+t.length))}}),Kr("specialChars",/[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(t,r,n){t.state.specialChars=new RegExp(r.source+(r.test(" ")?"":"| "),"g"),n!=e.Init&&t.refresh()}),Kr("specialCharPlaceholder",Rn,function(e){e.refresh()},!0),Kr("electricChars",!0),Kr("inputStyle",Wo?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),Kr("rtlMoveVisually",!Oo),Kr("wholeLineUpdateBefore",!0),Kr("theme","default",function(e){s(e),a(e)},!0),Kr("keyMap","default",function(t,r,n){var i=Xr(r),o=n!=e.Init&&Xr(n);o&&o.detach&&o.detach(t,i),i.attach&&i.attach(t,o||null)}),Kr("extraKeys",null),Kr("lineWrapping",!1,i,!0),Kr("gutters",[],function(e){d(e.options),a(e)},!0),Kr("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?L(e.display)+"px":"0",e.refresh()},!0),Kr("coverGutterNextToScrollbar",!1,function(e){y(e)},!0),Kr("scrollbarStyle","native",function(e){m(e),y(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),Kr("lineNumbers",!1,function(e){d(e.options),a(e)},!0),Kr("firstLineNumber",1,a,!0),Kr("lineNumberFormatter",function(e){return e},a,!0),Kr("showCursorWhenSelecting",!1,Pe,!0),Kr("resetSelectionOnContextMenu",!0),Kr("lineWiseCopyCut",!0),Kr("readOnly",!1,function(e,t){"nocursor"==t?(mr(e),e.display.input.blur(),e.display.disabled=!0):e.display.disabled=!1,e.display.input.readOnlyChanged(t)}),Kr("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),Kr("dragDrop",!0,Vt),Kr("allowDropFileTypes",null),Kr("cursorBlinkRate",530),Kr("cursorScrollMargin",0),Kr("cursorHeight",1,Pe,!0),Kr("singleCursorHeightPerLine",!0,Pe,!0),Kr("workTime",100),Kr("workDelay",100),Kr("flattenSpans",!0,n,!0),Kr("addModeClass",!1,n,!0),Kr("pollInterval",100),Kr("undoDepth",200,function(e,t){e.doc.history.undoDepth=t}),Kr("historyEventDelay",1250),Kr("viewportMargin",10,function(e){e.refresh()},!0),Kr("maxHighlightLength",1e4,n,!0), +Kr("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),Kr("tabindex",null,function(e,t){e.display.input.getField().tabIndex=t||""}),Kr("autofocus",null);var rl=e.modes={},nl=e.mimeModes={};e.defineMode=function(t,r){e.defaults.mode||"null"==t||(e.defaults.mode=t),arguments.length>2&&(r.dependencies=Array.prototype.slice.call(arguments,2)),rl[t]=r},e.defineMIME=function(e,t){nl[e]=t},e.resolveMode=function(t){if("string"==typeof t&&nl.hasOwnProperty(t))t=nl[t];else if(t&&"string"==typeof t.name&&nl.hasOwnProperty(t.name)){var r=nl[t.name];"string"==typeof r&&(r={name:r}),t=Ii(r,t),t.name=r.name}else if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return e.resolveMode("application/xml");return"string"==typeof t?{name:t}:t||{name:"null"}},e.getMode=function(t,r){var r=e.resolveMode(r),n=rl[r.name];if(!n)return e.getMode(t,"text/plain");var i=n(t,r);if(il.hasOwnProperty(r.name)){var o=il[r.name];for(var l in o)o.hasOwnProperty(l)&&(i.hasOwnProperty(l)&&(i["_"+l]=i[l]),i[l]=o[l])}if(i.name=r.name,r.helperType&&(i.helperType=r.helperType),r.modeProps)for(var l in r.modeProps)i[l]=r.modeProps[l];return i},e.defineMode("null",function(){return{token:function(e){e.skipToEnd()}}}),e.defineMIME("text/plain","null");var il=e.modeExtensions={};e.extendMode=function(e,t){var r=il.hasOwnProperty(e)?il[e]:il[e]={};zi(t,r)},e.defineExtension=function(t,r){e.prototype[t]=r},e.defineDocExtension=function(e,t){Sl.prototype[e]=t},e.defineOption=Kr;var ol=[];e.defineInitHook=function(e){ol.push(e)};var ll=e.helpers={};e.registerHelper=function(t,r,n){ll.hasOwnProperty(t)||(ll[t]=e[t]={_global:[]}),ll[t][r]=n},e.registerGlobalHelper=function(t,r,n,i){e.registerHelper(t,r,i),ll[t]._global.push({pred:n,val:i})};var sl=e.copyState=function(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},al=e.startState=function(e,t,r){return e.startState?e.startState(t,r):!0};e.innerMode=function(e,t){for(;e.innerMode;){var r=e.innerMode(t);if(!r||r.mode==e)break;t=r.state,e=r.mode}return r||{mode:e,state:t}};var ul=e.commands={selectAll:function(e){e.setSelection(zo(e.firstLine(),0),zo(e.lastLine()),Il)},singleSelection:function(e){e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Il)},killLine:function(e){Gr(e,function(t){if(t.empty()){var r=Zn(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line0)i=new zo(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),zo(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var l=Zn(e.doc,i.line-1).text;l&&e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),zo(i.line-1,l.length-1),zo(i.line,1),"+transpose")}r.push(new he(i,i))}e.setSelections(r)})},newlineAndIndent:function(e){Wt(e,function(){for(var t=e.listSelections().length,r=0;t>r;r++){var n=e.listSelections()[r];e.replaceRange(e.doc.lineSeparator(),n.anchor,n.head,"+input"),e.indentLine(n.from().line+1,null,!0)}zr(e)})},toggleOverwrite:function(e){e.toggleOverwrite()}},cl=e.keyMap={};cl.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},cl.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},cl.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars"},cl.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},cl.default=Ao?cl.macDefault:cl.pcDefault,e.normalizeKeyMap=function(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if("..."==n){delete e[r];continue}for(var i=Pi(r.split(" "),jr),o=0;o=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.post},eatSpace:function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);return t>-1?(this.pos=t,!0):void 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);return i(o)==i(e)?(t!==!1&&(this.pos+=e.length),!0):void 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}}};var gl=0,vl=e.TextMarker=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++gl};Wi(vl),vl.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&wt(e),Ni(this,"clear")){var r=this.find();r&&Li(this,"clear",r.from,r.to)}for(var n=null,i=null,o=0;oe.display.maxLineLength&&(e.display.maxLine=a,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=n&&e&&this.collapsed&&Et(e,n,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&We(e.doc)),e&&Li(e,"markerCleared",e,this),t&&Ct(e),this.parent&&this.parent.clear()}},vl.prototype.find=function(e,t){null==e&&"bookmark"==this.type&&(e=1);for(var r,n,i=0;ir;++r){var i=this.lines[r];this.height-=i.height,Nn(i),Li(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;ne;++e)if(r(this.lines[e]))return!0}},_n.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var r=0;re){var o=Math.min(t,i-e),l=n.height;if(n.removeInner(e,o),this.height-=l-n.height,i==o&&(this.children.splice(r--,1),n.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Yn))){var s=[];this.collapse(s),this.children=[new Yn(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t=e){if(i.insertInner(e,t,r),i.lines&&i.lines.length>50){for(;i.lines.length>50;){var l=i.lines.splice(i.lines.length-25,25),s=new Yn(l);i.height-=s.height,this.children.splice(n+1,0,s),s.parent=this}this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),r=new _n(t);if(e.parent){e.size-=r.size,e.height-=r.height;var n=Hi(e.parent.children,e);e.parent.children.splice(n+1,0,r)}else{var i=new _n(e.children);i.parent=e,e.children=[i,r],e=i}r.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var n=0;ne){var l=Math.min(t,o-e);if(i.iterN(e,l,r))return!0;if(0==(t-=l))break;e=0}else e-=o}}};var Cl=0,Sl=e.Doc=function(e,t,r,n){if(!(this instanceof Sl))return new Sl(e,t,r,n);null==r&&(r=0),_n.call(this,[new Yn([new bl("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=r;var i=zo(r,0);this.sel=de(i),this.history=new oi(null),this.id=++Cl,this.modeOption=t,this.lineSep=n,this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Xn(this,{from:i,to:i,text:e}),ke(this,de(i),Il)};Sl.prototype=Ii(_n.prototype,{constructor:Sl,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,n=0;n=0;o--)Tr(this,n[o]);s?Te(this,s):this.cm&&zr(this.cm)}),undo:Dt(function(){Mr(this,"undo")}),redo:Dt(function(){Mr(this,"redo")}),undoSelection:Dt(function(){Mr(this,"undo",!0)}),redoSelection:Dt(function(){Mr(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=ge(this,e),t=ge(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;sa.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-=i,void++r)}),ge(this,zo(r,t))},indexFromPos:function(e){e=ge(this,e);var t=e.ch;return e.linet&&(t=e.from),null!=e.to&&e.tos||s>=t)return l+(t-o);l+=s-o,l+=r-l%r,o=s+1}},Bl=e.findColumn=function(e,t,r){for(var n=0,i=0;;){var o=e.indexOf(" ",n);-1==o&&(o=e.length);var l=o-n;if(o==e.length||i+l>=t)return n+Math.min(l,t-i);if(i+=o-n,i+=r-i%r,n=o+1,i>=t)return n}},Gl=[""],Ul=function(e){e.select()};No?Ul=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:bo&&(Ul=function(e){try{e.select()}catch(t){}});var Vl,Kl=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,jl=e.isWordChar=function(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||Kl.test(e))},Xl=/[\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]/;Vl=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(i){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};var Yl=e.contains=function(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do if(11==t.nodeType&&(t=t.host),t==e)return!0;while(t=t.parentNode)};bo&&11>wo&&(ji=function(){try{return document.activeElement}catch(e){return document.body}});var _l,$l,ql=e.rmClass=function(e,t){var r=e.className,n=Xi(t).exec(r);if(n){var i=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(i?n[1]+i:"")}},Zl=e.addClass=function(e,t){var r=e.className;Xi(t).test(r)||(e.className+=(r?" ":"")+t)},Ql=!1,Jl=function(){if(bo&&9>wo)return!1;var e=Ui("div");return"draggable"in e||"dragDrop"in e}(),es=e.splitLines=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],n=e.length;n>=t;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),l=o.indexOf("\r");-1!=l?(r.push(o.slice(0,l)),t+=l+1):(r.push(o),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},ts=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(r){}return t&&t.parentElement()==e?0!=t.compareEndPoints("StartToEnd",t):!1},rs=function(){var e=Ui("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),ns=null,is=e.keyNames={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};!function(){for(var e=0;10>e;e++)is[e+48]=is[e+96]=String(e);for(var e=65;90>=e;e++)is[e]=String.fromCharCode(e);for(var e=1;12>=e;e++)is[e+111]=is[e+63235]="F"+e}();var os,ls=function(){function e(e){return 247>=e?r.charAt(e):e>=1424&&1524>=e?"R":e>=1536&&1773>=e?n.charAt(e-1536):e>=1774&&2220>=e?"r":e>=8192&&8203>=e?"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="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",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,c=r.length,h=[],f=0;c>f;++f)h.push(n=e(r.charCodeAt(f)));for(var f=0,d=u;c>f;++f){var n=h[f];"m"==n?h[f]=d:d=n}for(var f=0,p=u;c>f;++f){var n=h[f];"1"==n&&"r"==p?h[f]="n":l.test(n)&&(p=n,"r"==n&&(h[f]="R"))}for(var f=1,d=h[0];c-1>f;++f){var n=h[f];"+"==n&&"1"==d&&"1"==h[f+1]?h[f]="1":","!=n||d!=h[f+1]||"1"!=d&&"n"!=d||(h[f]=d),d=n}for(var f=0;c>f;++f){var n=h[f];if(","==n)h[f]="N";else if("%"==n){for(var g=f+1;c>g&&"%"==h[g];++g);for(var v=f&&"!"==h[f-1]||c>g&&"1"==h[g]?"1":"N",m=f;g>m;++m)h[m]=v;f=g-1}}for(var f=0,p=u;c>f;++f){var n=h[f];"L"==p&&"1"==n?h[f]="L":l.test(n)&&(p=n)}for(var f=0;c>f;++f)if(o.test(h[f])){for(var g=f+1;c>g&&o.test(h[g]);++g);for(var y="L"==(f?h[f-1]:u),b="L"==(c>g?h[g]:u),v=y||b?"L":"R",m=f;g>m;++m)h[m]=v;f=g-1}for(var w,x=[],f=0;c>f;)if(s.test(h[f])){var C=f;for(++f;c>f&&s.test(h[f]);++f);x.push(new t(0,C,f))}else{var S=f,L=x.length;for(++f;c>f&&"L"!=h[f];++f);for(var m=S;f>m;)if(a.test(h[m])){m>S&&x.splice(L,0,new t(1,S,m));var T=m;for(++m;f>m&&a.test(h[m]);++m);x.splice(L,0,new t(2,T,m)),S=m}else++m;f>S&&x.splice(L,0,new t(1,S,f))}return 1==x[0].level&&(w=r.match(/^\s+/))&&(x[0].from=w[0].length,x.unshift(new t(0,0,w[0].length))),1==Di(x).level&&(w=r.match(/\s+$/))&&(Di(x).to-=w[0].length,x.push(new t(0,c-w[0].length,c))),2==x[0].level&&x.unshift(new t(1,x[0].to,x[0].to)),x[0].level!=Di(x).level&&x.push(new t(x[0].level,c,c)),x}}();return e.version="5.13.4",e})},{}],39:[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){return/^(?:operator|sof|keyword c|case|new|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(r||0)))}e.defineMode("javascript",function(r,n){function a(e){for(var t,r=!1,n=!1;null!=(t=e.next());){if(!r){if("/"==t&&!n)return;"["==t?n=!0:n&&"]"==t&&(n=!1)}r=!r&&"\\"==t}}function i(e,t,r){return he=e,we=r,t}function o(e,r){var n=e.next();if('"'==n||"'"==n)return r.tokenize=c(n),r.tokenize(e,r);if("."==n&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return i("number","number");if("."==n&&e.match(".."))return i("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return i(n);if("="==n&&e.eat(">"))return i("=>","operator");if("0"==n&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),i("number","number");if("0"==n&&e.eat(/o/i))return e.eatWhile(/[0-7]/i),i("number","number");if("0"==n&&e.eat(/b/i))return e.eatWhile(/[01]/i),i("number","number");if(/\d/.test(n))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),i("number","number");if("/"==n)return e.eat("*")?(r.tokenize=u,u(e,r)):e.eat("/")?(e.skipToEnd(),i("comment","comment")):t(e,r,1)?(a(e),e.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),i("regexp","string-2")):(e.eatWhile(Ae),i("operator","operator",e.current()));if("`"==n)return r.tokenize=l,l(e,r);if("#"==n)return e.skipToEnd(),i("error","error");if(Ae.test(n))return e.eatWhile(Ae),i("operator","operator",e.current());if(Ie.test(n)){e.eatWhile(Ie);var o=e.current(),s=ze.propertyIsEnumerable(o)&&ze[o];return s&&"."!=r.lastType?i(s.type,s.style,o):i("variable","variable",o)}}function c(e){return function(t,r){var n,a=!1;if(Me&&"@"==t.peek()&&t.match(Te))return r.tokenize=o,i("jsonld-keyword","meta");for(;null!=(n=t.next())&&(n!=e||a);)a=!a&&"\\"==n;return a||(r.tokenize=o),i("string","string")}}function u(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=o;break}n="*"==r}return i("comment","comment")}function l(e,t){for(var r,n=!1;null!=(r=e.next());){if(!n&&("`"==r||"$"==r&&e.eat("{"))){t.tokenize=o;break}n=!n&&"\\"==r}return i("quasi","string-2",e.current())}function s(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var r=e.string.indexOf("=>",e.start);if(!(0>r)){for(var n=0,a=!1,i=r-1;i>=0;--i){var o=e.string.charAt(i),c=$e.indexOf(o);if(c>=0&&3>c){if(!n){++i;break}if(0==--n)break}else if(c>=3&&6>c)++n;else if(Ie.test(o))a=!0;else{if(/["'\/]/.test(o))return;if(a&&!n){++i;break}}}a&&!n&&(t.fatArrowAt=i)}}function f(e,t,r,n,a,i){this.indented=e,this.column=t,this.type=r,this.prev=a,this.info=i,null!=n&&(this.align=n)}function d(e,t){for(var r=e.localVars;r;r=r.next)if(r.name==t)return!0;for(var n=e.context;n;n=n.prev)for(var r=n.vars;r;r=r.next)if(r.name==t)return!0}function p(e,t,r,n,a){var i=e.cc;for(Ce.state=e,Ce.stream=a,Ce.marked=null,Ce.cc=i,Ce.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){var o=i.length?i.pop():Ve?j:g;if(o(r,n)){for(;i.length&&i[i.length-1].lex;)i.pop()();return Ce.marked?Ce.marked:"variable"==r&&d(e,n)?"variable-2":t}}}function m(){for(var e=arguments.length-1;e>=0;e--)Ce.cc.push(arguments[e])}function v(){return m.apply(null,arguments),!0}function y(e){function t(t){for(var r=t;r;r=r.next)if(r.name==e)return!0;return!1}var r=Ce.state;if(Ce.marked="def",r.context){if(t(r.localVars))return;r.localVars={name:e,next:r.localVars}}else{if(t(r.globalVars))return;n.globalVars&&(r.globalVars={name:e,next:r.globalVars})}}function k(){Ce.state.context={prev:Ce.state.context,vars:Ce.state.localVars},Ce.state.localVars=We}function b(){Ce.state.localVars=Ce.state.context.vars,Ce.state.context=Ce.state.context.prev}function x(e,t){var r=function(){var r=Ce.state,n=r.indented;if("stat"==r.lexical.type)n=r.lexical.indented;else for(var a=r.lexical;a&&")"==a.type&&a.align;a=a.prev)n=a.indented;r.lexical=new f(n,Ce.stream.column(),e,null,r.lexical,t)};return r.lex=!0,r}function h(){var e=Ce.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function w(e){function t(r){return r==e?v():";"==e?m():v(t)}return t}function g(e,t){return"var"==e?v(x("vardef",t.length),Q,w(";"),h):"keyword a"==e?v(x("form"),j,g,h):"keyword b"==e?v(x("form"),g,h):"{"==e?v(x("}"),G,h):";"==e?v():"if"==e?("else"==Ce.state.lexical.info&&Ce.state.cc[Ce.state.cc.length-1]==h&&Ce.state.cc.pop()(),v(x("form"),j,g,h,_)):"function"==e?v(ie):"for"==e?v(x("form"),ee,g,h):"variable"==e?v(x("stat"),S):"switch"==e?v(x("form"),j,x("}","switch"),w("{"),G,h,h):"case"==e?v(j,w(":")):"default"==e?v(w(":")):"catch"==e?v(x("form"),k,w("("),oe,w(")"),g,h,b):"class"==e?v(x("form"),ce,h):"export"==e?v(x("stat"),fe,h):"import"==e?v(x("stat"),de,h):"module"==e?v(x("form"),R,x("}"),w("{"),G,h,h):m(x("stat"),j,w(";"),h)}function j(e){return V(e,!1)}function M(e){return V(e,!0)}function V(e,t){if(Ce.state.fatArrowAt==Ce.stream.start){var r=t?C:q;if("("==e)return v(k,x(")"),D(R,")"),h,w("=>"),r,b);if("variable"==e)return m(k,R,w("=>"),r,b)}var n=t?A:z;return qe.hasOwnProperty(e)?v(n):"function"==e?v(ie,n):"keyword c"==e?v(t?I:E):"("==e?v(x(")"),E,be,w(")"),h,n):"operator"==e||"spread"==e?v(t?M:j):"["==e?v(x("]"),ye,h,n):"{"==e?F(B,"}",null,n):"quasi"==e?m(T,n):"new"==e?v(W(t)):v()}function E(e){return e.match(/[;\}\)\],]/)?m():m(j)}function I(e){return e.match(/[;\}\)\],]/)?m():m(M)}function z(e,t){return","==e?v(j):A(e,t,!1)}function A(e,t,r){var n=0==r?z:A,a=0==r?j:M;return"=>"==e?v(k,r?C:q,b):"operator"==e?/\+\+|--/.test(t)?v(n):"?"==t?v(j,w(":"),a):v(a):"quasi"==e?m(T,n):";"!=e?"("==e?F(M,")","call",n):"."==e?v(N,n):"["==e?v(x("]"),E,w("]"),h,n):void 0:void 0}function T(e,t){return"quasi"!=e?m():"${"!=t.slice(t.length-2)?v(T):v(j,$)}function $(e){return"}"==e?(Ce.marked="string-2",Ce.state.tokenize=l,v(T)):void 0}function q(e){return s(Ce.stream,Ce.state),m("{"==e?g:j)}function C(e){return s(Ce.stream,Ce.state),m("{"==e?g:M)}function W(e){return function(t){return"."==t?v(e?P:O):m(e?M:j)}}function O(e,t){return"target"==t?(Ce.marked="keyword",v(z)):void 0}function P(e,t){return"target"==t?(Ce.marked="keyword",v(A)):void 0}function S(e){return":"==e?v(h,g):m(z,w(";"),h)}function N(e){return"variable"==e?(Ce.marked="property",v()):void 0}function B(e,t){return"variable"==e||"keyword"==Ce.style?(Ce.marked="property",v("get"==t||"set"==t?H:U)):"number"==e||"string"==e?(Ce.marked=Me?"property":Ce.style+" property",v(U)):"jsonld-keyword"==e?v(U):"modifier"==e?v(B):"["==e?v(j,w("]"),U):"spread"==e?v(j):void 0}function H(e){return"variable"!=e?m(U):(Ce.marked="property",v(ie))}function U(e){return":"==e?v(M):"("==e?m(ie):void 0}function D(e,t){function r(n){if(","==n){var a=Ce.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),v(e,r)}return n==t?v():v(w(t))}return function(n){return n==t?v():m(e,r)}}function F(e,t,r){for(var n=3;n!?|~^]/,Te=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,$e="([{}])",qe={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0},Ce={state:null,column:null,marked:null,cc:null},We={name:"this",next:{name:"arguments"}};return h.lex=!0,{startState:function(e){var t={tokenize:o,lastType:"sof",cc:[],lexical:new f((e||0)-ge,0,"block",!1),localVars:n.localVars,context:n.localVars&&{vars:n.localVars},indented:e||0};return n.globalVars&&"object"==typeof n.globalVars&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),s(e,t)),t.tokenize!=u&&e.eatSpace())return null;var r=t.tokenize(e,t);return"comment"==he?r:(t.lastType="operator"!=he||"++"!=we&&"--"!=we?he:"incdec",p(t,r,he,we,e))},indent:function(t,r){if(t.tokenize==u)return e.Pass;if(t.tokenize!=o)return 0;var a=r&&r.charAt(0),i=t.lexical;if(!/^\s*else\b/.test(r))for(var c=t.cc.length-1;c>=0;--c){var l=t.cc[c];if(l==h)i=i.prev;else if(l!=_)break}"stat"==i.type&&"}"==a&&(i=i.prev),je&&")"==i.type&&"stat"==i.prev.type&&(i=i.prev);var s=i.type,f=a==s;return"vardef"==s?i.indented+("operator"==t.lastType||","==t.lastType?i.info+1:0):"form"==s&&"{"==a?i.indented:"form"==s?i.indented+ge:"stat"==s?i.indented+(xe(t,r)?je||ge:0):"switch"!=i.info||f||0==n.doubleIndentSwitch?i.align?i.column+(f?0:1):i.indented+(f?0:ge):i.indented+(/^(?:case|default)\b/.test(r)?ge:2*ge)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:Ve?null:"/*",blockCommentEnd:Ve?null:"*/",lineComment:Ve?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:Ve?"json":"javascript",jsonldMode:Me,jsonMode:Ve,expressionAllowed:t,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=j&&t!=M||e.cc.pop()}}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})})},{"../../lib/codemirror":38}],40:[function(require,module,exports){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.GraphQLError=void 0;var _getPrototypeOf=require("babel-runtime/core-js/object/get-prototype-of"),_getPrototypeOf2=_interopRequireDefault(_getPrototypeOf),_classCallCheck2=require("babel-runtime/helpers/classCallCheck"),_classCallCheck3=_interopRequireDefault(_classCallCheck2),_possibleConstructorReturn2=require("babel-runtime/helpers/possibleConstructorReturn"),_possibleConstructorReturn3=_interopRequireDefault(_possibleConstructorReturn2),_inherits2=require("babel-runtime/helpers/inherits"),_inherits3=_interopRequireDefault(_inherits2),_language=require("../language");exports.GraphQLError=function(e){function r(e,t,o,i,n){(0,_classCallCheck3.default)(this,r);var u=(0,_possibleConstructorReturn3.default)(this,(0,_getPrototypeOf2.default)(r).call(this,e));return u.message=e,Object.defineProperty(u,"stack",{value:o||e}),Object.defineProperty(u,"nodes",{value:t}),Object.defineProperty(u,"source",{get:function(){if(i)return i;if(t&&t.length>0){var e=t[0];return e&&e.loc&&e.loc.source}}}),Object.defineProperty(u,"positions",{get:function(){if(n)return n;if(t){var e=t.map(function(e){return e.loc&&e.loc.start});if(e.some(function(e){return e}))return e}}}),Object.defineProperty(u,"locations",{get:function(){var e=this;return this.positions&&this.source?this.positions.map(function(r){return(0,_language.getLocation)(e.source,r)}):void 0}}),u}return(0,_inherits3.default)(r,e),r}(Error)},{"../language":55,"babel-runtime/core-js/object/get-prototype-of":71,"babel-runtime/helpers/classCallCheck":78,"babel-runtime/helpers/inherits":81,"babel-runtime/helpers/possibleConstructorReturn":82}],41:[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}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.formatError=formatError;var _invariant=require("../jsutils/invariant"),_invariant2=_interopRequireDefault(_invariant)},{"../jsutils/invariant":51}],42:[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":40,"./formatError":41,"./locatedError":43,"./syntaxError":44}],43:[function(require,module,exports){"use strict";function locatedError(r,e){var o=r?r.message||String(r):"An unknown error occurred.",a=r?r.stack:null,t=new _GraphQLError.GraphQLError(o,e,a);return t.originalError=r,t}Object.defineProperty(exports,"__esModule",{value:!0}),exports.locatedError=locatedError;var _GraphQLError=require("./GraphQLError")},{"./GraphQLError":40}],44:[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,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:l}:(0,_execute.execute)(e,s,u,t,a,i))}).catch(function(e){return{errors:[e]}})}Object.defineProperty(exports,"__esModule",{value:!0});var _promise=require("babel-runtime/core-js/promise"),_promise2=_interopRequireDefault(_promise);exports.graphql=graphql;var _source=require("./language/source"),_parser=require("./language/parser"),_validate=require("./validation/validate"),_execute=require("./execution/execute")},{"./execution/execute":45,"./language/parser":59,"./language/source":61,"./validation/validate":245,"babel-runtime/core-js/promise":74}],49:[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,"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,"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,"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,"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,"BREAK",{enumerable:!0,get:function(){return _language.BREAK}});var _execution=require("./execution");Object.defineProperty(exports,"execute",{enumerable:!0,get:function(){return _execution.execute}});var _validation=require("./validation");Object.defineProperty(exports,"validate",{enumerable:!0,get:function(){return _validation.validate}}),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,"extendSchema",{enumerable:!0,get:function(){return _utilities.extendSchema}}),Object.defineProperty(exports,"printSchema",{enumerable:!0,get:function(){return _utilities.printSchema}}),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,"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}})},{"./error":42,"./execution":46,"./graphql":48,"./language":55,"./type":199,"./utilities":211,"./validation":219}],50:[function(require,module,exports){"use strict";function find(e,t){for(var r=0;r":127>e?(0,_stringify2.default)(String.fromCharCode(e)):'"\\u'+("00"+e.toString(16).toUpperCase()).slice(-4)+'"'}function readToken(e,r){var n=e.body,a=n.length,o=positionAfterWhitespace(n,r);if(o>=a)return makeToken(TokenKind.EOF,o,o);var t=charCodeAt.call(n,o);if(32>t&&9!==t&&10!==t&&13!==t)throw(0,_error.syntaxError)(e,o,"Invalid character "+printCharCode(t)+".");switch(t){case 33:return makeToken(TokenKind.BANG,o,o+1);case 36:return makeToken(TokenKind.DOLLAR,o,o+1);case 40:return makeToken(TokenKind.PAREN_L,o,o+1);case 41:return makeToken(TokenKind.PAREN_R,o,o+1);case 46:if(46===charCodeAt.call(n,o+1)&&46===charCodeAt.call(n,o+2))return makeToken(TokenKind.SPREAD,o,o+3);break;case 58:return makeToken(TokenKind.COLON,o,o+1);case 61:return makeToken(TokenKind.EQUALS,o,o+1);case 64:return makeToken(TokenKind.AT,o,o+1);case 91:return makeToken(TokenKind.BRACKET_L,o,o+1);case 93:return makeToken(TokenKind.BRACKET_R,o,o+1);case 123:return makeToken(TokenKind.BRACE_L,o,o+1);case 124:return makeToken(TokenKind.PIPE,o,o+1);case 125:return makeToken(TokenKind.BRACE_R,o,o+1);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(e,o);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return readNumber(e,o,t);case 34:return readString(e,o)}throw(0,_error.syntaxError)(e,o,"Unexpected character "+printCharCode(t)+".")}function positionAfterWhitespace(e,r){for(var n=e.length,a=r;n>a;){var o=charCodeAt.call(e,a);if(65279===o||9===o||32===o||10===o||13===o||44===o)++a;else{if(35!==o)break;for(++a;n>a&&null!==(o=charCodeAt.call(e,a))&&(o>31||9===o)&&10!==o&&13!==o;)++a}}return a}function readNumber(e,r,n){var a=e.body,o=n,t=r,c=!1;if(45===o&&(o=charCodeAt.call(a,++t)),48===o){if(o=charCodeAt.call(a,++t),o>=48&&57>=o)throw(0,_error.syntaxError)(e,t,"Invalid number, unexpected digit after 0: "+printCharCode(o)+".")}else t=readDigits(e,t,o),o=charCodeAt.call(a,t);return 46===o&&(c=!0,o=charCodeAt.call(a,++t),t=readDigits(e,t,o),o=charCodeAt.call(a,t)),69!==o&&101!==o||(c=!0,o=charCodeAt.call(a,++t),43!==o&&45!==o||(o=charCodeAt.call(a,++t)),t=readDigits(e,t,o)),makeToken(c?TokenKind.FLOAT:TokenKind.INT,r,t,slice.call(a,r,t))}function readDigits(e,r,n){var a=e.body,o=r,t=n;if(t>=48&&57>=t){do t=charCodeAt.call(a,++o);while(t>=48&&57>=t);return o}throw(0,_error.syntaxError)(e,o,"Invalid number, expected digit but got: "+printCharCode(t)+".")}function readString(e,r){for(var n=e.body,a=r+1,o=a,t=0,c="";at&&9!==t)throw(0,_error.syntaxError)(e,a,"Invalid character within String: "+printCharCode(t)+".");if(++a,92===t){switch(c+=slice.call(n,o,a-1),t=charCodeAt.call(n,a)){case 34:c+='"';break;case 47:c+="/";break;case 92:c+="\\";break;case 98:c+="\b";break;case 102:c+="\f";break;case 110:c+="\n";break;case 114:c+="\r";break;case 116:c+=" ";break;case 117:var i=uniCharCode(charCodeAt.call(n,a+1),charCodeAt.call(n,a+2),charCodeAt.call(n,a+3),charCodeAt.call(n,a+4));if(0>i)throw(0,_error.syntaxError)(e,a,"Invalid character escape sequence: "+("\\u"+n.slice(a+1,a+5)+"."));c+=String.fromCharCode(i),a+=4;break;default:throw(0,_error.syntaxError)(e,a,"Invalid character escape sequence: \\"+String.fromCharCode(t)+".")}++a,o=a}}if(34!==t)throw(0,_error.syntaxError)(e,a,"Unterminated string.");return c+=slice.call(n,o,a),makeToken(TokenKind.STRING,r,a+1,c)}function uniCharCode(e,r,n,a){return char2hex(e)<<12|char2hex(r)<<8|char2hex(n)<<4|char2hex(a)}function char2hex(e){return e>=48&&57>=e?e-48:e>=65&&70>=e?e-55:e>=97&&102>=e?e-87:-1}function readName(e,r){for(var n=e.body,a=n.length,o=r+1,t=0;o!==a&&null!==(t=charCodeAt.call(n,o))&&(95===t||t>=48&&57>=t||t>=65&&90>=t||t>=97&&122>=t);)++o;return makeToken(TokenKind.NAME,r,o,slice.call(n,r,o))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.TokenKind=void 0;var _stringify=require("babel-runtime/core-js/json/stringify"),_stringify2=_interopRequireDefault(_stringify);exports.lex=lex,exports.getTokenDesc=getTokenDesc,exports.getTokenKindDesc=getTokenKindDesc;var _error=require("../error"),TokenKind=exports.TokenKind={EOF:1,BANG:2,DOLLAR:3,PAREN_L:4,PAREN_R:5,SPREAD:6,COLON:7,EQUALS:8,AT:9,BRACKET_L:10,BRACKET_R:11,BRACE_L:12,PIPE:13,BRACE_R:14,NAME:15,INT:16,FLOAT:17,STRING:18},tokenDescription={};tokenDescription[TokenKind.EOF]="EOF",tokenDescription[TokenKind.BANG]="!",tokenDescription[TokenKind.DOLLAR]="$",tokenDescription[TokenKind.PAREN_L]="(",tokenDescription[TokenKind.PAREN_R]=")",tokenDescription[TokenKind.SPREAD]="...",tokenDescription[TokenKind.COLON]=":",tokenDescription[TokenKind.EQUALS]="=",tokenDescription[TokenKind.AT]="@",tokenDescription[TokenKind.BRACKET_L]="[",tokenDescription[TokenKind.BRACKET_R]="]",tokenDescription[TokenKind.BRACE_L]="{",tokenDescription[TokenKind.PIPE]="|",tokenDescription[TokenKind.BRACE_R]="}",tokenDescription[TokenKind.NAME]="Name",tokenDescription[TokenKind.INT]="Int",tokenDescription[TokenKind.FLOAT]="Float",tokenDescription[TokenKind.STRING]="String";var charCodeAt=String.prototype.charCodeAt,slice=String.prototype.slice},{"../error":42,"babel-runtime/core-js/json/stringify":66}],58:[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.indexf;)if(o=i[f++],o!=o)return!0}else for(;u>f;f++)if((e||f in i)&&i[f]===r)return e||f||0;return!e&&-1}}},{"./_to-index":169,"./_to-iobject":171,"./_to-length":172}],107:[function(require,module,exports){var ctx=require("./_ctx"),IObject=require("./_iobject"),toObject=require("./_to-object"),toLength=require("./_to-length"),asc=require("./_array-species-create");module.exports=function(e,r){var t=1==e,c=2==e,i=3==e,n=4==e,u=6==e,o=5==e||u,s=r||asc;return function(r,a,f){for(var b,h,j=toObject(r),l=IObject(j),q=ctx(a,f,3),_=toLength(l.length),g=0,v=t?s(r,_):c?s(r,0):void 0;_>g;g++)if((o||g in l)&&(b=l[g],h=q(b,g,j),e))if(t)v[g]=h;else if(h)switch(e){case 3:return!0;case 5:return b;case 6:return g;case 2:v.push(b)}else if(n)return!1;return u?-1:i||n?n:v}}},{"./_array-species-create":108,"./_ctx":116,"./_iobject":131,"./_to-length":172,"./_to-object":173}],108:[function(require,module,exports){var isObject=require("./_is-object"),isArray=require("./_is-array"),SPECIES=require("./_wks")("species");module.exports=function(r,e){var i;return isArray(r)&&(i=r.constructor,"function"!=typeof i||i!==Array&&!isArray(i.prototype)||(i=void 0),isObject(i)&&(i=i[SPECIES],null===i&&(i=void 0))),new(void 0===i?Array:i)(e)}},{"./_is-array":133,"./_is-object":134,"./_wks":176}],109:[function(require,module,exports){var cof=require("./_cof"),TAG=require("./_wks")("toStringTag"),ARG="Arguments"==cof(function(){return arguments}()),tryGet=function(t,e){try{return t[e]}catch(r){}};module.exports=function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=tryGet(e=Object(t),TAG))?r:ARG?cof(e):"Object"==(n=cof(e))&&"function"==typeof e.callee?"Arguments":n}},{"./_cof":110,"./_wks":176}],110:[function(require,module,exports){var toString={}.toString;module.exports=function(t){return toString.call(t).slice(8,-1)}},{}],111:[function(require,module,exports){"use strict";var dP=require("./_object-dp").f,create=require("./_object-create"),redefineAll=(require("./_hide"),require("./_redefine-all")),ctx=require("./_ctx"),anInstance=require("./_an-instance"),defined=require("./_defined"),forOf=require("./_for-of"),$iterDefine=require("./_iter-define"),step=require("./_iter-step"),setSpecies=require("./_set-species"),DESCRIPTORS=require("./_descriptors"),fastKey=require("./_meta").fastKey,SIZE=DESCRIPTORS?"_s":"size",getEntry=function(e,t){var r,i=fastKey(t);if("F"!==i)return e._i[i];for(r=e._f;r;r=r.n)if(r.k==t)return r};module.exports={getConstructor:function(e,t,r,i){var n=e(function(e,f){anInstance(e,n,t,"_i"),e._i=create(null),e._f=void 0,e._l=void 0,e[SIZE]=0,void 0!=f&&forOf(f,r,e[i],e)});return redefineAll(n.prototype,{clear:function(){for(var e=this,t=e._i,r=e._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete t[r.i];e._f=e._l=void 0,e[SIZE]=0},delete:function(e){var t=this,r=getEntry(t,e);if(r){var i=r.n,n=r.p;delete t._i[r.i],r.r=!0,n&&(n.n=i),i&&(i.p=n),t._f==r&&(t._f=i),t._l==r&&(t._l=n),t[SIZE]--}return!!r},forEach:function(e){anInstance(this,n,"forEach");for(var t,r=ctx(e,arguments.length>1?arguments[1]:void 0,3);t=t?t.n:this._f;)for(r(t.v,t.k,this);t&&t.r;)t=t.p},has:function(e){return!!getEntry(this,e)}}),DESCRIPTORS&&dP(n.prototype,"size",{get:function(){return defined(this[SIZE])}}),n},def:function(e,t,r){var i,n,f=getEntry(e,t);return f?f.v=r:(e._l=f={i:n=fastKey(t,!0),k:t,v:r,p:i=e._l,n:void 0,r:!1},e._f||(e._f=f),i&&(i.n=f),e[SIZE]++,"F"!==n&&(e._i[n]=f)),e},getEntry:getEntry,setStrong:function(e,t,r){$iterDefine(e,t,function(e,t){this._t=e,this._k=t,this._l=void 0},function(){for(var e=this,t=e._k,r=e._l;r&&r.r;)r=r.p;return e._t&&(e._l=r=r?r.n:e._t._f)?"keys"==t?step(0,r.k):"values"==t?step(0,r.v):step(0,[r.k,r.v]):(e._t=void 0,step(1))},r?"entries":"values",!r,!0),setSpecies(t)}}},{"./_an-instance":103,"./_ctx":116,"./_defined":117,"./_descriptors":118,"./_for-of":124,"./_hide":127,"./_iter-define":137,"./_iter-step":139,"./_meta":143,"./_object-create":146,"./_object-dp":147,"./_redefine-all":159,"./_set-species":162}],112:[function(require,module,exports){var classof=require("./_classof"),from=require("./_array-from-iterable");module.exports=function(r){return function(){if(classof(this)!=r)throw TypeError(r+"#toJSON isn't generic");return from(this)}}},{"./_array-from-iterable":105,"./_classof":109}],113:[function(require,module,exports){"use strict";var global=require("./_global"),$export=require("./_export"),meta=require("./_meta"),fails=require("./_fails"),hide=require("./_hide"),redefineAll=require("./_redefine-all"),forOf=require("./_for-of"),anInstance=require("./_an-instance"),isObject=require("./_is-object"),setToStringTag=require("./_set-to-string-tag"),dP=require("./_object-dp").f,each=require("./_array-methods")(0),DESCRIPTORS=require("./_descriptors");module.exports=function(e,r,t,i,o,n){var a=global[e],s=a,c=o?"set":"add",u=s&&s.prototype,f={};return DESCRIPTORS&&"function"==typeof s&&(n||u.forEach&&!fails(function(){(new s).entries().next()}))?(s=r(function(r,t){anInstance(r,s,e,"_c"),r._c=new a,void 0!=t&&forOf(t,o,r[c],r)}),each("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),function(e){var r="add"==e||"set"==e;e in u&&(!n||"clear"!=e)&&hide(s.prototype,e,function(t,i){if(anInstance(this,s,e),!r&&n&&!isObject(t))return"get"==e?void 0:!1;var o=this._c[e](0===t?0:t,i);return r?this:o})}),"size"in u&&dP(s.prototype,"size",{get:function(){return this._c.size}})):(s=i.getConstructor(r,e,o,c),redefineAll(s.prototype,t),meta.NEED=!0),setToStringTag(s,e),f[e]=s,$export($export.G+$export.W+$export.F,f),n||i.setStrong(s,e,o),s}},{"./_an-instance":103,"./_array-methods":107,"./_descriptors":118,"./_export":122,"./_fails":123,"./_for-of":124,"./_global":125,"./_hide":127,"./_is-object":134,"./_meta":143,"./_object-dp":147,"./_redefine-all":159,"./_set-to-string-tag":163}],114:[function(require,module,exports){var core=module.exports={version:"2.2.2"};"number"==typeof __e&&(__e=core)},{}],115:[function(require,module,exports){"use strict";var $defineProperty=require("./_object-dp"),createDesc=require("./_property-desc");module.exports=function(e,r,t){r in e?$defineProperty.f(e,r,createDesc(0,t)):e[r]=t}},{"./_object-dp":147,"./_property-desc":158}],116:[function(require,module,exports){var aFunction=require("./_a-function");module.exports=function(n,r,t){if(aFunction(n),void 0===r)return n;switch(t){case 1:return function(t){return n.call(r,t)};case 2:return function(t,u){return n.call(r,t,u)};case 3:return function(t,u,e){return n.call(r,t,u,e)}}return function(){return n.apply(r,arguments)}}},{"./_a-function":101}],117:[function(require,module,exports){module.exports=function(o){if(void 0==o)throw TypeError("Can't call method on "+o);return o}},{}],118:[function(require,module,exports){module.exports=!require("./_fails")(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},{"./_fails":123}],119:[function(require,module,exports){var isObject=require("./_is-object"),document=require("./_global").document,is=isObject(document)&&isObject(document.createElement);module.exports=function(e){return is?document.createElement(e):{}}},{"./_global":125,"./_is-object":134}],120:[function(require,module,exports){module.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},{}],121:[function(require,module,exports){var getKeys=require("./_object-keys"),gOPS=require("./_object-gops"),pIE=require("./_object-pie");module.exports=function(e){var r=getKeys(e),t=gOPS.f;if(t)for(var o,u=t(e),g=pIE.f,i=0;u.length>i;)g.call(e,o=u[i++])&&r.push(o);return r}},{"./_object-gops":152,"./_object-keys":155,"./_object-pie":156}],122:[function(require,module,exports){var global=require("./_global"),core=require("./_core"),ctx=require("./_ctx"),hide=require("./_hide"),PROTOTYPE="prototype",$export=function(e,r,t){var o,n,p,i=e&$export.F,x=e&$export.G,c=e&$export.S,l=e&$export.P,u=e&$export.B,a=e&$export.W,$=x?core:core[r]||(core[r]={}),P=$[PROTOTYPE],f=x?global:c?global[r]:(global[r]||{})[PROTOTYPE];x&&(t=r);for(o in t)n=!i&&f&&void 0!==f[o],n&&o in $||(p=n?f[o]:t[o],$[o]=x&&"function"!=typeof f[o]?t[o]:u&&n?ctx(p,global):a&&f[o]==p?function(e){var r=function(r,t,o){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(r);case 2:return new e(r,t)}return new e(r,t,o)}return e.apply(this,arguments)};return r[PROTOTYPE]=e[PROTOTYPE],r}(p):l&&"function"==typeof p?ctx(Function.call,p):p,l&&(($.virtual||($.virtual={}))[o]=p,e&$export.R&&P&&!P[o]&&hide(P,o,p)))};$export.F=1,$export.G=2,$export.S=4,$export.P=8,$export.B=16,$export.W=32,$export.U=64,$export.R=128,module.exports=$export},{"./_core":114,"./_ctx":116,"./_global":125,"./_hide":127}],123:[function(require,module,exports){module.exports=function(r){try{return!!r()}catch(t){return!0}}},{}],124:[function(require,module,exports){var ctx=require("./_ctx"),call=require("./_iter-call"),isArrayIter=require("./_is-array-iter"),anObject=require("./_an-object"),toLength=require("./_to-length"),getIterFn=require("./core.get-iterator-method");module.exports=function(e,r,t,i,n){var o,a,c,l=n?function(){return e}:getIterFn(e),u=ctx(t,i,r?2:1),f=0;if("function"!=typeof l)throw TypeError(e+" is not iterable!");if(isArrayIter(l))for(o=toLength(e.length);o>f;f++)r?u(anObject(a=e[f])[0],a[1]):u(e[f]);else for(c=l.call(e);!(a=c.next()).done;)call(c,u,a.value,r)}},{"./_an-object":104,"./_ctx":116,"./_is-array-iter":132,"./_iter-call":135,"./_to-length":172,"./core.get-iterator-method":177}],125:[function(require,module,exports){var global=module.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=global)},{}],126:[function(require,module,exports){var hasOwnProperty={}.hasOwnProperty;module.exports=function(r,e){return hasOwnProperty.call(r,e)}},{}],127:[function(require,module,exports){var dP=require("./_object-dp"),createDesc=require("./_property-desc");module.exports=require("./_descriptors")?function(e,r,t){return dP.f(e,r,createDesc(1,t))}:function(e,r,t){return e[r]=t,e}},{"./_descriptors":118,"./_object-dp":147,"./_property-desc":158}],128:[function(require,module,exports){module.exports=require("./_global").document&&document.documentElement},{"./_global":125}],129:[function(require,module,exports){module.exports=!require("./_descriptors")&&!require("./_fails")(function(){return 7!=Object.defineProperty(require("./_dom-create")("div"),"a",{get:function(){return 7}}).a})},{"./_descriptors":118,"./_dom-create":119,"./_fails":123}],130:[function(require,module,exports){module.exports=function(e,r,l){var a=void 0===l;switch(r.length){case 0:return a?e():e.call(l);case 1:return a?e(r[0]):e.call(l,r[0]);case 2:return a?e(r[0],r[1]):e.call(l,r[0],r[1]);case 3:return a?e(r[0],r[1],r[2]):e.call(l,r[0],r[1],r[2]);case 4:return a?e(r[0],r[1],r[2],r[3]):e.call(l,r[0],r[1],r[2],r[3])}return e.apply(l,r)}},{}],131:[function(require,module,exports){var cof=require("./_cof");module.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==cof(e)?e.split(""):Object(e)}},{"./_cof":110}],132:[function(require,module,exports){var Iterators=require("./_iterators"),ITERATOR=require("./_wks")("iterator"),ArrayProto=Array.prototype;module.exports=function(r){return void 0!==r&&(Iterators.Array===r||ArrayProto[ITERATOR]===r)}},{"./_iterators":140,"./_wks":176}],133:[function(require,module,exports){var cof=require("./_cof");module.exports=Array.isArray||function(r){return"Array"==cof(r)}},{"./_cof":110}],134:[function(require,module,exports){module.exports=function(o){return"object"==typeof o?null!==o:"function"==typeof o}},{}],135:[function(require,module,exports){var anObject=require("./_an-object");module.exports=function(r,t,e,a){try{return a?t(anObject(e)[0],e[1]):t(e)}catch(c){var n=r.return;throw void 0!==n&&anObject(n.call(r)),c}}},{"./_an-object":104}],136:[function(require,module,exports){"use strict";var create=require("./_object-create"),descriptor=require("./_property-desc"),setToStringTag=require("./_set-to-string-tag"),IteratorPrototype={};require("./_hide")(IteratorPrototype,require("./_wks")("iterator"),function(){return this}),module.exports=function(r,t,e){r.prototype=create(IteratorPrototype,{next:descriptor(1,e)}),setToStringTag(r,t+" Iterator")}},{"./_hide":127,"./_object-create":146,"./_property-desc":158,"./_set-to-string-tag":163, +"./_wks":176}],137:[function(require,module,exports){"use strict";var LIBRARY=require("./_library"),$export=require("./_export"),redefine=require("./_redefine"),hide=require("./_hide"),has=require("./_has"),Iterators=require("./_iterators"),$iterCreate=require("./_iter-create"),setToStringTag=require("./_set-to-string-tag"),getPrototypeOf=require("./_object-gpo"),ITERATOR=require("./_wks")("iterator"),BUGGY=!([].keys&&"next"in[].keys()),FF_ITERATOR="@@iterator",KEYS="keys",VALUES="values",returnThis=function(){return this};module.exports=function(e,r,t,i,n,o,s){$iterCreate(t,r,i);var u,a,T,R=function(e){if(!BUGGY&&e in h)return h[e];switch(e){case KEYS:return function(){return new t(this,e)};case VALUES:return function(){return new t(this,e)}}return function(){return new t(this,e)}},A=r+" Iterator",c=n==VALUES,f=!1,h=e.prototype,E=h[ITERATOR]||h[FF_ITERATOR]||n&&h[n],I=E||R(n),p=n?c?R("entries"):I:void 0,_="Array"==r?h.entries||E:E;if(_&&(T=getPrototypeOf(_.call(new e)),T!==Object.prototype&&(setToStringTag(T,A,!0),LIBRARY||has(T,ITERATOR)||hide(T,ITERATOR,returnThis))),c&&E&&E.name!==VALUES&&(f=!0,I=function(){return E.call(this)}),LIBRARY&&!s||!BUGGY&&!f&&h[ITERATOR]||hide(h,ITERATOR,I),Iterators[r]=I,Iterators[A]=returnThis,n)if(u={values:c?I:R(VALUES),keys:o?I:R(KEYS),entries:p},s)for(a in u)a in h||redefine(h,a,u[a]);else $export($export.P+$export.F*(BUGGY||f),r,u);return u}},{"./_export":122,"./_has":126,"./_hide":127,"./_iter-create":136,"./_iterators":140,"./_library":142,"./_object-gpo":153,"./_redefine":160,"./_set-to-string-tag":163,"./_wks":176}],138:[function(require,module,exports){var ITERATOR=require("./_wks")("iterator"),SAFE_CLOSING=!1;try{var riter=[7][ITERATOR]();riter.return=function(){SAFE_CLOSING=!0},Array.from(riter,function(){throw 2})}catch(e){}module.exports=function(r,t){if(!t&&!SAFE_CLOSING)return!1;var n=!1;try{var e=[7],u=e[ITERATOR]();u.next=function(){return{done:n=!0}},e[ITERATOR]=function(){return u},r(e)}catch(i){}return n}},{"./_wks":176}],139:[function(require,module,exports){module.exports=function(e,n){return{value:n,done:!!e}}},{}],140:[function(require,module,exports){module.exports={}},{}],141:[function(require,module,exports){var getKeys=require("./_object-keys"),toIObject=require("./_to-iobject");module.exports=function(e,t){for(var r,o=toIObject(e),c=getKeys(o),i=c.length,u=0;i>u;)if(o[r=c[u++]]===t)return r}},{"./_object-keys":155,"./_to-iobject":171}],142:[function(require,module,exports){module.exports=!0},{}],143:[function(require,module,exports){var META=require("./_uid")("meta"),isObject=require("./_is-object"),has=require("./_has"),setDesc=require("./_object-dp").f,id=0,isExtensible=Object.isExtensible||function(){return!0},FREEZE=!require("./_fails")(function(){return isExtensible(Object.preventExtensions({}))}),setMeta=function(e){setDesc(e,META,{value:{i:"O"+ ++id,w:{}}})},fastKey=function(e,t){if(!isObject(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!has(e,META)){if(!isExtensible(e))return"F";if(!t)return"E";setMeta(e)}return e[META].i},getWeak=function(e,t){if(!has(e,META)){if(!isExtensible(e))return!0;if(!t)return!1;setMeta(e)}return e[META].w},onFreeze=function(e){return FREEZE&&meta.NEED&&isExtensible(e)&&!has(e,META)&&setMeta(e),e},meta=module.exports={KEY:META,NEED:!1,fastKey:fastKey,getWeak:getWeak,onFreeze:onFreeze}},{"./_fails":123,"./_has":126,"./_is-object":134,"./_object-dp":147,"./_uid":175}],144:[function(require,module,exports){var head,last,notify,global=require("./_global"),macrotask=require("./_task").set,Observer=global.MutationObserver||global.WebKitMutationObserver,process=global.process,Promise=global.Promise,isNode="process"==require("./_cof")(process),flush=function(){var e,o;for(isNode&&(e=process.domain)&&e.exit();head;)o=head.fn,o(),head=head.next;last=void 0,e&&e.enter()};if(isNode)notify=function(){process.nextTick(flush)};else if(Observer){var toggle=!0,node=document.createTextNode("");new Observer(flush).observe(node,{characterData:!0}),notify=function(){node.data=toggle=!toggle}}else notify=Promise&&Promise.resolve?function(){Promise.resolve().then(flush)}:function(){macrotask.call(global,flush)};module.exports=function(e){var o={fn:e,next:void 0};last&&(last.next=o),head||(head=o,notify()),last=o}},{"./_cof":110,"./_global":125,"./_task":168}],145:[function(require,module,exports){"use strict";var getKeys=require("./_object-keys"),gOPS=require("./_object-gops"),pIE=require("./_object-pie"),toObject=require("./_to-object"),IObject=require("./_iobject"),$assign=Object.assign;module.exports=!$assign||require("./_fails")(function(){var e={},t={},r=Symbol(),s="abcdefghijklmnopqrst";return e[r]=7,s.split("").forEach(function(e){t[e]=e}),7!=$assign({},e)[r]||Object.keys($assign({},t)).join("")!=s})?function(e,t){for(var r=toObject(e),s=arguments.length,i=1,o=gOPS.f,c=pIE.f;s>i;)for(var n,a=IObject(arguments[i++]),g=o?getKeys(a).concat(o(a)):getKeys(a),b=g.length,j=0;b>j;)c.call(a,n=g[j++])&&(r[n]=a[n]);return r}:$assign},{"./_fails":123,"./_iobject":131,"./_object-gops":152,"./_object-keys":155,"./_object-pie":156,"./_to-object":173}],146:[function(require,module,exports){var anObject=require("./_an-object"),dPs=require("./_object-dps"),enumBugKeys=require("./_enum-bug-keys"),IE_PROTO=require("./_shared-key")("IE_PROTO"),Empty=function(){},PROTOTYPE="prototype",createDict=function(){var e,t=require("./_dom-create")("iframe"),r=enumBugKeys.length,c=">";for(t.style.display="none",require("./_html").appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write("