????

Your IP : 3.135.236.134


Current Path : C:/inetpub/vhost/dbadm.gdtsolutions.vn/web/js/
Upload File :
Current File : C:/inetpub/vhost/dbadm.gdtsolutions.vn/web/js/core-navigation-tree-e53397fb57c0b4534aef.js

/*! For license information please see ../license.txt */
"use strict";(self.webpackChunk_cloudbeaver_product_default=self.webpackChunk_cloudbeaver_product_default||[]).push([[44134],{94368:(e,t,a)=>{a.r(t),a.d(t,{LocaleService:()=>r});var n=a(1118),s=a(82103),o=a(5576),i=a(34227);let r=class LocaleService extends s.j{constructor(e){super(),this.localizationService=e}register(){this.localizationService.addProvider(this.provider.bind(this))}async provider(e){switch(e){case"ru":return(await Promise.all([a.e(92436),a.e(53573)]).then(a.bind(a,14772))).default;case"it":return(await Promise.all([a.e(32756),a.e(75954)]).then(a.bind(a,71268))).default;case"zh":return(await Promise.all([a.e(52041),a.e(98335)]).then(a.bind(a,73071))).default;case"fr":return(await Promise.all([a.e(29671),a.e(20716)]).then(a.bind(a,75317))).default;default:return(await Promise.all([a.e(41114),a.e(64049)]).then(a.bind(a,36922))).default}}};r=(0,n.Cg)([(0,o._)(),(0,n.Sn)("design:paramtypes",[i.LocalizationService])],r)},45910:(e,t,a)=>{a.r(t),a.d(t,{NavTreeSettingsService:()=>p});var n=a(1118),s=a(63716),o=a(5576),i=a(76761),r=a(70446),d=a(83916),c=a(80625),h=a(82607),l=a(3065),u=a(31038);const v=l.Ik({"core.navigation-tree.childrenLimit":l.au.number().min(10).max(1e3).default(100),"core.navigation-tree.editing":u.W.stringedBoolean().default(!0),"core.navigation-tree.deleting":u.W.stringedBoolean().default(!0)});let p=class NavTreeSettingsService extends s.O{get childrenLimit(){return this.settings.getValue("core.navigation-tree.childrenLimit")}get editing(){return this.settings.getValue("core.navigation-tree.editing")}get deleting(){return this.settings.getValue("core.navigation-tree.deleting")}constructor(e,t,a){super(),this.settingsProviderService=e,this.settingsManagerService=t,this.settingsResolverService=a,this.settings=this.settingsProviderService.createSettings(v),this.settingsResolverService.addResolver(i.T,(0,r.q)(this.settingsResolverService,this.settings,{"core.navigation-tree.childrenLimit":"core.app.navigationTree.childrenLimit"}),(0,r.q)(this.settingsResolverService,this.settings,{"core.navigation-tree.deleting":"core.app.metadata.deleting","core.navigation-tree.editing":"core.app.metadata.editing"})),this.registerSettings()}registerSettings(){this.settingsManagerService.registerSettings(this.settings,(()=>[]))}};p=(0,n.Cg)([(0,o._)(),(0,n.Sn)("design:paramtypes",[d.SettingsProviderService,c.SettingsManagerService,h.SettingsResolverService])],p)},14841:(e,t,a)=>{a.d(t,{G:()=>n});const n=(0,a(44745).M)("nav-node")},63772:(e,t,a)=>{a.d(t,{T:()=>n});const n=(0,a(44745).M)("nav-nodes")},71185:(e,t,a)=>{a.r(t),a.d(t,{DBObjectParentKey:()=>g,DBObjectResource:()=>I});var n=a(1118),s=a(94866),o=a(5576),i=a(86764),r=a(94652),d=a(40813),c=a(7278),h=a(85213),l=a(41075),u=a(57985),v=a(44512),p=a(83336),f=a(30819),N=a(6587);const g=(0,r.g_)("@db-object/parent",(e=>({parentId:e})));let I=class DBObjectResource extends d.nG{constructor(e,t,a){super(),this.graphQLService=e,this.navNodeInfoResource=t,this.navTreeResource=a,this.aliases.add(g,(e=>(0,c.OU)(a.get(e.options.parentId)||[]))),this.navNodeInfoResource.outdateResource(this),this.navNodeInfoResource.deleteInResource(this),this.navTreeResource.onDataOutdated.addHandler((e=>{h.F.forEach(e,(e=>{const t=this.aliases.isAlias(e,l.uL)||this.aliases.isAlias(e,l.cS);t&&this.markOutdated(g(t.target)),(0,u.l)(e)||this.markOutdated(g(e))}))})),this.beforeLoad.addHandler((async(e,a)=>{await this.navTreeResource.waitLoad();const n=this.aliases.isAlias(e,g),s=this.aliases.isAlias(e,l.uL)||this.aliases.isAlias(e,l.cS);let o=this.navTreeResource.childrenLimit,r=l.A2;if(s&&(o=s.options.limit,r=s.options.offset),n)return void await this.navTreeResource.load((0,l.uL)(r,o).setTarget(n.options.parentId));const d=h.F.toList(this.aliases.transformToKey(e)),u=[...new Set(d.map((e=>this.navNodeInfoResource.get(e)?.parentId)).filter((e=>void 0!==e)))];if(await this.navTreeResource.load((0,c.OU)(u)),d.length>0&&!t.has(d)){i.a.interrupt(a);const e=new v.d(`Entity not found: ${d.toString()}`);throw this.markError(e,d)}}))}async loader(e){let t=this.navTreeResource.childrenLimit,a=l.A2;const n=this.aliases.isAlias(e,g),o=this.aliases.isAlias(e,l.uL)||this.aliases.isAlias(e,l.cS);if(o&&(t=o.options.limit,a=o.options.offset),n){const o=n.options.parentId;return await this.loadFromChildren(o,a,t),(0,s.h5)((()=>{this.offsetPagination.setPageEnd((0,l.uL)(a,t).setTarget(e),this.navTreeResource.offsetPagination.hasNextPage((0,l.uL)(a,t).setTarget(o)))})),this.data}if(!(0,u.l)(e)){const t=[];e=h.F.toList(e),await h.F.forEachAsync(e,(async e=>{t.push(await this.loadDBObjectInfo(e))})),this.set(e,t)}return this.data}async loadFromChildren(e,t,a){const{dbObjects:n}=await this.graphQLService.sdk.getChildrenDBObjectInfo({navNodeId:e,offset:t,limit:a});this.set((0,c.OU)(n.map((e=>e.id))),n)}async loadDBObjectInfo(e){const{objectInfo:t}=await this.graphQLService.sdk.getDBObjectInfo({navNodeId:e});return t}validateKey(e){return"string"==typeof e}};I=(0,n.Cg)([(0,o._)(),(0,n.Sn)("design:paramtypes",[p.GraphQLService,f.NavNodeInfoResource,N.NavTreeResource])],I)},46683:(e,t,a)=>{var n;a.d(t,{E:()=>n}),function(e){e.objectContainer="objectContainer",e.entityContainer="entityContainer",e.relationalEntity="relationalEntity",e.entity="entity",e.container="container",e.dataContainer="dataContainer",e.item="item",e.leaf="leaf",e.canDelete="canDelete",e.canRename="canRename",e.shared="shared"}(n||(n={}))},3942:(e,t,a)=>{var n;a.d(t,{v:()=>n}),function(e){e.script="script",e.scriptExtended="scriptExtended",e.dataContainer="dataContainer",e.dataManipulator="dataManipulator",e.entity="entity",e.schema="schema",e.catalog="catalog",e.dataSource="dataSource",e.dataSourceTemporary="dataSourceTemporary",e.dataSourceConnected="dataSourceConnected",e.entityContainer="entityContainer",e.supportsDataFilter="supportsDataFilter"}(n||(n={}))},81244:(e,t,a)=>{a.d(t,{Z:()=>n});const n="folder"},30819:(e,t,a)=>{a.r(t),a.d(t,{NavNodeInfoResource:()=>p,ROOT_NODE_PATH:()=>v,getNodeDisplayName:()=>getNodeDisplayName,getNodePlainName:()=>getNodePlainName});var n=a(1118),s=a(94866),o=a(56078),i=a(5576),r=a(40813),d=a(85213),c=a(57985),h=a(7278),l=a(83336),u=a(15589);const v="";let p=class NavNodeInfoResource extends r.nG{constructor(e,t){super(),this.graphQLService=e,(0,s.Gn)(this,{setDetails:s.XI,setParent:s.XI}),t.requireAuthentication(this)}setDetails(e,t){this.metadata.update(e,(e=>{!e.withDetails&&t&&(e.outdated=!0,e.outdatedIncludes=(0,s.sH)([...e.includes])),e.withDetails=t}))}getParents(e){const t=[];let a=this.get(e);if(!a)return(0,u.j)(e);for(;a&&void 0!==a.parentId;)t.unshift(a.parentId),a=this.get(a.parentId);return t}getParent(e){return d.F.map(e,(e=>this.get(e)?.parentId))}setParent(e,t){d.F.forEach(e,(e=>{const a=this.get(e);a&&(a.parentId=t)}))}async loader(e){if((0,c.l)(e))throw new Error("Aliases not supported by this resource");const t=[];return await d.F.forEachAsync(e,(async e=>{t.push(await this.loadNodeInfo(e))})),this.set(d.F.toList(e),t),this.data}navNodeInfoToNavNode(e,t){const a=this.get(e.id);let n={...e,objectFeatures:e.object?.features||[],parentId:t??a?.parentId};return a&&(n=(0,s.sH)({...a,...n})),n}async loadNodeFullName(e){const t=await this.load(e),{navNodeInfo:a}=await this.graphQLService.sdk.getNavNodeFullName({nodePath:e});return t.fullName=a.fullName,t}async loadNodeFilter(e){const{navNodeInfo:t}=await this.graphQLService.sdk.navNodeInfo({nodePath:e,withDetails:!1,withFilters:!0});return t.filter}async loadNodeInfo(e){if(this.has(e)){const t=this.metadata.get(e),{navNodeInfo:a}=await this.graphQLService.sdk.navNodeInfo({nodePath:e,withDetails:t.withDetails,withFilters:!1});return this.navNodeInfoToNavNode(a)}return await this.loadNodeParents(e)}async loadNodeParents(e){const t=this.metadata.get(e),{node:a,parents:n}=await this.graphQLService.sdk.getNodeParents({nodePath:e,withDetails:t.withDetails,withFilters:!1});return(0,s.h5)((()=>{const e=this.navNodeInfoToNavNode(a,n[0]?.id);return this.set((0,h.OU)([...n.map((e=>e.id)),e.id]),[...n.reduce(((e,t,a,n)=>(e.push(this.navNodeInfoToNavNode(t,n[a+1]?.id)),e)),[]),e]),e}))}getDefaultMetadata(e,t){return Object.assign(super.getDefaultMetadata(e,t),{withDetails:!1})}dataSet(e,t){const a=this.dataGet(e);super.dataSet(e,Object.assign(a??{},t))}validateKey(e){return"string"==typeof e}};function getNodeDisplayName(e){return e.name??e.id}function getNodePlainName(e){return e.plainName??getNodeDisplayName(e)}p=(0,n.Cg)([(0,i._)(),(0,n.Sn)("design:paramtypes",[l.GraphQLService,o.AppAuthService])],p)},64809:(e,t,a)=>{a.r(t),a.d(t,{ENodeMoveType:()=>n,NavNodeManagerService:()=>O,parseNodeParentId:()=>parseNodeParentId});var n,s=a(1118),o=a(94866),i=a(82103),r=a(5576),d=a(29606),c=a(44017),h=a(7278),l=a(85213),u=a(57385),v=a(31324),p=a(46683),f=a(3942),N=a(30819),g=a(49311),I=a(6587),m=a(86888),y=a(3702);!function(e){e[e.CanDrop=0]="CanDrop",e[e.Drop=1]="Drop"}(n||(n={}));let O=class NavNodeManagerService extends i.j{constructor(e,t,a,n){super(),this.navTree=e,this.navNodeInfoResource=t,this.projectsNavNodeService=a,this.navigationNavNodeContext=(e,t)=>{let a,n,s=t.nodeId,o=t.projectId,i=t.parentId,r="",d=!1;const c=this.getNode(s);if(c&&(a=c.name,n=c.icon,o||=c.projectId,m.n.isDatabaseObject(s))){if(c.folder){const e=this.getParent(c);r=s,e&&!e.folder&&(s=e.id,i=e.parentId,a=e.name,n=e.icon)}t.folderId&&(r=t.folderId)}o||(o=this.projectsNavNodeService.getProject(s)?.id);return{get canOpen(){return d},projectId:o,nodeId:s,parentId:i,folderId:r,name:a,icon:n,markOpen:()=>{d=!0},getParents:()=>this.navNodeInfoResource.getParents(s),loadParents:async e=>{let t=N.ROOT_NODE_PATH;const a=await this.navNodeInfoResource.load((0,h.OU)(e));for(const e of a)e.parentId=t,t=e.id}}},this.syncNodeInfoCache=new v.C((()=>({canOpen:!1,canMove:!1}))),this.onMove=new d.Q(null,((e,t)=>e.type===t.type&&e.targetNode===t.targetNode)),this.onCanOpen=new c.H({nodeId:N.ROOT_NODE_PATH,parentId:N.ROOT_NODE_PATH}),this.navigator=new d.Q({nodeId:N.ROOT_NODE_PATH,parentId:N.ROOT_NODE_PATH},((e,t)=>e.projectId===t.projectId&&e.nodeId===t.nodeId)).before(n.navigationTask).addHandler(this.navigateHandler.bind(this)),this.navNodeInfoResource.onItemDelete.addHandler((0,o.XI)((e=>{l.F.forEach(e,(e=>{this.syncNodeInfoCache.delete(e)}))})))}register(){}load(){}getNavNodeCache(e){return this.syncNodeInfoCache.get(e)}async canMove(e,t){const a=(await this.onMove.execute({type:n.CanDrop,targetNode:e,moveContexts:t})).getContext(g.E);return this.syncNodeInfoCache.get(e.id).canMove=a.canMove,a.canMove}canOpen(e,t,a){if(!this.navNodeInfoResource.has(e))return!1;const n=this.onCanOpen.execute({nodeId:e,parentId:t,folderId:a}).getContext(this.navigationNavNodeContext);return this.syncNodeInfoCache.get(e).canOpen=n.canOpen,n.canOpen}async navToNode(e,t,a){await this.navigator.execute({nodeId:e,parentId:t,folderId:a})}async refreshTree(e){await this.navTree.refreshTree(e)}getTree(e){return"string"==typeof e?this.navTree.get(e):Array.isArray(e)?e.map((e=>this.navTree.data.get(e.nodeId))):this.navTree.get(e.nodeId)}loadTree(e){return this.navTree.load(e)}removeTree(e=N.ROOT_NODE_PATH){this.navTree.delete(e)}getNode(e){return"string"==typeof e?this.navNodeInfoResource.get(e):Array.isArray(e)?e.map((e=>this.navNodeInfoResource.get(e.nodeId))):this.navNodeInfoResource.get(e.nodeId)}async loadNode(...e){const t=await this.navNodeInfoResource.load((0,h.OU)(e.map((e=>e.nodeId))));for(let a=0;a<t.length;a++)t[a].parentId=e[a].parentId;return 1===e.length?this.getNode(e[0]):this.getNode(e)}removeNode(e=N.ROOT_NODE_PATH){this.navNodeInfoResource.delete(e)}getParent(e){if(void 0!==e.parentId)return this.navNodeInfoResource.get(e.parentId)}isNodeHasData(e){return"string"==typeof e&&(e=this.getNode(e)),!(!e||!e.objectFeatures)&&(e.objectFeatures.includes(p.E.dataContainer)||e.objectFeatures.includes(p.E.container))}async getNodeDatabaseAlias(e){const t=this.getNode(e);if(t?.fullName)return t.fullName;return(await this.navNodeInfoResource.loadNodeFullName(e)).fullName}getNodeContainerInfo(e){const scanParents=(e,t)=>{if(!t)return e;const a=this.getNode(t);return a?(a.projectId&&e.projectId!==a.projectId&&(e.projectId=a.projectId),a.objectFeatures.includes(f.v.dataSource)&&(e.connectionNodeId=a.id),a.objectFeatures.includes(f.v.catalog)&&(e.catalogId=a.name),a.objectFeatures.includes(f.v.schema)&&(e.schemaId=a.name),a.parentId===t?e:scanParents(e,a.parentId)):e};return scanParents({},e)}async navigateHandler(e,t){}};function parseNodeParentId(e){const t=e.slice(0,e.lastIndexOf("/"));return"database:/"===t?N.ROOT_NODE_PATH:t}O=(0,s.Cg)([(0,r._)(),(0,s.Sn)("design:paramtypes",[I.NavTreeResource,N.NavNodeInfoResource,y.ProjectsNavNodeService,u.NavigationService])],O)},6587:(e,t,a)=>{a.r(t),a.d(t,{NavTreeResource:()=>C});var n=a(1118),s=a(94866),o=a(11130),i=a(56078),r=a(5576),d=a(29606),c=a(86764),h=a(10392),l=a(40813),u=a(7278),v=a(85213),p=a(57985),f=a(17627),N=a(41075),g=a(98076),I=a(44512),m=a(83336),y=a(82636),O=a(23448),R=a(58158),S=a(45633),w=a(99294),T=a(45910),P=a(30819);let C=class NavTreeResource extends l.nG{get childrenLimit(){return this.navTreeSettingsService.childrenLimit}constructor(e,t,a,n,o,i,r){super(),this.graphQLService=e,this.navNodeInfoResource=t,this.navTreeSettingsService=a,this.sessionDataResource=n,this.userInfoResource=o,this.projectInfoResource=i,this.beforeNodeDelete=new d.Q,this.onNodeRename=new d.Q,this.onNodeMove=new d.Q,(0,s.Gn)(this,{childrenLimit:s.EW,setDetails:s.XI,setNavObject:s.XI,moveToNode:s.XI,deleteInNode:s.XI,unshiftToNode:s.XI,pushToNode:s.XI}),r.requireAuthentication(this),this.onNodeRefresh=new d.Q(null,((e,t)=>e===t)),t.connect(this),this.outdateResource(t),this.updateResource(t),this.sync(this.projectInfoResource,(()=>l.fZ),(()=>l.fZ)),this.projectInfoResource.onDataOutdated.addHandler((()=>this.markTreeOutdated((0,u.OU)(this.keys)))),this.sessionDataResource.onDataOutdated.addHandler((()=>this.markTreeOutdated((0,u.OU)(this.keys)))),this.userInfoResource.onUserChange.addHandler((0,s.XI)((()=>{this.clear(),this.navNodeInfoResource.clear()})))}async preloadNodeParents(e,t){if(0===e.length)return!0;let a;e=[...e];let n=[];for(;e.length>0;){const t=e.shift();if(void 0!==a&&!n.includes(t))return!1;await this.scheduler.waitRelease(t),n=this.isLoadable(t)?await this.load(t):this.get(t)||[],a=t}return!(t&&!n.includes(t))}async refreshTree(e,t=!1){await this.graphQLService.sdk.navRefreshNode({nodePath:e}),t||this.markTreeOutdated(e),await this.onNodeRefresh.execute(e)}markTreeOutdated(e){this.markOutdated((0,u.OU)(this.getNestedChildren(e)))}setDetails(e,t){const a=(0,u.OU)(v.F.mapArray(e,(e=>this.getNestedChildren(e))).flat());this.navNodeInfoResource.setDetails(a,t),this.metadata.update(a,(e=>{!e.withDetails&&t&&(e.outdated=!0,e.outdatedIncludes=(0,s.sH)([...e.includes])),e.withDetails=t}))}async deleteNode(e){const t=await this.beforeNodeDelete.execute(e);if(c.a.isInterrupted(t))return;const a=v.F.toArray(e);await this.performUpdate(e,[],(async()=>{const t=[];try{for(const e of a)await this.graphQLService.sdk.navDeleteNodes({nodePaths:[e]}),t.push(e);this.onDataOutdated.execute(e)}finally{(0,s.h5)((()=>{const e=[],a=new Map;for(const n of t){const t=this.navNodeInfoResource.get(n);if(t&&(e.push(n),void 0!==t.parentId)){const e=a.get(t.parentId)??[];a.set(t.parentId,e)}}const n=(0,u.OU)([...a.keys()]),s=[...a.values()];this.delete((0,u.OU)(e)),this.deleteInNode(n,s)}))}}))}async moveTo(e,t){const a=Array.from(new Set(v.F.mapArray(e,(e=>this.navNodeInfoResource.get(e)?.parentId)).filter(y.O))),n=(0,u.OU)(a);await this.performUpdate(n,[],(async()=>{this.markLoading(t,!0);try{await this.graphQLService.sdk.navMoveTo({nodePaths:v.F.toArray(e),folderPath:t}),this.moveToNode(e,t),this.markLoaded(t),this.onDataOutdated.execute(n)}finally{this.markLoading(t,!1)}})),this.markOutdated((0,u.OU)([...a,t])),await this.onNodeMove.execute({key:e,target:t})}async setFilter(e,t,a){await this.graphQLService.sdk.navSetFolderFilter({nodePath:e,exclude:a,include:t}),this.refreshTree(e)}async changeName(e,t){const a=e.parentId;if((0,O.b0)(a))throw new Error("Root node can't be renamed");const n=await this.performUpdate(a,[],(async()=>{this.markLoading(e.id,!0);try{await this.graphQLService.sdk.navRenameNode({nodePath:e.id,newName:t});const n=e.id.split("/");n.splice(n.length-1,1,t);const s=n.join("/");return this.markTreeOutdated(a),this.markLoaded(e.id),this.onDataOutdated.execute(a),s}finally{this.markLoading(e.id,!1)}}));return await this.onNodeRename.execute({projectId:e.projectId,nodeId:e.id,newNodeId:n}),n}moveSync(e,t){const a=(0,R.U)(t),n=(0,R.U)(e);this.pushToNode(a,[t]);const s=this.navNodeInfoResource.get(e);s&&(s.id=t,s.name=(0,S.L)(t),s.parentId=a,this.navNodeInfoResource.set(t,s)),this.deleteInNode(n,[e]),this.markOutdated((0,u.OU)([a,n]))}moveToNode(e,t){v.F.forEach(e,(e=>{const a=this.navNodeInfoResource.getParent(e);if(void 0!==a){const t=this.data.get(a);if(t){const n=t.filter((t=>t!==e));this.dataSet(a,n)}}this.navNodeInfoResource.setParent(e,t)})),this.pushToNode(t,v.F.toArray(e)),this.markUpdated(v.F.join(t,e)),this.onItemUpdate.execute(e)}deleteInNode(e,t){const a=[];v.F.forEach(e,((e,n)=>{const s=-1===n?t:t[n],o=this.data.get(e);if(o){const t=o.filter((e=>!s.includes(e)));this.dataSet(e,t)}a.push(...s)})),this.delete((0,u.OU)(a)),this.markOutdated(e),this.onItemUpdate.execute(e)}unshiftToNode(e,t){v.F.forEach(e,((e,a)=>{const n=-1===a?t:t[a],s=this.data.get(e)||[];s.unshift(...n),this.dataSet(e,s)})),this.markUpdated(e),this.onItemUpdate.execute(e)}pushToNode(e,t){v.F.forEach(e,((e,a)=>{const n=-1===a?t:t[a],s=this.data.get(e)||[];s.push(...n),this.dataSet(e,s)})),this.markUpdated(e),this.onItemUpdate.execute(e)}insertToNode(e,t,...a){const n=this.data.get(e)||[];n.splice(t,0,...a),this.dataSet(e,n),this.markUpdated(e),this.onItemUpdate.execute(e)}set(e,t){const a=[],n=[];if((0,u._e)(e)){n.push(...(0,w.C)(t));const s=(0,w.C)(this.get(e));a.push(...s.filter((e=>void 0!==e&&!n.includes(e))))}else{n.push(...t);const s=this.get(e)||[];a.push(...s.filter((e=>!n.includes(e))))}this.delete((0,u.OU)(a)),this.cleanError((0,u.OU)(n)),super.set(e,t)}delete(e){const t=(0,u.OU)(this.getNestedChildren(e));0!==t.length&&(super.delete(t),this.navNodeInfoResource.delete(t.exclude(e)))}async preLoadData(e,t){await v.F.forEachAsync(e,(async a=>{if((0,p.l)(a))return;this.navNodeInfoResource.has(a)||a===P.ROOT_NODE_PATH||await this.navNodeInfoResource.loadNodeParents(a);const n=this.navNodeInfoResource.getParents(a);if(!await this.preloadNodeParents(n,a)){const s=new I.d(`Entity not found:\n"${a}"\nPath:\n${n.map((e=>`"${e}"`)).join("\n")}`),o=new f.B(this,e,void 0,"Entity not found",{cause:s});throw c.a.interrupt(t),this.markError(o,e)}}))}async loader(e){const t=this.aliases.isAlias(e,N.uL)||this.aliases.isAlias(e,N.cS);if(this.aliases.isAlias(e,l.fZ))throw new Error("Loading all nodes is prohibited");const a=t?.options.offset??N.A2,n=t?.options.limit??this.childrenLimit,s=[];return await v.F.forEachAsync(e,(async e=>{const o=t?.target??e,i=await this.loadNodeChildren(o,a,n);s.push(i),this.offsetPagination.setPageEnd((0,N.uL)(a,i.navNodeChildren.length).setTarget(o),i.navNodeChildren.length===n)})),this.setNavObject(s,a,n),this.data}getNestedChildren(e){const t=[];let a;for(a=(0,u._e)(e)?e.concat():[e,...this.get(e)||[]],t.push(...a);a.length;){const e=a.shift(),n=this.get(e)||[];a.push(...n),t.push(...n)}return t}setNavObject(e,t,a){if(Array.isArray(e)){if(0===e.length)return;for(const t of e){const e=this.metadata.get(t.parentPath);this.setDetails((0,u.OU)([t.navNodeInfo.id,...t.navNodeChildren.map((e=>e.id))]),e.withDetails)}this.navNodeInfoResource.set((0,u.OU)([...e.map((e=>e.parentPath)),...e.map((e=>e.navNodeChildren.map((e=>e.id)))).flat()]),[...e.map((e=>this.navNodeInfoResource.navNodeInfoToNavNode(e.navNodeInfo))).flat(),...e.map((e=>e.navNodeChildren.map((t=>this.navNodeInfoResource.navNodeInfoToNavNode(t,e.parentPath))))).flat()]),this.set((0,u.OU)(e.map((e=>e.parentPath))),e.map((e=>this.insertSlice(e,t,a))))}else{const n=this.metadata.get(e.parentPath);this.setDetails((0,u.OU)([e.navNodeInfo.id,...e.navNodeChildren.map((e=>e.id))]),n.withDetails),this.navNodeInfoResource.set((0,u.OU)([e.parentPath,...e.navNodeChildren.map((e=>e.id))]),[this.navNodeInfoResource.navNodeInfoToNavNode(e.navNodeInfo),...e.navNodeChildren.map((t=>this.navNodeInfoResource.navNodeInfoToNavNode(t,e.parentPath)))]),this.set(e.parentPath,this.insertSlice(e,t,a))}}insertSlice(e,t,a){let n=[...this.get(e.parentPath)||[]];return n.splice(t,a,...e.navNodeChildren.map((e=>e.id))),e.navNodeChildren.length<a&&n.splice(t+e.navNodeChildren.length,n.length-t-e.navNodeChildren.length),n=n.filter(((e,t,a)=>a.indexOf(e)===t)),n}async loadNodeChildren(e,t,a){const n=this.metadata.get(e),{navNodeChildren:s,navNodeInfo:o}=await this.graphQLService.sdk.navNodeChildren({parentPath:e,offset:t,limit:a,withDetails:n.withDetails,withFilters:!1});return{navNodeChildren:s,navNodeInfo:o,parentPath:e}}getDefaultMetadata(e,t){return Object.assign(super.getDefaultMetadata(e,t),{withDetails:!1})}validateKey(e){return"string"==typeof e}};C=(0,n.Cg)([(0,r._)(),(0,n.Sn)("design:paramtypes",[m.GraphQLService,P.NavNodeInfoResource,T.NavTreeSettingsService,g.SessionDataResource,o.UserInfoResource,h.ProjectInfoResource,i.AppAuthService])],C)},86888:(e,t,a)=>{a.d(t,{n:()=>n});const n={connectionIdToConnectionNodeId:e=>`database://${e}`,isDatabaseObject:e=>e.startsWith("database://"),concatSchemaAndCatalog:(e,t)=>`${t||""}${t&&e?"@":""}${e||""}`}},3702:(e,t,a)=>{a.r(t),a.d(t,{ProjectsNavNodeService:()=>c});var n=a(1118),s=a(5576),o=a(97007),i=a(10392),r=a(7278),d=a(30819);let c=class ProjectsNavNodeService{constructor(e,t){this.navNodeInfoResource=e,this.projectInfoResource=t,this.projectTypes=[o.O],this.projectPrefixes=["resource://"]}addProjectType(e){this.projectTypes.push(e)}addProjectPrefix(e){this.projectPrefixes.push(e)}getProject(e){const t=[...this.navNodeInfoResource.getParents(e),e],a=this.navNodeInfoResource.get((0,r.OU)(t)).find((e=>this.projectTypes.includes(e?.nodeType||"")));if(a)return this.getByNodeId(a.id)}getByNodeId(e){return this.projectInfoResource.get(this.projectPrefixes.reduce(((e,t)=>e.replace(t,"")),e))}};c=(0,n.Cg)([(0,s._)(),(0,n.Sn)("design:paramtypes",[d.NavNodeInfoResource,i.ProjectInfoResource])],c)},7137:(e,t,a)=>{a.d(t,{U:()=>objectNavNodeProvider,_:()=>isObjectNavNodeProvider});var n=a(88381);const s=Symbol("@extension/ObjectNavNodeProvider");function objectNavNodeProvider(e){return(0,n.w)(e,s)}function isObjectNavNodeProvider(e){return(0,n.o)(e,s)}},35350:(e,t,a)=>{a.d(t,{x:()=>getNodesFromContext});var n=a(14841),s=a(63772);function getNodesFromContext(e){const t=e.get(n.G),a=e.get(s.T);let o=a?.();return(!o||o.length<2)&&(o=[]),t&&!o.includes(t)&&o.push(t),o}},49311:(e,t,a)=>{function navNodeMoveContext(e,t){return{canMove:!1,setCanMove(e){this.canMove=e}}}a.d(t,{E:()=>navNodeMoveContext})},33620:(e,t,a)=>{function nodeDeleteContext(e,t){return{confirmed:!1,confirm(){this.confirmed=!0}}}a.d(t,{v:()=>nodeDeleteContext})}}]);