graphdb-workbench
Version:
The web application for GraphDB APIs
1 lines • 45.5 kB
JavaScript
class e{static deepEqual(t,s){if(t===s)return!0;if(null==t||null==s)return!1;if("object"==typeof t&&"object"==typeof s){if(t.constructor!==s.constructor)return!1;if(Array.isArray(t)&&Array.isArray(s)){if(t.length!==s.length)return!1;for(let r=0;r<t.length;r++)if(!e.deepEqual(t[r],s[r]))return!1;return!0}if(!Array.isArray(t)&&!Array.isArray(s)){const r=Object.keys(t),i=Object.keys(s);if(r.length!==i.length)return!1;for(const i of r)if(!(i in s)||!e.deepEqual(t[i],s[i]))return!1;return!0}return!1}return!1}static deepCopy(t){if("object"!=typeof t||null==t||"function"==typeof t)return t;if(Array.isArray(t))return t.map(t=>e.deepCopy(t));const s=Object.create(Object.getPrototypeOf(t));for(const r of Object.keys(t))s[r]=e.deepCopy(t[r]);return s}static hasCopyMethod(e){return"object"==typeof e&&null!==e&&Object.prototype.hasOwnProperty.call(e,"copy")&&"function"==typeof e.copy}}class t{copy(){return e.deepCopy(this)}}class s extends t{constructor(e=[]){super(),this.items=e}getItems(){return this.items}sort(e){this.items.sort(e)}filter(e){return this.items.filter(e)}find(e){return this.items.find(e)}isEmpty(){return 0===this.items.length}addToStart(e){this.items.unshift(e)}addItems(e){this.items.push(...e)}remove(e){const t=this.items.indexOf(e);-1!==t&&this.items.splice(t,1)}}class r extends s{constructor(e){super(e)}add(e){this.items.push(e)}addAll(e){this.items.push(...e)}unsubscribeAll(){this.items.forEach(e=>e()),this.items=[]}}class i extends t{constructor(e){super(),this.id=e?.id||"",this.title=e?.title||"",this.type=e?.type,this.sesameType=e?.sesameType,this.uri=e?.uri||"",this.externalUrl=e?.externalUrl||"",this.location=e?.location||"",this.state=e?.state,this.local=e?.local,this.readable=e?.readable,this.writable=e?.writable,this.unsupported=e?.unsupported,this.isNew=e?.isNew}toRepositoryReference(){return{id:this.id,location:this.location}}}const n=(e,t)=>{const s=e.location.localeCompare(t.location);return 0!==s?s:e.id.localeCompare(t.id)};class o extends s{constructor(e){super(e)}findRepository(e,t){return super.find(s=>s.id===e&&s.location===t)}sortByLocationAndId(){super.sort(n)}filterByRepository(e){return super.filter(this.createIdLocationFilter(e))}createIdLocationFilter(e){return t=>e.some(e=>e.id!==t.id||e.location!==t.location)}}class a extends t{constructor(e){super(),this.inferred=e?.inferred||0,this.total=e?.total||0,this.explicit=e?.explicit||0}}let u=function(e){return e.INACTIVE="INACTIVE",e.STARTING="STARTING",e.RUNNING="RUNNING",e.RESTARTING="RESTARTING",e.STOPPING="STOPPING",e}({}),c=function(e){return e.GRAPH_DB="graphdb",e.ONTOP="ontop",e.FEDEX="fedex",e.SYSTEM="system",e}({});class h{constructor(e){this.setNamespaces(e)}setNamespaces(e){this.namespaces=e}getByPrefix(e){return this.namespaces[e]||""}}class l extends t{constructor(e){super(),this.uri=e?.uri||"",this.label=e?.label||"",this.username=e?.username||"",this.password=e?.password||"",this.authType=e?.authType,this.locationType=e?.locationType,this.active=e?.active,this.local=e?.local,this.system=e?.system,this.errorMsg=e?.errorMsg||"",this.defaultRepository=e?.defaultRepository||""}}let p=function(e){return e.GDB="GDB",e.ONTOPIC="ONTOPIC",e.SPARQL="SPARQL",e}({});class g{constructor(e,t){this.NAME=e,this.payload=t}}const d={NAVIGATION_END:"navigationEnd",NAVIGATION_START:"navigationStart",LOGOUT:"logout",APP_DATA_LOADED:"applicationDataLoaded"};class E extends g{constructor(e,t){super(d.NAVIGATION_END,{oldUrl:e,newUrl:t})}}class S{}class A extends g{constructor(e,t,s){super(d.NAVIGATION_START,{oldUrl:e,newUrl:t,cancelNavigation:s})}}class R extends g{constructor(){super(d.LOGOUT)}}let T=function(e){return e.NONE="NONE",e.BASIC="BASIC",e.SIGNATURE="SIGNATURE",e}({});class C{static MAPPER_INSTANCES=new Map;static get(e){const t=e.name;if(!C.MAPPER_INSTANCES.has(t)){const s=new e;C.MAPPER_INSTANCES.set(t,s)}return C.MAPPER_INSTANCES.get(t)}}class I{static SERVICE_INSTANCES=new Map;static get(e){if(!I.SERVICE_INSTANCES.has(e.name)){const t=new e;I.implementsLifecycleHooks(t)&&t.onCreated?.(),I.SERVICE_INSTANCES.set(e.name,t)}return this.SERVICE_INSTANCES.get(e.name)}static implementsLifecycleHooks(e){return"object"==typeof e&&"function"==typeof e.onCreated}static getAllBySuperType(e){return Array.from(I.SERVICE_INSTANCES.values()).filter(t=>t instanceof e)}}class y extends s{constructor(e){super(e)}hasAuthority(e){return this.items.includes(e)}}class _{}class f extends _{mapToModel(e){return new y(e)}}class O extends t{constructor(e){super(),this.external=e?.external??!1,this.username=e?.username??"",this.password=e?.password??"",this.authorities=C.get(f).mapToModel(e?.authorities),this.appSettings=e?.appSettings??{}}}class m extends t{constructor(e){super(),this.appSettings=e.appSettings,this.authorities=C.get(f).mapToModel(e.authorities),this.enabled=e.enabled}}class N extends _{mapToModel(e){return new m(e)}}class P extends t{constructor(e){super(),this.authImplementation=e.authImplementation,this.enabled=e.enabled,this.passwordLoginEnabled=e.passwordLoginEnabled,this.freeAccess=C.get(N).mapToModel(e.freeAccess),this.overrideAuth=C.get(N).mapToModel(e.overrideAuth),this.openIdEnabled=e.openIdEnabled,this.userLoggedIn=e.userLoggedIn,this.freeAccessActive=e.freeAccessActive,this.hasExternalAuthUser=e.hasExternalAuthUser}}let b=function(e){return e.ROLE_ADMIN="ROLE_ADMIN",e.ROLE_USER="ROLE_USER",e.ROLE_MONITORING="ROLE_MONITORING",e.ROLE_REPO_MANAGER="ROLE_REPO_MANAGER",e.ROLE_CLUSTER="ROLE_CLUSTER",e.IS_AUTHENTICATED_FULLY="IS_AUTHENTICATED_FULLY",e}({});class L extends t{pages={};isRestricted(e){return this.pages[e]??!1}setPageRestriction(e,t=!0){return this.pages[e]=t,this}}class x extends t{constructor(e){super(),this.openIdKeys=e.openIdKeys,this.openIdTokenUrl=e.openIdTokenUrl,this.openIdKeysUri=e.openIdKeysUri,this.openIdEndSessionUrl=e.openIdEndSessionUrl,this.supportsOfflineAccess=e.supportsOfflineAccess}}let U=function(e){return e.READ="READ",e.WRITE="WRITE",e}({});class v extends _{mapToModel(e){return new w(e)}}class D extends t{constructor(e){super(),this.expiryDate=e.expiryDate,this.latestPublicationDate=e.latestPublicationDate,this.licensee=e.licensee||"",this.maxCpuCores=e.maxCpuCores,this.product=e.product||"",this.productType=e.productType||"",this.licenseCapabilities=C.get(v).mapToModel(e.licenseCapabilities),this.version=e.version||"",this.installationId=e.installationId||"",this.valid=e.valid,this.typeOfUse=e.typeOfUse||"",this.message=e.message||"",this.present=e.present||!1,this.usageRestriction=e.usageRestriction||""}get expiryDate(){return this._expiryDate}set expiryDate(e){this._expiryDate=e}get latestPublicationDate(){return this._latestPublicationDate}set latestPublicationDate(e){this._latestPublicationDate=e}get licensee(){return this._licensee}set licensee(e){this._licensee=e}get maxCpuCores(){return this._maxCpuCores}set maxCpuCores(e){this._maxCpuCores=e}get product(){return this._product}set product(e){this._product=e}get productType(){return this._productType}set productType(e){this._productType=e}get licenseCapabilities(){return this._licenseCapabilities}set licenseCapabilities(e){this._licenseCapabilities=e}get version(){return this._version}set version(e){this._version=e}get installationId(){return this._installationId}set installationId(e){this._installationId=e}get valid(){return this._valid}set valid(e){this._valid=e}get typeOfUse(){return this._typeOfUse}set typeOfUse(e){this._typeOfUse=e}get message(){return this._message}set message(e){this._message=e}get present(){return this._present}set present(e){this._present=e}get usageRestriction(){return this._usageRestriction}set usageRestriction(e){this._usageRestriction=e}}let M=function(e){return e.LUCENE_CONNECTOR="Lucene connector",e.SOLR_CONNECTOR="Solr connector",e.ELASTICSEARCH_CONNECTOR="Elasticsearch connector",e.OPENSEARCH_CONNECTOR="OpenSearch connector",e.KAFKA_CONNECTOR="Kafka connector",e.CLUSTER="Cluster",e}({});class w extends s{constructor(e){super(e)}}class G{constructor(e){this.workbench=e.Workbench||"",this.productType=e.productType||"",this.productVersion=e.productVersion||"",this.sesame=e.sesame||"",this.connectors=e.connectors||""}}class V{constructor(e){this.value=e}getValue(){return this.value}getValueOrDefault(e){return this.value||e}getAsJson(){if(null===this.value)return null;try{return JSON.parse(this.value)}catch(e){return console.error("Error parsing JSON",e),null}}}class B{static GLOBAL_NAMESPACE="ontotext.gdb"}class Y{constructor(e){this.languages=e}getLanguageCodes(){return this.languages?.map(e=>e.key)}}class k extends _{mapToModel(e){return new Y(e)}}class H extends t{constructor(e){super(),this.defaultLanguage=e.defaultLanguage,this.availableLanguages=C.get(k).mapToModel(e.availableLanguages)}}class K{constructor(e){this.policyAccepted=e?.policyAccepted,this.statistic=e?.statistic,this.thirdParty=e?.thirdParty,this.updatedAt=e?.updatedAt}}let $=function(e){return e.INFORMATION="INFORMATION",e.WARNING="WARNING",e.CRITICAL="CRITICAL",e}({});const F={[$.INFORMATION]:0,[$.WARNING]:1,[$.CRITICAL]:2};class q extends t{constructor(e){super(),this.id=`${e.group}-${e.status}-${e.totalOperations}`,this.group=e.group,this.totalOperations=e.totalOperations,this.status=e.status}}class W extends t{constructor(e){super(),this.status=e.status||$.INFORMATION,this.allRunningOperations=e.allRunningOperations}toOperationsGroupSummary(){const e=new Map;return this.allRunningOperations.getItems().forEach(t=>{e.has(t.group)||e.set(t.group,new q({group:t.group,totalOperations:0,status:$.INFORMATION}));const s=e.get(t.group);s.totalOperations+=t.count,F[t.status]>F[s.status]&&(s.status=t.status)}),Array.from(e.values())}}class j extends s{constructor(e){super(e)}}let Q=function(e){return e.UPDATES="updates",e.QUERIES="queries",e.IMPORT="imports",e.BACKUP_AND_RESTORE="backupAndRestore",e.CLUSTER_HEALTH="clusterHealth",e}({}),z=function(e){return e.QUERY="QUERY",e.BACKUP="BACKUP",e.CLUSTER="CLUSTER",e.IMPORT="IMPORT",e}({});const X=[Q.QUERIES,Q.UPDATES,Q.IMPORT],J={[Q.UPDATES]:"monitor/queries",[Q.QUERIES]:"monitor/queries",[Q.BACKUP_AND_RESTORE]:"monitor/backup-and-restore",[Q.IMPORT]:"import",[Q.CLUSTER_HEALTH]:"cluster"},Z={[Q.QUERIES]:z.QUERY,[Q.UPDATES]:z.QUERY,[Q.BACKUP_AND_RESTORE]:z.BACKUP,[Q.IMPORT]:z.IMPORT,[Q.CLUSTER_HEALTH]:z.CLUSTER};class ee extends t{constructor(e){super(),this.id=`${e.status}-${e.type}-${e.value}`,this.value=e.value,this.status=e.status,this.type=e.type,this.count=this.getCount(e),this.group=Z[e.type],this.href=J[e.type],this.labelKey=this.getLabelKey(e)}getCount(e){return X.includes(e.type)?parseInt(e.value,10):0}getLabelKey(e){return X.includes(e.type)?e.type:e.value}}class te extends s{constructor(e){super(e)}}let se=function(e){return e.BOTTOM_RIGHT="bottom-right",e.BOTTOM_LEFT="bottom-left",e}({});class re{constructor(e){this.timeout=e?.timeout||5e3,this.onClick=e?.onClick,this.removeOnClick=e?.removeOnClick||!1}}class ie extends re{constructor(e){super(),this.timeout=e.timeout,this.position=e.position}static getDefaultConfig(){return this.instance||(this.instance=new ie({timeout:5e3,position:se.BOTTOM_RIGHT})),this.instance}}let ne=function(e){return e.ERROR="error",e.INFO="info",e.SUCCESS="success",e.WARNING="warning",e}({});class oe{static uuid(){const e=16;let t=(new Date).getTime(),s=1e3*(performance?.now()??0);return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,r=>{let i=Math.random()*e;return t>0?(i=(t+i)%e|0,t=Math.floor(t/e)):(i=(s+i)%e|0,s=Math.floor(s/e)),("x"===r?i:3&i|8).toString(e)})}static hashCode(e){let t=0;for(let s=0,r=e.length;s<r;s++)t=(t<<5)-t+e.charCodeAt(s),t|=0;return t}}class ae{constructor(e,t,s){this.id=oe.uuid(),this.type=e,this.message=t,this.config=s}}const ue="create-toast-event";class ce extends s{constructor(e){super(e)}}class he extends s{constructor(e){super(e)}}class le extends t{constructor(e){super(),this.setRadio(e.isRadio),this.setButtons(new he(e.buttons))}getButtons(){return this.buttons}setButtons(e){this.buttons=e}isRadio(){return this.radio}setRadio(e){this.radio=e}selectButton(e){return this.isRadio()&&!e.selected&&(this.deselectAll(),e.selected=!0,e.callback()),this.copy()}deselectAll(){this.buttons.getItems().forEach(e=>e.selected=!1)}}class pe extends t{constructor(e){super(),this.id=e.id,this.label=e.label,this.selected=e.selected,this.callback=e.callback}}class ge extends s{constructor(e){super(e)}}class de extends t{constructor(e){super(),this.setSuggestions(e.suggestionList)}getSuggestions(){return this._suggestions}setSuggestions(e){this._suggestions=e}hoverFirstSuggestion(){return this.hoverSuggestion(this.getSuggestions().getItems()[0])}hoverSuggestion(e){return e&&(this.clearHoveredState(),e.setHovered(!0)),this.copy()}selectSuggestion(e){return e&&(this.clearSelectedState(),e.setSelected(!0)),this.copy()}getHoveredSuggestion(){return this.getSuggestions().getItems().find(e=>e.isHovered())}hoverPreviousSuggestion(){const e=this.getSuggestions().getItems().findIndex(e=>e.isHovered());return e>0&&(this.clearHoveredState(),this.getSuggestions().getItems()[e-1].setHovered(!0)),this.copy()}hoverNextSuggestion(){const e=this.getSuggestions().getItems().findIndex(e=>e.isHovered());return e<this.getSuggestions().getItems().length-1&&(this.clearHoveredState(),this.getSuggestions().getItems()[e+1].setHovered(!0)),this.copy()}clearSuggestions(){return this.setSuggestions(new ge),this.copy()}getByValue(e){return this.getSuggestions().getItems().find(t=>t.getValue()===e)}clearSelectedState(){this.getSuggestions().getItems().forEach(e=>e.setSelected(!1))}clearHoveredState(){this.getSuggestions().getItems().forEach(e=>e.setHovered(!1))}}class Ee extends t{overrideToVisual=!1;constructor(e){super(),this.setId(e.id),this.setType(e.type),this.setValue(e.value),this.setDescription(e.description)}getId(){return this._id}setId(e){this._id=e}getType(){return this._type}setType(e){this._type=e}getValue(){return this._value}setValue(e){this._value=e}getDescription(){return this._description}setDescription(e){this._description=e}isHovered(){return this._hovered}setHovered(e){this._hovered=e}isSelected(){return this._selected}setSelected(e){this._selected=e}getOverrideToVisual(){return this.overrideToVisual}setOverrideToVisual(e){this.overrideToVisual=e}}let Se=function(e){return e.URI="uri",e.PREFIX="prefix",e}({});class Ae{constructor(e,t){this.setSuggestion(e),this.setContext(t)}getSuggestion(){return this.suggestion}getContext(){return this.context}setContext(e){this.context=e}setSuggestion(e){this.suggestion=e}}let Re=function(e){return e.DATA_LOADED="DATA_LOADED",e}({});class Te{callbackFunctions=[];beforeChangeValidationPromises=[];afterValueChangeCallbackFunctions=[];setValue(t){e.deepEqual(this.value,t)||(this.value=this.getCopy(t),this.callbackFunctions.forEach(e=>e(this.getValue())),this.afterValueChangeCallbackFunctions.forEach(e=>e(this.getValue())))}getValue(){return this.getCopy(this.value)}subscribe(e,t,s){return this.callbackFunctions.push(e),t&&this.beforeChangeValidationPromises.push(t),s&&this.afterValueChangeCallbackFunctions.push(s),()=>{this.callbackFunctions=this.callbackFunctions.filter(t=>t!==e),this.beforeChangeValidationPromises=this.beforeChangeValidationPromises.filter(e=>e!==t),this.afterValueChangeCallbackFunctions=this.afterValueChangeCallbackFunctions.filter(e=>e!==s)}}async canUpdate(e){if(0===this.beforeChangeValidationPromises.length)return!0;const t=this.beforeChangeValidationPromises.map(t=>t(e));try{return(await Promise.all(t)).every(e=>e)}catch{return!1}}getCopy(t){if(null!=t)return e.hasCopyMethod(t)?t.copy():e.deepCopy(t)}}class Ce{subscribers=[];unsubFns=new r;subscribeToService(e){const t=this.subscribers.map(t=>e.subscribeAll(t.callback,t.beforeChangeValidationPromise,t.afterChangeCallback));return this.unsubFns.addAll(t),()=>t.forEach(e=>e())}subscribeToAllRegisteredContexts(e,t,s){const r=I.getAllBySuperType(Ie).filter(e=>e.canSubscribeAll);for(const i of r)this.unsubFns.add(i.subscribeAll(e,t,s));const i={callback:e,beforeChangeValidationPromise:t,afterChangeCallback:s};this.subscribers.push(i);let o=!1;return()=>{if(o)return;o=!0,this.unsubFns.unsubscribeAll();const e=this.subscribers.indexOf(i);e>=0&&this.subscribers.splice(e,1)}}}class Ie{context=new Map;_canSubscribeAll=!1;onCreated(){this._canSubscribeAll=!0,I.get(Ce).subscribeToService(this)}updateContextProperty(e,t){this.getOrCreateValueContext(e).setValue(t)}validatePropertyChange(e,t){return this.getOrCreateValueContext(e).canUpdate(t)}getContextPropertyValue(e){const t=this.context.get(e);return t?t.getValue():void 0}subscribe(e,t,s,r){return t&&t(this.getContextPropertyValue(e)),r&&r(this.getContextPropertyValue(e)),this.getOrCreateValueContext(e).subscribe(t,s,r)}subscribeAll(e,t,s){const i=new r;for(const r of this.getContextFields())i.add(this.subscribe(r,e,t,s));return()=>i.unsubscribeAll()}getContextFields(){return Object.values(this).filter(e=>"string"==typeof e)}getOrCreateValueContext(e){let t=this.context.get(e);return t||(t=new Te,this.context.set(e,t)),t}canHandle(e){for(const t in this)if(this[t]===e)return!0;return!1}get canSubscribeAll(){return this._canSubscribeAll}}class ye{priority=0}class _e{getStorage(){return localStorage}get(e){const t=this.getStorage().getItem(this.getPrefixedKey(e));return new V(t)}storeValue(e,t){this.getStorage().setItem(this.getPrefixedKey(e),t)}remove(e){this.getStorage().removeItem(this.getPrefixedKey(e))}getPrefixedKey(e){const t=`${B.GLOBAL_NAMESPACE}.${this.NAMESPACE}.`,s=`${this.NAMESPACE}.`;return e.startsWith(t)?e:e.startsWith(s)?`${B.GLOBAL_NAMESPACE}.${e}`:`${t}${e}`}}class fe{handleStorageChange(e){const t=e.key?.substring(B.GLOBAL_NAMESPACE.length+1);let s="",r="";t&&(s=t.substring(0,t.indexOf(".")),r=t.substring(s.length+1));const i=this.resolveHandler(s,r);i&&i.updateContextProperty(r,e.newValue)}resolveHandler(e,t){if(!e)return void console.warn("Namespace is required to resolve a context property change handler.");const s=I.getAllBySuperType(Ie).find(e=>e.canHandle(t));if(s)return s;console.warn(`No context property change handler found for namespace: ${e} and property: ${t}`)}}class Oe extends _e{jwtKey="jwt";authenticatedKey="authenticated";NAMESPACE="auth";set(e,t){this.storeValue(e,t)}getAuthToken(){return this.get(this.jwtKey)}setAuthenticated(e){this.storeValue(this.authenticatedKey,e?.toString()||"")}isAuthenticated(){return"true"===this.get(this.authenticatedKey).getValue()}}class me extends _e{NAMESPACE="repository";SELECTED_REPOSITORY="selectedRepository";set(e,t){t?this.storeValue(e,t):this.remove(e)}setRepositoryReference(e){this.set(this.SELECTED_REPOSITORY,this.serializeRepositoryReference(e))}getRepositoryReference(){return this.deserializeRepositoryReference(this.get(this.SELECTED_REPOSITORY).getValueOrDefault('{"id": "", "location": ""}'))}removeRepositoryReference(){this.remove(this.SELECTED_REPOSITORY)}serializeRepositoryReference(e){return JSON.stringify(e)}deserializeRepositoryReference(e){if("string"==typeof e)try{return JSON.parse(e)}catch(e){console.error("Error parsing repository reference",e)}}}class Ne extends Ie{RESTRICTED_PAGES="restrictedPages";SECURITY_CONFIG="securityConfig";AUTHENTICATED_USER="authenticatedUser";AUTH_TOKEN="jwt";OPEN_ID_CONFIG="openIdConfig";getRestrictedPages(){return this.getContextPropertyValue(this.RESTRICTED_PAGES)||new L}updateRestrictedPages(e){this.updateContextProperty(this.RESTRICTED_PAGES,e)}onRestrictedPagesChanged(e){return this.subscribe(this.RESTRICTED_PAGES,e)}onAuthTokenChanged(e){return this.subscribe(this.AUTH_TOKEN,e)}updateAuthToken(e){this.updateContextProperty(this.AUTH_TOKEN,e)}getAuthToken(){return this.getContextPropertyValue(this.AUTH_TOKEN)}updateSecurityConfig(e){this.updateContextProperty(this.SECURITY_CONFIG,e)}onSecurityConfigChanged(e){return this.subscribe(this.SECURITY_CONFIG,e)}getSecurityConfig(){return this.getContextPropertyValue(this.SECURITY_CONFIG)}updateAuthenticatedUser(e){this.updateContextProperty(this.AUTHENTICATED_USER,e)}onAuthenticatedUserChanged(e){return this.subscribe(this.AUTHENTICATED_USER,e)}getAuthenticatedUser(){return this.getContextPropertyValue(this.AUTHENTICATED_USER)}updateOpenIdConfig(e){return this.updateContextProperty(this.OPEN_ID_CONFIG,e)}getOpenIdConfig(){return this.getContextPropertyValue(this.OPEN_ID_CONFIG)}}class Pe{static getWindow(){return window}}function be(e){return t=>{t&&t.preventDefault(),Le(e)}}function Le(e){Pe.getWindow().singleSpa.navigateToUrl(e)}function xe(e){Pe.getWindow().open(e,"_blank")}function Ue(){return"/"===ve()}function ve(){return Pe.getWindow().location.pathname.substring(De().length-1)}function De(){return document.querySelector("base")?.getAttribute("href")??"/"}function Me(){return ve().substring(1)}const we=new s([new class extends ye{authStorage=I.get(Oe);repositoryStorageService=I.get(me);securityContextService=I.get(Ne);process(e){e.headers=e.headers||{},e.headers["X-Requested-With"]="XMLHttpRequest";const t=this.authStorage.getAuthToken().getValue();if(t&&(e.headers.Authorization=t),!e.headers["X-GraphDB-Repository"]){const t=this.repositoryStorageService.getRepositoryReference();t?.id&&(e.headers["X-GraphDB-Repository"]=t.id),t?.location&&(e.headers["X-GraphDB-Repository-Location"]=t.location)}return Promise.resolve(e)}shouldProcess(e){const t=this.securityContextService.getOpenIdConfig();if(!t)return!0;const s=t?.openIdKeysUri,r=t?.openIdTokenUrl;return!s||!r||![t?.openIdKeysUri,t?.openIdTokenUrl].some(t=>t&&e.url.indexOf(t)>-1)}}]),Ge=new s([new class extends ye{process(e){return localStorage.getItem("ontotext.gdb.auth.jwt")&&(localStorage.removeItem("ontotext.gdb.auth.jwt"),Le("login"),Pe.getWindow().location.reload()),Promise.reject(e)}shouldProcess(e){return 401===e.status}}]);class Ve{preProcessors=new s;postProcessors=new s;constructor(){this.registerRequestInterceptors(we),this.registerResponseInterceptors(Ge)}async preProcess(e){let t=e;for(const e of this.preProcessors.getItems())e.shouldProcess(t)&&(t=await e.process(t));return t}async postProcess(e){let t=e;for(const e of this.postProcessors.getItems())e.shouldProcess(t)&&(t=await e.process(t));return t}registerRequestInterceptors(e){this.preProcessors.addItems(e.getItems()),this.sortInterceptors(this.preProcessors)}registerResponseInterceptors(e){this.postProcessors.addItems(e.getItems()),this.sortInterceptors(this.postProcessors)}sortInterceptors(e){e.sort((e,t)=>t.priority-e.priority)}}class Be{constructor(e){this.url=e.url,this.method=e.method,this.headers={...e.headers},this.body=e.body}}class Ye{emit(e){const t=new CustomEvent(e.NAME,{detail:e.payload});return this.getHostElement().dispatchEvent(t),t}subscribe(e,t){const s=e=>{e instanceof CustomEvent&&t(e.detail)};return this.getHostElement().addEventListener(e,s),()=>this.getHostElement().removeEventListener(e,s)}getHostElement(){return document.body}}const ke=["application/json","application/sparql-results+json"],He="http-request-done-event";class Ke{interceptorService=I.get(Ve);eventEmitter=new Ye;get(e,t,s){return this.request(e,"GET",{params:t,headers:s}).then(e=>e)}post(e,t,s){return this.request(e,"POST",{body:t,headers:s})}put(e,t,s){return this.request(e,"PUT",{body:t,headers:s})}delete(e,t){return this.request(e,"DELETE",{headers:t})}patch(e,t,s){return this.request(e,"PATCH",{body:t,headers:s})}encodeURIComponentStrict(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16)})}request(e,t,s={}){const r=this.buildQueryParams(s.params),i=`${e}${r?`?${r}`:""}`,o={"Content-Type":"application/json",Accept:"application/json, text/plain, */*",...s.headers};return this.interceptorService.preProcess(new Be({url:i,method:t,headers:o,body:s.body})).then(e=>fetch(e.url,{method:e.method,headers:e.headers,body:e.body?JSON.stringify(e.body):null})).then(e=>this.interceptorService.postProcess(e)).then(e=>e.ok?this.hasValidJson(e)?e.json():Promise.resolve():Promise.reject(e)).finally(()=>this.eventEmitter.emit({NAME:He,payload:void 0}))}hasValidJson(e){const t=e.headers.get("Content-Type");return!!t&&ke.some(e=>t.includes(e))}buildQueryParams(e={}){return new URLSearchParams(e).toString()}}class $e extends Ke{I18N_ENDPOINT="assets/i18n";getLanguage(e){return this.get(`${this.I18N_ENDPOINT}/${e}.json`)}getLanguageConfiguration(){return this.get(`${this.I18N_ENDPOINT}/language-config.json`)}}class Fe extends _{mapToModel(e){return new H(e)}}class qe extends _e{NAMESPACE="i18n";set(e,t){this.storeValue(e,t)}}class We extends Ie{LANGUAGE_CONFIG="languageConfig";SELECTED_LANGUAGE="selectedLanguage";LANGUAGE_BUNDLE="languageBundle";DEFAULT_BUNDLE="defaultBundle";updateSelectedLanguage(e){this.validatePropertyChange(this.SELECTED_LANGUAGE,e).then(t=>{if(t){const t=e||I.get(je).getDefaultLanguage();I.get(qe).set(this.SELECTED_LANGUAGE,t),this.updateContextProperty(this.SELECTED_LANGUAGE,e)}})}onSelectedLanguageChanged(e,t){return this.subscribe(this.SELECTED_LANGUAGE,e,t)}updateLanguageBundle(e){this.updateContextProperty(this.LANGUAGE_BUNDLE,e)}onLanguageBundleChanged(e){return this.subscribe(this.LANGUAGE_BUNDLE,e)}updateDefaultBundle(e){this.updateContextProperty(this.DEFAULT_BUNDLE,e)}getDefaultBundle(){return this.getContextPropertyValue(this.DEFAULT_BUNDLE)}getLanguageConfig(){return this.getContextPropertyValue(this.LANGUAGE_CONFIG)}setLanguageConfig(e){this.updateContextProperty(this.LANGUAGE_CONFIG,e)}getSelectedLanguage(){return this.getContextPropertyValue(this.SELECTED_LANGUAGE)}}class je{languageRestService=I.get($e);languageContextService=I.get(We);getSupportedLanguages(){const e=this.languageContextService.getLanguageConfig();return e?e.availableLanguages.getLanguageCodes():["en","fr"]}getLanguage(e){return this.languageRestService.getLanguage(e)}getLanguageConfiguration(){return this.languageRestService.getLanguageConfiguration().then(e=>C.get(Fe).mapToModel(e))}getDefaultLanguage(){const e=this.languageContextService.getLanguageConfig();return e?e.defaultLanguage:"en"}}class Qe extends Ke{static REPOSITORIES_ENDPOINT="rest/repositories";getRepositories(){return this.get(`${Qe.REPOSITORIES_ENDPOINT}/all`)}getRepositorySizeInfo(e){return this.get(`${Qe.REPOSITORIES_ENDPOINT}/${e.id}/size?location=${encodeURIComponent(e.location)}`)}}class ze extends _{mapToModel(e){return new i(e)}}class Xe extends _{constructor(){super(),this.repositoryMapper=C.get(ze)}mapToModel(e){if(!e||"object"!=typeof e)return new o;const t=[];return Object.entries(e).forEach(([,e])=>{Array.isArray(e)&&e.forEach(e=>{const s=this.repositoryMapper.mapToModel(e);t.push(s)})}),new o(t)}}class Je extends _{mapToModel(e){return new a(e)}}class Ze{GRAPHQL_REPO_AUTHORITY="GRAPHQL";constructor(){this.repositoryRestService=I.get(Qe),this.repositoryListMapper=C.get(Xe),this.repositorySizeInfoMapper=C.get(Je)}getRepositories(){return this.repositoryRestService.getRepositories().then(e=>this.repositoryListMapper.mapToModel(e))}getRepositorySizeInfo(e){return this.repositoryRestService.getRepositorySizeInfo(e).then(this.repositorySizeInfoMapper.mapToModel)}isSystemRepository(e){return"SYSTEM"===e.id}getCurrentGqlRepoAuthority(e,t){return`${this.getCurrentRepoAuthority(e,t)}:${this.GRAPHQL_REPO_AUTHORITY}`}getOverallGqlRepoAuthority(e){return`${this.getOverallRepoAuthority(e)}:${this.GRAPHQL_REPO_AUTHORITY}`}getLocationSpecificId(e){return e.location?`${e.id}@${e.location}`:e.id}getCurrentRepoAuthority(e,t){return`${e}_REPO_${t}`}getOverallRepoAuthority(e){return`${e}_REPO_*`}}class et extends Ie{SELECTED_REPOSITORY="selectedRepository";REPOSITORY_LIST="repositoryList";updateSelectedRepository(e){const t=I.get(me),s=this.findRepository(e);this.validatePropertyChange(this.SELECTED_REPOSITORY,s).then(r=>{r&&(s?t.setRepositoryReference(s.toRepositoryReference()):e||t.removeRepositoryReference(),this.updateContextProperty(this.SELECTED_REPOSITORY,s))})}getSelectedRepository(){return this.getContextPropertyValue(this.SELECTED_REPOSITORY)}onSelectedRepositoryChanged(e,t){return this.subscribe(this.SELECTED_REPOSITORY,e,t)}updateRepositoryList(e){return this.updateContextProperty(this.REPOSITORY_LIST,e)}getRepositoryList(){return this.getContextPropertyValue(this.REPOSITORY_LIST)||new o([])}onRepositoryListChanged(e){return this.subscribe(this.REPOSITORY_LIST,e)}findRepository(e){if(e)return this.getRepositoryList().findRepository(e.id,e.location)}}class tt extends Ke{getActiveRepositoryLocation(){return this.get("rest/locations/active")}}class st extends _{mapToModel(e){return new l(e)}}class rt{constructor(){this.locationRestService=I.get(tt),this.repositoryLocationMapper=C.get(st)}getActiveRepositoryLocation(){return this.locationRestService.getActiveRepositoryLocation().then(this.repositoryLocationMapper.mapToModel)}}class it extends Ie{ACTIVE_REPOSITORY_LOCATION="activeRepositoryLocation";IS_LOADING="isLoading";updateActiveRepositoryLocation(e){this.updateContextProperty(this.ACTIVE_REPOSITORY_LOCATION,e)}onActiveLocationChanged(e){return this.subscribe(this.ACTIVE_REPOSITORY_LOCATION,e)}updateIsLoading(e){this.updateContextProperty(this.IS_LOADING,e)}onIsLoadingChanged(e){return this.subscribe(this.IS_LOADING,e)}}class nt extends Ke{getLicense(){return this.get("rest/graphdb-settings/license")}}class ot extends _{mapToModel(e){return new D(e)}}class at extends Ie{GRAPHDB_LICENSE="graphDbLicense";updateGraphdbLicense(e){this.updateContextProperty(this.GRAPHDB_LICENSE,e)}onLicenseChanged(e){return this.subscribe(this.GRAPHDB_LICENSE,e)}getLicense(){return this.getContextPropertyValue(this.GRAPHDB_LICENSE)}}class ut{licenseRestService=I.get(nt);licenseMapper=I.get(ot);trackableProductTypes=["free","sandbox"];trackableTypesOfUse=["evaluation","this is an evaluation license"];getLicense(){return this.licenseRestService.getLicense().then(e=>this.licenseMapper.mapToModel(e))}isTrackableLicense(){const e=I.get(at).getLicense(),t=e?.typeOfUse?.toLowerCase()||"",s=e?.productType?.toLowerCase()||"";return!e?.present||this.trackableProductTypes.includes(s)||this.trackableTypesOfUse.includes(t)}}class ct extends Ie{PRODUCT_INFO="productInfo";updateProductInfo(e){this.updateContextProperty(this.PRODUCT_INFO,e)}onProductInfoChanged(e){return this.subscribe(this.PRODUCT_INFO,e)}}class ht extends _{mapToModel(e){return new G(e)}}class lt extends Ke{VERSION_URL="rest/info/version";getProductInfoLocal(){return this.get(`${this.VERSION_URL}?local=1`)}}class pt{productInfoMapper=I.get(ht);productInfoService=I.get(lt);getProductInfoLocal(){return this.productInfoService.getProductInfoLocal().then(e=>this.productInfoMapper.mapToModel(e))}}class gt extends _{mapToModel(e){return new P(e)}}class dt{constructor(e){this.notify=e}}class Et{eventSubscribers=new Map;emit(t){const s=this.eventSubscribers.get(t.NAME);s&&s.forEach(s=>{s.notify(e.deepCopy(t.payload))})}subscribe(e,t){const s=new dt(t),r=this.eventSubscribers.get(e);return r?r.push(s):this.eventSubscribers.set(e,[s]),()=>this.unsubscribe(e,s)}unsubscribe(e,t){const s=this.eventSubscribers.get(e);if(s){const r=s.indexOf(t);-1!==r&&s.splice(r,1),0===s.length&&this.eventSubscribers.delete(e)}}}class St{constructor(e,t){this.setRegex(e),this.setRouteParams(t)}getRegex(){return this.regex}setRegex(e){return this.regex=e,this}getRouteParams(){return this.routeParams}setRouteParams(e){return this.routeParams=e,this}}class At{constructor(e){this._url=e.url,this._module=e.module,this._path=e.path,this._chunk=e.chunk,this._controller=e.controller,this._templateUrl=e.templateUrl,this._title=e.title,this._reloadOnSearch=e.reloadOnSearch,this._helpInfo=e.helpInfo,this._documentationUrl=e.documentationUrl,this._allowAuthorities=e.allowAuthorities}get url(){return this._url}set url(e){this._url=e}get module(){return this._module}set module(e){this._module=e}get path(){return this._path}set path(e){this._path=e}get chunk(){return this._chunk}set chunk(e){this._chunk=e}get controller(){return this._controller}set controller(e){this._controller=e}get templateUrl(){return this._templateUrl}set templateUrl(e){this._templateUrl=e}get title(){return this._title}set title(e){this._title=e}get reloadOnSearch(){return this._reloadOnSearch}set reloadOnSearch(e){this._reloadOnSearch=e}get helpInfo(){return this._helpInfo}set helpInfo(e){this._helpInfo=e}get documentationUrl(){return this._documentationUrl}set documentationUrl(e){this._documentationUrl=e}get allowAuthorities(){return this._allowAuthorities}set allowAuthorities(e){this._allowAuthorities=e}}let Rt=function(e){return e.ROUTE="route",e.MAIN_MENU="main.menu",e}({});class Tt{routeConfig=Pe.getWindow().PluginRegistry.get(Rt.ROUTE);getActiveRoute(e=ve()){const t=this.routeConfig.find(t=>this.routeToRegex(t.url).getRegex().test(e));return t?new At(t):void 0}routeToRegex(e){const t=[],r=e.replace(/([().])/g,"\\$1").replace(/(\/)?:(\w+)(\*\?|[?*])?/g,function(e,s,r,i){const o="?"===i||"*?"===i,n="*"===i||"*?"===i;return t.push(r),s=s||"",(o?"(?:"+s:s+"(?:")+(n?"(.+?)":"([^/]+)")+(o?"?)?":")")}).replace(/([/$*])/g,"\\$1");return new St(new RegExp("^"+r+"(?:[?#]|$)"),new s(t))}}class Ct{repositoryService=I.get(Ze);securityContextService=I.get(Ne);login(){return"Authentication.login from the API"}logout(){I.get(Et).emit(new R)}isAuthenticated(){const e=this.getSecurityConfig();return!(!e?.enabled||!e?.userLoggedIn)}hasFreeAccess(){const e=this.getSecurityConfig();return e?.enabled&&e?.freeAccessActive}hasRole(e){const t=this.getSecurityConfig(),s=this.getAuthenticatedUser();return!e||!t?.enabled||!!(Object.keys(s||{}).length>0)&&(b.IS_AUTHENTICATED_FULLY===e||s?.authorities.hasAuthority(e))}isSecurityEnabled(){return!!this.getSecurityConfig()?.enabled}canReadRepo(e){if(!e||""===e.id)return!1;const t=this.getSecurityConfig(),s=this.getAuthenticatedUser();return!t?.enabled||!!s&&(!!this.isAdminOrRepoManager()||!this.repositoryService.isSystemRepository(e)&&this.hasBaseRights(U.READ,e))}canReadGqlRepo(e){return!(!e||""===e.id)&&this.hasGraphqlAuthority(U.READ,e)}canWriteGqlRepo(e){return!(!e||""===e.id)&&this.hasGraphqlAuthority(U.WRITE,e)}hasGqlRights(e){return this.canReadGqlRepo(e)||this.canWriteGqlRepo(e)}hasAuthority(){if(this.hasRole(b.ROLE_ADMIN))return!0;const e=I.get(Tt).getActiveRoute();if(!e)return!1;if(!e.allowAuthorities)return!0;if(!I.get(me).getRepositoryReference()?.id)return!0;const t=this.getAuthenticatedUser();return!t||!e.allowAuthorities.length||this.resolveAuthorities(e.allowAuthorities).some(e=>t.authorities.hasAuthority(e))}resolveAuthorities(e){if(!e)return[];const t=I.get(me).getRepositoryReference();return t?.id?[...e.map(e=>e.replace("{repoId}",t.id)),...e.map(e=>e.replace("{repoId}","*"))]:e}hasGraphqlAuthority(e,t){const s=this.securityContextService.getAuthenticatedUser();if(!s)return!1;const r=this.repositoryService.getLocationSpecificId(t),i=this.repositoryService.getCurrentGqlRepoAuthority(e,r),o=this.repositoryService.getOverallGqlRepoAuthority(e);return s.authorities.hasAuthority(i)||s.authorities.hasAuthority(o)}isAdminOrRepoManager(){return this.hasRole(b.ROLE_ADMIN)||this.hasRole(b.ROLE_REPO_MANAGER)}getSecurityConfig(){return I.get(Ne).getSecurityConfig()}getAuthenticatedUser(){return I.get(Ne).getAuthenticatedUser()}hasBaseRights(e,t){const s=this.repositoryService.getLocationSpecificId(t),r=this.repositoryService.getCurrentRepoAuthority(e,s),i=this.repositoryService.getOverallRepoAuthority(e),o=this.getAuthenticatedUser();return!(!o?.authorities.hasAuthority(r)&&!o?.authorities.hasAuthority(i))}}class It extends _{mapToModel(e){return new O(e)}}class yt extends Ke{SECURITY_ENDPOINT="rest/security";updateUserData(e){return this.patch(`${this.SECURITY_ENDPOINT}/users/${this.encodeURIComponentStrict(e.username)}`,{appSettings:e.appSettings})}getSecurityConfig(){return this.get(`${this.SECURITY_ENDPOINT}/all`)}getAuthenticatedUser(){return this.get(`${this.SECURITY_ENDPOINT}/authenticated-user`)}}class _t{securityRestService=I.get(yt);securityContextService=I.get(Ne);updateUserData(e){return this.securityRestService.updateUserData(e).then(()=>this.securityContextService.updateAuthenticatedUser(e))}getSecurityConfig(){return this.securityRestService.getSecurityConfig().then(e=>C.get(gt).mapToModel(e))}getAuthenticatedUser(){return this.securityRestService.getAuthenticatedUser().then(e=>C.get(It).mapToModel(e))}}class ft extends _{mapToModel(e){return new x(e)}}const Ot="cookie-consent-changed-event";class mt{eventEmitter=new Ye;acceptCookiePolicy(){const e=this.setAcceptedCookiePolicy();return I.get(_t).updateUserData(e).then(()=>{this.eventEmitter.emit({NAME:Ot,payload:e.appSettings.COOKIE_CONSENT})})}setAcceptedCookiePolicy(){const e=I.get(Ne).getAuthenticatedUser()||new O({});let t;return t=e.appSettings?.COOKIE_CONSENT?new K(e.appSettings.COOKIE_CONSENT):new K({thirdParty:!0,statistic:!0}),t.policyAccepted=!0,t.updatedAt=Date.now(),e.appSettings.COOKIE_CONSENT=t,e}}class Nt extends Ke{MONITORING_ENDPOINT="rest/monitor";getOperations(e){return this.get(`${this.MONITORING_ENDPOINT}/repository/${e}/operations`)}}const Pt={[Q.CLUSTER_HEALTH]:0,[Q.BACKUP_AND_RESTORE]:1,[Q.IMPORT]:2,[Q.QUERIES]:3,[Q.UPDATES]:4};class bt extends _{mapToModel(e){return new j(e.map(e=>new ee(e)).sort((e,t)=>Pt[e.type]-Pt[t.type]))}}class Lt extends _{mapToModel(e){return new W({status:e.status,allRunningOperations:C.get(bt).mapToModel(e.allRunningOperations||[])})}}class xt{getOperations(e){return I.get(Nt).getOperations(e).then(e=>C.get(Lt).mapToModel(e))}}class Ut extends _{mapToModel(e){return new te(e)}}class vt{eventEmitter=new Ye;error(e,t){this.createToastElement(e,ne.ERROR,t)}info(e,t){this.createToastElement(e,ne.INFO,t)}success(e,t){this.createToastElement(e,ne.SUCCESS,t)}warning(e,t){this.createToastElement(e,ne.WARNING,t)}createToastElement(e,t,s){this.eventEmitter.emit({NAME:ue,payload:new ae(t,e,s)})}}class Dt extends Ke{autocompleteRestPrefix="rest/autocomplete";search(e){return this.get(`${this.autocompleteRestPrefix}/query?q=${e}`)}enabled(){return this.get(`${this.autocompleteRestPrefix}/enabled`)}}class Mt extends _{mapToModel(e){return new ge(e.map(e=>new Ee({...e,id:oe.hashCode(`${e.type}-${e.value}-${e.description}`)})))}}class wt extends _{mapToModel(e){return new de({...e,suggestionList:C.get(Mt).mapToModel(e.suggestions)})}}class Gt{search(e){return I.get(Dt).search(e).then(e=>C.get(wt).mapToModel(e))}isAutocompleteEnabled(){return I.get(Dt).enabled()}}class Vt extends _e{ENABLED_KEY="enabled";NAMESPACE="autocomplete";set(e,t){this.storeValue(e,t)}isEnabled(){return"true"===this.get(this.ENABLED_KEY).value}setEnabled(e){this.set(this.ENABLED_KEY,e.toString())}}class Bt extends Ie{AUTOCOMPLETE_ENABLED="isAutocompleteEnabled";updateAutocompleteEnabled(e){this.updateContextProperty(this.AUTOCOMPLETE_ENABLED,e),I.get(Vt).setEnabled(e)}onAutocompleteEnabledChanged(e){return this.subscribe(this.AUTOCOMPLETE_ENABLED,e)}}class Yt extends _{mapToModel(e){const t=e?.results.bindings||[];return new h(t.reduce((e,t)=>(e[t.prefix.value]=t.namespace.value,e),{}))}}class kt extends Ke{REPOSITORIES_ENDPOINT="repositories";getNamespaces(e){return this.get(`${this.REPOSITORIES_ENDPOINT}/${e}/namespaces`)}}class Ht{namespaceMapper=C.get(Yt);namespacesRestService=I.get(kt);getNamespaces(e){return this.namespacesRestService.getNamespaces(e).then(e=>this.namespaceMapper.mapToModel(e))}}class Kt extends Ie{NAMESPACES="namespaces";updateNamespaces(e){this.updateContextProperty(this.NAMESPACES,e)}onNamespacesChanged(e){return this.subscribe(this.NAMESPACES,e)}}class $t extends _e{SELECTED_VIEW_KEY="selectedView";INPUT_KEY="input";LAST_SELECTED_KEY="lastSelected";NAMESPACE="resourceSearch";LEGACY_LAST_SELECTED_KEY="ls.rdf-search.resource-description";LEGACY_INPUT_KEY="ls.rdf-search.search-input";LEGACY_SELECTED_VIEW_KEY="ls.rdf-search.search-type";set(e,t){this.storeValue(e,t)}setSelectedView(e){this.set(this.SELECTED_VIEW_KEY,e),localStorage.setItem(this.LEGACY_SELECTED_VIEW_KEY,e)}getSelectedView(){return this.get(this.SELECTED_VIEW_KEY).getValue()||""}setInputValue(e){this.set(this.INPUT_KEY,e),localStorage.setItem(this.LEGACY_INPUT_KEY,e)}getInputValue(){return this.get(this.INPUT_KEY).getValue()||""}setLastSelected(e){this.set(this.LAST_SELECTED_KEY,e.getValue()),localStorage.setItem(this.LEGACY_LAST_SELECTED_KEY,e.getDescription()||"")}getLastSelectedValue(){return this.get(this.LAST_SELECTED_KEY).getValue()||""}clearStoredSearch(){this.remove(this.INPUT_KEY),this.remove(this.LAST_SELECTED_KEY),localStorage.removeItem(this.LEGACY_INPUT_KEY),localStorage.removeItem(this.LEGACY_LAST_SELECTED_KEY)}}class Ft extends Ie{PREVIOUS_ROUTE="previousRoute";updatePreviousRoute(e){this.updateContextProperty(this.PREVIOUS_ROUTE,e)}getPreviousRoute(){let e=this.getContextPropertyValue(this.PREVIOUS_ROUTE);return e?.endsWith("#")&&(e=e.slice(0,-1)),e}}class qt extends Ie{APPLICATION_DATA_STATE="applicationDataLoaded";updateApplicationDataState(e){this.updateContextProperty(this.APPLICATION_DATA_STATE,e)}onApplicationDataStateChanged(e){return this.subscribe(this.APPLICATION_DATA_STATE,e)}}class Wt{static isDevMode(){return Pe.getWindow().wbDevMode}}class jt{static ABS_URI_REGEX=/^<?(http|urn).*>?/;static GRAPHS_VISUALIZATIONS_URL="graphs-visualizations";static RESOURCE_URL="resource";static BASE_DOCUMENTATION_URL="https://graphdb.ontotext.com/documentation/";static LATEST_UNOFFICIAL_VERSION="master";static shortenIri(e){const t=document.createElement("a");t.href=e;let s=t.hostname;return jt.containsIPV4(t.hostname)||(s=t.hostname.split(".")[0]),s+":"+t.port}static containsIPV4(e){const t=e.split(".");for(let e=0,s=0;e<t.length;e++)if(parseInt(t[e],10)>=0&&parseInt(t[e],10)<=255?s++:s=0,4===s)return!0;return!1}static createAutocompleteRedirect(e,t){return`${e}?uri=${encodeURIComponent(t)}`}static removeAngleBrackets(e){return e?.startsWith("<")&&e?.endsWith(">")?e.substring(1,e.length-1):e}static isValidUri(e){let t=!1;if(this.hasValidProtocol(e))if(e.indexOf("http")>=0){const s=e.indexOf("//");t=s>4&&e.substring(s+2).length>0}else e.indexOf("urn")>=0&&(t=e.substring(4).length>0);return t}static resolveDocumentationUrl(e,t){if(!e||!t)throw new Error("Product version and endpoint path are required for documentation URL resolution.");const s=e.includes("-"),r=Wt.isDevMode()||s?this.LATEST_UNOFFICIAL_VERSION:e;return`${this.BASE_DOCUMENTATION_URL}${r}/${t}`}static hasAngleBrackets(e){return e.startsWith("<")&&e.endsWith(">")}static hasNoAngleBrackets(e){return!e.startsWith("<")&&!e.endsWith(">")}static hasValidProtocol(e){return this.ABS_URI_REGEX.test(e)&&(this.hasNoAngleBrackets(e)||this.hasAngleBrackets(e))}}class Qt{fibo1=0;fibo2=1;next(){const e=this.fibo2;return this.fibo2=this.fibo1+this.fibo2,this.fibo1=e,e}reset=()=>{this.fibo1=0,this.fibo2=1}}export{qt as ApplicationLifecycleContextService,O as AuthenticatedUser,It as AuthenticatedUserMapper,Ct as AuthenticationService,Oe as AuthenticationStorageService,T as AuthenticationType,b as Authority,y as AuthorityList,Bt as AutocompleteContextService,de as AutocompleteSearchResult,Gt as AutocompleteService,Vt as AutocompleteStorageService,Y as AvailableLanguagesList,Wt as BuildUtil,Ot as COOKIE_CONSENT_CHANGED_EVENT,ue as CREATE_TOAST_EVENT,M as Capability,w as CapabilityList,Ie as ContextService,Ce as ContextSubscriptionManager,K as CookieConsent,mt as CookieService,g as Event,Ye as EventEmitter,d as EventName,Et as EventService,Qt as FibonacciGenerator,He as HTTP_REQUEST_DONE_EVENT,H as LanguageConfig,We as LanguageContextService,$e as LanguageRestService,je as LanguageService,qe as LanguageStorageService,D as License,at as LicenseContextService,ut as LicenseService,Re as LifecycleState,_e as LocalStorageService,fe as LocalStorageSubscriptionHandlerService,R as Logout,C as MapperProvider,t as Model,s as ModelList,Nt as MonitoringRestService,xt as MonitoringService,h as NamespaceMap,Kt as NamespacesContextService,Ht as NamespacesService,Ft as NavigationContextService,E as NavigationEnd,S as NavigationEndPayload,A as NavigationStart,e as ObjectUtil,vt as OntoToastrService,x as OpenIdConfig,ft as OpenidConfigMapper,ee as Operation,z as OperationGroup,q as OperationGroupSummary,te as OperationGroupSummaryList,Ut as OperationGroupSummaryListMapper,j as OperationList,$ as OperationStatus,W as OperationStatusSummary,Lt as OperationSummaryMapper,Q as OperationType,G as ProductInfo,ct as ProductInfoContextService,pt as ProductInfoService,i as Repository,et as RepositoryContextService,o as RepositoryList,Xe as RepositoryListMapper,l as RepositoryLocation,it as RepositoryLocationContextService,rt as RepositoryLocationService,p as RepositoryLocationType,Qe as RepositoryRestService,Ze as RepositoryService,a as RepositorySizeInfo,u as RepositoryState,me as RepositoryStorageService,c as RepositoryType,$t as ResourceSearchStorageService,L as RestrictedPages,U as Rights,F as STATUS_ORDER,pe as SearchButton,le as SearchButtonConfig,he as SearchButtonList,P as SecurityConfig,gt as SecurityConfigMapper,Ne as SecurityContextService,_t as SecurityService,I as ServiceProvider,V as StorageData,B as StorageKey,r as SubscriptionList,Ee as Suggestion,ge as SuggestionList,Mt as SuggestionListMapper,Ae as SuggestionSelectedPayload,Se as SuggestionType,ae as ToastMessage,ce as ToastMessageList,ne as ToastType,ie as ToastrConfig,se as ToastrPosition,jt as UriUtil,Pe as WindowService,De as getContextName,Me as getCurrentRoute,ve as getPathName,Ue as isHomePage,Le as navigate,be as navigateTo,xe as openInNewTab};