graphdb-workbench 2.5.0 → 2.5.1-TR1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/115.558ce3da00d3be87d18a.bundle.js +1 -1
  2. package/dist/14.0bb211bcdc29c6d8b3b5.bundle.js +1 -1
  3. package/dist/15.6a74adbd30b4d2930e10.bundle.js +1 -0
  4. package/dist/178.e10370553beb5c6bb839.bundle.js +1 -1
  5. package/dist/180.d37db50f3ce1b3a04a65.bundle.js +1 -1
  6. package/dist/183.a086e00d4dc3c7855611.bundle.js +1 -1
  7. package/dist/21.c981976c6528073c0a2f.bundle.js +1 -1
  8. package/dist/210.1ac38e393ca959703d4b.bundle.js +1 -1
  9. package/dist/24.9076b75f45ce0579f7be.bundle.js +1 -1
  10. package/dist/31.31b7b4bd073b82c09fda.bundle.js +1 -1
  11. package/dist/51.514a339efd6cd11db0f8.bundle.js +1 -1
  12. package/dist/52.410a7d8b4cb433fb24ca.bundle.js +1 -0
  13. package/dist/{bundle.926694af2feb5084a769.bundle.js → bundle.39b836d40f0926aeec16.bundle.js} +2 -2
  14. package/dist/index.html +3 -3
  15. package/dist/js/angular/core/directives/autocomplete/templates/autocomplete.html +1 -1
  16. package/dist/js/angular/core/directives/operations-statuses-monitor/templates/operations-statuses-monitor.html +1 -1
  17. package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
  18. package/dist/js/angular/security/templates/user.html +1 -1
  19. package/dist/license-checker.json +2 -2
  20. package/dist/pages/aclmanagement.html +1 -1
  21. package/dist/pages/autocomplete.html +1 -1
  22. package/dist/pages/choose-repository-type.html +1 -1
  23. package/dist/pages/cluster-management/clusterInfo.html +3 -3
  24. package/dist/pages/create-index.html +4 -4
  25. package/dist/pages/dependencies.html +1 -1
  26. package/dist/pages/domainRangeInfo.html +2 -2
  27. package/dist/pages/edit.html +1 -1
  28. package/dist/pages/explore.html +1 -1
  29. package/dist/pages/export.html +1 -1
  30. package/dist/pages/find.html +1 -1
  31. package/dist/pages/graph-config/saveGraphConfig.html +11 -11
  32. package/dist/pages/graphs-visualizations.html +7 -7
  33. package/dist/pages/guides.html +1 -1
  34. package/dist/pages/import.html +1 -1
  35. package/dist/pages/jdbc-create.html +5 -5
  36. package/dist/pages/monitor/backup-and-restore.html +1 -1
  37. package/dist/pages/monitor/queries.html +1 -1
  38. package/dist/pages/monitor/resources.html +1 -1
  39. package/dist/pages/namespaces.html +2 -2
  40. package/dist/pages/plugins.html +1 -1
  41. package/dist/pages/rdfClassHierarchyInfo.html +7 -7
  42. package/dist/pages/rdfrank.html +2 -2
  43. package/dist/pages/repositories.html +1 -1
  44. package/dist/pages/repository.html +1 -1
  45. package/dist/pages/similarity-indexes.html +1 -1
  46. package/dist/pages/sparql-template-create.html +5 -5
  47. package/dist/pages/sparql.html +3 -3
  48. package/dist/pages/webapi.html +2 -2
  49. package/dist/res/swagger/index.html +27 -27
  50. package/package.json +1 -1
  51. package/dist/15.35db798cdef3e654ff7e.bundle.js +0 -1
  52. package/dist/52.23ca96a9ed8d85651731.bundle.js +0 -1
@@ -1,4 +1,4 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[14,3,11,21,24,30,31,49,50,83,92,93,94,95,96,97,98,100,101,138,143,144,145,149,163],{100:function(e,t){angular.module("graphdb.framework.rest.graphexplore.savedgraphs.service",[]).factory("SavedGraphsRestService",r),r.$inject=["$http"];function r(e){return{getSavedGraphs:function(){return e.get("rest/explore-graph/saved")},getSavedGraph:function(t){return e.get("rest/explore-graph/saved/"+encodeURIComponent(t))},editSavedGraph:function(t){return e.put("rest/explore-graph/saved/"+encodeURIComponent(t.id),t)},deleteSavedGraph:function(t){return e.delete("rest/explore-graph/saved/"+encodeURIComponent(t.id))},addNewSavedGraph:function(t){return e.post("rest/explore-graph/saved",t)}}}},101:function(e,t){angular.module("graphdb.framework.rest.graphconfig.service",[]).factory("GraphConfigRestService",r);function r(e){return{getGraphConfigs:function(){return e.get("rest/explore-graph/config")},getGraphConfigSamples:function(){return e.get("rest/explore-graph/samples")},loadGraphForConfig:function(t,r,n,i){return e.get(`rest/explore-graph/config/graph/${encodeURIComponent(t.id)}?includeInferred=${r}&linksLimit=${n}&sameAsState=${i}`)},getConfig:function(t){return e.get("rest/explore-graph/config/"+encodeURIComponent(t))},createGraphConfig:function(t){return e.post("rest/explore-graph/config",t)},updateGraphConfig:function(t){return e.put("rest/explore-graph/config/"+encodeURIComponent(t.id),t)},deleteGraphConfig:function(t){return e.delete("rest/explore-graph/config/"+encodeURIComponent(t.id))},validateQuery:function(t,r,n,i,o){return e({method:"POST",url:"rest/explore-graph/validate",data:{query:t,queryType:r,params:n,all:i,oneOf:o}})}}}r.$inject=["$http"]},102:function(e,t,r){"use strict";r.r(t);r(10);function n(e,t,r,n,i,o,s,a,l,u,c,p,d,f,h,g,m){e.classHierarchyData={},e.instancesObj={},e.instancesQueryObj={},e.instancesObj.items=[],e.instancesNotFiltered=[],e.isWarningShowed=!1,e.onopen=e.onclose=()=>angular.noop(),e.currentBrowserLimit=2e3,d.firefox?e.currentBrowserLimit=50:(d.safari||d.msie||d.msedge)&&(e.currentBrowserLimit=400);const E={};let v=0,x=0;t.key="",E.get=function(t,r,n){return l.initLazyList(t,r,n,v,e.instancesObj.items)};let y=allGraphs;const T=function(){if(e.getActiveRepository())return g.resolveGraphs().success((function(t){e.graphsInRepo=t.results.bindings.length>1002?t.results.bindings.slice(0,1002):t.results.bindings,C()})).error((function(t){e.repositoryError=getError(t),s.error(getError(t),m.instant("graphexplore.error.getting.graphs"))}))},C=function(){const t=f.get("classHierarchy-selectedGraph-"+n.getActiveRepository());null!==t&&e.graphsInRepo.some(e=>e.contextID.uri===t.contextID.uri)?y=t:f.set("classHierarchy-selectedGraph-"+n.getActiveRepository(),y)};function N(t,r,n){e.classCountSlider.options&&e.classCountSlider.options.ceil!==r&&(e.classCountSlider={});var i;e.classCountSlider.value||(e.showExternalElements=!0,e.classCountSlider={value:r,options:{floor:1,ceil:r,vertical:!0,showSelectionBar:!0,onChange:function(){c(I,100,!0)}}},null===f.get(h.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE)&&r>e.currentBrowserLimit&&(i=e.currentBrowserLimit,d.chrome?s.warning(m.instant("graphexplore.disabling.animations",{classLimit:i}),m.instant("graphexplore.reducing.visual.effects")):s.warning(m.instant("graphexplore.browser.performance",{browser:d.name,classLimit:i}),m.instant("graphexplore.reducing.visual.effects"))));const o=f.get(h.CLASS_HIERARCHY_SWITCH_PREFIXES);null!=o&&"true"!==o&&(e.showExternalElements=!0),n?e.classCountSlider.value=n:r>=1500&&(e.classCountSlider.value=1500,s.warning(m.instant("graphexplore.class.count.slider",{count:1500}),m.instant("graphexplore.reducing.class.count"))),r>=25&&!window.ActiveXObject&&"ActiveXObject"in window&&!e.isWarningShowed&&(e.classCountSlider.value=25,e.isWarningShowed=!0,s.warning(m.instant("graphexplore.class.count.browser",{count:25}),m.instant("graphexplore.reducing.class.count"))),c((function(){e.$broadcast("reCalcViewDimensions")}),200),I();let a=0;$("rzslider").on("wheel",(function(t){t.preventDefault(),t.stopPropagation();const r=(new Date).getTime();if(!(r-a>100))return;a=r,t=t.originalEvent;let n=e.classCountSlider.value;t.deltaY<=-1?n+=1:t.deltaY>=1&&(n-=1),n!==e.classCountSlider.value&&n>=e.classCountSlider.options.floor&&n<=e.classCountSlider.options.ceil&&e.$apply((function(){e.classCountSlider.value=n,c(I,100,!0)}))}))}function I(){e.currentSliderValue=e.classCountSlider.value}function S(e){const t=e.data.fullName,n=e.data.name;a.checkDomainRangeData(t).success((function(e,i){204===i?s.warning(m.instant("graphexplore.no.domain.range",{name:n})):(f.set(h.CLASS_HIERARCHY_LAST_SELECTED_CLASS,r.hash()),r.hash("").path("domain-range-graph").search("uri",t).search("name",n))})).error((function(){s.error(m.instant("graphexplore.error.request.failed",{name:n}))}))}function L(){r.replace().hash("1"),e.instancesObj.items=[],e.showExternalElements=!1,e.showClassInfoPanel=!1,f.clearClassHieararchyState(),e.hidePrefixes="true"===f.get(h.CLASS_HIERARCHY_HIDE_PREFIXES),e.currentSliderValue=void 0,e.classHierarchyData={},t.$broadcast("angucomplete-alt:clearInput")}function A(){e.hasClassHierarchy()&&c((function(){$("#toolbar").removeClass("ng-hide")}),0)}t.$watch((function(){return t.key}),(function(){v=0,_.each(e.instancesObj.items,(function(e){t.key>e&&v++})),x++})),E.revision=function(){return x},e.adapterContainer={adapter:{remain:!0}},e.$on("goToDomainRangeGraphView",(function(e,t){S(t)})),e.$on("classCount",N),e.$on("repositoryIsSet",(function(){if(!i.isLicenseValid())return;if(b===n.getActiveRepository())return;b=n.getActiveRepository();if(e.repositoryError=null,!b)return;y=allGraphs,T().then(R)})),e.datasource=E,e.goToDomainRangeGraphView=S,e.toggleClassInfoSidePanel=function(){e.showClassInfoPanel=!e.showClassInfoPanel,t.$broadcast("sidePanelClosed")},e.getActiveRepositoryNoError=function(){if(!e.repositoryError)return n.getActiveRepository()},e.isSystemRepository=function(){return n.isSystemRepository()},e.confirmReloadClassHierarchy=function(){p.openSimpleModal({title:m.instant("confirm.operation"),message:m.instant("graphexplore.calculating.hierarchy"),warning:!0}).result.then((function(){L(),e.loader=!0,e.hierarchyError=!1,a.reloadClassHierarchy(y.contextID.uri).success((function(t){e.loader=!1,e.classHierarchyData=t,A(),N()})).error((function(t){e.loader=!1,e.hierarchyError=getError(t),s.error(getError(t),m.instant("graphexplore.error.rdf.class.request"))}))}))},e.focusOnRoot=function(){e.$broadcast("rootFocus")},e.copyToClipboard=function(e){p.openCopyToClipboardModal(e)},e.searchedClassCallback=function(e){if(e){const r={name:e.title};t.$broadcast("searchedClass",r)}},e.instancesQueryObj.query="",e.instancesFilterFunc=function(t){return t.resolvedUri.toLowerCase().indexOf(e.instancesQueryObj.query.toLowerCase())>=0},T(),e.$watch("instancesObj.items",(function(){e.instancesObj.items.length>0&&c((function(){e.adapterContainer.adapter.reload()}),30)})),e.$watch("selectedClass",(function(){e.showClassInfoPanel&&function(t){const r=t.data.fullName;let n=t.data.name;if(n===r){const e=n.lastIndexOf("#");n=n.substring(e+1)}e.encodedUri=encodeURIComponent(r);const i=encodeURIComponent("prefix onto:<http://www.ontotext.com/>\nselect ?s {\n ?s a <"+r+"> .\n}");e.viewInstancesUri="sparql?name="+n+"&infer=true&sameAs=false&query="+i+"&execute=true",a.getRdfsLabelAndComment(r).success((function(t){e.rdfsLabel=t.label,e.rdfsComment=t.comment,e.expanded=!1})).error((function(){s.error("Error getting rdfs:label and rdfs:comment")})),e.instancesQueryObj.query="",e.instancesLoader=!0,a.getClassInstances(r).success((function(t){e.instancesObj.items=[],_.each(t,(function(t,r){const n={};n.type=t.startsWith("<<")&&t.endsWith(">>")?"triple":"uri",n.absUri=encodeURIComponent(t),n.absUriNonEncoded=t,n.resolvedUri=r,e.instancesObj.items.push(n)})),e.instancesLoader=!1,e.instancesSearchPlaceholder=e.instancesObj.items.length<1e3?"Search class instances":"Search first 1000 class instances",e.instancesNotFiltered=e.instancesObj.items})).error((function(){s.error(m.instant("graphexplore.error.instances.request"))}))}(e.selectedClass)})),$(document).ready((function(){$(".prefix-toggle").click((function(){$(".tooltip").hide()}))}));let b=n.getActiveRepository();function R(){L(),!e.isSystemRepository()&&e.isLicenseValid()&&(e.hierarchyError=!1,e.loader=!0,a.getClassHierarchyData(y.contextID.uri).success((function(t,r){e.showExternalElements=!0,e.loader=!1,e.classHierarchyData=t,207===r&&s.warning(m.instant("graphexplore.update.diagram"),m.instant("graphexplore.repository.data.changed")),A()})).error((function(t){e.loader=!1,e.hierarchyError=getError(t),s.error(getError(t),m.instant("graphexplore.error.rdf.class.request"))})))}e.hasClassHierarchy=function(){return e.classHierarchyData.classCount&&e.getActiveRepositoryNoError()&&!e.isSystemRepository()},e.isLicenseValid=function(){return i.isLicenseValid()},e.chosenGraph=function(e){y=e,R(),f.set("classHierarchy-selectedGraph-"+n.getActiveRepository(),y)},e.getSelGraphValue=function(){return y.contextID.value},e.isAllGraphsSelected=function(){return"all.graphs.label"===e.getSelGraphValue()}}angular.module("graphdb.framework.graphexplore.controllers.class",["pageslide-directive","ngAnimate","ui.scroll.jqlite","ui.scroll","angucomplete-alt","rzSlider","toastr","graphdb.framework.utils.localstorageadapter"]).controller("RdfClassHierarchyCtlr",n),n.$inject=["$scope","$rootScope","$location","$repositories","$licenseService","$window","toastr","GraphDataRestService","UiScrollService","RdfsLabelCommentService","$timeout","ModalService","bowser","LocalStorageAdapter","LSKeys","RDF4JRepositoriesRestService","$translate"]},103:function(e,t,r){"use strict";r.r(t);r(10);function n(e,t,r,n,i,o,s,a,l,u,c,p,d){e.predicatesObj={},e.predicatesQueryObj={},e.predicatesObj.items=[],e.predicatesQueryObj.query="",e.predicatesListNotFiltered=[],e.predicatesSearchPlaceholder="Search predicates",e.onopen=e.onclose=()=>angular.noop();const f={};let h=0,g=0;r.key="",f.get=function(t,r,n){return u.initLazyList(t,r,n,h,e.predicatesObj.items)},r.$watch((function(){return r.key}),(function(){h=0,_.each(e.predicatesObj.items,(function(e){r.key>e&&h++})),g++})),f.revision=function(){return g},e.adapterContainer={adapter:{remain:!0}};const m=s.get(a.DOMAIN_RANGE_COLLAPSE_EDGES);function E(){const e=s.get(a.CLASS_HIERARCHY_LAST_SELECTED_CLASS);t.search("").hash(e).path("hierarchy")}e.collapseEdges=null===m||"true"===m,e.datasource=f,e.$on("reloadDomainRangeGraphView",(function(e,r){const n=r.objectPropClassUri,i=r.objectPropClassName;t.path("domain-range-graph").search("uri",n).search("name",i)})),e.$on("switchEdgeMode",(function(e,r){t.path("domain-range-graph").search("uri",r.uri).search("name",r.name).search("collapsed",r.collapsed)})),e.$on("repositoryIsSet",(function(){if(v===i.getActiveRepository())return;v=i.getActiveRepository();E()})),e.$on("changeCollapsedEdgesState",(function(t,r){e.collapseEdges=!r,s.set(a.DOMAIN_RANGE_COLLAPSE_EDGES,e.collapseEdges)})),e.goToClassHierarchyView=E,e.copyToClipboard=function(e){c.openCopyToClipboardModal(e)},e.toggleCollapseEdgesState=function(){e.collapseEdges=!e.collapseEdges,o.history.pushState({collapsed:e.collapseEdges},"domainRangePage",null)},e.predicatesListFilterFunc=function(t){return t.resolvedUri.toLowerCase().indexOf(e.predicatesQueryObj.query.toLowerCase())>=0},e.$watch("predicatesObj.items",(function(){e.predicatesObj.items>0&&n((function(){e.adapterContainer.adapter.reload()}),30)})),e.$watch("selectedPredicate",(function(){e.showPredicatesInfoPanel&&function(t){const r=t.target,n=t.source;e.encodedUri=encodeURIComponent(t.uri),e.sourceTargetObjectNodeUri=r.objectPropClassUri?r.objectPropClassUri:n.objectPropClassUri,e.encodedSourceTargetObjectNodeUri=encodeURIComponent(e.sourceTargetObjectNodeUri),e.sourceTargetObjectNodeName=r.objectPropClassName?r.objectPropClassName:n.objectPropClassName?n.objectPropClassName:"<i>Literal</i>",-1===e.sourceTargetObjectNodeName.indexOf("Literal")?l.getRdfsLabelAndComment(e.sourceTargetObjectNodeUri).success((function(t){e.rdfsLabel=t.label,e.rdfsComment=t.comment})).error((function(){p.error(d.instant("domain.range.error.get.label.comment"))})):(e.rdfsComment=void 0,e.rdfsLabel=void 0);e.predicatesObj.items=[],e.predicatesQueryObj.query="";const i=r.allEdges?r.allEdges:n.allEdges;_.each(i,(function(t){const r={};r.absUri=encodeURIComponent(t.uri),r.absUriNonEncoded=t.uri,r.resolvedUri=t.name,r.isImplicit=t.implicit,e.predicatesObj.items.push(r)})),e.predicatesListNotFiltered=e.predicatesObj.items}(e.selectedPredicate)})),$(document).ready((function(){$(".compact-mode-toggle").click((function(){$(".tooltip").hide()}))}));let v=i.getActiveRepository()}angular.module("graphdb.framework.graphexplore.controllers.domainrange",["ui.scroll.jqlite","ui.scroll","ngSanitize","graphdb.framework.utils.localstorageadapter"]).controller("DomainRangeGraphCtlr",n),n.$inject=["$scope","$location","$rootScope","$timeout","$repositories","$window","LocalStorageAdapter","LSKeys","GraphDataRestService","UiScrollService","ModalService","toastr","$translate"]},104:function(e,t,r){(function(e){const t="WAIT",r="NO_REPO",n="READY",i="IN_PROGRESS",o="ERROR",s={contextID:{type:"all",value:"all.graphs.label",uri:""}};function a(e){if(e<1e3)return e;const t=Math.floor(Math.log(e)/Math.log(1e3));let r=e/Math.pow(1e3,t);return r=r%1>1/Math.pow(1e3,t-1)?r.toFixed(2):r.toFixed(0),r+["K","M","G","T","P","H"][t-1]}function l(e,a,l,u,c,p,d,f,h,g,m){let E=null;e.status=l.getActiveRepository()?t:r;let v=s;const x=function(){g.resolveGraphs().success((function(t){e.graphsInRepo=t.results.bindings.length>1002?t.results.bindings.slice(0,1002):t.results.bindings,y(),e.isSystemRepository()?"READY"!==e.status&&C():(e.status="WAIT",C(!0))})).error((function(t){e.repositoryError=getError(t),u.error(getError(t),m.instant("graphexplore.error.getting.graph"))}))},y=function(){const t=h.get("dependencies-selectedGraph-"+l.getActiveRepository());null!==t&&e.graphsInRepo.some(e=>e.contextID.uri===t.contextID.uri)?v=t:h.set("dependencies-selectedGraph-"+l.getActiveRepository(),v)},T=function(r){d3.select("#dependencies-chord").html(""),e.status=t,p.getRelationshipsData(r,e.direction,v.contextID.uri).success((function(t){e.dependenciesData={matrix:t.right,nodes:t.left,hasLinks:_.sum(_.map(t.right,(function(e){return _.sum(e)})))>0,direction:e.direction},e.status=n})).error((function(t){e.status=n,u.error(getError(t),m.instant("graphexplore.error.dependencies.count"))}))},C=function(r){(e.status!==n||r)&&(e.status=t,p.getRelationshipsStatus(v.contextID.uri).success((function(t){if(e.status=t,e.status===i){if(null!==E)return;E=c(C,2e3)}e.status===n&&(null!==E&&(c.cancel(E),E=null),p.getRelationshipsClasses(e.direction,v.contextID.uri).success((function(t,r){e.allClasses.items=_.filter(t,L),e.allNotFilteredClasses=t,e.selectedClasses=void 0,angular.isUndefined(e.selectedClasses)&&(e.selectedClasses=t.slice(0,10)),T(e.selectedClasses),207===r&&u.warning(m.instant("graphexplore.update.diagram"),m.instant("graphexplore.repository.data.changed"))}))),0===e.status.indexOf("ERROR;")&&(e.status=o,u.error(m.instant("graphexplore.error.dependencies.calc",{error:e.status.substring("ERROR;".length)})))})).error((function(t){e.status=o,u.error(getError(t),m.instant("graphexplore.error.dependencies.count.status"))})))};e.allClasses={},e.allClasses.items=[],e.allNotFilteredClasses=[],e.direction="all";const N={};let I=0,S=0;function L(t){return-1!==t.name.toLowerCase().indexOf(e.classQuery.query.toLowerCase())}a.key="",N.get=function(t,r,n){return d.initLazyList(t,r,n,I,e.allClasses.items)},a.$watch((function(){return a.key}),(function(){I=0,_.each(e.allClasses.items,(function(e){a.key>e&&I++})),S++})),N.revision=function(){return S},e.datasource=N,e.adapterContainer={adapter:{remain:!0}},e.classQuery={},e.classQuery.query="",e.classFilterFunc=L,e.$watch("allClasses.items",(function(){e.allClasses.items.length>0&&c((function(){e.adapterContainer.adapter.reload()}),30)})),e.$watch("direction",(function(){!l.getActiveRepository()||e.isSystemRepository()||l.isActiveRepoFedXType()||x()})),e.$on("$destroy",(function(){c.cancel(E)})),e.isLoading=function(){return e.status===i||e.status===t},e.confirmCalculateDependencies=function(){f.openSimpleModal({title:m.instant("confirm.operation"),message:m.instant("graphexplore.calculating.relationships"),warning:!0}).result.then((function(){e.calculateDependencies()}))},e.calculateDependencies=function(){e.status=t,e.selectedClasses=void 0,p.calculateRelationships(v.contextID.uri).success((function(t){0===t.indexOf("ERROR;")?u.error(m.instant("graphexplore.error.dependencies.calc",{error:e.status.substring("ERROR;".length)})):C()})).error((function(e){u.error(m.instant("graphexplore.error.could.not.force.count",{error:getError(e)}))}))},e.addClass=function(t){e.selectedClasses.push(t),T(e.selectedClasses)},e.removeClass=function(t){_.remove(e.selectedClasses,(function(e){return e.name===t.name})),T(e.selectedClasses)},e.showClass=function(t){e.classToShow=t},e.isClassByNameShown=function(t){return void 0!==_.find(e.selectedClasses,{name:t})},e.addClassByName=function(t){e.selectedClasses.push(_.find(e.allClasses.items,{name:t})),T(e.selectedClasses)},e.removeClassByName=function(t){_.remove(e.selectedClasses,(function(e){return e.name===t})),T(e.selectedClasses)},e.removeAllClasses=function(){e.selectedClasses=[],T(e.selectedClasses)},e.isSystemRepository=function(){return"SYSTEM"===l.getActiveRepository()};const A=e.$on("repositoryIsSet",(function(){e.classQuery={},e.classQuery.query="",e.repositoryError=null,v=s,l.getActiveRepository()&&!l.isActiveRepoFedXType()?x():e.status=r}));window.addEventListener("beforeunload",(function e(){A(),window.removeEventListener("beforeunload",e)})),e.selectGraph=function(e){v=e,C(!0),h.set("dependencies-selectedGraph-"+l.getActiveRepository(),v)},e.getSelectedGraphValue=function(){return v.contextID.value},e.isAllGraphsSelected=function(){return"all.graphs.label"===e.getSelectedGraphValue()}}Object.defineProperty(e,"allGraphs",{get:()=>s}),angular.module("graphdb.framework.graphexplore.controllers.dependencies",["ui.scroll.jqlite","ui.scroll","toastr","ui.bootstrap","graphdb.framework.core.services.repositories","graphdb.framework.utils.localstorageadapter"]).controller("DependenciesChordCtrl",l).config(["$uibTooltipProvider",function(e){e.options({appendToBody:!0})}]).filter("humanize",(function(){return a})),l.$inject=["$scope","$rootScope","$repositories","toastr","$timeout","GraphDataRestService","UiScrollService","ModalService","LocalStorageAdapter","RDF4JRepositoriesRestService","$translate"]}).call(this,r(11))},105:function(e,t,r){"use strict";r.r(t);r(7);var n=r(316),i=r(318),o=(r(10),r(67));function s(e,t,r,s,a,l,u,c,p,d,f,h,g,m,E,v,x,y,T,C,N,I,S){e.languageChanged=!1,e.propertiesObj={},e.propertiesQueryObj={},e.propertiesObj.items=[],e.propertiesNotFiltered=[],e.searchVisible=!1,e.nodeSelected=!1,e.queryResultsMode=!1,e.embedded=f.search().embedded,e.openedNodeInfoPanel=void 0,e.invalidLimit=!1,e.INVALID_LINKS_MSG=I.instant("sidepanel.invalid.limit.links.msg"),e.INVALID_LINKS_TOOLTIP=I.instant("sidepanel.invalid.limit.links.tooltip"),t.$on("$translateChangeSuccess",(function(){e.INVALID_LINKS_MSG=I.instant("sidepanel.invalid.limit.links.msg"),e.INVALID_LINKS_TOOLTIP=I.instant("sidepanel.invalid.limit.links.tooltip"),e.propertiesSearchPlaceholder=I.instant("visual.search.instance.placeholder")})),e.onopen=e.onclose=()=>angular.noop(),e.embedded&&(f.search().query||f.search().uri||f.search().config||f.search().saved)&&(e.noGoHome=!0);const L={};let A=0,b=0,R={},O=0;var w,P=d3.zoom().scaleExtent([.5,10]),D=d3.zoomIdentity.translate(0,-70).scale(1);P.on("zoom",(function(e){S.isActive()||(k=e.transform,w.attr("transform",k))}));let k=D;let M,F;function G(){return S.isActive()?e.defaultSettings:e.saveSettings}function U(e){m.openCopyToClipboardModal(e)}function B(){e.settings.languagesMap=_.map(e.settings.languages,(function(e){return{text:e}})),e.settings.preferredTypesMap=_.map(e.settings.preferredTypes,(function(e){return{text:e}})),e.settings.rejectedTypesMap=_.map(e.settings.rejectedTypes,(function(e){return{text:e}})),e.settings.preferredPredicatesMap=_.map(e.settings.preferredPredicates,(function(e){return{text:e}})),e.settings.rejectedPredicatesMap=_.map(e.settings.rejectedPredicates,(function(e){return{text:e}}))}t.key="",L.get=function(t,r,n){return g.initLazyList(t,r,n,A,e.propertiesObj.items)},t.$watch((function(){return t.key}),(function(){A=0,_.each(e.propertiesObj.items,(function(e){t.key>e&&A++})),b++})),L.revision=function(){return b},e.datasource=L,e.adapterContainer={adapter:{remain:!0}},e.propertiesQueryObj.query="",e.propertiesSearchPlaceholder=I.instant("visual.search.instance.placeholder"),e.propertiesFilterFunc=function(t){return t.key.toLowerCase().indexOf(e.propertiesQueryObj.query.toLowerCase())>=0},e.resetState=function(){e.searchVisible=!1,e.nodeSelected=!1,e.configLoaded=null,e.queryResultsMode=!1,e.lastSavedGraphName=null,e.lastSavedGraphId=null,e.shared=!1,e.numberOfPinnedNodes=0,R={},O=0},e.pushHistory=function(t,r){e.embedded&&(t.embedded=!0),f.search(t),f.state(r)},e.goToHome=function(){e.resetState(),f.url("graphs-visualizations")},e.shouldShowSettings=function(){return e.configLoaded&&e.configLoaded.id===e.defaultGraphConfig.id},e.shouldDisableSameAs=function(){const t=$("#sameAsCheck");return e.settings&&!e.settings.includeInferred&&t.prop("checked")&&(t.prop("checked",!1),e.settings.sameAsState=!1),e.settings&&!e.settings.includeInferred},e.$watch("propertiesObj.items",(function(){angular.isDefined(e.propertiesObj.items)&&e.propertiesObj.items.length>0&&l((function(){e.adapterContainer.adapter.reload()}),500)})),e.toggleMoreInfo=function(e){angular.element(e.currentTarget).parent().next().toggle(200),angular.element(e.currentTarget).children("span").toggleClass("icon-caret-down").toggleClass("icon-caret-up")},e.copyToClipboard=U,e.defaultSettings={linksLimit:20,includeInferred:!0,sameAsState:!0,languages:["en"],showLinksText:!0,preferredTypes:[],rejectedTypes:[],preferredPredicates:[],rejectedPredicates:["http://dbpedia.org/property/logo","http://dbpedia.org/property/hasPhotoCollection","http://dbpedia.org/property/website","http://dbpedia.org/property/homepage","http://dbpedia.org/ontology/thumbnail","http://xmlns.com/foaf/0.1/depiction","http://xmlns.com/foaf/0.1/homepage","http://xmlns.com/foaf/0.1/mbox","http://dbpedia.org/ontology/wikiPage*","http://dbpedia.org/property/wikiPage*","http://factforge.net/*"],preferredTypesOnly:!1,preferredPredicatesOnly:!1,includeSchema:!0},e.saveSettings=_.cloneDeep(e.defaultSettings),d.when(h.getPrincipal()).then(t=>function(t){const r=t.appSettings;e.defaultSettings.includeInferred=r.DEFAULT_INFERENCE,e.defaultSettings.sameAsState=r.DEFAULT_INFERENCE&&r.DEFAULT_SAMEAS,e.defaultSettings.includeSchema=r.DEFAULT_VIS_GRAPH_SCHEMA;const n=x.get(y.GRAPHS_VIZ);if(n&&"object"==typeof n)try{e.saveSettings=n,void 0===e.saveSettings.includeSchema&&(e.saveSettings.includeSchema=e.defaultSettings.includeSchema,e.saveSettings.rejectedPredicates=[...e.saveSettings.rejectedPredicates,...e.defaultSettings.rejectedPredicates].unique())}catch(t){e.saveSettings=_.cloneDeep(e.defaultSettings),x.set(y.GRAPHS_VIZ,e.saveSettings)}else e.saveSettings=_.cloneDeep(e.defaultSettings)}(t)),e.resetSettings=function(){e.settings=_.cloneDeep(e.defaultSettings),e.validateLinksLimit(),B()},e.changeLimit=function(t){let r=e.settings.linksLimit+t;r<1&&(r=1),r>1e3&&(r=1e3),e.settings.linksLimit=r},e.validateLinksLimit=function(){e.invalidLimit=!o.NUMBER_PATTERN.test(e.settings.linksLimit)},e.showSettings=function(){e.showInfoPanel=!0,e.showFilter=!0,e.showNodeInfo=!1,e.showPredicates=!1,e.saveSettings?e.settings=_.cloneDeep(e.saveSettings):e.settings=_.cloneDeep(e.defaultSettings),B()},e.reExpandNode=function(){e.rootNodeIri&&e.$broadcast("onRootNodeChange",e.rootNodeIri)};const j=function(t,r,n){const i=G(),o=void 0===r?i.sameAsState:!0===r,s=void 0===n?i.includeInferred:!0===n;e.loading=!0,u({url:"rest/explore-graph/graph",method:"POST",headers:{"Content-Type":"application/json"},data:{query:t,linksLimit:i.linksLimit,languages:e.shouldShowSettings()?i.languages:[],includeInferred:s,sameAsState:o}}).then((function(e){me(e)}),(function(t){e.loading=!1,a.error(getError(t.data),I.instant("graphexplore.error.cannot.load.graph"))}))};function V(e){return e.replace(/[()']/g,"")}function H(e,t){let r=e.split(" ");return t?[r[0],r[1],r[2]].join(">"):[r[0],r[2]].join(">")}function q(e){return[e.source.iri,e.target.iri].join(">")}function W(e){if(e.isTriple){let t=document.getElementById(V(H(e.iri)));if(t&&void 0!==t.__data__.x)return t.__data__.x}return e.x}function z(e){if(e.isTriple){let t=document.getElementById(V(H(e.iri)));if(t&&void 0!==t.__data__.y)return t.__data__.y}return e.y}function Q(e){let t=e.trim().split(" ");return`<<<${t[0]}> <${t[1]}> <${t[2]}>>>`}function X(e){return V(`${e.source.isTriple?H(e.source.iri,!0):e.source.iri}>${e.target.isTriple?H(e.target.iri,!0):e.target.iri}>marker`)}function Y(){this.nodes=[],this.links=[],this.tripleNodes=new Map,this.tripleLinksCopy=new Map,this.addNode=function(e,t,r){return e.x=t,e.y=r,this.nodes.push(e),e},this.computeConnectedness=function(){const e={},t={};_.each(this.links,(function(r){const n=r.source.iri,i=r.target.iri,o=_.min([n,i])+"|"+_.max([n,i]);t[o]||(t[o]=1,e[n]=(e[n]||0)+1,e[i]=(e[i]||0)+1)})),_.each(this.links,(function(t){e[t.source.iri]>1&&e[t.target.iri]>1?t.connectedness=Math.min(5,Math.max(e[t.source.iri],e[t.target.iri])-1):t.connectedness=0}))},this.addAndMatchLinks=function(e){const t=this.nodes;Array.prototype.push.apply(this.links,function(e,t){return _.map(e,(function(e){let r,n;r=e.isTripleSource?Ie(e.source):_.find(t,(function(t){return t.iri===e.source})),n=e.isTripleTarget?Ie(e.target):_.find(t,(function(t){return t.iri===e.target}));let i={source:r,target:n,predicates:e.predicates};if(e.isTripleSource||e.isTripleTarget){let e=`${i.source.isTriple?H(i.source.iri):i.source.iri}>${i.target.isTriple?H(i.target.iri):i.target.iri}`;if(K.tripleLinksCopy.has(e)){let t=K.tripleLinksCopy.get(e);return t[0].predicates.push(...i.predicates),t.push(i),K.tripleLinksCopy.set(e,t),null}K.tripleLinksCopy.set(e,[i])}return i}))}(e,t));for(let e of K.tripleLinksCopy.keys())1===K.tripleLinksCopy.get(e).length&&K.tripleLinksCopy.delete(e);this.links=this.links.filter(e=>null!==e),this.computeConnectedness()};const t=function(e,t){return r(e,t).length};function r(e,t){return _.filter(t,(function(t){return t.source.iri===e.iri||t.target.iri===e.iri}))}this.countLinks=t,this.linksTypes=function(e,t){const n=r(e,t),i=_.map(n,(function(t){return t.source.iri===e.iri?t.target.types:t.source.types}));return _.uniq(_.flatten(i))},this.linksPredicates=function(e,t){const n=r(e,t),i=_.map(n,(function(e){return e.predicates}));return _.uniq(_.flatten(i))},this.removeTriples=function(e){let t=[];this.tripleNodes.size>0&&e.forEach(e=>{this.tripleNodes.has(e)&&(this.tripleNodes.delete(e),this.links=_.reject(this.links,(function(r){let n=e.split(">"),i=H(r.source.iri),o=H(r.target.iri);if(i===e&&K.tripleNodes.delete(o)){let e=o.split(">");t.push({source:e[0],target:e[1]})}let s=i===e||o===e||r.source.iri===n[0]&&r.target.iri===n[1];return s&&(K.tripleLinksCopy.delete(`${i}>${o}`),K.tripleLinksCopy.delete(`${o}>${i}`)),s})))}),t.forEach(e=>{this.links=_.reject(this.links,(function(t){return t.source.iri===e.source&&t.target.iri===e.target}))})},this.removeNode=function(r){let n=[];this.links=_.reject(this.links,(function(e){let t=e.source.iri===r.iri||e.target.iri===r.iri;return t&&(e.target.isTriple&&n.push(H(e.target.iri)),e.source.isTriple||e.target.isTriple||n.push([e.source.iri,e.target.iri].join(">"))),t})),this.removeTriples(n);const i=this.links;this.nodes=_.reject(this.nodes,(function(e){return 0===t(e,i)})),0===this.nodes.length&&(e.nodeSelected=!1),this.computeConnectedness()},this.removeNodeLeafLinks=function(e){let n=[],i=this.links;this.links=_.reject(this.links,(function(o){let s=o.source.iri===e.iri&&1===t(o.target,i)&&!o.target.isTriple||o.target.iri===e.iri&&1===t(o.source,i)&&!o.source.isTriple;if(!s){let n;if(o.source.iri!==e.iri||2!==t(o.target,i)||o.target.isTriple?o.target.iri!==e.iri||2!==t(o.source,i)||o.source.isTriple||(n=r(o.source,i)):n=r(o.target,i),!n)return!1;s=(n[0].source.iri===e.iri||n[0].target.iri)&&(n[1].source.iri===e.iri||n[1].target.iri)}return s&&(o.target.isTriple&&n.push(H(o.target.iri)),o.source.isTriple||o.target.isTriple||n.push([o.source.iri,o.target.iri].join(">"))),s})),this.removeTriples(n),i=this.links,this.nodes=_.reject(this.nodes,(function(r){return 0===t(r,i)&&r.iri!==e.iri})),this.computeConnectedness()},this.addTriple=function(e,t,r){e.x=t,e.y=r,e.weight=0;let n=H(e.iri);if(this.tripleNodes.has(n)){let t=this.tripleNodes.get(n);t.push(e),this.tripleNodes.set(n,t)}else e.weight=10,this.tripleNodes.set(n,[e])},this.copyState=function(){const e=_.map(this.nodes,(function(e){return{iri:e.iri,isTriple:e.isTriple,size:e.size,labels:_.cloneDeep(e.labels),types:_.cloneDeep(e.types),rdfRank:e.rdfRank,x:e.x,y:e.y,fixed:e.fixed}})),t=JSON.stringify(Array.from(this.tripleNodes.entries())),r=JSON.stringify(Array.from(this.tripleLinksCopy.entries()));return{nodes:e,links:_.map(this.links,(function(e){return{source:e.source.iri,isTripleSource:e.source.isTriple,target:e.target.iri,isTripleTarget:e.target.isTriple,predicates:e.predicates}})),tripleNodes:t,tripleLinksCopy:r,colorIndex:O,type2color:R,transform:k}},this.restoreState=function(t){e.nodeSelected=!0,e.searchVisible=!1,this.nodes=_.cloneDeep(t.nodes),this.tripleNodes=t.tripleNodes?new Map(JSON.parse(t.tripleNodes)):new Map,this.links=[],this.addAndMatchLinks(t.links),this.tripleLinksCopy=t.tripleLinksCopy?new Map(JSON.parse(t.tripleLinksCopy)):new Map,_.each(this.nodes,(function(t){t.fixed&&e.numberOfPinnedNodes++})),angular.isDefined(t.colorIndex)&&angular.isDefined(t.type2color)&&(O=t.colorIndex,R=_.cloneDeep(t.type2color)),angular.isDefined(t.transform)&&(k=d3.zoomIdentity.translate(t.transform.x,t.transform.y).scale(t.transform.k)),pe()}}e.updateSettings=function(){e.invalidLimit?a.error(e.INVALID_LINKS_TOOLTIP,e.INVALID_LINKS_MSG):(e.saveSettings=e.settings,e.saveSettings.languages=_.map(e.saveSettings.languagesMap,(function(e){return e.text})),e.saveSettings.preferredTypes=_.map(e.saveSettings.preferredTypesMap,(function(e){return e.text})),e.saveSettings.rejectedTypes=_.map(e.saveSettings.rejectedTypesMap,(function(e){return e.text})),e.saveSettings.preferredPredicates=_.map(e.saveSettings.preferredPredicatesMap,(function(e){return e.text})),e.saveSettings.rejectedPredicates=_.map(e.saveSettings.rejectedPredicatesMap,(function(e){return e.text})),e.rootNodeIri?e.reExpandNode(e.rootNodeIri):e.queryResultsMode&&f.search().query?j(f.search().query,f.search().sameAs,f.search().inference):"query"===e.configLoaded.startMode&&e.loadGraphConfig(e.configLoaded),G().showLinksText?d3.selectAll("svg .link-wrapper text").style("display","block"):d3.selectAll("svg .link-wrapper text").style("display","none"),e.showInfoPanel=!1,e.showFilter=!1,x.set(y.GRAPHS_VIZ,e.saveSettings))},e.showInfoPanel=!1;let K=new Y;e.defaultGraphConfig={id:"default",name:"Easy graph",startMode:"search"},e.getGraphConfigs=function(t){C.getGraphConfigs().success((function(r){e.graphConfigs=r,t&&t()})).error((function(e){a.error(getError(e),I.instant("graphexplore.error.graph.configs.short.msg"))}))},e.loadConfigForId=function(t,r){t===e.defaultGraphConfig.id?e.loadGraphConfig(e.defaultGraphConfig):C.getConfig(t).success((function(t){e.loadGraphConfig(t),r()})).error((function(e){a.error(getError(e),I.instant("graphexplore.error.could.not.load.config",{configId:t}))}))},e.findConfigById=function(t){return t===e.defaultGraphConfig.id?e.defaultGraphConfig:$.grep(e.graphConfigs,(function(e){return e.id===t}))[0]},e.easyGraphSearch=function(t){e.configLoaded=e.defaultGraphConfig,e.openUri(t)},e.loadGraphConfig=function(t){e.configLoaded=t,"search"===t.startMode?e.searchVisible=!0:"node"===t.startMode&&t.startIRI?l((function(){e.openUri(t.startIRI,!0)}),0):"query"===t.startMode&&t.startGraphQuery&&(e.loading=!0,C.loadGraphForConfig(t,t.startQueryIncludeInferred,G().linksLimit,t.startQuerySameAs).then((function(e){me(e)}),(function(t){e.loading=!1,a.error(getError(t),I.instant("graphexplore.error.graph.load"))})))},e.deleteConfig=function(t){m.openSimpleModal({title:I.instant("common.confirm"),message:I.instant("graphexplore.delete.graph",{configName:t.name}),warning:!0}).result.then((function(){C.deleteGraphConfig(t).success((function(){e.getGraphConfigs(),e.refreshSavedGraphs()})).error((function(e){a.error(getError(e),I.instant("graphexplore.error.cannot.delete.config"))}))}))},e.goToGraphConfig=function(t){e.pushHistory({config:t.id},{config:t}),e.resetState(),e.loadGraphConfig(t)},v.onpopstate=function(t){e.resetState(),t.state&&(t.state.config?(e.loadGraphConfig(t.state.config),t.state.uri&&e.openUri(t.state.uri,!0)):t.state.savedGraph&&e.loadSavedGraph(t.state.savedGraph,!0))};const Z=function(){f.search().query?(e.searchVisible=!1,e.queryResultsMode=!0,j(f.search().query,f.search().sameAs,f.search().inference)):e.$on("onRootNodeChange",(function(t,r){e.loading=!0;const n=G();angular.isDefined(r)&&(e.rootNodeIri=r,u({url:"rest/explore-graph/node",method:"GET",params:{iri:r,config:e.configLoaded?e.configLoaded.id:e.defaultGraphConfig.id,languages:e.shouldShowSettings()?n.languages:[],includeInferred:n.includeInferred,sameAsState:n.sameAsState}}).then((function(t){e.nodeSelected=!0,e.searchVisible=!1,null===t.data.types&&(t.data.types="greyColor"),K=new Y;const r=K.addNode(t.data,500,500);k=D,ve(r,!0)})).catch((function(t){e.loading=!1,a.error(getError(t),I.instant("graphexplore.error.could.not.load.graph"))})))})),f.search().uri&&e.openUri(f.search().uri,!0),f.search().saved&&T.getSavedGraph(f.search().saved).success((function(t){e.loadSavedGraph(t)})).error((function(e){const t=getError(e);a.error(t,I.instant("graphexplore.error.could.not.open"))}))},J=function(){f.search().config?e.loadConfigForId(f.search().config,Z):f.search().query||f.search().uri?(e.loadGraphConfig(e.defaultGraphConfig),Z()):Z()};function ee(t){!r.getActiveRepository()||e.hasInitedRepository&&!t||(e.hasInitedRepository=!0,t||e.getGraphConfigs(J),e.getNamespacesPromise=N.getNamespaces(e.getActiveRepository()).success((function(t){const r=_.map(t.results.bindings,(function(e){return{uri:e.namespace.value,prefix:e.prefix.value}}));e.namespaces=_.sortBy(r,(function(e){return e.uri.length})),te()})).error((function(e){a.error(getError(e),I.instant("graphexplore.error.view.will.not.work"))})))}function te(){s.isLicenseValid()&&(e.getAutocompletePromise=p.checkAutocompleteStatus())}e.replaceIRIWithPrefix=function(t){const r=e.namespaces,n=_.findLast(r,(function(e){return 0===t.indexOf(e.uri)}));return n?n.prefix+":"+t.substring(n.uri.length):t},e.addedTag=function(t){return t.text.indexOf(":")<0?(a.warning(I.instant("graphexplore.absolute.prefixed.iri")),null):(t.text=function(e,t){if(!/^<?(http|urn).*>?/.test(e)){const r=e.split(":"),n=r[0],i=r[1];if(!angular.isUndefined(i)){const e=c.getNamespaceUriForPrefix(t,n);if(e)return e+i}}return e}(t.text,e.namespaces),e.pageslideExpanded=!0,t)},e.validateTag=function(e,t,r){if(e.text.indexOf(":")<0)return r?a.warning(I.instant("graphexplore.absolute.prefixed.iri.option"),t):a.warning(I.instant("graphexplore.absolute.prefixed.iri"),t),!1;const n=e.text.indexOf("*");if(n>=0){if(!r)return a.warning(I.instant("graphexplore.wildcards.not.allowed"),t),!1;if(n<e.text.length-1)return a.warning(I.instant("graphexplore.wildcards.last.char"),t),!1}return!0},e.getTagClass=function(e){return e.endsWith("*")?"tag-item-wildcard":null},e.getActiveRepository=function(){return r.getActiveRepository()},e.isLicenseValid=function(){return s.isLicenseValid()},e.hasInitedRepository=!1,e.$on("autocompleteStatus",(function(){te()})),e.$on("repositoryIsSet",(function(t,r){r.newRepo&&(e.hasInitedRepository=!1),ee(r.newRepo),r.newRepo&&(e.resetState(),$(".graph-visualization svg").empty(),f.search().query&&(e.goToHome(),Z()))})),ee();const re=d3.scaleLinear().domain([0,9]).range(["hsl(0, 100%, 75%)","hsl(360, 90%, 82%)"]).interpolate(d3.interpolateHslLong),ne=d3.scaleLinear().domain([0,9]).range(["hsl(180, 50%, 75%)","hsl(540, 40%, 82%)"]).interpolate(d3.interpolateHslLong);e.getColor=function(e){angular.isUndefined(R[e])&&(R[e]=O,O++);const t=R[e];return t>39?"#c2c2c2":t%2==0?re(t/2):ne(t/2)};const ie=d3.forceX(500).strength(.005),oe=d3.forceY(500).strength(.005),se=d3.forceSimulation().force("x",ie).force("y",oe),ae=d3.select(".main-container .graph-visualization").append("svg").attr("viewBox","0 0 1000 1000").attr("preserveAspectRatio","xMidYMid meet");ae.append("rect").attr("width",1e4).attr("height",1e4).attr("x",-4500).attr("y",-4500).style("fill","none").style("pointer-events","all").call(P).on("click",(function(e){e.stopPropagation(),xe(),se.stop()}));let le=0,ue=0;const ce=new function(){this.state=!1,this.setLoadingState=function(e){this.state=e},this.getLoadingState=function(){return this.state},this.init=function(e,t){d3.select(t).append("circle").attr("cx",(function(){return e.x})).attr("cy",(function(){return e.y})).attr("class","loader-container").attr("r",(function(){return e.size})).style("fill","fff").style("opacity","0.7"),d3.select(t).append("image").attr("xlink:href","js/angular/templates/loader/ot-loader.svg?v=2.5.0").attr("x",(function(){return e.x-e.size+5})).attr("y",(function(){return e.y-e.size})).attr("width",(function(){return 2*e.size})).attr("height",(function(){return 2*e.size})).attr("class","node-loader")}};function pe(t){d3.selectAll("svg g").remove(),d3.selectAll(".d3-tip").remove(),d3.selectAll(".menu-events").remove(),w=ae.append("g").attr("class","nodes-container").attr("transform",(function(){return angular.isDefined(k)&&!t?k:""}));const r=Object(i.a)().attr("class","d3-tip").customPosition((function(){const e=M.getBoundingClientRect();return{top:e.bottom+10+"px",left:e.left-30+"px"}})).html((function(t){let r="";return t.fixed&&(r+='<i class="icon-pin"></i>&nbsp;&nbsp;'),t.types.length>0?r+=_.join(_.map(t.types,(function(t){return e.replaceIRIWithPrefix(t)}))," · "):r+="<i>No types</i>",r})),o=function(e){let t="";return t+=_.join(_.map(e.predicates,(function(t,r){if(0===r)return Le(t);if(r<10)return" · "+Le(t);if(10===r){const t=function(e){return e.predicates.length-10}(e),r=t>1?t+" predicates":t+" predicate";return" · "+I.instant("graphexplore.tip.text",{textToShow:r})}})),""),t};let s;const u=Object(i.a)().attr("class","d3-tip").customPosition((function(e){const t=s.getBoundingClientRect(),r=function(e){const t=o(e),r=document.createElement("canvas").getContext("2d");return r.font="13px Arial",e.predicates.length<10?r.measureText(t).width:r.measureText(t).width/2}(e);return{top:t.top-30+"px",left:t.left-30+"px",width:r+"px"}})).html((function(e){return o(e)}));const c=function(){l.cancel(void 0),l.cancel(le),M=null,r.hide(),ue=l((function(){xe()}),500)};ae.call(r);ae.call(u);let p=ae.selectAll(".link"),d=ae.selectAll(".node");const f=d3.forceCollide(e=>e.size+5).strength(.5),h=d3.forceManyBody().strength(-300),g=d3.forceCenter(500,500);se.nodes(K.nodes).force("charge",h).force("collide",f).force("center",g).force("link",d3.forceLink(K.links).distance((function(e){return e.source.isTriple||e.target.isTriple?0:function(e){const t=$("<span></span>"),r=e.predicates[0].split("/"),n=r[r.length-1];t.addClass("predicate-text").text(n),$("body").append(t);const i=t.width()+2*e.source.size+2*e.target.size+50;return t.remove(),.75*i}(e)+30*e.connectedness}))),w.append("defs").selectAll("marker").data(K.links).enter().append("marker").attr("class","arrow-marker").attr("id",(function(e){return X(e)})).attr("viewBox","0 -5 10 10").attr("refX",(function(e){return e.target.isTriple?11:e.target.size+11})).attr("refY",0).attr("markerWidth",10).attr("markerHeight",10).attr("orient","auto").append("path").attr("d","M0,-5L10,0L0,5 L10,0 L0, -5"),p=w.selectAll(".link").data(K.links).enter().append("g").attr("class","link-wrapper").attr("id",(function(e){return V(q(e))})).append("line").attr("class","link").style("stroke-width",1).style("fill","transparent").style("marker-end",(function(e){return`url(#${X(e)})`}));const m=w.selectAll(".link-wrapper").append("text").text((function(e){return Se(e)})).attr("class",(function(e){return e.predicates.length>1||K.tripleNodes.has(q(e))?"predicates":"predicate"})).attr("dy","-0.5em").style("text-anchor","middle").style("display",G().showLinksText?"":"none").on("mouseover",(function(e,t){e.stopPropagation(),function(e,t){l.cancel(void 0);const r=s=e.target;l((function(){s===r&&t.predicates.length>1&&u.show(t,s)}),300)}(e,t)})).on("mouseout",(function(){l.cancel(void 0),s=null,u.hide()})).on("click",(function(t,r){t.stopPropagation(),function(t,r){Ne();let n=q(r);if(1===r.predicates.length&&K.tripleNodes.has(n)){F=null;let e=K.tripleNodes.get(n)[0];if(he(e,this,t.button)){let t={};t.iri=e.iri,t.pred=Le(e.iri.split(" ")[1]),Te(t)}return}!function(t){if(e.showNodeInfo=!1,e.showPredicates=t.predicates.length>1,e.showFilter=!1,e.showInfoPanel=!1,F===t)return e.showNodeInfo=!1,e.showInfoPanel=!1,void(F=null);F=t,e.showPredicates&&(e.predicates=_.map(t.predicates,(function(e){let r=function(e,t){let r=q(t);return K.tripleNodes.has(r)?K.tripleNodes.get(r).findIndex(t=>t.iri.indexOf(e)>=0):-1}(e,t),n=r>-1;return{value:Le(e),partOfTriple:n,linkId:n?q(t):"",nodeIndex:r}})),e.showInfoPanel=!0)}(r)}(t,r)}));let E,v=0,x=null,y=null;const T=function(t,r,n){let i=n||this.parentNode;Array.isArray(n)&&(i=n[r]);K.countLinks(t,K.links)<=G().linksLimit?ve(t,!1,i):a.info(I.instant("graphexplore.increase.limit"),I.instant("graphexplore.node.at.max")),e.closeInfoPanel()};function C(e,t){let r,n,i,o,s=!0;if("down"===t)r=2*e.size,n=e.size/3,i=.8,o=.3;else if("down-fixed"===t)r=2*e.size,n=e.size,i=.8,o=.66;else if("up"===t)r=e.size/3,n=2*e.size,i=.3,o=.8;else{if("fixed"!==t)return;r=e.size,i=.66,s=!1}let a=w.selectAll(".node-wrapper").filter((function(t){return t===e})).append("text").text("").classed("icon-any pinned",!0).style("font-size",r+"px").attr("x",(function(e){return e.x})).attr("y",(function(e){return e.y})).attr("opacity",i);"fixed"!==t&&"down-fixed"!==t||(e.pin=a),s&&(a=a.transition().duration(1e3).style("font-size",(function(){return n+"px"})).attr("opacity",o),"down-fixed"!==t&&a.remove())}const N=d3.drag().subject((function(e){return e})).on("start",(function(e,t){if(S.isActive())return;0===e.sourceEvent.button&&(t.fixedBeforeDrag=t.fixed,t.isBeingDragged=!0,t.beginDragging=!0,xe(),d3.select(this).classed("dragging",!0),se.alphaTarget(.3).restart())})).on("drag",(function(t,r){r.isBeingDragged&&(r.fx=t.x,r.fy=t.y,r.fixed?r.beginDragging&&C(r,"fixed"):(e.numberOfPinnedNodes++,r.fixed=!0,C(r,"down-fixed")),r.pinWasFixed=!0,r.beginDragging=null)})).on("end",(function(e,t){t.isBeingDragged&&(t.pinWasFixed&&(t.pinWasFixed=null,d3.select(".pinned").remove()),t.isBeingDragged=!1,d3.select(this).classed("dragging",!1));se.alphaTarget(0)}));d=w.selectAll(".node").data(K.nodes).enter().append("g").attr("class","node-wrapper").attr("id",(function(e){return e.iri})).append("circle").attr("class","node").attr("r",(function(e){return e.size})).style("fill",(function(t){return"greyColor"===t.types?"c2c2c2":e.getColor(t.types[0])})).on("mouseover",(function(t,n){n.isBeingDragged||(l.cancel(ue),le=l(()=>{(function(t,r){if(e.showInfoPanel)return!1;(fe.closeIcon||fe.expandIcon||fe.focusIcon||fe.copyURIIcon)&&fe.removeIcons();if(se.alpha()<.1)return fe.initIcons(t,r.parentNode),se.stop(),de(),!0;return!1})(n,this)&&function(e,t){l.cancel(void 0);const n=M=t.target;l((function(){M===n&&r.show(e,M)}),300)}(n,t)},400))})).on("mouseout",c).on("click",(function(t,r){if(t.button&&0!==t.button)return;const n=this;if(x&&y===n)return l.cancel(x),x=null,void T(r,0,n.parentNode);y=n,c(),e.showPredicates=!1,S.isActive()||(l.cancel(x),x=l((function(){he(r,n,t),x=null}),540))})).on("touchstart",(e,t)=>function(e){v=0,E=l((function(){v<5&&ge(e),E=null}),1e3)}(t)).on("touchmove",(function(){v++})).on("touchend",(function(){l.cancel(E),E=null})).on("contextmenu",(function(t,n){t.shiftKey||(t.preventDefault(),xe(),e.closeInfoPanel(),n.fixed?(e.numberOfPinnedNodes--,n.fixed=!1,n.fx=null,n.fy=null,C(n,"up"),se.alpha(1).restart()):(e.numberOfPinnedNodes++,n.fixed=!0,C(n,"down")),function(e){M&&r.show(e,M)}(n))})).on("gdb-expand-node",(e,t)=>T(t,0,e.srcElement.parentNode)).on("gdb-show-node-info",(e,t)=>ye(t)).call(N);const L=w.selectAll(".node-wrapper").append("foreignObject").style("pointer-events","none").attr("width",(function(e){return 2*e.size*1.75}));w.insert("g").attr("class","menu-events"),function(e){e.each((function(e){e.fontSize=n.a.Text.calcFontSizeRaw(e.labels[0].label,e.size,16,!0)})).attr("height",(function(e){return 3*e.fontSize})).append("xhtml:div").attr("class","node-label-body").style("font-size",(function(e){return e.fontSize+"px"})).append("xhtml:div").text((function(e){return e.labels[0].label})),l((function(){$(".node-label-body div").each((function(e,t){let r=t.textContent.substring(0,t.textContent.length-1);let n=0;for(;n<200&&(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth);)r=r.substring(0,r.length-1),t.textContent=r+"…",n++}))}),50)}(L),se.on("tick",(function(){p.attr("x1",(function(e){return W(e.source)})).attr("y1",(function(e){return z(e.source)})).attr("x2",(function(e){return W(e.target)})).attr("y2",(function(e){return z(e.target)})),m.attr("x",(function(e){let t=W(e.source),r=W(e.target);return e.x=.5*(t+r)})).attr("y",(function(e){let t=z(e.source),r=z(e.target);return e.y=.5*(t+r)})).attr("transform",(function(e){return"rotate("+function(e,t){const r={x:W(e.source),y:z(e.source)},n={x:W(e.target),y:z(e.target)};if(t)return 180*Math.atan2(n.y-r.y,n.x-r.x)/Math.PI;{const e=180*Math.atan2(n.y-r.y,n.x-r.x)/Math.PI;return e<=90&&e>=-90?e:(e>0?-1:1)*(180-Math.abs(e))}}(e,e.direction)+", "+e.x+", "+e.y+")"})),d.attr("cx",(function(e){return e.x})).attr("cy",(function(e){return e.y})),w.select(".node-loader").attr("x",(function(e){return e.x-e.size+3})).attr("y",(function(e){return e.y-e.size})),w.select(".loader-container").attr("cx",(function(e){return e.x})).attr("cy",(function(e){return e.y})),L.attr("x",(function(e){return e.x-1.75*e.size})).attr("y",(function(e){return e.y-3*e.fontSize/2})),d3.select(".pinned").attr("x",(function(e){return e.x})).attr("y",(function(e){return e.y})),de()})),angular.isDefined(ce)&&ce.setLoadingState(!1),e.loading&&(e.loading=!1),d3.selectAll(".link-wrapper").each((function(){const e=$(this).attr("id").split(">")[0],t=$(this).attr("id").split(">")[1];d3.selectAll(".link").each((function(r){let n=V(r.source.iri),i=V(r.target.iri);if(n===t&&i===e){let e=n;e+=">",e+=i;const t=document.createTextNode(" ⟶");document.getElementById(e).lastChild.appendChild(t),r.direction="double"}}))})),d3.selectAll(".d3-actions-tip").remove(),se.alpha(.3).restart()}function de(){t.d3alpha=se.alpha()}const fe=new function(){function e(e,t){return"translate("+(t.x-14+(t.size+15)*Math.cos(e*Math.PI/180-Math.PI/2))+","+(t.y-14+(t.size+15)*Math.sin(e*Math.PI/180-Math.PI/2))+")"}this.closeIcon=void 0,this.expandIcon=void 0,this.collapseIcon=void 0,this.focusIcon=void 0,this.copyURIIcon=void 0,this.actionsTip=void 0,this.removeIcons=function(){this.closeIcon.remove("g"),this.expandIcon&&this.expandIcon.remove("g"),this.collapseIcon&&this.collapseIcon.remove("g"),this.focusIcon.remove("g"),this.copyURIIcon.remove("g"),this.closeIcon=void 0,this.expandIcon=void 0,this.collapseIcon=void 0,this.focusIcon=void 0,this.copyURIIcon=void 0,this.expandedState=!1},this.expandedState=!1,this.initIcons=function(r,n){const o=Object(i.a)().attr("class","d3-tip d3-actions-tip").customPosition((function(e,t){const r=t.target.getBoundingClientRect();return{top:r.top-20+"px",left:r.right+10+"px"}})).html((function(e){return e}));ae.call(o);r.isExpanded?(this.collapseIcon=d3.select(".menu-events").append("g").attr("class","collapse-icon").attr("name","collapse").attr("transform",(function(){return e(20,r)})),this.collapseIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.collapseIcon.append("path").attr("d","M22.67,12a.59.59,0,0,1-.53.65l-6.88.72H15.2a.59.59,0,0,1-.59-.65l.72-6.88A.58.58,0,0,1,16,5.33a.59.59,0,0,1,.53.65L16,11.11,21.3,5.79a.64.64,0,0,1,.91.91L16.89,12,22,11.49A.59.59,0,0,1,22.67,12ZM12.59,14.75l-6.75.85a.59.59,0,0,0-.51.66.58.58,0,0,0,.66.51l4.95-.62-5.2,5.2a.64.64,0,1,0,.91.91l5.2-5.2L11.23,22a.59.59,0,0,0,.51.66h.07a.59.59,0,0,0,.59-.52l.85-6.75a.59.59,0,0,0-.17-.49A.58.58,0,0,0,12.59,14.75Z").style("fill","var(--primary-color)"),this.collapseIcon.on("click",(function(){var e;(e=r).isExpanded=!1,K.removeNodeLeafLinks(e),pe()})).on("mouseover",(function(e){o.show(this.getAttribute("name"),e),l.cancel(le),l.cancel(ue)})).on("mouseout",(function(){o.hide(),ue=l((function(){xe()}),500)}))):(this.expandIcon=d3.select(".menu-events").append("g").attr("class","expand-icon").attr("name","expand").attr("transform",(function(){return e(20,r)})),this.expandIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.expandIcon.append("path").attr("d","M22.37,6.28l-.72,6.88a.59.59,0,0,1-.59.53H21a.59.59,0,0,1-.53-.65L21,7.9l-5.32,5.32a.64.64,0,0,1-.91-.91L20.1,7,15,7.53a.59.59,0,0,1-.12-1.18l6.88-.72a.59.59,0,0,1,.65.65ZM12.89,20.34,7.95,21l5.2-5.2a.64.64,0,0,0-.91-.91L7,20.05l.62-4.95A.59.59,0,0,0,6.48,15l-.85,6.75a.59.59,0,0,0,.59.67h.07L13,21.52a.59.59,0,1,0-.15-1.18Z").style("fill","var(--primary-color)"),this.expandIcon.on("click",(function(){ve(r,!1,n)})).on("mouseover",(function(e){o.show(this.getAttribute("name"),e),l.cancel(ue),l.cancel(le)})).on("mouseout",(function(){o.hide(),ue=l((function(){xe()}),500)}))),this.focusIcon=d3.select(".menu-events").append("g").attr("class","focus-icon").attr("name","focus").attr("transform",(function(){return e(20,r)})),this.focusIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.focusIcon.append("path").attr("d","M14.2,23.81a9.8,9.8,0,1,1,6.93-2.87h0A9.74,9.74,0,0,1,14.2,23.81Zm0-18.17a8.37,8.37,0,1,0,5.92,14.29h0A8.37,8.37,0,0,0,14.2,5.64Zm1.42,6.95a2,2,0,1,0,0,2.85A2,2,0,0,0,15.62,12.59Z").style("fill","var(--primary-color)"),this.focusIcon.on("click",(function(){t.$broadcast("onRootNodeChange",r.iri)})).on("mouseover",(function(e){o.show(this.getAttribute("name"),e),l.cancel(ue),l.cancel(le)})).on("mouseout",(function(){o.hide(),ue=l((function(){xe()}),500)})),this.copyURIIcon=d3.select(".menu-events").append("g").attr("class","icon-link").attr("name","link").attr("transform",(function(){return e(20,r)})),this.copyURIIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.copyURIIcon.append("path").attr("d","M 13.457031 10.164062 C 13.648438 10.164062 13.820312 10.242188 13.941406 10.363281 L 15.492188 11.859375 C 15.984375 12.332031 16.292969 12.992188 16.292969 13.714844 C 16.292969 14.441406 15.984375 15.097656 15.492188 15.574219 L 10.394531 20.496094 C 9.902344 20.972656 9.222656 21.265625 8.472656 21.265625 C 7.71875 21.265625 7.039062 20.972656 6.546875 20.496094 L 4.996094 19 C 4.507812 18.523438 4.203125 17.867188 4.203125 17.144531 C 4.203125 16.421875 4.507812 15.765625 4.996094 15.289062 L 7.542969 12.824219 C 7.667969 12.707031 7.84375 12.628906 8.035156 12.628906 C 8.417969 12.628906 8.726562 12.929688 8.726562 13.300781 C 8.726562 13.484375 8.648438 13.652344 8.523438 13.773438 L 5.976562 16.234375 C 5.738281 16.46875 5.589844 16.792969 5.589844 17.148438 C 5.589844 17.503906 5.738281 17.824219 5.976562 18.058594 L 7.527344 19.566406 C 7.773438 19.792969 8.105469 19.929688 8.472656 19.929688 C 8.835938 19.929688 9.167969 19.792969 9.414062 19.566406 L 14.511719 14.644531 C 14.753906 14.410156 14.90625 14.089844 14.90625 13.730469 C 14.90625 13.375 14.753906 13.054688 14.511719 12.820312 L 12.964844 11.324219 C 12.839844 11.203125 12.761719 11.039062 12.761719 10.855469 C 12.761719 10.488281 13.070312 10.1875 13.449219 10.1875 Z M 17.082031 3.976562 C 17.082031 3.976562 17.085938 3.976562 17.085938 3.976562 C 17.824219 3.976562 18.492188 4.261719 18.980469 4.722656 L 20.535156 6.203125 C 21.042969 6.679688 21.355469 7.34375 21.355469 8.082031 C 21.355469 8.792969 21.058594 9.441406 20.582031 9.914062 L 18.0625 12.402344 C 17.9375 12.527344 17.761719 12.605469 17.566406 12.605469 C 17.183594 12.605469 16.875 12.304688 16.875 11.9375 C 16.875 11.753906 16.949219 11.589844 17.070312 11.46875 L 19.605469 8.984375 C 19.847656 8.75 19.996094 8.429688 19.996094 8.070312 C 19.996094 7.714844 19.847656 7.394531 19.605469 7.160156 L 18.019531 5.667969 C 17.773438 5.445312 17.4375 5.304688 17.070312 5.300781 C 16.703125 5.304688 16.367188 5.453125 16.128906 5.691406 L 11.085938 10.667969 C 10.84375 10.898438 10.695312 11.222656 10.695312 11.578125 C 10.695312 11.933594 10.84375 12.257812 11.085938 12.488281 L 12.675781 13.980469 C 12.804688 14.101562 12.882812 14.273438 12.882812 14.457031 C 12.882812 14.828125 12.574219 15.128906 12.191406 15.128906 C 12.003906 15.128906 11.832031 15.054688 11.707031 14.9375 L 10.140625 13.457031 C 9.636719 12.980469 9.324219 12.316406 9.324219 11.582031 C 9.324219 10.863281 9.621094 10.214844 10.101562 9.742188 L 15.140625 4.765625 C 15.625 4.285156 16.304688 3.980469 17.054688 3.976562 Z M 17.082031 3.976562").style("fill","var(--primary-color)"),this.copyURIIcon.on("click",(function(){U(r.iri),xe(),o.hide()})).on("mouseover",(function(e){o.show("<div style='text-align: center;'><b>Copy to ClipBoard</b><br>"+r.iri+"</div>",e),l.cancel(ue),l.cancel(le)})).on("mouseout",(function(){o.hide(),ue=l((function(){xe()}),500)})),this.closeIcon=d3.select(".menu-events").append("g").attr("class","close-icon").attr("name","remove").attr("transform",(function(){return e(20,r)})),this.closeIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.closeIcon.append("path").attr("d","M14.94,14l5.87-5.87a.66.66,0,1,0-.94-.94L14,13.06,8.13,7.19a.66.66,0,0,0-.94.94L13.06,14,7.19,19.87a.66.66,0,1,0,.94.94L14,14.94l5.87,5.87a.66.66,0,1,0,.94-.94Z").style("fill","var(--primary-color)"),this.closeIcon.on("click",(function(){ge(r)})).on("mouseover",(function(e){o.show(this.getAttribute("name"),e),l.cancel(ue),l.cancel(le)})).on("mouseout",(function(){o.hide(),ue=l((function(){xe()}),500)})),this.animateMenu(r)},this.animateMenu=function(t){const r=d3.easeSin;let n=0;let i=20;this.expandIcon&&this.expandIcon.transition().duration(100).style("opacity",1).ease(r).attr("transform",(function(){return e(i,t)})).delay(n+=35),this.collapseIcon&&this.collapseIcon.transition().duration(100).style("opacity",1).ease(r).attr("transform",(function(){return e(i,t)})).delay(n+=35),this.copyURIIcon.transition().duration(100).style("opacity",1).ease(r).attr("transform",(function(){return i+=30,e(i,t)})).delay(n+=35),this.focusIcon.transition().duration(100).style("opacity",1).ease(r).attr("transform",(function(){return i+=30,e(i,t)})).delay(n+=35),this.closeIcon.transition().duration(100).style("opacity",1).ease(r).attr("transform",(function(){return i+=30,e(i,t)})).delay(n+=35),this.expandedState=!0}};function he(r,n,i){return e.showInfoPanel=!1,e.showPredicates=!1,e.showNodeInfo=!1,i.shiftKey&&(i.ctrlKey||i.metaKey)?(t.$broadcast("onRootNodeChange",r.iri),!1):i.ctrlKey||i.metaKey?(ge(r),!1):void 0!==e.openedNodeInfoPanel&&e.openedNodeInfoPanel===r?(e.pageslideExpanded=!1,e.openedNodeInfoPanel=void 0,!1):(ye(r),!0)}function ge(e){K.removeNode(e),pe()}function me(t){!function(t){e.nodeSelected=!0,null===t.data.types&&(t.data.types="greyColor"),K=new Y,k=D}(t),Ee(t)}function Ee(t,r,n){let i=t.data;i=_.filter(i,(function(e){return-1===_.findIndex(K.links,(function(t){return e.source===t.source.iri&&e.target===t.target.iri}))}));let o=[];const s=K.tripleLinksCopy.values();for(let e=0;e<K.tripleLinksCopy.size;e++){s.next().value.forEach(e=>{o.push(e)})}i=_.filter(i,(function(e){return-1===_.findIndex(o,(function(t){return e.source===t.source.iri&&e.target===t.target.iri}))})),i=_.filter(i,(function(e){return e.source!==e.target}));const l=function(e,t){let r=t.map((function(t){return t[e]}));return t.filter((function(t,n){return r.indexOf(t[e])===n}))}("iri",_.union(_.flatten(_.map(t.data,(function(e){return[{iri:e.source,isTriple:e.isTripleSource},{iri:e.target,isTriple:e.isTripleTarget}]}))))),c=_.map(K.nodes,(function(e){return{iri:e.iri,isTriple:Boolean(e.isTriple)}})),p=K.tripleNodes.values();for(let e=0;e<K.tripleNodes.size;e++){p.next().value.forEach(e=>{c.push({iri:e.iri,isTriple:e.isTriple})})}const f=_.reject(l,(function(e){return _.some(c,e)}));if(0===f.length)(n||0===i.length)&&a.info(I.instant("graphexplore.error.node.connections")),K.addAndMatchLinks(i),pe();else{const t=[],n=[],o=G();_.forEach(f,(function(r,i){t.push(u({url:"rest/explore-graph/node",method:"GET",params:{iri:r.isTriple?Q(r.iri):r.iri,config:e.configLoaded.id,languages:e.shouldShowSettings()?o.languages:[],includeInferred:o.includeInferred,sameAsState:o.sameAsState}}).then((function(e){n[i]=e.data})))})),d.all(t).then((function(){_.forEach(n,(function(e,t){const i=2*Math.PI*t/n.length,o=(r?r.x:0)+1e3*Math.cos(i)/3,s=(r?r.y:0)+1e3*Math.sin(i)/3;e.isTriple?K.addTriple(e,o,s):K.addNode(e,o,s)})),K.addAndMatchLinks(i),r&&(r.isExpanded=!0),pe()}))}}function ve(t,r,n){if(ce.getLoadingState())return;ce.init(t,n);const i=G(),o=t.iri;u({url:"rest/explore-graph/links",method:"GET",params:{iri:o,linksLimit:i.linksLimit,includeInferred:i.includeInferred,config:e.configLoaded.id,preferredTypes:e.shouldShowSettings()?i.preferredTypes:[],rejectedTypes:e.shouldShowSettings()?i.rejectedTypes:[],preferredPredicates:e.shouldShowSettings()?i.preferredPredicates:[],rejectedPredicates:e.shouldShowSettings()?i.rejectedPredicates:[],preferredTypesOnly:e.shouldShowSettings()?i.preferredTypesOnly:[],preferredPredicatesOnly:e.shouldShowSettings()?i.preferredPredicatesOnly:[],languages:e.shouldShowSettings()?i.languages:[],sameAsState:i.sameAsState,includeSchema:i.includeSchema}}).then((function(e){Ee(e,t,r)}),(function(t){const r=getError(t.data);a.error(r,I.instant("graphexplore.error.exploring.node")),e.loading=!1,ce.setLoadingState(!1)}))}function xe(){angular.isDefined(fe)&&fe.expandedState&&fe.removeIcons()}function ye(t){se.stop(),e.openedNodeInfoPanel=t,e.showNodeInfo=!0,e.showFilter=!1,e.showPredicates=!1,e.nodeLabels=t.labels,e.nodeTypes=t.types,e.rdfRank=t.rdfRank,e.nodeIri=t.iri,e.resourceType=t.isTriple?"triple":"uri",e.encodedIri=t.isTriple?encodeURIComponent(Q(t.iri)):encodeURIComponent(t.iri),e.showInfoPanel=!0,e.rdfsLabel=t.labels[0].label,e.rdfsComment=t.comment,e.expanded=!1,e.propertiesQueryObj.query="",e.dataNodeKeysQuery="";const r=G();u.get("rest/explore-graph/properties",{params:{iri:t.isTriple?Q(t.iri):t.iri,config:e.configLoaded.id,languages:e.shouldShowSettings()?r.languages:[],includeInferred:r.includeInferred,sameAsState:r.sameAsState,rejectedPredicates:e.shouldShowSettings()?r.rejectedPredicates:[]}}).then((function(t){e.data=_.mapKeys(t.data,(function(t,r){return e.replaceIRIWithPrefix(r)})),e.propertiesObj.items=[],_.forEach(e.data,(function(t,r){e.propertiesObj.items.push({key:r,value:t})})),e.nodeImage=void 0,e.propertiesNotFiltered=e.propertiesObj.items;const r=_.find(e.propertiesObj.items,(function(e){return"image"===e.key}));r&&(e.nodeImage=r.value[0].v),e.propertiesObj.items=_.reject(e.propertiesObj.items,(function(e){return"image"===e.key})),e.propertiesNotFiltered=e.propertiesObj.items}),(function(e){a.warning(getError(e.data),"Error")}))}function Te(e){Ce("predicate","var(--primary-color-dark)",e),Ce("predicates","var(--primary-color-dark)",e);let t=document.getElementsByClassName("link");t&&_.each(t,(function(t){let r=t.__data__;(r.source.iri.indexOf(e.iri)>=0||r.target.iri.indexOf(e.iri)>=0)&&(t.style.stroke="var(--primary-color-dark)",t.style.strokeWidth=4)}));let r=document.getElementsByClassName("arrow-marker");r&&_.each(r,(function(t){let r=t.__data__;(r.source.iri.indexOf(e.iri)>=0||r.target.iri.indexOf(e.iri)>=0)&&(t.style.stroke="var(--primary-color-dark)",t.__data__.target.isTriple||t.setAttribute("refX","23"))}))}function Ce(e,t,r){let n=document.getElementsByClassName(e);n&&_.each(n,(function(e){let n=e.__data__;r?((n.source.iri.indexOf(r.iri)>=0||n.target.iri.indexOf(r.iri)>=0)&&(e.style.fill=t),H(r.iri)===q(n)&&(e.textContent=r.pred,e.style.fill=t),r.oppLinkIRI&&r.oppLinkIRI===q(n)&&(e.textContent=r.oppTriplePred,e.style.fill=t)):(e.style.fill=t,e.textContent=Se(n))}))}function Ne(){_.each(e.predicates,(function(e){let t=document.getElementById(e.linkId+e.nodeIndex);t&&(t.style.fontWeight="normal")}));let t=document.getElementsByClassName("link");t&&_.each(t,(function(e){e.style.stroke="#999",e.style.strokeWidth=1})),Ce("predicate",""),Ce("predicates","");let r=document.getElementsByClassName("arrow-marker");r&&_.each(r,(function(e){e.style.stroke="#999",e.__data__.target.isTriple||e.setAttribute("refX","59")}))}function Ie(e){let t=H(e);if(K.tripleNodes.has(t))return K.tripleNodes.get(t).find(t=>t.iri===e)}function Se(e){return e.predicates.length>1?e.predicates.length+" predicates":Le(e.predicates[0])}function Le(t){const r=e.replaceIRIWithPrefix(t);return r.length===t.length?t.split("/")[t.split("/").length-1]:r}e.toggleSidePanel=function(){e.pageslideExpanded=!e.pageslideExpanded},e.closeInfoPanel=function(){e.pageslideExpanded=!1,e.openedNodeInfoPanel=void 0,e.predicates=[],F=null,l((function(){e.showInfoPanel=!1}))},e.clickLink=function(t){if(K.tripleNodes.has(t.linkId)){Ne();let r=K.tripleNodes.get(t.linkId)[t.nodeIndex];ye(r),e.showPredicates=!0;let n=document.getElementById(t.linkId+t.nodeIndex);n&&(n.style.fontWeight="bold");let i={};const o=K.tripleLinksCopy.values();for(let e=0;e<K.tripleLinksCopy.size;e++){let e=o.next().value;e.length>1&&e.every(t=>t.source.iri===r.iri?(i.iri=e[0].source.iri,t.target.isTriple&&(i.oppLinkIRI=H(t.target.iri),i.oppTriplePred=Le(t.target.iri.split(" ")[1])),i.pred=Le(r.iri.split(" ")[1]),1===t.predicates.length&&(i.linkPred=t.predicates[0]),!1):t.target.iri!==r.iri||(i.iri=e[0].target.iri,t.source.isTriple&&(i.oppLinkIRI=H(t.source.iri),i.oppTriplePred=Le(t.source.iri.split(" ")[1])),i.pred=Le(r.iri.split(" ")[1]),1===t.predicates.length&&(i.linkPred=t.predicates[0]),!1))}i.iri||(i.iri=r.iri,i.pred=Le(r.iri.split(" ")[1])),Te(i)}},e.splitPredicate=function(e){return e.split("/")[e.split("/").length-1]},e.getActiveRepository=function(){return r.getActiveRepository()},e.isLoadingLocation=function(){return r.isLoadingLocation()},e.hasActiveLocation=function(){return r.hasActiveLocation()},e.rotate=function(e){xe();const t=10*(e?1:-1)*Math.PI/180,r=Math.cos(t),n=Math.sin(t);d3.selectAll(".node-wrapper").each((function(e){e.x=r*(e.x-500)+n*(e.y-500)+500,e.y=-n*(e.x-500)+r*(e.y-500)+500,e.fixed&&(e.fx=e.x,e.fy=e.y)})),se.alpha(1).restart()},e.openUri=function(t,r){if(!r){const r={};e.configLoaded.id!==e.defaultGraphConfig.id&&(r.config=e.configLoaded.id),r.uri=t,e.pushHistory(r,{uri:t,config:e.configLoaded})}e.$broadcast("onRootNodeChange",t)},e.saveOrUpdateGraph=function(){const t=JSON.stringify(K.copyState()),r={id:e.lastSavedGraphId,name:e.lastSavedGraphName,data:t,shared:e.shared};r.id?e.saveGraphModal("update",r):e.saveGraphModal("new",r)},e.renameSavedGraph=function(t){e.saveGraphModal("rename",{id:t.id,name:t.name,config:t.config,shared:t.shared})};const Ae=function(t){T.editSavedGraph(t).success((function(){e.lastSavedGraphName=t.name,e.shared=t.shared,e.refreshSavedGraphs(),a.success(I.instant("graphexplore.saved.graph.was.edited",{name:t.name}))})).error((function(e){const t=getError(e);a.error(t,I.instant("graphexplore.error.cannot.edit"))}))};e.saveGraphModal=function(t,r,n){E.open({templateUrl:"js/angular/graphexplore/templates/modal/save-graph.html",controller:"SaveGraphModalCtrl",resolve:{data:function(){return{mode:t,graph:r,graphExists:n,shared:r.shared}}}}).result.then((function(t){if(t.restart)e.saveGraphModal(t.mode,t.graph,!1);else switch(t.mode){case"new":!function(t){e.configLoaded&&(t.config=e.configLoaded.id),T.addNewSavedGraph(t).success((function(r,n,i){e.lastSavedGraphName=t.name,e.lastSavedGraphId=i()["x-saved-graph-id"],e.shared=t.shared,e.refreshSavedGraphs(),a.success(I.instant("graphexplore.saved.graph",{name:t.name}))})).error((function(r,n){if(422===n)e.saveGraphModal("new",t,!0);else{const e=getError(r);a.error(e,I.instant("graphexplore.error.cannot.create.graph"))}}))}(t.graph);break;case"update":case"rename":Ae(t.graph)}}))},e.refreshSavedGraphs=function(){T.getSavedGraphs().success((function(t){e.savedGraphs=t})).error((function(e){const t=getError(e);a.error(t,I.instant("graphexplore.error.getting.saved.graphs"))}))},e.loadSavedGraph=function(t,r){t.owner?(e.lastSavedGraphName=t.name,e.lastSavedGraphId=t.id,e.shared=t.shared,e.configLoaded=e.findConfigById(t.config)):(e.lastSavedGraphName=null,e.lastSavedGraphId=null,e.shared=t.shared),e.configLoaded||(e.configLoaded=e.defaultGraphConfig),f.url("?saved="+t.id),K.restoreState(JSON.parse(t.data)),r||e.pushHistory({saved:t.id},{savedGraph:t})},e.copyToClipboardSavedGraph=function(e){U([location.protocol,"//",location.host,location.pathname,"?saved=",e.id].join(""))},e.deleteSavedGraph=function(t){m.openSimpleModal({title:I.instant("common.confirm"),message:I.instant("graphexplore.confirm.delete.graph",{graphName:t.name}),warning:!0}).result.then((function(){!function(t){T.deleteSavedGraph(t).success((function(){e.refreshSavedGraphs(),a.success(I.instant("graphexplore.saved.graph.was.deleted",{name:t.name}))})).error((function(e){const t=getError(e);a.error(t,I.instant("graphexplore.error.cannot.delete"))}))}(t)}))},e.openIRI=function(t,r){return r.shiftKey?e.$broadcast("onRootNodeChange",t):window.open(t,"_blank"),!1},e.togglePinAllNodes=function(){xe();const t=angular.isUndefined(e.numberOfPinnedNodes)||e.numberOfPinnedNodes<=0;e.numberOfPinnedNodes=0,d3.selectAll(".node").each((function(r){r.fixed=t,t?(e.numberOfPinnedNodes++,r.fx=r.x,r.fy=r.y):(r.fx=null,r.fy=null)})),se.alpha(1).restart()},$("body").on("keydown",(function(t){!S.isActive()&&"input"!==t.target.nodeName&&e.nodeSelected&&(37===t.keyCode?e.rotate(!0):39===t.keyCode&&e.rotate(!1))})),e.getLiteralFromPropValue=function(e){return e.substring(e.indexOf(":")+1)}}function a(e,t,r,n){switch(e.mode=r.mode,e.graph=_.cloneDeep(r.graph),e.graphExists=r.graphExists,e.mode){case"new":e.title=n.instant("graphexplore.create.new.graph"),e.okButtonText=n.instant("common.create.btn");break;case"update":e.title=n.instant("graphexplore.update"),e.okButtonText=n.instant("common.save.btn");break;case"rename":e.title=n.instant("graphexplore.rename"),e.okButtonText=n.instant("common.save.btn")}e.ok=function(){e.form.$valid&&t.close({graph:e.graph,mode:e.mode})},e.saveNew=function(){e.graph.name=e.graph.name+" (new)",t.close({graph:e.graph,mode:"new",restart:!0})},e.cancel=function(){t.dismiss("cancel")}}angular.module("graphdb.framework.graphexplore.controllers.graphviz",["ui.scroll.jqlite","ui.scroll","toastr","ui.bootstrap","ngTagsInput","graphdb.framework.utils.localstorageadapter"]).controller("GraphsVisualizationsCtrl",s).controller("SaveGraphModalCtrl",a).config(["$uibTooltipProvider",function(e){e.options({appendToBody:!0})}]),s.$inject=["$scope","$rootScope","$repositories","$licenseService","toastr","$timeout","$http","ClassInstanceDetailsService","AutocompleteRestService","$q","$location","$jwtAuth","UiScrollService","ModalService","$uibModal","$window","LocalStorageAdapter","LSKeys","SavedGraphsRestService","GraphConfigRestService","RDF4JRepositoriesRestService","$translate","GuidesService"],a.$inject=["$scope","$uibModalInstance","data","$translate"]},106:function(e,t,r){"use strict";r.r(t);r(57),r(10);function n(e,t,r,n,i,o,s,a,l,u,c,p,d,f,h){var g;e.page=1,e.totalPages=5,e.helpHidden=1===d.get(f.HIDE_GRAPH_CONFIG_HELP),e.toggleHelp=function(t){void 0===t&&(t=d.get(f.HIDE_GRAPH_CONFIG_HELP)),1!==t?(d.set(f.HIDE_GRAPH_CONFIG_HELP,1),e.helpHidden=!0):(d.set(f.HIDE_GRAPH_CONFIG_HELP,0),e.helpHidden=!1)},e.fixedVisualCallback=function(t,r){e.newConfig.startIRI=t,e.newConfig.startIRILabel=r,g=!0},e.isDefaultGraph=function(e){return"Minimal"===e.name||"Advanced"===e.name},e.isUserGraph=function(t){return!e.isDefaultGraph(t)},e.getSampleName=function(e,t){const r=e[t+"Description"];return r||(e.id?"Copy of "+e.name:e.name)};const m=u.configName;function E(e){n.warning(e)}function v(t){let r;return"query"===t.startMode&&1===e.page?r=t.startGraphQuery:2===e.page?r=t.expandQuery:3===e.page?r=t.resourceQuery:4===e.page?r=t.predicateLabelQuery:5===e.page&&(r=t.resourcePropertiesQuery),angular.isDefined(r)?r:""}function x(){function o(){e.getAutocompletePromise=l.checkAutocompleteStatus()}a.getGraphConfigSamples().success((function(t){e.samples=_.filter(t,(function(t){return!t.id||e.newConfig.id!==t.id||(e.revertConfig=t,!1)}))})).error((function(e){n.error(getError(e),h.instant("graphexplore.error.graph.configs"))})),e.createGraphConfig=function(){a.createGraphConfig(e.newConfig).success((async function(){await c.showToastMessageWithDelay("graphexplore.saved.new.config"),r.url("graphs-visualizations")})).error((function(e){n.error(getError(e),h.instant("graphexplore.error.could.not.create"))}))},e.updateGraphConfig=function(){a.updateGraphConfig(e.newConfig).success((async function(){await c.showToastMessageWithDelay("graphexplore.saved.config"),r.url("graphs-visualizations")})).error((function(e){n.error(getError(e),h.instant("graphexplore.error.could.not.save"))}))},e.$on("autocompleteStatus",(function(){o()})),o(),e.getNamespacesPromise=p.getNamespaces(e.getActiveRepository());const s=function(e,t,r,n,i,o){t?a.validateQuery(t,r,n,i,o).success((function(){e()})).error((function(e){E(getError(e))})):e()};function u(){d()&&e.$broadcast("addStartFixedNodeAutomatically",{startIRI:e.newConfig.startIRI})}function d(){return 1===e.page&&"node"===e.newConfig.startMode}e.validateCurrentPage=function(t){e.updateModel(),1===e.page?"node"!==e.newConfig.startMode||e.newConfig.startIRI?"query"!==e.newConfig.startMode||e.newConfig.startGraphQuery?"query"===e.newConfig.startMode?s(t,e.newConfig.startGraphQuery,"graph"):t():E(h.instant("graphexplore.provide.query")):E(h.instant("graphexplore.select.start.node")):2===e.page?s(t,e.newConfig.expandQuery,"construct",["node"]):3===e.page?s(t,e.newConfig.resourceQuery,"tuple",["node"],[],["type","label","comment","rank"]):4===e.page?s(t,e.newConfig.predicateLabelQuery,"tuple",["edge"],["label"]):5===e.page&&s(t,e.newConfig.resourcePropertiesQuery,"tuple",["node"],["property","value"])},e.goToPage=function(t){e.page!==t&&e.validateCurrentPage((function(){e.showEditor(),e.page=t,e.notoolbar=1!==e.page}))},e.goToPreviousPage=function(){e.page>1&&e.goToPage(e.page-1),d()&&(g=!1)},e.goToNextPage=function(){u(),("node"!==e.newConfig.startMode||g)&&e.goToPage(e.page+1)},e.saveGraphConfig=function(){u(),d()&&!g||(e.newConfig.startQueryIncludeInferred=e.currentQuery.inference,e.newConfig.startQuerySameAs=e.currentQuery.sameAs,e.validateCurrentPage((function(){e.newConfig.name?e.isUpdate?e.updateGraphConfig(e.newConfig):e.createGraphConfig(e.newConfig):E(h.instant("graphexplore.provide.config.name"))})))},e.updateModel=function(){const t=window.editor.getValue().trim();"query"===e.newConfig.startMode&&1===e.page?e.newConfig.startGraphQuery=t:2===e.page?e.newConfig.expandQuery=t:3===e.page?e.newConfig.resourceQuery=t:4===e.page?e.newConfig.predicateLabelQuery=t:5===e.page&&(e.newConfig.resourcePropertiesQuery=t)},e.setQuery=function(e){window.editor.setValue(e||" ")},e.updateDirty=function(){if(e.revertConfig){const t=v(e.revertConfig),r=window.editor.getValue().trim();e.queryEditorIsDirty=t!==r}},e.updateEditor=function(){t((function(){e.currentQuery.query=v(e.newConfig),i.isActiveRepoOntopType()&&(e.nocount=!0),e.currentQuery.inference=e.newConfig.startQueryIncludeInferred,e.currentQuery.sameAs=e.newConfig.startQuerySameAs,O(),S(e.currentQuery.id)}),100)},e.showEditor=function(){window.editor&&window.editor.xhr&&window.editor.xhr.abort(),e.viewMode="yasr"},e.showPreview=function(){e.currentQuery.outputType="table",e.runQuery()},e.revertEditor=function(){e.setQuery(v(e.revertConfig))},e.$watch("newConfig.startMode",(function(r){"query"===r&&t((function(){e.updateEditor()}),0)})),e.$watch("page",(function(r){("query"===e.newConfig.startMode||r>1)&&t((function(){e.showEditor(),e.updateEditor()}),0)}))}e.newConfig={startQueryIncludeInferred:!0,startQuerySameAs:!0},e.newConfig.startMode="search",e.isUpdate=!1,e.shared=!1,e.encodeQuery=function(e){return encodeURIComponent(e)},m?(e.isUpdate=!0,a.getConfig(m).success((function(t){e.newConfig=t,x()})).error((function(e){n.error(getError(e),h.instant("created.connector",{name:m}))}))):(e.isUpdate=!1,x());const y={id:"1",name:"",query:"select * where { \n\t?s ?p ?o .\n} limit 100 \n",inference:e.newConfig.startQueryIncludeInferred,sameAs:e.newConfig.startQuerySameAs};function T(e){}function C(t,r,n){const i=angular.element(document.getElementById("yasr-inner"));e.queryIsRunning=t,t?(e.queryStartTime=Date.now(),e.countTimeouted=!1,e.progressMessage=r,e.extraMessage=n,i.addClass("hide")):(e.progressMessage="",e.extraMessage="",i.removeClass("hide")),null===e.$$phase&&e.$apply()}function N(r){function n(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0}const i=r;if(e.orientationViewMode){if("yasr"===e.viewMode){let e=n()-document.querySelector(".CodeMirror-wrap").getBoundingClientRect().top;e-=40,document.querySelector(".CodeMirror-wrap").style.height=e+"px"}else e.noPadding={},document.querySelector(".CodeMirror-wrap").style.height="";document.getElementById("yasr").style.minHeight=""}else if(e.noPadding={paddingRight:15,paddingLeft:0},window.editor&&document.querySelector(".CodeMirror-wrap")){let e=n()-document.querySelector(".CodeMirror-wrap").getBoundingClientRect().top;e-=40,document.querySelector(".CodeMirror-wrap").style.height=e+"px",document.getElementById("yasr").style.minHeight=e+"px"}else{let r;r=t(i?function(){e.fixSizesOnHorizontalViewModeSwitch(i)}:e.fixSizesOnHorizontalViewModeSwitch,100),e.$on("$destroy",(function(){t.cancel(r)}))}window.yasr&&window.yasr.container&&t((function(){window.yasr.container.resize()}),100)}function I(){N(!0)}function S(e){t((function(){$('a[data-id = "'+e+'"]').tab("show")}),0)}function L(t,r){e.executedQueryTab=e.currentQuery,r&&"SELECT"!==window.editor.getQueryType()&&"CONSTRUCT"!==window.editor.getQueryType()&&"DESCRIBE"!==window.editor.getQueryType()?n.warning(h.instant("query.editor.warning.msg")):"update"!==window.editor.getQueryMode()?(e.explainRequested=r,e.queryIsRunning||(t?e.currentTabConfig.resultsCount=0:e.resetCurrentTabConfig(),e.viewMode="editor",e.orientationViewMode&&e.fixSizesOnHorizontalViewModeSwitch(),C(!0,h.instant("evaluating.query.msg")),window.editor.query())):n.warning(h.instant("cannot.execute.update.error"))}function A(){C(!0,h.instant("common.refreshing.namespaces"),h.instant("common.extra.message")),p.getRepositoryNamespaces().success((function(t){const r={};t.results.bindings.forEach((function(e){r[e.prefix.value]=e.namespace.value})),e.namespaces=r})).error((function(t){e.repositoryError=getError(t)})).finally((function(){C(!1)}))}function b(){o.addKnownPrefixes(JSON.stringify(window.editor.getValue())).success((function(e){angular.isDefined(window.editor)&&angular.isDefined(e)&&e!==window.editor.getValue()&&window.editor.setValue(e)})).error((function(e){let t=getError(e);return n.error(t,h.instant("common.add.known.prefixes.error")),!0}))}function R(t){let r=void 0;return angular.forEach(e.tabsData,(function(e){if(e.name===t.name&&e.query===t.body)return r=e.id,e})),r}function O(){if(!window.editor)return void t(()=>O());e.tabsData=[e.currentQuery];let r=e.currentQuery;null==e.currentQuery.query||""===e.currentQuery.query?window.editor.setValue(" "):window.editor.setValue(e.currentQuery.query),t((function(){e.currentTabConfig={},e.currentTabConfig.queryType=r.queryType,e.currentTabConfig.resultsCount=r.resultsCount,e.currentTabConfig.offset=r.offset,e.currentTabConfig.allResultsCount=r.allResultsCount,e.currentTabConfig.page=r.page,e.currentTabConfig.pageSize=r.pageSize,e.currentTabConfig.timeFinished=r.timeFinished,e.currentTabConfig.timeTook=r.timeTook,e.currentTabConfig.sizeDelta=r.sizeDelta,e.$apply()}),0),$("#yasr").css("padding","0")}function w(e){return $(e).attr("data-id")}e.resetCurrentTabConfig=function(){e.currentTabConfig={pageSize:100,page:1,allResultsCount:0,resultsCount:0}},e.queryExists=!1,e.resetCurrentTabConfig(),e.tabsData=e.tabs=[y],e.saveTab=function(t){const r=function(t){for(let r=0;r<e.tabsData.length;r++){if(e.tabsData[r].id===t)return r}}(t);if(void 0===r)return{};const n=e.tabsData[r];return e.saveQueryToLocal(n),n},e.loadTab=O,e.addNewTab=function(e,t,r){},e.runQuery=L,e.getNamespaces=A,e.changePagination=function(){L(!0,e.explainRequested)},e.toggleSampleQueries=function(){},e.addKnownPrefixes=b,e.getExistingTabId=R,e.querySelected=function(t){const r=R(t);e.toggleSampleQueries(),angular.isDefined(r)?S(r):e.addNewTab(null,t.name,t.body)},e.saveQueryToLocal=T,e.setLoader=C,e.getLoaderMessage=function(){const t=(Date.now()-e.queryStartTime)/1e3,r=e.getHumanReadableSeconds(t);let n;n=e.progressMessage?e.progressMessage+"... "+r:h.instant("common.running.operation",{timeHuman:r});e.extraMessage&&t>10&&(n+="\n"+e.extraMessage);return n},e.fixSizesOnHorizontalViewModeSwitch=N,e.changeViewMode=function(r){e.viewMode="none",e.orientationViewMode=!e.orientationViewMode,N(),$(".dataTables_filter").remove(),$(".resultsTable").remove(),t((function(){O(),S(r)}),100)},e.showHideEditor=I,e.focusQueryEditor=function(){angular.element(document).find(".editable-input").is(":focus")||angular.element(document).find(".CodeMirror textarea:first-child").focus()},e.orientationViewMode=!0,e.orientationViewMode||I(),e.getActiveRepository()&&A(),e.$on("$destroy",(function(){window.editor=null,window.yasr=null})),$("textarea").on("paste",(function(){t((function(){b()}),0)})),e.$watchCollection("[currentQuery.inference, currentQuery.sameAs]",(function(){e.currentQuery})),e.$on("tabAction",(function(t,r){r.relatedTarget&&e.saveTab(w(r.relatedTarget)),e.loadTab(w(r.target))})),e.$on("deleteAllexeptSelected",(function(t,r){e.tabsData=r,e.tabs=r})),e.currentQuery=_.cloneDeep(y),e.showSampleQueries=!1,e.savedQuery={},e.sampleQueries={},e.getResultsDescription=function(){},e.getUpdateDescription=function(){},e.getStaleWarningMessage=function(){}}angular.module("graphdb.framework.graphexplore.controllers.graphviz.config",["graphdb.framework.utils.notifications","graphdb.framework.utils.localstorageadapter"]).controller("GraphConfigCtrl",n),n.$inject=["$scope","$timeout","$location","toastr","$repositories","SparqlRestService","$filter","GraphConfigRestService","AutocompleteRestService","$routeParams","Notifications","RDF4JRepositoriesRestService","LocalStorageAdapter","LSKeys","$translate"]},107:function(e,t,r){"use strict";r.r(t);var n=r(318),i=r(324),o=r(316),s=r(317);r(10);function a(e,t,r,a,l,u,c,p,d,f,h,g,m){return{restrict:"AE",template:'<div id="classChart"></div>',scope:{classHierarchyData:"=",flattenedClassNames:"=",selectedClass:"=",currentSliderValue:"=",showClassInfoPanel:"=",showExternalElements:"=",hidePrefixes:"=",currentBrowserLimit:"="},link:function(c,E,v){!function(c,E){var v,x,y=d3.pack().size([780,780]),T=d3.scaleLinear().domain([0,4]).range(["hsl(19, 70%, 90%)","hsl(19, 70%, 50%)"]).interpolate(d3.interpolateHcl),C=d3.select("#classChart").insert("svg:svg","h2").attr("viewBox","0 0 800 800").attr("preserveAspectRatio","xMidYMid meet").on("dblclick.zoom",null);function N(){return C.append("svg:g").attrs({id:"main-group",transform:"translate(400,400)"})}function I(){return"true"===h.get(g.CLASS_HIERARCHY_HIDE_PREFIXES)}function S(){var e=s.a.Export.getCSSRules("css/rdf-class-hierarchy-labels.css?v=2.5.0");d3.selectAll("#main-group").append("defs"),$("defs").append('<style type="text/css"><![CDATA['+e+"]]></style>"),d3.selectAll("g").style("opacity",1);var t=s.a.Export.generateBase64ImageSource("#classChart svg");d3.select(this).attrs({href:t,download:"class-hierarchy-"+u.getActiveRepository()+".svg"})}c.hidePrefixes=I();var L,A,b=N();if(!c.classHierarchyData.classCount&&u.getActiveRepository()&&!u.isSystemRepository()){e.loader=!0,e.hierarchyError=!1;const t=h.get("classHierarchy-selectedGraph-"+u.getActiveRepository());r.getClassHierarchyData(null!==t?t.contextID.uri:"").success((function(t,r,n){e.loader=!1,207===r&&p.warning(m.instant("graphexplore.update.diagram"),m.instant("graphexplore.repository.data.changed")),c.classHierarchyData=t,d3.select("#download-svg").on("mouseover",S)})).error((function(t){e.loader=!1,e.hierarchyError=getError(t),p.error(m.instant("graphexplore.error.request.failed",{name:f,error:getError(t)}))}))}var R,O,w,P,D,k,M,F={};function G(r,s,u,p){O&&O(),w&&w(),d3.selectAll("#main-group").remove(),b=N(),i.a.SingleChild.addPlaceholders(r,!0),(x=d3.hierarchy(r)).sum((function(e){return e.size})),R=u||x,y(x);var h,g=x.descendants();R.isInFocusTransitive=!0,i.a.SingleChild.removePlaceholders(g),i.a.SingleChild.centerNodes(g),i.a.SingleChild.makePositionsRelativeToZero(g),v||(v=Object(n.a)().attr("class","d3-tip").customPosition((function(e,t){return{top:"inherit",bottom:a.innerHeight-t.clientY+"px",right:a.innerWidth-t.clientX+"px"}})).html((function(e){return e.data.name})),C.call(v));var m=b.selectAll("circle").data(g).enter().append("g");s.doFade&&m.each((function(e){o.a.Transition.fadeIn(d3.select(this),550)}));var E,I=[],S=m.append("circle").attr("class",(function(e){return e.data.role})).attr("guide-selector",(function(e){return"class-"+e.data.name})).style("fill",(function(e){return e.children?T(e.depth):"#E0D0D0"})).each((function(e){if(e.circle=d3.select(this),e.data.name!==f){var t=e.data.name;I.push({name:t}),F[[t]]=e,e.circle.classed("rdf-class",!0),e.circle.on("mouseover",(function(t){s.noPrefixes||e.textHidden?v.show(e,t):v.hide(e)})),e.circle.on("mouseout",v.hide)}})).on("gdb-focus",(e,t)=>A(t)).on("gdb-zoom",(e,t)=>q(t));function P(e){d3.selectAll(".selected").classed("selected",e.selected=!1),e.circle.classed("selected",e.selected=!0),E=e}function D(){c.showClassInfoPanel=!1}I&&(I=_.uniqBy(I,"name"),c.flattenedClassNames=I);var k=o.a.Click.delayDblClick();d3.selectAll(".parent, .topLevelParent, .child, .root").call(k),A=function(e){q(e),e.data.name===f?(D(),d3.selectAll(".selected").classed("selected",!1)):(P(e),c.selectedClass=E,c.showClassInfoPanel=!0,c.$on("sidePanelClosed",(function(t){d3.selectAll(".selected").classed("selected",e.selected=!1)})))},k.on("click",(function(e,t){t.data.id&&a.history.pushState({id:t.data.id},"classHierarchyPage"+t.data.id,"hierarchy#"+t.data.id),v.hide(),A(t)})),k.on("dblclick",(function(t,n){n!==r&&(v.hide(),P(n),e.$broadcast("goToDomainRangeGraphView",E,R),t.stopPropagation())}));var M=0;C.on("wheel",(function(e){v.hide(),e.preventDefault(),e.stopPropagation();var t=(new Date).getTime();if(t-M>100){M=t;var r="";e.deltaY<=-1?r="in":e.deltaY>=1&&(r="out");var n=e.target.__data__;if(n||(n=R),"in"===r){if(n!==R){for(;n.parent&&!n.parent.isInFocusTransitive;)n=n.parent;n.depth<R.depth&&(n=R)}if(n===R&&n.children){for(var i=n.children[0],o=1;o<n.children.length;o++)n.children[o].sortingRank>i.sortingRank&&(i=n.children[o]);i.children&&(n=i)}else n.children||(n=n.parent);q(n,!0)}else"out"===r&&(n=R.parent)&&q(n,!0);R.data.name===f&&a.history.replaceState({id:1},"classHierarchyPage1","hierarchy#1"),U()}}));var G=b.selectAll("text").data(g).enter().append("text").attr("class",(function(e){return e.children&&e.children.length?"label":"label child-label"})).each((function(e){e.textSel=d3.select(this)}));s.noPrefixes?(G.each((function(e){var t=e.data.name.indexOf(":");e.data.name.indexOf("http://")>-1?e.noPrefixName=e.data.name:t>-1&&(e.noPrefixName=e.data.name.substring(t+1))})),G.style("font-size",(function(e){return o.a.Text.calcFontSize(e.noPrefixName,e.r)})).text((function(e){return o.a.Text.getTextWithElipsisIfNeeded(e.noPrefixName,e.r/3)}))):G.style("font-size",(function(e){return o.a.Text.calcFontSize(e.data.name,e.r)})).text((function(e){return o.a.Text.getTextWithElipsisIfNeeded(e.data.name,e.r/3)})),G.style("display",(function(e){return e.parent&&e.parent.data===R.data?(e.textHidden=this.textContent.indexOf("...")+3===this.textContent.length,null):(e.textHidden=!0,"none")})),s.doFade&&!s.keepPrevState&&G.each((function(e){o.a.Transition.fadeIn(d3.select(this),550)})),L=function(){function e(e){e&&S.each((function(t){+e===t.data.id&&A(t)}))}var r=t.hash();a.onpopstate=function(t){t.state&&e(t.state.id)},e(r)};var B=b.selectAll("circle, text");function j(e,t){var r=800/e[2];h=e,B.attr("transform",(function(t){return"translate("+(t.x-e[0])*r+","+(t.y-e[1])*r+")"})),S.attr("r",(function(e){return e.r*r})),t&&G.each((function(e){e.data.fullName!==R.data.topLevelParentUri&&R.data.topLevelParentUri!==f||(e.textSel.style("display","none"),R.children&&R.children.length?_.each(R.children,(function(e){e.textSel.style("display","inline")})):R.textSel.style("display","inline"),R.parent&&_.each(R.parent.children,(function(e){e.data.name!==R.data.name&&e.textSel.style("display","inline")})))})),G.style("font-size",(function(e){return s.noPrefixes?o.a.Text.calcFontSize(e.noPrefixName,e.r*r):o.a.Text.calcFontSize(e.data.name,e.r*r)})).text((function(e){return s.noPrefixes?o.a.Text.getTextWithElipsisIfNeeded(e.noPrefixName,e.r*r/3):o.a.Text.getTextWithElipsisIfNeeded(e.data.name,e.r*r/3)}))}function V(e){var t=2*e+20;return 2*e/t<.3&&(t=2*e+2),t}function H(e){!e.isInFocusTransitive&&e.parent&&e.parent.isInFocusTransitive?(e.textHidden=this.textContent.indexOf("...")+3===this.textContent.length,this.style.display=""):(e.textHidden=!0,this.style.display="none")}function q(e,t){if(l((function(){c.showExternalElements=e.data.name===f})),R!==e&&(e.data.id&&a.history.replaceState({id:e.data.id},"classHierarchyPage"+e.data.id,"hierarchy#"+e.data.id),e.children||(e=e.parent,R!==e))){if(t&&(D(),d3.selectAll(".selected").classed("selected",!1)),R.parent)for(var r=R;r;)r.isInFocusTransitive=!1,r=r.parent;for(r=e;r;)r.isInFocusTransitive=!!r.children,r=r.parent;if(2*(R=e).r/(2*R.r+20)<.3||c.currentSliderValue>c.currentBrowserLimit)j([R.x,R.y,V(R.r)]),G.each((function(e){H.call(this,e)}));else d3.transition().duration(d).tween("zoom",(function(e){var t=d3.interpolateZoom(h,[R.x,R.y,V(R.r)]);return function(e){j(t(e))}})).selectAll("text").each(H)}}j([R.x,R.y,V(R.r)],p),O=c.$on("rootFocus",(function(){a.history.pushState({id:1},"classHierarchyPage1","hierarchy#1"),A(x)})),w=c.$on("classSearch",(function(e){A(e)}))}function U(){const t=c.classHierarchyData.classCount;let r=h.get(g.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);(!r||r>t)&&(r=t,h.set(g.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,r)),e.$broadcast("classCount",t,r)}window.addEventListener("resize",U),window.addEventListener("beforeunload",(function e(){window.removeEventListener("resize",U),window.removeEventListener("beforeunload",e)})),c.$watch("classHierarchyData",(function(){P&&P(),D&&D(),k&&k(),M&&M();var e=I();if(c.classHierarchyData.classCount){U();var t=_.cloneDeep(c.classHierarchyData);var r,n,i=function(e){return e.descendants().sort((function(e,t){return e.data.sortingRank>t.data.sortingRank?-1:e.data.sortingRank<t.data.sortingRank||e.data.depth>t.data.depth?1:e.data.depth<t.data.depth?-1:0}))}(d3.hierarchy(t));function o(e,t){const i={keepPrevState:!0,noPrefixes:I()};n=i.noPrefixes,G(r||e,i,R,!0),l((function(){h.set(g.CLASS_HIERARCHY_SWITCH_PREFIXES,t),L()}),70)}function s(e,i,s){if(!e)return;h.set(g.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,e),r={name:f,children:[]};const a=new Set;for(let t=1;t<=e;t++)a.add(i[t].data.id),i[t].parent===i[0]&&r.children.push(i[t].data);if(function e(t){if(!t.children)return;const r=[];for(const e of t.children)a.has(e.id)&&r.push($.extend({},e));t.children=r;for(const r of t.children)e(r)}(r),s){n=angular.isUndefined(n)?I():n;G(r,{noPrefixes:n})}else o(t)}var a,u=h.get(g.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);if(u)s(u,i);else{var p={doFade:!0,keepPrevState:!0,noPrefixes:I()};G(t,p),L()}P=c.$watch("hidePrefixes",(function(r){angular.isUndefined(r)||e?e=void 0:l((function(){!function(e){angular.isUndefined(e)||h.set(g.CLASS_HIERARCHY_HIDE_PREFIXES,e)}(r),o(t,!0)}),50)}),!0),D=c.$watch("currentSliderValue",(function(e){s(e,i,!0)}),!0),M=c.$on("onEnterKeypressSearchAction",(function(e){a&&A(a)})),k=c.$on("searchedClass",(function(e,t){(a=F[t.name])&&A(a)}))}}),!0)}(c)}}}angular.module("graphdb.framework.graphexplore.directives.class",["graphdb.framework.graphexplore.controllers.class","graphdb.framework.utils.localstorageadapter"]).constant("ZOOM_DURATION",500).constant("ROOT_OBJ_NAME","RDF Class Hierarchy").directive("rdfClassHierarchy",a),a.$inject=["$rootScope","$location","GraphDataRestService","$window","$timeout","$repositories","$licenseService","toastr","ZOOM_DURATION","ROOT_OBJ_NAME","LocalStorageAdapter","LSKeys","$translate"]},108:function(e,t,r){"use strict";r.r(t);var n=r(317),i=r(316);r(10);function o(e,t,r,o,s,a,l,u,c,p,d,f,h){return{restrict:"AE",template:'<div id="domain-range"></div>',scope:{showPredicatesInfoPanel:"=",selectedPredicate:"=",collapseEdges:"="},link:function(p){const d=u((function(){!function(p){var d=d3.select("#domain-range").append("svg").attr("viewBox","0 0 1200 600").attr("preserveAspectRatio","xMidYMid meet").on("dblclick.zoom",null),g=d3.forceSimulation(),m=d3.drag().subject((function(e){return e})).on("start",(function(e,t){g.stop(),t.fx=e.x,t.fy=e.y,d3.select(this).classed("selected",!0)})).on("end",(function(e,t){t.fx=null,t.fy=null,d3.select(this).classed("selected",!1),T?(g.alpha(.2).restart(),T=!1):g.restart()})).on("drag",(function(e,t){T=!0,g.alphaTarget(0).restart(),t.fx=e.x,t.fy=e.y})),E=d.append("defs");E.append("marker").attrs({id:"arrow",viewBox:"0 -5 10 10",refX:10,refY:0,markerUnits:"strokeWidth",markerWidth:5,markerHeight:5,orient:"auto",fill:f}).append("path").attrs({d:"M0,-5L10,0L0,5",class:"arrowHead"}),E.append("marker").attrs({id:"collapsed-arrow",viewBox:"0 -5 10 10",refX:9,refY:0,markerUnits:"strokeWidth",markerWidth:4,markerHeight:4,orient:"auto",fill:f}).append("path").attrs({d:"M0,-5L10,0L0,5",class:"arrowHead"}),E.append("marker").attrs({id:"arrow-loop",viewBox:"0 -5 10 10",refX:7,refY:0,markerUnits:"strokeWidth",markerWidth:5,markerHeight:5,orient:"auto",fill:f}).append("path").attrs({d:"M0,-5L10,0L0,5",class:"arrowHead"}),d3.select("#download-svg").on("mouseover",(function(){var e=n.a.Export.getCSSRules("css/domain-range-graph.css?v=2.5.0");$("defs").append('<style type="text/css"><![CDATA['+e+"]]></style>");var t=n.a.Export.generateBase64ImageSource("#domain-range svg");d3.select(this).attrs({href:t,download:"domain-range-graph-"+r.getActiveRepository()+".svg"})})),function(){var e=d3.select(".legend-container").append("svg").attr("viewBox","0 0 "+1200/7+" "+1200/7*1.2).attr("preserveAspectRatio","xMidYMid meet");e.append("rect").attrs({width:1200/7,height:1200/7*1.2}).style("fill","rgba(235, 235, 235, 0.9)");var t=16+1200/18/2.5,r=t+1200/90;e.append("circle").attrs({class:"legend-class-node",cx:(16+t)/2,cy:30,r:1200/18/4.5}),e.append("text").attrs({x:r,y:30+1200/370}).style("font-size",1200/90/1.1+"px").text("main class node"),e.append("circle").attrs({class:"legend-object-node",cx:(16+t)/2,cy:70,r:1200/110/1.25}),e.append("text").attrs({x:r,y:30+1200/370+40}).style("font-size",1200/90/1.1+"px").text("class node"),e.append("circle").attrs({class:"legend-datatype-node",cx:(16+t)/2,cy:70+1200/45,r:1200/110/2}),e.append("text").attrs({x:r,y:99.90990990990991}).style("font-size",1200/90/1.1+"px").text("datatype node"),e.append("line").attrs({class:"property-arrow",x1:16,y1:123.33333333333334,x2:t,y2:123.33333333333334}).style("stroke-width",1.2).attr("marker-end","url("+s.absUrl()+"#arrow)"),e.append("text").attrs({x:r,y:126.57657657657658}).style("font-size",1200/90/1.1+"px").text("explicit property"),e.append("line").attrs({class:"implicit-property-arrow",x1:16,y1:150,x2:t,y2:150}).style("stroke-width",1.2).attr("marker-end","url("+s.absUrl()+"#arrow)"),e.append("text").attrs({x:r,y:150+1200/370}).style("font-size",1200/90/1.1+"px").text("implicit property"),e.append("line").attrs({class:"collapsed-property-arrow",x1:16,y1:150+1200/45,x2:t,y2:150+1200/45}).style("stroke-width",2).attr("marker-end","url("+s.absUrl()+"#collapsed-arrow)"),e.append("text").attrs({x:r,y:179.9099099099099}).style("font-size",1200/90/1.1+"px").text("collapsed property")}();var v=s.search().uri,x=s.search().name;const y=s.search().collapsed;(function(e,t){o.getDomainRangeData(e,t).success((function(e,t,r){p.domainRangeGraphData=e})).error((function(e){c.error("Request for "+x+" failed!")}))})(v,y),$(window).on("popstate",(function(){a.set(l.DOMAIN_RANGE_WENT_BACK,!0)})),t.onpopstate=function(t){t.state&&e.$broadcast("changeCollapsedEdgesState",t.state.collapsed)},p.$watch("collapseEdges",(function(){angular.isUndefined(p.collapseEdges)||(a.set(l.DOMAIN_RANGE_COLLAPSE_EDGES,p.collapseEdges),"true"!==a.get(l.DOMAIN_RANGE_WENT_BACK)&&function(t){e.$broadcast("switchEdgeMode",{uri:v,name:x,collapsed:t})}(p.collapseEdges),a.remove(l.DOMAIN_RANGE_WENT_BACK))})),p.$watch("domainRangeGraphData",(function(){if(p.domainRangeGraphData){var r=_.cloneDeep(p.domainRangeGraphData);const P=r.nodes,D=r.links;g.nodes(P).force("x",d3.forceX(600)).force("y",d3.forceY(300)).force("charge",d3.forceManyBody().strength(-800)).force("link",d3.forceLink(D).distance(1200/3.5));var n=d.selectAll(".link").data(D).enter().append("g");function o(e){e.style("stroke",f),e.style("stroke-width",2),e.attr("marker-end","url("+s.absUrl()+"#collapsed-arrow)")}var a,l,c=0;n.each((function(e){if(e.objectPropNodeClassUri!==v)a=n.append("line").attrs({class:"link","marker-end":"url("+s.absUrl()+"#arrow)"}).style("stroke-width",1.2).each((function(e){switch(e.propertyType){case"objectLeft":e.targetRadius=1200/18;break;case"objectRight":e.targetRadius=1200/110;break;case"datatype":e.targetRadius=1200/110/2;break;default:e.targetRadius=0}var t=d3.select(this);e.targetNodeEdgeCount>1?o(t):e.implicit&&t.style("stroke-dasharray","3, 3")}));else{if(angular.isUndefined(l)){l=d3.select(this).append("path").attrs({d:"M 0 0 A "+1200/18/2+" "+1200/18/2+" 0 1 1 0 "+1200/18/2,class:"loop-link",fill:"none","marker-end":"url("+s.absUrl()+"#arrow-loop)"}).style("stroke-width",1.2)}(c+=e.targetNodeEdgeCount)>1&&o(d3.select(".loop-link"))}}));var E={};function y(){$.isEmptyObject(E)||(E.text.style("fill","black"),E.background.style("fill","#f0f0f0"))}function T(e,t){y(),E.text=d3.select(this),E.background=d3.select(this.previousSibling),E.text.style("fill","white"),E.background.style("fill",f),u((function(){p.showPredicatesInfoPanel=!0,p.selectedPredicate=t})),e.stopPropagation()}$("document").ready((function(){$("#domain-range").bind("click",y)}));var C=n.append("text").attr("class",(function(e){return e.objectPropNodeClassUri===v?"loop-link-property-name":"property-name"})).attr("dx",(function(e){return 1200/18/2*("objectLeft"===e.propertyType?1:-1)})).style("text-anchor",(function(e){return"objectLeft"===e.propertyType?"end":"start"})).style("font-size",1200/90).text((function(e){return e.targetNodeEdgeCount>1?e.targetNodeEdgeCount+" predicates":e.name}));C.each((function(e){var r=d3.select(this);/\d\spredicates/.test(r.text())?r.style("font-weight","bold").on("click",T):r.on("click",(function(e,r){t.open("resource?uri="+encodeURIComponent(r.uri),"_blank")}))}));var N=n.append("rect").attr("class",(function(e){return e.objectPropNodeClassUri!==v?"link-background":"loop-link-background"})).attr("width",(function(e){return e.calculatedWidth=this.previousSibling.getBBox().width,e.calculatedWidth+4})).attr("height",(function(e){return e.calculatedHeight=this.previousSibling.getBBox().height,e.calculatedHeight+2})).attr("transform",(function(e){var t=2-1200/18/2*("objectLeft"===e.propertyType?1:-1);return"objectLeft"===e.propertyType&&(t+=e.calculatedWidth),"translate(-"+t+",-"+(2+e.calculatedHeight/2)+")"})).on("click",(function(e){e.stopPropagation()})),I=d.selectAll(".node").data(P).enter().append("g"),S=I.filter((function(e){return e.objectPropClassUri!==v})).append("circle").each((function(e){var t=d3.select(this);"main"===e.classPosition?t.attrs({class:"class-node",r:1200/18}).attr("marker-end","url("+s.absUrl()+"#loop-link)"):null===e.objectPropClassName?t.attrs({class:"datatype-node",r:1200/110/2}):t.attrs({class:"object-prop-node",r:1200/110})})).call(m);d3.selectAll(".object-prop-node").on("dblclick",(function(t,r,n){p.$apply((function(){e.$broadcast("reloadDomainRangeGraphView",r,n)}))})),I.filter((function(e){return e.objectPropClassName&&e.objectPropClassUri!==v})).append("text").attr("class",(function(e){return e.classPosition+"-class-label"})).style("font-size",1200/90).text((function(e){return e.objectPropClassName})).on("click",(function(e,r){t.open("resource?uri="+encodeURIComponent(r.objectPropClassUri),"_blank")}));var L=I.select("text");d.select(".class-node").each((function(){d3.select(this.parentNode).append("text").attr("class","rdf-class-label").style("font-size",(function(e){return i.a.Text.calcFontSize(x,1200/18)})).text(x).on("click",(function(){t.open("resource?uri="+encodeURIComponent(v),"_blank")}))}));var A=d.select(".class-node + text"),b=d3.select(".class-node"),R=d3.selectAll(".loop-link-background"),O=d3.selectAll(".loop-link-property-name");if(C=d3.selectAll(".property-name"),!angular.isUndefined(l)){var w=[];R.each((function(e,t){d3.select(this);w.push({idx:t,width:e.calculatedWidth,height:e.calculatedHeight})}))}g.on("tick",(function(e){var t=8*g.alpha();function r(e){var t=e.x+1200/18*2,r=e.y-1200/18/1.9;var n=[];R.each((function(i,o){n.push(i),o<h?function(n,i){var o=$.grep(w,(function(e){return e.idx==i}));i>0&&(t+=parseFloat(i*(o[0].height/(i/1.4)))),n.attrs({transform:"rotate(270, "+e.x+","+e.y+") translate("+t+","+r+")",width:o[0].height,height:o[0].width})}(d3.select(this),o):d3.select(this).remove()})),function(e){var t;d3.select(".view-more-preds-label").style("font-weight","bold").each((function(r){r.target.allEdges=e,t=this.getComputedTextLength()})).on("click",T),d3.select(".view-more-preds-rect").attr("height",t+4)}(n)}a.filter((function(e){return e.objectPropNodeClassUri!==v})).attr("x1",(function(e){return e.source.x})).attr("y1",(function(e){return e.source.y})).attr("x2",(function(e){return e.targetX})).attr("y2",(function(e){return e.targetY})).each((function(e){!function(e){"objectLeft"===e.propertyType?(e.source.x-=8*t,e.source.y-=t/9):(e.target.x+=8*t,e.target.y-=t/9)}(e);var r=Math.atan2(e.target.y-e.source.y,e.target.x-e.source.x);e.targetX=e.target.x-Math.cos(r)*e.targetRadius,e.targetY=e.target.y-Math.sin(r)*e.targetRadius})),S.each((function(e){"main"!==e.classPosition||angular.isUndefined(l)||(!function(e){var t=e.x+64,r=e.y-1200/18/5.7-5;l.attr("transform","rotate(270, "+e.x+","+e.y+") translate("+t+","+r+")")}(e),function(e){function t(t,r){var n=$.grep(w,(function(e){return e.idx==r})),i=0;r>0&&(i=parseFloat(2*r*(n[0].height/1.4)));var o=e.x,s=e.y-1200/18*2.1-i;t.attrs({x:o,y:s}).moveToFront()}O.each((function(e,r){var n=d3.select(this),i=O.size()-h;i<0?t(n,r):(0==r&&!p.collapseEdges&&i>1&&(!function(e,t,r){e.classed("view-more-preds-label",!0).text(r+" predicates more ..."),null!==this.nextSibling&&t.classed("view-more-preds-rect",!0)}(n,d3.select(this.nextSibling),i),t(n,r)),r<h?t(n,r):n.remove())}))}(e),r(e)),e.objectPropClassUri!==v&&d3.select(this).attr("cx",(function(e){return"main"===e.classPosition?function(e){!window.ActiveXObject&&"ActiveXObject"in window&&(Math.log10=function(e){return Math.log(e)/Math.LN10});var t=b.attr("cx")-600,r=.5*Math.log10(Math.abs(t));return e.x+=t>0?-r:r,e.x}(e):e.x})).attr("cy",(function(e){return e.y}))})),A.attr("x",(function(e){return e.x})).attr("y",(function(e){return e.y})).moveToFront(),N.filter((function(e){return e.objectPropNodeClassUri!==v})).attr("x",(function(e){return e.target.x>e.source.x?e.source.x+(e.target.x-e.source.x)/2:e.target.x+(e.source.x-e.target.x)/2})).attr("y",(function(e){return e.target.y>e.source.y?e.source.y+(e.target.y-e.source.y)/2:e.target.y+(e.source.y-e.target.y)/2})).moveToFront(),C.attr("x",(function(e){return e.target.x>e.source.x?e.source.x+(e.target.x-e.source.x)/2:e.target.x+(e.source.x-e.target.x)/2})).attr("y",(function(e){return e.target.y>e.source.y?e.source.y+(e.target.y-e.source.y)/2:e.target.y+(e.source.y-e.target.y)/2})).moveToFront(),L.attr("x",(function(e){return"right"===e.classPosition?e.x+1200/110*1.2:e.x-1200/110*1.2})).attr("y",(function(e){return e.y})).moveToFront()}))}}));let T=!1}(p)}),50);p.$on("$destroy",(function(){u.cancel(d)}))}}}angular.module("graphdb.framework.graphexplore.directives.domainrange",["graphdb.framework.graphexplore.controllers.domainrange","graphdb.framework.utils.localstorageadapter"]).constant("ONTO_RED","var(--primary-color)").constant("ONTO_GREEN","var(--tertiary-color)").constant("ONTO_BLUE","var(--secondary-color)").constant("NON_COLLAPSED_REFLEXIVE_LINK_LIMIT",6).directive("domainRangeGraph",o),o.$inject=["$rootScope","$window","$repositories","GraphDataRestService","$location","LocalStorageAdapter","LSKeys","$timeout","toastr","ONTO_RED","ONTO_GREEN","ONTO_BLUE","NON_COLLAPSED_REFLEXIVE_LINK_LIMIT"]},109:function(e,t){function r(e,t){return{restrict:"A",scope:{},templateUrl:"js/angular/graphexplore/templates/systemRepoWarningTemplate.html",link:function(r){r.isSystemRepository=function(){return"SYSTEM"===e.getActiveRepository()},r.hasPermission=function(){return t.hasPermission()}}}}angular.module("graphdb.framework.graphexplore.directives.sysrepo",["graphdb.framework.graphexplore.controllers.class"]).directive("systemRepoWarning",r),r.$inject=["$repositories","$rootScope"]},110:function(e,t){function r(e){return{restrict:"AE",scope:{rdfsLabel:"=",rdfsComment:"=",expanded:"=",alwaysExpanded:"="},templateUrl:"js/angular/graphexplore/templates/rdfsCommentLabelTemplate.html",link:function(t,r){t.stringLimit=e,t.scrollToTop=function(){r[0].getElementsByClassName("rdfs-comment")[0].scrollTop=0},t.checkCommentLength=function(){return r[0].getElementsByClassName("rdfs-comment-text")[0].innerText.length<e},t.equalHeights=function(){const e=r[0].getElementsByClassName("rdfs-comment-text")[0].innerHeight;e<250&&t.expanded&&(r[0].getElementsByClassName("rdfs-comment")[0].innerHeight=e)},t.toggleFullComment=function(){t.expanded=!t.expanded},t.$watch("expanded || alwaysExpanded",(function(r){t.stringLimit=r?t.rdfsComment.length:e}))}}}angular.module("graphdb.framework.graphexplore.directives.rdfsdetails",[]).directive("rdfsCommentLabel",r).constant("SHORT_COMMENT_LENGTH",100),r.$inject=["SHORT_COMMENT_LENGTH"]},111:function(e,t,r){"use strict";r.r(t);var n=r(317);r(72);function i(e,t){return{restrict:"A",template:'<div id="dependencies-chord"></div>',scope:{dependenciesData:"="},link:function(r){r.$watch("dependenciesData",(function(){if(r.dependenciesData){const i=r.dependenciesData;!function(i,o){if(function(){let e=!0;for(const t of i){if(t.some(e=>0!==e)){e=!1;break}}return e}())return;const s=d3.scaleOrdinal(d3.schemeCategory10),a=d3.select("body").append("div").attr("class","tooltip").style("opacity",0);d3.select("body").on("click",(function(){a.style("opacity",0)}));const l=Math.min(800,800)/2.8,u=l-24,c=d3.arc().innerRadius(u).outerRadius(l),p=d3.chord().padAngle(.04).sortSubgroups(d3.descending).sortChords(d3.ascending),d=d3.ribbon().radius(u),f=d3.select("#dependencies-chord").append("svg").attr("viewBox","0 0 800 800").attr("preserveAspectRatio","xMidYMid meet").style("font","10px sans-serif").append("g").attr("id","circle").attr("transform","translate(400,400)");f.append("circle").attr("r",l).style("fill","none");const h=p(i),g=f.selectAll(".group").data(h.groups).enter().append("g").attr("class","group").on("mouseover",(function(){const e=g.nodes().indexOf(this);m.classed("fade",(function(t){return t.source.index!==e&&t.target.index!==e}))}));g.append("title").text((function(e,t){return o[t]})),g.append("path").attr("id",(function(e,t){return"group"+t})).attr("d",c).style("fill",(function(e,t){return s(t)})),g.append("text").each((function(e){e.angle=(e.startAngle+e.endAngle)/2})).attr("dy",".35em").attr("transform",(function(e){return"rotate("+(180*e.angle/Math.PI-90)+")translate("+(u+26)+")"+(e.angle>Math.PI?"rotate(180)":"")})).style("text-anchor",(function(e){return e.angle>Math.PI?"end":null})).text((function(e){return o[e.index]}));const m=f.selectAll(".chord").data(h).enter().append("path").attr("class","chord").style("fill",(function(e){return s(e.target.index)})).style("fill-opacity",".67").style("stroke","#000").style("stroke-width",".25px").style("cursor","pointer").attr("d",d);m.on("mouseover",(function(){d3.select(this).style("fill-opacity","1")})),m.on("mouseout",(function(){d3.select(this).style("fill-opacity",".67")})),m.on("click",(function(e,n){const i=o[n.source.index],s=o[n.target.index],l=e.pageX,u=e.pageY;t.getPredicates(i,s,r.selectedGraph&&r.selectedGraph.contextID.uri).success((function(e){let t="<div class='dependencies-tooltip'>"+("<div class='row'>"+i+" <i class='fa fa-exchange'></i> "+s+"</div>")+_.map(e.slice(0,10),(function(e){const t=" <i class='fa fa-long-arrow-"+("out"===e.direction?"right":"left")+"'></i>";return"<div class='row'>"+e.predicate+" : "+e.weight+t+" </div>"})).join("");e.length>10?t=t+"<div class='pull-right'>And "+(e.length-10).toString()+" more...</div></div>":t+="</div>",a.html(t).style("left",l+"px").style("top",u+"px")})),a.transition().duration(200).style("opacity",1)})),d3.select("#circle").on("mouseleave",(function(){f.selectAll(".chord").classed("fade",!1)})),d3.select("#download-svg").on("mouseover",(function(){const t=n.a.Export.generateBase64ImageSource(".dependencies-chord svg");d3.select(this).attrs({href:t,download:"dependencies-"+e.getActiveRepository()+".svg"})}))}(i.matrix,i.nodes,i.direction)}}))}}}angular.module("graphdb.framework.graphexplore.directives.dependencies",["graphdb.framework.graphexplore.controllers.dependencies","graphdb.framework.rest.graphexplore.data.service"]).directive("dependenciesChord",i),i.$inject=["$repositories","GraphDataRestService"]},112:function(e,t){function r(){return{restrict:"AE",scope:{filterQueryObj:"=",filterFunction:"&",listItemsObj:"=",listItemsNotFiltered:"=",searchPlaceholder:"@"},templateUrl:"js/angular/graphexplore/templates/listItemsSearchFilterTemplate.html",link:function(e){e.filterFunction=e.filterFunction(),e.$watch("filterQueryObj.query",(function(){var t,r,n,i;e.listItemsObj.items=(t=e.filterQueryObj.query,r=e.listItemsObj.items,n=e.listItemsNotFiltered,i=e.filterFunction,t.length>0?_.filter(n,i):r.length!==n.length?n:r)}))}}}angular.module("graphdb.framework.graphexplore.directives.searchfilter",[]).directive("listItemsSearchFilter",r),r.$inject=[]},113:function(e,t){function r(e,t){return{restrict:"AE",scope:{searchData:"=",searchFields:"@",titleField:"@",searchPlaceholder:"@",initialValue:"=",searchedObjCallback:"&"},templateUrl:"js/angular/graphexplore/templates/searchIconInputTemplate.html",link:function(r,n){r.searchedObjCallback=r.searchedObjCallback(),r.performSearchActionOnEnter=function(){e.$broadcast("onEnterKeypressSearchAction")},r.showInput=function(){$("#selectGraphDropdown").hide(),n.find("#search_input #search_input_value")[0].value="",n.find(".search-icon").addClass("animated bounceOut").css("z-index","-1"),n.find("#search_input .angucomplete-holder").css("display","block"),t((function(){n.find("#search_input .angucomplete-holder").css("width","250px").css("left","-215px"),t((function(){n.find(".close-icon").css("display","block").addClass("animated bounceIn").css("z-index","3"),n.find("#search_input #search_input_value").focus()}),200)}),1)},r.hideInput=function(){n.find("#search_input #search_input_value")[0].value="",n.find("#search_input .angucomplete-holder").css("width","0px").css("left","35px"),t((function(){n.find("#search_input .angucomplete-holder").css("display","none"),$("#selectGraphDropdown").show()}),250),n.find(".close-icon").addClass("animated bounceOut").removeClass("bounceOut").css("z-index","-1").css("display","none").click((function(){$(".tooltip").hide()})),t((function(){n.find(".search-icon").css("display","inline-block").removeClass("bounceOut").addClass("bounceIn").css("z-index","3")}),200)}}}}angular.module("graphdb.framework.graphexplore.directives.searchcontrols",[]).directive("searchIconInput",r),r.$inject=["$rootScope","$timeout"]},162:function(e,t,r){"use strict";r.r(t);r(7),r(29),r(23),r(22),r(337),r(338),r(309),r(318),r(327),r(339),r(340),r(322),r(316),r(324),r(317),r(72),r(98),r(99),r(100),r(101),r(102),r(103),r(104),r(105),r(106),r(107),r(108),r(109),r(110),r(111),r(112),r(113),r(61),r(71);angular.module("graphdb.framework.graphexplore",["graphdb.framework.core.controllers","graphdb.framework.core.directives","graphdb.framework.rest.graphexplore.data.service","graphdb.framework.graphexplore.services.uiscroll","graphdb.framework.graphexplore.services.rdfsdetails","graphdb.framework.rest.graphexplore.savedgraphs.service","graphdb.framework.rest.graphconfig.service","graphdb.framework.graphexplore.controllers.class","graphdb.framework.graphexplore.controllers.domainrange","graphdb.framework.graphexplore.controllers.dependencies","graphdb.framework.graphexplore.controllers.graphviz","graphdb.framework.graphexplore.controllers.graphviz.config","graphdb.framework.graphexplore.directives.sysrepo","graphdb.framework.graphexplore.directives.rdfsdetails","graphdb.framework.graphexplore.directives.searchfilter","graphdb.framework.graphexplore.directives.class","graphdb.framework.graphexplore.directives.domainrange","graphdb.framework.graphexplore.directives.dependencies","graphdb.framework.graphexplore.directives.searchcontrols","graphdb.framework.core.directives.queryeditor.controllers","graphdb.framework.core.directives.queryeditor.queryeditor"])},309:function(e,t,r){var n,i;n=[r(313)],void 0===(i=function(){function e(e,t){return e.each((function(){var e=t.apply(this,arguments),r=select(this);for(var n in e)r.attr(n,e[n])}))}function t(e,t){for(var r in t)e.attr(r,t[r]);return e}return"undefined"==typeof d3&&(d3=r(313)),d3.selection.prototype.attrs=function(r){return("function"==typeof r?e:t)(this,r)},d3.selection.prototype.moveToFront=function(){return this.each((function(){d3.select(this.parentNode.appendChild(this))}))},d3.selection.prototype.moveToBack=function(){return this.each((function(){const e=this.parentNode.firstChild;e&&this.parentNode.insertBefore(this,e)}))},d3}.apply(t,n))||(e.exports=i)},316:function(e,t,r){"use strict";r(309);var n=n||{};n.Text=function(){function e(e,t,r,n){r=r||10;var i=t/3;return"string"==typeof e?(i*=10/(e.substring(0,t/3).length+1.5),i+=1,e.match(/[\u0900-\u0DFF\u1100-\u11FF\u2E80-\u2EFF\u3000-\u9FFF]/)&&(i*=.6),i<r&&(i=r),Math.round(i)):(i<r&&(i=r),Math.round(i))}return{calcFontSizeRaw:e,calcFontSize:function(t,r,n,i){return e(t,r,n)+"px"},getTextWithElipsisIfNeeded:function(e,t){return"string"==typeof e&&e.length>t?e.substring(0,t-3)+"...":e}}}(),n.Transition={fadeIn:function(e,t){e.style("opacity",0).transition().duration(t).style("opacity",1)},fadeOut:function(e,t){e.style("opacity",1).transition().duration(t).style("opacity",0)}},n.Click=function(){const e=function(e,r){let n,i=1,o=arguments.length;for(;++i<o;)n=arguments[i],e[n]=t(e,r,r[n]);return e};function t(e,t,r){return function(){var n=r.apply(t,arguments);return n===t?e:n}}return{delayDblClick:function(){var t=d3.dispatch("click","dblclick");return e((function(e){var r,n=null;e.on("mousedown",(function(){r=d3.pointer(document.body),+new Date})),e.on("mouseup",(function(e,i){var o,s,a;(s=r,a=d3.pointer(document.body),Math.sqrt(Math.pow(s[0]-a[0],2),Math.pow(s[1]-a[1],2))>5)||(n?(window.clearTimeout(n),n=null,t.call("dblclick",e,e,i)):n=window.setTimeout((o=e,function(){t.call("click",o,o,i),n=null}),250))}))}),t,"on")}}}(),t.a=n},317:function(e,t,r){"use strict";r(309);var n=n||{};n.Export={getCSSRules:function(e){const t=$('link[href="'+e+'"]')[0].sheet.rules;let r="";return _.each(t,(function(e){r+=e.cssText})),r},generateBase64ImageSource:function(e){e||(e="svg");const t=d3.selectAll(e).attr("version","1.1").attr("xmlns","http://www.w3.org/2000/svg").node().parentNode.innerHTML;return"data:image/svg+xml;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(t)))}},t.a=n},318:function(e,t,r){"use strict";t.a=function(){var e=function(){return"n"},t=function(){return[0,0]},r=function(){return" "},n=p(),i=null,o=null,s=null,a=null;function l(e){var t;i="svg"===(t=(t=e).node()).tagName.toLowerCase()?t:t.ownerSVGElement,o=i.createSVGPoint(),document.body.appendChild(n)}l.show=function(){var n=Array.prototype.slice.call(arguments);n[n.length-1]instanceof SVGElement&&(s=n.pop());var i,o=r.apply(this,n),p=t.apply(this,n),f=e.apply(this,n),h=d(),g=c.length,m=document.documentElement.scrollTop||document.body.scrollTop,E=document.documentElement.scrollLeft||document.body.scrollLeft,v=a.apply(this,n);for(h.html(o).style("opacity",1).style("pointer-events","all");g--;)h.classed(c[g],!1);const x=n.filter(e=>e instanceof Event);return i=u.get(f).apply(this,x),v?Object.keys(v).forEach((function(e){h.style(e,v[e])})):h.classed(f,!0).style("top",i.top+p[0]+m+"px").style("left",i.left+p[1]+E+"px"),l},l.hide=function(){return d().style("opacity",0).style("pointer-events","none"),l},l.attr=function(e,t){if(arguments.length<2&&"string"==typeof e)return d().attr(e);var r=Array.prototype.slice.call(arguments);return d3.selection.prototype.attr.apply(d(),r),l},l.style=function(e,t){if(arguments.length<2&&"string"==typeof e)return d().style(e);var r=Array.prototype.slice.call(arguments);return d3.selection.prototype.style.apply(d(),r),l},l.direction=function(t){return arguments.length?(e=null==t?t:h(t),l):e},l.offset=function(e){return arguments.length?(t=null==e?e:h(e),l):t},l.html=function(e){return arguments.length?(r=null==e?e:h(e),l):r},l.customPosition=function(e){return arguments.length?(a=null==e?e:h(e),l):a},l.destroy=function(){return n&&(d().remove(),n=null),l};var u=new Map(Object.entries({n:function(e){var t=f(e);return{top:t.n.y-n.offsetHeight,left:t.n.x-n.offsetWidth/2}},s:function(e){var t=f(e);return{top:t.s.y,left:t.s.x-n.offsetWidth/2}},e:function(e){var t=f(e);return{top:t.e.y-n.offsetHeight/2,left:t.e.x}},w:function(e){var t=f(e);return{top:t.w.y-n.offsetHeight/2,left:t.w.x-n.offsetWidth}},nw:function(e){var t=f(e);return{top:t.nw.y-n.offsetHeight,left:t.nw.x-n.offsetWidth}},ne:function(e){var t=f(e);return{top:t.ne.y-n.offsetHeight,left:t.ne.x}},sw:function(e){var t=f(e);return{top:t.sw.y,left:t.sw.x-n.offsetWidth}},se:function(e){var t=f(e);return{top:t.se.y,left:t.e.x}}})),c=u.keys();function p(){var e=d3.select(document.createElement("div"));return e.style("position","absolute").style("top",0).style("opacity",0).style("pointer-events","none").style("box-sizing","border-box"),e.node()}function d(){return null===n&&(n=p(),document.body.appendChild(n)),d3.select(n)}function f(e){for(var t=s||e.target;void 0===t.getScreenCTM&&"undefined"===t.parentNode;)t=t.parentNode;var r={},n=t.getScreenCTM(),i=t.getBBox(),a=i.width,l=i.height,u=i.x,c=i.y;return o.x=u,o.y=c,r.nw=o.matrixTransform(n),o.x+=a,r.ne=o.matrixTransform(n),o.y+=l,r.se=o.matrixTransform(n),o.x-=a,r.sw=o.matrixTransform(n),o.y-=l/2,r.w=o.matrixTransform(n),o.x+=a,r.e=o.matrixTransform(n),o.x-=a/2,o.y-=l/2,r.n=o.matrixTransform(n),o.y+=l,r.s=o.matrixTransform(n),r}function h(e){return"function"==typeof e?e:function(){return e}}return l}},319:function(e,t,r){var n,i=i||function(e){"use strict";if("undefined"==typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var t=e.document,r=function(){return e.URL||e.webkitURL||e},n=t.createElementNS("http://www.w3.org/1999/xhtml","a"),i=e.webkitRequestFileSystem,o=e.requestFileSystem||i||e.mozRequestFileSystem,s=function(t){(e.setImmediate||e.setTimeout)((function(){throw t}),0)},a=0,l=function(t){var n=function(){"string"==typeof t?r().revokeObjectURL(t):t.remove()};e.chrome?n():setTimeout(n,500)},u=function(e,t,r){for(var n=(t=[].concat(t)).length;n--;){var i=e["on"+t[n]];if("function"==typeof i)try{i.call(e,r||e)}catch(e){s(e)}}},c=function(e){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e},p=function(t,s){t=c(t);var p,d,f,h=this,g=t.type,m=!1,E=function(){u(h,"writestart progress write writeend".split(" "))},v=function(){(!m&&p||(p=r().createObjectURL(t)),d)?d.location.href=p:null==e.open(p,"_blank")&&"undefined"!=typeof safari&&(e.location.href=p);h.readyState=h.DONE,E(),l(p)},x=function(e){return function(){if(h.readyState!==h.DONE)return e.apply(this,arguments)}},y={create:!0,exclusive:!1};if(h.readyState=h.INIT,s||(s="download"),n)return p=r().createObjectURL(t),n.href=p,n.download=s,void setTimeout((function(){var e,t;e=n,t=new MouseEvent("click"),e.dispatchEvent(t),E(),l(p),h.readyState=h.DONE}));e.chrome&&g&&"application/octet-stream"!==g&&(f=t.slice||t.webkitSlice,t=f.call(t,0,t.size,"application/octet-stream"),m=!0),i&&"download"!==s&&(s+=".download"),("application/octet-stream"===g||i)&&(d=e),o?(a+=t.size,o(e.TEMPORARY,a,x((function(e){e.root.getDirectory("saved",y,x((function(e){var r=function(){e.getFile(s,y,x((function(e){e.createWriter(x((function(r){r.onwriteend=function(t){d.location.href=e.toURL(),h.readyState=h.DONE,u(h,"writeend",t),l(e)},r.onerror=function(){var e=r.error;e.code!==e.ABORT_ERR&&v()},"writestart progress write abort".split(" ").forEach((function(e){r["on"+e]=h["on"+e]})),r.write(t),h.abort=function(){r.abort(),h.readyState=h.DONE},h.readyState=h.WRITING})),v)})),v)};e.getFile(s,{create:!1},x((function(e){e.remove(),r()})),x((function(e){e.code===e.NOT_FOUND_ERR?r():v()})))})),v)})),v)):v()},d=p.prototype;return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(e,t){return navigator.msSaveOrOpenBlob(c(e),t)}:(d.abort=function(){this.readyState=this.DONE,u(this,"abort")},d.readyState=d.INIT=0,d.WRITING=1,d.DONE=2,d.error=d.onwritestart=d.onprogress=d.onwrite=d.onabort=d.onerror=d.onwriteend=null,function(e,t){return new p(e,t)})}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content);
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[14,3,11,21,24,30,31,49,50,83,92,93,94,95,96,97,98,100,101,138,143,144,145,149,163],{100:function(e,t){angular.module("graphdb.framework.rest.graphexplore.savedgraphs.service",[]).factory("SavedGraphsRestService",r),r.$inject=["$http"];function r(e){return{getSavedGraphs:function(){return e.get("rest/explore-graph/saved")},getSavedGraph:function(t){return e.get("rest/explore-graph/saved/"+encodeURIComponent(t))},editSavedGraph:function(t){return e.put("rest/explore-graph/saved/"+encodeURIComponent(t.id),t)},deleteSavedGraph:function(t){return e.delete("rest/explore-graph/saved/"+encodeURIComponent(t.id))},addNewSavedGraph:function(t){return e.post("rest/explore-graph/saved",t)}}}},101:function(e,t){angular.module("graphdb.framework.rest.graphconfig.service",[]).factory("GraphConfigRestService",r);function r(e){return{getGraphConfigs:function(){return e.get("rest/explore-graph/config")},getGraphConfigSamples:function(){return e.get("rest/explore-graph/samples")},loadGraphForConfig:function(t,r,n,i){return e.get(`rest/explore-graph/config/graph/${encodeURIComponent(t.id)}?includeInferred=${r}&linksLimit=${n}&sameAsState=${i}`)},getConfig:function(t){return e.get("rest/explore-graph/config/"+encodeURIComponent(t))},createGraphConfig:function(t){return e.post("rest/explore-graph/config",t)},updateGraphConfig:function(t){return e.put("rest/explore-graph/config/"+encodeURIComponent(t.id),t)},deleteGraphConfig:function(t){return e.delete("rest/explore-graph/config/"+encodeURIComponent(t.id))},validateQuery:function(t,r,n,i,o){return e({method:"POST",url:"rest/explore-graph/validate",data:{query:t,queryType:r,params:n,all:i,oneOf:o}})}}}r.$inject=["$http"]},102:function(e,t,r){"use strict";r.r(t);r(10);function n(e,t,r,n,i,o,s,a,l,u,c,p,d,f,h,g,m){e.classHierarchyData={},e.instancesObj={},e.instancesQueryObj={},e.instancesObj.items=[],e.instancesNotFiltered=[],e.isWarningShowed=!1,e.onopen=e.onclose=()=>angular.noop(),e.currentBrowserLimit=2e3,d.firefox?e.currentBrowserLimit=50:(d.safari||d.msie||d.msedge)&&(e.currentBrowserLimit=400);const E={};let v=0,x=0;t.key="",E.get=function(t,r,n){return l.initLazyList(t,r,n,v,e.instancesObj.items)};let y=allGraphs;const T=function(){if(e.getActiveRepository())return g.resolveGraphs().success((function(t){e.graphsInRepo=t.results.bindings.length>1002?t.results.bindings.slice(0,1002):t.results.bindings,C()})).error((function(t){e.repositoryError=getError(t),s.error(getError(t),m.instant("graphexplore.error.getting.graphs"))}))},C=function(){const t=f.get("classHierarchy-selectedGraph-"+n.getActiveRepository());null!==t&&e.graphsInRepo.some(e=>e.contextID.uri===t.contextID.uri)?y=t:f.set("classHierarchy-selectedGraph-"+n.getActiveRepository(),y)};function N(t,r,n){e.classCountSlider.options&&e.classCountSlider.options.ceil!==r&&(e.classCountSlider={});var i;e.classCountSlider.value||(e.showExternalElements=!0,e.classCountSlider={value:r,options:{floor:1,ceil:r,vertical:!0,showSelectionBar:!0,onChange:function(){c(I,100,!0)}}},null===f.get(h.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE)&&r>e.currentBrowserLimit&&(i=e.currentBrowserLimit,d.chrome?s.warning(m.instant("graphexplore.disabling.animations",{classLimit:i}),m.instant("graphexplore.reducing.visual.effects")):s.warning(m.instant("graphexplore.browser.performance",{browser:d.name,classLimit:i}),m.instant("graphexplore.reducing.visual.effects"))));const o=f.get(h.CLASS_HIERARCHY_SWITCH_PREFIXES);null!=o&&"true"!==o&&(e.showExternalElements=!0),n?e.classCountSlider.value=n:r>=1500&&(e.classCountSlider.value=1500,s.warning(m.instant("graphexplore.class.count.slider",{count:1500}),m.instant("graphexplore.reducing.class.count"))),r>=25&&!window.ActiveXObject&&"ActiveXObject"in window&&!e.isWarningShowed&&(e.classCountSlider.value=25,e.isWarningShowed=!0,s.warning(m.instant("graphexplore.class.count.browser",{count:25}),m.instant("graphexplore.reducing.class.count"))),c((function(){e.$broadcast("reCalcViewDimensions")}),200),I();let a=0;$("rzslider").on("wheel",(function(t){t.preventDefault(),t.stopPropagation();const r=(new Date).getTime();if(!(r-a>100))return;a=r,t=t.originalEvent;let n=e.classCountSlider.value;t.deltaY<=-1?n+=1:t.deltaY>=1&&(n-=1),n!==e.classCountSlider.value&&n>=e.classCountSlider.options.floor&&n<=e.classCountSlider.options.ceil&&e.$apply((function(){e.classCountSlider.value=n,c(I,100,!0)}))}))}function I(){e.currentSliderValue=e.classCountSlider.value}function S(e){const t=e.data.fullName,n=e.data.name;a.checkDomainRangeData(t).success((function(e,i){204===i?s.warning(m.instant("graphexplore.no.domain.range",{name:n})):(f.set(h.CLASS_HIERARCHY_LAST_SELECTED_CLASS,r.hash()),r.hash("").path("domain-range-graph").search("uri",t).search("name",n))})).error((function(){s.error(m.instant("graphexplore.error.request.failed",{name:n}))}))}function L(){r.replace().hash("1"),e.instancesObj.items=[],e.showExternalElements=!1,e.showClassInfoPanel=!1,f.clearClassHieararchyState(),e.hidePrefixes="true"===f.get(h.CLASS_HIERARCHY_HIDE_PREFIXES),e.currentSliderValue=void 0,e.classHierarchyData={},t.$broadcast("angucomplete-alt:clearInput")}function A(){e.hasClassHierarchy()&&c((function(){$("#toolbar").removeClass("ng-hide")}),0)}t.$watch((function(){return t.key}),(function(){v=0,_.each(e.instancesObj.items,(function(e){t.key>e&&v++})),x++})),E.revision=function(){return x},e.adapterContainer={adapter:{remain:!0}},e.$on("goToDomainRangeGraphView",(function(e,t){S(t)})),e.$on("classCount",N),e.$on("repositoryIsSet",(function(){if(!i.isLicenseValid())return;if(b===n.getActiveRepository())return;b=n.getActiveRepository();if(e.repositoryError=null,!b)return;y=allGraphs,T().then(R)})),e.datasource=E,e.goToDomainRangeGraphView=S,e.toggleClassInfoSidePanel=function(){e.showClassInfoPanel=!e.showClassInfoPanel,t.$broadcast("sidePanelClosed")},e.getActiveRepositoryNoError=function(){if(!e.repositoryError)return n.getActiveRepository()},e.isSystemRepository=function(){return n.isSystemRepository()},e.confirmReloadClassHierarchy=function(){p.openSimpleModal({title:m.instant("confirm.operation"),message:m.instant("graphexplore.calculating.hierarchy"),warning:!0}).result.then((function(){L(),e.loader=!0,e.hierarchyError=!1,a.reloadClassHierarchy(y.contextID.uri).success((function(t){e.loader=!1,e.classHierarchyData=t,A(),N()})).error((function(t){e.loader=!1,e.hierarchyError=getError(t),s.error(getError(t),m.instant("graphexplore.error.rdf.class.request"))}))}))},e.focusOnRoot=function(){e.$broadcast("rootFocus")},e.copyToClipboard=function(e){p.openCopyToClipboardModal(e)},e.searchedClassCallback=function(e){if(e){const r={name:e.title};t.$broadcast("searchedClass",r)}},e.instancesQueryObj.query="",e.instancesFilterFunc=function(t){return t.resolvedUri.toLowerCase().indexOf(e.instancesQueryObj.query.toLowerCase())>=0},T(),e.$watch("instancesObj.items",(function(){e.instancesObj.items.length>0&&c((function(){e.adapterContainer.adapter.reload()}),30)})),e.$watch("selectedClass",(function(){e.showClassInfoPanel&&function(t){const r=t.data.fullName;let n=t.data.name;if(n===r){const e=n.lastIndexOf("#");n=n.substring(e+1)}e.encodedUri=encodeURIComponent(r);const i=encodeURIComponent("prefix onto:<http://www.ontotext.com/>\nselect ?s {\n ?s a <"+r+"> .\n}");e.viewInstancesUri="sparql?name="+n+"&infer=true&sameAs=false&query="+i+"&execute=true",a.getRdfsLabelAndComment(r).success((function(t){e.rdfsLabel=t.label,e.rdfsComment=t.comment,e.expanded=!1})).error((function(){s.error("Error getting rdfs:label and rdfs:comment")})),e.instancesQueryObj.query="",e.instancesLoader=!0,a.getClassInstances(r).success((function(t){e.instancesObj.items=[],_.each(t,(function(t,r){const n={};n.type=t.startsWith("<<")&&t.endsWith(">>")?"triple":"uri",n.absUri=encodeURIComponent(t),n.absUriNonEncoded=t,n.resolvedUri=r,e.instancesObj.items.push(n)})),e.instancesLoader=!1,e.instancesSearchPlaceholder=e.instancesObj.items.length<1e3?"Search class instances":"Search first 1000 class instances",e.instancesNotFiltered=e.instancesObj.items})).error((function(){s.error(m.instant("graphexplore.error.instances.request"))}))}(e.selectedClass)})),$(document).ready((function(){$(".prefix-toggle").click((function(){$(".tooltip").hide()}))}));let b=n.getActiveRepository();function R(){L(),!e.isSystemRepository()&&e.isLicenseValid()&&(e.hierarchyError=!1,e.loader=!0,a.getClassHierarchyData(y.contextID.uri).success((function(t,r){e.showExternalElements=!0,e.loader=!1,e.classHierarchyData=t,207===r&&s.warning(m.instant("graphexplore.update.diagram"),m.instant("graphexplore.repository.data.changed")),A()})).error((function(t){e.loader=!1,e.hierarchyError=getError(t),s.error(getError(t),m.instant("graphexplore.error.rdf.class.request"))})))}e.hasClassHierarchy=function(){return e.classHierarchyData.classCount&&e.getActiveRepositoryNoError()&&!e.isSystemRepository()},e.isLicenseValid=function(){return i.isLicenseValid()},e.chosenGraph=function(e){y=e,R(),f.set("classHierarchy-selectedGraph-"+n.getActiveRepository(),y)},e.getSelGraphValue=function(){return y.contextID.value},e.isAllGraphsSelected=function(){return"all.graphs.label"===e.getSelGraphValue()}}angular.module("graphdb.framework.graphexplore.controllers.class",["pageslide-directive","ngAnimate","ui.scroll.jqlite","ui.scroll","angucomplete-alt","rzSlider","toastr","graphdb.framework.utils.localstorageadapter"]).controller("RdfClassHierarchyCtlr",n),n.$inject=["$scope","$rootScope","$location","$repositories","$licenseService","$window","toastr","GraphDataRestService","UiScrollService","RdfsLabelCommentService","$timeout","ModalService","bowser","LocalStorageAdapter","LSKeys","RDF4JRepositoriesRestService","$translate"]},103:function(e,t,r){"use strict";r.r(t);r(10);function n(e,t,r,n,i,o,s,a,l,u,c,p,d){e.predicatesObj={},e.predicatesQueryObj={},e.predicatesObj.items=[],e.predicatesQueryObj.query="",e.predicatesListNotFiltered=[],e.predicatesSearchPlaceholder="Search predicates",e.onopen=e.onclose=()=>angular.noop();const f={};let h=0,g=0;r.key="",f.get=function(t,r,n){return u.initLazyList(t,r,n,h,e.predicatesObj.items)},r.$watch((function(){return r.key}),(function(){h=0,_.each(e.predicatesObj.items,(function(e){r.key>e&&h++})),g++})),f.revision=function(){return g},e.adapterContainer={adapter:{remain:!0}};const m=s.get(a.DOMAIN_RANGE_COLLAPSE_EDGES);function E(){const e=s.get(a.CLASS_HIERARCHY_LAST_SELECTED_CLASS);t.search("").hash(e).path("hierarchy")}e.collapseEdges=null===m||"true"===m,e.datasource=f,e.$on("reloadDomainRangeGraphView",(function(e,r){const n=r.objectPropClassUri,i=r.objectPropClassName;t.path("domain-range-graph").search("uri",n).search("name",i)})),e.$on("switchEdgeMode",(function(e,r){t.path("domain-range-graph").search("uri",r.uri).search("name",r.name).search("collapsed",r.collapsed)})),e.$on("repositoryIsSet",(function(){if(v===i.getActiveRepository())return;v=i.getActiveRepository();E()})),e.$on("changeCollapsedEdgesState",(function(t,r){e.collapseEdges=!r,s.set(a.DOMAIN_RANGE_COLLAPSE_EDGES,e.collapseEdges)})),e.goToClassHierarchyView=E,e.copyToClipboard=function(e){c.openCopyToClipboardModal(e)},e.toggleCollapseEdgesState=function(){e.collapseEdges=!e.collapseEdges,o.history.pushState({collapsed:e.collapseEdges},"domainRangePage",null)},e.predicatesListFilterFunc=function(t){return t.resolvedUri.toLowerCase().indexOf(e.predicatesQueryObj.query.toLowerCase())>=0},e.$watch("predicatesObj.items",(function(){e.predicatesObj.items>0&&n((function(){e.adapterContainer.adapter.reload()}),30)})),e.$watch("selectedPredicate",(function(){e.showPredicatesInfoPanel&&function(t){const r=t.target,n=t.source;e.encodedUri=encodeURIComponent(t.uri),e.sourceTargetObjectNodeUri=r.objectPropClassUri?r.objectPropClassUri:n.objectPropClassUri,e.encodedSourceTargetObjectNodeUri=encodeURIComponent(e.sourceTargetObjectNodeUri),e.sourceTargetObjectNodeName=r.objectPropClassName?r.objectPropClassName:n.objectPropClassName?n.objectPropClassName:"<i>Literal</i>",-1===e.sourceTargetObjectNodeName.indexOf("Literal")?l.getRdfsLabelAndComment(e.sourceTargetObjectNodeUri).success((function(t){e.rdfsLabel=t.label,e.rdfsComment=t.comment})).error((function(){p.error(d.instant("domain.range.error.get.label.comment"))})):(e.rdfsComment=void 0,e.rdfsLabel=void 0);e.predicatesObj.items=[],e.predicatesQueryObj.query="";const i=r.allEdges?r.allEdges:n.allEdges;_.each(i,(function(t){const r={};r.absUri=encodeURIComponent(t.uri),r.absUriNonEncoded=t.uri,r.resolvedUri=t.name,r.isImplicit=t.implicit,e.predicatesObj.items.push(r)})),e.predicatesListNotFiltered=e.predicatesObj.items}(e.selectedPredicate)})),$(document).ready((function(){$(".compact-mode-toggle").click((function(){$(".tooltip").hide()}))}));let v=i.getActiveRepository()}angular.module("graphdb.framework.graphexplore.controllers.domainrange",["ui.scroll.jqlite","ui.scroll","ngSanitize","graphdb.framework.utils.localstorageadapter"]).controller("DomainRangeGraphCtlr",n),n.$inject=["$scope","$location","$rootScope","$timeout","$repositories","$window","LocalStorageAdapter","LSKeys","GraphDataRestService","UiScrollService","ModalService","toastr","$translate"]},104:function(e,t,r){(function(e){const t="WAIT",r="NO_REPO",n="READY",i="IN_PROGRESS",o="ERROR",s={contextID:{type:"all",value:"all.graphs.label",uri:""}};function a(e){if(e<1e3)return e;const t=Math.floor(Math.log(e)/Math.log(1e3));let r=e/Math.pow(1e3,t);return r=r%1>1/Math.pow(1e3,t-1)?r.toFixed(2):r.toFixed(0),r+["K","M","G","T","P","H"][t-1]}function l(e,a,l,u,c,p,d,f,h,g,m){let E=null;e.status=l.getActiveRepository()?t:r;let v=s;const x=function(){g.resolveGraphs().success((function(t){e.graphsInRepo=t.results.bindings.length>1002?t.results.bindings.slice(0,1002):t.results.bindings,y(),e.isSystemRepository()?"READY"!==e.status&&C():(e.status="WAIT",C(!0))})).error((function(t){e.repositoryError=getError(t),u.error(getError(t),m.instant("graphexplore.error.getting.graph"))}))},y=function(){const t=h.get("dependencies-selectedGraph-"+l.getActiveRepository());null!==t&&e.graphsInRepo.some(e=>e.contextID.uri===t.contextID.uri)?v=t:h.set("dependencies-selectedGraph-"+l.getActiveRepository(),v)},T=function(r){d3.select("#dependencies-chord").html(""),e.status=t,p.getRelationshipsData(r,e.direction,v.contextID.uri).success((function(t){e.dependenciesData={matrix:t.right,nodes:t.left,hasLinks:_.sum(_.map(t.right,(function(e){return _.sum(e)})))>0,direction:e.direction},e.status=n})).error((function(t){e.status=n,u.error(getError(t),m.instant("graphexplore.error.dependencies.count"))}))},C=function(r){(e.status!==n||r)&&(e.status=t,p.getRelationshipsStatus(v.contextID.uri).success((function(t){if(e.status=t,e.status===i){if(null!==E)return;E=c(C,2e3)}e.status===n&&(null!==E&&(c.cancel(E),E=null),p.getRelationshipsClasses(e.direction,v.contextID.uri).success((function(t,r){e.allClasses.items=_.filter(t,L),e.allNotFilteredClasses=t,e.selectedClasses=void 0,angular.isUndefined(e.selectedClasses)&&(e.selectedClasses=t.slice(0,10)),T(e.selectedClasses),207===r&&u.warning(m.instant("graphexplore.update.diagram"),m.instant("graphexplore.repository.data.changed"))}))),0===e.status.indexOf("ERROR;")&&(e.status=o,u.error(m.instant("graphexplore.error.dependencies.calc",{error:e.status.substring("ERROR;".length)})))})).error((function(t){e.status=o,u.error(getError(t),m.instant("graphexplore.error.dependencies.count.status"))})))};e.allClasses={},e.allClasses.items=[],e.allNotFilteredClasses=[],e.direction="all";const N={};let I=0,S=0;function L(t){return-1!==t.name.toLowerCase().indexOf(e.classQuery.query.toLowerCase())}a.key="",N.get=function(t,r,n){return d.initLazyList(t,r,n,I,e.allClasses.items)},a.$watch((function(){return a.key}),(function(){I=0,_.each(e.allClasses.items,(function(e){a.key>e&&I++})),S++})),N.revision=function(){return S},e.datasource=N,e.adapterContainer={adapter:{remain:!0}},e.classQuery={},e.classQuery.query="",e.classFilterFunc=L,e.$watch("allClasses.items",(function(){e.allClasses.items.length>0&&c((function(){e.adapterContainer.adapter.reload()}),30)})),e.$watch("direction",(function(){!l.getActiveRepository()||e.isSystemRepository()||l.isActiveRepoFedXType()||x()})),e.$on("$destroy",(function(){c.cancel(E)})),e.isLoading=function(){return e.status===i||e.status===t},e.confirmCalculateDependencies=function(){f.openSimpleModal({title:m.instant("confirm.operation"),message:m.instant("graphexplore.calculating.relationships"),warning:!0}).result.then((function(){e.calculateDependencies()}))},e.calculateDependencies=function(){e.status=t,e.selectedClasses=void 0,p.calculateRelationships(v.contextID.uri).success((function(t){0===t.indexOf("ERROR;")?u.error(m.instant("graphexplore.error.dependencies.calc",{error:e.status.substring("ERROR;".length)})):C()})).error((function(e){u.error(m.instant("graphexplore.error.could.not.force.count",{error:getError(e)}))}))},e.addClass=function(t){e.selectedClasses.push(t),T(e.selectedClasses)},e.removeClass=function(t){_.remove(e.selectedClasses,(function(e){return e.name===t.name})),T(e.selectedClasses)},e.showClass=function(t){e.classToShow=t},e.isClassByNameShown=function(t){return void 0!==_.find(e.selectedClasses,{name:t})},e.addClassByName=function(t){e.selectedClasses.push(_.find(e.allClasses.items,{name:t})),T(e.selectedClasses)},e.removeClassByName=function(t){_.remove(e.selectedClasses,(function(e){return e.name===t})),T(e.selectedClasses)},e.removeAllClasses=function(){e.selectedClasses=[],T(e.selectedClasses)},e.isSystemRepository=function(){return"SYSTEM"===l.getActiveRepository()};const A=e.$on("repositoryIsSet",(function(){e.classQuery={},e.classQuery.query="",e.repositoryError=null,v=s,l.getActiveRepository()&&!l.isActiveRepoFedXType()?x():e.status=r}));window.addEventListener("beforeunload",(function e(){A(),window.removeEventListener("beforeunload",e)})),e.selectGraph=function(e){v=e,C(!0),h.set("dependencies-selectedGraph-"+l.getActiveRepository(),v)},e.getSelectedGraphValue=function(){return v.contextID.value},e.isAllGraphsSelected=function(){return"all.graphs.label"===e.getSelectedGraphValue()}}Object.defineProperty(e,"allGraphs",{get:()=>s}),angular.module("graphdb.framework.graphexplore.controllers.dependencies",["ui.scroll.jqlite","ui.scroll","toastr","ui.bootstrap","graphdb.framework.core.services.repositories","graphdb.framework.utils.localstorageadapter"]).controller("DependenciesChordCtrl",l).config(["$uibTooltipProvider",function(e){e.options({appendToBody:!0})}]).filter("humanize",(function(){return a})),l.$inject=["$scope","$rootScope","$repositories","toastr","$timeout","GraphDataRestService","UiScrollService","ModalService","LocalStorageAdapter","RDF4JRepositoriesRestService","$translate"]}).call(this,r(11))},105:function(e,t,r){"use strict";r.r(t);r(7);var n=r(316),i=r(318),o=(r(10),r(67));function s(e,t,r,s,a,l,u,c,p,d,f,h,g,m,E,v,x,y,T,C,N,I,S){e.languageChanged=!1,e.propertiesObj={},e.propertiesQueryObj={},e.propertiesObj.items=[],e.propertiesNotFiltered=[],e.searchVisible=!1,e.nodeSelected=!1,e.queryResultsMode=!1,e.embedded=f.search().embedded,e.openedNodeInfoPanel=void 0,e.invalidLimit=!1,e.INVALID_LINKS_MSG=I.instant("sidepanel.invalid.limit.links.msg"),e.INVALID_LINKS_TOOLTIP=I.instant("sidepanel.invalid.limit.links.tooltip"),t.$on("$translateChangeSuccess",(function(){e.INVALID_LINKS_MSG=I.instant("sidepanel.invalid.limit.links.msg"),e.INVALID_LINKS_TOOLTIP=I.instant("sidepanel.invalid.limit.links.tooltip"),e.propertiesSearchPlaceholder=I.instant("visual.search.instance.placeholder")})),e.onopen=e.onclose=()=>angular.noop(),e.embedded&&(f.search().query||f.search().uri||f.search().config||f.search().saved)&&(e.noGoHome=!0);const L={};let A=0,b=0,R={},O=0;var w,P=d3.zoom().scaleExtent([.5,10]),D=d3.zoomIdentity.translate(0,-70).scale(1);P.on("zoom",(function(e){S.isActive()||(k=e.transform,w.attr("transform",k))}));let k=D;let M,F;function G(){return S.isActive()?e.defaultSettings:e.saveSettings}function U(e){m.openCopyToClipboardModal(e)}function B(){e.settings.languagesMap=_.map(e.settings.languages,(function(e){return{text:e}})),e.settings.preferredTypesMap=_.map(e.settings.preferredTypes,(function(e){return{text:e}})),e.settings.rejectedTypesMap=_.map(e.settings.rejectedTypes,(function(e){return{text:e}})),e.settings.preferredPredicatesMap=_.map(e.settings.preferredPredicates,(function(e){return{text:e}})),e.settings.rejectedPredicatesMap=_.map(e.settings.rejectedPredicates,(function(e){return{text:e}}))}t.key="",L.get=function(t,r,n){return g.initLazyList(t,r,n,A,e.propertiesObj.items)},t.$watch((function(){return t.key}),(function(){A=0,_.each(e.propertiesObj.items,(function(e){t.key>e&&A++})),b++})),L.revision=function(){return b},e.datasource=L,e.adapterContainer={adapter:{remain:!0}},e.propertiesQueryObj.query="",e.propertiesSearchPlaceholder=I.instant("visual.search.instance.placeholder"),e.propertiesFilterFunc=function(t){return t.key.toLowerCase().indexOf(e.propertiesQueryObj.query.toLowerCase())>=0},e.resetState=function(){e.searchVisible=!1,e.nodeSelected=!1,e.configLoaded=null,e.queryResultsMode=!1,e.lastSavedGraphName=null,e.lastSavedGraphId=null,e.shared=!1,e.numberOfPinnedNodes=0,R={},O=0},e.pushHistory=function(t,r){e.embedded&&(t.embedded=!0),f.search(t),f.state(r)},e.goToHome=function(){e.resetState(),f.url("graphs-visualizations")},e.shouldShowSettings=function(){return e.configLoaded&&e.configLoaded.id===e.defaultGraphConfig.id},e.shouldDisableSameAs=function(){const t=$("#sameAsCheck");return e.settings&&!e.settings.includeInferred&&t.prop("checked")&&(t.prop("checked",!1),e.settings.sameAsState=!1),e.settings&&!e.settings.includeInferred},e.$watch("propertiesObj.items",(function(){angular.isDefined(e.propertiesObj.items)&&e.propertiesObj.items.length>0&&l((function(){e.adapterContainer.adapter.reload()}),500)})),e.toggleMoreInfo=function(e){angular.element(e.currentTarget).parent().next().toggle(200),angular.element(e.currentTarget).children("span").toggleClass("icon-caret-down").toggleClass("icon-caret-up")},e.copyToClipboard=U,e.defaultSettings={linksLimit:20,includeInferred:!0,sameAsState:!0,languages:["en"],showLinksText:!0,preferredTypes:[],rejectedTypes:[],preferredPredicates:[],rejectedPredicates:["http://dbpedia.org/property/logo","http://dbpedia.org/property/hasPhotoCollection","http://dbpedia.org/property/website","http://dbpedia.org/property/homepage","http://dbpedia.org/ontology/thumbnail","http://xmlns.com/foaf/0.1/depiction","http://xmlns.com/foaf/0.1/homepage","http://xmlns.com/foaf/0.1/mbox","http://dbpedia.org/ontology/wikiPage*","http://dbpedia.org/property/wikiPage*","http://factforge.net/*"],preferredTypesOnly:!1,preferredPredicatesOnly:!1,includeSchema:!0},e.saveSettings=_.cloneDeep(e.defaultSettings),d.when(h.getPrincipal()).then(t=>function(t){const r=t.appSettings;e.defaultSettings.includeInferred=r.DEFAULT_INFERENCE,e.defaultSettings.sameAsState=r.DEFAULT_INFERENCE&&r.DEFAULT_SAMEAS,e.defaultSettings.includeSchema=r.DEFAULT_VIS_GRAPH_SCHEMA;const n=x.get(y.GRAPHS_VIZ);if(n&&"object"==typeof n)try{e.saveSettings=n,void 0===e.saveSettings.includeSchema&&(e.saveSettings.includeSchema=e.defaultSettings.includeSchema,e.saveSettings.rejectedPredicates=[...e.saveSettings.rejectedPredicates,...e.defaultSettings.rejectedPredicates].unique())}catch(t){e.saveSettings=_.cloneDeep(e.defaultSettings),x.set(y.GRAPHS_VIZ,e.saveSettings)}else e.saveSettings=_.cloneDeep(e.defaultSettings)}(t)),e.resetSettings=function(){e.settings=_.cloneDeep(e.defaultSettings),e.validateLinksLimit(),B()},e.changeLimit=function(t){let r=e.settings.linksLimit+t;r<1&&(r=1),r>1e3&&(r=1e3),e.settings.linksLimit=r},e.validateLinksLimit=function(){e.invalidLimit=!o.NUMBER_PATTERN.test(e.settings.linksLimit)},e.showSettings=function(){e.showInfoPanel=!0,e.showFilter=!0,e.showNodeInfo=!1,e.showPredicates=!1,e.saveSettings?e.settings=_.cloneDeep(e.saveSettings):e.settings=_.cloneDeep(e.defaultSettings),B()},e.reExpandNode=function(){e.rootNodeIri&&e.$broadcast("onRootNodeChange",e.rootNodeIri)};const j=function(t,r,n){const i=G(),o=void 0===r?i.sameAsState:!0===r,s=void 0===n?i.includeInferred:!0===n;e.loading=!0,u({url:"rest/explore-graph/graph",method:"POST",headers:{"Content-Type":"application/json"},data:{query:t,linksLimit:i.linksLimit,languages:e.shouldShowSettings()?i.languages:[],includeInferred:s,sameAsState:o}}).then((function(e){me(e)}),(function(t){e.loading=!1,a.error(getError(t.data),I.instant("graphexplore.error.cannot.load.graph"))}))};function V(e){return e.replace(/[()']/g,"")}function H(e,t){let r=e.split(" ");return t?[r[0],r[1],r[2]].join(">"):[r[0],r[2]].join(">")}function q(e){return[e.source.iri,e.target.iri].join(">")}function W(e){if(e.isTriple){let t=document.getElementById(V(H(e.iri)));if(t&&void 0!==t.__data__.x)return t.__data__.x}return e.x}function z(e){if(e.isTriple){let t=document.getElementById(V(H(e.iri)));if(t&&void 0!==t.__data__.y)return t.__data__.y}return e.y}function Q(e){let t=e.trim().split(" ");return`<<<${t[0]}> <${t[1]}> <${t[2]}>>>`}function X(e){return V(`${e.source.isTriple?H(e.source.iri,!0):e.source.iri}>${e.target.isTriple?H(e.target.iri,!0):e.target.iri}>marker`)}function Y(){this.nodes=[],this.links=[],this.tripleNodes=new Map,this.tripleLinksCopy=new Map,this.addNode=function(e,t,r){return e.x=t,e.y=r,this.nodes.push(e),e},this.computeConnectedness=function(){const e={},t={};_.each(this.links,(function(r){const n=r.source.iri,i=r.target.iri,o=_.min([n,i])+"|"+_.max([n,i]);t[o]||(t[o]=1,e[n]=(e[n]||0)+1,e[i]=(e[i]||0)+1)})),_.each(this.links,(function(t){e[t.source.iri]>1&&e[t.target.iri]>1?t.connectedness=Math.min(5,Math.max(e[t.source.iri],e[t.target.iri])-1):t.connectedness=0}))},this.addAndMatchLinks=function(e){const t=this.nodes;Array.prototype.push.apply(this.links,function(e,t){return _.map(e,(function(e){let r,n;r=e.isTripleSource?Ie(e.source):_.find(t,(function(t){return t.iri===e.source})),n=e.isTripleTarget?Ie(e.target):_.find(t,(function(t){return t.iri===e.target}));let i={source:r,target:n,predicates:e.predicates};if(e.isTripleSource||e.isTripleTarget){let e=`${i.source.isTriple?H(i.source.iri):i.source.iri}>${i.target.isTriple?H(i.target.iri):i.target.iri}`;if(K.tripleLinksCopy.has(e)){let t=K.tripleLinksCopy.get(e);return t[0].predicates.push(...i.predicates),t.push(i),K.tripleLinksCopy.set(e,t),null}K.tripleLinksCopy.set(e,[i])}return i}))}(e,t));for(let e of K.tripleLinksCopy.keys())1===K.tripleLinksCopy.get(e).length&&K.tripleLinksCopy.delete(e);this.links=this.links.filter(e=>null!==e),this.computeConnectedness()};const t=function(e,t){return r(e,t).length};function r(e,t){return _.filter(t,(function(t){return t.source.iri===e.iri||t.target.iri===e.iri}))}this.countLinks=t,this.linksTypes=function(e,t){const n=r(e,t),i=_.map(n,(function(t){return t.source.iri===e.iri?t.target.types:t.source.types}));return _.uniq(_.flatten(i))},this.linksPredicates=function(e,t){const n=r(e,t),i=_.map(n,(function(e){return e.predicates}));return _.uniq(_.flatten(i))},this.removeTriples=function(e){let t=[];this.tripleNodes.size>0&&e.forEach(e=>{this.tripleNodes.has(e)&&(this.tripleNodes.delete(e),this.links=_.reject(this.links,(function(r){let n=e.split(">"),i=H(r.source.iri),o=H(r.target.iri);if(i===e&&K.tripleNodes.delete(o)){let e=o.split(">");t.push({source:e[0],target:e[1]})}let s=i===e||o===e||r.source.iri===n[0]&&r.target.iri===n[1];return s&&(K.tripleLinksCopy.delete(`${i}>${o}`),K.tripleLinksCopy.delete(`${o}>${i}`)),s})))}),t.forEach(e=>{this.links=_.reject(this.links,(function(t){return t.source.iri===e.source&&t.target.iri===e.target}))})},this.removeNode=function(r){let n=[];this.links=_.reject(this.links,(function(e){let t=e.source.iri===r.iri||e.target.iri===r.iri;return t&&(e.target.isTriple&&n.push(H(e.target.iri)),e.source.isTriple||e.target.isTriple||n.push([e.source.iri,e.target.iri].join(">"))),t})),this.removeTriples(n);const i=this.links;this.nodes=_.reject(this.nodes,(function(e){return 0===t(e,i)})),0===this.nodes.length&&(e.nodeSelected=!1),this.computeConnectedness()},this.removeNodeLeafLinks=function(e){let n=[],i=this.links;this.links=_.reject(this.links,(function(o){let s=o.source.iri===e.iri&&1===t(o.target,i)&&!o.target.isTriple||o.target.iri===e.iri&&1===t(o.source,i)&&!o.source.isTriple;if(!s){let n;if(o.source.iri!==e.iri||2!==t(o.target,i)||o.target.isTriple?o.target.iri!==e.iri||2!==t(o.source,i)||o.source.isTriple||(n=r(o.source,i)):n=r(o.target,i),!n)return!1;s=(n[0].source.iri===e.iri||n[0].target.iri)&&(n[1].source.iri===e.iri||n[1].target.iri)}return s&&(o.target.isTriple&&n.push(H(o.target.iri)),o.source.isTriple||o.target.isTriple||n.push([o.source.iri,o.target.iri].join(">"))),s})),this.removeTriples(n),i=this.links,this.nodes=_.reject(this.nodes,(function(r){return 0===t(r,i)&&r.iri!==e.iri})),this.computeConnectedness()},this.addTriple=function(e,t,r){e.x=t,e.y=r,e.weight=0;let n=H(e.iri);if(this.tripleNodes.has(n)){let t=this.tripleNodes.get(n);t.push(e),this.tripleNodes.set(n,t)}else e.weight=10,this.tripleNodes.set(n,[e])},this.copyState=function(){const e=_.map(this.nodes,(function(e){return{iri:e.iri,isTriple:e.isTriple,size:e.size,labels:_.cloneDeep(e.labels),types:_.cloneDeep(e.types),rdfRank:e.rdfRank,x:e.x,y:e.y,fixed:e.fixed}})),t=JSON.stringify(Array.from(this.tripleNodes.entries())),r=JSON.stringify(Array.from(this.tripleLinksCopy.entries()));return{nodes:e,links:_.map(this.links,(function(e){return{source:e.source.iri,isTripleSource:e.source.isTriple,target:e.target.iri,isTripleTarget:e.target.isTriple,predicates:e.predicates}})),tripleNodes:t,tripleLinksCopy:r,colorIndex:O,type2color:R,transform:k}},this.restoreState=function(t){e.nodeSelected=!0,e.searchVisible=!1,this.nodes=_.cloneDeep(t.nodes),this.tripleNodes=t.tripleNodes?new Map(JSON.parse(t.tripleNodes)):new Map,this.links=[],this.addAndMatchLinks(t.links),this.tripleLinksCopy=t.tripleLinksCopy?new Map(JSON.parse(t.tripleLinksCopy)):new Map,_.each(this.nodes,(function(t){t.fixed&&e.numberOfPinnedNodes++})),angular.isDefined(t.colorIndex)&&angular.isDefined(t.type2color)&&(O=t.colorIndex,R=_.cloneDeep(t.type2color)),angular.isDefined(t.transform)&&(k=d3.zoomIdentity.translate(t.transform.x,t.transform.y).scale(t.transform.k)),pe()}}e.updateSettings=function(){e.invalidLimit?a.error(e.INVALID_LINKS_TOOLTIP,e.INVALID_LINKS_MSG):(e.saveSettings=e.settings,e.saveSettings.languages=_.map(e.saveSettings.languagesMap,(function(e){return e.text})),e.saveSettings.preferredTypes=_.map(e.saveSettings.preferredTypesMap,(function(e){return e.text})),e.saveSettings.rejectedTypes=_.map(e.saveSettings.rejectedTypesMap,(function(e){return e.text})),e.saveSettings.preferredPredicates=_.map(e.saveSettings.preferredPredicatesMap,(function(e){return e.text})),e.saveSettings.rejectedPredicates=_.map(e.saveSettings.rejectedPredicatesMap,(function(e){return e.text})),e.rootNodeIri?e.reExpandNode(e.rootNodeIri):e.queryResultsMode&&f.search().query?j(f.search().query,f.search().sameAs,f.search().inference):"query"===e.configLoaded.startMode&&e.loadGraphConfig(e.configLoaded),G().showLinksText?d3.selectAll("svg .link-wrapper text").style("display","block"):d3.selectAll("svg .link-wrapper text").style("display","none"),e.showInfoPanel=!1,e.showFilter=!1,x.set(y.GRAPHS_VIZ,e.saveSettings))},e.showInfoPanel=!1;let K=new Y;e.defaultGraphConfig={id:"default",name:"Easy graph",startMode:"search"},e.getGraphConfigs=function(t){C.getGraphConfigs().success((function(r){e.graphConfigs=r,t&&t()})).error((function(e){a.error(getError(e),I.instant("graphexplore.error.graph.configs.short.msg"))}))},e.loadConfigForId=function(t,r){t===e.defaultGraphConfig.id?e.loadGraphConfig(e.defaultGraphConfig):C.getConfig(t).success((function(t){e.loadGraphConfig(t),r()})).error((function(e){a.error(getError(e),I.instant("graphexplore.error.could.not.load.config",{configId:t}))}))},e.findConfigById=function(t){return t===e.defaultGraphConfig.id?e.defaultGraphConfig:$.grep(e.graphConfigs,(function(e){return e.id===t}))[0]},e.easyGraphSearch=function(t){e.configLoaded=e.defaultGraphConfig,e.openUri(t)},e.loadGraphConfig=function(t){e.configLoaded=t,"search"===t.startMode?e.searchVisible=!0:"node"===t.startMode&&t.startIRI?l((function(){e.openUri(t.startIRI,!0)}),0):"query"===t.startMode&&t.startGraphQuery&&(e.loading=!0,C.loadGraphForConfig(t,t.startQueryIncludeInferred,G().linksLimit,t.startQuerySameAs).then((function(e){me(e)}),(function(t){e.loading=!1,a.error(getError(t),I.instant("graphexplore.error.graph.load"))})))},e.deleteConfig=function(t){m.openSimpleModal({title:I.instant("common.confirm"),message:I.instant("graphexplore.delete.graph",{configName:t.name}),warning:!0}).result.then((function(){C.deleteGraphConfig(t).success((function(){e.getGraphConfigs(),e.refreshSavedGraphs()})).error((function(e){a.error(getError(e),I.instant("graphexplore.error.cannot.delete.config"))}))}))},e.goToGraphConfig=function(t){e.pushHistory({config:t.id},{config:t}),e.resetState(),e.loadGraphConfig(t)},v.onpopstate=function(t){e.resetState(),t.state&&(t.state.config?(e.loadGraphConfig(t.state.config),t.state.uri&&e.openUri(t.state.uri,!0)):t.state.savedGraph&&e.loadSavedGraph(t.state.savedGraph,!0))};const Z=function(){f.search().query?(e.searchVisible=!1,e.queryResultsMode=!0,j(f.search().query,f.search().sameAs,f.search().inference)):e.$on("onRootNodeChange",(function(t,r){e.loading=!0;const n=G();angular.isDefined(r)&&(e.rootNodeIri=r,u({url:"rest/explore-graph/node",method:"GET",params:{iri:r,config:e.configLoaded?e.configLoaded.id:e.defaultGraphConfig.id,languages:e.shouldShowSettings()?n.languages:[],includeInferred:n.includeInferred,sameAsState:n.sameAsState}}).then((function(t){e.nodeSelected=!0,e.searchVisible=!1,null===t.data.types&&(t.data.types="greyColor"),K=new Y;const r=K.addNode(t.data,500,500);k=D,ve(r,!0)})).catch((function(t){e.loading=!1,a.error(getError(t),I.instant("graphexplore.error.could.not.load.graph"))})))})),f.search().uri&&e.openUri(f.search().uri,!0),f.search().saved&&T.getSavedGraph(f.search().saved).success((function(t){e.loadSavedGraph(t)})).error((function(e){const t=getError(e);a.error(t,I.instant("graphexplore.error.could.not.open"))}))},J=function(){f.search().config?e.loadConfigForId(f.search().config,Z):f.search().query||f.search().uri?(e.loadGraphConfig(e.defaultGraphConfig),Z()):Z()};function ee(t){!r.getActiveRepository()||e.hasInitedRepository&&!t||(e.hasInitedRepository=!0,t||e.getGraphConfigs(J),e.getNamespacesPromise=N.getNamespaces(e.getActiveRepository()).success((function(t){const r=_.map(t.results.bindings,(function(e){return{uri:e.namespace.value,prefix:e.prefix.value}}));e.namespaces=_.sortBy(r,(function(e){return e.uri.length})),te()})).error((function(e){a.error(getError(e),I.instant("graphexplore.error.view.will.not.work"))})))}function te(){s.isLicenseValid()&&(e.getAutocompletePromise=p.checkAutocompleteStatus())}e.replaceIRIWithPrefix=function(t){const r=e.namespaces,n=_.findLast(r,(function(e){return 0===t.indexOf(e.uri)}));return n?n.prefix+":"+t.substring(n.uri.length):t},e.addedTag=function(t){return t.text.indexOf(":")<0?(a.warning(I.instant("graphexplore.absolute.prefixed.iri")),null):(t.text=function(e,t){if(!/^<?(http|urn).*>?/.test(e)){const r=e.split(":"),n=r[0],i=r[1];if(!angular.isUndefined(i)){const e=c.getNamespaceUriForPrefix(t,n);if(e)return e+i}}return e}(t.text,e.namespaces),e.pageslideExpanded=!0,t)},e.validateTag=function(e,t,r){if(e.text.indexOf(":")<0)return r?a.warning(I.instant("graphexplore.absolute.prefixed.iri.option"),t):a.warning(I.instant("graphexplore.absolute.prefixed.iri"),t),!1;const n=e.text.indexOf("*");if(n>=0){if(!r)return a.warning(I.instant("graphexplore.wildcards.not.allowed"),t),!1;if(n<e.text.length-1)return a.warning(I.instant("graphexplore.wildcards.last.char"),t),!1}return!0},e.getTagClass=function(e){return e.endsWith("*")?"tag-item-wildcard":null},e.getActiveRepository=function(){return r.getActiveRepository()},e.isLicenseValid=function(){return s.isLicenseValid()},e.hasInitedRepository=!1,e.$on("autocompleteStatus",(function(){te()})),e.$on("repositoryIsSet",(function(t,r){r.newRepo&&(e.hasInitedRepository=!1),ee(r.newRepo),r.newRepo&&(e.resetState(),$(".graph-visualization svg").empty(),f.search().query&&(e.goToHome(),Z()))})),ee();const re=d3.scaleLinear().domain([0,9]).range(["hsl(0, 100%, 75%)","hsl(360, 90%, 82%)"]).interpolate(d3.interpolateHslLong),ne=d3.scaleLinear().domain([0,9]).range(["hsl(180, 50%, 75%)","hsl(540, 40%, 82%)"]).interpolate(d3.interpolateHslLong);e.getColor=function(e){angular.isUndefined(R[e])&&(R[e]=O,O++);const t=R[e];return t>39?"#c2c2c2":t%2==0?re(t/2):ne(t/2)};const ie=d3.forceX(500).strength(.005),oe=d3.forceY(500).strength(.005),se=d3.forceSimulation().force("x",ie).force("y",oe),ae=d3.select(".main-container .graph-visualization").append("svg").attr("viewBox","0 0 1000 1000").attr("preserveAspectRatio","xMidYMid meet");ae.append("rect").attr("width",1e4).attr("height",1e4).attr("x",-4500).attr("y",-4500).style("fill","none").style("pointer-events","all").call(P).on("click",(function(e){e.stopPropagation(),xe(),se.stop()}));let le=0,ue=0;const ce=new function(){this.state=!1,this.setLoadingState=function(e){this.state=e},this.getLoadingState=function(){return this.state},this.init=function(e,t){d3.select(t).append("circle").attr("cx",(function(){return e.x})).attr("cy",(function(){return e.y})).attr("class","loader-container").attr("r",(function(){return e.size})).style("fill","fff").style("opacity","0.7"),d3.select(t).append("image").attr("xlink:href","js/angular/templates/loader/ot-loader.svg?v=2.5.1-TR1").attr("x",(function(){return e.x-e.size+5})).attr("y",(function(){return e.y-e.size})).attr("width",(function(){return 2*e.size})).attr("height",(function(){return 2*e.size})).attr("class","node-loader")}};function pe(t){d3.selectAll("svg g").remove(),d3.selectAll(".d3-tip").remove(),d3.selectAll(".menu-events").remove(),w=ae.append("g").attr("class","nodes-container").attr("transform",(function(){return angular.isDefined(k)&&!t?k:""}));const r=Object(i.a)().attr("class","d3-tip").customPosition((function(){const e=M.getBoundingClientRect();return{top:e.bottom+10+"px",left:e.left-30+"px"}})).html((function(t){let r="";return t.fixed&&(r+='<i class="icon-pin"></i>&nbsp;&nbsp;'),t.types.length>0?r+=_.join(_.map(t.types,(function(t){return e.replaceIRIWithPrefix(t)}))," · "):r+="<i>No types</i>",r})),o=function(e){let t="";return t+=_.join(_.map(e.predicates,(function(t,r){if(0===r)return Le(t);if(r<10)return" · "+Le(t);if(10===r){const t=function(e){return e.predicates.length-10}(e),r=t>1?t+" predicates":t+" predicate";return" · "+I.instant("graphexplore.tip.text",{textToShow:r})}})),""),t};let s;const u=Object(i.a)().attr("class","d3-tip").customPosition((function(e){const t=s.getBoundingClientRect(),r=function(e){const t=o(e),r=document.createElement("canvas").getContext("2d");return r.font="13px Arial",e.predicates.length<10?r.measureText(t).width:r.measureText(t).width/2}(e);return{top:t.top-30+"px",left:t.left-30+"px",width:r+"px"}})).html((function(e){return o(e)}));const c=function(){l.cancel(void 0),l.cancel(le),M=null,r.hide(),ue=l((function(){xe()}),500)};ae.call(r);ae.call(u);let p=ae.selectAll(".link"),d=ae.selectAll(".node");const f=d3.forceCollide(e=>e.size+5).strength(.5),h=d3.forceManyBody().strength(-300),g=d3.forceCenter(500,500);se.nodes(K.nodes).force("charge",h).force("collide",f).force("center",g).force("link",d3.forceLink(K.links).distance((function(e){return e.source.isTriple||e.target.isTriple?0:function(e){const t=$("<span></span>"),r=e.predicates[0].split("/"),n=r[r.length-1];t.addClass("predicate-text").text(n),$("body").append(t);const i=t.width()+2*e.source.size+2*e.target.size+50;return t.remove(),.75*i}(e)+30*e.connectedness}))),w.append("defs").selectAll("marker").data(K.links).enter().append("marker").attr("class","arrow-marker").attr("id",(function(e){return X(e)})).attr("viewBox","0 -5 10 10").attr("refX",(function(e){return e.target.isTriple?11:e.target.size+11})).attr("refY",0).attr("markerWidth",10).attr("markerHeight",10).attr("orient","auto").append("path").attr("d","M0,-5L10,0L0,5 L10,0 L0, -5"),p=w.selectAll(".link").data(K.links).enter().append("g").attr("class","link-wrapper").attr("id",(function(e){return V(q(e))})).append("line").attr("class","link").style("stroke-width",1).style("fill","transparent").style("marker-end",(function(e){return`url(#${X(e)})`}));const m=w.selectAll(".link-wrapper").append("text").text((function(e){return Se(e)})).attr("class",(function(e){return e.predicates.length>1||K.tripleNodes.has(q(e))?"predicates":"predicate"})).attr("dy","-0.5em").style("text-anchor","middle").style("display",G().showLinksText?"":"none").on("mouseover",(function(e,t){e.stopPropagation(),function(e,t){l.cancel(void 0);const r=s=e.target;l((function(){s===r&&t.predicates.length>1&&u.show(t,s)}),300)}(e,t)})).on("mouseout",(function(){l.cancel(void 0),s=null,u.hide()})).on("click",(function(t,r){t.stopPropagation(),function(t,r){Ne();let n=q(r);if(1===r.predicates.length&&K.tripleNodes.has(n)){F=null;let e=K.tripleNodes.get(n)[0];if(he(e,this,t.button)){let t={};t.iri=e.iri,t.pred=Le(e.iri.split(" ")[1]),Te(t)}return}!function(t){if(e.showNodeInfo=!1,e.showPredicates=t.predicates.length>1,e.showFilter=!1,e.showInfoPanel=!1,F===t)return e.showNodeInfo=!1,e.showInfoPanel=!1,void(F=null);F=t,e.showPredicates&&(e.predicates=_.map(t.predicates,(function(e){let r=function(e,t){let r=q(t);return K.tripleNodes.has(r)?K.tripleNodes.get(r).findIndex(t=>t.iri.indexOf(e)>=0):-1}(e,t),n=r>-1;return{value:Le(e),partOfTriple:n,linkId:n?q(t):"",nodeIndex:r}})),e.showInfoPanel=!0)}(r)}(t,r)}));let E,v=0,x=null,y=null;const T=function(t,r,n){let i=n||this.parentNode;Array.isArray(n)&&(i=n[r]);K.countLinks(t,K.links)<=G().linksLimit?ve(t,!1,i):a.info(I.instant("graphexplore.increase.limit"),I.instant("graphexplore.node.at.max")),e.closeInfoPanel()};function C(e,t){let r,n,i,o,s=!0;if("down"===t)r=2*e.size,n=e.size/3,i=.8,o=.3;else if("down-fixed"===t)r=2*e.size,n=e.size,i=.8,o=.66;else if("up"===t)r=e.size/3,n=2*e.size,i=.3,o=.8;else{if("fixed"!==t)return;r=e.size,i=.66,s=!1}let a=w.selectAll(".node-wrapper").filter((function(t){return t===e})).append("text").text("").classed("icon-any pinned",!0).style("font-size",r+"px").attr("x",(function(e){return e.x})).attr("y",(function(e){return e.y})).attr("opacity",i);"fixed"!==t&&"down-fixed"!==t||(e.pin=a),s&&(a=a.transition().duration(1e3).style("font-size",(function(){return n+"px"})).attr("opacity",o),"down-fixed"!==t&&a.remove())}const N=d3.drag().subject((function(e){return e})).on("start",(function(e,t){if(S.isActive())return;0===e.sourceEvent.button&&(t.fixedBeforeDrag=t.fixed,t.isBeingDragged=!0,t.beginDragging=!0,xe(),d3.select(this).classed("dragging",!0),se.alphaTarget(.3).restart())})).on("drag",(function(t,r){r.isBeingDragged&&(r.fx=t.x,r.fy=t.y,r.fixed?r.beginDragging&&C(r,"fixed"):(e.numberOfPinnedNodes++,r.fixed=!0,C(r,"down-fixed")),r.pinWasFixed=!0,r.beginDragging=null)})).on("end",(function(e,t){t.isBeingDragged&&(t.pinWasFixed&&(t.pinWasFixed=null,d3.select(".pinned").remove()),t.isBeingDragged=!1,d3.select(this).classed("dragging",!1));se.alphaTarget(0)}));d=w.selectAll(".node").data(K.nodes).enter().append("g").attr("class","node-wrapper").attr("id",(function(e){return e.iri})).append("circle").attr("class","node").attr("r",(function(e){return e.size})).style("fill",(function(t){return"greyColor"===t.types?"c2c2c2":e.getColor(t.types[0])})).on("mouseover",(function(t,n){n.isBeingDragged||(l.cancel(ue),le=l(()=>{(function(t,r){if(e.showInfoPanel)return!1;(fe.closeIcon||fe.expandIcon||fe.focusIcon||fe.copyURIIcon)&&fe.removeIcons();if(se.alpha()<.1)return fe.initIcons(t,r.parentNode),se.stop(),de(),!0;return!1})(n,this)&&function(e,t){l.cancel(void 0);const n=M=t.target;l((function(){M===n&&r.show(e,M)}),300)}(n,t)},400))})).on("mouseout",c).on("click",(function(t,r){if(t.button&&0!==t.button)return;const n=this;if(x&&y===n)return l.cancel(x),x=null,void T(r,0,n.parentNode);y=n,c(),e.showPredicates=!1,S.isActive()||(l.cancel(x),x=l((function(){he(r,n,t),x=null}),540))})).on("touchstart",(e,t)=>function(e){v=0,E=l((function(){v<5&&ge(e),E=null}),1e3)}(t)).on("touchmove",(function(){v++})).on("touchend",(function(){l.cancel(E),E=null})).on("contextmenu",(function(t,n){t.shiftKey||(t.preventDefault(),xe(),e.closeInfoPanel(),n.fixed?(e.numberOfPinnedNodes--,n.fixed=!1,n.fx=null,n.fy=null,C(n,"up"),se.alpha(1).restart()):(e.numberOfPinnedNodes++,n.fixed=!0,C(n,"down")),function(e){M&&r.show(e,M)}(n))})).on("gdb-expand-node",(e,t)=>T(t,0,e.srcElement.parentNode)).on("gdb-show-node-info",(e,t)=>ye(t)).call(N);const L=w.selectAll(".node-wrapper").append("foreignObject").style("pointer-events","none").attr("width",(function(e){return 2*e.size*1.75}));w.insert("g").attr("class","menu-events"),function(e){e.each((function(e){e.fontSize=n.a.Text.calcFontSizeRaw(e.labels[0].label,e.size,16,!0)})).attr("height",(function(e){return 3*e.fontSize})).append("xhtml:div").attr("class","node-label-body").style("font-size",(function(e){return e.fontSize+"px"})).append("xhtml:div").text((function(e){return e.labels[0].label})),l((function(){$(".node-label-body div").each((function(e,t){let r=t.textContent.substring(0,t.textContent.length-1);let n=0;for(;n<200&&(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth);)r=r.substring(0,r.length-1),t.textContent=r+"…",n++}))}),50)}(L),se.on("tick",(function(){p.attr("x1",(function(e){return W(e.source)})).attr("y1",(function(e){return z(e.source)})).attr("x2",(function(e){return W(e.target)})).attr("y2",(function(e){return z(e.target)})),m.attr("x",(function(e){let t=W(e.source),r=W(e.target);return e.x=.5*(t+r)})).attr("y",(function(e){let t=z(e.source),r=z(e.target);return e.y=.5*(t+r)})).attr("transform",(function(e){return"rotate("+function(e,t){const r={x:W(e.source),y:z(e.source)},n={x:W(e.target),y:z(e.target)};if(t)return 180*Math.atan2(n.y-r.y,n.x-r.x)/Math.PI;{const e=180*Math.atan2(n.y-r.y,n.x-r.x)/Math.PI;return e<=90&&e>=-90?e:(e>0?-1:1)*(180-Math.abs(e))}}(e,e.direction)+", "+e.x+", "+e.y+")"})),d.attr("cx",(function(e){return e.x})).attr("cy",(function(e){return e.y})),w.select(".node-loader").attr("x",(function(e){return e.x-e.size+3})).attr("y",(function(e){return e.y-e.size})),w.select(".loader-container").attr("cx",(function(e){return e.x})).attr("cy",(function(e){return e.y})),L.attr("x",(function(e){return e.x-1.75*e.size})).attr("y",(function(e){return e.y-3*e.fontSize/2})),d3.select(".pinned").attr("x",(function(e){return e.x})).attr("y",(function(e){return e.y})),de()})),angular.isDefined(ce)&&ce.setLoadingState(!1),e.loading&&(e.loading=!1),d3.selectAll(".link-wrapper").each((function(){const e=$(this).attr("id").split(">")[0],t=$(this).attr("id").split(">")[1];d3.selectAll(".link").each((function(r){let n=V(r.source.iri),i=V(r.target.iri);if(n===t&&i===e){let e=n;e+=">",e+=i;const t=document.createTextNode(" ⟶");document.getElementById(e).lastChild.appendChild(t),r.direction="double"}}))})),d3.selectAll(".d3-actions-tip").remove(),se.alpha(.3).restart()}function de(){t.d3alpha=se.alpha()}const fe=new function(){function e(e,t){return"translate("+(t.x-14+(t.size+15)*Math.cos(e*Math.PI/180-Math.PI/2))+","+(t.y-14+(t.size+15)*Math.sin(e*Math.PI/180-Math.PI/2))+")"}this.closeIcon=void 0,this.expandIcon=void 0,this.collapseIcon=void 0,this.focusIcon=void 0,this.copyURIIcon=void 0,this.actionsTip=void 0,this.removeIcons=function(){this.closeIcon.remove("g"),this.expandIcon&&this.expandIcon.remove("g"),this.collapseIcon&&this.collapseIcon.remove("g"),this.focusIcon.remove("g"),this.copyURIIcon.remove("g"),this.closeIcon=void 0,this.expandIcon=void 0,this.collapseIcon=void 0,this.focusIcon=void 0,this.copyURIIcon=void 0,this.expandedState=!1},this.expandedState=!1,this.initIcons=function(r,n){const o=Object(i.a)().attr("class","d3-tip d3-actions-tip").customPosition((function(e,t){const r=t.target.getBoundingClientRect();return{top:r.top-20+"px",left:r.right+10+"px"}})).html((function(e){return e}));ae.call(o);r.isExpanded?(this.collapseIcon=d3.select(".menu-events").append("g").attr("class","collapse-icon").attr("name","collapse").attr("transform",(function(){return e(20,r)})),this.collapseIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.collapseIcon.append("path").attr("d","M22.67,12a.59.59,0,0,1-.53.65l-6.88.72H15.2a.59.59,0,0,1-.59-.65l.72-6.88A.58.58,0,0,1,16,5.33a.59.59,0,0,1,.53.65L16,11.11,21.3,5.79a.64.64,0,0,1,.91.91L16.89,12,22,11.49A.59.59,0,0,1,22.67,12ZM12.59,14.75l-6.75.85a.59.59,0,0,0-.51.66.58.58,0,0,0,.66.51l4.95-.62-5.2,5.2a.64.64,0,1,0,.91.91l5.2-5.2L11.23,22a.59.59,0,0,0,.51.66h.07a.59.59,0,0,0,.59-.52l.85-6.75a.59.59,0,0,0-.17-.49A.58.58,0,0,0,12.59,14.75Z").style("fill","var(--primary-color)"),this.collapseIcon.on("click",(function(){var e;(e=r).isExpanded=!1,K.removeNodeLeafLinks(e),pe()})).on("mouseover",(function(e){o.show(this.getAttribute("name"),e),l.cancel(le),l.cancel(ue)})).on("mouseout",(function(){o.hide(),ue=l((function(){xe()}),500)}))):(this.expandIcon=d3.select(".menu-events").append("g").attr("class","expand-icon").attr("name","expand").attr("transform",(function(){return e(20,r)})),this.expandIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.expandIcon.append("path").attr("d","M22.37,6.28l-.72,6.88a.59.59,0,0,1-.59.53H21a.59.59,0,0,1-.53-.65L21,7.9l-5.32,5.32a.64.64,0,0,1-.91-.91L20.1,7,15,7.53a.59.59,0,0,1-.12-1.18l6.88-.72a.59.59,0,0,1,.65.65ZM12.89,20.34,7.95,21l5.2-5.2a.64.64,0,0,0-.91-.91L7,20.05l.62-4.95A.59.59,0,0,0,6.48,15l-.85,6.75a.59.59,0,0,0,.59.67h.07L13,21.52a.59.59,0,1,0-.15-1.18Z").style("fill","var(--primary-color)"),this.expandIcon.on("click",(function(){ve(r,!1,n)})).on("mouseover",(function(e){o.show(this.getAttribute("name"),e),l.cancel(ue),l.cancel(le)})).on("mouseout",(function(){o.hide(),ue=l((function(){xe()}),500)}))),this.focusIcon=d3.select(".menu-events").append("g").attr("class","focus-icon").attr("name","focus").attr("transform",(function(){return e(20,r)})),this.focusIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.focusIcon.append("path").attr("d","M14.2,23.81a9.8,9.8,0,1,1,6.93-2.87h0A9.74,9.74,0,0,1,14.2,23.81Zm0-18.17a8.37,8.37,0,1,0,5.92,14.29h0A8.37,8.37,0,0,0,14.2,5.64Zm1.42,6.95a2,2,0,1,0,0,2.85A2,2,0,0,0,15.62,12.59Z").style("fill","var(--primary-color)"),this.focusIcon.on("click",(function(){t.$broadcast("onRootNodeChange",r.iri)})).on("mouseover",(function(e){o.show(this.getAttribute("name"),e),l.cancel(ue),l.cancel(le)})).on("mouseout",(function(){o.hide(),ue=l((function(){xe()}),500)})),this.copyURIIcon=d3.select(".menu-events").append("g").attr("class","icon-link").attr("name","link").attr("transform",(function(){return e(20,r)})),this.copyURIIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.copyURIIcon.append("path").attr("d","M 13.457031 10.164062 C 13.648438 10.164062 13.820312 10.242188 13.941406 10.363281 L 15.492188 11.859375 C 15.984375 12.332031 16.292969 12.992188 16.292969 13.714844 C 16.292969 14.441406 15.984375 15.097656 15.492188 15.574219 L 10.394531 20.496094 C 9.902344 20.972656 9.222656 21.265625 8.472656 21.265625 C 7.71875 21.265625 7.039062 20.972656 6.546875 20.496094 L 4.996094 19 C 4.507812 18.523438 4.203125 17.867188 4.203125 17.144531 C 4.203125 16.421875 4.507812 15.765625 4.996094 15.289062 L 7.542969 12.824219 C 7.667969 12.707031 7.84375 12.628906 8.035156 12.628906 C 8.417969 12.628906 8.726562 12.929688 8.726562 13.300781 C 8.726562 13.484375 8.648438 13.652344 8.523438 13.773438 L 5.976562 16.234375 C 5.738281 16.46875 5.589844 16.792969 5.589844 17.148438 C 5.589844 17.503906 5.738281 17.824219 5.976562 18.058594 L 7.527344 19.566406 C 7.773438 19.792969 8.105469 19.929688 8.472656 19.929688 C 8.835938 19.929688 9.167969 19.792969 9.414062 19.566406 L 14.511719 14.644531 C 14.753906 14.410156 14.90625 14.089844 14.90625 13.730469 C 14.90625 13.375 14.753906 13.054688 14.511719 12.820312 L 12.964844 11.324219 C 12.839844 11.203125 12.761719 11.039062 12.761719 10.855469 C 12.761719 10.488281 13.070312 10.1875 13.449219 10.1875 Z M 17.082031 3.976562 C 17.082031 3.976562 17.085938 3.976562 17.085938 3.976562 C 17.824219 3.976562 18.492188 4.261719 18.980469 4.722656 L 20.535156 6.203125 C 21.042969 6.679688 21.355469 7.34375 21.355469 8.082031 C 21.355469 8.792969 21.058594 9.441406 20.582031 9.914062 L 18.0625 12.402344 C 17.9375 12.527344 17.761719 12.605469 17.566406 12.605469 C 17.183594 12.605469 16.875 12.304688 16.875 11.9375 C 16.875 11.753906 16.949219 11.589844 17.070312 11.46875 L 19.605469 8.984375 C 19.847656 8.75 19.996094 8.429688 19.996094 8.070312 C 19.996094 7.714844 19.847656 7.394531 19.605469 7.160156 L 18.019531 5.667969 C 17.773438 5.445312 17.4375 5.304688 17.070312 5.300781 C 16.703125 5.304688 16.367188 5.453125 16.128906 5.691406 L 11.085938 10.667969 C 10.84375 10.898438 10.695312 11.222656 10.695312 11.578125 C 10.695312 11.933594 10.84375 12.257812 11.085938 12.488281 L 12.675781 13.980469 C 12.804688 14.101562 12.882812 14.273438 12.882812 14.457031 C 12.882812 14.828125 12.574219 15.128906 12.191406 15.128906 C 12.003906 15.128906 11.832031 15.054688 11.707031 14.9375 L 10.140625 13.457031 C 9.636719 12.980469 9.324219 12.316406 9.324219 11.582031 C 9.324219 10.863281 9.621094 10.214844 10.101562 9.742188 L 15.140625 4.765625 C 15.625 4.285156 16.304688 3.980469 17.054688 3.976562 Z M 17.082031 3.976562").style("fill","var(--primary-color)"),this.copyURIIcon.on("click",(function(){U(r.iri),xe(),o.hide()})).on("mouseover",(function(e){o.show("<div style='text-align: center;'><b>Copy to ClipBoard</b><br>"+r.iri+"</div>",e),l.cancel(ue),l.cancel(le)})).on("mouseout",(function(){o.hide(),ue=l((function(){xe()}),500)})),this.closeIcon=d3.select(".menu-events").append("g").attr("class","close-icon").attr("name","remove").attr("transform",(function(){return e(20,r)})),this.closeIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.closeIcon.append("path").attr("d","M14.94,14l5.87-5.87a.66.66,0,1,0-.94-.94L14,13.06,8.13,7.19a.66.66,0,0,0-.94.94L13.06,14,7.19,19.87a.66.66,0,1,0,.94.94L14,14.94l5.87,5.87a.66.66,0,1,0,.94-.94Z").style("fill","var(--primary-color)"),this.closeIcon.on("click",(function(){ge(r)})).on("mouseover",(function(e){o.show(this.getAttribute("name"),e),l.cancel(ue),l.cancel(le)})).on("mouseout",(function(){o.hide(),ue=l((function(){xe()}),500)})),this.animateMenu(r)},this.animateMenu=function(t){const r=d3.easeSin;let n=0;let i=20;this.expandIcon&&this.expandIcon.transition().duration(100).style("opacity",1).ease(r).attr("transform",(function(){return e(i,t)})).delay(n+=35),this.collapseIcon&&this.collapseIcon.transition().duration(100).style("opacity",1).ease(r).attr("transform",(function(){return e(i,t)})).delay(n+=35),this.copyURIIcon.transition().duration(100).style("opacity",1).ease(r).attr("transform",(function(){return i+=30,e(i,t)})).delay(n+=35),this.focusIcon.transition().duration(100).style("opacity",1).ease(r).attr("transform",(function(){return i+=30,e(i,t)})).delay(n+=35),this.closeIcon.transition().duration(100).style("opacity",1).ease(r).attr("transform",(function(){return i+=30,e(i,t)})).delay(n+=35),this.expandedState=!0}};function he(r,n,i){return e.showInfoPanel=!1,e.showPredicates=!1,e.showNodeInfo=!1,i.shiftKey&&(i.ctrlKey||i.metaKey)?(t.$broadcast("onRootNodeChange",r.iri),!1):i.ctrlKey||i.metaKey?(ge(r),!1):void 0!==e.openedNodeInfoPanel&&e.openedNodeInfoPanel===r?(e.pageslideExpanded=!1,e.openedNodeInfoPanel=void 0,!1):(ye(r),!0)}function ge(e){K.removeNode(e),pe()}function me(t){!function(t){e.nodeSelected=!0,null===t.data.types&&(t.data.types="greyColor"),K=new Y,k=D}(t),Ee(t)}function Ee(t,r,n){let i=t.data;i=_.filter(i,(function(e){return-1===_.findIndex(K.links,(function(t){return e.source===t.source.iri&&e.target===t.target.iri}))}));let o=[];const s=K.tripleLinksCopy.values();for(let e=0;e<K.tripleLinksCopy.size;e++){s.next().value.forEach(e=>{o.push(e)})}i=_.filter(i,(function(e){return-1===_.findIndex(o,(function(t){return e.source===t.source.iri&&e.target===t.target.iri}))})),i=_.filter(i,(function(e){return e.source!==e.target}));const l=function(e,t){let r=t.map((function(t){return t[e]}));return t.filter((function(t,n){return r.indexOf(t[e])===n}))}("iri",_.union(_.flatten(_.map(t.data,(function(e){return[{iri:e.source,isTriple:e.isTripleSource},{iri:e.target,isTriple:e.isTripleTarget}]}))))),c=_.map(K.nodes,(function(e){return{iri:e.iri,isTriple:Boolean(e.isTriple)}})),p=K.tripleNodes.values();for(let e=0;e<K.tripleNodes.size;e++){p.next().value.forEach(e=>{c.push({iri:e.iri,isTriple:e.isTriple})})}const f=_.reject(l,(function(e){return _.some(c,e)}));if(0===f.length)(n||0===i.length)&&a.info(I.instant("graphexplore.error.node.connections")),K.addAndMatchLinks(i),pe();else{const t=[],n=[],o=G();_.forEach(f,(function(r,i){t.push(u({url:"rest/explore-graph/node",method:"GET",params:{iri:r.isTriple?Q(r.iri):r.iri,config:e.configLoaded.id,languages:e.shouldShowSettings()?o.languages:[],includeInferred:o.includeInferred,sameAsState:o.sameAsState}}).then((function(e){n[i]=e.data})))})),d.all(t).then((function(){_.forEach(n,(function(e,t){const i=2*Math.PI*t/n.length,o=(r?r.x:0)+1e3*Math.cos(i)/3,s=(r?r.y:0)+1e3*Math.sin(i)/3;e.isTriple?K.addTriple(e,o,s):K.addNode(e,o,s)})),K.addAndMatchLinks(i),r&&(r.isExpanded=!0),pe()}))}}function ve(t,r,n){if(ce.getLoadingState())return;ce.init(t,n);const i=G(),o=t.iri;u({url:"rest/explore-graph/links",method:"GET",params:{iri:o,linksLimit:i.linksLimit,includeInferred:i.includeInferred,config:e.configLoaded.id,preferredTypes:e.shouldShowSettings()?i.preferredTypes:[],rejectedTypes:e.shouldShowSettings()?i.rejectedTypes:[],preferredPredicates:e.shouldShowSettings()?i.preferredPredicates:[],rejectedPredicates:e.shouldShowSettings()?i.rejectedPredicates:[],preferredTypesOnly:e.shouldShowSettings()?i.preferredTypesOnly:[],preferredPredicatesOnly:e.shouldShowSettings()?i.preferredPredicatesOnly:[],languages:e.shouldShowSettings()?i.languages:[],sameAsState:i.sameAsState,includeSchema:i.includeSchema}}).then((function(e){Ee(e,t,r)}),(function(t){const r=getError(t.data);a.error(r,I.instant("graphexplore.error.exploring.node")),e.loading=!1,ce.setLoadingState(!1)}))}function xe(){angular.isDefined(fe)&&fe.expandedState&&fe.removeIcons()}function ye(t){se.stop(),e.openedNodeInfoPanel=t,e.showNodeInfo=!0,e.showFilter=!1,e.showPredicates=!1,e.nodeLabels=t.labels,e.nodeTypes=t.types,e.rdfRank=t.rdfRank,e.nodeIri=t.iri,e.resourceType=t.isTriple?"triple":"uri",e.encodedIri=t.isTriple?encodeURIComponent(Q(t.iri)):encodeURIComponent(t.iri),e.showInfoPanel=!0,e.rdfsLabel=t.labels[0].label,e.rdfsComment=t.comment,e.expanded=!1,e.propertiesQueryObj.query="",e.dataNodeKeysQuery="";const r=G();u.get("rest/explore-graph/properties",{params:{iri:t.isTriple?Q(t.iri):t.iri,config:e.configLoaded.id,languages:e.shouldShowSettings()?r.languages:[],includeInferred:r.includeInferred,sameAsState:r.sameAsState,rejectedPredicates:e.shouldShowSettings()?r.rejectedPredicates:[]}}).then((function(t){e.data=_.mapKeys(t.data,(function(t,r){return e.replaceIRIWithPrefix(r)})),e.propertiesObj.items=[],_.forEach(e.data,(function(t,r){e.propertiesObj.items.push({key:r,value:t})})),e.nodeImage=void 0,e.propertiesNotFiltered=e.propertiesObj.items;const r=_.find(e.propertiesObj.items,(function(e){return"image"===e.key}));r&&(e.nodeImage=r.value[0].v),e.propertiesObj.items=_.reject(e.propertiesObj.items,(function(e){return"image"===e.key})),e.propertiesNotFiltered=e.propertiesObj.items}),(function(e){a.warning(getError(e.data),"Error")}))}function Te(e){Ce("predicate","var(--primary-color-dark)",e),Ce("predicates","var(--primary-color-dark)",e);let t=document.getElementsByClassName("link");t&&_.each(t,(function(t){let r=t.__data__;(r.source.iri.indexOf(e.iri)>=0||r.target.iri.indexOf(e.iri)>=0)&&(t.style.stroke="var(--primary-color-dark)",t.style.strokeWidth=4)}));let r=document.getElementsByClassName("arrow-marker");r&&_.each(r,(function(t){let r=t.__data__;(r.source.iri.indexOf(e.iri)>=0||r.target.iri.indexOf(e.iri)>=0)&&(t.style.stroke="var(--primary-color-dark)",t.__data__.target.isTriple||t.setAttribute("refX","23"))}))}function Ce(e,t,r){let n=document.getElementsByClassName(e);n&&_.each(n,(function(e){let n=e.__data__;r?((n.source.iri.indexOf(r.iri)>=0||n.target.iri.indexOf(r.iri)>=0)&&(e.style.fill=t),H(r.iri)===q(n)&&(e.textContent=r.pred,e.style.fill=t),r.oppLinkIRI&&r.oppLinkIRI===q(n)&&(e.textContent=r.oppTriplePred,e.style.fill=t)):(e.style.fill=t,e.textContent=Se(n))}))}function Ne(){_.each(e.predicates,(function(e){let t=document.getElementById(e.linkId+e.nodeIndex);t&&(t.style.fontWeight="normal")}));let t=document.getElementsByClassName("link");t&&_.each(t,(function(e){e.style.stroke="#999",e.style.strokeWidth=1})),Ce("predicate",""),Ce("predicates","");let r=document.getElementsByClassName("arrow-marker");r&&_.each(r,(function(e){e.style.stroke="#999",e.__data__.target.isTriple||e.setAttribute("refX","59")}))}function Ie(e){let t=H(e);if(K.tripleNodes.has(t))return K.tripleNodes.get(t).find(t=>t.iri===e)}function Se(e){return e.predicates.length>1?e.predicates.length+" predicates":Le(e.predicates[0])}function Le(t){const r=e.replaceIRIWithPrefix(t);return r.length===t.length?t.split("/")[t.split("/").length-1]:r}e.toggleSidePanel=function(){e.pageslideExpanded=!e.pageslideExpanded},e.closeInfoPanel=function(){e.pageslideExpanded=!1,e.openedNodeInfoPanel=void 0,e.predicates=[],F=null,l((function(){e.showInfoPanel=!1}))},e.clickLink=function(t){if(K.tripleNodes.has(t.linkId)){Ne();let r=K.tripleNodes.get(t.linkId)[t.nodeIndex];ye(r),e.showPredicates=!0;let n=document.getElementById(t.linkId+t.nodeIndex);n&&(n.style.fontWeight="bold");let i={};const o=K.tripleLinksCopy.values();for(let e=0;e<K.tripleLinksCopy.size;e++){let e=o.next().value;e.length>1&&e.every(t=>t.source.iri===r.iri?(i.iri=e[0].source.iri,t.target.isTriple&&(i.oppLinkIRI=H(t.target.iri),i.oppTriplePred=Le(t.target.iri.split(" ")[1])),i.pred=Le(r.iri.split(" ")[1]),1===t.predicates.length&&(i.linkPred=t.predicates[0]),!1):t.target.iri!==r.iri||(i.iri=e[0].target.iri,t.source.isTriple&&(i.oppLinkIRI=H(t.source.iri),i.oppTriplePred=Le(t.source.iri.split(" ")[1])),i.pred=Le(r.iri.split(" ")[1]),1===t.predicates.length&&(i.linkPred=t.predicates[0]),!1))}i.iri||(i.iri=r.iri,i.pred=Le(r.iri.split(" ")[1])),Te(i)}},e.splitPredicate=function(e){return e.split("/")[e.split("/").length-1]},e.getActiveRepository=function(){return r.getActiveRepository()},e.isLoadingLocation=function(){return r.isLoadingLocation()},e.hasActiveLocation=function(){return r.hasActiveLocation()},e.rotate=function(e){xe();const t=10*(e?1:-1)*Math.PI/180,r=Math.cos(t),n=Math.sin(t);d3.selectAll(".node-wrapper").each((function(e){e.x=r*(e.x-500)+n*(e.y-500)+500,e.y=-n*(e.x-500)+r*(e.y-500)+500,e.fixed&&(e.fx=e.x,e.fy=e.y)})),se.alpha(1).restart()},e.openUri=function(t,r){if(!r){const r={};e.configLoaded.id!==e.defaultGraphConfig.id&&(r.config=e.configLoaded.id),r.uri=t,e.pushHistory(r,{uri:t,config:e.configLoaded})}e.$broadcast("onRootNodeChange",t)},e.saveOrUpdateGraph=function(){const t=JSON.stringify(K.copyState()),r={id:e.lastSavedGraphId,name:e.lastSavedGraphName,data:t,shared:e.shared};r.id?e.saveGraphModal("update",r):e.saveGraphModal("new",r)},e.renameSavedGraph=function(t){e.saveGraphModal("rename",{id:t.id,name:t.name,config:t.config,shared:t.shared})};const Ae=function(t){T.editSavedGraph(t).success((function(){e.lastSavedGraphName=t.name,e.shared=t.shared,e.refreshSavedGraphs(),a.success(I.instant("graphexplore.saved.graph.was.edited",{name:t.name}))})).error((function(e){const t=getError(e);a.error(t,I.instant("graphexplore.error.cannot.edit"))}))};e.saveGraphModal=function(t,r,n){E.open({templateUrl:"js/angular/graphexplore/templates/modal/save-graph.html",controller:"SaveGraphModalCtrl",resolve:{data:function(){return{mode:t,graph:r,graphExists:n,shared:r.shared}}}}).result.then((function(t){if(t.restart)e.saveGraphModal(t.mode,t.graph,!1);else switch(t.mode){case"new":!function(t){e.configLoaded&&(t.config=e.configLoaded.id),T.addNewSavedGraph(t).success((function(r,n,i){e.lastSavedGraphName=t.name,e.lastSavedGraphId=i()["x-saved-graph-id"],e.shared=t.shared,e.refreshSavedGraphs(),a.success(I.instant("graphexplore.saved.graph",{name:t.name}))})).error((function(r,n){if(422===n)e.saveGraphModal("new",t,!0);else{const e=getError(r);a.error(e,I.instant("graphexplore.error.cannot.create.graph"))}}))}(t.graph);break;case"update":case"rename":Ae(t.graph)}}))},e.refreshSavedGraphs=function(){T.getSavedGraphs().success((function(t){e.savedGraphs=t})).error((function(e){const t=getError(e);a.error(t,I.instant("graphexplore.error.getting.saved.graphs"))}))},e.loadSavedGraph=function(t,r){t.owner?(e.lastSavedGraphName=t.name,e.lastSavedGraphId=t.id,e.shared=t.shared,e.configLoaded=e.findConfigById(t.config)):(e.lastSavedGraphName=null,e.lastSavedGraphId=null,e.shared=t.shared),e.configLoaded||(e.configLoaded=e.defaultGraphConfig),f.url("?saved="+t.id),K.restoreState(JSON.parse(t.data)),r||e.pushHistory({saved:t.id},{savedGraph:t})},e.copyToClipboardSavedGraph=function(e){U([location.protocol,"//",location.host,location.pathname,"?saved=",e.id].join(""))},e.deleteSavedGraph=function(t){m.openSimpleModal({title:I.instant("common.confirm"),message:I.instant("graphexplore.confirm.delete.graph",{graphName:t.name}),warning:!0}).result.then((function(){!function(t){T.deleteSavedGraph(t).success((function(){e.refreshSavedGraphs(),a.success(I.instant("graphexplore.saved.graph.was.deleted",{name:t.name}))})).error((function(e){const t=getError(e);a.error(t,I.instant("graphexplore.error.cannot.delete"))}))}(t)}))},e.openIRI=function(t,r){return r.shiftKey?e.$broadcast("onRootNodeChange",t):window.open(t,"_blank"),!1},e.togglePinAllNodes=function(){xe();const t=angular.isUndefined(e.numberOfPinnedNodes)||e.numberOfPinnedNodes<=0;e.numberOfPinnedNodes=0,d3.selectAll(".node").each((function(r){r.fixed=t,t?(e.numberOfPinnedNodes++,r.fx=r.x,r.fy=r.y):(r.fx=null,r.fy=null)})),se.alpha(1).restart()},$("body").on("keydown",(function(t){!S.isActive()&&"input"!==t.target.nodeName&&e.nodeSelected&&(37===t.keyCode?e.rotate(!0):39===t.keyCode&&e.rotate(!1))})),e.getLiteralFromPropValue=function(e){return e.substring(e.indexOf(":")+1)}}function a(e,t,r,n){switch(e.mode=r.mode,e.graph=_.cloneDeep(r.graph),e.graphExists=r.graphExists,e.mode){case"new":e.title=n.instant("graphexplore.create.new.graph"),e.okButtonText=n.instant("common.create.btn");break;case"update":e.title=n.instant("graphexplore.update"),e.okButtonText=n.instant("common.save.btn");break;case"rename":e.title=n.instant("graphexplore.rename"),e.okButtonText=n.instant("common.save.btn")}e.ok=function(){e.form.$valid&&t.close({graph:e.graph,mode:e.mode})},e.saveNew=function(){e.graph.name=e.graph.name+" (new)",t.close({graph:e.graph,mode:"new",restart:!0})},e.cancel=function(){t.dismiss("cancel")}}angular.module("graphdb.framework.graphexplore.controllers.graphviz",["ui.scroll.jqlite","ui.scroll","toastr","ui.bootstrap","ngTagsInput","graphdb.framework.utils.localstorageadapter"]).controller("GraphsVisualizationsCtrl",s).controller("SaveGraphModalCtrl",a).config(["$uibTooltipProvider",function(e){e.options({appendToBody:!0})}]),s.$inject=["$scope","$rootScope","$repositories","$licenseService","toastr","$timeout","$http","ClassInstanceDetailsService","AutocompleteRestService","$q","$location","$jwtAuth","UiScrollService","ModalService","$uibModal","$window","LocalStorageAdapter","LSKeys","SavedGraphsRestService","GraphConfigRestService","RDF4JRepositoriesRestService","$translate","GuidesService"],a.$inject=["$scope","$uibModalInstance","data","$translate"]},106:function(e,t,r){"use strict";r.r(t);r(57),r(10);function n(e,t,r,n,i,o,s,a,l,u,c,p,d,f,h){var g;e.page=1,e.totalPages=5,e.helpHidden=1===d.get(f.HIDE_GRAPH_CONFIG_HELP),e.toggleHelp=function(t){void 0===t&&(t=d.get(f.HIDE_GRAPH_CONFIG_HELP)),1!==t?(d.set(f.HIDE_GRAPH_CONFIG_HELP,1),e.helpHidden=!0):(d.set(f.HIDE_GRAPH_CONFIG_HELP,0),e.helpHidden=!1)},e.fixedVisualCallback=function(t,r){e.newConfig.startIRI=t,e.newConfig.startIRILabel=r,g=!0},e.isDefaultGraph=function(e){return"Minimal"===e.name||"Advanced"===e.name},e.isUserGraph=function(t){return!e.isDefaultGraph(t)},e.getSampleName=function(e,t){const r=e[t+"Description"];return r||(e.id?"Copy of "+e.name:e.name)};const m=u.configName;function E(e){n.warning(e)}function v(t){let r;return"query"===t.startMode&&1===e.page?r=t.startGraphQuery:2===e.page?r=t.expandQuery:3===e.page?r=t.resourceQuery:4===e.page?r=t.predicateLabelQuery:5===e.page&&(r=t.resourcePropertiesQuery),angular.isDefined(r)?r:""}function x(){function o(){e.getAutocompletePromise=l.checkAutocompleteStatus()}a.getGraphConfigSamples().success((function(t){e.samples=_.filter(t,(function(t){return!t.id||e.newConfig.id!==t.id||(e.revertConfig=t,!1)}))})).error((function(e){n.error(getError(e),h.instant("graphexplore.error.graph.configs"))})),e.createGraphConfig=function(){a.createGraphConfig(e.newConfig).success((async function(){await c.showToastMessageWithDelay("graphexplore.saved.new.config"),r.url("graphs-visualizations")})).error((function(e){n.error(getError(e),h.instant("graphexplore.error.could.not.create"))}))},e.updateGraphConfig=function(){a.updateGraphConfig(e.newConfig).success((async function(){await c.showToastMessageWithDelay("graphexplore.saved.config"),r.url("graphs-visualizations")})).error((function(e){n.error(getError(e),h.instant("graphexplore.error.could.not.save"))}))},e.$on("autocompleteStatus",(function(){o()})),o(),e.getNamespacesPromise=p.getNamespaces(e.getActiveRepository());const s=function(e,t,r,n,i,o){t?a.validateQuery(t,r,n,i,o).success((function(){e()})).error((function(e){E(getError(e))})):e()};function u(){d()&&e.$broadcast("addStartFixedNodeAutomatically",{startIRI:e.newConfig.startIRI})}function d(){return 1===e.page&&"node"===e.newConfig.startMode}e.validateCurrentPage=function(t){e.updateModel(),1===e.page?"node"!==e.newConfig.startMode||e.newConfig.startIRI?"query"!==e.newConfig.startMode||e.newConfig.startGraphQuery?"query"===e.newConfig.startMode?s(t,e.newConfig.startGraphQuery,"graph"):t():E(h.instant("graphexplore.provide.query")):E(h.instant("graphexplore.select.start.node")):2===e.page?s(t,e.newConfig.expandQuery,"construct",["node"]):3===e.page?s(t,e.newConfig.resourceQuery,"tuple",["node"],[],["type","label","comment","rank"]):4===e.page?s(t,e.newConfig.predicateLabelQuery,"tuple",["edge"],["label"]):5===e.page&&s(t,e.newConfig.resourcePropertiesQuery,"tuple",["node"],["property","value"])},e.goToPage=function(t){e.page!==t&&e.validateCurrentPage((function(){e.showEditor(),e.page=t,e.notoolbar=1!==e.page}))},e.goToPreviousPage=function(){e.page>1&&e.goToPage(e.page-1),d()&&(g=!1)},e.goToNextPage=function(){u(),("node"!==e.newConfig.startMode||g)&&e.goToPage(e.page+1)},e.saveGraphConfig=function(){u(),d()&&!g||(e.newConfig.startQueryIncludeInferred=e.currentQuery.inference,e.newConfig.startQuerySameAs=e.currentQuery.sameAs,e.validateCurrentPage((function(){e.newConfig.name?e.isUpdate?e.updateGraphConfig(e.newConfig):e.createGraphConfig(e.newConfig):E(h.instant("graphexplore.provide.config.name"))})))},e.updateModel=function(){const t=window.editor.getValue().trim();"query"===e.newConfig.startMode&&1===e.page?e.newConfig.startGraphQuery=t:2===e.page?e.newConfig.expandQuery=t:3===e.page?e.newConfig.resourceQuery=t:4===e.page?e.newConfig.predicateLabelQuery=t:5===e.page&&(e.newConfig.resourcePropertiesQuery=t)},e.setQuery=function(e){window.editor.setValue(e||" ")},e.updateDirty=function(){if(e.revertConfig){const t=v(e.revertConfig),r=window.editor.getValue().trim();e.queryEditorIsDirty=t!==r}},e.updateEditor=function(){t((function(){e.currentQuery.query=v(e.newConfig),i.isActiveRepoOntopType()&&(e.nocount=!0),e.currentQuery.inference=e.newConfig.startQueryIncludeInferred,e.currentQuery.sameAs=e.newConfig.startQuerySameAs,O(),S(e.currentQuery.id)}),100)},e.showEditor=function(){window.editor&&window.editor.xhr&&window.editor.xhr.abort(),e.viewMode="yasr"},e.showPreview=function(){e.currentQuery.outputType="table",e.runQuery()},e.revertEditor=function(){e.setQuery(v(e.revertConfig))},e.$watch("newConfig.startMode",(function(r){"query"===r&&t((function(){e.updateEditor()}),0)})),e.$watch("page",(function(r){("query"===e.newConfig.startMode||r>1)&&t((function(){e.showEditor(),e.updateEditor()}),0)}))}e.newConfig={startQueryIncludeInferred:!0,startQuerySameAs:!0},e.newConfig.startMode="search",e.isUpdate=!1,e.shared=!1,e.encodeQuery=function(e){return encodeURIComponent(e)},m?(e.isUpdate=!0,a.getConfig(m).success((function(t){e.newConfig=t,x()})).error((function(e){n.error(getError(e),h.instant("created.connector",{name:m}))}))):(e.isUpdate=!1,x());const y={id:"1",name:"",query:"select * where { \n\t?s ?p ?o .\n} limit 100 \n",inference:e.newConfig.startQueryIncludeInferred,sameAs:e.newConfig.startQuerySameAs};function T(e){}function C(t,r,n){const i=angular.element(document.getElementById("yasr-inner"));e.queryIsRunning=t,t?(e.queryStartTime=Date.now(),e.countTimeouted=!1,e.progressMessage=r,e.extraMessage=n,i.addClass("hide")):(e.progressMessage="",e.extraMessage="",i.removeClass("hide")),null===e.$$phase&&e.$apply()}function N(r){function n(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0}const i=r;if(e.orientationViewMode){if("yasr"===e.viewMode){let e=n()-document.querySelector(".CodeMirror-wrap").getBoundingClientRect().top;e-=40,document.querySelector(".CodeMirror-wrap").style.height=e+"px"}else e.noPadding={},document.querySelector(".CodeMirror-wrap").style.height="";document.getElementById("yasr").style.minHeight=""}else if(e.noPadding={paddingRight:15,paddingLeft:0},window.editor&&document.querySelector(".CodeMirror-wrap")){let e=n()-document.querySelector(".CodeMirror-wrap").getBoundingClientRect().top;e-=40,document.querySelector(".CodeMirror-wrap").style.height=e+"px",document.getElementById("yasr").style.minHeight=e+"px"}else{let r;r=t(i?function(){e.fixSizesOnHorizontalViewModeSwitch(i)}:e.fixSizesOnHorizontalViewModeSwitch,100),e.$on("$destroy",(function(){t.cancel(r)}))}window.yasr&&window.yasr.container&&t((function(){window.yasr.container.resize()}),100)}function I(){N(!0)}function S(e){t((function(){$('a[data-id = "'+e+'"]').tab("show")}),0)}function L(t,r){e.executedQueryTab=e.currentQuery,r&&"SELECT"!==window.editor.getQueryType()&&"CONSTRUCT"!==window.editor.getQueryType()&&"DESCRIBE"!==window.editor.getQueryType()?n.warning(h.instant("query.editor.warning.msg")):"update"!==window.editor.getQueryMode()?(e.explainRequested=r,e.queryIsRunning||(t?e.currentTabConfig.resultsCount=0:e.resetCurrentTabConfig(),e.viewMode="editor",e.orientationViewMode&&e.fixSizesOnHorizontalViewModeSwitch(),C(!0,h.instant("evaluating.query.msg")),window.editor.query())):n.warning(h.instant("cannot.execute.update.error"))}function A(){C(!0,h.instant("common.refreshing.namespaces"),h.instant("common.extra.message")),p.getRepositoryNamespaces().success((function(t){const r={};t.results.bindings.forEach((function(e){r[e.prefix.value]=e.namespace.value})),e.namespaces=r})).error((function(t){e.repositoryError=getError(t)})).finally((function(){C(!1)}))}function b(){o.addKnownPrefixes(JSON.stringify(window.editor.getValue())).success((function(e){angular.isDefined(window.editor)&&angular.isDefined(e)&&e!==window.editor.getValue()&&window.editor.setValue(e)})).error((function(e){let t=getError(e);return n.error(t,h.instant("common.add.known.prefixes.error")),!0}))}function R(t){let r=void 0;return angular.forEach(e.tabsData,(function(e){if(e.name===t.name&&e.query===t.body)return r=e.id,e})),r}function O(){if(!window.editor)return void t(()=>O());e.tabsData=[e.currentQuery];let r=e.currentQuery;null==e.currentQuery.query||""===e.currentQuery.query?window.editor.setValue(" "):window.editor.setValue(e.currentQuery.query),t((function(){e.currentTabConfig={},e.currentTabConfig.queryType=r.queryType,e.currentTabConfig.resultsCount=r.resultsCount,e.currentTabConfig.offset=r.offset,e.currentTabConfig.allResultsCount=r.allResultsCount,e.currentTabConfig.page=r.page,e.currentTabConfig.pageSize=r.pageSize,e.currentTabConfig.timeFinished=r.timeFinished,e.currentTabConfig.timeTook=r.timeTook,e.currentTabConfig.sizeDelta=r.sizeDelta,e.$apply()}),0),$("#yasr").css("padding","0")}function w(e){return $(e).attr("data-id")}e.resetCurrentTabConfig=function(){e.currentTabConfig={pageSize:100,page:1,allResultsCount:0,resultsCount:0}},e.queryExists=!1,e.resetCurrentTabConfig(),e.tabsData=e.tabs=[y],e.saveTab=function(t){const r=function(t){for(let r=0;r<e.tabsData.length;r++){if(e.tabsData[r].id===t)return r}}(t);if(void 0===r)return{};const n=e.tabsData[r];return e.saveQueryToLocal(n),n},e.loadTab=O,e.addNewTab=function(e,t,r){},e.runQuery=L,e.getNamespaces=A,e.changePagination=function(){L(!0,e.explainRequested)},e.toggleSampleQueries=function(){},e.addKnownPrefixes=b,e.getExistingTabId=R,e.querySelected=function(t){const r=R(t);e.toggleSampleQueries(),angular.isDefined(r)?S(r):e.addNewTab(null,t.name,t.body)},e.saveQueryToLocal=T,e.setLoader=C,e.getLoaderMessage=function(){const t=(Date.now()-e.queryStartTime)/1e3,r=e.getHumanReadableSeconds(t);let n;n=e.progressMessage?e.progressMessage+"... "+r:h.instant("common.running.operation",{timeHuman:r});e.extraMessage&&t>10&&(n+="\n"+e.extraMessage);return n},e.fixSizesOnHorizontalViewModeSwitch=N,e.changeViewMode=function(r){e.viewMode="none",e.orientationViewMode=!e.orientationViewMode,N(),$(".dataTables_filter").remove(),$(".resultsTable").remove(),t((function(){O(),S(r)}),100)},e.showHideEditor=I,e.focusQueryEditor=function(){angular.element(document).find(".editable-input").is(":focus")||angular.element(document).find(".CodeMirror textarea:first-child").focus()},e.orientationViewMode=!0,e.orientationViewMode||I(),e.getActiveRepository()&&A(),e.$on("$destroy",(function(){window.editor=null,window.yasr=null})),$("textarea").on("paste",(function(){t((function(){b()}),0)})),e.$watchCollection("[currentQuery.inference, currentQuery.sameAs]",(function(){e.currentQuery})),e.$on("tabAction",(function(t,r){r.relatedTarget&&e.saveTab(w(r.relatedTarget)),e.loadTab(w(r.target))})),e.$on("deleteAllexeptSelected",(function(t,r){e.tabsData=r,e.tabs=r})),e.currentQuery=_.cloneDeep(y),e.showSampleQueries=!1,e.savedQuery={},e.sampleQueries={},e.getResultsDescription=function(){},e.getUpdateDescription=function(){},e.getStaleWarningMessage=function(){}}angular.module("graphdb.framework.graphexplore.controllers.graphviz.config",["graphdb.framework.utils.notifications","graphdb.framework.utils.localstorageadapter"]).controller("GraphConfigCtrl",n),n.$inject=["$scope","$timeout","$location","toastr","$repositories","SparqlRestService","$filter","GraphConfigRestService","AutocompleteRestService","$routeParams","Notifications","RDF4JRepositoriesRestService","LocalStorageAdapter","LSKeys","$translate"]},107:function(e,t,r){"use strict";r.r(t);var n=r(318),i=r(324),o=r(316),s=r(317);r(10);function a(e,t,r,a,l,u,c,p,d,f,h,g,m){return{restrict:"AE",template:'<div id="classChart"></div>',scope:{classHierarchyData:"=",flattenedClassNames:"=",selectedClass:"=",currentSliderValue:"=",showClassInfoPanel:"=",showExternalElements:"=",hidePrefixes:"=",currentBrowserLimit:"="},link:function(c,E,v){!function(c,E){var v,x,y=d3.pack().size([780,780]),T=d3.scaleLinear().domain([0,4]).range(["hsl(19, 70%, 90%)","hsl(19, 70%, 50%)"]).interpolate(d3.interpolateHcl),C=d3.select("#classChart").insert("svg:svg","h2").attr("viewBox","0 0 800 800").attr("preserveAspectRatio","xMidYMid meet").on("dblclick.zoom",null);function N(){return C.append("svg:g").attrs({id:"main-group",transform:"translate(400,400)"})}function I(){return"true"===h.get(g.CLASS_HIERARCHY_HIDE_PREFIXES)}function S(){var e=s.a.Export.getCSSRules("css/rdf-class-hierarchy-labels.css?v=2.5.1-TR1");d3.selectAll("#main-group").append("defs"),$("defs").append('<style type="text/css"><![CDATA['+e+"]]></style>"),d3.selectAll("g").style("opacity",1);var t=s.a.Export.generateBase64ImageSource("#classChart svg");d3.select(this).attrs({href:t,download:"class-hierarchy-"+u.getActiveRepository()+".svg"})}c.hidePrefixes=I();var L,A,b=N();if(!c.classHierarchyData.classCount&&u.getActiveRepository()&&!u.isSystemRepository()){e.loader=!0,e.hierarchyError=!1;const t=h.get("classHierarchy-selectedGraph-"+u.getActiveRepository());r.getClassHierarchyData(null!==t?t.contextID.uri:"").success((function(t,r,n){e.loader=!1,207===r&&p.warning(m.instant("graphexplore.update.diagram"),m.instant("graphexplore.repository.data.changed")),c.classHierarchyData=t,d3.select("#download-svg").on("mouseover",S)})).error((function(t){e.loader=!1,e.hierarchyError=getError(t),p.error(m.instant("graphexplore.error.request.failed",{name:f,error:getError(t)}))}))}var R,O,w,P,D,k,M,F={};function G(r,s,u,p){O&&O(),w&&w(),d3.selectAll("#main-group").remove(),b=N(),i.a.SingleChild.addPlaceholders(r,!0),(x=d3.hierarchy(r)).sum((function(e){return e.size})),R=u||x,y(x);var h,g=x.descendants();R.isInFocusTransitive=!0,i.a.SingleChild.removePlaceholders(g),i.a.SingleChild.centerNodes(g),i.a.SingleChild.makePositionsRelativeToZero(g),v||(v=Object(n.a)().attr("class","d3-tip").customPosition((function(e,t){return{top:"inherit",bottom:a.innerHeight-t.clientY+"px",right:a.innerWidth-t.clientX+"px"}})).html((function(e){return e.data.name})),C.call(v));var m=b.selectAll("circle").data(g).enter().append("g");s.doFade&&m.each((function(e){o.a.Transition.fadeIn(d3.select(this),550)}));var E,I=[],S=m.append("circle").attr("class",(function(e){return e.data.role})).attr("guide-selector",(function(e){return"class-"+e.data.name})).style("fill",(function(e){return e.children?T(e.depth):"#E0D0D0"})).each((function(e){if(e.circle=d3.select(this),e.data.name!==f){var t=e.data.name;I.push({name:t}),F[[t]]=e,e.circle.classed("rdf-class",!0),e.circle.on("mouseover",(function(t){s.noPrefixes||e.textHidden?v.show(e,t):v.hide(e)})),e.circle.on("mouseout",v.hide)}})).on("gdb-focus",(e,t)=>A(t)).on("gdb-zoom",(e,t)=>q(t));function P(e){d3.selectAll(".selected").classed("selected",e.selected=!1),e.circle.classed("selected",e.selected=!0),E=e}function D(){c.showClassInfoPanel=!1}I&&(I=_.uniqBy(I,"name"),c.flattenedClassNames=I);var k=o.a.Click.delayDblClick();d3.selectAll(".parent, .topLevelParent, .child, .root").call(k),A=function(e){q(e),e.data.name===f?(D(),d3.selectAll(".selected").classed("selected",!1)):(P(e),c.selectedClass=E,c.showClassInfoPanel=!0,c.$on("sidePanelClosed",(function(t){d3.selectAll(".selected").classed("selected",e.selected=!1)})))},k.on("click",(function(e,t){t.data.id&&a.history.pushState({id:t.data.id},"classHierarchyPage"+t.data.id,"hierarchy#"+t.data.id),v.hide(),A(t)})),k.on("dblclick",(function(t,n){n!==r&&(v.hide(),P(n),e.$broadcast("goToDomainRangeGraphView",E,R),t.stopPropagation())}));var M=0;C.on("wheel",(function(e){v.hide(),e.preventDefault(),e.stopPropagation();var t=(new Date).getTime();if(t-M>100){M=t;var r="";e.deltaY<=-1?r="in":e.deltaY>=1&&(r="out");var n=e.target.__data__;if(n||(n=R),"in"===r){if(n!==R){for(;n.parent&&!n.parent.isInFocusTransitive;)n=n.parent;n.depth<R.depth&&(n=R)}if(n===R&&n.children){for(var i=n.children[0],o=1;o<n.children.length;o++)n.children[o].sortingRank>i.sortingRank&&(i=n.children[o]);i.children&&(n=i)}else n.children||(n=n.parent);q(n,!0)}else"out"===r&&(n=R.parent)&&q(n,!0);R.data.name===f&&a.history.replaceState({id:1},"classHierarchyPage1","hierarchy#1"),U()}}));var G=b.selectAll("text").data(g).enter().append("text").attr("class",(function(e){return e.children&&e.children.length?"label":"label child-label"})).each((function(e){e.textSel=d3.select(this)}));s.noPrefixes?(G.each((function(e){var t=e.data.name.indexOf(":");e.data.name.indexOf("http://")>-1?e.noPrefixName=e.data.name:t>-1&&(e.noPrefixName=e.data.name.substring(t+1))})),G.style("font-size",(function(e){return o.a.Text.calcFontSize(e.noPrefixName,e.r)})).text((function(e){return o.a.Text.getTextWithElipsisIfNeeded(e.noPrefixName,e.r/3)}))):G.style("font-size",(function(e){return o.a.Text.calcFontSize(e.data.name,e.r)})).text((function(e){return o.a.Text.getTextWithElipsisIfNeeded(e.data.name,e.r/3)})),G.style("display",(function(e){return e.parent&&e.parent.data===R.data?(e.textHidden=this.textContent.indexOf("...")+3===this.textContent.length,null):(e.textHidden=!0,"none")})),s.doFade&&!s.keepPrevState&&G.each((function(e){o.a.Transition.fadeIn(d3.select(this),550)})),L=function(){function e(e){e&&S.each((function(t){+e===t.data.id&&A(t)}))}var r=t.hash();a.onpopstate=function(t){t.state&&e(t.state.id)},e(r)};var B=b.selectAll("circle, text");function j(e,t){var r=800/e[2];h=e,B.attr("transform",(function(t){return"translate("+(t.x-e[0])*r+","+(t.y-e[1])*r+")"})),S.attr("r",(function(e){return e.r*r})),t&&G.each((function(e){e.data.fullName!==R.data.topLevelParentUri&&R.data.topLevelParentUri!==f||(e.textSel.style("display","none"),R.children&&R.children.length?_.each(R.children,(function(e){e.textSel.style("display","inline")})):R.textSel.style("display","inline"),R.parent&&_.each(R.parent.children,(function(e){e.data.name!==R.data.name&&e.textSel.style("display","inline")})))})),G.style("font-size",(function(e){return s.noPrefixes?o.a.Text.calcFontSize(e.noPrefixName,e.r*r):o.a.Text.calcFontSize(e.data.name,e.r*r)})).text((function(e){return s.noPrefixes?o.a.Text.getTextWithElipsisIfNeeded(e.noPrefixName,e.r*r/3):o.a.Text.getTextWithElipsisIfNeeded(e.data.name,e.r*r/3)}))}function V(e){var t=2*e+20;return 2*e/t<.3&&(t=2*e+2),t}function H(e){!e.isInFocusTransitive&&e.parent&&e.parent.isInFocusTransitive?(e.textHidden=this.textContent.indexOf("...")+3===this.textContent.length,this.style.display=""):(e.textHidden=!0,this.style.display="none")}function q(e,t){if(l((function(){c.showExternalElements=e.data.name===f})),R!==e&&(e.data.id&&a.history.replaceState({id:e.data.id},"classHierarchyPage"+e.data.id,"hierarchy#"+e.data.id),e.children||(e=e.parent,R!==e))){if(t&&(D(),d3.selectAll(".selected").classed("selected",!1)),R.parent)for(var r=R;r;)r.isInFocusTransitive=!1,r=r.parent;for(r=e;r;)r.isInFocusTransitive=!!r.children,r=r.parent;if(2*(R=e).r/(2*R.r+20)<.3||c.currentSliderValue>c.currentBrowserLimit)j([R.x,R.y,V(R.r)]),G.each((function(e){H.call(this,e)}));else d3.transition().duration(d).tween("zoom",(function(e){var t=d3.interpolateZoom(h,[R.x,R.y,V(R.r)]);return function(e){j(t(e))}})).selectAll("text").each(H)}}j([R.x,R.y,V(R.r)],p),O=c.$on("rootFocus",(function(){a.history.pushState({id:1},"classHierarchyPage1","hierarchy#1"),A(x)})),w=c.$on("classSearch",(function(e){A(e)}))}function U(){const t=c.classHierarchyData.classCount;let r=h.get(g.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);(!r||r>t)&&(r=t,h.set(g.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,r)),e.$broadcast("classCount",t,r)}window.addEventListener("resize",U),window.addEventListener("beforeunload",(function e(){window.removeEventListener("resize",U),window.removeEventListener("beforeunload",e)})),c.$watch("classHierarchyData",(function(){P&&P(),D&&D(),k&&k(),M&&M();var e=I();if(c.classHierarchyData.classCount){U();var t=_.cloneDeep(c.classHierarchyData);var r,n,i=function(e){return e.descendants().sort((function(e,t){return e.data.sortingRank>t.data.sortingRank?-1:e.data.sortingRank<t.data.sortingRank||e.data.depth>t.data.depth?1:e.data.depth<t.data.depth?-1:0}))}(d3.hierarchy(t));function o(e,t){const i={keepPrevState:!0,noPrefixes:I()};n=i.noPrefixes,G(r||e,i,R,!0),l((function(){h.set(g.CLASS_HIERARCHY_SWITCH_PREFIXES,t),L()}),70)}function s(e,i,s){if(!e)return;h.set(g.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,e),r={name:f,children:[]};const a=new Set;for(let t=1;t<=e;t++)a.add(i[t].data.id),i[t].parent===i[0]&&r.children.push(i[t].data);if(function e(t){if(!t.children)return;const r=[];for(const e of t.children)a.has(e.id)&&r.push($.extend({},e));t.children=r;for(const r of t.children)e(r)}(r),s){n=angular.isUndefined(n)?I():n;G(r,{noPrefixes:n})}else o(t)}var a,u=h.get(g.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);if(u)s(u,i);else{var p={doFade:!0,keepPrevState:!0,noPrefixes:I()};G(t,p),L()}P=c.$watch("hidePrefixes",(function(r){angular.isUndefined(r)||e?e=void 0:l((function(){!function(e){angular.isUndefined(e)||h.set(g.CLASS_HIERARCHY_HIDE_PREFIXES,e)}(r),o(t,!0)}),50)}),!0),D=c.$watch("currentSliderValue",(function(e){s(e,i,!0)}),!0),M=c.$on("onEnterKeypressSearchAction",(function(e){a&&A(a)})),k=c.$on("searchedClass",(function(e,t){(a=F[t.name])&&A(a)}))}}),!0)}(c)}}}angular.module("graphdb.framework.graphexplore.directives.class",["graphdb.framework.graphexplore.controllers.class","graphdb.framework.utils.localstorageadapter"]).constant("ZOOM_DURATION",500).constant("ROOT_OBJ_NAME","RDF Class Hierarchy").directive("rdfClassHierarchy",a),a.$inject=["$rootScope","$location","GraphDataRestService","$window","$timeout","$repositories","$licenseService","toastr","ZOOM_DURATION","ROOT_OBJ_NAME","LocalStorageAdapter","LSKeys","$translate"]},108:function(e,t,r){"use strict";r.r(t);var n=r(317),i=r(316);r(10);function o(e,t,r,o,s,a,l,u,c,p,d,f,h){return{restrict:"AE",template:'<div id="domain-range"></div>',scope:{showPredicatesInfoPanel:"=",selectedPredicate:"=",collapseEdges:"="},link:function(p){const d=u((function(){!function(p){var d=d3.select("#domain-range").append("svg").attr("viewBox","0 0 1200 600").attr("preserveAspectRatio","xMidYMid meet").on("dblclick.zoom",null),g=d3.forceSimulation(),m=d3.drag().subject((function(e){return e})).on("start",(function(e,t){g.stop(),t.fx=e.x,t.fy=e.y,d3.select(this).classed("selected",!0)})).on("end",(function(e,t){t.fx=null,t.fy=null,d3.select(this).classed("selected",!1),T?(g.alpha(.2).restart(),T=!1):g.restart()})).on("drag",(function(e,t){T=!0,g.alphaTarget(0).restart(),t.fx=e.x,t.fy=e.y})),E=d.append("defs");E.append("marker").attrs({id:"arrow",viewBox:"0 -5 10 10",refX:10,refY:0,markerUnits:"strokeWidth",markerWidth:5,markerHeight:5,orient:"auto",fill:f}).append("path").attrs({d:"M0,-5L10,0L0,5",class:"arrowHead"}),E.append("marker").attrs({id:"collapsed-arrow",viewBox:"0 -5 10 10",refX:9,refY:0,markerUnits:"strokeWidth",markerWidth:4,markerHeight:4,orient:"auto",fill:f}).append("path").attrs({d:"M0,-5L10,0L0,5",class:"arrowHead"}),E.append("marker").attrs({id:"arrow-loop",viewBox:"0 -5 10 10",refX:7,refY:0,markerUnits:"strokeWidth",markerWidth:5,markerHeight:5,orient:"auto",fill:f}).append("path").attrs({d:"M0,-5L10,0L0,5",class:"arrowHead"}),d3.select("#download-svg").on("mouseover",(function(){var e=n.a.Export.getCSSRules("css/domain-range-graph.css?v=2.5.1-TR1");$("defs").append('<style type="text/css"><![CDATA['+e+"]]></style>");var t=n.a.Export.generateBase64ImageSource("#domain-range svg");d3.select(this).attrs({href:t,download:"domain-range-graph-"+r.getActiveRepository()+".svg"})})),function(){var e=d3.select(".legend-container").append("svg").attr("viewBox","0 0 "+1200/7+" "+1200/7*1.2).attr("preserveAspectRatio","xMidYMid meet");e.append("rect").attrs({width:1200/7,height:1200/7*1.2}).style("fill","rgba(235, 235, 235, 0.9)");var t=16+1200/18/2.5,r=t+1200/90;e.append("circle").attrs({class:"legend-class-node",cx:(16+t)/2,cy:30,r:1200/18/4.5}),e.append("text").attrs({x:r,y:30+1200/370}).style("font-size",1200/90/1.1+"px").text("main class node"),e.append("circle").attrs({class:"legend-object-node",cx:(16+t)/2,cy:70,r:1200/110/1.25}),e.append("text").attrs({x:r,y:30+1200/370+40}).style("font-size",1200/90/1.1+"px").text("class node"),e.append("circle").attrs({class:"legend-datatype-node",cx:(16+t)/2,cy:70+1200/45,r:1200/110/2}),e.append("text").attrs({x:r,y:99.90990990990991}).style("font-size",1200/90/1.1+"px").text("datatype node"),e.append("line").attrs({class:"property-arrow",x1:16,y1:123.33333333333334,x2:t,y2:123.33333333333334}).style("stroke-width",1.2).attr("marker-end","url("+s.absUrl()+"#arrow)"),e.append("text").attrs({x:r,y:126.57657657657658}).style("font-size",1200/90/1.1+"px").text("explicit property"),e.append("line").attrs({class:"implicit-property-arrow",x1:16,y1:150,x2:t,y2:150}).style("stroke-width",1.2).attr("marker-end","url("+s.absUrl()+"#arrow)"),e.append("text").attrs({x:r,y:150+1200/370}).style("font-size",1200/90/1.1+"px").text("implicit property"),e.append("line").attrs({class:"collapsed-property-arrow",x1:16,y1:150+1200/45,x2:t,y2:150+1200/45}).style("stroke-width",2).attr("marker-end","url("+s.absUrl()+"#collapsed-arrow)"),e.append("text").attrs({x:r,y:179.9099099099099}).style("font-size",1200/90/1.1+"px").text("collapsed property")}();var v=s.search().uri,x=s.search().name;const y=s.search().collapsed;(function(e,t){o.getDomainRangeData(e,t).success((function(e,t,r){p.domainRangeGraphData=e})).error((function(e){c.error("Request for "+x+" failed!")}))})(v,y),$(window).on("popstate",(function(){a.set(l.DOMAIN_RANGE_WENT_BACK,!0)})),t.onpopstate=function(t){t.state&&e.$broadcast("changeCollapsedEdgesState",t.state.collapsed)},p.$watch("collapseEdges",(function(){angular.isUndefined(p.collapseEdges)||(a.set(l.DOMAIN_RANGE_COLLAPSE_EDGES,p.collapseEdges),"true"!==a.get(l.DOMAIN_RANGE_WENT_BACK)&&function(t){e.$broadcast("switchEdgeMode",{uri:v,name:x,collapsed:t})}(p.collapseEdges),a.remove(l.DOMAIN_RANGE_WENT_BACK))})),p.$watch("domainRangeGraphData",(function(){if(p.domainRangeGraphData){var r=_.cloneDeep(p.domainRangeGraphData);const P=r.nodes,D=r.links;g.nodes(P).force("x",d3.forceX(600)).force("y",d3.forceY(300)).force("charge",d3.forceManyBody().strength(-800)).force("link",d3.forceLink(D).distance(1200/3.5));var n=d.selectAll(".link").data(D).enter().append("g");function o(e){e.style("stroke",f),e.style("stroke-width",2),e.attr("marker-end","url("+s.absUrl()+"#collapsed-arrow)")}var a,l,c=0;n.each((function(e){if(e.objectPropNodeClassUri!==v)a=n.append("line").attrs({class:"link","marker-end":"url("+s.absUrl()+"#arrow)"}).style("stroke-width",1.2).each((function(e){switch(e.propertyType){case"objectLeft":e.targetRadius=1200/18;break;case"objectRight":e.targetRadius=1200/110;break;case"datatype":e.targetRadius=1200/110/2;break;default:e.targetRadius=0}var t=d3.select(this);e.targetNodeEdgeCount>1?o(t):e.implicit&&t.style("stroke-dasharray","3, 3")}));else{if(angular.isUndefined(l)){l=d3.select(this).append("path").attrs({d:"M 0 0 A "+1200/18/2+" "+1200/18/2+" 0 1 1 0 "+1200/18/2,class:"loop-link",fill:"none","marker-end":"url("+s.absUrl()+"#arrow-loop)"}).style("stroke-width",1.2)}(c+=e.targetNodeEdgeCount)>1&&o(d3.select(".loop-link"))}}));var E={};function y(){$.isEmptyObject(E)||(E.text.style("fill","black"),E.background.style("fill","#f0f0f0"))}function T(e,t){y(),E.text=d3.select(this),E.background=d3.select(this.previousSibling),E.text.style("fill","white"),E.background.style("fill",f),u((function(){p.showPredicatesInfoPanel=!0,p.selectedPredicate=t})),e.stopPropagation()}$("document").ready((function(){$("#domain-range").bind("click",y)}));var C=n.append("text").attr("class",(function(e){return e.objectPropNodeClassUri===v?"loop-link-property-name":"property-name"})).attr("dx",(function(e){return 1200/18/2*("objectLeft"===e.propertyType?1:-1)})).style("text-anchor",(function(e){return"objectLeft"===e.propertyType?"end":"start"})).style("font-size",1200/90).text((function(e){return e.targetNodeEdgeCount>1?e.targetNodeEdgeCount+" predicates":e.name}));C.each((function(e){var r=d3.select(this);/\d\spredicates/.test(r.text())?r.style("font-weight","bold").on("click",T):r.on("click",(function(e,r){t.open("resource?uri="+encodeURIComponent(r.uri),"_blank")}))}));var N=n.append("rect").attr("class",(function(e){return e.objectPropNodeClassUri!==v?"link-background":"loop-link-background"})).attr("width",(function(e){return e.calculatedWidth=this.previousSibling.getBBox().width,e.calculatedWidth+4})).attr("height",(function(e){return e.calculatedHeight=this.previousSibling.getBBox().height,e.calculatedHeight+2})).attr("transform",(function(e){var t=2-1200/18/2*("objectLeft"===e.propertyType?1:-1);return"objectLeft"===e.propertyType&&(t+=e.calculatedWidth),"translate(-"+t+",-"+(2+e.calculatedHeight/2)+")"})).on("click",(function(e){e.stopPropagation()})),I=d.selectAll(".node").data(P).enter().append("g"),S=I.filter((function(e){return e.objectPropClassUri!==v})).append("circle").each((function(e){var t=d3.select(this);"main"===e.classPosition?t.attrs({class:"class-node",r:1200/18}).attr("marker-end","url("+s.absUrl()+"#loop-link)"):null===e.objectPropClassName?t.attrs({class:"datatype-node",r:1200/110/2}):t.attrs({class:"object-prop-node",r:1200/110})})).call(m);d3.selectAll(".object-prop-node").on("dblclick",(function(t,r,n){p.$apply((function(){e.$broadcast("reloadDomainRangeGraphView",r,n)}))})),I.filter((function(e){return e.objectPropClassName&&e.objectPropClassUri!==v})).append("text").attr("class",(function(e){return e.classPosition+"-class-label"})).style("font-size",1200/90).text((function(e){return e.objectPropClassName})).on("click",(function(e,r){t.open("resource?uri="+encodeURIComponent(r.objectPropClassUri),"_blank")}));var L=I.select("text");d.select(".class-node").each((function(){d3.select(this.parentNode).append("text").attr("class","rdf-class-label").style("font-size",(function(e){return i.a.Text.calcFontSize(x,1200/18)})).text(x).on("click",(function(){t.open("resource?uri="+encodeURIComponent(v),"_blank")}))}));var A=d.select(".class-node + text"),b=d3.select(".class-node"),R=d3.selectAll(".loop-link-background"),O=d3.selectAll(".loop-link-property-name");if(C=d3.selectAll(".property-name"),!angular.isUndefined(l)){var w=[];R.each((function(e,t){d3.select(this);w.push({idx:t,width:e.calculatedWidth,height:e.calculatedHeight})}))}g.on("tick",(function(e){var t=8*g.alpha();function r(e){var t=e.x+1200/18*2,r=e.y-1200/18/1.9;var n=[];R.each((function(i,o){n.push(i),o<h?function(n,i){var o=$.grep(w,(function(e){return e.idx==i}));i>0&&(t+=parseFloat(i*(o[0].height/(i/1.4)))),n.attrs({transform:"rotate(270, "+e.x+","+e.y+") translate("+t+","+r+")",width:o[0].height,height:o[0].width})}(d3.select(this),o):d3.select(this).remove()})),function(e){var t;d3.select(".view-more-preds-label").style("font-weight","bold").each((function(r){r.target.allEdges=e,t=this.getComputedTextLength()})).on("click",T),d3.select(".view-more-preds-rect").attr("height",t+4)}(n)}a.filter((function(e){return e.objectPropNodeClassUri!==v})).attr("x1",(function(e){return e.source.x})).attr("y1",(function(e){return e.source.y})).attr("x2",(function(e){return e.targetX})).attr("y2",(function(e){return e.targetY})).each((function(e){!function(e){"objectLeft"===e.propertyType?(e.source.x-=8*t,e.source.y-=t/9):(e.target.x+=8*t,e.target.y-=t/9)}(e);var r=Math.atan2(e.target.y-e.source.y,e.target.x-e.source.x);e.targetX=e.target.x-Math.cos(r)*e.targetRadius,e.targetY=e.target.y-Math.sin(r)*e.targetRadius})),S.each((function(e){"main"!==e.classPosition||angular.isUndefined(l)||(!function(e){var t=e.x+64,r=e.y-1200/18/5.7-5;l.attr("transform","rotate(270, "+e.x+","+e.y+") translate("+t+","+r+")")}(e),function(e){function t(t,r){var n=$.grep(w,(function(e){return e.idx==r})),i=0;r>0&&(i=parseFloat(2*r*(n[0].height/1.4)));var o=e.x,s=e.y-1200/18*2.1-i;t.attrs({x:o,y:s}).moveToFront()}O.each((function(e,r){var n=d3.select(this),i=O.size()-h;i<0?t(n,r):(0==r&&!p.collapseEdges&&i>1&&(!function(e,t,r){e.classed("view-more-preds-label",!0).text(r+" predicates more ..."),null!==this.nextSibling&&t.classed("view-more-preds-rect",!0)}(n,d3.select(this.nextSibling),i),t(n,r)),r<h?t(n,r):n.remove())}))}(e),r(e)),e.objectPropClassUri!==v&&d3.select(this).attr("cx",(function(e){return"main"===e.classPosition?function(e){!window.ActiveXObject&&"ActiveXObject"in window&&(Math.log10=function(e){return Math.log(e)/Math.LN10});var t=b.attr("cx")-600,r=.5*Math.log10(Math.abs(t));return e.x+=t>0?-r:r,e.x}(e):e.x})).attr("cy",(function(e){return e.y}))})),A.attr("x",(function(e){return e.x})).attr("y",(function(e){return e.y})).moveToFront(),N.filter((function(e){return e.objectPropNodeClassUri!==v})).attr("x",(function(e){return e.target.x>e.source.x?e.source.x+(e.target.x-e.source.x)/2:e.target.x+(e.source.x-e.target.x)/2})).attr("y",(function(e){return e.target.y>e.source.y?e.source.y+(e.target.y-e.source.y)/2:e.target.y+(e.source.y-e.target.y)/2})).moveToFront(),C.attr("x",(function(e){return e.target.x>e.source.x?e.source.x+(e.target.x-e.source.x)/2:e.target.x+(e.source.x-e.target.x)/2})).attr("y",(function(e){return e.target.y>e.source.y?e.source.y+(e.target.y-e.source.y)/2:e.target.y+(e.source.y-e.target.y)/2})).moveToFront(),L.attr("x",(function(e){return"right"===e.classPosition?e.x+1200/110*1.2:e.x-1200/110*1.2})).attr("y",(function(e){return e.y})).moveToFront()}))}}));let T=!1}(p)}),50);p.$on("$destroy",(function(){u.cancel(d)}))}}}angular.module("graphdb.framework.graphexplore.directives.domainrange",["graphdb.framework.graphexplore.controllers.domainrange","graphdb.framework.utils.localstorageadapter"]).constant("ONTO_RED","var(--primary-color)").constant("ONTO_GREEN","var(--tertiary-color)").constant("ONTO_BLUE","var(--secondary-color)").constant("NON_COLLAPSED_REFLEXIVE_LINK_LIMIT",6).directive("domainRangeGraph",o),o.$inject=["$rootScope","$window","$repositories","GraphDataRestService","$location","LocalStorageAdapter","LSKeys","$timeout","toastr","ONTO_RED","ONTO_GREEN","ONTO_BLUE","NON_COLLAPSED_REFLEXIVE_LINK_LIMIT"]},109:function(e,t){function r(e,t){return{restrict:"A",scope:{},templateUrl:"js/angular/graphexplore/templates/systemRepoWarningTemplate.html",link:function(r){r.isSystemRepository=function(){return"SYSTEM"===e.getActiveRepository()},r.hasPermission=function(){return t.hasPermission()}}}}angular.module("graphdb.framework.graphexplore.directives.sysrepo",["graphdb.framework.graphexplore.controllers.class"]).directive("systemRepoWarning",r),r.$inject=["$repositories","$rootScope"]},110:function(e,t){function r(e){return{restrict:"AE",scope:{rdfsLabel:"=",rdfsComment:"=",expanded:"=",alwaysExpanded:"="},templateUrl:"js/angular/graphexplore/templates/rdfsCommentLabelTemplate.html",link:function(t,r){t.stringLimit=e,t.scrollToTop=function(){r[0].getElementsByClassName("rdfs-comment")[0].scrollTop=0},t.checkCommentLength=function(){return r[0].getElementsByClassName("rdfs-comment-text")[0].innerText.length<e},t.equalHeights=function(){const e=r[0].getElementsByClassName("rdfs-comment-text")[0].innerHeight;e<250&&t.expanded&&(r[0].getElementsByClassName("rdfs-comment")[0].innerHeight=e)},t.toggleFullComment=function(){t.expanded=!t.expanded},t.$watch("expanded || alwaysExpanded",(function(r){t.stringLimit=r?t.rdfsComment.length:e}))}}}angular.module("graphdb.framework.graphexplore.directives.rdfsdetails",[]).directive("rdfsCommentLabel",r).constant("SHORT_COMMENT_LENGTH",100),r.$inject=["SHORT_COMMENT_LENGTH"]},111:function(e,t,r){"use strict";r.r(t);var n=r(317);r(72);function i(e,t){return{restrict:"A",template:'<div id="dependencies-chord"></div>',scope:{dependenciesData:"="},link:function(r){r.$watch("dependenciesData",(function(){if(r.dependenciesData){const i=r.dependenciesData;!function(i,o){if(function(){let e=!0;for(const t of i){if(t.some(e=>0!==e)){e=!1;break}}return e}())return;const s=d3.scaleOrdinal(d3.schemeCategory10),a=d3.select("body").append("div").attr("class","tooltip").style("opacity",0);d3.select("body").on("click",(function(){a.style("opacity",0)}));const l=Math.min(800,800)/2.8,u=l-24,c=d3.arc().innerRadius(u).outerRadius(l),p=d3.chord().padAngle(.04).sortSubgroups(d3.descending).sortChords(d3.ascending),d=d3.ribbon().radius(u),f=d3.select("#dependencies-chord").append("svg").attr("viewBox","0 0 800 800").attr("preserveAspectRatio","xMidYMid meet").style("font","10px sans-serif").append("g").attr("id","circle").attr("transform","translate(400,400)");f.append("circle").attr("r",l).style("fill","none");const h=p(i),g=f.selectAll(".group").data(h.groups).enter().append("g").attr("class","group").on("mouseover",(function(){const e=g.nodes().indexOf(this);m.classed("fade",(function(t){return t.source.index!==e&&t.target.index!==e}))}));g.append("title").text((function(e,t){return o[t]})),g.append("path").attr("id",(function(e,t){return"group"+t})).attr("d",c).style("fill",(function(e,t){return s(t)})),g.append("text").each((function(e){e.angle=(e.startAngle+e.endAngle)/2})).attr("dy",".35em").attr("transform",(function(e){return"rotate("+(180*e.angle/Math.PI-90)+")translate("+(u+26)+")"+(e.angle>Math.PI?"rotate(180)":"")})).style("text-anchor",(function(e){return e.angle>Math.PI?"end":null})).text((function(e){return o[e.index]}));const m=f.selectAll(".chord").data(h).enter().append("path").attr("class","chord").style("fill",(function(e){return s(e.target.index)})).style("fill-opacity",".67").style("stroke","#000").style("stroke-width",".25px").style("cursor","pointer").attr("d",d);m.on("mouseover",(function(){d3.select(this).style("fill-opacity","1")})),m.on("mouseout",(function(){d3.select(this).style("fill-opacity",".67")})),m.on("click",(function(e,n){const i=o[n.source.index],s=o[n.target.index],l=e.pageX,u=e.pageY;t.getPredicates(i,s,r.selectedGraph&&r.selectedGraph.contextID.uri).success((function(e){let t="<div class='dependencies-tooltip'>"+("<div class='row'>"+i+" <i class='fa fa-exchange'></i> "+s+"</div>")+_.map(e.slice(0,10),(function(e){const t=" <i class='fa fa-long-arrow-"+("out"===e.direction?"right":"left")+"'></i>";return"<div class='row'>"+e.predicate+" : "+e.weight+t+" </div>"})).join("");e.length>10?t=t+"<div class='pull-right'>And "+(e.length-10).toString()+" more...</div></div>":t+="</div>",a.html(t).style("left",l+"px").style("top",u+"px")})),a.transition().duration(200).style("opacity",1)})),d3.select("#circle").on("mouseleave",(function(){f.selectAll(".chord").classed("fade",!1)})),d3.select("#download-svg").on("mouseover",(function(){const t=n.a.Export.generateBase64ImageSource(".dependencies-chord svg");d3.select(this).attrs({href:t,download:"dependencies-"+e.getActiveRepository()+".svg"})}))}(i.matrix,i.nodes,i.direction)}}))}}}angular.module("graphdb.framework.graphexplore.directives.dependencies",["graphdb.framework.graphexplore.controllers.dependencies","graphdb.framework.rest.graphexplore.data.service"]).directive("dependenciesChord",i),i.$inject=["$repositories","GraphDataRestService"]},112:function(e,t){function r(){return{restrict:"AE",scope:{filterQueryObj:"=",filterFunction:"&",listItemsObj:"=",listItemsNotFiltered:"=",searchPlaceholder:"@"},templateUrl:"js/angular/graphexplore/templates/listItemsSearchFilterTemplate.html",link:function(e){e.filterFunction=e.filterFunction(),e.$watch("filterQueryObj.query",(function(){var t,r,n,i;e.listItemsObj.items=(t=e.filterQueryObj.query,r=e.listItemsObj.items,n=e.listItemsNotFiltered,i=e.filterFunction,t.length>0?_.filter(n,i):r.length!==n.length?n:r)}))}}}angular.module("graphdb.framework.graphexplore.directives.searchfilter",[]).directive("listItemsSearchFilter",r),r.$inject=[]},113:function(e,t){function r(e,t){return{restrict:"AE",scope:{searchData:"=",searchFields:"@",titleField:"@",searchPlaceholder:"@",initialValue:"=",searchedObjCallback:"&"},templateUrl:"js/angular/graphexplore/templates/searchIconInputTemplate.html",link:function(r,n){r.searchedObjCallback=r.searchedObjCallback(),r.performSearchActionOnEnter=function(){e.$broadcast("onEnterKeypressSearchAction")},r.showInput=function(){$("#selectGraphDropdown").hide(),n.find("#search_input #search_input_value")[0].value="",n.find(".search-icon").addClass("animated bounceOut").css("z-index","-1"),n.find("#search_input .angucomplete-holder").css("display","block"),t((function(){n.find("#search_input .angucomplete-holder").css("width","250px").css("left","-215px"),t((function(){n.find(".close-icon").css("display","block").addClass("animated bounceIn").css("z-index","3"),n.find("#search_input #search_input_value").focus()}),200)}),1)},r.hideInput=function(){n.find("#search_input #search_input_value")[0].value="",n.find("#search_input .angucomplete-holder").css("width","0px").css("left","35px"),t((function(){n.find("#search_input .angucomplete-holder").css("display","none"),$("#selectGraphDropdown").show()}),250),n.find(".close-icon").addClass("animated bounceOut").removeClass("bounceOut").css("z-index","-1").css("display","none").click((function(){$(".tooltip").hide()})),t((function(){n.find(".search-icon").css("display","inline-block").removeClass("bounceOut").addClass("bounceIn").css("z-index","3")}),200)}}}}angular.module("graphdb.framework.graphexplore.directives.searchcontrols",[]).directive("searchIconInput",r),r.$inject=["$rootScope","$timeout"]},162:function(e,t,r){"use strict";r.r(t);r(7),r(29),r(23),r(22),r(337),r(338),r(309),r(318),r(327),r(339),r(340),r(322),r(316),r(324),r(317),r(72),r(98),r(99),r(100),r(101),r(102),r(103),r(104),r(105),r(106),r(107),r(108),r(109),r(110),r(111),r(112),r(113),r(61),r(71);angular.module("graphdb.framework.graphexplore",["graphdb.framework.core.controllers","graphdb.framework.core.directives","graphdb.framework.rest.graphexplore.data.service","graphdb.framework.graphexplore.services.uiscroll","graphdb.framework.graphexplore.services.rdfsdetails","graphdb.framework.rest.graphexplore.savedgraphs.service","graphdb.framework.rest.graphconfig.service","graphdb.framework.graphexplore.controllers.class","graphdb.framework.graphexplore.controllers.domainrange","graphdb.framework.graphexplore.controllers.dependencies","graphdb.framework.graphexplore.controllers.graphviz","graphdb.framework.graphexplore.controllers.graphviz.config","graphdb.framework.graphexplore.directives.sysrepo","graphdb.framework.graphexplore.directives.rdfsdetails","graphdb.framework.graphexplore.directives.searchfilter","graphdb.framework.graphexplore.directives.class","graphdb.framework.graphexplore.directives.domainrange","graphdb.framework.graphexplore.directives.dependencies","graphdb.framework.graphexplore.directives.searchcontrols","graphdb.framework.core.directives.queryeditor.controllers","graphdb.framework.core.directives.queryeditor.queryeditor"])},309:function(e,t,r){var n,i;n=[r(313)],void 0===(i=function(){function e(e,t){return e.each((function(){var e=t.apply(this,arguments),r=select(this);for(var n in e)r.attr(n,e[n])}))}function t(e,t){for(var r in t)e.attr(r,t[r]);return e}return"undefined"==typeof d3&&(d3=r(313)),d3.selection.prototype.attrs=function(r){return("function"==typeof r?e:t)(this,r)},d3.selection.prototype.moveToFront=function(){return this.each((function(){d3.select(this.parentNode.appendChild(this))}))},d3.selection.prototype.moveToBack=function(){return this.each((function(){const e=this.parentNode.firstChild;e&&this.parentNode.insertBefore(this,e)}))},d3}.apply(t,n))||(e.exports=i)},316:function(e,t,r){"use strict";r(309);var n=n||{};n.Text=function(){function e(e,t,r,n){r=r||10;var i=t/3;return"string"==typeof e?(i*=10/(e.substring(0,t/3).length+1.5),i+=1,e.match(/[\u0900-\u0DFF\u1100-\u11FF\u2E80-\u2EFF\u3000-\u9FFF]/)&&(i*=.6),i<r&&(i=r),Math.round(i)):(i<r&&(i=r),Math.round(i))}return{calcFontSizeRaw:e,calcFontSize:function(t,r,n,i){return e(t,r,n)+"px"},getTextWithElipsisIfNeeded:function(e,t){return"string"==typeof e&&e.length>t?e.substring(0,t-3)+"...":e}}}(),n.Transition={fadeIn:function(e,t){e.style("opacity",0).transition().duration(t).style("opacity",1)},fadeOut:function(e,t){e.style("opacity",1).transition().duration(t).style("opacity",0)}},n.Click=function(){const e=function(e,r){let n,i=1,o=arguments.length;for(;++i<o;)n=arguments[i],e[n]=t(e,r,r[n]);return e};function t(e,t,r){return function(){var n=r.apply(t,arguments);return n===t?e:n}}return{delayDblClick:function(){var t=d3.dispatch("click","dblclick");return e((function(e){var r,n=null;e.on("mousedown",(function(){r=d3.pointer(document.body),+new Date})),e.on("mouseup",(function(e,i){var o,s,a;(s=r,a=d3.pointer(document.body),Math.sqrt(Math.pow(s[0]-a[0],2),Math.pow(s[1]-a[1],2))>5)||(n?(window.clearTimeout(n),n=null,t.call("dblclick",e,e,i)):n=window.setTimeout((o=e,function(){t.call("click",o,o,i),n=null}),250))}))}),t,"on")}}}(),t.a=n},317:function(e,t,r){"use strict";r(309);var n=n||{};n.Export={getCSSRules:function(e){const t=$('link[href="'+e+'"]')[0].sheet.rules;let r="";return _.each(t,(function(e){r+=e.cssText})),r},generateBase64ImageSource:function(e){e||(e="svg");const t=d3.selectAll(e).attr("version","1.1").attr("xmlns","http://www.w3.org/2000/svg").node().parentNode.innerHTML;return"data:image/svg+xml;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(t)))}},t.a=n},318:function(e,t,r){"use strict";t.a=function(){var e=function(){return"n"},t=function(){return[0,0]},r=function(){return" "},n=p(),i=null,o=null,s=null,a=null;function l(e){var t;i="svg"===(t=(t=e).node()).tagName.toLowerCase()?t:t.ownerSVGElement,o=i.createSVGPoint(),document.body.appendChild(n)}l.show=function(){var n=Array.prototype.slice.call(arguments);n[n.length-1]instanceof SVGElement&&(s=n.pop());var i,o=r.apply(this,n),p=t.apply(this,n),f=e.apply(this,n),h=d(),g=c.length,m=document.documentElement.scrollTop||document.body.scrollTop,E=document.documentElement.scrollLeft||document.body.scrollLeft,v=a.apply(this,n);for(h.html(o).style("opacity",1).style("pointer-events","all");g--;)h.classed(c[g],!1);const x=n.filter(e=>e instanceof Event);return i=u.get(f).apply(this,x),v?Object.keys(v).forEach((function(e){h.style(e,v[e])})):h.classed(f,!0).style("top",i.top+p[0]+m+"px").style("left",i.left+p[1]+E+"px"),l},l.hide=function(){return d().style("opacity",0).style("pointer-events","none"),l},l.attr=function(e,t){if(arguments.length<2&&"string"==typeof e)return d().attr(e);var r=Array.prototype.slice.call(arguments);return d3.selection.prototype.attr.apply(d(),r),l},l.style=function(e,t){if(arguments.length<2&&"string"==typeof e)return d().style(e);var r=Array.prototype.slice.call(arguments);return d3.selection.prototype.style.apply(d(),r),l},l.direction=function(t){return arguments.length?(e=null==t?t:h(t),l):e},l.offset=function(e){return arguments.length?(t=null==e?e:h(e),l):t},l.html=function(e){return arguments.length?(r=null==e?e:h(e),l):r},l.customPosition=function(e){return arguments.length?(a=null==e?e:h(e),l):a},l.destroy=function(){return n&&(d().remove(),n=null),l};var u=new Map(Object.entries({n:function(e){var t=f(e);return{top:t.n.y-n.offsetHeight,left:t.n.x-n.offsetWidth/2}},s:function(e){var t=f(e);return{top:t.s.y,left:t.s.x-n.offsetWidth/2}},e:function(e){var t=f(e);return{top:t.e.y-n.offsetHeight/2,left:t.e.x}},w:function(e){var t=f(e);return{top:t.w.y-n.offsetHeight/2,left:t.w.x-n.offsetWidth}},nw:function(e){var t=f(e);return{top:t.nw.y-n.offsetHeight,left:t.nw.x-n.offsetWidth}},ne:function(e){var t=f(e);return{top:t.ne.y-n.offsetHeight,left:t.ne.x}},sw:function(e){var t=f(e);return{top:t.sw.y,left:t.sw.x-n.offsetWidth}},se:function(e){var t=f(e);return{top:t.se.y,left:t.e.x}}})),c=u.keys();function p(){var e=d3.select(document.createElement("div"));return e.style("position","absolute").style("top",0).style("opacity",0).style("pointer-events","none").style("box-sizing","border-box"),e.node()}function d(){return null===n&&(n=p(),document.body.appendChild(n)),d3.select(n)}function f(e){for(var t=s||e.target;void 0===t.getScreenCTM&&"undefined"===t.parentNode;)t=t.parentNode;var r={},n=t.getScreenCTM(),i=t.getBBox(),a=i.width,l=i.height,u=i.x,c=i.y;return o.x=u,o.y=c,r.nw=o.matrixTransform(n),o.x+=a,r.ne=o.matrixTransform(n),o.y+=l,r.se=o.matrixTransform(n),o.x-=a,r.sw=o.matrixTransform(n),o.y-=l/2,r.w=o.matrixTransform(n),o.x+=a,r.e=o.matrixTransform(n),o.x-=a/2,o.y-=l/2,r.n=o.matrixTransform(n),o.y+=l,r.s=o.matrixTransform(n),r}function h(e){return"function"==typeof e?e:function(){return e}}return l}},319:function(e,t,r){var n,i=i||function(e){"use strict";if("undefined"==typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var t=e.document,r=function(){return e.URL||e.webkitURL||e},n=t.createElementNS("http://www.w3.org/1999/xhtml","a"),i=e.webkitRequestFileSystem,o=e.requestFileSystem||i||e.mozRequestFileSystem,s=function(t){(e.setImmediate||e.setTimeout)((function(){throw t}),0)},a=0,l=function(t){var n=function(){"string"==typeof t?r().revokeObjectURL(t):t.remove()};e.chrome?n():setTimeout(n,500)},u=function(e,t,r){for(var n=(t=[].concat(t)).length;n--;){var i=e["on"+t[n]];if("function"==typeof i)try{i.call(e,r||e)}catch(e){s(e)}}},c=function(e){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e},p=function(t,s){t=c(t);var p,d,f,h=this,g=t.type,m=!1,E=function(){u(h,"writestart progress write writeend".split(" "))},v=function(){(!m&&p||(p=r().createObjectURL(t)),d)?d.location.href=p:null==e.open(p,"_blank")&&"undefined"!=typeof safari&&(e.location.href=p);h.readyState=h.DONE,E(),l(p)},x=function(e){return function(){if(h.readyState!==h.DONE)return e.apply(this,arguments)}},y={create:!0,exclusive:!1};if(h.readyState=h.INIT,s||(s="download"),n)return p=r().createObjectURL(t),n.href=p,n.download=s,void setTimeout((function(){var e,t;e=n,t=new MouseEvent("click"),e.dispatchEvent(t),E(),l(p),h.readyState=h.DONE}));e.chrome&&g&&"application/octet-stream"!==g&&(f=t.slice||t.webkitSlice,t=f.call(t,0,t.size,"application/octet-stream"),m=!0),i&&"download"!==s&&(s+=".download"),("application/octet-stream"===g||i)&&(d=e),o?(a+=t.size,o(e.TEMPORARY,a,x((function(e){e.root.getDirectory("saved",y,x((function(e){var r=function(){e.getFile(s,y,x((function(e){e.createWriter(x((function(r){r.onwriteend=function(t){d.location.href=e.toURL(),h.readyState=h.DONE,u(h,"writeend",t),l(e)},r.onerror=function(){var e=r.error;e.code!==e.ABORT_ERR&&v()},"writestart progress write abort".split(" ").forEach((function(e){r["on"+e]=h["on"+e]})),r.write(t),h.abort=function(){r.abort(),h.readyState=h.DONE},h.readyState=h.WRITING})),v)})),v)};e.getFile(s,{create:!1},x((function(e){e.remove(),r()})),x((function(e){e.code===e.NOT_FOUND_ERR?r():v()})))})),v)})),v)):v()},d=p.prototype;return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(e,t){return navigator.msSaveOrOpenBlob(c(e),t)}:(d.abort=function(){this.readyState=this.DONE,u(this,"abort")},d.readyState=d.INIT=0,d.WRITING=1,d.DONE=2,d.error=d.onwritestart=d.onprogress=d.onwrite=d.onabort=d.onerror=d.onwriteend=null,function(e,t){return new p(e,t)})}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content);
2
2
  /*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */e.exports?e.exports.saveAs=i:null!==r(314)&&null!=r(315)&&(void 0===(n=function(){return i}.apply(t,[]))||(e.exports=n))},324:function(e,t,r){"use strict";var n=n||{};n.SingleChild={addPlaceholders:function e(t,r){if(t.children){for(var n=0;n<t.children.length;n++)e(t.children[n]);if(1===t.children.length){var i=1.2*t.size;r&&(i=.1*t.children[0].size),t.children.push({name:"placeholder",size:i})}}},removePlaceholders:function e(t){for(var r=t.length-1;r>=0;r--){var n=t[r];"placeholder"===n.data.name?t.splice(r,1):n.children&&e(n.children)}},centerNodes:function(e){for(var t=0;t<e.length;t++){var r=e[t];if(r.children&&1===r.children.length){var n=r.x-r.children[0].x;r.children[0].x+=n,i(r.children[0],n)}}function i(e,t){if(e.children)for(var r=0;r<e.children.length;r++)e.children[r].x+=t,i(e.children[r],t)}},makePositionsRelativeToZero:function(e){for(var t=e[0].x,r=e[0].y,n=0;n<e.length;n++){var i=e[n];i.x-=t,i.y-=r}}},t.a=n},325:function(module,exports,__webpack_require__){(function(global){var require,require,f;f=function(){var define,module,exports;return function e(t,r,n){function i(s,a){if(!r[s]){if(!t[s]){if(!a&&"function"==typeof require&&require)return require(s,!0);if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var u=r[s]={exports:{}};t[s][0].call(u.exports,(function(e){return i(t[s][1][e]||e)}),u,u.exports,e,t,r,n)}return r[s].exports}for(var o="function"==typeof require&&require,s=0;s<n.length;s++)i(n[s]);return i}({1:[function(e,t,r){"use strict";var n=e("jquery");n.deparam=function(e,t){var r={},i={true:!0,false:!1,null:null};return n.each(e.replace(/\+/g," ").split("&"),(function(e,o){var s,a=o.split("="),l=decodeURIComponent(a[0]),u=r,c=0,p=l.split("]["),d=p.length-1;if(/\[/.test(p[0])&&/\]$/.test(p[d])?(p[d]=p[d].replace(/\]$/,""),d=(p=p.shift().split("[").concat(p)).length-1):d=0,2===a.length)if(s=decodeURIComponent(a[1]),t&&(s=s&&!isNaN(s)?+s:"undefined"===s?void 0:void 0!==i[s]?i[s]:s),d)for(;c<=d;c++)u=u[l=""===p[c]?u.length:p[c]]=c<d?u[l]||(p[c+1]&&isNaN(p[c+1])?{}:[]):s;else n.isArray(r[l])?r[l].push(s):void 0!==r[l]?r[l]=[r[l],s]:r[l]=s;else l&&(r[l]=t?void 0:"")})),r}},{jquery:16}],2:[function(e,t,r){t.exports={table:{"*[&&,valueLogical]":{"&&":["[&&,valueLogical]","*[&&,valueLogical]"],AS:[],")":[],",":[],"||":[],";":[]},"*[,,expression]":{",":["[,,expression]","*[,,expression]"],")":[]},"*[,,objectPath]":{",":["[,,objectPath]","*[,,objectPath]"],".":[],";":[],"]":[],"{":[],OPTIONAL:[],MINUS:[],GRAPH:[],SERVICE:[],FILTER:[],BIND:[],VALUES:[],"}":[]},"*[,,object]":{",":["[,,object]","*[,,object]"],".":[],";":[],"]":[],"}":[],GRAPH:[],"{":[],OPTIONAL:[],MINUS:[],SERVICE:[],FILTER:[],BIND:[],VALUES:[]},"*[/,pathEltOrInverse]":{"/":["[/,pathEltOrInverse]","*[/,pathEltOrInverse]"],"|":[],")":[],"(":[],"[":[],VAR1:[],VAR2:[],NIL:[],IRI_REF:[],TRUE:[],FALSE:[],BLANK_NODE_LABEL:[],ANON:[],"<<":[],PNAME_LN:[],PNAME_NS:[],STRING_LITERAL1:[],STRING_LITERAL2:[],STRING_LITERAL_LONG1:[],STRING_LITERAL_LONG2:[],INTEGER:[],DECIMAL:[],DOUBLE:[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[]},"*[;,?[or([verbPath,verbSimple]),objectList]]":{";":["[;,?[or([verbPath,verbSimple]),objectList]]","*[;,?[or([verbPath,verbSimple]),objectList]]"],".":[],"]":[],"}":[],GRAPH:[],"{":[],OPTIONAL:[],MINUS:[],SERVICE:[],FILTER:[],BIND:[],VALUES:[]},"*[UNION,groupGraphPattern]":{UNION:["[UNION,groupGraphPattern]","*[UNION,groupGraphPattern]"],VAR1:[],VAR2:[],NIL:[],"(":[],"[":[],IRI_REF:[],TRUE:[],FALSE:[],BLANK_NODE_LABEL:[],ANON:[],"<<":[],PNAME_LN:[],PNAME_NS:[],STRING_LITERAL1:[],STRING_LITERAL2:[],STRING_LITERAL_LONG1:[],STRING_LITERAL_LONG2:[],INTEGER:[],DECIMAL:[],DOUBLE:[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[],".":[],"{":[],OPTIONAL:[],MINUS:[],GRAPH:[],SERVICE:[],FILTER:[],BIND:[],VALUES:[],"}":[]},"*[graphPatternNotTriples,?.,?triplesBlock]":{"{":["[graphPatternNotTriples,?.,?triplesBlock]","*[graphPatternNotTriples,?.,?triplesBlock]"],OPTIONAL:["[graphPatternNotTriples,?.,?triplesBlock]","*[graphPatternNotTriples,?.,?triplesBlock]"],MINUS:["[graphPatternNotTriples,?.,?triplesBlock]","*[graphPatternNotTriples,?.,?triplesBlock]"],GRAPH:["[graphPatternNotTriples,?.,?triplesBlock]","*[graphPatternNotTriples,?.,?triplesBlock]"],SERVICE:["[graphPatternNotTriples,?.,?triplesBlock]","*[graphPatternNotTriples,?.,?triplesBlock]"],FILTER:["[graphPatternNotTriples,?.,?triplesBlock]","*[graphPatternNotTriples,?.,?triplesBlock]"],BIND:["[graphPatternNotTriples,?.,?triplesBlock]","*[graphPatternNotTriples,?.,?triplesBlock]"],VALUES:["[graphPatternNotTriples,?.,?triplesBlock]","*[graphPatternNotTriples,?.,?triplesBlock]"],"}":[]},"*[quadsNotTriples,?.,?triplesTemplate]":{GRAPH:["[quadsNotTriples,?.,?triplesTemplate]","*[quadsNotTriples,?.,?triplesTemplate]"],"}":[]},"*[|,pathOneInPropertySet]":{"|":["[|,pathOneInPropertySet]","*[|,pathOneInPropertySet]"],")":[]},"*[|,pathSequence]":{"|":["[|,pathSequence]","*[|,pathSequence]"],")":[],"(":[],"[":[],VAR1:[],VAR2:[],NIL:[],IRI_REF:[],TRUE:[],FALSE:[],BLANK_NODE_LABEL:[],ANON:[],"<<":[],PNAME_LN:[],PNAME_NS:[],STRING_LITERAL1:[],STRING_LITERAL2:[],STRING_LITERAL_LONG1:[],STRING_LITERAL_LONG2:[],INTEGER:[],DECIMAL:[],DOUBLE:[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[]},"*[||,conditionalAndExpression]":{"||":["[||,conditionalAndExpression]","*[||,conditionalAndExpression]"],AS:[],")":[],",":[],";":[]},"*dataBlockValue":{UNDEF:["dataBlockValue","*dataBlockValue"],IRI_REF:["dataBlockValue","*dataBlockValue"],TRUE:["dataBlockValue","*dataBlockValue"],FALSE:["dataBlockValue","*dataBlockValue"],"<<":["dataBlockValue","*dataBlockValue"],PNAME_LN:["dataBlockValue","*dataBlockValue"],PNAME_NS:["dataBlockValue","*dataBlockValue"],STRING_LITERAL1:["dataBlockValue","*dataBlockValue"],STRING_LITERAL2:["dataBlockValue","*dataBlockValue"],STRING_LITERAL_LONG1:["dataBlockValue","*dataBlockValue"],STRING_LITERAL_LONG2:["dataBlockValue","*dataBlockValue"],INTEGER:["dataBlockValue","*dataBlockValue"],DECIMAL:["dataBlockValue","*dataBlockValue"],DOUBLE:["dataBlockValue","*dataBlockValue"],INTEGER_POSITIVE:["dataBlockValue","*dataBlockValue"],DECIMAL_POSITIVE:["dataBlockValue","*dataBlockValue"],DOUBLE_POSITIVE:["dataBlockValue","*dataBlockValue"],INTEGER_NEGATIVE:["dataBlockValue","*dataBlockValue"],DECIMAL_NEGATIVE:["dataBlockValue","*dataBlockValue"],DOUBLE_NEGATIVE:["dataBlockValue","*dataBlockValue"],"}":[],")":[]},"*datasetClause":{FROM:["datasetClause","*datasetClause"],WHERE:[],"{":[]},"*describeDatasetClause":{FROM:["describeDatasetClause","*describeDatasetClause"],ORDER:[],HAVING:[],GROUP:[],LIMIT:[],OFFSET:[],WHERE:[],"{":[],VALUES:[],$:[]},"*graphNode":{"(":["graphNode","*graphNode"],"[":["graphNode","*graphNode"],VAR1:["graphNode","*graphNode"],VAR2:["graphNode","*graphNode"],NIL:["graphNode","*graphNode"],IRI_REF:["graphNode","*graphNode"],TRUE:["graphNode","*graphNode"],FALSE:["graphNode","*graphNode"],BLANK_NODE_LABEL:["graphNode","*graphNode"],ANON:["graphNode","*graphNode"],"<<":["graphNode","*graphNode"],PNAME_LN:["graphNode","*graphNode"],PNAME_NS:["graphNode","*graphNode"],STRING_LITERAL1:["graphNode","*graphNode"],STRING_LITERAL2:["graphNode","*graphNode"],STRING_LITERAL_LONG1:["graphNode","*graphNode"],STRING_LITERAL_LONG2:["graphNode","*graphNode"],INTEGER:["graphNode","*graphNode"],DECIMAL:["graphNode","*graphNode"],DOUBLE:["graphNode","*graphNode"],INTEGER_POSITIVE:["graphNode","*graphNode"],DECIMAL_POSITIVE:["graphNode","*graphNode"],DOUBLE_POSITIVE:["graphNode","*graphNode"],INTEGER_NEGATIVE:["graphNode","*graphNode"],DECIMAL_NEGATIVE:["graphNode","*graphNode"],DOUBLE_NEGATIVE:["graphNode","*graphNode"],")":[]},"*graphNodePath":{"(":["graphNodePath","*graphNodePath"],"[":["graphNodePath","*graphNodePath"],VAR1:["graphNodePath","*graphNodePath"],VAR2:["graphNodePath","*graphNodePath"],NIL:["graphNodePath","*graphNodePath"],IRI_REF:["graphNodePath","*graphNodePath"],TRUE:["graphNodePath","*graphNodePath"],FALSE:["graphNodePath","*graphNodePath"],BLANK_NODE_LABEL:["graphNodePath","*graphNodePath"],ANON:["graphNodePath","*graphNodePath"],"<<":["graphNodePath","*graphNodePath"],PNAME_LN:["graphNodePath","*graphNodePath"],PNAME_NS:["graphNodePath","*graphNodePath"],STRING_LITERAL1:["graphNodePath","*graphNodePath"],STRING_LITERAL2:["graphNodePath","*graphNodePath"],STRING_LITERAL_LONG1:["graphNodePath","*graphNodePath"],STRING_LITERAL_LONG2:["graphNodePath","*graphNodePath"],INTEGER:["graphNodePath","*graphNodePath"],DECIMAL:["graphNodePath","*graphNodePath"],DOUBLE:["graphNodePath","*graphNodePath"],INTEGER_POSITIVE:["graphNodePath","*graphNodePath"],DECIMAL_POSITIVE:["graphNodePath","*graphNodePath"],DOUBLE_POSITIVE:["graphNodePath","*graphNodePath"],INTEGER_NEGATIVE:["graphNodePath","*graphNodePath"],DECIMAL_NEGATIVE:["graphNodePath","*graphNodePath"],DOUBLE_NEGATIVE:["graphNodePath","*graphNodePath"],")":[]},"*groupCondition":{"(":["groupCondition","*groupCondition"],STR:["groupCondition","*groupCondition"],LANG:["groupCondition","*groupCondition"],LANGMATCHES:["groupCondition","*groupCondition"],DATATYPE:["groupCondition","*groupCondition"],BOUND:["groupCondition","*groupCondition"],IRI:["groupCondition","*groupCondition"],URI:["groupCondition","*groupCondition"],BNODE:["groupCondition","*groupCondition"],RAND:["groupCondition","*groupCondition"],ABS:["groupCondition","*groupCondition"],CEIL:["groupCondition","*groupCondition"],FLOOR:["groupCondition","*groupCondition"],ROUND:["groupCondition","*groupCondition"],CONCAT:["groupCondition","*groupCondition"],STRLEN:["groupCondition","*groupCondition"],UCASE:["groupCondition","*groupCondition"],LCASE:["groupCondition","*groupCondition"],ENCODE_FOR_URI:["groupCondition","*groupCondition"],CONTAINS:["groupCondition","*groupCondition"],STRSTARTS:["groupCondition","*groupCondition"],STRENDS:["groupCondition","*groupCondition"],STRBEFORE:["groupCondition","*groupCondition"],STRAFTER:["groupCondition","*groupCondition"],YEAR:["groupCondition","*groupCondition"],MONTH:["groupCondition","*groupCondition"],DAY:["groupCondition","*groupCondition"],HOURS:["groupCondition","*groupCondition"],MINUTES:["groupCondition","*groupCondition"],SECONDS:["groupCondition","*groupCondition"],TIMEZONE:["groupCondition","*groupCondition"],TZ:["groupCondition","*groupCondition"],NOW:["groupCondition","*groupCondition"],UUID:["groupCondition","*groupCondition"],STRUUID:["groupCondition","*groupCondition"],MD5:["groupCondition","*groupCondition"],SHA1:["groupCondition","*groupCondition"],SHA256:["groupCondition","*groupCondition"],SHA384:["groupCondition","*groupCondition"],SHA512:["groupCondition","*groupCondition"],COALESCE:["groupCondition","*groupCondition"],IF:["groupCondition","*groupCondition"],STRLANG:["groupCondition","*groupCondition"],STRDT:["groupCondition","*groupCondition"],SAMETERM:["groupCondition","*groupCondition"],ISIRI:["groupCondition","*groupCondition"],ISURI:["groupCondition","*groupCondition"],ISBLANK:["groupCondition","*groupCondition"],ISLITERAL:["groupCondition","*groupCondition"],ISNUMERIC:["groupCondition","*groupCondition"],VAR1:["groupCondition","*groupCondition"],VAR2:["groupCondition","*groupCondition"],SUBSTR:["groupCondition","*groupCondition"],REPLACE:["groupCondition","*groupCondition"],REGEX:["groupCondition","*groupCondition"],EXISTS:["groupCondition","*groupCondition"],NOT:["groupCondition","*groupCondition"],IRI_REF:["groupCondition","*groupCondition"],PNAME_LN:["groupCondition","*groupCondition"],PNAME_NS:["groupCondition","*groupCondition"],VALUES:[],LIMIT:[],OFFSET:[],ORDER:[],HAVING:[],$:[],"}":[]},"*havingCondition":{"(":["havingCondition","*havingCondition"],STR:["havingCondition","*havingCondition"],LANG:["havingCondition","*havingCondition"],LANGMATCHES:["havingCondition","*havingCondition"],DATATYPE:["havingCondition","*havingCondition"],BOUND:["havingCondition","*havingCondition"],IRI:["havingCondition","*havingCondition"],URI:["havingCondition","*havingCondition"],BNODE:["havingCondition","*havingCondition"],RAND:["havingCondition","*havingCondition"],ABS:["havingCondition","*havingCondition"],CEIL:["havingCondition","*havingCondition"],FLOOR:["havingCondition","*havingCondition"],ROUND:["havingCondition","*havingCondition"],CONCAT:["havingCondition","*havingCondition"],STRLEN:["havingCondition","*havingCondition"],UCASE:["havingCondition","*havingCondition"],LCASE:["havingCondition","*havingCondition"],ENCODE_FOR_URI:["havingCondition","*havingCondition"],CONTAINS:["havingCondition","*havingCondition"],STRSTARTS:["havingCondition","*havingCondition"],STRENDS:["havingCondition","*havingCondition"],STRBEFORE:["havingCondition","*havingCondition"],STRAFTER:["havingCondition","*havingCondition"],YEAR:["havingCondition","*havingCondition"],MONTH:["havingCondition","*havingCondition"],DAY:["havingCondition","*havingCondition"],HOURS:["havingCondition","*havingCondition"],MINUTES:["havingCondition","*havingCondition"],SECONDS:["havingCondition","*havingCondition"],TIMEZONE:["havingCondition","*havingCondition"],TZ:["havingCondition","*havingCondition"],NOW:["havingCondition","*havingCondition"],UUID:["havingCondition","*havingCondition"],STRUUID:["havingCondition","*havingCondition"],MD5:["havingCondition","*havingCondition"],SHA1:["havingCondition","*havingCondition"],SHA256:["havingCondition","*havingCondition"],SHA384:["havingCondition","*havingCondition"],SHA512:["havingCondition","*havingCondition"],COALESCE:["havingCondition","*havingCondition"],IF:["havingCondition","*havingCondition"],STRLANG:["havingCondition","*havingCondition"],STRDT:["havingCondition","*havingCondition"],SAMETERM:["havingCondition","*havingCondition"],ISIRI:["havingCondition","*havingCondition"],ISURI:["havingCondition","*havingCondition"],ISBLANK:["havingCondition","*havingCondition"],ISLITERAL:["havingCondition","*havingCondition"],ISNUMERIC:["havingCondition","*havingCondition"],SUBSTR:["havingCondition","*havingCondition"],REPLACE:["havingCondition","*havingCondition"],REGEX:["havingCondition","*havingCondition"],EXISTS:["havingCondition","*havingCondition"],NOT:["havingCondition","*havingCondition"],IRI_REF:["havingCondition","*havingCondition"],PNAME_LN:["havingCondition","*havingCondition"],PNAME_NS:["havingCondition","*havingCondition"],VALUES:[],LIMIT:[],OFFSET:[],ORDER:[],$:[],"}":[]},"*or([[(,*dataBlockValue,)],NIL])":{"(":["or([[(,*dataBlockValue,)],NIL])","*or([[(,*dataBlockValue,)],NIL])"],NIL:["or([[(,*dataBlockValue,)],NIL])","*or([[(,*dataBlockValue,)],NIL])"],"}":[]},"*or([[*,unaryExpression],[/,unaryExpression]])":{"*":["or([[*,unaryExpression],[/,unaryExpression]])","*or([[*,unaryExpression],[/,unaryExpression]])"],"/":["or([[*,unaryExpression],[/,unaryExpression]])","*or([[*,unaryExpression],[/,unaryExpression]])"],AS:[],")":[],",":[],"||":[],"&&":[],"=":[],"!=":[],"<":[],">":[],"<=":[],">=":[],IN:[],NOT:[],"+":[],"-":[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[],";":[]},"*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])":{"+":["or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],"-":["or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],INTEGER_POSITIVE:["or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DECIMAL_POSITIVE:["or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DOUBLE_POSITIVE:["or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],INTEGER_NEGATIVE:["or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DECIMAL_NEGATIVE:["or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DOUBLE_NEGATIVE:["or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],AS:[],")":[],",":[],"||":[],"&&":[],"=":[],"!=":[],"<":[],">":[],"<=":[],">=":[],IN:[],NOT:[],";":[]},"*or([baseDecl,prefixDecl])":{BASE:["or([baseDecl,prefixDecl])","*or([baseDecl,prefixDecl])"],PREFIX:["or([baseDecl,prefixDecl])","*or([baseDecl,prefixDecl])"],$:[],CONSTRUCT:[],DESCRIBE:[],ASK:[],INSERT:[],DELETE:[],SELECT:[],LOAD:[],CLEAR:[],DROP:[],ADD:[],MOVE:[],COPY:[],CREATE:[],WITH:[]},"*or([var,[(,expression,AS,var,)]])":{"(":["or([var,[(,expression,AS,var,)]])","*or([var,[(,expression,AS,var,)]])"],VAR1:["or([var,[(,expression,AS,var,)]])","*or([var,[(,expression,AS,var,)]])"],VAR2:["or([var,[(,expression,AS,var,)]])","*or([var,[(,expression,AS,var,)]])"],WHERE:[],"{":[],FROM:[]},"*or([varOrIRIref,embeddedTriple])":{"<<":["or([varOrIRIref,embeddedTriple])","*or([varOrIRIref,embeddedTriple])"],VAR1:["or([varOrIRIref,embeddedTriple])","*or([varOrIRIref,embeddedTriple])"],VAR2:["or([varOrIRIref,embeddedTriple])","*or([varOrIRIref,embeddedTriple])"],IRI_REF:["or([varOrIRIref,embeddedTriple])","*or([varOrIRIref,embeddedTriple])"],PNAME_LN:["or([varOrIRIref,embeddedTriple])","*or([varOrIRIref,embeddedTriple])"],PNAME_NS:["or([varOrIRIref,embeddedTriple])","*or([varOrIRIref,embeddedTriple])"],ORDER:[],HAVING:[],GROUP:[],LIMIT:[],OFFSET:[],WHERE:[],"{":[],FROM:[],VALUES:[],$:[]},"*orderCondition":{ASC:["orderCondition","*orderCondition"],DESC:["orderCondition","*orderCondition"],VAR1:["orderCondition","*orderCondition"],VAR2:["orderCondition","*orderCondition"],"(":["orderCondition","*orderCondition"],STR:["orderCondition","*orderCondition"],LANG:["orderCondition","*orderCondition"],LANGMATCHES:["orderCondition","*orderCondition"],DATATYPE:["orderCondition","*orderCondition"],BOUND:["orderCondition","*orderCondition"],IRI:["orderCondition","*orderCondition"],URI:["orderCondition","*orderCondition"],BNODE:["orderCondition","*orderCondition"],RAND:["orderCondition","*orderCondition"],ABS:["orderCondition","*orderCondition"],CEIL:["orderCondition","*orderCondition"],FLOOR:["orderCondition","*orderCondition"],ROUND:["orderCondition","*orderCondition"],CONCAT:["orderCondition","*orderCondition"],STRLEN:["orderCondition","*orderCondition"],UCASE:["orderCondition","*orderCondition"],LCASE:["orderCondition","*orderCondition"],ENCODE_FOR_URI:["orderCondition","*orderCondition"],CONTAINS:["orderCondition","*orderCondition"],STRSTARTS:["orderCondition","*orderCondition"],STRENDS:["orderCondition","*orderCondition"],STRBEFORE:["orderCondition","*orderCondition"],STRAFTER:["orderCondition","*orderCondition"],YEAR:["orderCondition","*orderCondition"],MONTH:["orderCondition","*orderCondition"],DAY:["orderCondition","*orderCondition"],HOURS:["orderCondition","*orderCondition"],MINUTES:["orderCondition","*orderCondition"],SECONDS:["orderCondition","*orderCondition"],TIMEZONE:["orderCondition","*orderCondition"],TZ:["orderCondition","*orderCondition"],NOW:["orderCondition","*orderCondition"],UUID:["orderCondition","*orderCondition"],STRUUID:["orderCondition","*orderCondition"],MD5:["orderCondition","*orderCondition"],SHA1:["orderCondition","*orderCondition"],SHA256:["orderCondition","*orderCondition"],SHA384:["orderCondition","*orderCondition"],SHA512:["orderCondition","*orderCondition"],COALESCE:["orderCondition","*orderCondition"],IF:["orderCondition","*orderCondition"],STRLANG:["orderCondition","*orderCondition"],STRDT:["orderCondition","*orderCondition"],SAMETERM:["orderCondition","*orderCondition"],ISIRI:["orderCondition","*orderCondition"],ISURI:["orderCondition","*orderCondition"],ISBLANK:["orderCondition","*orderCondition"],ISLITERAL:["orderCondition","*orderCondition"],ISNUMERIC:["orderCondition","*orderCondition"],SUBSTR:["orderCondition","*orderCondition"],REPLACE:["orderCondition","*orderCondition"],REGEX:["orderCondition","*orderCondition"],EXISTS:["orderCondition","*orderCondition"],NOT:["orderCondition","*orderCondition"],IRI_REF:["orderCondition","*orderCondition"],PNAME_LN:["orderCondition","*orderCondition"],PNAME_NS:["orderCondition","*orderCondition"],VALUES:[],LIMIT:[],OFFSET:[],$:[],"}":[]},"*usingClause":{USING:["usingClause","*usingClause"],WHERE:[]},"*var":{VAR1:["var","*var"],VAR2:["var","*var"],")":[]},"+graphNode":{"(":["graphNode","*graphNode"],"[":["graphNode","*graphNode"],VAR1:["graphNode","*graphNode"],VAR2:["graphNode","*graphNode"],NIL:["graphNode","*graphNode"],IRI_REF:["graphNode","*graphNode"],TRUE:["graphNode","*graphNode"],FALSE:["graphNode","*graphNode"],BLANK_NODE_LABEL:["graphNode","*graphNode"],ANON:["graphNode","*graphNode"],"<<":["graphNode","*graphNode"],PNAME_LN:["graphNode","*graphNode"],PNAME_NS:["graphNode","*graphNode"],STRING_LITERAL1:["graphNode","*graphNode"],STRING_LITERAL2:["graphNode","*graphNode"],STRING_LITERAL_LONG1:["graphNode","*graphNode"],STRING_LITERAL_LONG2:["graphNode","*graphNode"],INTEGER:["graphNode","*graphNode"],DECIMAL:["graphNode","*graphNode"],DOUBLE:["graphNode","*graphNode"],INTEGER_POSITIVE:["graphNode","*graphNode"],DECIMAL_POSITIVE:["graphNode","*graphNode"],DOUBLE_POSITIVE:["graphNode","*graphNode"],INTEGER_NEGATIVE:["graphNode","*graphNode"],DECIMAL_NEGATIVE:["graphNode","*graphNode"],DOUBLE_NEGATIVE:["graphNode","*graphNode"]},"+graphNodePath":{"(":["graphNodePath","*graphNodePath"],"[":["graphNodePath","*graphNodePath"],VAR1:["graphNodePath","*graphNodePath"],VAR2:["graphNodePath","*graphNodePath"],NIL:["graphNodePath","*graphNodePath"],IRI_REF:["graphNodePath","*graphNodePath"],TRUE:["graphNodePath","*graphNodePath"],FALSE:["graphNodePath","*graphNodePath"],BLANK_NODE_LABEL:["graphNodePath","*graphNodePath"],ANON:["graphNodePath","*graphNodePath"],"<<":["graphNodePath","*graphNodePath"],PNAME_LN:["graphNodePath","*graphNodePath"],PNAME_NS:["graphNodePath","*graphNodePath"],STRING_LITERAL1:["graphNodePath","*graphNodePath"],STRING_LITERAL2:["graphNodePath","*graphNodePath"],STRING_LITERAL_LONG1:["graphNodePath","*graphNodePath"],STRING_LITERAL_LONG2:["graphNodePath","*graphNodePath"],INTEGER:["graphNodePath","*graphNodePath"],DECIMAL:["graphNodePath","*graphNodePath"],DOUBLE:["graphNodePath","*graphNodePath"],INTEGER_POSITIVE:["graphNodePath","*graphNodePath"],DECIMAL_POSITIVE:["graphNodePath","*graphNodePath"],DOUBLE_POSITIVE:["graphNodePath","*graphNodePath"],INTEGER_NEGATIVE:["graphNodePath","*graphNodePath"],DECIMAL_NEGATIVE:["graphNodePath","*graphNodePath"],DOUBLE_NEGATIVE:["graphNodePath","*graphNodePath"]},"+groupCondition":{"(":["groupCondition","*groupCondition"],STR:["groupCondition","*groupCondition"],LANG:["groupCondition","*groupCondition"],LANGMATCHES:["groupCondition","*groupCondition"],DATATYPE:["groupCondition","*groupCondition"],BOUND:["groupCondition","*groupCondition"],IRI:["groupCondition","*groupCondition"],URI:["groupCondition","*groupCondition"],BNODE:["groupCondition","*groupCondition"],RAND:["groupCondition","*groupCondition"],ABS:["groupCondition","*groupCondition"],CEIL:["groupCondition","*groupCondition"],FLOOR:["groupCondition","*groupCondition"],ROUND:["groupCondition","*groupCondition"],CONCAT:["groupCondition","*groupCondition"],STRLEN:["groupCondition","*groupCondition"],UCASE:["groupCondition","*groupCondition"],LCASE:["groupCondition","*groupCondition"],ENCODE_FOR_URI:["groupCondition","*groupCondition"],CONTAINS:["groupCondition","*groupCondition"],STRSTARTS:["groupCondition","*groupCondition"],STRENDS:["groupCondition","*groupCondition"],STRBEFORE:["groupCondition","*groupCondition"],STRAFTER:["groupCondition","*groupCondition"],YEAR:["groupCondition","*groupCondition"],MONTH:["groupCondition","*groupCondition"],DAY:["groupCondition","*groupCondition"],HOURS:["groupCondition","*groupCondition"],MINUTES:["groupCondition","*groupCondition"],SECONDS:["groupCondition","*groupCondition"],TIMEZONE:["groupCondition","*groupCondition"],TZ:["groupCondition","*groupCondition"],NOW:["groupCondition","*groupCondition"],UUID:["groupCondition","*groupCondition"],STRUUID:["groupCondition","*groupCondition"],MD5:["groupCondition","*groupCondition"],SHA1:["groupCondition","*groupCondition"],SHA256:["groupCondition","*groupCondition"],SHA384:["groupCondition","*groupCondition"],SHA512:["groupCondition","*groupCondition"],COALESCE:["groupCondition","*groupCondition"],IF:["groupCondition","*groupCondition"],STRLANG:["groupCondition","*groupCondition"],STRDT:["groupCondition","*groupCondition"],SAMETERM:["groupCondition","*groupCondition"],ISIRI:["groupCondition","*groupCondition"],ISURI:["groupCondition","*groupCondition"],ISBLANK:["groupCondition","*groupCondition"],ISLITERAL:["groupCondition","*groupCondition"],ISNUMERIC:["groupCondition","*groupCondition"],VAR1:["groupCondition","*groupCondition"],VAR2:["groupCondition","*groupCondition"],SUBSTR:["groupCondition","*groupCondition"],REPLACE:["groupCondition","*groupCondition"],REGEX:["groupCondition","*groupCondition"],EXISTS:["groupCondition","*groupCondition"],NOT:["groupCondition","*groupCondition"],IRI_REF:["groupCondition","*groupCondition"],PNAME_LN:["groupCondition","*groupCondition"],PNAME_NS:["groupCondition","*groupCondition"]},"+havingCondition":{"(":["havingCondition","*havingCondition"],STR:["havingCondition","*havingCondition"],LANG:["havingCondition","*havingCondition"],LANGMATCHES:["havingCondition","*havingCondition"],DATATYPE:["havingCondition","*havingCondition"],BOUND:["havingCondition","*havingCondition"],IRI:["havingCondition","*havingCondition"],URI:["havingCondition","*havingCondition"],BNODE:["havingCondition","*havingCondition"],RAND:["havingCondition","*havingCondition"],ABS:["havingCondition","*havingCondition"],CEIL:["havingCondition","*havingCondition"],FLOOR:["havingCondition","*havingCondition"],ROUND:["havingCondition","*havingCondition"],CONCAT:["havingCondition","*havingCondition"],STRLEN:["havingCondition","*havingCondition"],UCASE:["havingCondition","*havingCondition"],LCASE:["havingCondition","*havingCondition"],ENCODE_FOR_URI:["havingCondition","*havingCondition"],CONTAINS:["havingCondition","*havingCondition"],STRSTARTS:["havingCondition","*havingCondition"],STRENDS:["havingCondition","*havingCondition"],STRBEFORE:["havingCondition","*havingCondition"],STRAFTER:["havingCondition","*havingCondition"],YEAR:["havingCondition","*havingCondition"],MONTH:["havingCondition","*havingCondition"],DAY:["havingCondition","*havingCondition"],HOURS:["havingCondition","*havingCondition"],MINUTES:["havingCondition","*havingCondition"],SECONDS:["havingCondition","*havingCondition"],TIMEZONE:["havingCondition","*havingCondition"],TZ:["havingCondition","*havingCondition"],NOW:["havingCondition","*havingCondition"],UUID:["havingCondition","*havingCondition"],STRUUID:["havingCondition","*havingCondition"],MD5:["havingCondition","*havingCondition"],SHA1:["havingCondition","*havingCondition"],SHA256:["havingCondition","*havingCondition"],SHA384:["havingCondition","*havingCondition"],SHA512:["havingCondition","*havingCondition"],COALESCE:["havingCondition","*havingCondition"],IF:["havingCondition","*havingCondition"],STRLANG:["havingCondition","*havingCondition"],STRDT:["havingCondition","*havingCondition"],SAMETERM:["havingCondition","*havingCondition"],ISIRI:["havingCondition","*havingCondition"],ISURI:["havingCondition","*havingCondition"],ISBLANK:["havingCondition","*havingCondition"],ISLITERAL:["havingCondition","*havingCondition"],ISNUMERIC:["havingCondition","*havingCondition"],SUBSTR:["havingCondition","*havingCondition"],REPLACE:["havingCondition","*havingCondition"],REGEX:["havingCondition","*havingCondition"],EXISTS:["havingCondition","*havingCondition"],NOT:["havingCondition","*havingCondition"],IRI_REF:["havingCondition","*havingCondition"],PNAME_LN:["havingCondition","*havingCondition"],PNAME_NS:["havingCondition","*havingCondition"]},"+or([var,[(,expression,AS,var,)]])":{"(":["or([var,[(,expression,AS,var,)]])","*or([var,[(,expression,AS,var,)]])"],VAR1:["or([var,[(,expression,AS,var,)]])","*or([var,[(,expression,AS,var,)]])"],VAR2:["or([var,[(,expression,AS,var,)]])","*or([var,[(,expression,AS,var,)]])"]},"+or([varOrIRIref,embeddedTriple])":{"<<":["or([varOrIRIref,embeddedTriple])","*or([varOrIRIref,embeddedTriple])"],VAR1:["or([varOrIRIref,embeddedTriple])","*or([varOrIRIref,embeddedTriple])"],VAR2:["or([varOrIRIref,embeddedTriple])","*or([varOrIRIref,embeddedTriple])"],IRI_REF:["or([varOrIRIref,embeddedTriple])","*or([varOrIRIref,embeddedTriple])"],PNAME_LN:["or([varOrIRIref,embeddedTriple])","*or([varOrIRIref,embeddedTriple])"],PNAME_NS:["or([varOrIRIref,embeddedTriple])","*or([varOrIRIref,embeddedTriple])"]},"+orderCondition":{ASC:["orderCondition","*orderCondition"],DESC:["orderCondition","*orderCondition"],VAR1:["orderCondition","*orderCondition"],VAR2:["orderCondition","*orderCondition"],"(":["orderCondition","*orderCondition"],STR:["orderCondition","*orderCondition"],LANG:["orderCondition","*orderCondition"],LANGMATCHES:["orderCondition","*orderCondition"],DATATYPE:["orderCondition","*orderCondition"],BOUND:["orderCondition","*orderCondition"],IRI:["orderCondition","*orderCondition"],URI:["orderCondition","*orderCondition"],BNODE:["orderCondition","*orderCondition"],RAND:["orderCondition","*orderCondition"],ABS:["orderCondition","*orderCondition"],CEIL:["orderCondition","*orderCondition"],FLOOR:["orderCondition","*orderCondition"],ROUND:["orderCondition","*orderCondition"],CONCAT:["orderCondition","*orderCondition"],STRLEN:["orderCondition","*orderCondition"],UCASE:["orderCondition","*orderCondition"],LCASE:["orderCondition","*orderCondition"],ENCODE_FOR_URI:["orderCondition","*orderCondition"],CONTAINS:["orderCondition","*orderCondition"],STRSTARTS:["orderCondition","*orderCondition"],STRENDS:["orderCondition","*orderCondition"],STRBEFORE:["orderCondition","*orderCondition"],STRAFTER:["orderCondition","*orderCondition"],YEAR:["orderCondition","*orderCondition"],MONTH:["orderCondition","*orderCondition"],DAY:["orderCondition","*orderCondition"],HOURS:["orderCondition","*orderCondition"],MINUTES:["orderCondition","*orderCondition"],SECONDS:["orderCondition","*orderCondition"],TIMEZONE:["orderCondition","*orderCondition"],TZ:["orderCondition","*orderCondition"],NOW:["orderCondition","*orderCondition"],UUID:["orderCondition","*orderCondition"],STRUUID:["orderCondition","*orderCondition"],MD5:["orderCondition","*orderCondition"],SHA1:["orderCondition","*orderCondition"],SHA256:["orderCondition","*orderCondition"],SHA384:["orderCondition","*orderCondition"],SHA512:["orderCondition","*orderCondition"],COALESCE:["orderCondition","*orderCondition"],IF:["orderCondition","*orderCondition"],STRLANG:["orderCondition","*orderCondition"],STRDT:["orderCondition","*orderCondition"],SAMETERM:["orderCondition","*orderCondition"],ISIRI:["orderCondition","*orderCondition"],ISURI:["orderCondition","*orderCondition"],ISBLANK:["orderCondition","*orderCondition"],ISLITERAL:["orderCondition","*orderCondition"],ISNUMERIC:["orderCondition","*orderCondition"],SUBSTR:["orderCondition","*orderCondition"],REPLACE:["orderCondition","*orderCondition"],REGEX:["orderCondition","*orderCondition"],EXISTS:["orderCondition","*orderCondition"],NOT:["orderCondition","*orderCondition"],IRI_REF:["orderCondition","*orderCondition"],PNAME_LN:["orderCondition","*orderCondition"],PNAME_NS:["orderCondition","*orderCondition"]},"?.":{".":["."],VAR1:[],VAR2:[],NIL:[],"(":[],"[":[],IRI_REF:[],TRUE:[],FALSE:[],BLANK_NODE_LABEL:[],ANON:[],"<<":[],PNAME_LN:[],PNAME_NS:[],STRING_LITERAL1:[],STRING_LITERAL2:[],STRING_LITERAL_LONG1:[],STRING_LITERAL_LONG2:[],INTEGER:[],DECIMAL:[],DOUBLE:[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[],GRAPH:[],"{":[],OPTIONAL:[],MINUS:[],SERVICE:[],FILTER:[],BIND:[],VALUES:[],"}":[]},"?DISTINCT":{DISTINCT:["DISTINCT"],"!":[],"+":[],"-":[],VAR1:[],VAR2:[],"(":[],STR:[],LANG:[],LANGMATCHES:[],DATATYPE:[],BOUND:[],IRI:[],URI:[],BNODE:[],RAND:[],ABS:[],CEIL:[],FLOOR:[],ROUND:[],CONCAT:[],STRLEN:[],UCASE:[],LCASE:[],ENCODE_FOR_URI:[],CONTAINS:[],STRSTARTS:[],STRENDS:[],STRBEFORE:[],STRAFTER:[],YEAR:[],MONTH:[],DAY:[],HOURS:[],MINUTES:[],SECONDS:[],TIMEZONE:[],TZ:[],NOW:[],UUID:[],STRUUID:[],MD5:[],SHA1:[],SHA256:[],SHA384:[],SHA512:[],COALESCE:[],IF:[],STRLANG:[],STRDT:[],SAMETERM:[],ISIRI:[],ISURI:[],ISBLANK:[],ISLITERAL:[],ISNUMERIC:[],TRUE:[],FALSE:[],"<<":[],COUNT:[],SUM:[],MIN:[],MAX:[],AVG:[],SAMPLE:[],GROUP_CONCAT:[],SUBSTR:[],REPLACE:[],REGEX:[],EXISTS:[],NOT:[],IRI_REF:[],STRING_LITERAL1:[],STRING_LITERAL2:[],STRING_LITERAL_LONG1:[],STRING_LITERAL_LONG2:[],INTEGER:[],DECIMAL:[],DOUBLE:[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[],PNAME_LN:[],PNAME_NS:[],"*":[]},"?GRAPH":{GRAPH:["GRAPH"],IRI_REF:[],PNAME_LN:[],PNAME_NS:[]},"?SILENT":{SILENT:["SILENT"],VAR1:[],VAR2:[],IRI_REF:[],PNAME_LN:[],PNAME_NS:[]},"?SILENT_1":{SILENT:["SILENT"],IRI_REF:[],PNAME_LN:[],PNAME_NS:[]},"?SILENT_2":{SILENT:["SILENT"],GRAPH:[],DEFAULT:[],NAMED:[],ALL:[]},"?SILENT_3":{SILENT:["SILENT"],GRAPH:[]},"?SILENT_4":{SILENT:["SILENT"],DEFAULT:[],GRAPH:[],IRI_REF:[],PNAME_LN:[],PNAME_NS:[]},"?WHERE":{WHERE:["WHERE"],"{":[]},"?[,,expression]":{",":["[,,expression]"],")":[]},"?[.,?constructTriples]":{".":["[.,?constructTriples]"],"}":[]},"?[.,?triplesBlock]":{".":["[.,?triplesBlock]"],"{":[],OPTIONAL:[],MINUS:[],GRAPH:[],SERVICE:[],FILTER:[],BIND:[],VALUES:[],"}":[]},"?[.,?triplesTemplate]":{".":["[.,?triplesTemplate]"],"}":[],GRAPH:[]},"?[;,SEPARATOR,=,string]":{";":["[;,SEPARATOR,=,string]"],")":[]},"?[;,update]":{";":["[;,update]"],$:[]},"?[AS,var]":{AS:["[AS,var]"],")":[]},"?[INTO,graphRef]":{INTO:["[INTO,graphRef]"],";":[],$:[]},"?[or([verbPath,verbSimple]),objectList]":{VAR1:["[or([verbPath,verbSimple]),objectList]"],VAR2:["[or([verbPath,verbSimple]),objectList]"],"^":["[or([verbPath,verbSimple]),objectList]"],a:["[or([verbPath,verbSimple]),objectList]"],"!":["[or([verbPath,verbSimple]),objectList]"],"(":["[or([verbPath,verbSimple]),objectList]"],IRI_REF:["[or([verbPath,verbSimple]),objectList]"],PNAME_LN:["[or([verbPath,verbSimple]),objectList]"],PNAME_NS:["[or([verbPath,verbSimple]),objectList]"],";":[],".":[],"]":[],"}":[],GRAPH:[],"{":[],OPTIONAL:[],MINUS:[],SERVICE:[],FILTER:[],BIND:[],VALUES:[]},"?[pathOneInPropertySet,*[|,pathOneInPropertySet]]":{a:["[pathOneInPropertySet,*[|,pathOneInPropertySet]]"],"^":["[pathOneInPropertySet,*[|,pathOneInPropertySet]]"],IRI_REF:["[pathOneInPropertySet,*[|,pathOneInPropertySet]]"],PNAME_LN:["[pathOneInPropertySet,*[|,pathOneInPropertySet]]"],PNAME_NS:["[pathOneInPropertySet,*[|,pathOneInPropertySet]]"],")":[]},"?[update1,?[;,update]]":{INSERT:["[update1,?[;,update]]"],DELETE:["[update1,?[;,update]]"],LOAD:["[update1,?[;,update]]"],CLEAR:["[update1,?[;,update]]"],DROP:["[update1,?[;,update]]"],ADD:["[update1,?[;,update]]"],MOVE:["[update1,?[;,update]]"],COPY:["[update1,?[;,update]]"],CREATE:["[update1,?[;,update]]"],WITH:["[update1,?[;,update]]"],$:[]},"?argList":{NIL:["argList"],"(":["argList"],AS:[],")":[],",":[],"||":[],"&&":[],"=":[],"!=":[],"<":[],">":[],"<=":[],">=":[],IN:[],NOT:[],"+":[],"-":[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[],"*":[],"/":[],";":[]},"?constructTriples":{VAR1:["constructTriples"],VAR2:["constructTriples"],NIL:["constructTriples"],"(":["constructTriples"],"[":["constructTriples"],IRI_REF:["constructTriples"],TRUE:["constructTriples"],FALSE:["constructTriples"],BLANK_NODE_LABEL:["constructTriples"],ANON:["constructTriples"],"<<":["constructTriples"],PNAME_LN:["constructTriples"],PNAME_NS:["constructTriples"],STRING_LITERAL1:["constructTriples"],STRING_LITERAL2:["constructTriples"],STRING_LITERAL_LONG1:["constructTriples"],STRING_LITERAL_LONG2:["constructTriples"],INTEGER:["constructTriples"],DECIMAL:["constructTriples"],DOUBLE:["constructTriples"],INTEGER_POSITIVE:["constructTriples"],DECIMAL_POSITIVE:["constructTriples"],DOUBLE_POSITIVE:["constructTriples"],INTEGER_NEGATIVE:["constructTriples"],DECIMAL_NEGATIVE:["constructTriples"],DOUBLE_NEGATIVE:["constructTriples"],"}":[]},"?groupClause":{GROUP:["groupClause"],VALUES:[],LIMIT:[],OFFSET:[],ORDER:[],HAVING:[],$:[],"}":[]},"?havingClause":{HAVING:["havingClause"],VALUES:[],LIMIT:[],OFFSET:[],ORDER:[],$:[],"}":[]},"?insertClause":{INSERT:["insertClause"],WHERE:[],USING:[]},"?limitClause":{LIMIT:["limitClause"],VALUES:[],$:[],"}":[]},"?limitOffsetClauses":{LIMIT:["limitOffsetClauses"],OFFSET:["limitOffsetClauses"],VALUES:[],$:[],"}":[]},"?offsetClause":{OFFSET:["offsetClause"],VALUES:[],$:[],"}":[]},"?or([DISTINCT,REDUCED])":{DISTINCT:["or([DISTINCT,REDUCED])"],REDUCED:["or([DISTINCT,REDUCED])"],"*":[],"(":[],VAR1:[],VAR2:[]},"?or([LANGTAG,[^^,iriRef]])":{LANGTAG:["or([LANGTAG,[^^,iriRef]])"],"^^":["or([LANGTAG,[^^,iriRef]])"],UNDEF:[],IRI_REF:[],TRUE:[],FALSE:[],"<<":[],PNAME_LN:[],PNAME_NS:[],STRING_LITERAL1:[],STRING_LITERAL2:[],STRING_LITERAL_LONG1:[],STRING_LITERAL_LONG2:[],INTEGER:[],DECIMAL:[],DOUBLE:[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[],VAR1:[],VAR2:[],"^":[],a:[],"!":[],"(":[],".":[],";":[],",":[],AS:[],")":[],"||":[],"&&":[],"=":[],"!=":[],"<":[],">":[],"<=":[],">=":[],IN:[],NOT:[],"+":[],"-":[],"*":[],"/":[],"}":[],">>":[],"[":[],NIL:[],BLANK_NODE_LABEL:[],ANON:[],"]":[],GRAPH:[],"{":[],OPTIONAL:[],MINUS:[],SERVICE:[],FILTER:[],BIND:[],VALUES:[]},"?or([[*,unaryExpression],[/,unaryExpression]])":{"*":["or([[*,unaryExpression],[/,unaryExpression]])"],"/":["or([[*,unaryExpression],[/,unaryExpression]])"],"+":[],"-":[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[],AS:[],")":[],",":[],"||":[],"&&":[],"=":[],"!=":[],"<":[],">":[],"<=":[],">=":[],IN:[],NOT:[],";":[]},"?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])":{"=":["or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],"!=":["or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],"<":["or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],">":["or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],"<=":["or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],">=":["or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],IN:["or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],NOT:["or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],AS:[],")":[],",":[],"||":[],"&&":[],";":[]},"?orderClause":{ORDER:["orderClause"],VALUES:[],LIMIT:[],OFFSET:[],$:[],"}":[]},"?pathMod":{"*":["pathMod"],"?":["pathMod"],"+":["pathMod"],"{":["pathMod"],"|":[],"/":[],")":[],"(":[],"[":[],VAR1:[],VAR2:[],NIL:[],IRI_REF:[],TRUE:[],FALSE:[],BLANK_NODE_LABEL:[],ANON:[],"<<":[],PNAME_LN:[],PNAME_NS:[],STRING_LITERAL1:[],STRING_LITERAL2:[],STRING_LITERAL_LONG1:[],STRING_LITERAL_LONG2:[],INTEGER:[],DECIMAL:[],DOUBLE:[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[]},"?triplesBlock":{VAR1:["triplesBlock"],VAR2:["triplesBlock"],NIL:["triplesBlock"],"(":["triplesBlock"],"[":["triplesBlock"],IRI_REF:["triplesBlock"],TRUE:["triplesBlock"],FALSE:["triplesBlock"],BLANK_NODE_LABEL:["triplesBlock"],ANON:["triplesBlock"],"<<":["triplesBlock"],PNAME_LN:["triplesBlock"],PNAME_NS:["triplesBlock"],STRING_LITERAL1:["triplesBlock"],STRING_LITERAL2:["triplesBlock"],STRING_LITERAL_LONG1:["triplesBlock"],STRING_LITERAL_LONG2:["triplesBlock"],INTEGER:["triplesBlock"],DECIMAL:["triplesBlock"],DOUBLE:["triplesBlock"],INTEGER_POSITIVE:["triplesBlock"],DECIMAL_POSITIVE:["triplesBlock"],DOUBLE_POSITIVE:["triplesBlock"],INTEGER_NEGATIVE:["triplesBlock"],DECIMAL_NEGATIVE:["triplesBlock"],DOUBLE_NEGATIVE:["triplesBlock"],"{":[],OPTIONAL:[],MINUS:[],GRAPH:[],SERVICE:[],FILTER:[],BIND:[],VALUES:[],"}":[]},"?triplesTemplate":{VAR1:["triplesTemplate"],VAR2:["triplesTemplate"],NIL:["triplesTemplate"],"(":["triplesTemplate"],"[":["triplesTemplate"],IRI_REF:["triplesTemplate"],TRUE:["triplesTemplate"],FALSE:["triplesTemplate"],BLANK_NODE_LABEL:["triplesTemplate"],ANON:["triplesTemplate"],"<<":["triplesTemplate"],PNAME_LN:["triplesTemplate"],PNAME_NS:["triplesTemplate"],STRING_LITERAL1:["triplesTemplate"],STRING_LITERAL2:["triplesTemplate"],STRING_LITERAL_LONG1:["triplesTemplate"],STRING_LITERAL_LONG2:["triplesTemplate"],INTEGER:["triplesTemplate"],DECIMAL:["triplesTemplate"],DOUBLE:["triplesTemplate"],INTEGER_POSITIVE:["triplesTemplate"],DECIMAL_POSITIVE:["triplesTemplate"],DOUBLE_POSITIVE:["triplesTemplate"],INTEGER_NEGATIVE:["triplesTemplate"],DECIMAL_NEGATIVE:["triplesTemplate"],DOUBLE_NEGATIVE:["triplesTemplate"],"}":[],GRAPH:[]},"?whereClause":{WHERE:["whereClause"],"{":["whereClause"],ORDER:[],HAVING:[],GROUP:[],LIMIT:[],OFFSET:[],VALUES:[],$:[]},"[!=,numericExpression]":{"!=":["!=","numericExpression"]},"[&&,valueLogical]":{"&&":["&&","valueLogical"]},"[(,*dataBlockValue,)]":{"(":["(","*dataBlockValue",")"]},"[(,*var,)]":{"(":["(","*var",")"]},"[(,expression,)]":{"(":["(","expression",")"]},"[(,expression,AS,var,)]":{"(":["(","expression","AS","var",")"]},"[*,unaryExpression]":{"*":["*","unaryExpression"]},"[*datasetClause,WHERE,{,?triplesTemplate,},solutionModifier]":{WHERE:["*datasetClause","WHERE","{","?triplesTemplate","}","solutionModifier"],FROM:["*datasetClause","WHERE","{","?triplesTemplate","}","solutionModifier"]},"[+,multiplicativeExpression]":{"+":["+","multiplicativeExpression"]},"[,,expression]":{",":[",","expression"]},"[,,integer,}]":{",":[",","integer","}"]},"[,,objectPath]":{",":[",","objectPath"]},"[,,object]":{",":[",","object"]},"[,,or([},[integer,}]])]":{",":[",","or([},[integer,}]])"]},"[-,multiplicativeExpression]":{"-":["-","multiplicativeExpression"]},"[.,?constructTriples]":{".":[".","?constructTriples"]},"[.,?triplesBlock]":{".":[".","?triplesBlock"]},"[.,?triplesTemplate]":{".":[".","?triplesTemplate"]},"[/,pathEltOrInverse]":{"/":["/","pathEltOrInverse"]},"[/,unaryExpression]":{"/":["/","unaryExpression"]},"[;,?[or([verbPath,verbSimple]),objectList]]":{";":[";","?[or([verbPath,verbSimple]),objectList]"]},"[;,SEPARATOR,=,string]":{";":[";","SEPARATOR","=","string"]},"[;,update]":{";":[";","update"]},"[<,numericExpression]":{"<":["<","numericExpression"]},"[<=,numericExpression]":{"<=":["<=","numericExpression"]},"[=,numericExpression]":{"=":["=","numericExpression"]},"[>,numericExpression]":{">":[">","numericExpression"]},"[>=,numericExpression]":{">=":[">=","numericExpression"]},"[AS,var]":{AS:["AS","var"]},"[IN,expressionList]":{IN:["IN","expressionList"]},"[INTO,graphRef]":{INTO:["INTO","graphRef"]},"[NAMED,iriRef]":{NAMED:["NAMED","iriRef"]},"[NOT,IN,expressionList]":{NOT:["NOT","IN","expressionList"]},"[UNION,groupGraphPattern]":{UNION:["UNION","groupGraphPattern"]},"[^^,iriRef]":{"^^":["^^","iriRef"]},"[constructTemplate,*datasetClause,whereClause,solutionModifier]":{"{":["constructTemplate","*datasetClause","whereClause","solutionModifier"]},"[deleteClause,?insertClause]":{DELETE:["deleteClause","?insertClause"]},"[graphPatternNotTriples,?.,?triplesBlock]":{"{":["graphPatternNotTriples","?.","?triplesBlock"],OPTIONAL:["graphPatternNotTriples","?.","?triplesBlock"],MINUS:["graphPatternNotTriples","?.","?triplesBlock"],GRAPH:["graphPatternNotTriples","?.","?triplesBlock"],SERVICE:["graphPatternNotTriples","?.","?triplesBlock"],FILTER:["graphPatternNotTriples","?.","?triplesBlock"],BIND:["graphPatternNotTriples","?.","?triplesBlock"],VALUES:["graphPatternNotTriples","?.","?triplesBlock"]},"[integer,or([[,,or([},[integer,}]])],}])]":{INTEGER:["integer","or([[,,or([},[integer,}]])],}])"]},"[integer,}]":{INTEGER:["integer","}"]},"[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]":{INTEGER_POSITIVE:["or([numericLiteralPositive,numericLiteralNegative])","?or([[*,unaryExpression],[/,unaryExpression]])"],DECIMAL_POSITIVE:["or([numericLiteralPositive,numericLiteralNegative])","?or([[*,unaryExpression],[/,unaryExpression]])"],DOUBLE_POSITIVE:["or([numericLiteralPositive,numericLiteralNegative])","?or([[*,unaryExpression],[/,unaryExpression]])"],INTEGER_NEGATIVE:["or([numericLiteralPositive,numericLiteralNegative])","?or([[*,unaryExpression],[/,unaryExpression]])"],DECIMAL_NEGATIVE:["or([numericLiteralPositive,numericLiteralNegative])","?or([[*,unaryExpression],[/,unaryExpression]])"],DOUBLE_NEGATIVE:["or([numericLiteralPositive,numericLiteralNegative])","?or([[*,unaryExpression],[/,unaryExpression]])"]},"[or([verbPath,verbSimple]),objectList]":{VAR1:["or([verbPath,verbSimple])","objectList"],VAR2:["or([verbPath,verbSimple])","objectList"],"^":["or([verbPath,verbSimple])","objectList"],a:["or([verbPath,verbSimple])","objectList"],"!":["or([verbPath,verbSimple])","objectList"],"(":["or([verbPath,verbSimple])","objectList"],IRI_REF:["or([verbPath,verbSimple])","objectList"],PNAME_LN:["or([verbPath,verbSimple])","objectList"],PNAME_NS:["or([verbPath,verbSimple])","objectList"]},"[pathOneInPropertySet,*[|,pathOneInPropertySet]]":{a:["pathOneInPropertySet","*[|,pathOneInPropertySet]"],"^":["pathOneInPropertySet","*[|,pathOneInPropertySet]"],IRI_REF:["pathOneInPropertySet","*[|,pathOneInPropertySet]"],PNAME_LN:["pathOneInPropertySet","*[|,pathOneInPropertySet]"],PNAME_NS:["pathOneInPropertySet","*[|,pathOneInPropertySet]"]},"[quadsNotTriples,?.,?triplesTemplate]":{GRAPH:["quadsNotTriples","?.","?triplesTemplate"]},"[update1,?[;,update]]":{INSERT:["update1","?[;,update]"],DELETE:["update1","?[;,update]"],LOAD:["update1","?[;,update]"],CLEAR:["update1","?[;,update]"],DROP:["update1","?[;,update]"],ADD:["update1","?[;,update]"],MOVE:["update1","?[;,update]"],COPY:["update1","?[;,update]"],CREATE:["update1","?[;,update]"],WITH:["update1","?[;,update]"]},"[|,pathOneInPropertySet]":{"|":["|","pathOneInPropertySet"]},"[|,pathSequence]":{"|":["|","pathSequence"]},"[||,conditionalAndExpression]":{"||":["||","conditionalAndExpression"]},add:{ADD:["ADD","?SILENT_4","graphOrDefault","TO","graphOrDefault"]},additiveExpression:{"!":["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],"+":["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],"-":["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],VAR1:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],VAR2:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],"(":["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STR:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],LANG:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],LANGMATCHES:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DATATYPE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],BOUND:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],IRI:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],URI:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],BNODE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],RAND:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],ABS:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],CEIL:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],FLOOR:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],ROUND:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],CONCAT:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRLEN:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],UCASE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],LCASE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],ENCODE_FOR_URI:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],CONTAINS:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRSTARTS:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRENDS:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRBEFORE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRAFTER:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],YEAR:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],MONTH:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DAY:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],HOURS:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],MINUTES:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],SECONDS:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],TIMEZONE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],TZ:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],NOW:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],UUID:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRUUID:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],MD5:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],SHA1:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],SHA256:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],SHA384:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],SHA512:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],COALESCE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],IF:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRLANG:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRDT:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],SAMETERM:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],ISIRI:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],ISURI:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],ISBLANK:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],ISLITERAL:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],ISNUMERIC:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],TRUE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],FALSE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],"<<":["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],COUNT:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],SUM:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],MIN:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],MAX:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],AVG:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],SAMPLE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],GROUP_CONCAT:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],SUBSTR:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],REPLACE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],REGEX:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],EXISTS:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],NOT:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],IRI_REF:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRING_LITERAL1:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRING_LITERAL2:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRING_LITERAL_LONG1:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRING_LITERAL_LONG2:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],INTEGER:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DECIMAL:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DOUBLE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],INTEGER_POSITIVE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DECIMAL_POSITIVE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DOUBLE_POSITIVE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],INTEGER_NEGATIVE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DECIMAL_NEGATIVE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DOUBLE_NEGATIVE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],PNAME_LN:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],PNAME_NS:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"]},aggregate:{COUNT:["COUNT","(","?DISTINCT","or([*,expression])",")"],SUM:["SUM","(","?DISTINCT","expression",")"],MIN:["MIN","(","?DISTINCT","expression",")"],MAX:["MAX","(","?DISTINCT","expression",")"],AVG:["AVG","(","?DISTINCT","expression",")"],SAMPLE:["SAMPLE","(","?DISTINCT","expression",")"],GROUP_CONCAT:["GROUP_CONCAT","(","?DISTINCT","expression","?[;,SEPARATOR,=,string]",")"]},allowBnodes:{"}":[]},allowVars:{"}":[],UNDEF:[],IRI_REF:[],TRUE:[],FALSE:[],"<<":[],PNAME_LN:[],PNAME_NS:[],STRING_LITERAL1:[],STRING_LITERAL2:[],STRING_LITERAL_LONG1:[],STRING_LITERAL_LONG2:[],INTEGER:[],DECIMAL:[],DOUBLE:[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[],")":[]},argList:{NIL:["NIL"],"(":["(","?DISTINCT","expression","*[,,expression]",")"]},askQuery:{ASK:["ASK","*datasetClause","whereClause","solutionModifier"]},baseDecl:{BASE:["BASE","IRI_REF"]},bind:{BIND:["BIND","(","expression","AS","var",")"]},blankNode:{BLANK_NODE_LABEL:["BLANK_NODE_LABEL"],ANON:["ANON"]},blankNodePropertyList:{"[":["[","propertyListNotEmpty","]"]},blankNodePropertyListPath:{"[":["[","propertyListPathNotEmpty","]"]},booleanLiteral:{TRUE:["TRUE"],FALSE:["FALSE"]},brackettedExpression:{"(":["(","expression",")"]},builtInCall:{STR:["STR","(","expression",")"],LANG:["LANG","(","expression",")"],LANGMATCHES:["LANGMATCHES","(","expression",",","expression",")"],DATATYPE:["DATATYPE","(","expression",")"],BOUND:["BOUND","(","var",")"],IRI:["IRI","(","expression",")"],URI:["URI","(","expression",")"],BNODE:["BNODE","or([[(,expression,)],NIL])"],RAND:["RAND","NIL"],ABS:["ABS","(","expression",")"],CEIL:["CEIL","(","expression",")"],FLOOR:["FLOOR","(","expression",")"],ROUND:["ROUND","(","expression",")"],CONCAT:["CONCAT","expressionList"],SUBSTR:["substringExpression"],STRLEN:["STRLEN","(","expression",")"],REPLACE:["strReplaceExpression"],UCASE:["UCASE","(","expression",")"],LCASE:["LCASE","(","expression",")"],ENCODE_FOR_URI:["ENCODE_FOR_URI","(","expression",")"],CONTAINS:["CONTAINS","(","expression",",","expression",")"],STRSTARTS:["STRSTARTS","(","expression",",","expression",")"],STRENDS:["STRENDS","(","expression",",","expression",")"],STRBEFORE:["STRBEFORE","(","expression",",","expression",")"],STRAFTER:["STRAFTER","(","expression",",","expression",")"],YEAR:["YEAR","(","expression",")"],MONTH:["MONTH","(","expression",")"],DAY:["DAY","(","expression",")"],HOURS:["HOURS","(","expression",")"],MINUTES:["MINUTES","(","expression",")"],SECONDS:["SECONDS","(","expression",")"],TIMEZONE:["TIMEZONE","(","expression",")"],TZ:["TZ","(","expression",")"],NOW:["NOW","NIL"],UUID:["UUID","NIL"],STRUUID:["STRUUID","NIL"],MD5:["MD5","(","expression",")"],SHA1:["SHA1","(","expression",")"],SHA256:["SHA256","(","expression",")"],SHA384:["SHA384","(","expression",")"],SHA512:["SHA512","(","expression",")"],COALESCE:["COALESCE","expressionList"],IF:["IF","(","expression",",","expression",",","expression",")"],STRLANG:["STRLANG","(","expression",",","expression",")"],STRDT:["STRDT","(","expression",",","expression",")"],SAMETERM:["SAMETERM","(","expression",",","expression",")"],ISIRI:["ISIRI","(","expression",")"],ISURI:["ISURI","(","expression",")"],ISBLANK:["ISBLANK","(","expression",")"],ISLITERAL:["ISLITERAL","(","expression",")"],ISNUMERIC:["ISNUMERIC","(","expression",")"],REGEX:["regexExpression"],EXISTS:["existsFunc"],NOT:["notExistsFunc"]},clear:{CLEAR:["CLEAR","?SILENT_2","graphRefAll"]},collection:{"(":["(","+graphNode",")"]},collectionPath:{"(":["(","+graphNodePath",")"]},conditionalAndExpression:{"!":["valueLogical","*[&&,valueLogical]"],"+":["valueLogical","*[&&,valueLogical]"],"-":["valueLogical","*[&&,valueLogical]"],VAR1:["valueLogical","*[&&,valueLogical]"],VAR2:["valueLogical","*[&&,valueLogical]"],"(":["valueLogical","*[&&,valueLogical]"],STR:["valueLogical","*[&&,valueLogical]"],LANG:["valueLogical","*[&&,valueLogical]"],LANGMATCHES:["valueLogical","*[&&,valueLogical]"],DATATYPE:["valueLogical","*[&&,valueLogical]"],BOUND:["valueLogical","*[&&,valueLogical]"],IRI:["valueLogical","*[&&,valueLogical]"],URI:["valueLogical","*[&&,valueLogical]"],BNODE:["valueLogical","*[&&,valueLogical]"],RAND:["valueLogical","*[&&,valueLogical]"],ABS:["valueLogical","*[&&,valueLogical]"],CEIL:["valueLogical","*[&&,valueLogical]"],FLOOR:["valueLogical","*[&&,valueLogical]"],ROUND:["valueLogical","*[&&,valueLogical]"],CONCAT:["valueLogical","*[&&,valueLogical]"],STRLEN:["valueLogical","*[&&,valueLogical]"],UCASE:["valueLogical","*[&&,valueLogical]"],LCASE:["valueLogical","*[&&,valueLogical]"],ENCODE_FOR_URI:["valueLogical","*[&&,valueLogical]"],CONTAINS:["valueLogical","*[&&,valueLogical]"],STRSTARTS:["valueLogical","*[&&,valueLogical]"],STRENDS:["valueLogical","*[&&,valueLogical]"],STRBEFORE:["valueLogical","*[&&,valueLogical]"],STRAFTER:["valueLogical","*[&&,valueLogical]"],YEAR:["valueLogical","*[&&,valueLogical]"],MONTH:["valueLogical","*[&&,valueLogical]"],DAY:["valueLogical","*[&&,valueLogical]"],HOURS:["valueLogical","*[&&,valueLogical]"],MINUTES:["valueLogical","*[&&,valueLogical]"],SECONDS:["valueLogical","*[&&,valueLogical]"],TIMEZONE:["valueLogical","*[&&,valueLogical]"],TZ:["valueLogical","*[&&,valueLogical]"],NOW:["valueLogical","*[&&,valueLogical]"],UUID:["valueLogical","*[&&,valueLogical]"],STRUUID:["valueLogical","*[&&,valueLogical]"],MD5:["valueLogical","*[&&,valueLogical]"],SHA1:["valueLogical","*[&&,valueLogical]"],SHA256:["valueLogical","*[&&,valueLogical]"],SHA384:["valueLogical","*[&&,valueLogical]"],SHA512:["valueLogical","*[&&,valueLogical]"],COALESCE:["valueLogical","*[&&,valueLogical]"],IF:["valueLogical","*[&&,valueLogical]"],STRLANG:["valueLogical","*[&&,valueLogical]"],STRDT:["valueLogical","*[&&,valueLogical]"],SAMETERM:["valueLogical","*[&&,valueLogical]"],ISIRI:["valueLogical","*[&&,valueLogical]"],ISURI:["valueLogical","*[&&,valueLogical]"],ISBLANK:["valueLogical","*[&&,valueLogical]"],ISLITERAL:["valueLogical","*[&&,valueLogical]"],ISNUMERIC:["valueLogical","*[&&,valueLogical]"],TRUE:["valueLogical","*[&&,valueLogical]"],FALSE:["valueLogical","*[&&,valueLogical]"],"<<":["valueLogical","*[&&,valueLogical]"],COUNT:["valueLogical","*[&&,valueLogical]"],SUM:["valueLogical","*[&&,valueLogical]"],MIN:["valueLogical","*[&&,valueLogical]"],MAX:["valueLogical","*[&&,valueLogical]"],AVG:["valueLogical","*[&&,valueLogical]"],SAMPLE:["valueLogical","*[&&,valueLogical]"],GROUP_CONCAT:["valueLogical","*[&&,valueLogical]"],SUBSTR:["valueLogical","*[&&,valueLogical]"],REPLACE:["valueLogical","*[&&,valueLogical]"],REGEX:["valueLogical","*[&&,valueLogical]"],EXISTS:["valueLogical","*[&&,valueLogical]"],NOT:["valueLogical","*[&&,valueLogical]"],IRI_REF:["valueLogical","*[&&,valueLogical]"],STRING_LITERAL1:["valueLogical","*[&&,valueLogical]"],STRING_LITERAL2:["valueLogical","*[&&,valueLogical]"],STRING_LITERAL_LONG1:["valueLogical","*[&&,valueLogical]"],STRING_LITERAL_LONG2:["valueLogical","*[&&,valueLogical]"],INTEGER:["valueLogical","*[&&,valueLogical]"],DECIMAL:["valueLogical","*[&&,valueLogical]"],DOUBLE:["valueLogical","*[&&,valueLogical]"],INTEGER_POSITIVE:["valueLogical","*[&&,valueLogical]"],DECIMAL_POSITIVE:["valueLogical","*[&&,valueLogical]"],DOUBLE_POSITIVE:["valueLogical","*[&&,valueLogical]"],INTEGER_NEGATIVE:["valueLogical","*[&&,valueLogical]"],DECIMAL_NEGATIVE:["valueLogical","*[&&,valueLogical]"],DOUBLE_NEGATIVE:["valueLogical","*[&&,valueLogical]"],PNAME_LN:["valueLogical","*[&&,valueLogical]"],PNAME_NS:["valueLogical","*[&&,valueLogical]"]},conditionalOrExpression:{"!":["conditionalAndExpression","*[||,conditionalAndExpression]"],"+":["conditionalAndExpression","*[||,conditionalAndExpression]"],"-":["conditionalAndExpression","*[||,conditionalAndExpression]"],VAR1:["conditionalAndExpression","*[||,conditionalAndExpression]"],VAR2:["conditionalAndExpression","*[||,conditionalAndExpression]"],"(":["conditionalAndExpression","*[||,conditionalAndExpression]"],STR:["conditionalAndExpression","*[||,conditionalAndExpression]"],LANG:["conditionalAndExpression","*[||,conditionalAndExpression]"],LANGMATCHES:["conditionalAndExpression","*[||,conditionalAndExpression]"],DATATYPE:["conditionalAndExpression","*[||,conditionalAndExpression]"],BOUND:["conditionalAndExpression","*[||,conditionalAndExpression]"],IRI:["conditionalAndExpression","*[||,conditionalAndExpression]"],URI:["conditionalAndExpression","*[||,conditionalAndExpression]"],BNODE:["conditionalAndExpression","*[||,conditionalAndExpression]"],RAND:["conditionalAndExpression","*[||,conditionalAndExpression]"],ABS:["conditionalAndExpression","*[||,conditionalAndExpression]"],CEIL:["conditionalAndExpression","*[||,conditionalAndExpression]"],FLOOR:["conditionalAndExpression","*[||,conditionalAndExpression]"],ROUND:["conditionalAndExpression","*[||,conditionalAndExpression]"],CONCAT:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRLEN:["conditionalAndExpression","*[||,conditionalAndExpression]"],UCASE:["conditionalAndExpression","*[||,conditionalAndExpression]"],LCASE:["conditionalAndExpression","*[||,conditionalAndExpression]"],ENCODE_FOR_URI:["conditionalAndExpression","*[||,conditionalAndExpression]"],CONTAINS:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRSTARTS:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRENDS:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRBEFORE:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRAFTER:["conditionalAndExpression","*[||,conditionalAndExpression]"],YEAR:["conditionalAndExpression","*[||,conditionalAndExpression]"],MONTH:["conditionalAndExpression","*[||,conditionalAndExpression]"],DAY:["conditionalAndExpression","*[||,conditionalAndExpression]"],HOURS:["conditionalAndExpression","*[||,conditionalAndExpression]"],MINUTES:["conditionalAndExpression","*[||,conditionalAndExpression]"],SECONDS:["conditionalAndExpression","*[||,conditionalAndExpression]"],TIMEZONE:["conditionalAndExpression","*[||,conditionalAndExpression]"],TZ:["conditionalAndExpression","*[||,conditionalAndExpression]"],NOW:["conditionalAndExpression","*[||,conditionalAndExpression]"],UUID:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRUUID:["conditionalAndExpression","*[||,conditionalAndExpression]"],MD5:["conditionalAndExpression","*[||,conditionalAndExpression]"],SHA1:["conditionalAndExpression","*[||,conditionalAndExpression]"],SHA256:["conditionalAndExpression","*[||,conditionalAndExpression]"],SHA384:["conditionalAndExpression","*[||,conditionalAndExpression]"],SHA512:["conditionalAndExpression","*[||,conditionalAndExpression]"],COALESCE:["conditionalAndExpression","*[||,conditionalAndExpression]"],IF:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRLANG:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRDT:["conditionalAndExpression","*[||,conditionalAndExpression]"],SAMETERM:["conditionalAndExpression","*[||,conditionalAndExpression]"],ISIRI:["conditionalAndExpression","*[||,conditionalAndExpression]"],ISURI:["conditionalAndExpression","*[||,conditionalAndExpression]"],ISBLANK:["conditionalAndExpression","*[||,conditionalAndExpression]"],ISLITERAL:["conditionalAndExpression","*[||,conditionalAndExpression]"],ISNUMERIC:["conditionalAndExpression","*[||,conditionalAndExpression]"],TRUE:["conditionalAndExpression","*[||,conditionalAndExpression]"],FALSE:["conditionalAndExpression","*[||,conditionalAndExpression]"],"<<":["conditionalAndExpression","*[||,conditionalAndExpression]"],COUNT:["conditionalAndExpression","*[||,conditionalAndExpression]"],SUM:["conditionalAndExpression","*[||,conditionalAndExpression]"],MIN:["conditionalAndExpression","*[||,conditionalAndExpression]"],MAX:["conditionalAndExpression","*[||,conditionalAndExpression]"],AVG:["conditionalAndExpression","*[||,conditionalAndExpression]"],SAMPLE:["conditionalAndExpression","*[||,conditionalAndExpression]"],GROUP_CONCAT:["conditionalAndExpression","*[||,conditionalAndExpression]"],SUBSTR:["conditionalAndExpression","*[||,conditionalAndExpression]"],REPLACE:["conditionalAndExpression","*[||,conditionalAndExpression]"],REGEX:["conditionalAndExpression","*[||,conditionalAndExpression]"],EXISTS:["conditionalAndExpression","*[||,conditionalAndExpression]"],NOT:["conditionalAndExpression","*[||,conditionalAndExpression]"],IRI_REF:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRING_LITERAL1:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRING_LITERAL2:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRING_LITERAL_LONG1:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRING_LITERAL_LONG2:["conditionalAndExpression","*[||,conditionalAndExpression]"],INTEGER:["conditionalAndExpression","*[||,conditionalAndExpression]"],DECIMAL:["conditionalAndExpression","*[||,conditionalAndExpression]"],DOUBLE:["conditionalAndExpression","*[||,conditionalAndExpression]"],INTEGER_POSITIVE:["conditionalAndExpression","*[||,conditionalAndExpression]"],DECIMAL_POSITIVE:["conditionalAndExpression","*[||,conditionalAndExpression]"],DOUBLE_POSITIVE:["conditionalAndExpression","*[||,conditionalAndExpression]"],INTEGER_NEGATIVE:["conditionalAndExpression","*[||,conditionalAndExpression]"],DECIMAL_NEGATIVE:["conditionalAndExpression","*[||,conditionalAndExpression]"],DOUBLE_NEGATIVE:["conditionalAndExpression","*[||,conditionalAndExpression]"],PNAME_LN:["conditionalAndExpression","*[||,conditionalAndExpression]"],PNAME_NS:["conditionalAndExpression","*[||,conditionalAndExpression]"]},constraint:{"(":["brackettedExpression"],STR:["builtInCall"],LANG:["builtInCall"],LANGMATCHES:["builtInCall"],DATATYPE:["builtInCall"],BOUND:["builtInCall"],IRI:["builtInCall"],URI:["builtInCall"],BNODE:["builtInCall"],RAND:["builtInCall"],ABS:["builtInCall"],CEIL:["builtInCall"],FLOOR:["builtInCall"],ROUND:["builtInCall"],CONCAT:["builtInCall"],STRLEN:["builtInCall"],UCASE:["builtInCall"],LCASE:["builtInCall"],ENCODE_FOR_URI:["builtInCall"],CONTAINS:["builtInCall"],STRSTARTS:["builtInCall"],STRENDS:["builtInCall"],STRBEFORE:["builtInCall"],STRAFTER:["builtInCall"],YEAR:["builtInCall"],MONTH:["builtInCall"],DAY:["builtInCall"],HOURS:["builtInCall"],MINUTES:["builtInCall"],SECONDS:["builtInCall"],TIMEZONE:["builtInCall"],TZ:["builtInCall"],NOW:["builtInCall"],UUID:["builtInCall"],STRUUID:["builtInCall"],MD5:["builtInCall"],SHA1:["builtInCall"],SHA256:["builtInCall"],SHA384:["builtInCall"],SHA512:["builtInCall"],COALESCE:["builtInCall"],IF:["builtInCall"],STRLANG:["builtInCall"],STRDT:["builtInCall"],SAMETERM:["builtInCall"],ISIRI:["builtInCall"],ISURI:["builtInCall"],ISBLANK:["builtInCall"],ISLITERAL:["builtInCall"],ISNUMERIC:["builtInCall"],SUBSTR:["builtInCall"],REPLACE:["builtInCall"],REGEX:["builtInCall"],EXISTS:["builtInCall"],NOT:["builtInCall"],IRI_REF:["functionCall"],PNAME_LN:["functionCall"],PNAME_NS:["functionCall"]},constructQuery:{CONSTRUCT:["CONSTRUCT","or([[constructTemplate,*datasetClause,whereClause,solutionModifier],[*datasetClause,WHERE,{,?triplesTemplate,},solutionModifier]])"]},constructTemplate:{"{":["{","?constructTriples","}"]},constructTriples:{VAR1:["triplesSameSubject","?[.,?constructTriples]"],VAR2:["triplesSameSubject","?[.,?constructTriples]"],NIL:["triplesSameSubject","?[.,?constructTriples]"],"(":["triplesSameSubject","?[.,?constructTriples]"],"[":["triplesSameSubject","?[.,?constructTriples]"],IRI_REF:["triplesSameSubject","?[.,?constructTriples]"],TRUE:["triplesSameSubject","?[.,?constructTriples]"],FALSE:["triplesSameSubject","?[.,?constructTriples]"],BLANK_NODE_LABEL:["triplesSameSubject","?[.,?constructTriples]"],ANON:["triplesSameSubject","?[.,?constructTriples]"],"<<":["triplesSameSubject","?[.,?constructTriples]"],PNAME_LN:["triplesSameSubject","?[.,?constructTriples]"],PNAME_NS:["triplesSameSubject","?[.,?constructTriples]"],STRING_LITERAL1:["triplesSameSubject","?[.,?constructTriples]"],STRING_LITERAL2:["triplesSameSubject","?[.,?constructTriples]"],STRING_LITERAL_LONG1:["triplesSameSubject","?[.,?constructTriples]"],STRING_LITERAL_LONG2:["triplesSameSubject","?[.,?constructTriples]"],INTEGER:["triplesSameSubject","?[.,?constructTriples]"],DECIMAL:["triplesSameSubject","?[.,?constructTriples]"],DOUBLE:["triplesSameSubject","?[.,?constructTriples]"],INTEGER_POSITIVE:["triplesSameSubject","?[.,?constructTriples]"],DECIMAL_POSITIVE:["triplesSameSubject","?[.,?constructTriples]"],DOUBLE_POSITIVE:["triplesSameSubject","?[.,?constructTriples]"],INTEGER_NEGATIVE:["triplesSameSubject","?[.,?constructTriples]"],DECIMAL_NEGATIVE:["triplesSameSubject","?[.,?constructTriples]"],DOUBLE_NEGATIVE:["triplesSameSubject","?[.,?constructTriples]"]},copy:{COPY:["COPY","?SILENT_4","graphOrDefault","TO","graphOrDefault"]},create:{CREATE:["CREATE","?SILENT_3","graphRef"]},dataBlock:{NIL:["or([inlineDataOneVar,inlineDataFull])"],"(":["or([inlineDataOneVar,inlineDataFull])"],VAR1:["or([inlineDataOneVar,inlineDataFull])"],VAR2:["or([inlineDataOneVar,inlineDataFull])"]},dataBlockValue:{IRI_REF:["iriRef"],PNAME_LN:["iriRef"],PNAME_NS:["iriRef"],STRING_LITERAL1:["rdfLiteral"],STRING_LITERAL2:["rdfLiteral"],STRING_LITERAL_LONG1:["rdfLiteral"],STRING_LITERAL_LONG2:["rdfLiteral"],INTEGER:["numericLiteral"],DECIMAL:["numericLiteral"],DOUBLE:["numericLiteral"],INTEGER_POSITIVE:["numericLiteral"],DECIMAL_POSITIVE:["numericLiteral"],DOUBLE_POSITIVE:["numericLiteral"],INTEGER_NEGATIVE:["numericLiteral"],DECIMAL_NEGATIVE:["numericLiteral"],DOUBLE_NEGATIVE:["numericLiteral"],TRUE:["booleanLiteral"],FALSE:["booleanLiteral"],"<<":["disallowVars","embeddedTriple","allowVars"],UNDEF:["UNDEF"]},datasetClause:{FROM:["FROM","or([defaultGraphClause,namedGraphClause])"]},defaultGraphClause:{IRI_REF:["sourceSelector"],PNAME_LN:["sourceSelector"],PNAME_NS:["sourceSelector"]},delete1:{DATA:["DATA","quadDataNoBnodes"],WHERE:["WHERE","quadPatternNoBnodes"],"{":["quadPatternNoBnodes","?insertClause","*usingClause","WHERE","groupGraphPattern"]},deleteClause:{DELETE:["DELETE","quadPattern"]},describeDatasetClause:{FROM:["FROM","or([defaultGraphClause,namedGraphClause])"]},describeQuery:{DESCRIBE:["DESCRIBE","or([+or([varOrIRIref,embeddedTriple]),*])","*describeDatasetClause","?whereClause","solutionModifier"]},disallowBnodes:{"}":[],GRAPH:[],VAR1:[],VAR2:[],NIL:[],"(":[],"[":[],IRI_REF:[],TRUE:[],FALSE:[],BLANK_NODE_LABEL:[],ANON:[],"<<":[],PNAME_LN:[],PNAME_NS:[],STRING_LITERAL1:[],STRING_LITERAL2:[],STRING_LITERAL_LONG1:[],STRING_LITERAL_LONG2:[],INTEGER:[],DECIMAL:[],DOUBLE:[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[]},disallowVars:{"}":[],GRAPH:[],VAR1:[],VAR2:[],NIL:[],"(":[],"[":[],IRI_REF:[],TRUE:[],FALSE:[],BLANK_NODE_LABEL:[],ANON:[],"<<":[],PNAME_LN:[],PNAME_NS:[],STRING_LITERAL1:[],STRING_LITERAL2:[],STRING_LITERAL_LONG1:[],STRING_LITERAL_LONG2:[],INTEGER:[],DECIMAL:[],DOUBLE:[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[]},drop:{DROP:["DROP","?SILENT_2","graphRefAll"]},embeddedTriple:{"<<":["<<","varOrTerm","verb","varOrTerm",">>"]},existsFunc:{EXISTS:["EXISTS","groupGraphPattern"]},expression:{"!":["conditionalOrExpression"],"+":["conditionalOrExpression"],"-":["conditionalOrExpression"],VAR1:["conditionalOrExpression"],VAR2:["conditionalOrExpression"],"(":["conditionalOrExpression"],STR:["conditionalOrExpression"],LANG:["conditionalOrExpression"],LANGMATCHES:["conditionalOrExpression"],DATATYPE:["conditionalOrExpression"],BOUND:["conditionalOrExpression"],IRI:["conditionalOrExpression"],URI:["conditionalOrExpression"],BNODE:["conditionalOrExpression"],RAND:["conditionalOrExpression"],ABS:["conditionalOrExpression"],CEIL:["conditionalOrExpression"],FLOOR:["conditionalOrExpression"],ROUND:["conditionalOrExpression"],CONCAT:["conditionalOrExpression"],STRLEN:["conditionalOrExpression"],UCASE:["conditionalOrExpression"],LCASE:["conditionalOrExpression"],ENCODE_FOR_URI:["conditionalOrExpression"],CONTAINS:["conditionalOrExpression"],STRSTARTS:["conditionalOrExpression"],STRENDS:["conditionalOrExpression"],STRBEFORE:["conditionalOrExpression"],STRAFTER:["conditionalOrExpression"],YEAR:["conditionalOrExpression"],MONTH:["conditionalOrExpression"],DAY:["conditionalOrExpression"],HOURS:["conditionalOrExpression"],MINUTES:["conditionalOrExpression"],SECONDS:["conditionalOrExpression"],TIMEZONE:["conditionalOrExpression"],TZ:["conditionalOrExpression"],NOW:["conditionalOrExpression"],UUID:["conditionalOrExpression"],STRUUID:["conditionalOrExpression"],MD5:["conditionalOrExpression"],SHA1:["conditionalOrExpression"],SHA256:["conditionalOrExpression"],SHA384:["conditionalOrExpression"],SHA512:["conditionalOrExpression"],COALESCE:["conditionalOrExpression"],IF:["conditionalOrExpression"],STRLANG:["conditionalOrExpression"],STRDT:["conditionalOrExpression"],SAMETERM:["conditionalOrExpression"],ISIRI:["conditionalOrExpression"],ISURI:["conditionalOrExpression"],ISBLANK:["conditionalOrExpression"],ISLITERAL:["conditionalOrExpression"],ISNUMERIC:["conditionalOrExpression"],TRUE:["conditionalOrExpression"],FALSE:["conditionalOrExpression"],"<<":["conditionalOrExpression"],COUNT:["conditionalOrExpression"],SUM:["conditionalOrExpression"],MIN:["conditionalOrExpression"],MAX:["conditionalOrExpression"],AVG:["conditionalOrExpression"],SAMPLE:["conditionalOrExpression"],GROUP_CONCAT:["conditionalOrExpression"],SUBSTR:["conditionalOrExpression"],REPLACE:["conditionalOrExpression"],REGEX:["conditionalOrExpression"],EXISTS:["conditionalOrExpression"],NOT:["conditionalOrExpression"],IRI_REF:["conditionalOrExpression"],STRING_LITERAL1:["conditionalOrExpression"],STRING_LITERAL2:["conditionalOrExpression"],STRING_LITERAL_LONG1:["conditionalOrExpression"],STRING_LITERAL_LONG2:["conditionalOrExpression"],INTEGER:["conditionalOrExpression"],DECIMAL:["conditionalOrExpression"],DOUBLE:["conditionalOrExpression"],INTEGER_POSITIVE:["conditionalOrExpression"],DECIMAL_POSITIVE:["conditionalOrExpression"],DOUBLE_POSITIVE:["conditionalOrExpression"],INTEGER_NEGATIVE:["conditionalOrExpression"],DECIMAL_NEGATIVE:["conditionalOrExpression"],DOUBLE_NEGATIVE:["conditionalOrExpression"],PNAME_LN:["conditionalOrExpression"],PNAME_NS:["conditionalOrExpression"]},expressionList:{NIL:["NIL"],"(":["(","expression","*[,,expression]",")"]},filter:{FILTER:["FILTER","constraint"]},functionCall:{IRI_REF:["iriRef","argList"],PNAME_LN:["iriRef","argList"],PNAME_NS:["iriRef","argList"]},graphGraphPattern:{GRAPH:["GRAPH","varOrIRIref","groupGraphPattern"]},graphNode:{VAR1:["varOrTerm"],VAR2:["varOrTerm"],NIL:["varOrTerm"],IRI_REF:["varOrTerm"],TRUE:["varOrTerm"],FALSE:["varOrTerm"],BLANK_NODE_LABEL:["varOrTerm"],ANON:["varOrTerm"],"<<":["varOrTerm"],PNAME_LN:["varOrTerm"],PNAME_NS:["varOrTerm"],STRING_LITERAL1:["varOrTerm"],STRING_LITERAL2:["varOrTerm"],STRING_LITERAL_LONG1:["varOrTerm"],STRING_LITERAL_LONG2:["varOrTerm"],INTEGER:["varOrTerm"],DECIMAL:["varOrTerm"],DOUBLE:["varOrTerm"],INTEGER_POSITIVE:["varOrTerm"],DECIMAL_POSITIVE:["varOrTerm"],DOUBLE_POSITIVE:["varOrTerm"],INTEGER_NEGATIVE:["varOrTerm"],DECIMAL_NEGATIVE:["varOrTerm"],DOUBLE_NEGATIVE:["varOrTerm"],"(":["triplesNode"],"[":["triplesNode"]},graphNodePath:{VAR1:["varOrTerm"],VAR2:["varOrTerm"],NIL:["varOrTerm"],IRI_REF:["varOrTerm"],TRUE:["varOrTerm"],FALSE:["varOrTerm"],BLANK_NODE_LABEL:["varOrTerm"],ANON:["varOrTerm"],"<<":["varOrTerm"],PNAME_LN:["varOrTerm"],PNAME_NS:["varOrTerm"],STRING_LITERAL1:["varOrTerm"],STRING_LITERAL2:["varOrTerm"],STRING_LITERAL_LONG1:["varOrTerm"],STRING_LITERAL_LONG2:["varOrTerm"],INTEGER:["varOrTerm"],DECIMAL:["varOrTerm"],DOUBLE:["varOrTerm"],INTEGER_POSITIVE:["varOrTerm"],DECIMAL_POSITIVE:["varOrTerm"],DOUBLE_POSITIVE:["varOrTerm"],INTEGER_NEGATIVE:["varOrTerm"],DECIMAL_NEGATIVE:["varOrTerm"],DOUBLE_NEGATIVE:["varOrTerm"],"(":["triplesNodePath"],"[":["triplesNodePath"]},graphOrDefault:{DEFAULT:["DEFAULT"],IRI_REF:["?GRAPH","iriRef"],PNAME_LN:["?GRAPH","iriRef"],PNAME_NS:["?GRAPH","iriRef"],GRAPH:["?GRAPH","iriRef"]},graphPatternNotTriples:{"{":["groupOrUnionGraphPattern"],OPTIONAL:["optionalGraphPattern"],MINUS:["minusGraphPattern"],GRAPH:["graphGraphPattern"],SERVICE:["serviceGraphPattern"],FILTER:["filter"],BIND:["bind"],VALUES:["inlineData"]},graphRef:{GRAPH:["GRAPH","iriRef"]},graphRefAll:{GRAPH:["graphRef"],DEFAULT:["DEFAULT"],NAMED:["NAMED"],ALL:["ALL"]},graphTerm:{IRI_REF:["iriRef"],PNAME_LN:["iriRef"],PNAME_NS:["iriRef"],STRING_LITERAL1:["rdfLiteral"],STRING_LITERAL2:["rdfLiteral"],STRING_LITERAL_LONG1:["rdfLiteral"],STRING_LITERAL_LONG2:["rdfLiteral"],INTEGER:["numericLiteral"],DECIMAL:["numericLiteral"],DOUBLE:["numericLiteral"],INTEGER_POSITIVE:["numericLiteral"],DECIMAL_POSITIVE:["numericLiteral"],DOUBLE_POSITIVE:["numericLiteral"],INTEGER_NEGATIVE:["numericLiteral"],DECIMAL_NEGATIVE:["numericLiteral"],DOUBLE_NEGATIVE:["numericLiteral"],TRUE:["booleanLiteral"],FALSE:["booleanLiteral"],BLANK_NODE_LABEL:["blankNode"],ANON:["blankNode"],"<<":["embeddedTriple"],NIL:["NIL"]},groupClause:{GROUP:["GROUP","BY","+groupCondition"]},groupCondition:{STR:["builtInCall"],LANG:["builtInCall"],LANGMATCHES:["builtInCall"],DATATYPE:["builtInCall"],BOUND:["builtInCall"],IRI:["builtInCall"],URI:["builtInCall"],BNODE:["builtInCall"],RAND:["builtInCall"],ABS:["builtInCall"],CEIL:["builtInCall"],FLOOR:["builtInCall"],ROUND:["builtInCall"],CONCAT:["builtInCall"],STRLEN:["builtInCall"],UCASE:["builtInCall"],LCASE:["builtInCall"],ENCODE_FOR_URI:["builtInCall"],CONTAINS:["builtInCall"],STRSTARTS:["builtInCall"],STRENDS:["builtInCall"],STRBEFORE:["builtInCall"],STRAFTER:["builtInCall"],YEAR:["builtInCall"],MONTH:["builtInCall"],DAY:["builtInCall"],HOURS:["builtInCall"],MINUTES:["builtInCall"],SECONDS:["builtInCall"],TIMEZONE:["builtInCall"],TZ:["builtInCall"],NOW:["builtInCall"],UUID:["builtInCall"],STRUUID:["builtInCall"],MD5:["builtInCall"],SHA1:["builtInCall"],SHA256:["builtInCall"],SHA384:["builtInCall"],SHA512:["builtInCall"],COALESCE:["builtInCall"],IF:["builtInCall"],STRLANG:["builtInCall"],STRDT:["builtInCall"],SAMETERM:["builtInCall"],ISIRI:["builtInCall"],ISURI:["builtInCall"],ISBLANK:["builtInCall"],ISLITERAL:["builtInCall"],ISNUMERIC:["builtInCall"],SUBSTR:["builtInCall"],REPLACE:["builtInCall"],REGEX:["builtInCall"],EXISTS:["builtInCall"],NOT:["builtInCall"],IRI_REF:["functionCall"],PNAME_LN:["functionCall"],PNAME_NS:["functionCall"],"(":["(","expression","?[AS,var]",")"],VAR1:["var"],VAR2:["var"]},groupGraphPattern:{"{":["{","or([subSelect,groupGraphPatternSub])","}"]},groupGraphPatternSub:{"{":["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],OPTIONAL:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],MINUS:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],GRAPH:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],SERVICE:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],FILTER:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],BIND:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],VALUES:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],VAR1:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],VAR2:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],NIL:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],"(":["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],"[":["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],IRI_REF:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],TRUE:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],FALSE:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],BLANK_NODE_LABEL:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],ANON:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],"<<":["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],PNAME_LN:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],PNAME_NS:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],STRING_LITERAL1:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],STRING_LITERAL2:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],STRING_LITERAL_LONG1:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],STRING_LITERAL_LONG2:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],INTEGER:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],DECIMAL:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],DOUBLE:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],INTEGER_POSITIVE:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],DECIMAL_POSITIVE:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],DOUBLE_POSITIVE:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],INTEGER_NEGATIVE:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],DECIMAL_NEGATIVE:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],DOUBLE_NEGATIVE:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],"}":["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"]},groupOrUnionGraphPattern:{"{":["groupGraphPattern","*[UNION,groupGraphPattern]"]},havingClause:{HAVING:["HAVING","+havingCondition"]},havingCondition:{"(":["constraint"],STR:["constraint"],LANG:["constraint"],LANGMATCHES:["constraint"],DATATYPE:["constraint"],BOUND:["constraint"],IRI:["constraint"],URI:["constraint"],BNODE:["constraint"],RAND:["constraint"],ABS:["constraint"],CEIL:["constraint"],FLOOR:["constraint"],ROUND:["constraint"],CONCAT:["constraint"],STRLEN:["constraint"],UCASE:["constraint"],LCASE:["constraint"],ENCODE_FOR_URI:["constraint"],CONTAINS:["constraint"],STRSTARTS:["constraint"],STRENDS:["constraint"],STRBEFORE:["constraint"],STRAFTER:["constraint"],YEAR:["constraint"],MONTH:["constraint"],DAY:["constraint"],HOURS:["constraint"],MINUTES:["constraint"],SECONDS:["constraint"],TIMEZONE:["constraint"],TZ:["constraint"],NOW:["constraint"],UUID:["constraint"],STRUUID:["constraint"],MD5:["constraint"],SHA1:["constraint"],SHA256:["constraint"],SHA384:["constraint"],SHA512:["constraint"],COALESCE:["constraint"],IF:["constraint"],STRLANG:["constraint"],STRDT:["constraint"],SAMETERM:["constraint"],ISIRI:["constraint"],ISURI:["constraint"],ISBLANK:["constraint"],ISLITERAL:["constraint"],ISNUMERIC:["constraint"],SUBSTR:["constraint"],REPLACE:["constraint"],REGEX:["constraint"],EXISTS:["constraint"],NOT:["constraint"],IRI_REF:["constraint"],PNAME_LN:["constraint"],PNAME_NS:["constraint"]},inlineData:{VALUES:["VALUES","dataBlock"]},inlineDataFull:{NIL:["or([NIL,[(,*var,)]])","{","*or([[(,*dataBlockValue,)],NIL])","}"],"(":["or([NIL,[(,*var,)]])","{","*or([[(,*dataBlockValue,)],NIL])","}"]},inlineDataOneVar:{VAR1:["var","{","*dataBlockValue","}"],VAR2:["var","{","*dataBlockValue","}"]},insert1:{DATA:["DATA","quadData"],"{":["quadPattern","*usingClause","WHERE","groupGraphPattern"]},insertClause:{INSERT:["INSERT","quadPattern"]},integer:{INTEGER:["INTEGER"]},iriRef:{IRI_REF:["IRI_REF"],PNAME_LN:["prefixedName"],PNAME_NS:["prefixedName"]},iriRefOrFunction:{IRI_REF:["iriRef","?argList"],PNAME_LN:["iriRef","?argList"],PNAME_NS:["iriRef","?argList"]},limitClause:{LIMIT:["LIMIT","INTEGER"]},limitOffsetClauses:{LIMIT:["limitClause","?offsetClause"],OFFSET:["offsetClause","?limitClause"]},load:{LOAD:["LOAD","?SILENT_1","iriRef","?[INTO,graphRef]"]},minusGraphPattern:{MINUS:["MINUS","groupGraphPattern"]},modify:{WITH:["WITH","iriRef","or([[deleteClause,?insertClause],insertClause])","*usingClause","WHERE","groupGraphPattern"]},move:{MOVE:["MOVE","?SILENT_4","graphOrDefault","TO","graphOrDefault"]},multiplicativeExpression:{"!":["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],"+":["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],"-":["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],VAR1:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],VAR2:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],"(":["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STR:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],LANG:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],LANGMATCHES:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],DATATYPE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],BOUND:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],IRI:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],URI:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],BNODE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],RAND:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],ABS:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],CEIL:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],FLOOR:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],ROUND:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],CONCAT:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRLEN:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],UCASE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],LCASE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],ENCODE_FOR_URI:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],CONTAINS:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRSTARTS:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRENDS:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRBEFORE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRAFTER:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],YEAR:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],MONTH:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],DAY:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],HOURS:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],MINUTES:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],SECONDS:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],TIMEZONE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],TZ:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],NOW:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],UUID:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRUUID:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],MD5:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],SHA1:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],SHA256:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],SHA384:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],SHA512:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],COALESCE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],IF:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRLANG:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRDT:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],SAMETERM:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],ISIRI:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],ISURI:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],ISBLANK:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],ISLITERAL:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],ISNUMERIC:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],TRUE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],FALSE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],"<<":["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],COUNT:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],SUM:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],MIN:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],MAX:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],AVG:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],SAMPLE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],GROUP_CONCAT:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],SUBSTR:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],REPLACE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],REGEX:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],EXISTS:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],NOT:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],IRI_REF:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRING_LITERAL1:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRING_LITERAL2:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRING_LITERAL_LONG1:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRING_LITERAL_LONG2:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],INTEGER:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],DECIMAL:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],DOUBLE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],INTEGER_POSITIVE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],DECIMAL_POSITIVE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],DOUBLE_POSITIVE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],INTEGER_NEGATIVE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],DECIMAL_NEGATIVE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],DOUBLE_NEGATIVE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],PNAME_LN:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],PNAME_NS:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"]},namedGraphClause:{NAMED:["NAMED","sourceSelector"]},notExistsFunc:{NOT:["NOT","EXISTS","groupGraphPattern"]},numericExpression:{"!":["additiveExpression"],"+":["additiveExpression"],"-":["additiveExpression"],VAR1:["additiveExpression"],VAR2:["additiveExpression"],"(":["additiveExpression"],STR:["additiveExpression"],LANG:["additiveExpression"],LANGMATCHES:["additiveExpression"],DATATYPE:["additiveExpression"],BOUND:["additiveExpression"],IRI:["additiveExpression"],URI:["additiveExpression"],BNODE:["additiveExpression"],RAND:["additiveExpression"],ABS:["additiveExpression"],CEIL:["additiveExpression"],FLOOR:["additiveExpression"],ROUND:["additiveExpression"],CONCAT:["additiveExpression"],STRLEN:["additiveExpression"],UCASE:["additiveExpression"],LCASE:["additiveExpression"],ENCODE_FOR_URI:["additiveExpression"],CONTAINS:["additiveExpression"],STRSTARTS:["additiveExpression"],STRENDS:["additiveExpression"],STRBEFORE:["additiveExpression"],STRAFTER:["additiveExpression"],YEAR:["additiveExpression"],MONTH:["additiveExpression"],DAY:["additiveExpression"],HOURS:["additiveExpression"],MINUTES:["additiveExpression"],SECONDS:["additiveExpression"],TIMEZONE:["additiveExpression"],TZ:["additiveExpression"],NOW:["additiveExpression"],UUID:["additiveExpression"],STRUUID:["additiveExpression"],MD5:["additiveExpression"],SHA1:["additiveExpression"],SHA256:["additiveExpression"],SHA384:["additiveExpression"],SHA512:["additiveExpression"],COALESCE:["additiveExpression"],IF:["additiveExpression"],STRLANG:["additiveExpression"],STRDT:["additiveExpression"],SAMETERM:["additiveExpression"],ISIRI:["additiveExpression"],ISURI:["additiveExpression"],ISBLANK:["additiveExpression"],ISLITERAL:["additiveExpression"],ISNUMERIC:["additiveExpression"],TRUE:["additiveExpression"],FALSE:["additiveExpression"],"<<":["additiveExpression"],COUNT:["additiveExpression"],SUM:["additiveExpression"],MIN:["additiveExpression"],MAX:["additiveExpression"],AVG:["additiveExpression"],SAMPLE:["additiveExpression"],GROUP_CONCAT:["additiveExpression"],SUBSTR:["additiveExpression"],REPLACE:["additiveExpression"],REGEX:["additiveExpression"],EXISTS:["additiveExpression"],NOT:["additiveExpression"],IRI_REF:["additiveExpression"],STRING_LITERAL1:["additiveExpression"],STRING_LITERAL2:["additiveExpression"],STRING_LITERAL_LONG1:["additiveExpression"],STRING_LITERAL_LONG2:["additiveExpression"],INTEGER:["additiveExpression"],DECIMAL:["additiveExpression"],DOUBLE:["additiveExpression"],INTEGER_POSITIVE:["additiveExpression"],DECIMAL_POSITIVE:["additiveExpression"],DOUBLE_POSITIVE:["additiveExpression"],INTEGER_NEGATIVE:["additiveExpression"],DECIMAL_NEGATIVE:["additiveExpression"],DOUBLE_NEGATIVE:["additiveExpression"],PNAME_LN:["additiveExpression"],PNAME_NS:["additiveExpression"]},numericLiteral:{INTEGER:["numericLiteralUnsigned"],DECIMAL:["numericLiteralUnsigned"],DOUBLE:["numericLiteralUnsigned"],INTEGER_POSITIVE:["numericLiteralPositive"],DECIMAL_POSITIVE:["numericLiteralPositive"],DOUBLE_POSITIVE:["numericLiteralPositive"],INTEGER_NEGATIVE:["numericLiteralNegative"],DECIMAL_NEGATIVE:["numericLiteralNegative"],DOUBLE_NEGATIVE:["numericLiteralNegative"]},numericLiteralNegative:{INTEGER_NEGATIVE:["INTEGER_NEGATIVE"],DECIMAL_NEGATIVE:["DECIMAL_NEGATIVE"],DOUBLE_NEGATIVE:["DOUBLE_NEGATIVE"]},numericLiteralPositive:{INTEGER_POSITIVE:["INTEGER_POSITIVE"],DECIMAL_POSITIVE:["DECIMAL_POSITIVE"],DOUBLE_POSITIVE:["DOUBLE_POSITIVE"]},numericLiteralUnsigned:{INTEGER:["INTEGER"],DECIMAL:["DECIMAL"],DOUBLE:["DOUBLE"]},object:{"(":["graphNode"],"[":["graphNode"],VAR1:["graphNode"],VAR2:["graphNode"],NIL:["graphNode"],IRI_REF:["graphNode"],TRUE:["graphNode"],FALSE:["graphNode"],BLANK_NODE_LABEL:["graphNode"],ANON:["graphNode"],"<<":["graphNode"],PNAME_LN:["graphNode"],PNAME_NS:["graphNode"],STRING_LITERAL1:["graphNode"],STRING_LITERAL2:["graphNode"],STRING_LITERAL_LONG1:["graphNode"],STRING_LITERAL_LONG2:["graphNode"],INTEGER:["graphNode"],DECIMAL:["graphNode"],DOUBLE:["graphNode"],INTEGER_POSITIVE:["graphNode"],DECIMAL_POSITIVE:["graphNode"],DOUBLE_POSITIVE:["graphNode"],INTEGER_NEGATIVE:["graphNode"],DECIMAL_NEGATIVE:["graphNode"],DOUBLE_NEGATIVE:["graphNode"]},objectList:{"(":["object","*[,,object]"],"[":["object","*[,,object]"],VAR1:["object","*[,,object]"],VAR2:["object","*[,,object]"],NIL:["object","*[,,object]"],IRI_REF:["object","*[,,object]"],TRUE:["object","*[,,object]"],FALSE:["object","*[,,object]"],BLANK_NODE_LABEL:["object","*[,,object]"],ANON:["object","*[,,object]"],"<<":["object","*[,,object]"],PNAME_LN:["object","*[,,object]"],PNAME_NS:["object","*[,,object]"],STRING_LITERAL1:["object","*[,,object]"],STRING_LITERAL2:["object","*[,,object]"],STRING_LITERAL_LONG1:["object","*[,,object]"],STRING_LITERAL_LONG2:["object","*[,,object]"],INTEGER:["object","*[,,object]"],DECIMAL:["object","*[,,object]"],DOUBLE:["object","*[,,object]"],INTEGER_POSITIVE:["object","*[,,object]"],DECIMAL_POSITIVE:["object","*[,,object]"],DOUBLE_POSITIVE:["object","*[,,object]"],INTEGER_NEGATIVE:["object","*[,,object]"],DECIMAL_NEGATIVE:["object","*[,,object]"],DOUBLE_NEGATIVE:["object","*[,,object]"]},objectListPath:{"(":["objectPath","*[,,objectPath]"],"[":["objectPath","*[,,objectPath]"],VAR1:["objectPath","*[,,objectPath]"],VAR2:["objectPath","*[,,objectPath]"],NIL:["objectPath","*[,,objectPath]"],IRI_REF:["objectPath","*[,,objectPath]"],TRUE:["objectPath","*[,,objectPath]"],FALSE:["objectPath","*[,,objectPath]"],BLANK_NODE_LABEL:["objectPath","*[,,objectPath]"],ANON:["objectPath","*[,,objectPath]"],"<<":["objectPath","*[,,objectPath]"],PNAME_LN:["objectPath","*[,,objectPath]"],PNAME_NS:["objectPath","*[,,objectPath]"],STRING_LITERAL1:["objectPath","*[,,objectPath]"],STRING_LITERAL2:["objectPath","*[,,objectPath]"],STRING_LITERAL_LONG1:["objectPath","*[,,objectPath]"],STRING_LITERAL_LONG2:["objectPath","*[,,objectPath]"],INTEGER:["objectPath","*[,,objectPath]"],DECIMAL:["objectPath","*[,,objectPath]"],DOUBLE:["objectPath","*[,,objectPath]"],INTEGER_POSITIVE:["objectPath","*[,,objectPath]"],DECIMAL_POSITIVE:["objectPath","*[,,objectPath]"],DOUBLE_POSITIVE:["objectPath","*[,,objectPath]"],INTEGER_NEGATIVE:["objectPath","*[,,objectPath]"],DECIMAL_NEGATIVE:["objectPath","*[,,objectPath]"],DOUBLE_NEGATIVE:["objectPath","*[,,objectPath]"]},objectPath:{"(":["graphNodePath"],"[":["graphNodePath"],VAR1:["graphNodePath"],VAR2:["graphNodePath"],NIL:["graphNodePath"],IRI_REF:["graphNodePath"],TRUE:["graphNodePath"],FALSE:["graphNodePath"],BLANK_NODE_LABEL:["graphNodePath"],ANON:["graphNodePath"],"<<":["graphNodePath"],PNAME_LN:["graphNodePath"],PNAME_NS:["graphNodePath"],STRING_LITERAL1:["graphNodePath"],STRING_LITERAL2:["graphNodePath"],STRING_LITERAL_LONG1:["graphNodePath"],STRING_LITERAL_LONG2:["graphNodePath"],INTEGER:["graphNodePath"],DECIMAL:["graphNodePath"],DOUBLE:["graphNodePath"],INTEGER_POSITIVE:["graphNodePath"],DECIMAL_POSITIVE:["graphNodePath"],DOUBLE_POSITIVE:["graphNodePath"],INTEGER_NEGATIVE:["graphNodePath"],DECIMAL_NEGATIVE:["graphNodePath"],DOUBLE_NEGATIVE:["graphNodePath"]},offsetClause:{OFFSET:["OFFSET","INTEGER"]},optionalGraphPattern:{OPTIONAL:["OPTIONAL","groupGraphPattern"]},"or([*,expression])":{"*":["*"],"!":["expression"],"+":["expression"],"-":["expression"],VAR1:["expression"],VAR2:["expression"],"(":["expression"],STR:["expression"],LANG:["expression"],LANGMATCHES:["expression"],DATATYPE:["expression"],BOUND:["expression"],IRI:["expression"],URI:["expression"],BNODE:["expression"],RAND:["expression"],ABS:["expression"],CEIL:["expression"],FLOOR:["expression"],ROUND:["expression"],CONCAT:["expression"],STRLEN:["expression"],UCASE:["expression"],LCASE:["expression"],ENCODE_FOR_URI:["expression"],CONTAINS:["expression"],STRSTARTS:["expression"],STRENDS:["expression"],STRBEFORE:["expression"],STRAFTER:["expression"],YEAR:["expression"],MONTH:["expression"],DAY:["expression"],HOURS:["expression"],MINUTES:["expression"],SECONDS:["expression"],TIMEZONE:["expression"],TZ:["expression"],NOW:["expression"],UUID:["expression"],STRUUID:["expression"],MD5:["expression"],SHA1:["expression"],SHA256:["expression"],SHA384:["expression"],SHA512:["expression"],COALESCE:["expression"],IF:["expression"],STRLANG:["expression"],STRDT:["expression"],SAMETERM:["expression"],ISIRI:["expression"],ISURI:["expression"],ISBLANK:["expression"],ISLITERAL:["expression"],ISNUMERIC:["expression"],TRUE:["expression"],FALSE:["expression"],"<<":["expression"],COUNT:["expression"],SUM:["expression"],MIN:["expression"],MAX:["expression"],AVG:["expression"],SAMPLE:["expression"],GROUP_CONCAT:["expression"],SUBSTR:["expression"],REPLACE:["expression"],REGEX:["expression"],EXISTS:["expression"],NOT:["expression"],IRI_REF:["expression"],STRING_LITERAL1:["expression"],STRING_LITERAL2:["expression"],STRING_LITERAL_LONG1:["expression"],STRING_LITERAL_LONG2:["expression"],INTEGER:["expression"],DECIMAL:["expression"],DOUBLE:["expression"],INTEGER_POSITIVE:["expression"],DECIMAL_POSITIVE:["expression"],DOUBLE_POSITIVE:["expression"],INTEGER_NEGATIVE:["expression"],DECIMAL_NEGATIVE:["expression"],DOUBLE_NEGATIVE:["expression"],PNAME_LN:["expression"],PNAME_NS:["expression"]},"or([+or([var,[(,expression,AS,var,)]]),*])":{"(":["+or([var,[(,expression,AS,var,)]])"],VAR1:["+or([var,[(,expression,AS,var,)]])"],VAR2:["+or([var,[(,expression,AS,var,)]])"],"*":["*"]},"or([+or([varOrIRIref,embeddedTriple]),*])":{"<<":["+or([varOrIRIref,embeddedTriple])"],VAR1:["+or([varOrIRIref,embeddedTriple])"],VAR2:["+or([varOrIRIref,embeddedTriple])"],IRI_REF:["+or([varOrIRIref,embeddedTriple])"],PNAME_LN:["+or([varOrIRIref,embeddedTriple])"],PNAME_NS:["+or([varOrIRIref,embeddedTriple])"],"*":["*"]},"or([ASC,DESC])":{ASC:["ASC"],DESC:["DESC"]},"or([DISTINCT,REDUCED])":{DISTINCT:["DISTINCT"],REDUCED:["REDUCED"]},"or([LANGTAG,[^^,iriRef]])":{LANGTAG:["LANGTAG"],"^^":["[^^,iriRef]"]},"or([NIL,[(,*var,)]])":{NIL:["NIL"],"(":["[(,*var,)]"]},"or([[(,*dataBlockValue,)],NIL])":{"(":["[(,*dataBlockValue,)]"],NIL:["NIL"]},"or([[(,expression,)],NIL])":{"(":["[(,expression,)]"],NIL:["NIL"]},"or([[*,unaryExpression],[/,unaryExpression]])":{"*":["[*,unaryExpression]"],"/":["[/,unaryExpression]"]},"or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])":{"+":["[+,multiplicativeExpression]"],"-":["[-,multiplicativeExpression]"],INTEGER_POSITIVE:["[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]"],DECIMAL_POSITIVE:["[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]"],DOUBLE_POSITIVE:["[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]"],INTEGER_NEGATIVE:["[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]"],DECIMAL_NEGATIVE:["[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]"],DOUBLE_NEGATIVE:["[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]"]},"or([[,,or([},[integer,}]])],}])":{",":["[,,or([},[integer,}]])]"],"}":["}"]},"or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])":{"=":["[=,numericExpression]"],"!=":["[!=,numericExpression]"],"<":["[<,numericExpression]"],">":["[>,numericExpression]"],"<=":["[<=,numericExpression]"],">=":["[>=,numericExpression]"],IN:["[IN,expressionList]"],NOT:["[NOT,IN,expressionList]"]},"or([[constructTemplate,*datasetClause,whereClause,solutionModifier],[*datasetClause,WHERE,{,?triplesTemplate,},solutionModifier]])":{"{":["[constructTemplate,*datasetClause,whereClause,solutionModifier]"],WHERE:["[*datasetClause,WHERE,{,?triplesTemplate,},solutionModifier]"],FROM:["[*datasetClause,WHERE,{,?triplesTemplate,},solutionModifier]"]},"or([[deleteClause,?insertClause],insertClause])":{DELETE:["[deleteClause,?insertClause]"],INSERT:["insertClause"]},"or([[integer,or([[,,or([},[integer,}]])],}])],[,,integer,}]])":{INTEGER:["[integer,or([[,,or([},[integer,}]])],}])]"],",":["[,,integer,}]"]},"or([baseDecl,prefixDecl])":{BASE:["baseDecl"],PREFIX:["prefixDecl"]},"or([defaultGraphClause,namedGraphClause])":{IRI_REF:["defaultGraphClause"],PNAME_LN:["defaultGraphClause"],PNAME_NS:["defaultGraphClause"],NAMED:["namedGraphClause"]},"or([inlineDataOneVar,inlineDataFull])":{VAR1:["inlineDataOneVar"],VAR2:["inlineDataOneVar"],NIL:["inlineDataFull"],"(":["inlineDataFull"]},"or([iriRef,[NAMED,iriRef]])":{IRI_REF:["iriRef"],PNAME_LN:["iriRef"],PNAME_NS:["iriRef"],NAMED:["[NAMED,iriRef]"]},"or([iriRef,a])":{IRI_REF:["iriRef"],PNAME_LN:["iriRef"],PNAME_NS:["iriRef"],a:["a"]},"or([numericLiteralPositive,numericLiteralNegative])":{INTEGER_POSITIVE:["numericLiteralPositive"],DECIMAL_POSITIVE:["numericLiteralPositive"],DOUBLE_POSITIVE:["numericLiteralPositive"],INTEGER_NEGATIVE:["numericLiteralNegative"],DECIMAL_NEGATIVE:["numericLiteralNegative"],DOUBLE_NEGATIVE:["numericLiteralNegative"]},"or([queryAll,updateAll])":{CONSTRUCT:["queryAll"],DESCRIBE:["queryAll"],ASK:["queryAll"],SELECT:["queryAll"],INSERT:["updateAll"],DELETE:["updateAll"],LOAD:["updateAll"],CLEAR:["updateAll"],DROP:["updateAll"],ADD:["updateAll"],MOVE:["updateAll"],COPY:["updateAll"],CREATE:["updateAll"],WITH:["updateAll"],$:["updateAll"]},"or([selectQuery,constructQuery,describeQuery,askQuery])":{SELECT:["selectQuery"],CONSTRUCT:["constructQuery"],DESCRIBE:["describeQuery"],ASK:["askQuery"]},"or([subSelect,groupGraphPatternSub])":{SELECT:["subSelect"],"{":["groupGraphPatternSub"],OPTIONAL:["groupGraphPatternSub"],MINUS:["groupGraphPatternSub"],GRAPH:["groupGraphPatternSub"],SERVICE:["groupGraphPatternSub"],FILTER:["groupGraphPatternSub"],BIND:["groupGraphPatternSub"],VALUES:["groupGraphPatternSub"],VAR1:["groupGraphPatternSub"],VAR2:["groupGraphPatternSub"],NIL:["groupGraphPatternSub"],"(":["groupGraphPatternSub"],"[":["groupGraphPatternSub"],IRI_REF:["groupGraphPatternSub"],TRUE:["groupGraphPatternSub"],FALSE:["groupGraphPatternSub"],BLANK_NODE_LABEL:["groupGraphPatternSub"],ANON:["groupGraphPatternSub"],"<<":["groupGraphPatternSub"],PNAME_LN:["groupGraphPatternSub"],PNAME_NS:["groupGraphPatternSub"],STRING_LITERAL1:["groupGraphPatternSub"],STRING_LITERAL2:["groupGraphPatternSub"],STRING_LITERAL_LONG1:["groupGraphPatternSub"],STRING_LITERAL_LONG2:["groupGraphPatternSub"],INTEGER:["groupGraphPatternSub"],DECIMAL:["groupGraphPatternSub"],DOUBLE:["groupGraphPatternSub"],INTEGER_POSITIVE:["groupGraphPatternSub"],DECIMAL_POSITIVE:["groupGraphPatternSub"],DOUBLE_POSITIVE:["groupGraphPatternSub"],INTEGER_NEGATIVE:["groupGraphPatternSub"],DECIMAL_NEGATIVE:["groupGraphPatternSub"],DOUBLE_NEGATIVE:["groupGraphPatternSub"],"}":["groupGraphPatternSub"]},"or([var,[(,expression,AS,var,)]])":{VAR1:["var"],VAR2:["var"],"(":["[(,expression,AS,var,)]"]},"or([varOrIRIref,embeddedTriple])":{VAR1:["varOrIRIref"],VAR2:["varOrIRIref"],IRI_REF:["varOrIRIref"],PNAME_LN:["varOrIRIref"],PNAME_NS:["varOrIRIref"],"<<":["embeddedTriple"]},"or([verbPath,verbSimple])":{"^":["verbPath"],a:["verbPath"],"!":["verbPath"],"(":["verbPath"],IRI_REF:["verbPath"],PNAME_LN:["verbPath"],PNAME_NS:["verbPath"],VAR1:["verbSimple"],VAR2:["verbSimple"]},"or([},[integer,}]])":{"}":["}"],INTEGER:["[integer,}]"]},orderClause:{ORDER:["ORDER","BY","+orderCondition"]},orderCondition:{ASC:["or([ASC,DESC])","brackettedExpression"],DESC:["or([ASC,DESC])","brackettedExpression"],"(":["constraint"],STR:["constraint"],LANG:["constraint"],LANGMATCHES:["constraint"],DATATYPE:["constraint"],BOUND:["constraint"],IRI:["constraint"],URI:["constraint"],BNODE:["constraint"],RAND:["constraint"],ABS:["constraint"],CEIL:["constraint"],FLOOR:["constraint"],ROUND:["constraint"],CONCAT:["constraint"],STRLEN:["constraint"],UCASE:["constraint"],LCASE:["constraint"],ENCODE_FOR_URI:["constraint"],CONTAINS:["constraint"],STRSTARTS:["constraint"],STRENDS:["constraint"],STRBEFORE:["constraint"],STRAFTER:["constraint"],YEAR:["constraint"],MONTH:["constraint"],DAY:["constraint"],HOURS:["constraint"],MINUTES:["constraint"],SECONDS:["constraint"],TIMEZONE:["constraint"],TZ:["constraint"],NOW:["constraint"],UUID:["constraint"],STRUUID:["constraint"],MD5:["constraint"],SHA1:["constraint"],SHA256:["constraint"],SHA384:["constraint"],SHA512:["constraint"],COALESCE:["constraint"],IF:["constraint"],STRLANG:["constraint"],STRDT:["constraint"],SAMETERM:["constraint"],ISIRI:["constraint"],ISURI:["constraint"],ISBLANK:["constraint"],ISLITERAL:["constraint"],ISNUMERIC:["constraint"],SUBSTR:["constraint"],REPLACE:["constraint"],REGEX:["constraint"],EXISTS:["constraint"],NOT:["constraint"],IRI_REF:["constraint"],PNAME_LN:["constraint"],PNAME_NS:["constraint"],VAR1:["var"],VAR2:["var"]},path:{"^":["pathAlternative"],a:["pathAlternative"],"!":["pathAlternative"],"(":["pathAlternative"],IRI_REF:["pathAlternative"],PNAME_LN:["pathAlternative"],PNAME_NS:["pathAlternative"]},pathAlternative:{"^":["pathSequence","*[|,pathSequence]"],a:["pathSequence","*[|,pathSequence]"],"!":["pathSequence","*[|,pathSequence]"],"(":["pathSequence","*[|,pathSequence]"],IRI_REF:["pathSequence","*[|,pathSequence]"],PNAME_LN:["pathSequence","*[|,pathSequence]"],PNAME_NS:["pathSequence","*[|,pathSequence]"]},pathElt:{a:["pathPrimary","?pathMod"],"!":["pathPrimary","?pathMod"],"(":["pathPrimary","?pathMod"],IRI_REF:["pathPrimary","?pathMod"],PNAME_LN:["pathPrimary","?pathMod"],PNAME_NS:["pathPrimary","?pathMod"]},pathEltOrInverse:{a:["pathElt"],"!":["pathElt"],"(":["pathElt"],IRI_REF:["pathElt"],PNAME_LN:["pathElt"],PNAME_NS:["pathElt"],"^":["^","pathElt"]},pathMod:{"*":["*"],"?":["?"],"+":["+"],"{":["{","or([[integer,or([[,,or([},[integer,}]])],}])],[,,integer,}]])"]},pathNegatedPropertySet:{a:["pathOneInPropertySet"],"^":["pathOneInPropertySet"],IRI_REF:["pathOneInPropertySet"],PNAME_LN:["pathOneInPropertySet"],PNAME_NS:["pathOneInPropertySet"],"(":["(","?[pathOneInPropertySet,*[|,pathOneInPropertySet]]",")"]},pathOneInPropertySet:{IRI_REF:["iriRef"],PNAME_LN:["iriRef"],PNAME_NS:["iriRef"],a:["a"],"^":["^","or([iriRef,a])"]},pathPrimary:{IRI_REF:["storeProperty","iriRef"],PNAME_LN:["storeProperty","iriRef"],PNAME_NS:["storeProperty","iriRef"],a:["storeProperty","a"],"!":["!","pathNegatedPropertySet"],"(":["(","path",")"]},pathSequence:{"^":["pathEltOrInverse","*[/,pathEltOrInverse]"],a:["pathEltOrInverse","*[/,pathEltOrInverse]"],"!":["pathEltOrInverse","*[/,pathEltOrInverse]"],"(":["pathEltOrInverse","*[/,pathEltOrInverse]"],IRI_REF:["pathEltOrInverse","*[/,pathEltOrInverse]"],PNAME_LN:["pathEltOrInverse","*[/,pathEltOrInverse]"],PNAME_NS:["pathEltOrInverse","*[/,pathEltOrInverse]"]},prefixDecl:{PREFIX:["PREFIX","PNAME_NS","IRI_REF"]},prefixedName:{PNAME_LN:["PNAME_LN"],PNAME_NS:["PNAME_NS"]},primaryExpression:{"(":["brackettedExpression"],STR:["builtInCall"],LANG:["builtInCall"],LANGMATCHES:["builtInCall"],DATATYPE:["builtInCall"],BOUND:["builtInCall"],IRI:["builtInCall"],URI:["builtInCall"],BNODE:["builtInCall"],RAND:["builtInCall"],ABS:["builtInCall"],CEIL:["builtInCall"],FLOOR:["builtInCall"],ROUND:["builtInCall"],CONCAT:["builtInCall"],STRLEN:["builtInCall"],UCASE:["builtInCall"],LCASE:["builtInCall"],ENCODE_FOR_URI:["builtInCall"],CONTAINS:["builtInCall"],STRSTARTS:["builtInCall"],STRENDS:["builtInCall"],STRBEFORE:["builtInCall"],STRAFTER:["builtInCall"],YEAR:["builtInCall"],MONTH:["builtInCall"],DAY:["builtInCall"],HOURS:["builtInCall"],MINUTES:["builtInCall"],SECONDS:["builtInCall"],TIMEZONE:["builtInCall"],TZ:["builtInCall"],NOW:["builtInCall"],UUID:["builtInCall"],STRUUID:["builtInCall"],MD5:["builtInCall"],SHA1:["builtInCall"],SHA256:["builtInCall"],SHA384:["builtInCall"],SHA512:["builtInCall"],COALESCE:["builtInCall"],IF:["builtInCall"],STRLANG:["builtInCall"],STRDT:["builtInCall"],SAMETERM:["builtInCall"],ISIRI:["builtInCall"],ISURI:["builtInCall"],ISBLANK:["builtInCall"],ISLITERAL:["builtInCall"],ISNUMERIC:["builtInCall"],SUBSTR:["builtInCall"],REPLACE:["builtInCall"],REGEX:["builtInCall"],EXISTS:["builtInCall"],NOT:["builtInCall"],IRI_REF:["iriRefOrFunction"],PNAME_LN:["iriRefOrFunction"],PNAME_NS:["iriRefOrFunction"],STRING_LITERAL1:["rdfLiteral"],STRING_LITERAL2:["rdfLiteral"],STRING_LITERAL_LONG1:["rdfLiteral"],STRING_LITERAL_LONG2:["rdfLiteral"],INTEGER:["numericLiteral"],DECIMAL:["numericLiteral"],DOUBLE:["numericLiteral"],INTEGER_POSITIVE:["numericLiteral"],DECIMAL_POSITIVE:["numericLiteral"],DOUBLE_POSITIVE:["numericLiteral"],INTEGER_NEGATIVE:["numericLiteral"],DECIMAL_NEGATIVE:["numericLiteral"],DOUBLE_NEGATIVE:["numericLiteral"],TRUE:["booleanLiteral"],FALSE:["booleanLiteral"],"<<":["embeddedTriple"],VAR1:["var"],VAR2:["var"],COUNT:["aggregate"],SUM:["aggregate"],MIN:["aggregate"],MAX:["aggregate"],AVG:["aggregate"],SAMPLE:["aggregate"],GROUP_CONCAT:["aggregate"]},prologue:{BASE:["*or([baseDecl,prefixDecl])"],PREFIX:["*or([baseDecl,prefixDecl])"],$:["*or([baseDecl,prefixDecl])"],CONSTRUCT:["*or([baseDecl,prefixDecl])"],DESCRIBE:["*or([baseDecl,prefixDecl])"],ASK:["*or([baseDecl,prefixDecl])"],INSERT:["*or([baseDecl,prefixDecl])"],DELETE:["*or([baseDecl,prefixDecl])"],SELECT:["*or([baseDecl,prefixDecl])"],LOAD:["*or([baseDecl,prefixDecl])"],CLEAR:["*or([baseDecl,prefixDecl])"],DROP:["*or([baseDecl,prefixDecl])"],ADD:["*or([baseDecl,prefixDecl])"],MOVE:["*or([baseDecl,prefixDecl])"],COPY:["*or([baseDecl,prefixDecl])"],CREATE:["*or([baseDecl,prefixDecl])"],WITH:["*or([baseDecl,prefixDecl])"]},propertyList:{VAR1:["propertyListNotEmpty"],VAR2:["propertyListNotEmpty"],"^":["propertyListNotEmpty"],a:["propertyListNotEmpty"],"!":["propertyListNotEmpty"],"(":["propertyListNotEmpty"],IRI_REF:["propertyListNotEmpty"],PNAME_LN:["propertyListNotEmpty"],PNAME_NS:["propertyListNotEmpty"],".":[],"}":[],GRAPH:[]},propertyListNotEmpty:{VAR1:["or([verbPath,verbSimple])","objectList","*[;,?[or([verbPath,verbSimple]),objectList]]"],VAR2:["or([verbPath,verbSimple])","objectList","*[;,?[or([verbPath,verbSimple]),objectList]]"],"^":["or([verbPath,verbSimple])","objectList","*[;,?[or([verbPath,verbSimple]),objectList]]"],a:["or([verbPath,verbSimple])","objectList","*[;,?[or([verbPath,verbSimple]),objectList]]"],"!":["or([verbPath,verbSimple])","objectList","*[;,?[or([verbPath,verbSimple]),objectList]]"],"(":["or([verbPath,verbSimple])","objectList","*[;,?[or([verbPath,verbSimple]),objectList]]"],IRI_REF:["or([verbPath,verbSimple])","objectList","*[;,?[or([verbPath,verbSimple]),objectList]]"],PNAME_LN:["or([verbPath,verbSimple])","objectList","*[;,?[or([verbPath,verbSimple]),objectList]]"],PNAME_NS:["or([verbPath,verbSimple])","objectList","*[;,?[or([verbPath,verbSimple]),objectList]]"]},propertyListPath:{VAR1:["propertyListNotEmpty"],VAR2:["propertyListNotEmpty"],"^":["propertyListNotEmpty"],a:["propertyListNotEmpty"],"!":["propertyListNotEmpty"],"(":["propertyListNotEmpty"],IRI_REF:["propertyListNotEmpty"],PNAME_LN:["propertyListNotEmpty"],PNAME_NS:["propertyListNotEmpty"],".":[],"{":[],OPTIONAL:[],MINUS:[],GRAPH:[],SERVICE:[],FILTER:[],BIND:[],VALUES:[],"}":[]},propertyListPathNotEmpty:{VAR1:["or([verbPath,verbSimple])","objectListPath","*[;,?[or([verbPath,verbSimple]),objectList]]"],VAR2:["or([verbPath,verbSimple])","objectListPath","*[;,?[or([verbPath,verbSimple]),objectList]]"],"^":["or([verbPath,verbSimple])","objectListPath","*[;,?[or([verbPath,verbSimple]),objectList]]"],a:["or([verbPath,verbSimple])","objectListPath","*[;,?[or([verbPath,verbSimple]),objectList]]"],"!":["or([verbPath,verbSimple])","objectListPath","*[;,?[or([verbPath,verbSimple]),objectList]]"],"(":["or([verbPath,verbSimple])","objectListPath","*[;,?[or([verbPath,verbSimple]),objectList]]"],IRI_REF:["or([verbPath,verbSimple])","objectListPath","*[;,?[or([verbPath,verbSimple]),objectList]]"],PNAME_LN:["or([verbPath,verbSimple])","objectListPath","*[;,?[or([verbPath,verbSimple]),objectList]]"],PNAME_NS:["or([verbPath,verbSimple])","objectListPath","*[;,?[or([verbPath,verbSimple]),objectList]]"]},quadData:{"{":["{","disallowVars","quads","allowVars","}"]},quadDataNoBnodes:{"{":["{","disallowBnodes","disallowVars","quads","allowVars","allowBnodes","}"]},quadPattern:{"{":["{","quads","}"]},quadPatternNoBnodes:{"{":["{","disallowBnodes","quads","allowBnodes","}"]},quads:{GRAPH:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],VAR1:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],VAR2:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],NIL:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],"(":["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],"[":["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],IRI_REF:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],TRUE:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],FALSE:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],BLANK_NODE_LABEL:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],ANON:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],"<<":["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],PNAME_LN:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],PNAME_NS:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],STRING_LITERAL1:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],STRING_LITERAL2:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],STRING_LITERAL_LONG1:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],STRING_LITERAL_LONG2:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],INTEGER:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],DECIMAL:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],DOUBLE:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],INTEGER_POSITIVE:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],DECIMAL_POSITIVE:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],DOUBLE_POSITIVE:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],INTEGER_NEGATIVE:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],DECIMAL_NEGATIVE:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],DOUBLE_NEGATIVE:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],"}":["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"]},quadsNotTriples:{GRAPH:["GRAPH","varOrIRIref","{","?triplesTemplate","}"]},queryAll:{CONSTRUCT:["or([selectQuery,constructQuery,describeQuery,askQuery])","valuesClause"],DESCRIBE:["or([selectQuery,constructQuery,describeQuery,askQuery])","valuesClause"],ASK:["or([selectQuery,constructQuery,describeQuery,askQuery])","valuesClause"],SELECT:["or([selectQuery,constructQuery,describeQuery,askQuery])","valuesClause"]},rdfLiteral:{STRING_LITERAL1:["string","?or([LANGTAG,[^^,iriRef]])"],STRING_LITERAL2:["string","?or([LANGTAG,[^^,iriRef]])"],STRING_LITERAL_LONG1:["string","?or([LANGTAG,[^^,iriRef]])"],STRING_LITERAL_LONG2:["string","?or([LANGTAG,[^^,iriRef]])"]},regexExpression:{REGEX:["REGEX","(","expression",",","expression","?[,,expression]",")"]},relationalExpression:{"!":["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],"+":["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],"-":["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],VAR1:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],VAR2:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],"(":["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STR:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],LANG:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],LANGMATCHES:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],DATATYPE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],BOUND:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],IRI:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],URI:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],BNODE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],RAND:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],ABS:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],CEIL:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],FLOOR:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],ROUND:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],CONCAT:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRLEN:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],UCASE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],LCASE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],ENCODE_FOR_URI:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],CONTAINS:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRSTARTS:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRENDS:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRBEFORE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRAFTER:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],YEAR:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],MONTH:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],DAY:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],HOURS:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],MINUTES:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],SECONDS:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],TIMEZONE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],TZ:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],NOW:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],UUID:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRUUID:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],MD5:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],SHA1:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],SHA256:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],SHA384:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],SHA512:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],COALESCE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],IF:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRLANG:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRDT:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],SAMETERM:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],ISIRI:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],ISURI:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],ISBLANK:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],ISLITERAL:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],ISNUMERIC:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],TRUE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],FALSE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],"<<":["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],COUNT:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],SUM:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],MIN:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],MAX:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],AVG:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],SAMPLE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],GROUP_CONCAT:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],SUBSTR:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],REPLACE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],REGEX:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],EXISTS:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],NOT:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],IRI_REF:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRING_LITERAL1:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRING_LITERAL2:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRING_LITERAL_LONG1:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRING_LITERAL_LONG2:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],INTEGER:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],DECIMAL:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],DOUBLE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],INTEGER_POSITIVE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],DECIMAL_POSITIVE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],DOUBLE_POSITIVE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],INTEGER_NEGATIVE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],DECIMAL_NEGATIVE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],DOUBLE_NEGATIVE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],PNAME_LN:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],PNAME_NS:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"]},selectClause:{SELECT:["SELECT","?or([DISTINCT,REDUCED])","or([+or([var,[(,expression,AS,var,)]]),*])"]},selectQuery:{SELECT:["selectClause","*datasetClause","whereClause","solutionModifier"]},serviceGraphPattern:{SERVICE:["SERVICE","?SILENT","varOrIRIref","groupGraphPattern"]},solutionModifier:{LIMIT:["?groupClause","?havingClause","?orderClause","?limitOffsetClauses"],OFFSET:["?groupClause","?havingClause","?orderClause","?limitOffsetClauses"],ORDER:["?groupClause","?havingClause","?orderClause","?limitOffsetClauses"],HAVING:["?groupClause","?havingClause","?orderClause","?limitOffsetClauses"],GROUP:["?groupClause","?havingClause","?orderClause","?limitOffsetClauses"],VALUES:["?groupClause","?havingClause","?orderClause","?limitOffsetClauses"],$:["?groupClause","?havingClause","?orderClause","?limitOffsetClauses"],"}":["?groupClause","?havingClause","?orderClause","?limitOffsetClauses"]},sourceSelector:{IRI_REF:["iriRef"],PNAME_LN:["iriRef"],PNAME_NS:["iriRef"]},sparql11:{$:["prologue","or([queryAll,updateAll])","$"],CONSTRUCT:["prologue","or([queryAll,updateAll])","$"],DESCRIBE:["prologue","or([queryAll,updateAll])","$"],ASK:["prologue","or([queryAll,updateAll])","$"],INSERT:["prologue","or([queryAll,updateAll])","$"],DELETE:["prologue","or([queryAll,updateAll])","$"],SELECT:["prologue","or([queryAll,updateAll])","$"],LOAD:["prologue","or([queryAll,updateAll])","$"],CLEAR:["prologue","or([queryAll,updateAll])","$"],DROP:["prologue","or([queryAll,updateAll])","$"],ADD:["prologue","or([queryAll,updateAll])","$"],MOVE:["prologue","or([queryAll,updateAll])","$"],COPY:["prologue","or([queryAll,updateAll])","$"],CREATE:["prologue","or([queryAll,updateAll])","$"],WITH:["prologue","or([queryAll,updateAll])","$"],BASE:["prologue","or([queryAll,updateAll])","$"],PREFIX:["prologue","or([queryAll,updateAll])","$"]},storeProperty:{VAR1:[],VAR2:[],IRI_REF:[],PNAME_LN:[],PNAME_NS:[],a:[]},strReplaceExpression:{REPLACE:["REPLACE","(","expression",",","expression",",","expression","?[,,expression]",")"]},string:{STRING_LITERAL1:["STRING_LITERAL1"],STRING_LITERAL2:["STRING_LITERAL2"],STRING_LITERAL_LONG1:["STRING_LITERAL_LONG1"],STRING_LITERAL_LONG2:["STRING_LITERAL_LONG2"]},subSelect:{SELECT:["selectClause","whereClause","solutionModifier","valuesClause"]},substringExpression:{SUBSTR:["SUBSTR","(","expression",",","expression","?[,,expression]",")"]},triplesBlock:{VAR1:["triplesSameSubjectPath","?[.,?triplesBlock]"],VAR2:["triplesSameSubjectPath","?[.,?triplesBlock]"],NIL:["triplesSameSubjectPath","?[.,?triplesBlock]"],"(":["triplesSameSubjectPath","?[.,?triplesBlock]"],"[":["triplesSameSubjectPath","?[.,?triplesBlock]"],IRI_REF:["triplesSameSubjectPath","?[.,?triplesBlock]"],TRUE:["triplesSameSubjectPath","?[.,?triplesBlock]"],FALSE:["triplesSameSubjectPath","?[.,?triplesBlock]"],BLANK_NODE_LABEL:["triplesSameSubjectPath","?[.,?triplesBlock]"],ANON:["triplesSameSubjectPath","?[.,?triplesBlock]"],"<<":["triplesSameSubjectPath","?[.,?triplesBlock]"],PNAME_LN:["triplesSameSubjectPath","?[.,?triplesBlock]"],PNAME_NS:["triplesSameSubjectPath","?[.,?triplesBlock]"],STRING_LITERAL1:["triplesSameSubjectPath","?[.,?triplesBlock]"],STRING_LITERAL2:["triplesSameSubjectPath","?[.,?triplesBlock]"],STRING_LITERAL_LONG1:["triplesSameSubjectPath","?[.,?triplesBlock]"],STRING_LITERAL_LONG2:["triplesSameSubjectPath","?[.,?triplesBlock]"],INTEGER:["triplesSameSubjectPath","?[.,?triplesBlock]"],DECIMAL:["triplesSameSubjectPath","?[.,?triplesBlock]"],DOUBLE:["triplesSameSubjectPath","?[.,?triplesBlock]"],INTEGER_POSITIVE:["triplesSameSubjectPath","?[.,?triplesBlock]"],DECIMAL_POSITIVE:["triplesSameSubjectPath","?[.,?triplesBlock]"],DOUBLE_POSITIVE:["triplesSameSubjectPath","?[.,?triplesBlock]"],INTEGER_NEGATIVE:["triplesSameSubjectPath","?[.,?triplesBlock]"],DECIMAL_NEGATIVE:["triplesSameSubjectPath","?[.,?triplesBlock]"],DOUBLE_NEGATIVE:["triplesSameSubjectPath","?[.,?triplesBlock]"]},triplesNode:{"(":["collection"],"[":["blankNodePropertyList"]},triplesNodePath:{"(":["collectionPath"],"[":["blankNodePropertyListPath"]},triplesSameSubject:{VAR1:["varOrTerm","propertyListNotEmpty"],VAR2:["varOrTerm","propertyListNotEmpty"],NIL:["varOrTerm","propertyListNotEmpty"],IRI_REF:["varOrTerm","propertyListNotEmpty"],TRUE:["varOrTerm","propertyListNotEmpty"],FALSE:["varOrTerm","propertyListNotEmpty"],BLANK_NODE_LABEL:["varOrTerm","propertyListNotEmpty"],ANON:["varOrTerm","propertyListNotEmpty"],"<<":["varOrTerm","propertyListNotEmpty"],PNAME_LN:["varOrTerm","propertyListNotEmpty"],PNAME_NS:["varOrTerm","propertyListNotEmpty"],STRING_LITERAL1:["varOrTerm","propertyListNotEmpty"],STRING_LITERAL2:["varOrTerm","propertyListNotEmpty"],STRING_LITERAL_LONG1:["varOrTerm","propertyListNotEmpty"],STRING_LITERAL_LONG2:["varOrTerm","propertyListNotEmpty"],INTEGER:["varOrTerm","propertyListNotEmpty"],DECIMAL:["varOrTerm","propertyListNotEmpty"],DOUBLE:["varOrTerm","propertyListNotEmpty"],INTEGER_POSITIVE:["varOrTerm","propertyListNotEmpty"],DECIMAL_POSITIVE:["varOrTerm","propertyListNotEmpty"],DOUBLE_POSITIVE:["varOrTerm","propertyListNotEmpty"],INTEGER_NEGATIVE:["varOrTerm","propertyListNotEmpty"],DECIMAL_NEGATIVE:["varOrTerm","propertyListNotEmpty"],DOUBLE_NEGATIVE:["varOrTerm","propertyListNotEmpty"],"(":["triplesNode","propertyList"],"[":["triplesNode","propertyList"]},triplesSameSubjectPath:{VAR1:["varOrTerm","propertyListPathNotEmpty"],VAR2:["varOrTerm","propertyListPathNotEmpty"],NIL:["varOrTerm","propertyListPathNotEmpty"],IRI_REF:["varOrTerm","propertyListPathNotEmpty"],TRUE:["varOrTerm","propertyListPathNotEmpty"],FALSE:["varOrTerm","propertyListPathNotEmpty"],BLANK_NODE_LABEL:["varOrTerm","propertyListPathNotEmpty"],ANON:["varOrTerm","propertyListPathNotEmpty"],"<<":["varOrTerm","propertyListPathNotEmpty"],PNAME_LN:["varOrTerm","propertyListPathNotEmpty"],PNAME_NS:["varOrTerm","propertyListPathNotEmpty"],STRING_LITERAL1:["varOrTerm","propertyListPathNotEmpty"],STRING_LITERAL2:["varOrTerm","propertyListPathNotEmpty"],STRING_LITERAL_LONG1:["varOrTerm","propertyListPathNotEmpty"],STRING_LITERAL_LONG2:["varOrTerm","propertyListPathNotEmpty"],INTEGER:["varOrTerm","propertyListPathNotEmpty"],DECIMAL:["varOrTerm","propertyListPathNotEmpty"],DOUBLE:["varOrTerm","propertyListPathNotEmpty"],INTEGER_POSITIVE:["varOrTerm","propertyListPathNotEmpty"],DECIMAL_POSITIVE:["varOrTerm","propertyListPathNotEmpty"],DOUBLE_POSITIVE:["varOrTerm","propertyListPathNotEmpty"],INTEGER_NEGATIVE:["varOrTerm","propertyListPathNotEmpty"],DECIMAL_NEGATIVE:["varOrTerm","propertyListPathNotEmpty"],DOUBLE_NEGATIVE:["varOrTerm","propertyListPathNotEmpty"],"(":["triplesNodePath","propertyListPath"],"[":["triplesNodePath","propertyListPath"]},triplesTemplate:{VAR1:["triplesSameSubject","?[.,?triplesTemplate]"],VAR2:["triplesSameSubject","?[.,?triplesTemplate]"],NIL:["triplesSameSubject","?[.,?triplesTemplate]"],"(":["triplesSameSubject","?[.,?triplesTemplate]"],"[":["triplesSameSubject","?[.,?triplesTemplate]"],IRI_REF:["triplesSameSubject","?[.,?triplesTemplate]"],TRUE:["triplesSameSubject","?[.,?triplesTemplate]"],FALSE:["triplesSameSubject","?[.,?triplesTemplate]"],BLANK_NODE_LABEL:["triplesSameSubject","?[.,?triplesTemplate]"],ANON:["triplesSameSubject","?[.,?triplesTemplate]"],"<<":["triplesSameSubject","?[.,?triplesTemplate]"],PNAME_LN:["triplesSameSubject","?[.,?triplesTemplate]"],PNAME_NS:["triplesSameSubject","?[.,?triplesTemplate]"],STRING_LITERAL1:["triplesSameSubject","?[.,?triplesTemplate]"],STRING_LITERAL2:["triplesSameSubject","?[.,?triplesTemplate]"],STRING_LITERAL_LONG1:["triplesSameSubject","?[.,?triplesTemplate]"],STRING_LITERAL_LONG2:["triplesSameSubject","?[.,?triplesTemplate]"],INTEGER:["triplesSameSubject","?[.,?triplesTemplate]"],DECIMAL:["triplesSameSubject","?[.,?triplesTemplate]"],DOUBLE:["triplesSameSubject","?[.,?triplesTemplate]"],INTEGER_POSITIVE:["triplesSameSubject","?[.,?triplesTemplate]"],DECIMAL_POSITIVE:["triplesSameSubject","?[.,?triplesTemplate]"],DOUBLE_POSITIVE:["triplesSameSubject","?[.,?triplesTemplate]"],INTEGER_NEGATIVE:["triplesSameSubject","?[.,?triplesTemplate]"],DECIMAL_NEGATIVE:["triplesSameSubject","?[.,?triplesTemplate]"],DOUBLE_NEGATIVE:["triplesSameSubject","?[.,?triplesTemplate]"]},unaryExpression:{"!":["!","primaryExpression"],"+":["+","primaryExpression"],"-":["-","primaryExpression"],VAR1:["primaryExpression"],VAR2:["primaryExpression"],"(":["primaryExpression"],STR:["primaryExpression"],LANG:["primaryExpression"],LANGMATCHES:["primaryExpression"],DATATYPE:["primaryExpression"],BOUND:["primaryExpression"],IRI:["primaryExpression"],URI:["primaryExpression"],BNODE:["primaryExpression"],RAND:["primaryExpression"],ABS:["primaryExpression"],CEIL:["primaryExpression"],FLOOR:["primaryExpression"],ROUND:["primaryExpression"],CONCAT:["primaryExpression"],STRLEN:["primaryExpression"],UCASE:["primaryExpression"],LCASE:["primaryExpression"],ENCODE_FOR_URI:["primaryExpression"],CONTAINS:["primaryExpression"],STRSTARTS:["primaryExpression"],STRENDS:["primaryExpression"],STRBEFORE:["primaryExpression"],STRAFTER:["primaryExpression"],YEAR:["primaryExpression"],MONTH:["primaryExpression"],DAY:["primaryExpression"],HOURS:["primaryExpression"],MINUTES:["primaryExpression"],SECONDS:["primaryExpression"],TIMEZONE:["primaryExpression"],TZ:["primaryExpression"],NOW:["primaryExpression"],UUID:["primaryExpression"],STRUUID:["primaryExpression"],MD5:["primaryExpression"],SHA1:["primaryExpression"],SHA256:["primaryExpression"],SHA384:["primaryExpression"],SHA512:["primaryExpression"],COALESCE:["primaryExpression"],IF:["primaryExpression"],STRLANG:["primaryExpression"],STRDT:["primaryExpression"],SAMETERM:["primaryExpression"],ISIRI:["primaryExpression"],ISURI:["primaryExpression"],ISBLANK:["primaryExpression"],ISLITERAL:["primaryExpression"],ISNUMERIC:["primaryExpression"],TRUE:["primaryExpression"],FALSE:["primaryExpression"],"<<":["primaryExpression"],COUNT:["primaryExpression"],SUM:["primaryExpression"],MIN:["primaryExpression"],MAX:["primaryExpression"],AVG:["primaryExpression"],SAMPLE:["primaryExpression"],GROUP_CONCAT:["primaryExpression"],SUBSTR:["primaryExpression"],REPLACE:["primaryExpression"],REGEX:["primaryExpression"],EXISTS:["primaryExpression"],NOT:["primaryExpression"],IRI_REF:["primaryExpression"],STRING_LITERAL1:["primaryExpression"],STRING_LITERAL2:["primaryExpression"],STRING_LITERAL_LONG1:["primaryExpression"],STRING_LITERAL_LONG2:["primaryExpression"],INTEGER:["primaryExpression"],DECIMAL:["primaryExpression"],DOUBLE:["primaryExpression"],INTEGER_POSITIVE:["primaryExpression"],DECIMAL_POSITIVE:["primaryExpression"],DOUBLE_POSITIVE:["primaryExpression"],INTEGER_NEGATIVE:["primaryExpression"],DECIMAL_NEGATIVE:["primaryExpression"],DOUBLE_NEGATIVE:["primaryExpression"],PNAME_LN:["primaryExpression"],PNAME_NS:["primaryExpression"]},update:{INSERT:["prologue","?[update1,?[;,update]]"],DELETE:["prologue","?[update1,?[;,update]]"],LOAD:["prologue","?[update1,?[;,update]]"],CLEAR:["prologue","?[update1,?[;,update]]"],DROP:["prologue","?[update1,?[;,update]]"],ADD:["prologue","?[update1,?[;,update]]"],MOVE:["prologue","?[update1,?[;,update]]"],COPY:["prologue","?[update1,?[;,update]]"],CREATE:["prologue","?[update1,?[;,update]]"],WITH:["prologue","?[update1,?[;,update]]"],BASE:["prologue","?[update1,?[;,update]]"],PREFIX:["prologue","?[update1,?[;,update]]"],$:["prologue","?[update1,?[;,update]]"]},update1:{LOAD:["load"],CLEAR:["clear"],DROP:["drop"],ADD:["add"],MOVE:["move"],COPY:["copy"],CREATE:["create"],INSERT:["INSERT","insert1"],DELETE:["DELETE","delete1"],WITH:["modify"]},updateAll:{INSERT:["?[update1,?[;,update]]"],DELETE:["?[update1,?[;,update]]"],LOAD:["?[update1,?[;,update]]"],CLEAR:["?[update1,?[;,update]]"],DROP:["?[update1,?[;,update]]"],ADD:["?[update1,?[;,update]]"],MOVE:["?[update1,?[;,update]]"],COPY:["?[update1,?[;,update]]"],CREATE:["?[update1,?[;,update]]"],WITH:["?[update1,?[;,update]]"],$:["?[update1,?[;,update]]"]},usingClause:{USING:["USING","or([iriRef,[NAMED,iriRef]])"]},valueLogical:{"!":["relationalExpression"],"+":["relationalExpression"],"-":["relationalExpression"],VAR1:["relationalExpression"],VAR2:["relationalExpression"],"(":["relationalExpression"],STR:["relationalExpression"],LANG:["relationalExpression"],LANGMATCHES:["relationalExpression"],DATATYPE:["relationalExpression"],BOUND:["relationalExpression"],IRI:["relationalExpression"],URI:["relationalExpression"],BNODE:["relationalExpression"],RAND:["relationalExpression"],ABS:["relationalExpression"],CEIL:["relationalExpression"],FLOOR:["relationalExpression"],ROUND:["relationalExpression"],CONCAT:["relationalExpression"],STRLEN:["relationalExpression"],UCASE:["relationalExpression"],LCASE:["relationalExpression"],ENCODE_FOR_URI:["relationalExpression"],CONTAINS:["relationalExpression"],STRSTARTS:["relationalExpression"],STRENDS:["relationalExpression"],STRBEFORE:["relationalExpression"],STRAFTER:["relationalExpression"],YEAR:["relationalExpression"],MONTH:["relationalExpression"],DAY:["relationalExpression"],HOURS:["relationalExpression"],MINUTES:["relationalExpression"],SECONDS:["relationalExpression"],TIMEZONE:["relationalExpression"],TZ:["relationalExpression"],NOW:["relationalExpression"],UUID:["relationalExpression"],STRUUID:["relationalExpression"],MD5:["relationalExpression"],SHA1:["relationalExpression"],SHA256:["relationalExpression"],SHA384:["relationalExpression"],SHA512:["relationalExpression"],COALESCE:["relationalExpression"],IF:["relationalExpression"],STRLANG:["relationalExpression"],STRDT:["relationalExpression"],SAMETERM:["relationalExpression"],ISIRI:["relationalExpression"],ISURI:["relationalExpression"],ISBLANK:["relationalExpression"],ISLITERAL:["relationalExpression"],ISNUMERIC:["relationalExpression"],TRUE:["relationalExpression"],FALSE:["relationalExpression"],"<<":["relationalExpression"],COUNT:["relationalExpression"],SUM:["relationalExpression"],MIN:["relationalExpression"],MAX:["relationalExpression"],AVG:["relationalExpression"],SAMPLE:["relationalExpression"],GROUP_CONCAT:["relationalExpression"],SUBSTR:["relationalExpression"],REPLACE:["relationalExpression"],REGEX:["relationalExpression"],EXISTS:["relationalExpression"],NOT:["relationalExpression"],IRI_REF:["relationalExpression"],STRING_LITERAL1:["relationalExpression"],STRING_LITERAL2:["relationalExpression"],STRING_LITERAL_LONG1:["relationalExpression"],STRING_LITERAL_LONG2:["relationalExpression"],INTEGER:["relationalExpression"],DECIMAL:["relationalExpression"],DOUBLE:["relationalExpression"],INTEGER_POSITIVE:["relationalExpression"],DECIMAL_POSITIVE:["relationalExpression"],DOUBLE_POSITIVE:["relationalExpression"],INTEGER_NEGATIVE:["relationalExpression"],DECIMAL_NEGATIVE:["relationalExpression"],DOUBLE_NEGATIVE:["relationalExpression"],PNAME_LN:["relationalExpression"],PNAME_NS:["relationalExpression"]},valuesClause:{VALUES:["VALUES","dataBlock"],$:[],"}":[]},var:{VAR1:["VAR1"],VAR2:["VAR2"]},varOrIRIref:{VAR1:["var"],VAR2:["var"],IRI_REF:["iriRef"],PNAME_LN:["iriRef"],PNAME_NS:["iriRef"]},varOrTerm:{VAR1:["var"],VAR2:["var"],NIL:["graphTerm"],IRI_REF:["graphTerm"],TRUE:["graphTerm"],FALSE:["graphTerm"],BLANK_NODE_LABEL:["graphTerm"],ANON:["graphTerm"],"<<":["graphTerm"],PNAME_LN:["graphTerm"],PNAME_NS:["graphTerm"],STRING_LITERAL1:["graphTerm"],STRING_LITERAL2:["graphTerm"],STRING_LITERAL_LONG1:["graphTerm"],STRING_LITERAL_LONG2:["graphTerm"],INTEGER:["graphTerm"],DECIMAL:["graphTerm"],DOUBLE:["graphTerm"],INTEGER_POSITIVE:["graphTerm"],DECIMAL_POSITIVE:["graphTerm"],DOUBLE_POSITIVE:["graphTerm"],INTEGER_NEGATIVE:["graphTerm"],DECIMAL_NEGATIVE:["graphTerm"],DOUBLE_NEGATIVE:["graphTerm"]},verb:{VAR1:["storeProperty","varOrIRIref"],VAR2:["storeProperty","varOrIRIref"],IRI_REF:["storeProperty","varOrIRIref"],PNAME_LN:["storeProperty","varOrIRIref"],PNAME_NS:["storeProperty","varOrIRIref"],a:["storeProperty","a"]},verbPath:{"^":["path"],a:["path"],"!":["path"],"(":["path"],IRI_REF:["path"],PNAME_LN:["path"],PNAME_NS:["path"]},verbSimple:{VAR1:["var"],VAR2:["var"]},whereClause:{"{":["?WHERE","groupGraphPattern"],WHERE:["?WHERE","groupGraphPattern"]}},keywords:/^(GROUP_CONCAT|DATATYPE|BASE|PREFIX|SELECT|CONSTRUCT|DESCRIBE|ASK|FROM|NAMED|ORDER|BY|LIMIT|ASC|DESC|OFFSET|DISTINCT|REDUCED|WHERE|GRAPH|OPTIONAL|UNION|FILTER|GROUP|HAVING|AS|VALUES|LOAD|CLEAR|DROP|CREATE|MOVE|COPY|SILENT|INSERT|DELETE|DATA|WITH|TO|USING|NAMED|MINUS|BIND|LANGMATCHES|LANG|BOUND|SAMETERM|ISIRI|ISURI|ISBLANK|ISLITERAL|REGEX|TRUE|FALSE|UNDEF|ADD|DEFAULT|ALL|SERVICE|INTO|IN|NOT|IRI|URI|BNODE|RAND|ABS|CEIL|FLOOR|ROUND|CONCAT|STRLEN|UCASE|LCASE|ENCODE_FOR_URI|CONTAINS|STRSTARTS|STRENDS|STRBEFORE|STRAFTER|YEAR|MONTH|DAY|HOURS|MINUTES|SECONDS|TIMEZONE|TZ|NOW|UUID|STRUUID|MD5|SHA1|SHA256|SHA384|SHA512|COALESCE|IF|STRLANG|STRDT|ISNUMERIC|SUBSTR|REPLACE|EXISTS|COUNT|SUM|MIN|MAX|AVG|SAMPLE|SEPARATOR|STR|<<|>>)/i,punct:/^(\*|a|\.|\{|\}|,|\(|\)|;|\[|\]|\|\||&&|=|!=|!|<=|>=|<|>|\+|-|\/|\^\^|\?|\||\^)/,startSymbol:"sparql11",acceptEmpty:!0}},{}],3:[function(e,t,r){"use strict";var n=e("codemirror");n.defineMode("sparql11",(function(t,r){t.indentUnit;var n=e("./_tokenizer-table.js"),i=n.table,o="[0-9A-Fa-f]",s="(([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD])(((([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|_|-|[0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]))|\\.)*(([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|_|-|[0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040])))?)?:",a="[eE][\\+-]?[0-9]+",l="(([0-9]+\\.[0-9]*)|(\\.[0-9]+))",u="(([0-9]+\\.[0-9]*"+a+")|(\\.[0-9]+"+a+")|([0-9]+"+a+"))",c="\\\\[tbnrf\\\\\"']",p=o+"{4}",d="(\\\\u"+p+"|\\\\U00(10|0"+o+")"+p+")",f={SINGLE:{CAT:"STRING_LITERAL_LONG1",QUOTES:"'''",CONTENTS:"(('|'')?([^'\\\\]|"+c+"|"+d+"))*"},DOUBLE:{CAT:"STRING_LITERAL_LONG2",QUOTES:'"""',CONTENTS:'(("|"")?([^"\\\\]|'+c+"|"+d+"))*"}};for(var h in f)f[h].COMPLETE=f[h].QUOTES+f[h].CONTENTS+f[h].QUOTES;var g={};for(var h in f)g[h]={complete:{name:"STRING_LITERAL_LONG_"+h,regex:new RegExp("^"+f[h].COMPLETE),style:"string"},contents:{name:"STRING_LITERAL_LONG_"+h,regex:new RegExp("^"+f[h].CONTENTS),style:"string"},closing:{name:"STRING_LITERAL_LONG_"+h,regex:new RegExp("^"+f[h].CONTENTS+f[h].QUOTES),style:"string"},quotes:{name:"STRING_LITERAL_LONG_QUOTES_"+h,regex:new RegExp("^"+f[h].QUOTES),style:"string"}};var m="[\\x20\\x09\\x0D\\x0A]",E="#([^\\n\\r]*[\\n\\r]|[^\\n\\r]*$)",v=[{name:"WS",regex:new RegExp("^"+m+"+"),style:"ws"},{name:"COMMENT",regex:new RegExp("^"+E),style:"comment"},{name:"IRI_REF",regex:new RegExp("^<[^<>\"'|{}^\\\0- ]*>"),style:"variable-3"},{name:"VAR1",regex:new RegExp("^\\?([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|_|[0-9])([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|_|[0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040])*"),style:"atom"},{name:"VAR2",regex:new RegExp("^\\$([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|_|[0-9])([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|_|[0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040])*"),style:"atom"},{name:"LANGTAG",regex:new RegExp("^@[a-zA-Z]+(-[a-zA-Z0-9]+)*"),style:"meta"},{name:"DOUBLE",regex:new RegExp("^"+u),style:"number"},{name:"DECIMAL",regex:new RegExp("^"+l),style:"number"},{name:"INTEGER",regex:new RegExp("^[0-9]+"),style:"number"},{name:"DOUBLE_POSITIVE",regex:new RegExp("^\\+(([0-9]+\\.[0-9]*[eE][\\+-]?[0-9]+)|(\\.[0-9]+[eE][\\+-]?[0-9]+)|([0-9]+[eE][\\+-]?[0-9]+))"),style:"number"},{name:"DECIMAL_POSITIVE",regex:new RegExp("^\\+(([0-9]+\\.[0-9]*)|(\\.[0-9]+))"),style:"number"},{name:"INTEGER_POSITIVE",regex:new RegExp("^\\+[0-9]+"),style:"number"},{name:"DOUBLE_NEGATIVE",regex:new RegExp("^-(([0-9]+\\.[0-9]*[eE][\\+-]?[0-9]+)|(\\.[0-9]+[eE][\\+-]?[0-9]+)|([0-9]+[eE][\\+-]?[0-9]+))"),style:"number"},{name:"DECIMAL_NEGATIVE",regex:new RegExp("^-(([0-9]+\\.[0-9]*)|(\\.[0-9]+))"),style:"number"},{name:"INTEGER_NEGATIVE",regex:new RegExp("^-[0-9]+"),style:"number"},{name:"STRING_LITERAL1",regex:new RegExp("^'(([^\\x27\\x5C\\x0A\\x0D])|\\\\[tbnrf\\\\\"']|(\\\\u[0-9A-Fa-f]{4}|\\\\U00(10|0[0-9A-Fa-f])[0-9A-Fa-f]{4}))*'"),style:"string"},{name:"STRING_LITERAL2",regex:new RegExp('^"(([^\\x22\\x5C\\x0A\\x0D])|\\\\[tbnrf\\\\"\']|(\\\\u[0-9A-Fa-f]{4}|\\\\U00(10|0[0-9A-Fa-f])[0-9A-Fa-f]{4}))*"'),style:"string"},{name:"NIL",regex:new RegExp("^\\(([\\x20\\x09\\x0D\\x0A]|(#([^\\n\\r]*[\\n\\r]|[^\\n\\r]*$)))*\\)"),style:"punc"},{name:"ANON",regex:new RegExp("^\\[([\\x20\\x09\\x0D\\x0A]|(#([^\\n\\r]*[\\n\\r]|[^\\n\\r]*$)))*\\]"),style:"punc"},{name:"PNAME_LN",regex:new RegExp("^(([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD])(((([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|_|-|[0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]))|\\.)*(([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|_|-|[0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040])))?)?:([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|_|:|[0-9]|((%[0-9A-Fa-f][0-9A-Fa-f])|(\\\\[_~\\.\\-!\\$&'\\(\\)\\*\\+,;=/\\?#@%])))((([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|_|-|[0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040])|\\.|:|((%[0-9A-Fa-f][0-9A-Fa-f])|(\\\\[_~\\.\\-!\\$&'\\(\\)\\*\\+,;=/\\?#@%])))*(([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|_|-|[0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040])|:|((%[0-9A-Fa-f][0-9A-Fa-f])|(\\\\[_~\\.\\-!\\$&'\\(\\)\\*\\+,;=/\\?#@%]))))?"),style:"string-2"},{name:"PNAME_NS",regex:new RegExp("^"+s),style:"string-2"},{name:"BLANK_NODE_LABEL",regex:new RegExp("^_:([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|_|[0-9])((([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|_|-|[0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040])|\\.)*([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|_|-|[0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]))?"),style:"string-2"}];function x(e){var t=[],r=i[e];if(null!=r)for(var n in r)t.push(n.toString());else t.push(e);return t}function y(e,t){function r(){var r=e.column();t.errorStartPos=r,t.errorEndPos=r+a.text.length}function o(e){"disallowVars"==e?t.allowVars=!1:"allowVars"==e?t.allowVars=!0:"disallowBnodes"==e?t.allowBnodes=!1:"allowBnodes"==e?t.allowBnodes=!0:"storeProperty"==e&&(t.storeProperty=!0)}function s(e){return(t.allowVars||"var"!=e)&&(t.allowBnodes||"blankNode"!=e&&"blankNodePropertyList"!=e&&"blankNodePropertyListPath"!=e)}0==e.pos&&(t.possibleCurrent=t.possibleNext);var a=function(){var r=null;if(t.inLiteral){var i=!1;if((r=e.match(g[t.inLiteral].contents.regex,!0,!1))&&0==r[0].length&&(r=e.match(g[t.inLiteral].closing.regex,!0,!1),i=!0),r&&r[0].length>0){var o={quotePos:i?"end":"content",cat:f[t.inLiteral].CAT,style:g[t.inLiteral].complete.style,text:r[0],start:e.start};return i&&(t.inLiteral=!1),o}}for(var s in g){var a;if(r=e.match(g[s].quotes.regex,!0,!1))return t.inLiteral?(t.inLiteral=!1,a="end"):(t.inLiteral=s,a="start"),{cat:f[s].CAT,style:g[s].quotes.style,text:r[0],quotePos:a,start:e.start}}for(var l=0;l<v.length;++l)if(r=e.match(v[l].regex,!0,!1))return{cat:v[l].name,style:v[l].style,text:r[0],start:e.start};return(r=e.match(n.keywords,!0,!1))?{cat:e.current().toUpperCase(),style:"keyword",text:r[0],start:e.start}:(r=e.match(n.punct,!0,!1))?{cat:e.current(),style:"punc",text:r[0],start:e.start}:{cat:"<invalid_token>",style:"error",text:(r=e.match(/^.[A-Za-z0-9]*/,!0,!1))[0],start:e.start}}();if("<invalid_token>"==a.cat)return 1==t.OK&&(t.OK=!1,r()),t.complete=!1,a.style;if("WS"==a.cat||"COMMENT"==a.cat||a.quotePos&&"end"!=a.quotePos)return t.possibleCurrent=t.possibleNext,a.style;var l,u,c=!1,p=a.cat;if(!a.quotePos||"end"==a.quotePos)for(;t.stack.length>0&&p&&t.OK&&!c;)if(l=t.stack.pop(),i[l]){var d=i[l][p];if(null!=d&&s(l)){for(var h=d.length-1;h>=0;--h)t.stack.push(d[h]);o(l)}else t.OK=!1,t.complete=!1,r(),t.stack.push(l)}else if(l==p){c=!0,u=l,null==t.queryType&&("SELECT"!=u&&"CONSTRUCT"!=u&&"ASK"!=u&&"DESCRIBE"!=u&&"INSERT"!=u&&"DELETE"!=u&&"LOAD"!=u&&"CLEAR"!=u&&"CREATE"!=u&&"DROP"!=u&&"COPY"!=u&&"MOVE"!=u&&"ADD"!=u||(t.queryType=u));for(var m=!0,E=t.stack.length;E>0;--E){var y=i[t.stack[E-1]];y&&y.$||(m=!1)}t.complete=m,t.storeProperty&&"punc"!=p.cat&&(t.lastProperty=a.text,t.storeProperty=!1)}else t.OK=!1,t.complete=!1,r();return!c&&t.OK&&(t.OK=!1,t.complete=!1,r()),t.possibleCurrent.indexOf("a")>=0&&(t.lastPredicateOffset=a.start),t.possibleCurrent=t.possibleNext,t.possibleNext=x(t.stack[t.stack.length-1]),a.style}var T={"*[,, object]":3,"*[(,),object]":3,"*[(,),objectPath]":3,"*[/,pathEltOrInverse]":2,object:2,objectPath:2,objectList:2,objectListPath:2,storeProperty:2,pathMod:2,"?pathMod":2,propertyListNotEmpty:1,propertyList:1,propertyListPath:1,propertyListPathNotEmpty:1,"?[verb,objectList]":1},C={"}":1,"]":0,")":1,"{":-1,"(":-1};return{token:y,startState:function(e){return{tokenize:y,OK:!0,complete:n.acceptEmpty,errorStartPos:null,errorEndPos:null,queryType:null,possibleCurrent:x(n.startSymbol),possibleNext:x(n.startSymbol),allowVars:!0,allowBnodes:!0,storeProperty:!1,lastProperty:"",inLiteral:!1,stack:[n.startSymbol],lastPredicateOffset:t.indentUnit}},indent:function(e,r){if(e.inLiteral)return 0;if(e.stack.length&&"?[or([verbPath,verbSimple]),objectList]"==e.stack[e.stack.length-1])return e.lastPredicateOffset;var n=0,i=e.stack.length-1;if(/^[\}\]\)]/.test(r)){for(var o=r.substr(0,1);i>=0;--i)if(e.stack[i]==o){--i;break}}else(s=T[e.stack[i]])&&(n+=s,--i);for(;i>=0;--i){var s;(s=C[e.stack[i]])&&(n+=s)}return n*t.indentUnit},electricChars:"}])"}})),n.defineMIME("application/x-sparql-query","sparql11")},{"./_tokenizer-table.js":2,codemirror:15}],4:[function(e,t,r){var n=t.exports=function(){this.words=0,this.prefixes=0,this.children=[]};n.prototype={insert:function(e,t){if(0!=e.length){var r,i=this;void 0===t&&(t=0),t!==e.length?(i.prefixes++,r=e[t],void 0===i.children[r]&&(i.children[r]=new n),i.children[r].insert(e,t+1)):i.words++}},remove:function(e,t){if(0!=e.length){var r,n=this;void 0===t&&(t=0),void 0!==n&&(t!==e.length?(n.prefixes--,r=e[t],n.children[r].remove(e,t+1)):n.words--)}},update:function(e,t){0!=e.length&&0!=t.length&&(this.remove(e),this.insert(t))},countWord:function(e,t){if(0==e.length)return 0;var r,n,i=0;return void 0===t&&(t=0),t===e.length?this.words:(r=e[t],void 0!==(n=this.children[r])&&(i=n.countWord(e,t+1)),i)},countPrefix:function(e,t){if(0==e.length)return 0;var r,n=0;if(void 0===t&&(t=0),t===e.length)return this.prefixes;var i=e[t];return void 0!==(r=this.children[i])&&(n=r.countPrefix(e,t+1)),n},find:function(e){return 0!=e.length&&this.countWord(e)>0},getAllWords:function(e){var t,r,n=this,i=[];if(void 0===e&&(e=""),void 0===n)return[];for(t in n.words>0&&i.push(e),n.children)r=n.children[t],i=i.concat(r.getAllWords(e+t));return i},autoComplete:function(e,t){var r,n;return 0==e.length?void 0===t?this.getAllWords(e):[]:(void 0===t&&(t=0),r=e[t],void 0===(n=this.children[r])?[]:t===e.length-1?n.getAllWords(e):n.autoComplete(e,t+1))}}},{}],5:[function(e,t,r){var n;n=function(e){"use strict";e.defineOption("fullScreen",!1,(function(t,r,n){n==e.Init&&(n=!1),!n!=!r&&(r?function(e){var t=e.getWrapperElement();e.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:t.style.width,height:t.style.height},t.style.width="",t.style.height="auto",t.className+=" CodeMirror-fullscreen",document.documentElement.style.overflow="hidden",e.refresh()}(t):function(e){var t=e.getWrapperElement();t.className=t.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="";var r=e.state.fullScreenRestore;t.style.width=r.width,t.style.height=r.height,window.scrollTo(r.scrollLeft,r.scrollTop),e.refresh()}(t))}))},"object"==typeof r&&"object"==typeof t?n(e("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],n):n(CodeMirror)},{"../../lib/codemirror":15}],6:[function(e,t,r){var n;n=function(e){var t={pairs:"()[]{}''\"\"",triples:"",explode:"[]{}"},r=e.Pos;function n(e,r){return"pairs"==r&&"string"==typeof e?e:"object"==typeof e&&null!=e[r]?e[r]:t[r]}e.defineOption("autoCloseBrackets",!1,(function(t,r,n){n&&n!=e.Init&&(t.removeKeyMap(o),t.state.closeBrackets=null),r&&(t.state.closeBrackets=r,t.addKeyMap(o))}));for(var i=t.pairs+"`",o={Backspace:function(t){var i=l(t);if(!i||t.getOption("disableInput"))return e.Pass;for(var o=n(i,"pairs"),s=t.listSelections(),a=0;a<s.length;a++){if(!s[a].empty())return e.Pass;var u=c(t,s[a].head);if(!u||o.indexOf(u)%2!=0)return e.Pass}for(a=s.length-1;a>=0;a--){var p=s[a].head;t.replaceRange("",r(p.line,p.ch-1),r(p.line,p.ch+1),"+delete")}},Enter:function(t){var r=l(t),i=r&&n(r,"explode");if(!i||t.getOption("disableInput"))return e.Pass;for(var o=t.listSelections(),s=0;s<o.length;s++){if(!o[s].empty())return e.Pass;var a=c(t,o[s].head);if(!a||i.indexOf(a)%2!=0)return e.Pass}t.operation((function(){t.replaceSelection("\n\n",null),t.execCommand("goCharLeft"),o=t.listSelections();for(var e=0;e<o.length;e++){var r=o[e].head.line;t.indentLine(r,null,!0),t.indentLine(r+1,null,!0)}}))}},s=0;s<i.length;s++)o["'"+i.charAt(s)+"'"]=a(i.charAt(s));function a(t){return function(i){return function(t,i){var o=l(t);if(!o||t.getOption("disableInput"))return e.Pass;var s=n(o,"pairs"),a=s.indexOf(i);if(-1==a)return e.Pass;for(var c,d=n(o,"triples"),f=s.charAt(a+1)==i,h=t.listSelections(),g=a%2==0,m=0;m<h.length;m++){var E,v=h[m],x=v.head,y=t.getRange(x,r(x.line,x.ch+1));if(g&&!v.empty())E="surround";else if(!f&&g||y!=i)if(f&&x.ch>1&&d.indexOf(i)>=0&&t.getRange(r(x.line,x.ch-2),x)==i+i&&(x.ch<=2||t.getRange(r(x.line,x.ch-3),r(x.line,x.ch-2))!=i))E="addFour";else if(f){if(e.isWordChar(y)||!p(t,x,i))return e.Pass;E="both"}else{if(!g||t.getLine(x.line).length!=x.ch&&!u(y,s)&&!/\s/.test(y))return e.Pass;E="both"}else E=d.indexOf(i)>=0&&t.getRange(x,r(x.line,x.ch+3))==i+i+i?"skipThree":"skip";if(c){if(c!=E)return e.Pass}else c=E}var T=a%2?s.charAt(a-1):i,C=a%2?i:s.charAt(a+1);t.operation((function(){if("skip"==c)t.execCommand("goCharRight");else if("skipThree"==c)for(var n=0;n<3;n++)t.execCommand("goCharRight");else if("surround"==c){var i=t.getSelections();for(n=0;n<i.length;n++)i[n]=T+i[n]+C;for(t.replaceSelections(i,"around"),i=t.listSelections().slice(),n=0;n<i.length;n++)i[n]=(o=i[n],s=void 0,s=e.cmpPos(o.anchor,o.head)>0,{anchor:new r(o.anchor.line,o.anchor.ch+(s?-1:1)),head:new r(o.head.line,o.head.ch+(s?1:-1))});t.setSelections(i)}else"both"==c?(t.replaceSelection(T+C,null),t.triggerElectric(T+C),t.execCommand("goCharLeft")):"addFour"==c&&(t.replaceSelection(T+T+T+T,"before"),t.execCommand("goCharRight"));var o,s}))}(i,t)}}function l(e){var t=e.state.closeBrackets;return t?e.getModeAt(e.getCursor()).closeBrackets||t:null}function u(e,t){var r=t.lastIndexOf(e);return r>-1&&r%2==1}function c(e,t){var n=e.getRange(r(t.line,t.ch-1),r(t.line,t.ch+1));return 2==n.length?n:null}function p(t,r,n){var i=t.getLine(r.line),o=t.getTokenAt(r);if(/\bstring2?\b/.test(o.type))return!1;var s=new e.StringStream(i.slice(0,r.ch)+n+i.slice(r.ch),4);for(s.pos=s.start=o.start;;){var a=t.getMode().token(s,o.state);if(s.pos>=r.ch+1)return/\bstring2?\b/.test(a);s.start=s.pos}}},"object"==typeof r&&"object"==typeof t?n(e("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],n):n(CodeMirror)},{"../../lib/codemirror":15}],7:[function(e,t,r){var n;n=function(e){var t=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),r=e.Pos,n={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"};function i(e,t,i,s){var a=e.getLineHandle(t.line),l=t.ch-1,u=l>=0&&n[a.text.charAt(l)]||n[a.text.charAt(++l)];if(!u)return null;var c=">"==u.charAt(1)?1:-1;if(i&&c>0!=(l==t.ch))return null;var p=e.getTokenTypeAt(r(t.line,l+1)),d=o(e,r(t.line,l+(c>0?1:0)),c,p||null,s);return null==d?null:{from:r(t.line,l),to:d&&d.pos,match:d&&d.ch==u.charAt(0),forward:c>0}}function o(e,t,i,o,s){for(var a=s&&s.maxScanLineLength||1e4,l=s&&s.maxScanLines||1e3,u=[],c=s&&s.bracketRegex?s.bracketRegex:/[(){}[\]]/,p=i>0?Math.min(t.line+l,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-l),d=t.line;d!=p;d+=i){var f=e.getLine(d);if(f){var h=i>0?0:f.length-1,g=i>0?f.length:-1;if(!(f.length>a))for(d==t.line&&(h=t.ch-(i<0?1:0));h!=g;h+=i){var m=f.charAt(h);if(c.test(m)&&(void 0===o||e.getTokenTypeAt(r(d,h+1))==o))if(">"==n[m].charAt(1)==i>0)u.push(m);else{if(!u.length)return{pos:r(d,h),ch:m};u.pop()}}}}return d-i!=(i>0?e.lastLine():e.firstLine())&&null}function s(e,n,o){for(var s=e.state.matchBrackets.maxHighlightLineLength||1e3,a=[],l=e.listSelections(),u=0;u<l.length;u++){var c=l[u].empty()&&i(e,l[u].head,!1,o);if(c&&e.getLine(c.from.line).length<=s){var p=c.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";a.push(e.markText(c.from,r(c.from.line,c.from.ch+1),{className:p})),c.to&&e.getLine(c.to.line).length<=s&&a.push(e.markText(c.to,r(c.to.line,c.to.ch+1),{className:p}))}}if(a.length){t&&e.state.focused&&e.focus();var d=function(){e.operation((function(){for(var e=0;e<a.length;e++)a[e].clear()}))};if(!n)return d;setTimeout(d,800)}}var a=null;function l(e){e.operation((function(){a&&(a(),a=null),a=s(e,!1,e.state.matchBrackets)}))}e.defineOption("matchBrackets",!1,(function(t,r,n){n&&n!=e.Init&&t.off("cursorActivity",l),r&&(t.state.matchBrackets="object"==typeof r?r:{},t.on("cursorActivity",l))})),e.defineExtension("matchBrackets",(function(){s(this,!0)})),e.defineExtension("findMatchingBracket",(function(e,t,r){return i(this,e,t,r)})),e.defineExtension("scanForBracket",(function(e,t,r,n){return o(this,e,t,r,n)}))},"object"==typeof r&&"object"==typeof t?n(e("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],n):n(CodeMirror)},{"../../lib/codemirror":15}],8:[function(e,t,r){var n;n=function(e){"use strict";e.registerHelper("fold","brace",(function(t,r){var n,i=r.line,o=t.getLine(i);function s(s){for(var a=r.ch,l=0;;){var u=a<=0?-1:o.lastIndexOf(s,a-1);if(-1!=u){if(1==l&&u<r.ch)break;if(n=t.getTokenTypeAt(e.Pos(i,u+1)),!/^(comment|string)/.test(n))return u+1;a=u-1}else{if(1==l)break;l=1,a=o.length}}}var a="{",l="}",u=s("{");if(null==u&&(a="[",l="]",u=s("[")),null!=u){var c,p,d=1,f=t.lastLine();e:for(var h=i;h<=f;++h)for(var g=t.getLine(h),m=h==i?u:0;;){var E=g.indexOf(a,m),v=g.indexOf(l,m);if(E<0&&(E=g.length),v<0&&(v=g.length),(m=Math.min(E,v))==g.length)break;if(t.getTokenTypeAt(e.Pos(h,m+1))==n)if(m==E)++d;else if(!--d){c=h,p=m;break e}++m}if(null!=c&&(i!=c||p!=u))return{from:e.Pos(i,u),to:e.Pos(c,p)}}})),e.registerHelper("fold","import",(function(t,r){function n(r){if(r<t.firstLine()||r>t.lastLine())return null;var n=t.getTokenAt(e.Pos(r,1));if(/\S/.test(n.string)||(n=t.getTokenAt(e.Pos(r,n.end+1))),"keyword"!=n.type||"import"!=n.string)return null;for(var i=r,o=Math.min(t.lastLine(),r+10);i<=o;++i){var s=t.getLine(i).indexOf(";");if(-1!=s)return{startCh:n.end,end:e.Pos(i,s)}}}var i,o=r.line,s=n(o);if(!s||n(o-1)||(i=n(o-2))&&i.end.line==o-1)return null;for(var a=s.end;;){var l=n(a.line+1);if(null==l)break;a=l.end}return{from:t.clipPos(e.Pos(o,s.startCh+1)),to:a}})),e.registerHelper("fold","include",(function(t,r){function n(r){if(r<t.firstLine()||r>t.lastLine())return null;var n=t.getTokenAt(e.Pos(r,1));return/\S/.test(n.string)||(n=t.getTokenAt(e.Pos(r,n.end+1))),"meta"==n.type&&"#include"==n.string.slice(0,8)?n.start+8:void 0}var i=r.line,o=n(i);if(null==o||null!=n(i-1))return null;for(var s=i;null!=n(s+1);)++s;return{from:e.Pos(i,o+1),to:t.clipPos(e.Pos(s))}}))},"object"==typeof r&&"object"==typeof t?n(e("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],n):n(CodeMirror)},{"../../lib/codemirror":15}],9:[function(e,t,r){var n;n=function(e){"use strict";function t(t,r,i,o){if(i&&i.call){var s=i;i=null}else s=n(t,i,"rangeFinder");"number"==typeof r&&(r=e.Pos(r,0));var a=n(t,i,"minFoldSize");function l(e){var n=s(t,r);if(!n||n.to.line-n.from.line<a)return null;for(var i=t.findMarksAt(n.from),l=0;l<i.length;++l)if(i[l].__isFold&&"fold"!==o){if(!e)return null;n.cleared=!0,i[l].clear()}return n}var u=l(!0);if(n(t,i,"scanUp"))for(;!u&&r.line>t.firstLine();)r=e.Pos(r.line-1,0),u=l(!1);if(u&&!u.cleared&&"unfold"!==o){var c=function(e,t){var r=n(e,t,"widget");if("string"==typeof r){var i=document.createTextNode(r);(r=document.createElement("span")).appendChild(i),r.className="CodeMirror-foldmarker"}return r}(t,i);e.on(c,"mousedown",(function(t){p.clear(),e.e_preventDefault(t)}));var p=t.markText(u.from,u.to,{replacedWith:c,clearOnEnter:n(t,i,"clearOnEnter"),__isFold:!0});p.on("clear",(function(r,n){e.signal(t,"unfold",t,r,n)})),e.signal(t,"fold",t,u.from,u.to)}}e.newFoldFunction=function(e,r){return function(n,i){t(n,i,{rangeFinder:e,widget:r})}},e.defineExtension("foldCode",(function(e,r,n){t(this,e,r,n)})),e.defineExtension("isFolded",(function(e){for(var t=this.findMarksAt(e),r=0;r<t.length;++r)if(t[r].__isFold)return!0})),e.commands.toggleFold=function(e){e.foldCode(e.getCursor())},e.commands.fold=function(e){e.foldCode(e.getCursor(),null,"fold")},e.commands.unfold=function(e){e.foldCode(e.getCursor(),null,"unfold")},e.commands.foldAll=function(t){t.operation((function(){for(var r=t.firstLine(),n=t.lastLine();r<=n;r++)t.foldCode(e.Pos(r,0),null,"fold")}))},e.commands.unfoldAll=function(t){t.operation((function(){for(var r=t.firstLine(),n=t.lastLine();r<=n;r++)t.foldCode(e.Pos(r,0),null,"unfold")}))},e.registerHelper("fold","combine",(function(){var e=Array.prototype.slice.call(arguments,0);return function(t,r){for(var n=0;n<e.length;++n){var i=e[n](t,r);if(i)return i}}})),e.registerHelper("fold","auto",(function(e,t){for(var r=e.getHelpers(t,"fold"),n=0;n<r.length;n++){var i=r[n](e,t);if(i)return i}}));var r={rangeFinder:e.fold.auto,widget:"↔",minFoldSize:0,scanUp:!1,clearOnEnter:!0};function n(e,t,n){if(t&&void 0!==t[n])return t[n];var i=e.options.foldOptions;return i&&void 0!==i[n]?i[n]:r[n]}e.defineOption("foldOptions",null),e.defineExtension("foldOption",(function(e,t){return n(this,e,t)}))},"object"==typeof r&&"object"==typeof t?n(e("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],n):n(CodeMirror)},{"../../lib/codemirror":15}],10:[function(e,t,r){var n;n=function(e){"use strict";e.defineOption("foldGutter",!1,(function(t,n,i){var o;i&&i!=e.Init&&(t.clearGutter(t.state.foldGutter.options.gutter),t.state.foldGutter=null,t.off("gutterClick",a),t.off("change",l),t.off("viewportChange",u),t.off("fold",c),t.off("unfold",c),t.off("swapDoc",l)),n&&(t.state.foldGutter=new r((!0===(o=n)&&(o={}),null==o.gutter&&(o.gutter="CodeMirror-foldgutter"),null==o.indicatorOpen&&(o.indicatorOpen="CodeMirror-foldgutter-open"),null==o.indicatorFolded&&(o.indicatorFolded="CodeMirror-foldgutter-folded"),o)),s(t),t.on("gutterClick",a),t.on("change",l),t.on("viewportChange",u),t.on("fold",c),t.on("unfold",c),t.on("swapDoc",l))}));var t=e.Pos;function r(e){this.options=e,this.from=this.to=0}function n(e,r){for(var n=e.findMarks(t(r,0),t(r+1,0)),i=0;i<n.length;++i)if(n[i].__isFold&&n[i].find().from.line==r)return n[i]}function i(e){if("string"==typeof e){var t=document.createElement("div");return t.className=e+" CodeMirror-guttermarker-subtle",t}return e.cloneNode(!0)}function o(e,r,o){var s=e.state.foldGutter.options,a=r,l=e.foldOption(s,"minFoldSize"),u=e.foldOption(s,"rangeFinder");e.eachLine(r,o,(function(r){var o=null;if(n(e,a))o=i(s.indicatorFolded);else{var c=t(a,0),p=u&&u(e,c);p&&p.to.line-p.from.line>=l&&(o=i(s.indicatorOpen))}e.setGutterMarker(r,s.gutter,o),++a}))}function s(e){var t=e.getViewport(),r=e.state.foldGutter;r&&(e.operation((function(){o(e,t.from,t.to)})),r.from=t.from,r.to=t.to)}function a(e,r,i){var o=e.state.foldGutter;if(o){var s=o.options;if(i==s.gutter){var a=n(e,r);a?a.clear():e.foldCode(t(r,0),s.rangeFinder)}}}function l(e){var t=e.state.foldGutter;if(t){var r=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout((function(){s(e)}),r.foldOnChangeTimeSpan||600)}}function u(e){var t=e.state.foldGutter;if(t){var r=t.options;clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout((function(){var r=e.getViewport();t.from==t.to||r.from-t.to>20||t.from-r.to>20?s(e):e.operation((function(){r.from<t.from&&(o(e,r.from,t.from),t.from=r.from),r.to>t.to&&(o(e,t.to,r.to),t.to=r.to)}))}),r.updateViewportTimeSpan||400)}}function c(e,t){var r=e.state.foldGutter;if(r){var n=t.line;n>=r.from&&n<r.to&&o(e,n,n+1)}}},"object"==typeof r&&"object"==typeof t?n(e("../../lib/codemirror"),e("./foldcode")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./foldcode"],n):n(CodeMirror)},{"../../lib/codemirror":15,"./foldcode":9}],11:[function(e,t,r){var n;n=function(e){"use strict";var t=e.Pos,r="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",n=new RegExp("<(/?)(["+r+"][A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*)","g");function i(e,t,r,n){this.line=t,this.ch=r,this.cm=e,this.text=e.getLine(t),this.min=n?n.from:e.firstLine(),this.max=n?n.to-1:e.lastLine()}function o(e,r){var n=e.cm.getTokenTypeAt(t(e.line,r));return n&&/\btag\b/.test(n)}function s(e){if(!(e.line>=e.max))return e.ch=0,e.text=e.cm.getLine(++e.line),!0}function a(e){if(!(e.line<=e.min))return e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0}function l(e){for(;;){var t=e.text.indexOf(">",e.ch);if(-1==t){if(s(e))continue;return}if(o(e,t+1)){var r=e.text.lastIndexOf("/",t),n=r>-1&&!/\S/.test(e.text.slice(r+1,t));return e.ch=t+1,n?"selfClose":"regular"}e.ch=t+1}}function u(e){for(;;){var t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(-1==t){if(a(e))continue;return}if(o(e,t+1)){n.lastIndex=t,e.ch=t;var r=n.exec(e.text);if(r&&r.index==t)return r}else e.ch=t}}function c(e){for(;;){n.lastIndex=e.ch;var t=n.exec(e.text);if(!t){if(s(e))continue;return}if(o(e,t.index+1))return e.ch=t.index+t[0].length,t;e.ch=t.index+1}}function p(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==t){if(a(e))continue;return}if(o(e,t+1)){var r=e.text.lastIndexOf("/",t),n=r>-1&&!/\S/.test(e.text.slice(r+1,t));return e.ch=t+1,n?"selfClose":"regular"}e.ch=t}}function d(e,r){for(var n=[];;){var i,o=c(e),s=e.line,a=e.ch-(o?o[0].length:0);if(!o||!(i=l(e)))return;if("selfClose"!=i)if(o[1]){for(var u=n.length-1;u>=0;--u)if(n[u]==o[2]){n.length=u;break}if(u<0&&(!r||r==o[2]))return{tag:o[2],from:t(s,a),to:t(e.line,e.ch)}}else n.push(o[2])}}function f(e,r){for(var n=[];;){var i=p(e);if(!i)return;if("selfClose"!=i){var o=e.line,s=e.ch,a=u(e);if(!a)return;if(a[1])n.push(a[2]);else{for(var l=n.length-1;l>=0;--l)if(n[l]==a[2]){n.length=l;break}if(l<0&&(!r||r==a[2]))return{tag:a[2],from:t(e.line,e.ch),to:t(o,s)}}}else u(e)}}e.registerHelper("fold","xml",(function(e,r){for(var n=new i(e,r.line,0);;){var o,s=c(n);if(!s||n.line!=r.line||!(o=l(n)))return;if(!s[1]&&"selfClose"!=o){var a=t(n.line,n.ch),u=d(n,s[2]);return u&&{from:a,to:u.from}}}})),e.findMatchingTag=function(e,r,n){var o=new i(e,r.line,r.ch,n);if(-1!=o.text.indexOf(">")||-1!=o.text.indexOf("<")){var s=l(o),a=s&&t(o.line,o.ch),c=s&&u(o);if(s&&c&&(h=r,!(((p=o).line-h.line||p.ch-h.ch)>0))){var p,h,g={from:t(o.line,o.ch),to:a,tag:c[2]};return"selfClose"==s?{open:g,close:null,at:"open"}:c[1]?{open:f(o,c[2]),close:g,at:"close"}:{open:g,close:d(o=new i(e,a.line,a.ch,n),c[2]),at:"open"}}}},e.findEnclosingTag=function(e,t,r){for(var n=new i(e,t.line,t.ch,r);;){var o=f(n);if(!o)break;var s=d(new i(e,t.line,t.ch,r),o.tag);if(s)return{open:o,close:s}}},e.scanForClosingTag=function(e,t,r,n){return d(new i(e,t.line,t.ch,n?{from:0,to:n}:null),r)}},"object"==typeof r&&"object"==typeof t?n(e("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],n):n(CodeMirror)},{"../../lib/codemirror":15}],12:[function(e,t,r){var n;n=function(e){"use strict";function t(e,t){this.cm=e,this.options=t,this.widget=null,this.debounce=0,this.tick=0,this.startPos=this.cm.getCursor("start"),this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length;var r=this;e.on("cursorActivity",this.activityFunc=function(){r.cursorActivity()})}e.showHint=function(e,t,r){if(!t)return e.showHint(r);r&&r.async&&(t.async=!0);var n={hint:t};if(r)for(var i in r)n[i]=r[i];return e.showHint(n)},e.defineExtension("showHint",(function(r){r=function(e,t,r){var n=e.options.hintOptions,i={};for(var o in l)i[o]=l[o];if(n)for(var o in n)void 0!==n[o]&&(i[o]=n[o]);if(r)for(var o in r)void 0!==r[o]&&(i[o]=r[o]);return i.hint.resolve&&(i.hint=i.hint.resolve(e,t)),i}(this,this.getCursor("start"),r);var n=this.listSelections();if(!(n.length>1)){if(this.somethingSelected()){if(!r.hint.supportsSelection)return;for(var i=0;i<n.length;i++)if(n[i].head.line!=n[i].anchor.line)return}this.state.completionActive&&this.state.completionActive.close();var o=this.state.completionActive=new t(this,r);o.options.hint&&(e.signal(this,"startCompletion",this),o.update(!0))}}));var r=window.requestAnimationFrame||function(e){return setTimeout(e,1e3/60)},n=window.cancelAnimationFrame||clearTimeout;function i(e){return"string"==typeof e?e:e.text}function o(e,t){for(;t&&t!=e;){if("LI"===t.nodeName.toUpperCase()&&t.parentNode==e)return t;t=t.parentNode}}function s(t,r){this.completion=t,this.data=r,this.picked=!1;var n=this,s=t.cm,a=this.hints=document.createElement("ul");a.className="CodeMirror-hints",this.selectedHint=r.selectedHint||0;for(var l=r.list,u=0;u<l.length;++u){var c=a.appendChild(document.createElement("li")),p=l[u],d="CodeMirror-hint"+(u!=this.selectedHint?"":" CodeMirror-hint-active");null!=p.className&&(d=p.className+" "+d),c.className=d,p.render?p.render(c,r,p):c.appendChild(document.createTextNode(p.displayText||i(p))),c.hintId=u}var f=s.cursorCoords(t.options.alignWithWord?r.from:null),h=f.left,g=f.bottom,m=!0;a.style.left=h+"px",a.style.top=g+"px";var E=window.innerWidth||Math.max(document.body.offsetWidth,document.documentElement.offsetWidth),v=window.innerHeight||Math.max(document.body.offsetHeight,document.documentElement.offsetHeight);(t.options.container||document.body).appendChild(a);var x=a.getBoundingClientRect(),y=x.bottom-v,T=a.scrollHeight>a.clientHeight+1,C=s.getScrollInfo();if(y>0){var N=x.bottom-x.top;if(f.top-(f.bottom-x.top)-N>0)a.style.top=(g=f.top-N)+"px",m=!1;else if(N>v){a.style.height=v-5+"px",a.style.top=(g=f.bottom-x.top)+"px";var I=s.getCursor();r.from.ch!=I.ch&&(f=s.cursorCoords(I),a.style.left=(h=f.left)+"px",x=a.getBoundingClientRect())}}var S,L=x.right-E;if(L>0&&(x.right-x.left>E&&(a.style.width=E-5+"px",L-=x.right-x.left-E),a.style.left=(h=f.left-L)+"px"),T)for(var A=a.firstChild;A;A=A.nextSibling)A.style.paddingRight=s.display.nativeBarWidth+"px";return s.addKeyMap(this.keyMap=function(e,t){var r={Up:function(){t.moveFocus(-1)},Down:function(){t.moveFocus(1)},PageUp:function(){t.moveFocus(1-t.menuSize(),!0)},PageDown:function(){t.moveFocus(t.menuSize()-1,!0)},Home:function(){t.setFocus(0)},End:function(){t.setFocus(t.length-1)},Enter:t.pick,Tab:t.pick,Esc:t.close},n=e.options.customKeys,i=n?{}:r;function o(e,n){var o;o="string"!=typeof n?function(e){return n(e,t)}:r.hasOwnProperty(n)?r[n]:n,i[e]=o}if(n)for(var s in n)n.hasOwnProperty(s)&&o(s,n[s]);var a=e.options.extraKeys;if(a)for(var s in a)a.hasOwnProperty(s)&&o(s,a[s]);return i}(t,{moveFocus:function(e,t){n.changeActive(n.selectedHint+e,t)},setFocus:function(e){n.changeActive(e)},menuSize:function(){return n.screenAmount()},length:l.length,close:function(){t.close()},pick:function(){n.pick()},data:r})),t.options.closeOnUnfocus&&(s.on("blur",this.onBlur=function(){S=setTimeout((function(){t.close()}),100)}),s.on("focus",this.onFocus=function(){clearTimeout(S)})),s.on("scroll",this.onScroll=function(){var e=s.getScrollInfo(),r=s.getWrapperElement().getBoundingClientRect(),n=g+C.top-e.top,i=n-(window.pageYOffset||(document.documentElement||document.body).scrollTop);if(m||(i+=a.offsetHeight),i<=r.top||i>=r.bottom)return t.close();a.style.top=n+"px",a.style.left=h+C.left-e.left+"px"}),e.on(a,"dblclick",(function(e){var t=o(a,e.target||e.srcElement);t&&null!=t.hintId&&(n.changeActive(t.hintId),n.pick())})),e.on(a,"click",(function(e){var r=o(a,e.target||e.srcElement);r&&null!=r.hintId&&(n.changeActive(r.hintId),t.options.completeOnSingleClick&&n.pick())})),e.on(a,"mousedown",(function(){setTimeout((function(){s.focus()}),20)})),e.signal(r,"select",l[0],a.firstChild),!0}function a(e,t,r,n){if(e.async)e(t,n,r);else{var i=e(t,r);i&&i.then?i.then(n):n(i)}}t.prototype={close:function(){this.active()&&(this.cm.state.completionActive=null,this.tick=null,this.cm.off("cursorActivity",this.activityFunc),this.widget&&this.data&&e.signal(this.data,"close"),this.widget&&this.widget.close(),e.signal(this.cm,"endCompletion",this.cm))},active:function(){return this.cm.state.completionActive==this},pick:function(t,r){var n=t.list[r];n.hint?n.hint(this.cm,t,n):this.cm.replaceRange(i(n),n.from||t.from,n.to||t.to,"complete"),e.signal(t,"pick",n),this.close()},cursorActivity:function(){this.debounce&&(n(this.debounce),this.debounce=0);var e=this.cm.getCursor(),t=this.cm.getLine(e.line);if(e.line!=this.startPos.line||t.length-e.ch!=this.startLen-this.startPos.ch||e.ch<this.startPos.ch||this.cm.somethingSelected()||e.ch&&this.options.closeCharacters.test(t.charAt(e.ch-1)))this.close();else{var i=this;this.debounce=r((function(){i.update()})),this.widget&&this.widget.disable()}},update:function(e){if(null!=this.tick){var t=this,r=++this.tick;a(this.options.hint,this.cm,this.options,(function(n){t.tick==r&&t.finishUpdate(n,e)}))}},finishUpdate:function(t,r){this.data&&e.signal(this.data,"update");var n,i,o=this.widget&&this.widget.picked||r&&this.options.completeSingle;this.widget&&this.widget.close(),t&&this.data&&(n=this.data,i=t,e.cmpPos(i.from,n.from)>0&&n.to.ch-n.from.ch!=i.to.ch-i.from.ch)||(this.data=t,t&&t.list.length&&(o&&1==t.list.length?this.pick(t,0):(this.widget=new s(this,t),e.signal(t,"shown"))))}},s.prototype={close:function(){if(this.completion.widget==this){this.completion.widget=null,this.hints.parentNode.removeChild(this.hints),this.completion.cm.removeKeyMap(this.keyMap);var e=this.completion.cm;this.completion.options.closeOnUnfocus&&(e.off("blur",this.onBlur),e.off("focus",this.onFocus)),e.off("scroll",this.onScroll)}},disable:function(){this.completion.cm.removeKeyMap(this.keyMap);var e=this;this.keyMap={Enter:function(){e.picked=!0}},this.completion.cm.addKeyMap(this.keyMap)},pick:function(){this.completion.pick(this.data,this.selectedHint)},changeActive:function(t,r){if(t>=this.data.list.length?t=r?this.data.list.length-1:0:t<0&&(t=r?0:this.data.list.length-1),this.selectedHint!=t){var n=this.hints.childNodes[this.selectedHint];n.className=n.className.replace(" CodeMirror-hint-active",""),(n=this.hints.childNodes[this.selectedHint=t]).className+=" CodeMirror-hint-active",n.offsetTop<this.hints.scrollTop?this.hints.scrollTop=n.offsetTop-3:n.offsetTop+n.offsetHeight>this.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=n.offsetTop+n.offsetHeight-this.hints.clientHeight+3),e.signal(this.data,"select",this.data.list[this.selectedHint],n)}},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1}},e.registerHelper("hint","auto",{resolve:function(t,r){var n,i=t.getHelpers(r,"hint");if(i.length){var o=function(e,t,r){var n=function(e,t){if(!e.somethingSelected())return t;for(var r=[],n=0;n<t.length;n++)t[n].supportsSelection&&r.push(t[n]);return r}(e,i);!function i(o){if(o==n.length)return t(null);a(n[o],e,r,(function(e){e&&e.list.length>0?t(e):i(o+1)}))}(0)};return o.async=!0,o.supportsSelection=!0,o}return(n=t.getHelper(t.getCursor(),"hintWords"))?function(t){return e.hint.fromList(t,{words:n})}:e.hint.anyword?function(t,r){return e.hint.anyword(t,r)}:function(){}}}),e.registerHelper("hint","fromList",(function(t,r){var n=t.getCursor(),i=t.getTokenAt(n),o=e.Pos(n.line,i.end);if(i.string&&/\w/.test(i.string[i.string.length-1]))var s=i.string,a=e.Pos(n.line,i.start);else s="",a=o;for(var l=[],u=0;u<r.words.length;u++){var c=r.words[u];c.slice(0,s.length)==s&&l.push(c)}if(l.length)return{list:l,from:a,to:o}})),e.commands.autocomplete=e.showHint;var l={hint:e.hint.auto,completeSingle:!0,alignWithWord:!0,closeCharacters:/[\s()\[\]{};:>,]/,closeOnUnfocus:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null};e.defineOption("hintOptions",null)},"object"==typeof r&&"object"==typeof t?n(e("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],n):n(CodeMirror)},{"../../lib/codemirror":15}],13:[function(e,t,r){var n;n=function(e){"use strict";e.runMode=function(t,r,n,i){var o=e.getMode(e.defaults,r),s=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<9);if(n.appendChild){var a=i&&i.tabSize||e.defaults.tabSize,l=n,u=0;l.innerHTML="",n=function(e,t){if("\n"==e)return l.appendChild(document.createTextNode(s?"\r":e)),void(u=0);for(var r="",n=0;;){var i=e.indexOf("\t",n);if(-1==i){r+=e.slice(n),u+=e.length-n;break}u+=i-n,r+=e.slice(n,i);var o=a-u%a;u+=o;for(var c=0;c<o;++c)r+=" ";n=i+1}if(t){var p=l.appendChild(document.createElement("span"));p.className="cm-"+t.replace(/ +/g," cm-"),p.appendChild(document.createTextNode(r))}else l.appendChild(document.createTextNode(r))}}for(var c=e.splitLines(t),p=i&&i.state||e.startState(o),d=0,f=c.length;d<f;++d){d&&n("\n");var h=new e.StringStream(c[d]);for(!h.string&&o.blankLine&&o.blankLine(p);!h.eol();){var g=o.token(h,p);n(h.current(),g,d,h.start,p),h.start=h.pos}}}},"object"==typeof r&&"object"==typeof t?n(e("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],n):n(CodeMirror)},{"../../lib/codemirror":15}],14:[function(e,t,r){var n;n=function(e){"use strict";var t=e.Pos;function r(e,r,i,o){if(this.atOccurrence=!1,this.doc=e,null==o&&"string"==typeof r&&(o=!1),i=i?e.clipPos(i):t(0,0),this.pos={from:i,to:i},"string"!=typeof r)r.global||(r=new RegExp(r.source,r.ignoreCase?"ig":"g")),this.matches=function(n,i){if(n){r.lastIndex=0;for(var o=e.getLine(i.line).slice(0,i.ch),s=0;;){r.lastIndex=s;var a=r.exec(o);if(!a)break;if(u=(l=a).index,(s=l.index+(l[0].length||1))==o.length)break}(c=l&&l[0].length||0)||(0==u&&0==o.length?l=void 0:u!=e.getLine(i.line).length&&c++)}else{r.lastIndex=i.ch,o=e.getLine(i.line);var l,u,c=(l=r.exec(o))&&l[0].length||0;(u=l&&l.index)+c==o.length||c||(c=1)}if(l&&c)return{from:t(i.line,u),to:t(i.line,u+c),match:l}};else{var s=r;o&&(r=r.toLowerCase());var a=o?function(e){return e.toLowerCase()}:function(e){return e},l=r.split("\n");if(1==l.length)r.length?this.matches=function(i,o){if(i){var l=e.getLine(o.line).slice(0,o.ch);if((c=(u=a(l)).lastIndexOf(r))>-1)return c=n(l,u,c),{from:t(o.line,c),to:t(o.line,c+s.length)}}else{var u,c;if(l=e.getLine(o.line).slice(o.ch),(c=(u=a(l)).indexOf(r))>-1)return c=n(l,u,c)+o.ch,{from:t(o.line,c),to:t(o.line,c+s.length)}}}:this.matches=function(){};else{var u=s.split("\n");this.matches=function(r,n){var i,o=l.length-1;if(r){if(n.line-(l.length-1)<e.firstLine())return;if(a(e.getLine(n.line).slice(0,u[o].length))!=l[l.length-1])return;for(var s=t(n.line,u[o].length),c=n.line-1,p=o-1;p>=1;--p,--c)if(l[p]!=a(e.getLine(c)))return;var d=(i=e.getLine(c)).length-u[0].length;if(a(i.slice(d))!=l[0])return;return{from:t(c,d),to:s}}if(!(n.line+(l.length-1)>e.lastLine())&&(d=(i=e.getLine(n.line)).length-u[0].length,a(i.slice(d))==l[0])){var f=t(n.line,d);for(c=n.line+1,p=1;p<o;++p,++c)if(l[p]!=a(e.getLine(c)))return;if(a(e.getLine(c).slice(0,u[o].length))==l[o])return{from:f,to:t(c,u[o].length)}}}}}}function n(e,t,r){if(e.length==t.length)return r;for(var n=Math.min(r,e.length);;){var i=e.slice(0,n).toLowerCase().length;if(i<r)++n;else{if(!(i>r))return n;--n}}}r.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(e){var r=this,n=this.doc.clipPos(e?this.pos.from:this.pos.to);function i(e){var n=t(e,0);return r.pos={from:n,to:n},r.atOccurrence=!1,!1}for(;;){if(this.pos=this.matches(e,n))return this.atOccurrence=!0,this.pos.match||!0;if(e){if(!n.line)return i(0);n=t(n.line-1,this.doc.getLine(n.line-1).length)}else{var o=this.doc.lineCount();if(n.line==o-1)return i(o);n=t(n.line+1,0)}}},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(r,n){if(this.atOccurrence){var i=e.splitLines(r);this.doc.replaceRange(i,this.pos.from,this.pos.to,n),this.pos.to=t(this.pos.from.line+i.length-1,i[i.length-1].length+(1==i.length?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",(function(e,t,n){return new r(this.doc,e,t,n)})),e.defineDocExtension("getSearchCursor",(function(e,t,n){return new r(this,e,t,n)})),e.defineExtension("selectMatches",(function(t,r){for(var n=[],i=this.getSearchCursor(t,this.getCursor("from"),r);i.findNext()&&!(e.cmpPos(i.to(),this.getCursor("to"))>0);)n.push({anchor:i.from(),head:i.to()});n.length&&this.setSelections(n,0)}))},"object"==typeof r&&"object"==typeof t?n(e("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],n):n(CodeMirror)},{"../../lib/codemirror":15}],15:[function(e,t,r){!function(e){if("object"==typeof r&&"object"==typeof t)t.exports=e();else{if("function"==typeof define&&define.amd)return define([],e);(this||window).CodeMirror=e()}}((function(){"use strict";var e=navigator.userAgent,t=navigator.platform,r=/gecko\/\d/i.test(e),n=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=n||i,s=o&&(n?document.documentMode||6:i[1]),a=/WebKit\//.test(e),l=a&&/Qt\/\d+\.\d+/.test(e),u=/Chrome\//.test(e),c=/Opera\//.test(e),p=/Apple Computer/.test(navigator.vendor),d=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),f=/PhantomJS/.test(e),h=/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),g=h||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),m=h||/Mac/.test(t),E=/\bCrOS\b/.test(e),v=/win/i.test(t),x=c&&e.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(c=!1,a=!0);var y=m&&(l||c&&(null==x||x<12.11)),T=r||o&&s>=9,C=!1,N=!1;function I(e,t){if(!(this instanceof I))return new I(e,t);this.options=t=t?Co(t):{},Co(Jr,t,!1),M(t);var r=t.value;"string"==typeof r&&(r=new Ei(r,t.mode,null,t.lineSeparator)),this.doc=r;var n=new I.inputStyles[t.inputStyle](this),i=this.display=new S(e,r,n);i.wrapper.CodeMirror=this,P(this),O(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),t.autofocus&&!g&&i.input.focus(),B(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new co,keySeq:null,specialChars:null};var l=this;for(var u in o&&s<11&&setTimeout((function(){l.display.input.reset(!0)}),20),function(e){var t=e.display;zi(t.scroller,"mousedown",Yt(e,cr)),zi(t.scroller,"dblclick",o&&s<11?Yt(e,(function(t){if(!to(e,t)){var r=ur(e,t);if(r&&!dr(e,t)&&!lr(e.display,t)){ji(t);var n=e.findWordAt(r);je(e.doc,n.anchor,n.head)}}})):function(t){to(e,t)||ji(t)}),T||zi(t.scroller,"contextmenu",(function(t){Pr(e,t)}));var r,n={end:0};function i(){t.activeTouch&&(r=setTimeout((function(){t.activeTouch=null}),1e3),(n=t.activeTouch).end=+new Date)}function a(e,t){if(null==t.left)return!0;var r=t.left-e.left,n=t.top-e.top;return r*r+n*n>400}zi(t.scroller,"touchstart",(function(i){if(!to(e,i)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(i)){clearTimeout(r);var o=+new Date;t.activeTouch={start:o,moved:!1,prev:o-n.end<=300?n:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}})),zi(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),zi(t.scroller,"touchend",(function(r){var n=t.activeTouch;if(n&&!lr(t,r)&&null!=n.left&&!n.moved&&new Date-n.start<300){var o,s=e.coordsChar(t.activeTouch,"page");o=!n.prev||a(n,n.prev)?new De(s,s):!n.prev.prev||a(n,n.prev.prev)?e.findWordAt(s):new De(fe(s.line,0),Fe(e.doc,fe(s.line+1,0))),e.setSelection(o.anchor,o.head),e.focus(),ji(r)}i()})),zi(t.scroller,"touchcancel",i),zi(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(mr(e,t.scroller.scrollTop),Er(e,t.scroller.scrollLeft,!0),Ki(e,"scroll",e))})),zi(t.scroller,"mousewheel",(function(t){Tr(e,t)})),zi(t.scroller,"DOMMouseScroll",(function(t){Tr(e,t)})),zi(t.wrapper,"scroll",(function(){t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){to(e,t)||qi(t)},over:function(t){to(e,t)||(function(e,t){var r=ur(e,t);if(r){var n=document.createDocumentFragment();rt(e,r,n),e.display.dragCursor||(e.display.dragCursor=wo("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),Do(e.display.dragCursor,n)}}(e,t),qi(t))},start:function(t){!function(e,t){if(o&&(!e.state.draggingText||+new Date-fr<100))qi(t);else if(!to(e,t)&&!lr(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!p)){var r=wo("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",c&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),c&&r.parentNode.removeChild(r)}}(e,t)},drop:Yt(e,hr),leave:function(t){to(e,t)||gr(e)}};var l=t.input.getField();zi(l,"keyup",(function(t){br.call(e,t)})),zi(l,"keydown",Yt(e,Ar)),zi(l,"keypress",Yt(e,Rr)),zi(l,"focus",No(Or,e)),zi(l,"blur",No(wr,e))}(this),function(){var e;Ho||(zi(window,"resize",(function(){null==e&&(e=setTimeout((function(){e=null,Bo(ar)}),100))})),zi(window,"blur",(function(){Bo(wr)})),Ho=!0)}(),Vt(this),this.curOp.forceUpdate=!0,Ti(this,r),t.autofocus&&!g||l.hasFocus()?setTimeout(No(Or,this),20):wr(this),en)en.hasOwnProperty(u)&&en[u](this,t[u],rn);$(this),t.finishInit&&t.finishInit(this);for(var d=0;d<an.length;++d)an[d](this);Ht(this),a&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(i.lineDiv).textRendering&&(i.lineDiv.style.textRendering="auto")}function S(e,t,n){var i=this;this.input=n,i.scrollbarFiller=wo("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=wo("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=wo("div",null,"CodeMirror-code"),i.selectionDiv=wo("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=wo("div",null,"CodeMirror-cursors"),i.measure=wo("div",null,"CodeMirror-measure"),i.lineMeasure=wo("div",null,"CodeMirror-measure"),i.lineSpace=wo("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none"),i.mover=wo("div",[wo("div",[i.lineSpace],"CodeMirror-lines")],null,"position: relative"),i.sizer=wo("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=wo("div",null,null,"position: absolute; height: "+oo+"px; width: 1px;"),i.gutters=wo("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=wo("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=wo("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),o&&s<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),a||r&&g||(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,n.init(i)}function L(e){e.doc.mode=I.getMode(e.options,e.doc.modeOption),A(e)}function A(e){e.doc.iter((function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)})),e.doc.frontier=e.doc.first,ot(e,100),e.state.modeGen++,e.curOp&&tr(e)}function b(e){var t=Mt(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/Ft(e.display)-3);return function(i){if(Hn(e.doc,i))return 0;var o=0;if(i.widgets)for(var s=0;s<i.widgets.length;s++)i.widgets[s].height&&(o+=i.widgets[s].height);return r?o+(Math.ceil(i.text.length/n)||1)*t:o+t}}function R(e){var t=e.doc,r=b(e);t.iter((function(e){var t=r(e);t!=e.height&&Si(e,t)}))}function O(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),St(e)}function w(e){P(e),tr(e),setTimeout((function(){q(e)}),20)}function P(e){var t=e.display.gutters,r=e.options.gutters;Po(t);for(var n=0;n<r.length;++n){var i=r[n],o=t.appendChild(wo("div",null,"CodeMirror-gutter "+i));"CodeMirror-linenumbers"==i&&(e.display.lineGutter=o,o.style.width=(e.display.lineNumWidth||1)+"px")}t.style.display=n?"":"none",D(e)}function D(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function _(e){if(0==e.height)return 0;for(var t,r=e.text.length,n=e;t=Fn(n);)n=(i=t.find(0,!0)).from.line,r+=i.from.ch-i.to.ch;for(n=e;t=Gn(n);){var i=t.find(0,!0);r-=n.text.length-i.from.ch,r+=(n=i.to.line).text.length-i.to.ch}return r}function k(e){var t=e.display,r=e.doc;t.maxLine=Ci(r,r.first),t.maxLineLength=_(t.maxLine),t.maxLineChanged=!0,r.iter((function(e){var r=_(e);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)}))}function M(e){var t=vo(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 F(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+ut(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+pt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}function G(e,t,r){this.cm=r;var n=this.vert=wo("div",[wo("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=wo("div",[wo("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(n),e(i),zi(n,"scroll",(function(){n.clientHeight&&t(n.scrollTop,"vertical")})),zi(i,"scroll",(function(){i.clientWidth&&t(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,o&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function U(){}function B(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&Fo(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new I.scrollbarModel[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),zi(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,r){"horizontal"==r?Er(e,t):mr(e,t)}),e),e.display.scrollbars.addClass&&Go(e.display.wrapper,e.display.scrollbars.addClass)}function j(e,t){t||(t=F(e));var r=e.display.barWidth,n=e.display.barHeight;V(e,t);for(var i=0;i<4&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&J(e),V(e,F(e)),r=e.display.barWidth,n=e.display.barHeight}function V(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 H(e,t,r){var n=r&&null!=r.top?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-lt(e));var i=r&&null!=r.bottom?r.bottom:n+e.wrapper.clientHeight,o=Ai(t,n),s=Ai(t,i);if(r&&r.ensure){var a=r.ensure.from.line,l=r.ensure.to.line;a<o?(o=a,s=Ai(t,bi(Ci(t,a))+e.wrapper.clientHeight)):Math.min(l,t.lastLine())>=s&&(o=Ai(t,bi(Ci(t,l))-e.wrapper.clientHeight),s=l)}return{from:o,to:Math.max(s,o+1)}}function q(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=z(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",s=0;s<r.length;s++)if(!r[s].hidden){e.options.fixedGutter&&r[s].gutter&&(r[s].gutter.style.left=o);var a=r[s].alignable;if(a)for(var l=0;l<a.length;l++)a[l].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=n+i+"px")}}function $(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=W(e.options,t.first+t.size-1),n=e.display;if(r.length!=n.lineNumChars){var i=n.measure.appendChild(wo("div",[wo("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,s=i.offsetWidth-o;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(o,n.lineGutter.offsetWidth-s)+1,n.lineNumWidth=n.lineNumInnerWidth+s,n.lineNumChars=n.lineNumInnerWidth?r.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",D(e),!0}return!1}function W(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function z(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Q(e,t,r){var n=e.display;this.viewport=t,this.visible=H(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=dt(e),this.force=r,this.dims=te(e),this.events=[]}function X(e,t){var r=e.display,n=e.doc;if(t.editorIsHidden)return nr(e),!1;if(!t.force&&t.visible.from>=r.viewFrom&&t.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==sr(e))return!1;$(e)&&(nr(e),t.dims=te(e));var i=n.first+n.size,o=Math.max(t.visible.from-e.options.viewportMargin,n.first),s=Math.min(i,t.visible.to+e.options.viewportMargin);r.viewFrom<o&&o-r.viewFrom<20&&(o=Math.max(n.first,r.viewFrom)),r.viewTo>s&&r.viewTo-s<20&&(s=Math.min(i,r.viewTo)),N&&(o=jn(e.doc,o),s=Vn(e.doc,s));var l=o!=r.viewFrom||s!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;!function(e,t,r){var n=e.display;0==n.view.length||t>=n.viewTo||r<=n.viewFrom?(n.view=er(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=er(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(ir(e,t))),n.viewFrom=t,n.viewTo<r?n.view=n.view.concat(er(e,n.viewTo,r)):n.viewTo>r&&(n.view=n.view.slice(0,ir(e,r)))),n.viewTo=r}(e,o,s),r.viewOffset=bi(Ci(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var u=sr(e);if(!l&&0==u&&!t.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var c=ko();return u>4&&(r.lineDiv.style.display="none"),function(e,t,r){var n=e.display,i=e.options.lineNumbers,o=n.lineDiv,s=o.firstChild;function l(t){var r=t.nextSibling;return a&&m&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),r}for(var u=n.view,c=n.viewFrom,p=0;p<u.length;p++){var d=u[p];if(d.hidden);else if(d.node&&d.node.parentNode==o){for(;s!=d.node;)s=l(s);var f=i&&null!=t&&t<=c&&d.lineNumber;d.changes&&(vo(d.changes,"gutter")>-1&&(f=!1),re(e,d,c,r)),f&&(Po(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(W(e.options,c)))),s=d.node.nextSibling}else{var h=ue(e,d,c,r);o.insertBefore(h,s)}c+=d.size}for(;s;)s=l(s)}(e,r.updateLineNumbers,t.dims),u>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,c&&ko()!=c&&c.offsetHeight&&c.focus(),Po(r.cursorDiv),Po(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,l&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,ot(e,400)),r.updateLineNumbers=null,!0}function Y(e,t){for(var r=t.viewport,n=!0;(n&&e.options.lineWrapping&&t.oldDisplayWidth!=dt(e)||(r&&null!=r.top&&(r={top:Math.min(e.doc.height+ut(e.display)-ft(e),r.top)}),t.visible=H(e.display,e.doc,r),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&X(e,t);n=!1){J(e);var i=F(e);et(e),j(e,i),Z(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 K(e,t){var r=new Q(e,t);if(X(e,r)){J(e),Y(e,r);var n=F(e);et(e),j(e,n),Z(e,n),r.finish()}}function Z(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+pt(e)+"px"}function J(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var i,a=t.view[n];if(!a.hidden){if(o&&s<8){var l=a.node.offsetTop+a.node.offsetHeight;i=l-r,r=l}else{var u=a.node.getBoundingClientRect();i=u.bottom-u.top}var c=a.line.height-i;if(i<2&&(i=Mt(t)),(c>.001||c<-.001)&&(Si(a.line,i),ee(a.line),a.rest))for(var p=0;p<a.rest.length;p++)ee(a.rest[p])}}}function ee(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t)e.widgets[t].height=e.widgets[t].node.parentNode.offsetHeight}function te(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,o=t.gutters.firstChild,s=0;o;o=o.nextSibling,++s)r[e.options.gutters[s]]=o.offsetLeft+o.clientLeft+i,n[e.options.gutters[s]]=o.clientWidth;return{fixedPos:z(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function re(e,t,r,n){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?oe(e,t):"gutter"==o?ae(e,t,r,n):"class"==o?se(t):"widget"==o&&le(e,t,n)}t.changes=null}function ne(e){return e.node==e.text&&(e.node=wo("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),o&&s<8&&(e.node.style.zIndex=2)),e.node}function ie(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):ai(e,t)}function oe(e,t){var r=t.text.className,n=ie(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,se(t)):r&&(t.text.className=r)}function se(e){!function(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=ne(e);e.background=r.insertBefore(wo("div",null,t),r.firstChild)}}(e),e.line.wrapClass?ne(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 ae(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=ne(t);t.gutterBackground=wo("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){i=ne(t);var s=t.gutter=wo("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(s),i.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=s.appendChild(wo("div",W(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var a=0;a<e.options.gutters.length;++a){var l=e.options.gutters[a],u=o.hasOwnProperty(l)&&o[l];u&&s.appendChild(wo("div",[u],"CodeMirror-gutter-elt","left: "+n.gutterLeft[l]+"px; width: "+n.gutterWidth[l]+"px"))}}}function le(e,t,r){t.alignable&&(t.alignable=null);for(var n=t.node.firstChild;n;n=i){var i=n.nextSibling;"CodeMirror-linewidget"==n.className&&t.node.removeChild(n)}ce(e,t,r)}function ue(e,t,r,n){var i=ie(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),se(t),ae(e,t,r,n),ce(e,t,n),t.node}function ce(e,t,r){if(pe(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)pe(e,t.rest[n],t,r,!1)}function pe(e,t,r,n,i){if(t.widgets)for(var o=ne(r),s=0,a=t.widgets;s<a.length;++s){var l=a[s],u=wo("div",[l.node],"CodeMirror-linewidget");l.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),de(l,u,r,n),e.display.input.setUneditable(u),i&&l.above?o.insertBefore(u,r.gutter||r.text):o.appendChild(u),Ji(l,"redraw")}}function de(e,t,r,n){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var i=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(i-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}G.prototype=Co({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=m&&!d?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new co,this.disableVert=new co},enableZeroWidthBar:function(e,t){e.style.pointerEvents="auto",t.set(1e3,(function r(){var n=e.getBoundingClientRect();document.elementFromPoint(n.left+1,n.bottom-1)!=e?e.style.pointerEvents="none":t.set(1e3,r)}))},clear:function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)}},G.prototype),U.prototype=Co({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},U.prototype),I.scrollbarModel={native:G,null:U},Q.prototype.signal=function(e,t){no(e,t)&&this.events.push(arguments)},Q.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Ki.apply(null,this.events[e])};var fe=I.Pos=function(e,t){if(!(this instanceof fe))return new fe(e,t);this.line=e,this.ch=t},he=I.cmpPos=function(e,t){return e.line-t.line||e.ch-t.ch};function ge(e){return fe(e.line,e.ch)}function me(e,t){return he(e,t)<0?t:e}function Ee(e,t){return he(e,t)<0?e:t}function ve(e){e.state.focused||(e.display.input.focus(),Or(e))}var xe=null;function ye(e,t,r,n,i){var o=e.doc;e.display.shift=!1,n||(n=o.sel);var s=e.state.pasteIncoming||"paste"==i,a=o.splitLines(t),l=null;if(s&&n.ranges.length>1)if(xe&&xe.text.join("\n")==t){if(n.ranges.length%xe.text.length==0){l=[];for(var u=0;u<xe.text.length;u++)l.push(o.splitLines(xe.text[u]))}}else a.length==n.ranges.length&&(l=xo(a,(function(e){return[e]})));for(u=n.ranges.length-1;u>=0;u--){var c=n.ranges[u],p=c.from(),d=c.to();c.empty()&&(r&&r>0?p=fe(p.line,p.ch-r):e.state.overwrite&&!s?d=fe(d.line,Math.min(Ci(o,d.line).text.length,d.ch+mo(a).length)):xe&&xe.lineWise&&xe.text.join("\n")==t&&(p=d=fe(p.line,0)));var f=e.curOp.updateInput,h={from:p,to:d,text:l?l[u%l.length]:a,origin:i||(s?"paste":e.state.cutIncoming?"cut":"+input")};Gr(e.doc,h),Ji(e,"inputRead",e,h)}t&&!s&&Ce(e,t),Wr(e),e.curOp.updateInput=f,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function Te(e,t){var r=e.clipboardData&&e.clipboardData.getData("text/plain");if(r)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Xt(t,(function(){ye(t,r,0,null,"paste")})),!0}function Ce(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),s=!1;if(o.electricChars){for(var a=0;a<o.electricChars.length;a++)if(t.indexOf(o.electricChars.charAt(a))>-1){s=Qr(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Ci(e.doc,i.head.line).text.slice(0,i.head.ch))&&(s=Qr(e,i.head.line,"smart"));s&&Ji(e,"electricInput",e,i.head.line)}}}function Ne(e){for(var t=[],r=[],n=0;n<e.doc.sel.ranges.length;n++){var i=e.doc.sel.ranges[n].head.line,o={anchor:fe(i,0),head:fe(i+1,0)};r.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:r}}function Ie(e){e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","off"),e.setAttribute("spellcheck","false")}function Se(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new co,this.inaccurateSelection=!1,this.hasSelection=!1,this.composing=null}function Le(){var e=wo("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=wo("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return a?e.style.width="1000px":e.setAttribute("wrap","off"),h&&(e.style.border="1px solid black"),Ie(e),t}function Ae(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new co,this.gracePeriod=!1}function be(e,t){var r=mt(e,t.line);if(!r||r.hidden)return null;var n=Ci(e.doc,t.line),i=ht(r,n,t.line),o=Ri(n),s="left";o&&(s=as(o,t.ch)%2?"right":"left");var a=Tt(i.map,t.ch,s);return a.offset="right"==a.collapse?a.end:a.start,a}function Re(e,t){return t&&(e.bad=!0),e}function Oe(e,t,r){var n;if(t==e.display.lineDiv){if(!(n=e.display.lineDiv.childNodes[r]))return Re(e.clipPos(fe(e.display.viewTo-1)),!0);t=null,r=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==n)return we(o,t,r)}}function we(e,t,r){var n=e.text.firstChild,i=!1;if(!t||!_o(n,t))return Re(fe(Li(e.line),0),!0);if(t==n&&(i=!0,t=n.childNodes[r],r=0,!t)){var o=e.rest?mo(e.rest):e.line;return Re(fe(Li(o),o.text.length),i)}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!=n;)a=a.parentNode;var l=e.measure,u=l.maps;function c(t,r,n){for(var i=-1;i<(u?u.length:0);i++)for(var o=i<0?l.map:u[i],s=0;s<o.length;s+=3){var a=o[s+2];if(a==t||a==r){var c=Li(i<0?e.line:e.rest[i]),p=o[s]+n;return(n<0||a!=t)&&(p=o[s+(n?1:0)]),fe(c,p)}}}var p=c(s,a,r);if(p)return Re(p,i);for(var d=a.nextSibling,f=s?s.nodeValue.length-r:0;d;d=d.nextSibling){if(p=c(d,d.firstChild,0))return Re(fe(p.line,p.ch-f),i);f+=d.textContent.length}var h=a.previousSibling;for(f=r;h;h=h.previousSibling){if(p=c(h,h.firstChild,-1))return Re(fe(p.line,p.ch+f),i);f+=d.textContent.length}}function Pe(e,t){this.ranges=e,this.primIndex=t}function De(e,t){this.anchor=e,this.head=t}function _e(e,t){var r=e[t];e.sort((function(e,t){return he(e.from(),t.from())})),t=vo(e,r);for(var n=1;n<e.length;n++){var i=e[n],o=e[n-1];if(he(o.to(),i.from())>=0){var s=Ee(o.from(),i.from()),a=me(o.to(),i.to()),l=o.empty()?i.from()==i.head:o.from()==o.head;n<=t&&--t,e.splice(--n,2,new De(l?a:s,l?s:a))}}return new Pe(e,t)}function ke(e,t){return new Pe([new De(e,t||e)],0)}function Me(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function Fe(e,t){if(t.line<e.first)return fe(e.first,0);var r=e.first+e.size-1;return t.line>r?fe(r,Ci(e,r).text.length):function(e,t){var r=e.ch;return null==r||r>t?fe(e.line,t):r<0?fe(e.line,0):e}(t,Ci(e,t.line).text.length)}function Ge(e,t){return t>=e.first&&t<e.first+e.size}function Ue(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=Fe(e,t[n]);return r}function Be(e,t,r,n){if(e.cm&&e.cm.display.shift||e.extend){var i=t.anchor;if(n){var o=he(r,i)<0;o!=he(n,i)<0?(i=r,r=n):o!=he(r,n)<0&&(r=n)}return new De(i,r)}return new De(n||r,r)}function je(e,t,r,n){We(e,new Pe([Be(e,e.sel.primary(),t,r)],0),n)}function Ve(e,t,r){for(var n=[],i=0;i<e.sel.ranges.length;i++)n[i]=Be(e,e.sel.ranges[i],t[i],null);We(e,_e(n,e.sel.primIndex),r)}function He(e,t,r,n){var i=e.sel.ranges.slice(0);i[t]=r,We(e,_e(i,e.sel.primIndex),n)}function qe(e,t,r,n){We(e,ke(t,r),n)}function $e(e,t,r){var n=e.history.done,i=mo(n);i&&i.ranges?(n[n.length-1]=t,ze(e,t,r)):We(e,t,r)}function We(e,t,r){ze(e,t,r),function(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||function(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)}(e,o,mo(i.done),t))?i.done[i.done.length-1]=t:_i(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=r,n&&!1!==n.clearRedo&&Pi(i.undone)}(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function ze(e,t,r){(no(e,"beforeSelectionChange")||e.cm&&no(e.cm,"beforeSelectionChange"))&&(t=function(e,t,r){var n={ranges:t.ranges,update:function(t){this.ranges=[];for(var r=0;r<t.length;r++)this.ranges[r]=new De(Fe(e,t[r].anchor),Fe(e,t[r].head))},origin:r&&r.origin};return Ki(e,"beforeSelectionChange",e,n),e.cm&&Ki(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?_e(n.ranges,n.ranges.length-1):t}(e,t,r));var n=r&&r.bias||(he(t.primary().head,e.sel.primary().head)<0?-1:1);Qe(e,Ye(e,t,n,!0)),r&&!1===r.scroll||!e.cm||Wr(e.cm)}function Qe(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,ro(e.cm)),Ji(e,"cursorActivity",e))}function Xe(e){Qe(e,Ye(e,e.sel,null,!1))}function Ye(e,t,r,n){for(var i,o=0;o<t.ranges.length;o++){var s=t.ranges[o],a=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],l=Ze(e,s.anchor,a&&a.anchor,r,n),u=Ze(e,s.head,a&&a.head,r,n);(i||l!=s.anchor||u!=s.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new De(l,u))}return i?_e(i,t.primIndex):t}function Ke(e,t,r,n,i){var o=Ci(e,t.line);if(o.markedSpans)for(var s=0;s<o.markedSpans.length;++s){var a=o.markedSpans[s],l=a.marker;if((null==a.from||(l.inclusiveLeft?a.from<=t.ch:a.from<t.ch))&&(null==a.to||(l.inclusiveRight?a.to>=t.ch:a.to>t.ch))){if(i&&(Ki(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--s;continue}break}if(!l.atomic)continue;if(r){var u,c=l.find(n<0?1:-1);if((n<0?l.inclusiveRight:l.inclusiveLeft)&&(c=Je(e,c,-n,c&&c.line==t.line?o:null)),c&&c.line==t.line&&(u=he(c,r))&&(n<0?u<0:u>0))return Ke(e,c,t,n,i)}var p=l.find(n<0?-1:1);return(n<0?l.inclusiveLeft:l.inclusiveRight)&&(p=Je(e,p,n,p.line==t.line?o:null)),p?Ke(e,p,t,n,i):null}}return t}function Ze(e,t,r,n,i){var o=n||1,s=Ke(e,t,r,o,i)||!i&&Ke(e,t,r,o,!0)||Ke(e,t,r,-o,i)||!i&&Ke(e,t,r,-o,!0);return s||(e.cantEdit=!0,fe(e.first,0))}function Je(e,t,r,n){return r<0&&0==t.ch?t.line>e.first?Fe(e,fe(t.line-1)):null:r>0&&t.ch==(n||Ci(e,t.line)).text.length?t.line<e.first+e.size-1?fe(t.line+1,0):null:new fe(t.line,t.ch+r)}function et(e){e.display.input.showSelection(e.display.input.prepareSelection())}function tt(e,t){for(var r=e.doc,n={},i=n.cursors=document.createDocumentFragment(),o=n.selection=document.createDocumentFragment(),s=0;s<r.sel.ranges.length;s++)if(!1!==t||s!=r.sel.primIndex){var a=r.sel.ranges[s];if(!(a.from().line>=e.display.viewTo||a.to().line<e.display.viewFrom)){var l=a.empty();(l||e.options.showCursorWhenSelecting)&&rt(e,a.head,i),l||nt(e,a,o)}}return n}function rt(e,t,r){var n=wt(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=r.appendChild(wo("div"," ","CodeMirror-cursor"));if(i.style.left=n.left+"px",i.style.top=n.top+"px",i.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var o=r.appendChild(wo("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=n.other.left+"px",o.style.top=n.other.top+"px",o.style.height=.85*(n.other.bottom-n.other.top)+"px"}}function nt(e,t,r){var n=e.display,i=e.doc,o=document.createDocumentFragment(),s=ct(e.display),a=s.left,l=Math.max(n.sizerWidth,dt(e)-n.sizer.offsetLeft)-s.right;function u(e,t,r,n){t<0&&(t=0),t=Math.round(t),n=Math.round(n),o.appendChild(wo("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px; top: "+t+"px; width: "+(null==r?l-e:r)+"px; height: "+(n-t)+"px"))}function c(t,r,n){var o,s,c=Ci(i,t),p=c.text.length;function d(r,n){return Ot(e,fe(t,r),"div",c,n)}return function(e,t,r,n){if(!e)return n(t,r,"ltr");for(var i=!1,o=0;o<e.length;++o){var s=e[o];(s.from<r&&s.to>t||t==r&&s.to==t)&&(n(Math.max(s.from,t),Math.min(s.to,r),1==s.level?"rtl":"ltr"),i=!0)}i||n(t,r,"ltr")}(Ri(c),r||0,null==n?p:n,(function(e,t,i){var c,f,h,g=d(e,"left");if(e==t)c=g,f=h=g.left;else{if(c=d(t-1,"right"),"rtl"==i){var m=g;g=c,c=m}f=g.left,h=c.right}null==r&&0==e&&(f=a),c.top-g.top>3&&(u(f,g.top,null,g.bottom),f=a,g.bottom<c.top&&u(f,g.bottom,null,c.top)),null==n&&t==p&&(h=l),(!o||g.top<o.top||g.top==o.top&&g.left<o.left)&&(o=g),(!s||c.bottom>s.bottom||c.bottom==s.bottom&&c.right>s.right)&&(s=c),f<a+1&&(f=a),u(f,c.top,h-f,c.bottom)})),{start:o,end:s}}var p=t.from(),d=t.to();if(p.line==d.line)c(p.line,p.ch,d.ch);else{var f=Ci(i,p.line),h=Ci(i,d.line),g=Bn(f)==Bn(h),m=c(p.line,p.ch,g?f.text.length+1:null).end,E=c(d.line,g?0:null,d.ch).start;g&&(m.top<E.top-2?(u(m.right,m.top,null,m.bottom),u(a,E.top,E.left,E.bottom)):u(m.right,m.top,E.left-m.right,m.bottom)),m.bottom<E.top&&u(a,m.bottom,null,E.top)}r.appendChild(o)}function it(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval((function(){t.cursorDiv.style.visibility=(r=!r)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function ot(e,t){e.doc.mode.startState&&e.doc.frontier<e.display.viewTo&&e.state.highlight.set(t,No(st,e))}function st(e){var t=e.doc;if(t.frontier<t.first&&(t.frontier=t.first),!(t.frontier>=e.display.viewTo)){var r=+new Date+e.options.workTime,n=un(t.mode,at(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 s=o.styles,a=o.text.length>e.options.maxHighlightLength,l=ti(e,o,a?un(t.mode,n):n,!0);o.styles=l.styles;var u=o.styleClasses,c=l.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var p=!s||s.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),d=0;!p&&d<s.length;++d)p=s[d]!=o.styles[d];p&&i.push(t.frontier),o.stateAfter=a?n:un(t.mode,n)}else o.text.length<=e.options.maxHighlightLength&&ni(e,o.text,n),o.stateAfter=t.frontier%5==0?un(t.mode,n):null;if(++t.frontier,+new Date>r)return ot(e,e.options.workDelay),!0})),i.length&&Xt(e,(function(){for(var t=0;t<i.length;t++)rr(e,i[t],"text")}))}}function at(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return!0;var o=function(e,t,r){for(var n,i,o=e.doc,s=r?-1:t-(e.doc.mode.innerMode?1e3:100),a=t;a>s;--a){if(a<=o.first)return o.first;var l=Ci(o,a-1);if(l.stateAfter&&(!r||a<=o.frontier))return a;var u=po(l.text,null,e.options.tabSize);(null==i||n>u)&&(i=a-1,n=u)}return i}(e,t,r),s=o>n.first&&Ci(n,o-1).stateAfter;return s=s?un(n.mode,s):cn(n.mode),n.iter(o,t,(function(r){ni(e,r.text,s);var a=o==t-1||o%5==0||o>=i.viewFrom&&o<i.viewTo;r.stateAfter=a?un(n.mode,s):null,++o})),r&&(n.frontier=o),s}function lt(e){return e.lineSpace.offsetTop}function ut(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function ct(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=Do(e.measure,wo("pre","x")),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)};return isNaN(n.left)||isNaN(n.right)||(e.cachedPaddingH=n),n}function pt(e){return oo-e.display.nativeBarWidth}function dt(e){return e.display.scroller.clientWidth-pt(e)-e.display.barWidth}function ft(e){return e.display.scroller.clientHeight-pt(e)-e.display.barHeight}function ht(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(n=0;n<e.rest.length;n++)if(Li(e.rest[n])>r)return{map:e.measure.maps[n],cache:e.measure.caches[n],before:!0}}function gt(e,t,r,n){return vt(e,Et(e,t),r,n)}function mt(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[ir(e,t)];var r=e.display.externalMeasured;return r&&t>=r.lineN&&t<r.lineN+r.size?r:void 0}function Et(e,t){var r=Li(t),n=mt(e,r);n&&!n.text?n=null:n&&n.changes&&(re(e,n,r,te(e)),e.curOp.forceUpdate=!0),n||(n=function(e,t){var r=Li(t=Bn(t)),n=e.display.externalMeasured=new Jt(e.doc,t,r);n.lineN=r;var i=n.built=ai(e,n);return n.text=i.pre,Do(e.display.lineMeasure,i.pre),n}(e,t));var i=ht(n,t,r);return{line:t,view:n,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function vt(e,t,r,n,i){t.before&&(r=-1);var a,l=r+(n||"");return t.cache.hasOwnProperty(l)?a=t.cache[l]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(function(e,t,r){var n=e.options.lineWrapping,i=n&&dt(e);if(!t.measure.heights||n&&t.measure.width!=i){var o=t.measure.heights=[];if(n){t.measure.width=i;for(var s=t.text.firstChild.getClientRects(),a=0;a<s.length-1;a++){var l=s[a],u=s[a+1];Math.abs(l.bottom-u.bottom)>2&&o.push((l.bottom+u.top)/2-r.top)}}o.push(r.bottom-r.top)}}(e,t.view,t.rect),t.hasHeights=!0),(a=function(e,t,r,n){var i,a=Tt(t.map,r,n),l=a.node,u=a.start,c=a.end,p=a.collapse;if(3==l.nodeType){for(var d=0;d<4;d++){for(;u&&Oo(t.line.text.charAt(a.coverStart+u));)--u;for(;a.coverStart+c<a.coverEnd&&Oo(t.line.text.charAt(a.coverStart+c));)++c;if((i=o&&s<9&&0==u&&c==a.coverEnd-a.coverStart?l.parentNode.getBoundingClientRect():Ct(bo(l,u,c).getClientRects(),n)).left||i.right||0==u)break;c=u,u-=1,p="right"}o&&s<11&&(i=function(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(e){if(null!=Zo)return Zo;var t=Do(e,wo("span","x")),r=t.getBoundingClientRect(),n=bo(t,0,1).getBoundingClientRect();return Zo=Math.abs(r.left-n.left)>1}(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}(e.display.measure,i))}else{var f;u>0&&(p=n="right"),i=e.options.lineWrapping&&(f=l.getClientRects()).length>1?f["right"==n?f.length-1:0]:l.getBoundingClientRect()}if(o&&s<9&&!u&&(!i||!i.left&&!i.right)){var h=l.parentNode.getClientRects()[0];i=h?{left:h.left,right:h.left+Ft(e.display),top:h.top,bottom:h.bottom}:yt}var g=i.top-t.rect.top,m=i.bottom-t.rect.top,E=(g+m)/2,v=t.view.measure.heights;for(d=0;d<v.length-1&&!(E<v[d]);d++);var x=d?v[d-1]:0,y=v[d],T={left:("right"==p?i.right:i.left)-t.rect.left,right:("left"==p?i.left:i.right)-t.rect.left,top:x,bottom:y};return i.left||i.right||(T.bogus=!0),e.options.singleCursorHeightPerLine||(T.rtop=g,T.rbottom=m),T}(e,t,r,n)).bogus||(t.cache[l]=a)),{left:a.left,right:a.right,top:i?a.rtop:a.top,bottom:i?a.rbottom:a.bottom}}Se.prototype=Co({init:function(e){var t=this,r=this.cm,n=this.wrapper=Le(),i=this.textarea=n.firstChild;function a(e){if(!to(r,e)){if(r.somethingSelected())xe={lineWise:!1,text:r.getSelections()},t.inaccurateSelection&&(t.prevInput="",t.inaccurateSelection=!1,i.value=xe.text.join("\n"),Eo(i));else{if(!r.options.lineWiseCopyCut)return;var n=Ne(r);xe={lineWise:!0,text:n.text},"cut"==e.type?r.setSelections(n.ranges,null,ao):(t.prevInput="",i.value=n.text.join("\n"),Eo(i))}"cut"==e.type&&(r.state.cutIncoming=!0)}}e.wrapper.insertBefore(n,e.wrapper.firstChild),h&&(i.style.width="0px"),zi(i,"input",(function(){o&&s>=9&&t.hasSelection&&(t.hasSelection=null),t.poll()})),zi(i,"paste",(function(e){to(r,e)||Te(e,r)||(r.state.pasteIncoming=!0,t.fastPoll())})),zi(i,"cut",a),zi(i,"copy",a),zi(e.scroller,"paste",(function(n){lr(e,n)||to(r,n)||(r.state.pasteIncoming=!0,t.focus())})),zi(e.lineSpace,"selectstart",(function(t){lr(e,t)||ji(t)})),zi(i,"compositionstart",(function(){var e=r.getCursor("from");t.composing&&t.composing.range.clear(),t.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}})),zi(i,"compositionend",(function(){t.composing&&(t.poll(),t.composing.range.clear(),t.composing=null)}))},prepareSelection:function(){var e=this.cm,t=e.display,r=e.doc,n=tt(e);if(e.options.moveInputWithCursor){var i=wt(e,r.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),s=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+s.top-o.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+s.left-o.left))}return n},showSelection:function(e){var t=this.cm.display;Do(t.cursorDiv,e.cursors),Do(t.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 a=i.sel.primary(),l=(t=Ko&&(a.to().line-a.from().line>100||(r=n.getSelection()).length>1e3))?"-":r||n.getSelection();this.textarea.value=l,n.state.focused&&Eo(this.textarea),o&&s>=9&&(this.hasSelection=l)}else e||(this.prevInput=this.textarea.value="",o&&s>=9&&(this.hasSelection=null));this.inaccurateSelection=t}},getField:function(){return this.textarea},supportsTouch:function(){return!1},focus:function(){if("nocursor"!=this.cm.options.readOnly&&(!g||ko()!=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(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,(function r(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,r))}))},poll:function(){var e=this.cm,t=this.textarea,r=this.prevInput;if(this.contextMenuPending||!e.state.focused||Yo(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(o&&s>=9&&this.hasSelection===n||m&&/[\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 a=0,l=Math.min(r.length,n.length);a<l&&r.charCodeAt(a)==n.charCodeAt(a);)++a;var u=this;return Xt(e,(function(){ye(e,n.slice(a),r.length-a,null,u.composing?"*compose":null),n.length>1e3||n.indexOf("\n")>-1?t.value=u.prevInput="":u.prevInput=n,u.composing&&(u.composing.range.clear(),u.composing.range=e.markText(u.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},ensurePolled:function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},onKeyPress:function(){o&&s>=9&&(this.hasSelection=null),this.fastPoll()},onContextMenu:function(e){var t=this,r=t.cm,n=r.display,i=t.textarea,l=ur(r,e),u=n.scroller.scrollTop;if(l&&!c){r.options.resetSelectionOnContextMenu&&-1==r.doc.sel.contains(l)&&Yt(r,We)(r.doc,ke(l),ao);var p=i.style.cssText,d=t.wrapper.style.cssText;t.wrapper.style.cssText="position: absolute";var f=t.wrapper.getBoundingClientRect();if(i.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: "+(o?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",a)var h=window.scrollY;if(n.input.focus(),a&&window.scrollTo(null,h),n.input.reset(),r.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=!0,n.selForContextMenu=r.doc.sel,clearTimeout(n.detectingSelectAll),o&&s>=9&&m(),T){qi(e);var g=function(){Yi(window,"mouseup",g),setTimeout(E,20)};zi(window,"mouseup",g)}else setTimeout(E,50)}function m(){if(null!=i.selectionStart){var e=r.somethingSelected(),o="​"+(e?i.value:"");i.value="⇚",i.value=o,t.prevInput=e?"":"​",i.selectionStart=1,i.selectionEnd=o.length,n.selForContextMenu=r.doc.sel}}function E(){if(t.contextMenuPending=!1,t.wrapper.style.cssText=d,i.style.cssText=p,o&&s<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=u),null!=i.selectionStart){(!o||o&&s<9)&&m();var e=0,a=function(){n.selForContextMenu==r.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"​"==t.prevInput?Yt(r,pn.selectAll)(r):e++<10?n.detectingSelectAll=setTimeout(a,500):n.input.reset()};n.detectingSelectAll=setTimeout(a,200)}}},readOnlyChanged:function(e){e||this.reset()},setUneditable:yo,needsContentAttribute:!1},Se.prototype),Ae.prototype=Co({init:function(e){var t=this,r=t.cm,n=t.div=e.lineDiv;function i(e){if(!to(r,e)){if(r.somethingSelected())xe={lineWise:!1,text:r.getSelections()},"cut"==e.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var t=Ne(r);xe={lineWise:!0,text:t.text},"cut"==e.type&&r.operation((function(){r.setSelections(t.ranges,0,ao),r.replaceSelection("",null,"cut")}))}if(e.clipboardData&&!h)e.preventDefault(),e.clipboardData.clearData(),e.clipboardData.setData("text/plain",xe.text.join("\n"));else{var n=Le(),i=n.firstChild;r.display.lineSpace.insertBefore(n,r.display.lineSpace.firstChild),i.value=xe.text.join("\n");var o=document.activeElement;Eo(i),setTimeout((function(){r.display.lineSpace.removeChild(n),o.focus()}),50)}}}Ie(n),zi(n,"paste",(function(e){to(r,e)||Te(e,r)})),zi(n,"compositionstart",(function(e){var n=e.data;if(t.composing={sel:r.doc.sel,data:n,startData:n},n){var i=r.doc.sel.primary(),o=r.getLine(i.head.line).indexOf(n,Math.max(0,i.head.ch-n.length));o>-1&&o<=i.head.ch&&(t.composing.sel=ke(fe(i.head.line,o),fe(i.head.line,o+n.length)))}})),zi(n,"compositionupdate",(function(e){t.composing.data=e.data})),zi(n,"compositionend",(function(e){var r=t.composing;r&&(e.data==r.startData||/\u200b/.test(e.data)||(r.data=e.data),setTimeout((function(){r.handled||t.applyComposition(r),t.composing==r&&(t.composing=null)}),50))})),zi(n,"touchstart",(function(){t.forceCompositionEnd()})),zi(n,"input",(function(){t.composing||!r.isReadOnly()&&t.pollContent()||Xt(t.cm,(function(){tr(r)}))})),zi(n,"copy",i),zi(n,"cut",i)},prepareSelection:function(){var e=tt(this.cm,!1);return e.focus=this.cm.state.focused,e},showSelection:function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},showPrimarySelection:function(){var e=window.getSelection(),t=this.cm.doc.sel.primary(),n=Oe(this.cm,e.anchorNode,e.anchorOffset),i=Oe(this.cm,e.focusNode,e.focusOffset);if(!n||n.bad||!i||i.bad||0!=he(Ee(n,i),t.from())||0!=he(me(n,i),t.to())){var o=be(this.cm,t.from()),s=be(this.cm,t.to());if(o||s){var a=this.cm.display.view,l=e.rangeCount&&e.getRangeAt(0);if(o){if(!s){var u=a[a.length-1].measure,c=u.maps?u.maps[u.maps.length-1]:u.map;s={node:c[c.length-1],offset:c[c.length-2]-c[c.length-3]}}}else o={node:a[0].measure.map[2],offset:0};try{var p=bo(o.node,o.offset,s.offset,s.node)}catch(e){}p&&(!r&&this.cm.state.focused?(e.collapse(o.node,o.offset),p.collapsed||e.addRange(p)):(e.removeAllRanges(),e.addRange(p)),l&&null==e.anchorNode?e.addRange(l):r&&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){Do(this.cm.display.cursorDiv,e.cursors),Do(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 _o(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(){var e=this;this.selectionInEditor()?this.pollSelection():Xt(this.cm,(function(){e.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,(function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}))},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=Oe(t,e.anchorNode,e.anchorOffset),n=Oe(t,e.focusNode,e.focusOffset);r&&n&&Xt(t,(function(){We(t.doc,ke(r,n),ao),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)}))}},pollContent:function(){var e,t=this.cm,r=t.display,n=t.doc.sel.primary(),i=n.from(),o=n.to();if(i.line<r.viewFrom||o.line>r.viewTo-1)return!1;if(i.line==r.viewFrom||0==(e=ir(t,i.line)))var s=Li(r.view[0].line),a=r.view[0].node;else s=Li(r.view[e].line),a=r.view[e-1].node.nextSibling;var l=ir(t,o.line);if(l==r.view.length-1)var u=r.viewTo-1,c=r.lineDiv.lastChild;else u=Li(r.view[l+1].line)-1,c=r.view[l+1].node.previousSibling;for(var p=t.doc.splitLines(function(e,t,r,n,i){var o="",s=!1,a=e.doc.lineSeparator();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(o+=r);var u,c=t.getAttribute("cm-marker");if(c){var p=e.findMarks(fe(n,0),fe(i+1,0),(h=+c,function(e){return e.id==h}));return void(p.length&&(u=p[0].find())&&(o+=Ni(e.doc,u.from,u.to).join(a)))}if("false"==t.getAttribute("contenteditable"))return;for(var d=0;d<t.childNodes.length;d++)l(t.childNodes[d]);/^(pre|div|p)$/i.test(t.nodeName)&&(s=!0)}else if(3==t.nodeType){var f=t.nodeValue;if(!f)return;s&&(o+=a,s=!1),o+=f}var h}for(;l(t),t!=r;)t=t.nextSibling;return o}(t,a,c,s,u)),d=Ni(t.doc,fe(s,0),fe(u,Ci(t.doc,u).text.length));p.length>1&&d.length>1;)if(mo(p)==mo(d))p.pop(),d.pop(),u--;else{if(p[0]!=d[0])break;p.shift(),d.shift(),s++}for(var f=0,h=0,g=p[0],m=d[0],E=Math.min(g.length,m.length);f<E&&g.charCodeAt(f)==m.charCodeAt(f);)++f;for(var v=mo(p),x=mo(d),y=Math.min(v.length-(1==p.length?f:0),x.length-(1==d.length?f:0));h<y&&v.charCodeAt(v.length-h-1)==x.charCodeAt(x.length-h-1);)++h;p[p.length-1]=v.slice(0,v.length-h),p[0]=p[0].slice(f);var T=fe(s,f),C=fe(u,d.length?mo(d).length-h:0);return p.length>1||p[0]||he(T,C)?(Hr(t.doc,p,T,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()?Yt(this.cm,tr)(this.cm):e.data&&e.data!=e.startData&&Yt(this.cm,ye)(this.cm,e.data,0,e.sel)},setUneditable:function(e){e.contentEditable="false"},onKeyPress:function(e){e.preventDefault(),this.cm.isReadOnly()||Yt(this.cm,ye)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0)},readOnlyChanged:function(e){this.div.contentEditable=String("nocursor"!=e)},onContextMenu:yo,resetPosition:yo,needsContentAttribute:!0},Ae.prototype),I.inputStyles={textarea:Se,contenteditable:Ae},Pe.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<this.ranges.length;t++){var r=this.ranges[t],n=e.ranges[t];if(0!=he(r.anchor,n.anchor)||0!=he(r.head,n.head))return!1}return!0},deepCopy:function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new De(ge(this.ranges[t].anchor),ge(this.ranges[t].head));return new Pe(e,this.primIndex)},somethingSelected:function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},contains:function(e,t){t||(t=e);for(var r=0;r<this.ranges.length;r++){var n=this.ranges[r];if(he(t,n.from())>=0&&he(e,n.to())<=0)return r}return-1}},De.prototype={from:function(){return Ee(this.anchor,this.head)},to:function(){return me(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var xt,yt={left:0,right:0,top:0,bottom:0};function Tt(e,t,r){for(var n,i,o,s,a=0;a<e.length;a+=3){var l=e[a],u=e[a+1];if(t<l?(i=0,o=1,s="left"):t<u?o=1+(i=t-l):(a==e.length-3||t==u&&e[a+3]>t)&&(i=(o=u-l)-1,t>=u&&(s="right")),null!=i){if(n=e[a+2],l==u&&r==(n.insertLeft?"left":"right")&&(s=r),"left"==r&&0==i)for(;a&&e[a-2]==e[a-3]&&e[a-1].insertLeft;)n=e[2+(a-=3)],s="left";if("right"==r&&i==u-l)for(;a<e.length-3&&e[a+3]==e[a+4]&&!e[a+5].insertLeft;)n=e[(a+=3)+2],s="right";break}}return{node:n,start:i,end:o,collapse:s,coverStart:l,coverEnd:u}}function Ct(e,t){var r=yt;if("left"==t)for(var n=0;n<e.length&&(r=e[n]).left==r.right;n++);else for(n=e.length-1;n>=0&&(r=e[n]).left==r.right;n--);return r}function Nt(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function It(e){e.display.externalMeasure=null,Po(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Nt(e.display.view[t])}function St(e){It(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Lt(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function At(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function bt(e,t,r,n){if(t.widgets)for(var i=0;i<t.widgets.length;++i)if(t.widgets[i].above){var o=zn(t.widgets[i]);r.top+=o,r.bottom+=o}if("line"==n)return r;n||(n="local");var s=bi(t);if("local"==n?s+=lt(e.display):s-=e.display.viewOffset,"page"==n||"window"==n){var a=e.display.lineSpace.getBoundingClientRect();s+=a.top+("window"==n?0:At());var l=a.left+("window"==n?0:Lt());r.left+=l,r.right+=l}return r.top+=s,r.bottom+=s,r}function Rt(e,t,r){if("div"==r)return t;var n=t.left,i=t.top;if("page"==r)n-=Lt(),i-=At();else if("local"==r||!r){var o=e.display.sizer.getBoundingClientRect();n+=o.left,i+=o.top}var s=e.display.lineSpace.getBoundingClientRect();return{left:n-s.left,top:i-s.top}}function Ot(e,t,r,n,i){return n||(n=Ci(e.doc,t.line)),bt(e,n,gt(e,n,t.ch,i),r)}function wt(e,t,r,n,i,o){function s(t,s){var a=vt(e,i,t,s?"right":"left",o);return s?a.left=a.right:a.right=a.left,bt(e,n,a,r)}function a(e,t){var r=l[t],n=r.level%2;return e==es(r)&&t&&r.level<l[t-1].level?(e=ts(r=l[--t])-(r.level%2?0:1),n=!0):e==ts(r)&&t<l.length-1&&r.level<l[t+1].level&&(e=es(r=l[++t])-r.level%2,n=!1),n&&e==r.to&&e>r.from?s(e-1):s(e,n)}n=n||Ci(e.doc,t.line),i||(i=Et(e,n));var l=Ri(n),u=t.ch;if(!l)return s(u);var c=a(u,as(l,u));return null!=Qo&&(c.other=a(u,Qo)),c}function Pt(e,t){var r=0;t=Fe(e.doc,t),e.options.lineWrapping||(r=Ft(e.display)*t.ch);var n=Ci(e.doc,t.line),i=bi(n)+lt(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function Dt(e,t,r,n){var i=fe(e,t);return i.xRel=n,r&&(i.outside=!0),i}function _t(e,t,r){var n=e.doc;if((r+=e.display.viewOffset)<0)return Dt(n.first,0,!0,-1);var i=Ai(n,r),o=n.first+n.size-1;if(i>o)return Dt(n.first+n.size-1,Ci(n,o).text.length,!0,1);t<0&&(t=0);for(var s=Ci(n,i);;){var a=kt(e,s,i,t,r),l=Gn(s),u=l&&l.find(0,!0);if(!l||!(a.ch>u.from.ch||a.ch==u.from.ch&&a.xRel>0))return a;i=Li(s=u.to.line)}}function kt(e,t,r,n,i){var o=i-bi(t),s=!1,a=2*e.display.wrapper.clientWidth,l=Et(e,t);function u(n){var i=wt(e,fe(r,n),"line",t,l);return s=!0,o>i.bottom?i.left-a:o<i.top?i.left+a:(s=!1,i.left)}var c=Ri(t),p=t.text.length,d=rs(t),f=ns(t),h=u(d),g=s,m=u(f),E=s;if(n>m)return Dt(r,f,E,1);for(;;){if(c?f==d||f==us(t,d,1):f-d<=1){var v=n<h||n-h<=m-n?d:f,x=v==d?g:E,y=n-(v==d?h:m);if(E&&!c&&!/\s/.test(t.text.charAt(v))&&y>0&&v<t.text.length&&l.view.measure.heights.length>1){var T=vt(e,l,v,"right");o<=T.bottom&&o>=T.top&&Math.abs(n-T.right)<y&&(x=!1,v++,y=n-T.right)}for(;Oo(t.text.charAt(v));)++v;return Dt(r,v,x,y<-1?-1:y>1?1:0)}var C=Math.ceil(p/2),N=d+C;if(c){N=d;for(var I=0;I<C;++I)N=us(t,N,1)}var S=u(N);S>n?(f=N,m=S,(E=s)&&(m+=1e3),p=C):(d=N,h=S,g=s,p-=C)}}function Mt(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==xt){xt=wo("pre");for(var t=0;t<49;++t)xt.appendChild(document.createTextNode("x")),xt.appendChild(wo("br"));xt.appendChild(document.createTextNode("x"))}Do(e.measure,xt);var r=xt.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),Po(e.measure),r||1}function Ft(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=wo("span","xxxxxxxxxx"),r=wo("pre",[t]);Do(e.measure,r);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}var Gt,Ut,Bt=null,jt=0;function Vt(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:++jt},Bt?Bt.ops.push(e.curOp):e.curOp.ownsGroup=Bt={ops:[e.curOp],delayedCallbacks:[]}}function Ht(e){var t=e.curOp.ownsGroup;if(t)try{!function(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r].call(null);for(var n=0;n<e.ops.length;n++){var i=e.ops[n];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(r<t.length)}(t)}finally{Bt=null;for(var r=0;r<t.ops.length;r++)t.ops[r].cm.curOp=null;!function(e){for(var t=e.ops,r=0;r<t.length;r++)qt(t[r]);for(r=0;r<t.length;r++)$t(t[r]);for(r=0;r<t.length;r++)Wt(t[r]);for(r=0;r<t.length;r++)zt(t[r]);for(r=0;r<t.length;r++)Qt(t[r])}(t)}}function qt(e){var t=e.cm,r=t.display;!function(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=pt(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=pt(e)+"px",t.scrollbarsClipped=!0)}(t),e.updateMaxLine&&k(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<r.viewFrom||e.scrollToPos.to.line>=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Q(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function $t(e){e.updatedDisplay=e.mustUpdate&&X(e.cm,e.update)}function Wt(e){var t=e.cm,r=t.display;e.updatedDisplay&&J(t),e.barMeasure=F(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=gt(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+pt(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-dt(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection(e.focus))}function zt(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Er(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==ko()&&(!document.hasFocus||document.hasFocus());e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),(e.updatedDisplay||e.startHeight!=t.doc.height)&&j(t,e.barMeasure),e.updatedDisplay&&Z(t,e.barMeasure),e.selectionChanged&&it(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&ve(e.cm)}function Qt(e){var t=e.cm,r=t.display,n=t.doc;if(e.updatedDisplay&&Y(t,e.update),null==r.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(r.wheelStartX=r.wheelStartY=null),null==e.scrollTop||r.scroller.scrollTop==e.scrollTop&&!e.forceScroll||(n.scrollTop=Math.max(0,Math.min(r.scroller.scrollHeight-r.scroller.clientHeight,e.scrollTop)),r.scrollbars.setScrollTop(n.scrollTop),r.scroller.scrollTop=n.scrollTop),null==e.scrollLeft||r.scroller.scrollLeft==e.scrollLeft&&!e.forceScroll||(n.scrollLeft=Math.max(0,Math.min(r.scroller.scrollWidth-r.scroller.clientWidth,e.scrollLeft)),r.scrollbars.setScrollLeft(n.scrollLeft),r.scroller.scrollLeft=n.scrollLeft,q(t)),e.scrollToPos){var i=function(e,t,r,n){null==n&&(n=0);for(var i=0;i<5;i++){var o=!1,s=wt(e,t),a=r&&r!=t?wt(e,r):s,l=qr(e,Math.min(s.left,a.left),Math.min(s.top,a.top)-n,Math.max(s.left,a.left),Math.max(s.bottom,a.bottom)+n),u=e.doc.scrollTop,c=e.doc.scrollLeft;if(null!=l.scrollTop&&(mr(e,l.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(o=!0)),null!=l.scrollLeft&&(Er(e,l.scrollLeft),Math.abs(e.doc.scrollLeft-c)>1&&(o=!0)),!o)break}return s}(t,Fe(n,e.scrollToPos.from),Fe(n,e.scrollToPos.to),e.scrollToPos.margin);e.scrollToPos.isCursor&&t.state.focused&&function(e,t){if(!to(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&&!f){var o=wo("div","​",null,"position: absolute; top: "+(t.top-r.viewOffset-lt(e.display))+"px; height: "+(t.bottom-t.top+pt(e)+r.barHeight)+"px; left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}(t,i)}var o=e.maybeHiddenMarkers,s=e.maybeUnhiddenMarkers;if(o)for(var a=0;a<o.length;++a)o[a].lines.length||Ki(o[a],"hide");if(s)for(a=0;a<s.length;++a)s[a].lines.length&&Ki(s[a],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Ki(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Xt(e,t){if(e.curOp)return t();Vt(e);try{return t()}finally{Ht(e)}}function Yt(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Vt(e);try{return t.apply(e,arguments)}finally{Ht(e)}}}function Kt(e){return function(){if(this.curOp)return e.apply(this,arguments);Vt(this);try{return e.apply(this,arguments)}finally{Ht(this)}}}function Zt(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Vt(t);try{return e.apply(this,arguments)}finally{Ht(t)}}}function Jt(e,t,r){this.line=t,this.rest=function(e){for(var t,r;t=Gn(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}(t),this.size=this.rest?Li(mo(this.rest))-r+1:1,this.node=this.text=null,this.hidden=Hn(e,t)}function er(e,t,r){for(var n,i=[],o=t;o<r;o=n){var s=new Jt(e.doc,Ci(e.doc,o),o);n=o+s.size,i.push(s)}return i}function tr(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&&r<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)N&&jn(e.doc,t)<i.viewTo&&nr(e);else if(r<=i.viewFrom)N&&Vn(e.doc,r+n)>i.viewFrom?nr(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)nr(e);else if(t<=i.viewFrom)(o=or(e,r,r+n,1))?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):nr(e);else if(r>=i.viewTo){var o;(o=or(e,t,t,-1))?(i.view=i.view.slice(0,o.index),i.viewTo=o.lineN):nr(e)}else{var s=or(e,t,t,-1),a=or(e,r,r+n,1);s&&a?(i.view=i.view.slice(0,s.index).concat(er(e,s.lineN,a.lineN)).concat(i.view.slice(a.index)),i.viewTo+=n):nr(e)}var l=i.externalMeasured;l&&(r<l.lineN?l.lineN+=n:t<l.lineN+l.size&&(i.externalMeasured=null))}function rr(e,t,r){e.curOp.viewChanged=!0;var n=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(n.externalMeasured=null),!(t<n.viewFrom||t>=n.viewTo)){var o=n.view[ir(e,t)];if(null!=o.node){var s=o.changes||(o.changes=[]);-1==vo(s,r)&&s.push(r)}}}function nr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function ir(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var r=e.display.view,n=0;n<r.length;n++)if((t-=r[n].size)<0)return n}function or(e,t,r,n){var i,o=ir(e,t),s=e.display.view;if(!N||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var a=0,l=e.display.viewFrom;a<o;a++)l+=s[a].size;if(l!=t){if(n>0){if(o==s.length-1)return null;i=l+s[o].size-t,o++}else i=l-t;t+=i,r+=i}for(;jn(e.doc,r)!=r;){if(o==(n<0?0:s.length-1))return null;r+=n*s[o-(n<0?1:0)].size,o+=n}return{index:o,lineN:r}}function sr(e){for(var t=e.display.view,r=0,n=0;n<t.length;n++){var i=t[n];i.hidden||i.node&&!i.changes||++r}return r}function ar(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 lr(e,t){for(var r=$i(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 ur(e,t,r,n){var i=e.display;if(!r&&"true"==$i(t).getAttribute("cm-not-content"))return null;var o,s,a=i.lineSpace.getBoundingClientRect();try{o=t.clientX-a.left,s=t.clientY-a.top}catch(t){return null}var l,u=_t(e,o,s);if(n&&1==u.xRel&&(l=Ci(e.doc,u.line).text).length==u.ch){var c=po(l,l.length,e.options.tabSize)-l.length;u=fe(u.line,Math.max(0,Math.round((o-ct(e.display).left)/Ft(e.display))-c))}return u}function cr(e){var t=this,r=t.display;if(!(to(t,e)||r.activeTouch&&r.input.supportsTouch()))if(r.shift=e.shiftKey,lr(r,e))a||(r.scroller.draggable=!1,setTimeout((function(){r.scroller.draggable=!0}),100));else if(!dr(t,e)){var n=ur(t,e);switch(window.focus(),Wi(e)){case 1:t.state.selectingText?t.state.selectingText(e):n?function(e,t,r){o?setTimeout(No(ve,e),0):e.curOp.focus=ko();var n,i=+new Date;Ut&&Ut.time>i-400&&0==he(Ut.pos,r)?n="triple":Gt&&Gt.time>i-400&&0==he(Gt.pos,r)?(n="double",Ut={time:i,pos:r}):(n="single",Gt={time:i,pos:r});var l,u=e.doc.sel,c=m?t.metaKey:t.ctrlKey;e.options.dragDrop&&qo&&!e.isReadOnly()&&"single"==n&&(l=u.contains(r))>-1&&(he((l=u.ranges[l]).from(),r)<0||r.xRel>0)&&(he(l.to(),r)>0||r.xRel<0)?function(e,t,r,n){var i=e.display,l=+new Date,u=Yt(e,(function(c){a&&(i.scroller.draggable=!1),e.state.draggingText=!1,Yi(document,"mouseup",u),Yi(i.scroller,"drop",u),Math.abs(t.clientX-c.clientX)+Math.abs(t.clientY-c.clientY)<10&&(ji(c),!n&&+new Date-200<l&&je(e.doc,r),a||o&&9==s?setTimeout((function(){document.body.focus(),i.input.focus()}),20):i.input.focus())}));a&&(i.scroller.draggable=!0),e.state.draggingText=u,u.copy=m?t.altKey:t.ctrlKey,i.scroller.dragDrop&&i.scroller.dragDrop(),zi(document,"mouseup",u),zi(i.scroller,"drop",u)}(e,t,r,c):function(e,t,r,n,i){var o=e.display,s=e.doc;ji(t);var a,l,u=s.sel,c=u.ranges;if(i&&!t.shiftKey?(l=s.sel.contains(r),a=l>-1?c[l]:new De(r,r)):(a=s.sel.primary(),l=s.sel.primIndex),E?t.shiftKey&&t.metaKey:t.altKey)n="rect",i||(a=new De(r,r)),r=ur(e,t,!0,!0),l=-1;else if("double"==n){var p=e.findWordAt(r);a=e.display.shift||s.extend?Be(s,a,p.anchor,p.head):p}else if("triple"==n){var d=new De(fe(r.line,0),Fe(s,fe(r.line+1,0)));a=e.display.shift||s.extend?Be(s,a,d.anchor,d.head):d}else a=Be(s,a,r);i?-1==l?(l=c.length,We(s,_e(c.concat([a]),l),{scroll:!1,origin:"*mouse"})):c.length>1&&c[l].empty()&&"single"==n&&!t.shiftKey?(We(s,_e(c.slice(0,l).concat(c.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),u=s.sel):He(s,l,a,lo):(l=0,We(s,new Pe([a],0),lo),u=s.sel);var f=r,h=o.wrapper.getBoundingClientRect(),g=0;function m(t){var i=++g,c=ur(e,t,!0,"rect"==n);if(c)if(0!=he(c,f)){e.curOp.focus=ko(),function(t){if(0!=he(f,t))if(f=t,"rect"==n){for(var i=[],o=e.options.tabSize,c=po(Ci(s,r.line).text,r.ch,o),p=po(Ci(s,t.line).text,t.ch,o),d=Math.min(c,p),h=Math.max(c,p),g=Math.min(r.line,t.line),m=Math.min(e.lastLine(),Math.max(r.line,t.line));g<=m;g++){var E=Ci(s,g).text,v=fo(E,d,o);d==h?i.push(new De(fe(g,v),fe(g,v))):E.length>v&&i.push(new De(fe(g,v),fe(g,fo(E,h,o))))}i.length||i.push(new De(r,r)),We(s,_e(u.ranges.slice(0,l).concat(i),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var x=a,y=x.anchor,T=t;if("single"!=n){if("double"==n)var C=e.findWordAt(t);else C=new De(fe(t.line,0),Fe(s,fe(t.line+1,0)));he(C.anchor,y)>0?(T=C.head,y=Ee(x.from(),C.anchor)):(T=C.anchor,y=me(x.to(),C.head))}(i=u.ranges.slice(0))[l]=new De(Fe(s,y),T),We(s,_e(i,l),lo)}}(c);var p=H(o,s);(c.line>=p.to||c.line<p.from)&&setTimeout(Yt(e,(function(){g==i&&m(t)})),150)}else{var d=t.clientY<h.top?-20:t.clientY>h.bottom?20:0;d&&setTimeout(Yt(e,(function(){g==i&&(o.scroller.scrollTop+=d,m(t))})),50)}}function v(t){e.state.selectingText=!1,g=1/0,ji(t),o.input.focus(),Yi(document,"mousemove",x),Yi(document,"mouseup",y),s.history.lastSelOrigin=null}var x=Yt(e,(function(e){Wi(e)?m(e):v(e)})),y=Yt(e,v);e.state.selectingText=y,zi(document,"mousemove",x),zi(document,"mouseup",y)}(e,t,r,n,c)}(t,e,n):$i(e)==r.scroller&&ji(e);break;case 2:a&&(t.state.lastMiddleDown=+new Date),n&&je(t.doc,n),setTimeout((function(){r.input.focus()}),20),ji(e);break;case 3:T?Pr(t,e):function(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,wr(e))}),100)}(t)}}}function pr(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&&ji(t);var s=e.display,a=s.lineDiv.getBoundingClientRect();if(o>a.bottom||!no(e,r))return Hi(t);o-=a.top-s.viewOffset;for(var l=0;l<e.options.gutters.length;++l){var u=s.gutters.childNodes[l];if(u&&u.getBoundingClientRect().right>=i){var c=Ai(e.doc,o),p=e.options.gutters[l];return Ki(e,r,e,c,p,t),Hi(t)}}}function dr(e,t){return pr(e,t,"gutterClick",!0)}var fr=0;function hr(e){var t=this;if(gr(t),!to(t,e)&&!lr(t.display,e)){ji(e),o&&(fr=+new Date);var r=ur(t,e,!0),n=e.dataTransfer.files;if(r&&!t.isReadOnly())if(n&&n.length&&window.FileReader&&window.File)for(var i=n.length,s=Array(i),a=0,l=function(e,n){if(!t.options.allowDropFileTypes||-1!=vo(t.options.allowDropFileTypes,e.type)){var o=new FileReader;o.onload=Yt(t,(function(){var e=o.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),s[n]=e,++a==i){var l={from:r=Fe(t.doc,r),to:r,text:t.doc.splitLines(s.join(t.doc.lineSeparator())),origin:"paste"};Gr(t.doc,l),$e(t.doc,ke(r,Dr(l)))}})),o.readAsText(e)}},u=0;u<i;++u)l(n[u],u);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{if(s=e.dataTransfer.getData("Text")){if(t.state.draggingText&&!t.state.draggingText.copy)var c=t.listSelections();if(ze(t.doc,ke(r,r)),c)for(u=0;u<c.length;++u)Hr(t.doc,"",c[u].anchor,c[u].head,"drag");t.replaceSelection(s,"around","paste"),t.display.input.focus()}}catch(e){}}}}function gr(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function mr(e,t){Math.abs(e.doc.scrollTop-t)<2||(e.doc.scrollTop=t,r||K(e,{top:t}),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t),e.display.scrollbars.setScrollTop(t),r&&K(e),ot(e,100))}function Er(e,t,r){(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)||(t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),e.doc.scrollLeft=t,q(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}var vr=0,xr=null;o?xr=-.53:r?xr=15:u?xr=-.7:p&&(xr=-1/3);var yr=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}};function Tr(e,t){var n=yr(t),i=n.x,o=n.y,s=e.display,l=s.scroller,u=l.scrollWidth>l.clientWidth,p=l.scrollHeight>l.clientHeight;if(i&&u||o&&p){if(o&&m&&a)e:for(var d=t.target,f=s.view;d!=l;d=d.parentNode)for(var h=0;h<f.length;h++)if(f[h].node==d){e.display.currentWheelTarget=d;break e}if(i&&!r&&!c&&null!=xr)return o&&p&&mr(e,Math.max(0,Math.min(l.scrollTop+o*xr,l.scrollHeight-l.clientHeight))),Er(e,Math.max(0,Math.min(l.scrollLeft+i*xr,l.scrollWidth-l.clientWidth))),(!o||o&&p)&&ji(t),void(s.wheelStartX=null);if(o&&null!=xr){var g=o*xr,E=e.doc.scrollTop,v=E+s.wrapper.clientHeight;g<0?E=Math.max(0,E+g-50):v=Math.min(e.doc.height,v+g+50),K(e,{top:E,bottom:v})}vr<20&&(null==s.wheelStartX?(s.wheelStartX=l.scrollLeft,s.wheelStartY=l.scrollTop,s.wheelDX=i,s.wheelDY=o,setTimeout((function(){if(null!=s.wheelStartX){var e=l.scrollLeft-s.wheelStartX,t=l.scrollTop-s.wheelStartY,r=t&&s.wheelDY&&t/s.wheelDY||e&&s.wheelDX&&e/s.wheelDX;s.wheelStartX=s.wheelStartY=null,r&&(xr=(xr*vr+r)/(vr+1),++vr)}}),200)):(s.wheelDX+=i,s.wheelDY+=o))}}function Cr(e,t,r){if("string"==typeof t&&!(t=pn[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)!=so}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}I.wheelEventPixels=function(e){var t=yr(e);return t.x*=xr,t.y*=xr,t};var Nr=new co;function Ir(e,t,r,n){var i=e.state.keySeq;if(i){if(gn(t))return"handled";Nr.set(50,(function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())})),t=i+" "+t}var o=function(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var i=hn(t,e.state.keyMaps[n],r,e);if(i)return i}return e.options.extraKeys&&hn(t,e.options.extraKeys,r,e)||hn(t,e.options.keyMap,r,e)}(e,t,n);return"multi"==o&&(e.state.keySeq=t),"handled"==o&&Ji(e,"keyHandled",e,t,r),"handled"!=o&&"multi"!=o||(ji(r),it(e)),i&&!o&&/\'$/.test(t)?(ji(r),!0):!!o}function Sr(e,t){var r=mn(t,!0);return!!r&&(t.shiftKey&&!e.state.keySeq?Ir(e,"Shift-"+r,t,(function(t){return Cr(e,t,!0)}))||Ir(e,r,t,(function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return Cr(e,t)})):Ir(e,r,t,(function(t){return Cr(e,t)})))}var Lr=null;function Ar(e){var t=this;if(t.curOp.focus=ko(),!to(t,e)){o&&s<11&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=16==r||e.shiftKey;var n=Sr(t,e);c&&(Lr=n?r:null,n||88!=r||Ko||!(m?e.metaKey:e.ctrlKey)||t.replaceSelection("",null,"cut")),18!=r||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||function(e){var t=e.display.lineDiv;function r(e){18!=e.keyCode&&e.altKey||(Fo(t,"CodeMirror-crosshair"),Yi(document,"keyup",r),Yi(document,"mouseover",r))}Go(t,"CodeMirror-crosshair"),zi(document,"keyup",r),zi(document,"mouseover",r)}(t)}}function br(e){16==e.keyCode&&(this.doc.sel.shift=!1),to(this,e)}function Rr(e){var t=this;if(!(lr(t.display,e)||to(t,e)||e.ctrlKey&&!e.altKey||m&&e.metaKey)){var r=e.keyCode,n=e.charCode;if(c&&r==Lr)return Lr=null,void ji(e);c&&(!e.which||e.which<10)&&Sr(t,e)||function(e,t,r){return Ir(e,"'"+r+"'",t,(function(t){return Cr(e,t,!0)}))}(t,e,String.fromCharCode(null==n?r:n))||t.display.input.onKeyPress(e)}}function Or(e){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(Ki(e,"focus",e),e.state.focused=!0,Go(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),a&&setTimeout((function(){e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),it(e))}function wr(e){e.state.delayingBlurEvent||(e.state.focused&&(Ki(e,"blur",e),e.state.focused=!1,Fo(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function Pr(e,t){lr(e.display,t)||function(e,t){return!!no(e,"gutterContextMenu")&&pr(e,t,"gutterContextMenu",!1)}(e,t)||to(e,t,"contextmenu")||e.display.input.onContextMenu(t)}var Dr=I.changeEnd=function(e){return e.text?fe(e.from.line+e.text.length-1,mo(e.text).length+(1==e.text.length?e.from.ch:0)):e.to};function _r(e,t){if(he(e,t.from)<0)return e;if(he(e,t.to)<=0)return Dr(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+=Dr(t).ch-t.to.ch),fe(r,n)}function kr(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var i=e.sel.ranges[n];r.push(new De(_r(i.anchor,t),_r(i.head,t)))}return _e(r,e.sel.primIndex)}function Mr(e,t,r){return e.line==t.line?fe(r.line,e.ch-t.ch+r.ch):fe(r.line+(e.line-t.line),e.ch)}function Fr(e,t,r){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){this.canceled=!0}};return r&&(n.update=function(t,r,n,i){t&&(this.from=Fe(e,t)),r&&(this.to=Fe(e,r)),n&&(this.text=n),void 0!==i&&(this.origin=i)}),Ki(e,"beforeChange",e,n),e.cm&&Ki(e.cm,"beforeChange",e.cm,n),n.canceled?null:{from:n.from,to:n.to,text:n.text,origin:n.origin}}function Gr(e,t,r){if(e.cm){if(!e.cm.curOp)return Yt(e.cm,Gr)(e,t,r);if(e.cm.state.suppressEdits)return}if(!(no(e,"beforeChange")||e.cm&&no(e.cm,"beforeChange"))||(t=Fr(e,t,!0))){var n=C&&!r&&function(e,t,r){var n=null;if(e.iter(t.line,r.line+1,(function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var r=e.markedSpans[t].marker;!r.readOnly||n&&-1!=vo(n,r)||(n||(n=[])).push(r)}})),!n)return null;for(var i=[{from:t,to:r}],o=0;o<n.length;++o)for(var s=n[o],a=s.find(0),l=0;l<i.length;++l){var u=i[l];if(!(he(u.to,a.from)<0||he(u.from,a.to)>0)){var c=[l,1],p=he(u.from,a.from),d=he(u.to,a.to);(p<0||!s.inclusiveLeft&&!p)&&c.push({from:u.from,to:a.from}),(d>0||!s.inclusiveRight&&!d)&&c.push({from:a.to,to:u.to}),i.splice.apply(i,c),l+=c.length-1}}return i}(e,t.from,t.to);if(n)for(var i=n.length-1;i>=0;--i)Ur(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text});else Ur(e,t)}}function Ur(e,t){if(1!=t.text.length||""!=t.text[0]||0!=he(t.from,t.to)){var r=kr(e,t);Di(e,t,r,e.cm?e.cm.curOp.id:NaN),Vr(e,t,r,bn(e,t));var n=[];yi(e,(function(e,r){r||-1!=vo(n,e.history)||(Bi(e.history,t),n.push(e.history)),Vr(e,t,null,bn(e,t))}))}}function Br(e,t,r){if(!e.cm||!e.cm.state.suppressEdits||r){for(var n,i=e.history,o=e.sel,s="undo"==t?i.done:i.undone,a="undo"==t?i.undone:i.done,l=0;l<s.length&&(n=s[l],r?!n.ranges||n.equals(e.sel):n.ranges);l++);if(l!=s.length){for(i.lastOrigin=i.lastSelOrigin=null;(n=s.pop()).ranges;){if(_i(n,a),r&&!n.equals(e.sel))return void We(e,n,{clearRedo:!1});o=n}var u=[];_i(o,a),a.push({changes:u,generation:i.generation}),i.generation=n.generation||++i.maxGeneration;var c=no(e,"beforeChange")||e.cm&&no(e.cm,"beforeChange");for(l=n.changes.length-1;l>=0;--l){var p=n.changes[l];if(p.origin=t,c&&!Fr(e,p,!1))return void(s.length=0);u.push(wi(e,p));var d=l?kr(e,p):mo(s);Vr(e,p,d,On(e,p)),!l&&e.cm&&e.cm.scrollIntoView({from:p.from,to:Dr(p)});var f=[];yi(e,(function(e,t){t||-1!=vo(f,e.history)||(Bi(e.history,p),f.push(e.history)),Vr(e,p,null,On(e,p))}))}}}}function jr(e,t){if(0!=t&&(e.first+=t,e.sel=new Pe(xo(e.sel.ranges,(function(e){return new De(fe(e.anchor.line+t,e.anchor.ch),fe(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){tr(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;n<r.viewTo;n++)rr(e.cm,n,"gutter")}}function Vr(e,t,r,n){if(e.cm&&!e.cm.curOp)return Yt(e.cm,Vr)(e,t,r,n);if(t.to.line<e.first)jr(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);jr(e,i),t={from:fe(e.first,0),to:fe(t.to.line+i,t.to.ch),text:[mo(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:fe(o,Ci(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Ni(e,t.from,t.to),r||(r=kr(e,t)),e.cm?function(e,t,r){var n=e.doc,i=e.display,o=t.from,s=t.to,a=!1,l=o.line;e.options.lineWrapping||(l=Li(Bn(Ci(n,o.line))),n.iter(l,s.line+1,(function(e){if(e==i.maxLine)return a=!0,!0}))),n.sel.contains(t.from,t.to)>-1&&ro(e),fi(n,t,r,b(e)),e.options.lineWrapping||(n.iter(l,o.line+t.text.length,(function(e){var t=_(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,o.line),ot(e,400);var u=t.text.length-(s.line-o.line)-1;t.full?tr(e):o.line!=s.line||1!=t.text.length||di(e.doc,t)?tr(e,o.line,s.line+1,u):rr(e,o.line,"text");var c=no(e,"changes"),p=no(e,"change");if(p||c){var d={from:o,to:s,text:t.text,removed:t.removed,origin:t.origin};p&&Ji(e,"change",e,d),c&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(d)}e.display.selForContextMenu=null}(e.cm,t,n):fi(e,t,n),ze(e,r,ao)}}function Hr(e,t,r,n,i){if(n||(n=r),he(n,r)<0){var o=n;n=r,r=o}"string"==typeof t&&(t=e.splitLines(t)),Gr(e,{from:r,to:n,text:t,origin:i})}function qr(e,t,r,n,i){var o=e.display,s=Mt(e.display);r<0&&(r=0);var a=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:o.scroller.scrollTop,l=ft(e),u={};i-r>l&&(i=r+l);var c=e.doc.height+ut(o),p=r<s,d=i>c-s;if(r<a)u.scrollTop=p?0:r;else if(i>a+l){var f=Math.min(r,(d?c:i)-l);f!=a&&(u.scrollTop=f)}var h=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:o.scroller.scrollLeft,g=dt(e)-(e.options.fixedGutter?o.gutters.offsetWidth:0),m=n-t>g;return m&&(n=t+g),t<10?u.scrollLeft=0:t<h?u.scrollLeft=Math.max(0,t-(m?0:10)):n>g+h-3&&(u.scrollLeft=n+(m?0:10)-g),u}function $r(e,t,r){null==t&&null==r||zr(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 Wr(e){zr(e);var t=e.getCursor(),r=t,n=t;e.options.lineWrapping||(r=t.ch?fe(t.line,t.ch-1):t,n=fe(t.line,t.ch+1)),e.curOp.scrollToPos={from:r,to:n,margin:e.options.cursorScrollMargin,isCursor:!0}}function zr(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=Pt(e,t.from),n=Pt(e,t.to),i=qr(e,Math.min(r.left,n.left),Math.min(r.top,n.top)-t.margin,Math.max(r.right,n.right),Math.max(r.bottom,n.bottom)+t.margin);e.scrollTo(i.scrollLeft,i.scrollTop)}}function Qr(e,t,r,n){var i,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?i=at(e,t):r="prev");var s=e.options.tabSize,a=Ci(o,t),l=po(a.text,null,s);a.stateAfter&&(a.stateAfter=null);var u,c=a.text.match(/^\s*/)[0];if(n||/\S/.test(a.text)){if("smart"==r&&((u=o.mode.indent(i,a.text.slice(c.length),a.text))==so||u>150)){if(!n)return;r="prev"}}else u=0,r="not";"prev"==r?u=t>o.first?po(Ci(o,t-1).text,null,s):0:"add"==r?u=l+e.options.indentUnit:"subtract"==r?u=l-e.options.indentUnit:"number"==typeof r&&(u=l+r),u=Math.max(0,u);var p="",d=0;if(e.options.indentWithTabs)for(var f=Math.floor(u/s);f;--f)d+=s,p+="\t";if(d<u&&(p+=go(u-d)),p!=c)return Hr(o,p,fe(t,0),fe(t,c.length),"+input"),a.stateAfter=null,!0;for(f=0;f<o.sel.ranges.length;f++){var h=o.sel.ranges[f];if(h.head.line==t&&h.head.ch<c.length){He(o,f,new De(d=fe(t,c.length),d));break}}}function Xr(e,t,r,n){var i=t,o=t;return"number"==typeof t?o=Ci(e,Me(e,t)):i=Li(t),null==i?null:(n(o,i)&&e.cm&&rr(e.cm,i,r),o)}function Yr(e,t){for(var r=e.doc.sel.ranges,n=[],i=0;i<r.length;i++){for(var o=t(r[i]);n.length&&he(o.from,mo(n).to)<=0;){var s=n.pop();if(he(s.from,o.from)<0){o.from=s.from;break}}n.push(o)}Xt(e,(function(){for(var t=n.length-1;t>=0;t--)Hr(e.doc,"",n[t].from,n[t].to,"+delete");Wr(e)}))}function Kr(e,t,r,n,i){var o=t.line,s=t.ch,a=r,l=Ci(e,o);function u(t){var n,a=(i?us:cs)(l,s,r,!0);if(null==a){if(t||(n=o+r)<e.first||n>=e.first+e.size||(o=n,!(l=Ci(e,n))))return!1;s=i?(r<0?ns:rs)(l):r<0?l.text.length:0}else s=a;return!0}if("char"==n)u();else if("column"==n)u(!0);else if("word"==n||"group"==n)for(var c=null,p="group"==n,d=e.cm&&e.cm.getHelper(t,"wordChars"),f=!0;!(r<0)||u(!f);f=!1){var h=l.text.charAt(s)||"\n",g=Lo(h,d)?"w":p&&"\n"==h?"n":!p||/\s/.test(h)?null:"p";if(!p||f||g||(g="s"),c&&c!=g){r<0&&(r=1,u());break}if(g&&(c=g),r>0&&!u(!f))break}var m=Ze(e,fe(o,s),t,a,!0);return he(t,m)||(m.hitSide=!0),m}function Zr(e,t,r,n){var i,o=e.doc,s=t.left;if("page"==n){var a=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);i=t.top+r*(a-(r<0?1.5:.5)*Mt(e.display))}else"line"==n&&(i=r>0?t.bottom+3:t.top-3);for(;;){var l=_t(e,s,i);if(!l.outside)break;if(r<0?i<=0:i>=o.height){l.hitSide=!0;break}i+=5*r}return l}I.prototype={constructor:I,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,en.hasOwnProperty(e)&&Yt(this,en[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"](En(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,r=0;r<t.length;++r)if(t[r]==e||t[r].name==e)return t.splice(r,1),!0},addOverlay:Kt((function(e,t){var r=e.token?e:I.getMode(this.options,e);if(r.startState)throw new Error("Overlays may not be stateful.");this.state.overlays.push({mode:r,modeSpec:e,opaque:t&&t.opaque}),this.state.modeGen++,tr(this)})),removeOverlay:Kt((function(e){for(var t=this.state.overlays,r=0;r<t.length;++r){var n=t[r].modeSpec;if(n==e||"string"==typeof e&&n.name==e)return t.splice(r,1),this.state.modeGen++,void tr(this)}})),indentLine:Kt((function(e,t,r){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),Ge(this.doc,e)&&Qr(this,e,t,r)})),indentSelection:Kt((function(e){for(var t=this.doc.sel.ranges,r=-1,n=0;n<t.length;n++){var i=t[n];if(i.empty())i.head.line>r&&(Qr(this,i.head.line,e,!0),r=i.head.line,n==this.doc.sel.primIndex&&Wr(this));else{var o=i.from(),s=i.to(),a=Math.max(r,o.line);r=Math.min(this.lastLine(),s.line-(s.ch?0:1))+1;for(var l=a;l<r;++l)Qr(this,l,e);var u=this.doc.sel.ranges;0==o.ch&&t.length==u.length&&u[n].from().ch>0&&He(this.doc,n,new De(o,u[n].to()),ao)}}})),getTokenAt:function(e,t){return Jn(this,e,t)},getLineTokens:function(e,t){return Jn(this,fe(e),t,!0)},getTokenTypeAt:function(e){e=Fe(this.doc,e);var t,r=ri(this,Ci(this.doc,e.line)),n=0,i=(r.length-1)/2,o=e.ch;if(0==o)t=r[2];else for(;;){var s=n+i>>1;if((s?r[2*s-1]:0)>=o)i=s;else{if(!(r[2*s+1]<o)){t=r[2*s+2];break}n=s+1}}var a=t?t.indexOf("cm-overlay "):-1;return a<0?t:0==a?null:t.slice(0,a-1)},getModeAt:function(e){var t=this.doc.mode;return t.innerMode?I.innerMode(t,this.getTokenAt(e).state).mode:t},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!ln.hasOwnProperty(t))return r;var n=ln[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;o<i[t].length;o++){var s=n[i[t][o]];s&&r.push(s)}else i.helperType&&n[i.helperType]?r.push(n[i.helperType]):n[i.name]&&r.push(n[i.name]);for(o=0;o<n._global.length;o++){var a=n._global[o];a.pred(i,this)&&-1==vo(r,a.val)&&r.push(a.val)}return r},getStateAfter:function(e,t){var r=this.doc;return at(this,(e=Me(r,null==e?r.first+r.size-1:e))+1,t)},cursorCoords:function(e,t){var r=this.doc.sel.primary();return wt(this,null==e?r.head:"object"==typeof e?Fe(this.doc,e):e?r.from():r.to(),t||"page")},charCoords:function(e,t){return Ot(this,Fe(this.doc,e),t||"page")},coordsChar:function(e,t){return _t(this,(e=Rt(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=Rt(this,{top:e,left:0},t||"page").top,Ai(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t){var r,n=!1;if("number"==typeof e){var i=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>i&&(e=i,n=!0),r=Ci(this.doc,e)}else r=e;return bt(this,r,{top:0,left:0},t||"page").top+(n?this.doc.height-bi(r):0)},defaultTextHeight:function(){return Mt(this.display)},defaultCharWidth:function(){return Ft(this.display)},setGutterMarker:Kt((function(e,t,r){return Xr(this.doc,e,"gutter",(function(e){var n=e.gutterMarkers||(e.gutterMarkers={});return n[t]=r,!r&&Ao(n)&&(e.gutterMarkers=null),!0}))})),clearGutter:Kt((function(e){var t=this,r=t.doc,n=r.first;r.iter((function(r){r.gutterMarkers&&r.gutterMarkers[e]&&(r.gutterMarkers[e]=null,rr(t,n,"gutter"),Ao(r.gutterMarkers)&&(r.gutterMarkers=null)),++n}))})),lineInfo:function(e){if("number"==typeof e){if(!Ge(this.doc,e))return null;var t=e;if(!(e=Ci(this.doc,e)))return null}else if(null==(t=Li(e)))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,s,a,l,u,c,p=this.display,d=(e=wt(this,Fe(this.doc,e))).bottom,f=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),p.sizer.appendChild(t),"over"==n)d=e.top;else if("above"==n||"near"==n){var h=Math.max(p.wrapper.clientHeight,this.doc.height),g=Math.max(p.sizer.clientWidth,p.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>h)&&e.top>t.offsetHeight?d=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=h&&(d=e.bottom),f+t.offsetWidth>g&&(f=g-t.offsetWidth)}t.style.top=d+"px",t.style.left=t.style.right="","right"==i?(f=p.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?f=0:"middle"==i&&(f=(p.sizer.clientWidth-t.offsetWidth)/2),t.style.left=f+"px"),r&&(o=this,s=f,a=d,l=f+t.offsetWidth,u=d+t.offsetHeight,null!=(c=qr(o,s,a,l,u)).scrollTop&&mr(o,c.scrollTop),null!=c.scrollLeft&&Er(o,c.scrollLeft))},triggerOnKeyDown:Kt(Ar),triggerOnKeyPress:Kt(Rr),triggerOnKeyUp:br,execCommand:function(e){if(pn.hasOwnProperty(e))return pn[e].call(null,this)},triggerElectric:Kt((function(e){Ce(this,e)})),findPosH:function(e,t,r,n){var i=1;t<0&&(i=-1,t=-t);for(var o=0,s=Fe(this.doc,e);o<t&&!(s=Kr(this.doc,s,i,r,n)).hitSide;++o);return s},moveH:Kt((function(e,t){var r=this;r.extendSelectionsBy((function(n){return r.display.shift||r.doc.extend||n.empty()?Kr(r.doc,n.head,e,t,r.options.rtlMoveVisually):e<0?n.from():n.to()}),uo)})),deleteH:Kt((function(e,t){var r=this.doc.sel,n=this.doc;r.somethingSelected()?n.replaceSelection("",null,"+delete"):Yr(this,(function(r){var i=Kr(n,r.head,e,t,!1);return e<0?{from:i,to:r.head}:{from:r.head,to:i}}))})),findPosV:function(e,t,r,n){var i=1,o=n;t<0&&(i=-1,t=-t);for(var s=0,a=Fe(this.doc,e);s<t;++s){var l=wt(this,a,"div");if(null==o?o=l.left:l.left=o,(a=Zr(this,l,i,r)).hitSide)break}return a},moveV:Kt((function(e,t){var r=this,n=this.doc,i=[],o=!r.display.shift&&!n.extend&&n.sel.somethingSelected();if(n.extendSelectionsBy((function(s){if(o)return e<0?s.from():s.to();var a=wt(r,s.head,"div");null!=s.goalColumn&&(a.left=s.goalColumn),i.push(a.left);var l=Zr(r,a,e,t);return"page"==t&&s==n.sel.primary()&&$r(r,null,Ot(r,l,"div").top-a.top),l}),uo),i.length)for(var s=0;s<n.sel.ranges.length;s++)n.sel.ranges[s].goalColumn=i[s]})),findWordAt:function(e){var t=Ci(this.doc,e.line).text,r=e.ch,n=e.ch;if(t){var i=this.getHelper(e,"wordChars");(e.xRel<0||n==t.length)&&r?--r:++n;for(var o=t.charAt(r),s=Lo(o,i)?function(e){return Lo(e,i)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!Lo(e)};r>0&&s(t.charAt(r-1));)--r;for(;n<t.length&&s(t.charAt(n));)++n}return new De(fe(e.line,r),fe(e.line,n))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?Go(this.display.cursorDiv,"CodeMirror-overwrite"):Fo(this.display.cursorDiv,"CodeMirror-overwrite"),Ki(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==ko()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:Kt((function(e,t){null==e&&null==t||zr(this),null!=e&&(this.curOp.scrollLeft=e),null!=t&&(this.curOp.scrollTop=t)})),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-pt(this)-this.display.barHeight,width:e.scrollWidth-pt(this)-this.display.barWidth,clientHeight:ft(this),clientWidth:dt(this)}},scrollIntoView:Kt((function(e,t){if(null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:fe(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line)zr(this),this.curOp.scrollToPos=e;else{var r=qr(this,Math.min(e.from.left,e.to.left),Math.min(e.from.top,e.to.top)-e.margin,Math.max(e.from.right,e.to.right),Math.max(e.from.bottom,e.to.bottom)+e.margin);this.scrollTo(r.scrollLeft,r.scrollTop)}})),setSize:Kt((function(e,t){var r=this;function n(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e}null!=e&&(r.display.wrapper.style.width=n(e)),null!=t&&(r.display.wrapper.style.height=n(t)),r.options.lineWrapping&&It(this);var i=r.display.viewFrom;r.doc.iter(i,r.display.viewTo,(function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){rr(r,i,"widget");break}++i})),r.curOp.forceUpdate=!0,Ki(r,"refresh",this)})),operation:function(e){return Xt(this,e)},refresh:Kt((function(){var e=this.display.cachedTextHeight;tr(this),this.curOp.forceUpdate=!0,St(this),this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop),D(this),(null==e||Math.abs(e-Mt(this.display))>.5)&&R(this),Ki(this,"refresh",this)})),swapDoc:Kt((function(e){var t=this.doc;return t.cm=null,Ti(this,e),St(this),this.display.input.reset(),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Ji(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}},io(I);var Jr=I.defaults={},en=I.optionHandlers={};function tn(e,t,r,n){I.defaults[e]=t,r&&(en[e]=n?function(e,t,n){n!=rn&&r(e,t,n)}:r)}var rn=I.Init={toString:function(){return"CodeMirror.Init"}};tn("value","",(function(e,t){e.setValue(t)}),!0),tn("mode",null,(function(e,t){e.doc.modeOption=t,L(e)}),!0),tn("indentUnit",2,L,!0),tn("indentWithTabs",!1),tn("smartIndent",!0),tn("tabSize",4,(function(e){A(e),St(e),tr(e)}),!0),tn("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(fe(n,o))}n++}));for(var i=r.length-1;i>=0;i--)Hr(e.doc,t,r[i],fe(r[i].line,r[i].ch+t.length))}})),tn("specialChars",/[\u0000-\u001f\u007f\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,(function(e,t,r){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),r!=I.Init&&e.refresh()})),tn("specialCharPlaceholder",(function(e){var t=wo("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}),(function(e){e.refresh()}),!0),tn("electricChars",!0),tn("inputStyle",g?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),tn("rtlMoveVisually",!v),tn("wholeLineUpdateBefore",!0),tn("theme","default",(function(e){O(e),w(e)}),!0),tn("keyMap","default",(function(e,t,r){var n=En(t),i=r!=I.Init&&En(r);i&&i.detach&&i.detach(e,n),n.attach&&n.attach(e,i||null)})),tn("extraKeys",null),tn("lineWrapping",!1,(function(e){e.options.lineWrapping?(Go(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Fo(e.display.wrapper,"CodeMirror-wrap"),k(e)),R(e),tr(e),St(e),setTimeout((function(){j(e)}),100)}),!0),tn("gutters",[],(function(e){M(e.options),w(e)}),!0),tn("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?z(e.display)+"px":"0",e.refresh()}),!0),tn("coverGutterNextToScrollbar",!1,(function(e){j(e)}),!0),tn("scrollbarStyle","native",(function(e){B(e),j(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),tn("lineNumbers",!1,(function(e){M(e.options),w(e)}),!0),tn("firstLineNumber",1,w,!0),tn("lineNumberFormatter",(function(e){return e}),w,!0),tn("showCursorWhenSelecting",!1,et,!0),tn("resetSelectionOnContextMenu",!0),tn("lineWiseCopyCut",!0),tn("readOnly",!1,(function(e,t){"nocursor"==t?(wr(e),e.display.input.blur(),e.display.disabled=!0):e.display.disabled=!1,e.display.input.readOnlyChanged(t)})),tn("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),tn("dragDrop",!0,(function(e,t,r){if(!t!=!(r&&r!=I.Init)){var n=e.display.dragFunctions,i=t?zi:Yi;i(e.display.scroller,"dragstart",n.start),i(e.display.scroller,"dragenter",n.enter),i(e.display.scroller,"dragover",n.over),i(e.display.scroller,"dragleave",n.leave),i(e.display.scroller,"drop",n.drop)}})),tn("allowDropFileTypes",null),tn("cursorBlinkRate",530),tn("cursorScrollMargin",0),tn("cursorHeight",1,et,!0),tn("singleCursorHeightPerLine",!0,et,!0),tn("workTime",100),tn("workDelay",100),tn("flattenSpans",!0,A,!0),tn("addModeClass",!1,A,!0),tn("pollInterval",100),tn("undoDepth",200,(function(e,t){e.doc.history.undoDepth=t})),tn("historyEventDelay",1250),tn("viewportMargin",10,(function(e){e.refresh()}),!0),tn("maxHighlightLength",1e4,A,!0),tn("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),tn("tabindex",null,(function(e,t){e.display.input.getField().tabIndex=t||""})),tn("autofocus",null);var nn=I.modes={},on=I.mimeModes={};I.defineMode=function(e,t){I.defaults.mode||"null"==e||(I.defaults.mode=e),arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),nn[e]=t},I.defineMIME=function(e,t){on[e]=t},I.resolveMode=function(e){if("string"==typeof e&&on.hasOwnProperty(e))e=on[e];else if(e&&"string"==typeof e.name&&on.hasOwnProperty(e.name)){var t=on[e.name];"string"==typeof t&&(t={name:t}),(e=To(t,e)).name=t.name}else if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return I.resolveMode("application/xml");return"string"==typeof e?{name:e}:e||{name:"null"}},I.getMode=function(e,t){t=I.resolveMode(t);var r=nn[t.name];if(!r)return I.getMode(e,"text/plain");var n=r(e,t);if(sn.hasOwnProperty(t.name)){var i=sn[t.name];for(var o in i)i.hasOwnProperty(o)&&(n.hasOwnProperty(o)&&(n["_"+o]=n[o]),n[o]=i[o])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var o in t.modeProps)n[o]=t.modeProps[o];return n},I.defineMode("null",(function(){return{token:function(e){e.skipToEnd()}}})),I.defineMIME("text/plain","null");var sn=I.modeExtensions={};I.extendMode=function(e,t){Co(t,sn.hasOwnProperty(e)?sn[e]:sn[e]={})},I.defineExtension=function(e,t){I.prototype[e]=t},I.defineDocExtension=function(e,t){Ei.prototype[e]=t},I.defineOption=tn;var an=[];I.defineInitHook=function(e){an.push(e)};var ln=I.helpers={};I.registerHelper=function(e,t,r){ln.hasOwnProperty(e)||(ln[e]=I[e]={_global:[]}),ln[e][t]=r},I.registerGlobalHelper=function(e,t,r,n){I.registerHelper(e,t,n),ln[e]._global.push({pred:r,val:n})};var un=I.copyState=function(e,t){if(!0===t)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},cn=I.startState=function(e,t,r){return!e.startState||e.startState(t,r)};I.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 pn=I.commands={selectAll:function(e){e.setSelection(fe(e.firstLine(),0),fe(e.lastLine()),ao)},singleSelection:function(e){e.setSelection(e.getCursor("anchor"),e.getCursor("head"),ao)},killLine:function(e){Yr(e,(function(t){if(t.empty()){var r=Ci(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:fe(t.head.line+1,0)}:{from:t.head,to:fe(t.head.line,r)}}return{from:t.from(),to:t.to()}}))},deleteLine:function(e){Yr(e,(function(t){return{from:fe(t.from().line,0),to:Fe(e.doc,fe(t.to().line+1,0))}}))},delLineLeft:function(e){Yr(e,(function(e){return{from:fe(e.from().line,0),to:e.from()}}))},delWrappedLineLeft:function(e){Yr(e,(function(t){var r=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:r},"div"),to:t.from()}}))},delWrappedLineRight:function(e){Yr(e,(function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div");return{from:t.from(),to:n}}))},undo:function(e){e.undo()},redo:function(e){e.redo()},undoSelection:function(e){e.undoSelection()},redoSelection:function(e){e.redoSelection()},goDocStart:function(e){e.extendSelection(fe(e.firstLine(),0))},goDocEnd:function(e){e.extendSelection(fe(e.lastLine()))},goLineStart:function(e){e.extendSelectionsBy((function(t){return is(e,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(e){e.extendSelectionsBy((function(t){return os(e,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(e){e.extendSelectionsBy((function(t){return function(e,t){for(var r,n=Ci(e.doc,t);r=Gn(n);)n=r.find(1,!0).line,t=null;var i=Ri(n),o=i?i[0].level%2?rs(n):ns(n):n.text.length;return fe(null==t?Li(n):t,o)}(e,t.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(e){e.extendSelectionsBy((function(t){var r=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")}),uo)},goLineLeft:function(e){e.extendSelectionsBy((function(t){var r=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")}),uo)},goLineLeftSmart:function(e){e.extendSelectionsBy((function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return n.ch<e.getLine(n.line).search(/\S/)?os(e,t.head):n}),uo)},goLineUp:function(e){e.moveV(-1,"line")},goLineDown:function(e){e.moveV(1,"line")},goPageUp:function(e){e.moveV(-1,"page")},goPageDown:function(e){e.moveV(1,"page")},goCharLeft:function(e){e.moveH(-1,"char")},goCharRight:function(e){e.moveH(1,"char")},goColumnLeft:function(e){e.moveH(-1,"column")},goColumnRight:function(e){e.moveH(1,"column")},goWordLeft:function(e){e.moveH(-1,"word")},goGroupRight:function(e){e.moveH(1,"group")},goGroupLeft:function(e){e.moveH(-1,"group")},goWordRight:function(e){e.moveH(1,"word")},delCharBefore:function(e){e.deleteH(-1,"char")},delCharAfter:function(e){e.deleteH(1,"char")},delWordBefore:function(e){e.deleteH(-1,"word")},delWordAfter:function(e){e.deleteH(1,"word")},delGroupBefore:function(e){e.deleteH(-1,"group")},delGroupAfter:function(e){e.deleteH(1,"group")},indentAuto:function(e){e.indentSelection("smart")},indentMore:function(e){e.indentSelection("add")},indentLess:function(e){e.indentSelection("subtract")},insertTab:function(e){e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],r=e.listSelections(),n=e.options.tabSize,i=0;i<r.length;i++){var o=r[i].from(),s=po(e.getLine(o.line),o.ch,n);t.push(go(n-s%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){Xt(e,(function(){for(var t=e.listSelections(),r=[],n=0;n<t.length;n++){var i=t[n].head,o=Ci(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new fe(i.line,i.ch-1)),i.ch>0)i=new fe(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),fe(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var s=Ci(e.doc,i.line-1).text;s&&e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+s.charAt(s.length-1),fe(i.line-1,s.length-1),fe(i.line,1),"+transpose")}r.push(new De(i,i))}e.setSelections(r)}))},newlineAndIndent:function(e){Xt(e,(function(){for(var t=e.listSelections().length,r=0;r<t;r++){var n=e.listSelections()[r];e.replaceRange(e.doc.lineSeparator(),n.anchor,n.head,"+input"),e.indentLine(n.from().line+1,null,!0)}Wr(e)}))},openLine:function(e){e.replaceSelection("\n","start")},toggleOverwrite:function(e){e.toggleOverwrite()}},dn=I.keyMap={};function fn(e){for(var t,r,n,i,o=e.split(/-(?!$)/),s=(e=o[o.length-1],0);s<o.length-1;s++){var a=o[s];if(/^(cmd|meta|m)$/i.test(a))i=!0;else if(/^a(lt)?$/i.test(a))t=!0;else if(/^(c|ctrl|control)$/i.test(a))r=!0;else{if(!/^s(hift)$/i.test(a))throw new Error("Unrecognized modifier name: "+a);n=!0}}return t&&(e="Alt-"+e),r&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),n&&(e="Shift-"+e),e}dn.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"},dn.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"},dn.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","Ctrl-O":"openLine"},dn.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"]},dn.default=m?dn.macDefault:dn.pcDefault,I.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=xo(r.split(" "),fn),o=0;o<i.length;o++){var s,a;o==i.length-1?(a=i.join(" "),s=n):(a=i.slice(0,o+1).join(" "),s="...");var l=t[a];if(l){if(l!=s)throw new Error("Inconsistent bindings for "+a)}else t[a]=s}delete e[r]}for(var u in t)e[u]=t[u];return e};var hn=I.lookupKey=function(e,t,r,n){var i=(t=En(t)).call?t.call(e,n):t[e];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&r(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return hn(e,t.fallthrough,r,n);for(var o=0;o<t.fallthrough.length;o++){var s=hn(e,t.fallthrough[o],r,n);if(s)return s}}},gn=I.isModifierKey=function(e){var t="string"==typeof e?e:Jo[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t},mn=I.keyName=function(e,t){if(c&&34==e.keyCode&&e.char)return!1;var r=Jo[e.keyCode],n=r;return null!=n&&!e.altGraphKey&&(e.altKey&&"Alt"!=r&&(n="Alt-"+n),(y?e.metaKey:e.ctrlKey)&&"Ctrl"!=r&&(n="Ctrl-"+n),(y?e.ctrlKey:e.metaKey)&&"Cmd"!=r&&(n="Cmd-"+n),!t&&e.shiftKey&&"Shift"!=r&&(n="Shift-"+n),n)};function En(e){return"string"==typeof e?dn[e]:e}I.fromTextArea=function(e,t){if((t=t?Co(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var r=ko();t.autofocus=r==e||null!=e.getAttribute("autofocus")&&r==document.body}function n(){e.value=a.getValue()}if(e.form&&(zi(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var i=e.form,o=i.submit;try{var s=i.submit=function(){n(),i.submit=o,i.submit(),i.submit=s}}catch(e){}}t.finishInit=function(t){t.save=n,t.getTextArea=function(){return e},t.toTextArea=function(){t.toTextArea=isNaN,n(),e.parentNode.removeChild(t.getWrapperElement()),e.style.display="",e.form&&(Yi(e.form,"submit",n),"function"==typeof e.form.submit&&(e.form.submit=o))}},e.style.display="none";var a=I((function(t){e.parentNode.insertBefore(t,e.nextSibling)}),t);return a};var vn=I.StringStream=function(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0};vn.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eat:function(e){var t=this.string.charAt(this.pos);if("string"==typeof e)var r=t==e;else r=t&&(e.test?e.test(t):e(t));if(r)return++this.pos,t},eatWhile:function(e){for(var t=this.pos;this.eat(e););return this.pos>t},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);if(t>-1)return this.pos=t,!0},backUp:function(e){this.pos-=e},column:function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=po(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?po(this.string,this.lineStart,this.tabSize):0)},indentation:function(){return po(this.string,null,this.tabSize)-(this.lineStart?po(this.string,this.lineStart,this.tabSize):0)},match:function(e,t,r){if("string"!=typeof e){var n=this.string.slice(this.pos).match(e);return n&&n.index>0?null:(n&&!1!==t&&(this.pos+=n[0].length),n)}var i=function(e){return r?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}}};var xn=0,yn=I.TextMarker=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++xn};function Tn(e,t,r,n,i){if(n&&n.shared)return function(e,t,r,n,i){(n=Co(n)).shared=!1;var o=[Tn(e,t,r,n,i)],s=o[0],a=n.widgetNode;return yi(e,(function(e){a&&(n.widgetNode=a.cloneNode(!0)),o.push(Tn(e,Fe(e,t),Fe(e,r),n,i));for(var l=0;l<e.linked.length;++l)if(e.linked[l].isParent)return;s=mo(o)})),new Cn(o,s)}(e,t,r,n,i);if(e.cm&&!e.cm.curOp)return Yt(e.cm,Tn)(e,t,r,n,i);var o=new yn(e,i),s=he(t,r);if(n&&Co(n,o,!1),s>0||0==s&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=wo("span",[o.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Un(e,t.line,t,r,o)||t.line!=r.line&&Un(e,r.line,t,r,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");N=!0}o.addToHistory&&Di(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var a,l=t.line,u=e.cm;if(e.iter(l,r.line+1,(function(e){u&&o.collapsed&&!u.options.lineWrapping&&Bn(e)==u.display.maxLine&&(a=!0),o.collapsed&&l!=t.line&&Si(e,0),function(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}(e,new Sn(o,l==t.line?t.ch:null,l==r.line?r.ch:null)),++l})),o.collapsed&&e.iter(t.line,r.line+1,(function(t){Hn(e,t)&&Si(t,0)})),o.clearOnEnter&&zi(o,"beforeCursorEnter",(function(){o.clear()})),o.readOnly&&(C=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++xn,o.atomic=!0),u){if(a&&(u.curOp.updateMaxLine=!0),o.collapsed)tr(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++)rr(u,c,"text");o.atomic&&Xe(u.doc),Ji(u,"markerAdded",u,o)}return o}io(yn),yn.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Vt(e),no(this,"clear")){var r=this.find();r&&Ji(this,"clear",r.from,r.to)}for(var n=null,i=null,o=0;o<this.lines.length;++o){var s=this.lines[o],a=Ln(s.markedSpans,this);e&&!this.collapsed?rr(e,Li(s),"text"):e&&(null!=a.to&&(i=Li(s)),null!=a.from&&(n=Li(s))),s.markedSpans=An(s.markedSpans,a),null==a.from&&this.collapsed&&!Hn(this.doc,s)&&e&&Si(s,Mt(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(o=0;o<this.lines.length;++o){var l=Bn(this.lines[o]),u=_(l);u>e.display.maxLineLength&&(e.display.maxLine=l,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=n&&e&&this.collapsed&&tr(e,n,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Xe(e.doc)),e&&Ji(e,"markerCleared",e,this),t&&Ht(e),this.parent&&this.parent.clear()}},yn.prototype.find=function(e,t){var r,n;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i<this.lines.length;++i){var o=this.lines[i],s=Ln(o.markedSpans,this);if(null!=s.from&&(r=fe(t?o:Li(o),s.from),-1==e))return r;if(null!=s.to&&(n=fe(t?o:Li(o),s.to),1==e))return n}return r&&{from:r,to:n}},yn.prototype.changed=function(){var e=this.find(-1,!0),t=this,r=this.doc.cm;e&&r&&Xt(r,(function(){var n=e.line,i=Li(e.line),o=mt(r,i);if(o&&(Nt(o),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!Hn(t.doc,n)&&null!=t.height){var s=t.height;t.height=null;var a=zn(t)-s;a&&Si(n,n.height+a)}}))},yn.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=vo(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},yn.prototype.detachLine=function(e){if(this.lines.splice(vo(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},xn=0;var Cn=I.SharedTextMarker=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};function Nn(e){return e.findMarks(fe(e.first,0),e.clipPos(fe(e.lastLine())),(function(e){return e.parent}))}function In(e){for(var t=0;t<e.length;t++){var r=e[t],n=[r.primary.doc];yi(r.primary.doc,(function(e){n.push(e)}));for(var i=0;i<r.markers.length;i++){var o=r.markers[i];-1==vo(n,o.doc)&&(o.parent=null,r.markers.splice(i--,1))}}}function Sn(e,t,r){this.marker=e,this.from=t,this.to=r}function Ln(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function An(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}function bn(e,t){if(t.full)return null;var r=Ge(e,t.from.line)&&Ci(e,t.from.line).markedSpans,n=Ge(e,t.to.line)&&Ci(e,t.to.line).markedSpans;if(!r&&!n)return null;var i=t.from.ch,o=t.to.ch,s=0==he(t.from,t.to),a=function(e,t,r){if(e)for(var n,i=0;i<e.length;++i){var o=e[i],s=o.marker;if(null==o.from||(s.inclusiveLeft?o.from<=t:o.from<t)||o.from==t&&"bookmark"==s.type&&(!r||!o.marker.insertLeft)){var a=null==o.to||(s.inclusiveRight?o.to>=t:o.to>t);(n||(n=[])).push(new Sn(s,o.from,a?null:o.to))}}return n}(r,i,s),l=function(e,t,r){if(e)for(var n,i=0;i<e.length;++i){var o=e[i],s=o.marker;if(null==o.to||(s.inclusiveRight?o.to>=t:o.to>t)||o.from==t&&"bookmark"==s.type&&(!r||o.marker.insertLeft)){var a=null==o.from||(s.inclusiveLeft?o.from<=t:o.from<t);(n||(n=[])).push(new Sn(s,a?null:o.from-t,null==o.to?null:o.to-t))}}return n}(n,o,s),u=1==t.text.length,c=mo(t.text).length+(u?i:0);if(a)for(var p=0;p<a.length;++p)null==(d=a[p]).to&&((f=Ln(l,d.marker))?u&&(d.to=null==f.to?null:f.to+c):d.to=i);if(l)for(p=0;p<l.length;++p){var d,f;null!=(d=l[p]).to&&(d.to+=c),null==d.from?(f=Ln(a,d.marker))||(d.from=c,u&&(a||(a=[])).push(d)):(d.from+=c,u&&(a||(a=[])).push(d))}a&&(a=Rn(a)),l&&l!=a&&(l=Rn(l));var h=[a];if(!u){var g,m=t.text.length-2;if(m>0&&a)for(p=0;p<a.length;++p)null==a[p].to&&(g||(g=[])).push(new Sn(a[p].marker,null,null));for(p=0;p<m;++p)h.push(g);h.push(l)}return h}function Rn(e){for(var t=0;t<e.length;++t){var r=e[t];null!=r.from&&r.from==r.to&&!1!==r.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function On(e,t){var r=function(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var n=0,i=[];n<t.text.length;++n)i.push(Mi(r[n]));return i}(e,t),n=bn(e,t);if(!r)return n;if(!n)return r;for(var i=0;i<r.length;++i){var o=r[i],s=n[i];if(o&&s)e:for(var a=0;a<s.length;++a){for(var l=s[a],u=0;u<o.length;++u)if(o[u].marker==l.marker)continue e;o.push(l)}else s&&(r[i]=s)}return r}function wn(e){var t=e.markedSpans;if(t){for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}}function Pn(e,t){if(t){for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}}function Dn(e){return e.inclusiveLeft?-1:0}function _n(e){return e.inclusiveRight?1:0}function kn(e,t){var r=e.lines.length-t.lines.length;if(0!=r)return r;var n=e.find(),i=t.find(),o=he(n.from,i.from)||Dn(e)-Dn(t);if(o)return-o;var s=he(n.to,i.to)||_n(e)-_n(t);return s||t.id-e.id}function Mn(e,t){var r,n=N&&e.markedSpans;if(n)for(var i,o=0;o<n.length;++o)(i=n[o]).marker.collapsed&&null==(t?i.from:i.to)&&(!r||kn(r,i.marker)<0)&&(r=i.marker);return r}function Fn(e){return Mn(e,!0)}function Gn(e){return Mn(e,!1)}function Un(e,t,r,n,i){var o=Ci(e,t),s=N&&o.markedSpans;if(s)for(var a=0;a<s.length;++a){var l=s[a];if(l.marker.collapsed){var u=l.marker.find(0),c=he(u.from,r)||Dn(l.marker)-Dn(i),p=he(u.to,n)||_n(l.marker)-_n(i);if(!(c>=0&&p<=0||c<=0&&p>=0)&&(c<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?he(u.to,r)>=0:he(u.to,r)>0)||c>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?he(u.from,n)<=0:he(u.from,n)<0)))return!0}}}function Bn(e){for(var t;t=Fn(e);)e=t.find(-1,!0).line;return e}function jn(e,t){var r=Ci(e,t),n=Bn(r);return r==n?t:Li(n)}function Vn(e,t){if(t>e.lastLine())return t;var r,n=Ci(e,t);if(!Hn(e,n))return t;for(;r=Gn(n);)n=r.find(1,!0).line;return Li(n)+1}function Hn(e,t){var r=N&&t.markedSpans;if(r)for(var n,i=0;i<r.length;++i)if((n=r[i]).marker.collapsed){if(null==n.from)return!0;if(!n.marker.widgetNode&&0==n.from&&n.marker.inclusiveLeft&&qn(e,t,n))return!0}}function qn(e,t,r){if(null==r.to){var n=r.marker.find(1,!0);return qn(e,n.line,Ln(n.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var i,o=0;o<t.markedSpans.length;++o)if((i=t.markedSpans[o]).marker.collapsed&&!i.marker.widgetNode&&i.from==r.to&&(null==i.to||i.to!=r.from)&&(i.marker.inclusiveLeft||r.marker.inclusiveRight)&&qn(e,t,i))return!0}io(Cn),Cn.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Ji(this,"clear")}},Cn.prototype.find=function(e,t){return this.primary.find(e,t)};var $n=I.LineWidget=function(e,t,r){if(r)for(var n in r)r.hasOwnProperty(n)&&(this[n]=r[n]);this.doc=e,this.node=t};function Wn(e,t,r){bi(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&$r(e,null,r)}function zn(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!_o(document.body,e.node)){var r="position: relative;";e.coverGutter&&(r+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(r+="width: "+t.display.wrapper.clientWidth+"px;"),Do(t.display.measure,wo("div",[e.node],null,r))}return e.height=e.node.parentNode.offsetHeight}io($n),$n.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,r=this.line,n=Li(r);if(null!=n&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(r.widgets=null);var o=zn(this);Si(r,Math.max(0,r.height-o)),e&&Xt(e,(function(){Wn(e,r,-o),rr(e,n,"widget")}))}},$n.prototype.changed=function(){var e=this.height,t=this.doc.cm,r=this.line;this.height=null;var n=zn(this)-e;n&&(Si(r,r.height+n),t&&Xt(t,(function(){t.curOp.forceUpdate=!0,Wn(t,r,n)})))};var Qn=I.Line=function(e,t,r){this.text=e,Pn(this,t),this.height=r?r(this):1};function Xn(e){e.parent=null,wn(e)}function Yn(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var n=r[1]?"bgClass":"textClass";null==t[n]?t[n]=r[2]:new RegExp("(?:^|s)"+r[2]+"(?:$|s)").test(t[n])||(t[n]+=" "+r[2])}return e}function Kn(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var r=I.innerMode(e,t);return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function Zn(e,t,r,n){for(var i=0;i<10;i++){n&&(n[0]=I.innerMode(e,r).mode);var o=e.token(t,r);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}function Jn(e,t,r,n){function i(e){return{start:p.start,end:p.pos,string:p.current(),type:o||null,state:e?un(s.mode,c):c}}var o,s=e.doc,a=s.mode;t=Fe(s,t);var l,u=Ci(s,t.line),c=at(e,t.line,r),p=new vn(u.text,e.options.tabSize);for(n&&(l=[]);(n||p.pos<t.ch)&&!p.eol();)p.start=p.pos,o=Zn(a,p,c),n&&l.push(i(!0));return n?l:i()}function ei(e,t,r,n,i,o,s){var a=r.flattenSpans;null==a&&(a=e.options.flattenSpans);var l,u=0,c=null,p=new vn(t,e.options.tabSize),d=e.options.addModeClass&&[null];for(""==t&&Yn(Kn(r,n),o);!p.eol();){if(p.pos>e.options.maxHighlightLength?(a=!1,s&&ni(e,t,n,p.pos),p.pos=t.length,l=null):l=Yn(Zn(r,p,n,d),o),d){var f=d[0].name;f&&(l="m-"+(l?f+" "+l:f))}if(!a||c!=l){for(;u<p.start;)i(u=Math.min(p.start,u+5e4),c);c=l}p.start=p.pos}for(;u<p.pos;){var h=Math.min(p.pos,u+5e4);i(h,c),u=h}}function ti(e,t,r,n){var i=[e.state.modeGen],o={};ei(e,t.text,e.doc.mode,r,(function(e,t){i.push(e,t)}),o,n);for(var s=0;s<e.state.overlays.length;++s){var a=e.state.overlays[s],l=1,u=0;ei(e,t.text,a.mode,!0,(function(e,t){for(var r=l;u<e;){var n=i[l];n>e&&i.splice(l,1,e,i[l+1],n),l+=2,u=Math.min(e,n)}if(t)if(a.opaque)i.splice(r,l-r,e,"cm-overlay "+t),l=r+2;else for(;r<l;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 ri(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=at(e,Li(t)),i=ti(e,t,t.text.length>e.options.maxHighlightLength?un(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 ni(e,t,r,n){var i=e.doc.mode,o=new vn(t,e.options.tabSize);for(o.start=o.pos=n||0,""==t&&Kn(i,r);!o.eol();)Zn(i,o,r),o.start=o.pos}io(Qn),Qn.prototype.lineNo=function(){return Li(this)};var ii={},oi={};function si(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?oi:ii;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function ai(e,t){var r=wo("span",null,null,a?"padding-right: .1px":null),n={pre:wo("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:(o||a)&&e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var s,l=i?t.rest[i-1]:t.line;n.pos=0,n.addToken=li,Wo(e.display.measure)&&(s=Ri(l))&&(n.addToken=ui(n.addToken,s)),n.map=[],pi(l,n,ri(e,l,t!=e.display.externalMeasured&&Li(l))),l.styleClasses&&(l.styleClasses.bgClass&&(n.bgClass=Uo(l.styleClasses.bgClass,n.bgClass||"")),l.styleClasses.textClass&&(n.textClass=Uo(l.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild($o(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({}))}if(a){var u=n.content.lastChild;(/\bcm-tab\b/.test(u.className)||u.querySelector&&u.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return Ki(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=Uo(n.pre.className,n.textClass||"")),n}function li(e,t,r,n,i,a,l){if(t){var u=e.splitSpaces?function(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",i=0;i<e.length;i++){var o=e.charAt(i);" "!=o||!r||i!=e.length-1&&32!=e.charCodeAt(i+1)||(o=" "),n+=o,r=" "==o}return n}(t,e.trailingSpace):t,c=e.cm.state.specialChars,p=!1;if(c.test(t)){v=document.createDocumentFragment();for(var d=0;;){c.lastIndex=d;var f=c.exec(t),h=f?f.index-d:t.length-d;if(h){var g=document.createTextNode(u.slice(d,d+h));o&&s<9?v.appendChild(wo("span",[g])):v.appendChild(g),e.map.push(e.pos,e.pos+h,g),e.col+=h,e.pos+=h}if(!f)break;if(d+=h+1,"\t"==f[0]){var m=e.cm.options.tabSize,E=m-e.col%m;(g=v.appendChild(wo("span",go(E),"cm-tab"))).setAttribute("role","presentation"),g.setAttribute("cm-text","\t"),e.col+=E}else"\r"==f[0]||"\n"==f[0]?((g=v.appendChild(wo("span","\r"==f[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",f[0]),e.col+=1):((g=e.cm.options.specialCharPlaceholder(f[0])).setAttribute("cm-text",f[0]),o&&s<9?v.appendChild(wo("span",[g])):v.appendChild(g),e.col+=1);e.map.push(e.pos,e.pos+1,g),e.pos++}}else{e.col+=t.length;var v=document.createTextNode(u);e.map.push(e.pos,e.pos+t.length,v),o&&s<9&&(p=!0),e.pos+=t.length}if(e.trailingSpace=32==u.charCodeAt(t.length-1),r||n||i||p||l){var x=r||"";n&&(x+=n),i&&(x+=i);var y=wo("span",[v],x,l);return a&&(y.title=a),e.content.appendChild(y)}e.content.appendChild(v)}}function ui(e,t){return function(r,n,i,o,s,a,l){i=i?i+" cm-force-border":"cm-force-border";for(var u=r.pos,c=u+n.length;;){for(var p=0;p<t.length;p++){var d=t[p];if(d.to>u&&d.from<=u)break}if(d.to>=c)return e(r,n,i,o,s,a,l);e(r,n.slice(0,d.to-u),i,o,null,a,l),o=null,n=n.slice(d.to-u),u=d.to}}}function ci(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function pi(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var s,a,l,u,c,p,d,f=i.length,h=0,g=(S=1,""),m=0;;){if(m==h){l=u=c=p=a="",d=null,m=1/0;for(var E,v=[],x=0;x<n.length;++x){var y=n[x],T=y.marker;"bookmark"==T.type&&y.from==h&&T.widgetNode?v.push(T):y.from<=h&&(null==y.to||y.to>h||T.collapsed&&y.to==h&&y.from==h)?(null!=y.to&&y.to!=h&&m>y.to&&(m=y.to,u=""),T.className&&(l+=" "+T.className),T.css&&(a=(a?a+";":"")+T.css),T.startStyle&&y.from==h&&(c+=" "+T.startStyle),T.endStyle&&y.to==m&&(E||(E=[])).push(T.endStyle,y.to),T.title&&!p&&(p=T.title),T.collapsed&&(!d||kn(d.marker,T)<0)&&(d=y)):y.from>h&&m>y.from&&(m=y.from)}if(E)for(x=0;x<E.length;x+=2)E[x+1]==m&&(u+=" "+E[x]);if(!d||d.from==h)for(x=0;x<v.length;++x)ci(t,0,v[x]);if(d&&(d.from||0)==h){if(ci(t,(null==d.to?f+1:d.to)-h,d.marker,null==d.from),null==d.to)return;d.to==h&&(d=!1)}}if(h>=f)break;for(var C=Math.min(f,m);;){if(g){var N=h+g.length;if(!d){var I=N>C?g.slice(0,C-h):g;t.addToken(t,I,s?s+l:l,c,h+I.length==m?u:"",p,a)}if(N>=C){g=g.slice(C-h),h=C;break}h=N,c=""}g=i.slice(o,o=r[S++]),s=si(r[S++],t.cm.options)}}else for(var S=1;S<r.length;S+=2)t.addToken(t,i.slice(o,o=r[S]),si(r[S+1],t.cm.options))}function di(e,t){return 0==t.from.ch&&0==t.to.ch&&""==mo(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function fi(e,t,r,n){function i(e){return r?r[e]:null}function o(e,r,i){!function(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),wn(e),Pn(e,r);var i=n?n(e):1;i!=e.height&&Si(e,i)}(e,r,i,n),Ji(e,"change",e,t)}function s(e,t){for(var r=e,o=[];r<t;++r)o.push(new Qn(u[r],i(r),n));return o}var a=t.from,l=t.to,u=t.text,c=Ci(e,a.line),p=Ci(e,l.line),d=mo(u),f=i(u.length-1),h=l.line-a.line;if(t.full)e.insert(0,s(0,u.length)),e.remove(u.length,e.size-u.length);else if(di(e,t)){var g=s(0,u.length-1);o(p,p.text,f),h&&e.remove(a.line,h),g.length&&e.insert(a.line,g)}else c==p?1==u.length?o(c,c.text.slice(0,a.ch)+d+c.text.slice(l.ch),f):((g=s(1,u.length-1)).push(new Qn(d+c.text.slice(l.ch),f,n)),o(c,c.text.slice(0,a.ch)+u[0],i(0)),e.insert(a.line+1,g)):1==u.length?(o(c,c.text.slice(0,a.ch)+u[0]+p.text.slice(l.ch),i(0)),e.remove(a.line+1,h)):(o(c,c.text.slice(0,a.ch)+u[0],i(0)),o(p,d+p.text.slice(l.ch),f),g=s(1,u.length-1),h>1&&e.remove(a.line+1,h-1),e.insert(a.line+1,g));Ji(e,"change",e,t)}function hi(e){this.lines=e,this.parent=null;for(var t=0,r=0;t<e.length;++t)e[t].parent=this,r+=e[t].height;this.height=r}function gi(e){this.children=e;for(var t=0,r=0,n=0;n<e.length;++n){var i=e[n];t+=i.chunkSize(),r+=i.height,i.parent=this}this.size=t,this.height=r,this.parent=null}hi.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r=e,n=e+t;r<n;++r){var i=this.lines[r];this.height-=i.height,Xn(i),Ji(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;n<t.length;++n)t[n].parent=this},iterN:function(e,t,r){for(var n=e+t;e<n;++e)if(r(this.lines[e]))return!0}},gi.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var r=0;r<this.children.length;++r){var n=this.children[r],i=n.chunkSize();if(e<i){var o=Math.min(t,i-e),s=n.height;if(n.removeInner(e,o),this.height-=s-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 hi))){var a=[];this.collapse(a),this.children=[new hi(a)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,r){this.size+=t.length,this.height+=r;for(var n=0;n<this.children.length;++n){var i=this.children[n],o=i.chunkSize();if(e<=o){if(i.insertInner(e,t,r),i.lines&&i.lines.length>50){for(var s=i.lines.length%25+25,a=s;a<i.lines.length;){var l=new hi(i.lines.slice(a,a+=25));i.height-=l.height,this.children.splice(++n,0,l),l.parent=this}i.lines=i.lines.slice(0,s),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new gi(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var r=vo(e.parent.children,e);e.parent.children.splice(r+1,0,t)}else{var n=new gi(e.children);n.parent=e,e.children=[n,t],e=n}t.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var n=0;n<this.children.length;++n){var i=this.children[n],o=i.chunkSize();if(e<o){var s=Math.min(t,o-e);if(i.iterN(e,s,r))return!0;if(0==(t-=s))break;e=0}else e-=o}}};var mi=0,Ei=I.Doc=function(e,t,r,n){if(!(this instanceof Ei))return new Ei(e,t,r,n);null==r&&(r=0),gi.call(this,[new hi([new Qn("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=r;var i=fe(r,0);this.sel=ke(i),this.history=new Oi(null),this.id=++mi,this.modeOption=t,this.lineSep=n,this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),fi(this,{from:i,to:i,text:e}),We(this,ke(i),ao)};Ei.prototype=To(gi.prototype,{constructor:Ei,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<t.length;++n)r+=t[n].height;this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Ii(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:Zt((function(e){var t=fe(this.first,0),r=this.first+this.size-1;Gr(this,{from:t,to:fe(r,Ci(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),We(this,ke(t))})),replaceRange:function(e,t,r,n){Hr(this,e,t=Fe(this,t),r=r?Fe(this,r):t,n)},getRange:function(e,t,r){var n=Ni(this,Fe(this,e),Fe(this,t));return!1===r?n:n.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Ge(this,e))return Ci(this,e)},getLineNumber:function(e){return Li(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Ci(this,e)),Bn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return Fe(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Zt((function(e,t,r){qe(this,Fe(this,"number"==typeof e?fe(e,t||0):e),null,r)})),setSelection:Zt((function(e,t,r){qe(this,Fe(this,e),Fe(this,t||e),r)})),extendSelection:Zt((function(e,t,r){je(this,Fe(this,e),t&&Fe(this,t),r)})),extendSelections:Zt((function(e,t){Ve(this,Ue(this,e),t)})),extendSelectionsBy:Zt((function(e,t){Ve(this,Ue(this,xo(this.sel.ranges,e)),t)})),setSelections:Zt((function(e,t,r){if(e.length){for(var n=0,i=[];n<e.length;n++)i[n]=new De(Fe(this,e[n].anchor),Fe(this,e[n].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),We(this,_e(i,t),r)}})),addSelection:Zt((function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new De(Fe(this,e),Fe(this,t||e))),We(this,_e(n,n.length-1),r)})),getSelection:function(e){for(var t,r=this.sel.ranges,n=0;n<r.length;n++){var i=Ni(this,r[n].from(),r[n].to());t=t?t.concat(i):i}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],r=this.sel.ranges,n=0;n<r.length;n++){var i=Ni(this,r[n].from(),r[n].to());!1!==e&&(i=i.join(e||this.lineSeparator())),t[n]=i}return t},replaceSelection:function(e,t,r){for(var n=[],i=0;i<this.sel.ranges.length;i++)n[i]=e;this.replaceSelections(n,t,r||"+input")},replaceSelections:Zt((function(e,t,r){for(var n=[],i=this.sel,o=0;o<i.ranges.length;o++){var s=i.ranges[o];n[o]={from:s.from(),to:s.to(),text:this.splitLines(e[o]),origin:r}}var a=t&&"end"!=t&&function(e,t,r){for(var n=[],i=fe(e.first,0),o=i,s=0;s<t.length;s++){var a=t[s],l=Mr(a.from,i,o),u=Mr(Dr(a),i,o);if(i=a.to,o=u,"around"==r){var c=e.sel.ranges[s],p=he(c.head,c.anchor)<0;n[s]=new De(p?u:l,p?l:u)}else n[s]=new De(l,l)}return new Pe(n,e.sel.primIndex)}(this,n,t);for(o=n.length-1;o>=0;o--)Gr(this,n[o]);a?$e(this,a):this.cm&&Wr(this.cm)})),undo:Zt((function(){Br(this,"undo")})),redo:Zt((function(){Br(this,"redo")})),undoSelection:Zt((function(){Br(this,"undo",!0)})),redoSelection:Zt((function(){Br(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.done.length;n++)e.done[n].ranges||++t;for(n=0;n<e.undone.length;n++)e.undone[n].ranges||++r;return{undo:t,redo:r}},clearHistory:function(){this.history=new Oi(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Fi(this.history.done),undone:Fi(this.history.undone)}},setHistory:function(e){var t=this.history=new Oi(this.history.maxGeneration);t.done=Fi(e.done.slice(0),null,!0),t.undone=Fi(e.undone.slice(0),null,!0)},addLineClass:Zt((function(e,t,r){return Xr(this,e,"gutter"==t?"gutter":"class",(function(e){var n="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[n]){if(Mo(r).test(e[n]))return!1;e[n]+=" "+r}else e[n]=r;return!0}))})),removeLineClass:Zt((function(e,t,r){return Xr(this,e,"gutter"==t?"gutter":"class",(function(e){var n="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",i=e[n];if(!i)return!1;if(null==r)e[n]=null;else{var o=i.match(Mo(r));if(!o)return!1;var s=o.index+o[0].length;e[n]=i.slice(0,o.index)+(o.index&&s!=i.length?" ":"")+i.slice(s)||null}return!0}))})),addLineWidget:Zt((function(e,t,r){return function(e,t,r,n){var i=new $n(e,r,n),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),Xr(e,t,"widget",(function(t){var r=t.widgets||(t.widgets=[]);if(null==i.insertAt?r.push(i):r.splice(Math.min(r.length-1,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!Hn(e,t)){var n=bi(t)<e.scrollTop;Si(t,t.height+zn(i)),n&&$r(o,null,i.height),o.curOp.forceUpdate=!0}return!0})),i}(this,e,t,r)})),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return Tn(this,Fe(this,e),Fe(this,t),r,r&&r.type||"range")},setBookmark:function(e,t){var r={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return Tn(this,e=Fe(this,e),e,r,"bookmark")},findMarksAt:function(e){var t=[],r=Ci(this,(e=Fe(this,e)).line).markedSpans;if(r)for(var n=0;n<r.length;++n){var i=r[n];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,r){e=Fe(this,e),t=Fe(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,(function(o){var s=o.markedSpans;if(s)for(var a=0;a<s.length;a++){var l=s[a];null!=l.to&&i==e.line&&e.ch>=l.to||null==l.from&&i!=e.line||null!=l.from&&i==t.line&&l.from>=t.ch||r&&!r(l.marker)||n.push(l.marker.parent||l.marker)}++i})),n},getAllMarks:function(){var e=[];return this.iter((function(t){var r=t.markedSpans;if(r)for(var n=0;n<r.length;++n)null!=r[n].from&&e.push(r[n].marker)})),e},posFromIndex:function(e){var t,r=this.first,n=this.lineSeparator().length;return this.iter((function(i){var o=i.text.length+n;if(o>e)return t=e,!0;e-=o,++r})),Fe(this,fe(r,t))},indexFromPos:function(e){var t=(e=Fe(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var r=this.lineSeparator().length;return this.iter(this.first,e.line,(function(e){t+=e.text.length+r})),t},copy:function(e){var t=new Ei(Ii(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,r=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<r&&(r=e.to);var n=new Ei(Ii(this,t,r),e.mode||this.modeOption,t,this.lineSep);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=n.find(),o=e.clipPos(i.from),s=e.clipPos(i.to);if(he(o,s)){var a=Tn(e,o,s,n.primary,n.primary.type);n.markers.push(a),a.parent=n}}}(n,Nn(this)),n},unlinkDoc:function(e){if(e instanceof I&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t)if(this.linked[t].doc==e){this.linked.splice(t,1),e.unlinkDoc(this),In(Nn(this));break}if(e.history==this.history){var r=[e.id];yi(e,(function(e){r.push(e.id)}),!0),e.history=new Oi(null),e.history.done=Fi(this.history.done,r),e.history.undone=Fi(this.history.undone,r)}},iterLinkedDocs:function(e){yi(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Xo(e)},lineSeparator:function(){return this.lineSep||"\n"}}),Ei.prototype.eachLine=Ei.prototype.iter;var vi="iter insert remove copy getEditor constructor".split(" ");for(var xi in Ei.prototype)Ei.prototype.hasOwnProperty(xi)&&vo(vi,xi)<0&&(I.prototype[xi]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ei.prototype[xi]));function yi(e,t,r){!function e(n,i,o){if(n.linked)for(var s=0;s<n.linked.length;++s){var a=n.linked[s];if(a.doc!=i){var l=o&&a.sharedHist;r&&!l||(t(a.doc,l),e(a.doc,n,l))}}}(e,null,!0)}function Ti(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,R(e),L(e),e.options.lineWrapping||k(e),e.options.mode=t.modeOption,tr(e)}function Ci(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],o=i.chunkSize();if(t<o){r=i;break}t-=o}return r.lines[t]}function Ni(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 Ii(e,t,r){var n=[];return e.iter(t,r,(function(e){n.push(e.text)})),n}function Si(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function Li(e){if(null==e.parent)return null;for(var t=e.parent,r=vo(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 Ai(e,t){var r=e.first;e:do{for(var n=0;n<e.children.length;++n){var i=e.children[n],o=i.height;if(t<o){e=i;continue e}t-=o,r+=i.chunkSize()}return r}while(!e.lines);for(n=0;n<e.lines.length;++n){var s=e.lines[n].height;if(t<s)break;t-=s}return r+n}function bi(e){for(var t=0,r=(e=Bn(e)).parent,n=0;n<r.lines.length;++n){var i=r.lines[n];if(i==e)break;t+=i.height}for(var o=r.parent;o;o=(r=o).parent)for(n=0;n<o.children.length;++n){var s=o.children[n];if(s==r)break;t+=s.height}return t}function Ri(e){var t=e.order;return null==t&&(t=e.order=ps(e.text)),t}function Oi(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function wi(e,t){var r={from:ge(t.from),to:Dr(t),text:Ni(e,t.from,t.to)};return ki(e,r,t.from.line,t.to.line+1),yi(e,(function(e){ki(e,r,t.from.line,t.to.line+1)}),!0),r}function Pi(e){for(;e.length&&mo(e).ranges;)e.pop()}function Di(e,t,r,n){var i=e.history;i.undone.length=0;var o,s=+new Date;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>s-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=function(e,t){return t?(Pi(e.done),mo(e.done)):e.done.length&&!mo(e.done).ranges?mo(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),mo(e.done)):void 0}(i,i.lastOp==n))){var a=mo(o.changes);0==he(t.from,t.to)&&0==he(t.from,a.to)?a.to=Dr(t):o.changes.push(wi(e,t))}else{var l=mo(i.done);for(l&&l.ranges||_i(e.sel,i.done),o={changes:[wi(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,a||Ki(e,"historyAdded")}function _i(e,t){var r=mo(t);r&&r.ranges&&r.equals(e)||t.push(e)}function ki(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 Mi(e){if(!e)return null;for(var t,r=0;r<e.length;++r)e[r].marker.explicitlyCleared?t||(t=e.slice(0,r)):t&&t.push(e[r]);return t?t.length?t:null:e}function Fi(e,t,r){for(var n=0,i=[];n<e.length;++n){var o=e[n];if(o.ranges)i.push(r?Pe.prototype.deepCopy.call(o):o);else{var s=o.changes,a=[];i.push({changes:a});for(var l=0;l<s.length;++l){var u,c=s[l];if(a.push({from:c.from,to:c.to,text:c.text}),t)for(var p in c)(u=p.match(/^spans_(\d+)$/))&&vo(t,Number(u[1]))>-1&&(mo(a)[p]=c[p],delete c[p])}}}return i}function Gi(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function Ui(e,t,r,n){for(var i=0;i<e.length;++i){var o=e[i],s=!0;if(o.ranges){o.copied||((o=e[i]=o.deepCopy()).copied=!0);for(var a=0;a<o.ranges.length;a++)Gi(o.ranges[a].anchor,t,r,n),Gi(o.ranges[a].head,t,r,n)}else{for(a=0;a<o.changes.length;++a){var l=o.changes[a];if(r<l.from.line)l.from=fe(l.from.line+n,l.from.ch),l.to=fe(l.to.line+n,l.to.ch);else if(t<=l.to.line){s=!1;break}}s||(e.splice(0,i+1),i=0)}}}function Bi(e,t){var r=t.from.line,n=t.to.line,i=t.text.length-(n-r)-1;Ui(e.done,r,n,i),Ui(e.undone,r,n,i)}io(Ei);var ji=I.e_preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},Vi=I.e_stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0};function Hi(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}var qi=I.e_stop=function(e){ji(e),Vi(e)};function $i(e){return e.target||e.srcElement}function Wi(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),m&&e.ctrlKey&&1==t&&(t=3),t}var zi=I.on=function(e,t,r){if(e.addEventListener)e.addEventListener(t,r,!1);else if(e.attachEvent)e.attachEvent("on"+t,r);else{var n=e._handlers||(e._handlers={});(n[t]||(n[t]=[])).push(r)}},Qi=[];function Xi(e,t,r){var n=e._handlers&&e._handlers[t];return r?n&&n.length>0?n.slice():Qi:n||Qi}var Yi=I.off=function(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else for(var n=Xi(e,t,!1),i=0;i<n.length;++i)if(n[i]==r){n.splice(i,1);break}},Ki=I.signal=function(e,t){var r=Xi(e,t,!0);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),i=0;i<r.length;++i)r[i].apply(null,n)},Zi=null;function Ji(e,t){var r=Xi(e,t,!1);if(r.length){var n,i=Array.prototype.slice.call(arguments,2);Bt?n=Bt.delayedCallbacks:Zi?n=Zi:(n=Zi=[],setTimeout(eo,0));for(var o=0;o<r.length;++o)n.push(s(r[o]))}function s(e){return function(){e.apply(null,i)}}}function eo(){var e=Zi;Zi=null;for(var t=0;t<e.length;++t)e[t]()}function to(e,t,r){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ki(e,r||t.type,e,t),Hi(t)||t.codemirrorIgnore}function ro(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)-1==vo(r,t[n])&&r.push(t[n])}function no(e,t){return Xi(e,t).length>0}function io(e){e.prototype.on=function(e,t){zi(this,e,t)},e.prototype.off=function(e,t){Yi(this,e,t)}}var oo=30,so=I.Pass={toString:function(){return"CodeMirror.Pass"}},ao={scroll:!1},lo={origin:"*mouse"},uo={origin:"+move"};function co(){this.id=null}co.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var po=I.countColumn=function(e,t,r,n,i){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=n||0,s=i||0;;){var a=e.indexOf("\t",o);if(a<0||a>=t)return s+(t-o);s+=a-o,s+=r-s%r,o=a+1}},fo=I.findColumn=function(e,t,r){for(var n=0,i=0;;){var o=e.indexOf("\t",n);-1==o&&(o=e.length);var s=o-n;if(o==e.length||i+s>=t)return n+Math.min(s,t-i);if(i+=o-n,n=o+1,(i+=r-i%r)>=t)return n}},ho=[""];function go(e){for(;ho.length<=e;)ho.push(mo(ho)+" ");return ho[e]}function mo(e){return e[e.length-1]}var Eo=function(e){e.select()};function vo(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}function xo(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function yo(){}function To(e,t){var r;return Object.create?r=Object.create(e):(yo.prototype=e,r=new yo),t&&Co(t,r),r}function Co(e,t,r){for(var n in t||(t={}),e)!e.hasOwnProperty(n)||!1===r&&t.hasOwnProperty(n)||(t[n]=e[n]);return t}function No(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}h?Eo=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:o&&(Eo=function(e){try{e.select()}catch(e){}});var Io=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,So=I.isWordChar=function(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||Io.test(e))};function Lo(e,t){return t?!!(t.source.indexOf("\\w")>-1&&So(e))||t.test(e):So(e)}function Ao(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var bo,Ro=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Oo(e){return e.charCodeAt(0)>=768&&Ro.test(e)}function wo(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function Po(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function Do(e,t){return Po(e).appendChild(t)}bo=document.createRange?function(e,t,r,n){var i=document.createRange();return i.setEnd(n||e,r),i.setStart(e,t),i}:function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(e){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};var _o=I.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)};function ko(){for(var e=document.activeElement;e&&e.root&&e.root.activeElement;)e=e.root.activeElement;return e}function Mo(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}o&&s<11&&(ko=function(){try{return document.activeElement}catch(e){return document.body}});var Fo=I.rmClass=function(e,t){var r=e.className,n=Mo(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:"")}},Go=I.addClass=function(e,t){var r=e.className;Mo(t).test(r)||(e.className+=(r?" ":"")+t)};function Uo(e,t){for(var r=e.split(" "),n=0;n<r.length;n++)r[n]&&!Mo(r[n]).test(t)&&(t+=" "+r[n]);return t}function Bo(e){if(document.body.getElementsByClassName)for(var t=document.body.getElementsByClassName("CodeMirror"),r=0;r<t.length;r++){var n=t[r].CodeMirror;n&&e(n)}}var jo,Vo,Ho=!1,qo=function(){if(o&&s<9)return!1;var e=wo("div");return"draggable"in e||"dragDrop"in e}();function $o(e){if(null==jo){var t=wo("span","​");Do(e,wo("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(jo=t.offsetWidth<=1&&t.offsetHeight>2&&!(o&&s<8))}var r=jo?wo("span","​"):wo("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function Wo(e){if(null!=Vo)return Vo;var t=Do(e,document.createTextNode("AخA")),r=bo(t,0,1).getBoundingClientRect(),n=bo(t,1,2).getBoundingClientRect();return Po(e),!(!r||r.left==r.right)&&(Vo=n.right-r.right<3)}var zo,Qo,Xo=I.splitLines=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],n=e.length;t<=n;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),s=o.indexOf("\r");-1!=s?(r.push(o.slice(0,s)),t+=s+1):(r.push(o),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},Yo=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Ko="oncopy"in(zo=wo("div"))||(zo.setAttribute("oncopy","return;"),"function"==typeof zo.oncopy),Zo=null,Jo=I.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 es(e){return e.level%2?e.to:e.from}function ts(e){return e.level%2?e.from:e.to}function rs(e){var t=Ri(e);return t?es(t[0]):0}function ns(e){var t=Ri(e);return t?ts(mo(t)):e.text.length}function is(e,t){var r=Ci(e.doc,t),n=Bn(r);n!=r&&(t=Li(n));var i=Ri(n),o=i?i[0].level%2?ns(n):rs(n):0;return fe(t,o)}function os(e,t){var r=is(e,t.line),n=Ci(e.doc,r.line),i=Ri(n);if(!i||0==i[0].level){var o=Math.max(0,n.text.search(/\S/)),s=t.line==r.line&&t.ch<=o&&t.ch;return fe(r.line,s?0:o)}return r}function ss(e,t,r){var n=e[0].level;return t==n||r!=n&&t<r}function as(e,t){Qo=null;for(var r,n=0;n<e.length;++n){var i=e[n];if(i.from<t&&i.to>t)return n;if(i.from==t||i.to==t){if(null!=r)return ss(e,i.level,e[r].level)?(i.from!=i.to&&(Qo=r),n):(i.from!=i.to&&(Qo=n),r);r=n}}return r}function ls(e,t,r,n){if(!n)return t+r;do{t+=r}while(t>0&&Oo(e.text.charAt(t)));return t}function us(e,t,r,n){var i=Ri(e);if(!i)return cs(e,t,r,n);for(var o=as(i,t),s=i[o],a=ls(e,t,s.level%2?-r:r,n);;){if(a>s.from&&a<s.to)return a;if(a==s.from||a==s.to)return as(i,a)==o?a:r>0==(s=i[o+=r]).level%2?s.to:s.from;if(!(s=i[o+=r]))return null;a=r>0==s.level%2?ls(e,s.to,-1,n):ls(e,s.from,1,n)}}function cs(e,t,r,n){var i=t+r;if(n)for(;i>0&&Oo(e.text.charAt(i));)i+=r;return i<0||i>e.text.length?null:i}!function(){for(var e=0;e<10;e++)Jo[e+48]=Jo[e+96]=String(e);for(e=65;e<=90;e++)Jo[e]=String.fromCharCode(e);for(e=1;e<=12;e++)Jo[e+111]=Jo[e+63235]="F"+e}();var ps=function(){var e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,r=/[LRr]/,n=/[Lb1n]/,i=/[1n]/;function o(e,t,r){this.level=e,this.from=t,this.to=r}return function(s){if(!e.test(s))return!1;for(var a,l=s.length,u=[],c=0;c<l;++c)u.push(m=(a=s.charCodeAt(c))<=247?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(a):1424<=a&&a<=1524?"R":1536<=a&&a<=1773?"rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm".charAt(a-1536):1774<=a&&a<=2220?"r":8192<=a&&a<=8203?"w":8204==a?"b":"L");c=0;for(var p="L";c<l;++c)"m"==(m=u[c])?u[c]=p:p=m;c=0;for(var d="L";c<l;++c)"1"==(m=u[c])&&"r"==d?u[c]="n":r.test(m)&&(d=m,"r"==m&&(u[c]="R"));for(c=1,p=u[0];c<l-1;++c)"+"==(m=u[c])&&"1"==p&&"1"==u[c+1]?u[c]="1":","!=m||p!=u[c+1]||"1"!=p&&"n"!=p||(u[c]=p),p=m;for(c=0;c<l;++c)if(","==(m=u[c]))u[c]="N";else if("%"==m){for(var f=c+1;f<l&&"%"==u[f];++f);for(var h=c&&"!"==u[c-1]||f<l&&"1"==u[f]?"1":"N",g=c;g<f;++g)u[g]=h;c=f-1}for(c=0,d="L";c<l;++c){var m=u[c];"L"==d&&"1"==m?u[c]="L":r.test(m)&&(d=m)}for(c=0;c<l;++c)if(t.test(u[c])){for(f=c+1;f<l&&t.test(u[f]);++f);var E="L"==(c?u[c-1]:"L"),v="L"==(f<l?u[f]:"L");for(h=E||v?"L":"R",g=c;g<f;++g)u[g]=h;c=f-1}var x,y=[];for(c=0;c<l;)if(n.test(u[c])){var T=c;for(++c;c<l&&n.test(u[c]);++c);y.push(new o(0,T,c))}else{var C=c,N=y.length;for(++c;c<l&&"L"!=u[c];++c);for(g=C;g<c;)if(i.test(u[g])){C<g&&y.splice(N,0,new o(1,C,g));var I=g;for(++g;g<c&&i.test(u[g]);++g);y.splice(N,0,new o(2,I,g)),C=g}else++g;C<c&&y.splice(N,0,new o(1,C,c))}return 1==y[0].level&&(x=s.match(/^\s+/))&&(y[0].from=x[0].length,y.unshift(new o(0,0,x[0].length))),1==mo(y).level&&(x=s.match(/\s+$/))&&(mo(y).to-=x[0].length,y.push(new o(0,l-x[0].length,l))),2==y[0].level&&y.unshift(new o(1,y[0].to,y[0].to)),y[0].level!=mo(y).level&&y.push(new o(y[0].level,l,l)),y}}();return I.version="5.17.0",I}))},{}],16:[function(e,t,r){
3
3
  /*!
4
4
  * jQuery JavaScript Library v2.2.4