solid-panes 5.1.0-2 → 5.1.0-3

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 (58) hide show
  1. package/README.md +6 -0
  2. package/dist/components/profile-heading/ProfileHeading.cjs.js +2 -2
  3. package/dist/components/profile-heading/ProfileHeading.cjs.js.map +1 -1
  4. package/dist/components/profile-heading/ProfileHeading.esm.js +2 -2
  5. package/dist/components/profile-heading/ProfileHeading.esm.js.map +1 -1
  6. package/dist/components/profile-heading/ProfileHeading.styles.cjs.js +1 -1
  7. package/dist/components/profile-heading/ProfileHeading.styles.cjs.js.map +1 -1
  8. package/dist/components/profile-heading/ProfileHeading.styles.esm.js +1 -1
  9. package/dist/components/profile-heading/ProfileHeading.styles.esm.js.map +1 -1
  10. package/dist/index.cjs.js +1 -1
  11. package/dist/index.cjs.js.map +1 -1
  12. package/dist/index.d.ts +1 -0
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.esm.js +16 -15
  15. package/dist/index.esm.js.map +1 -1
  16. package/dist/mainPage/index.cjs.js +1 -1
  17. package/dist/mainPage/index.cjs.js.map +1 -1
  18. package/dist/mainPage/index.d.ts.map +1 -1
  19. package/dist/mainPage/index.esm.js +36 -25
  20. package/dist/mainPage/index.esm.js.map +1 -1
  21. package/dist/mainPage/profileHeading.d.ts +2 -1
  22. package/dist/mainPage/profileHeading.d.ts.map +1 -1
  23. package/dist/mainPage/profileHeading2.cjs.js +1 -1
  24. package/dist/mainPage/profileHeading2.cjs.js.map +1 -1
  25. package/dist/mainPage/profileHeading2.esm.js +75 -75
  26. package/dist/mainPage/profileHeading2.esm.js.map +1 -1
  27. package/dist/navigation/chrome.cjs.js +1 -1
  28. package/dist/navigation/chrome.cjs.js.map +1 -1
  29. package/dist/navigation/chrome.d.ts +20 -2
  30. package/dist/navigation/chrome.d.ts.map +1 -1
  31. package/dist/navigation/chrome.esm.js +14 -8
  32. package/dist/navigation/chrome.esm.js.map +1 -1
  33. package/dist/navigation/controller.cjs.js +1 -1
  34. package/dist/navigation/controller.cjs.js.map +1 -1
  35. package/dist/navigation/controller.d.ts +3 -0
  36. package/dist/navigation/controller.d.ts.map +1 -1
  37. package/dist/navigation/controller.esm.js +49 -28
  38. package/dist/navigation/controller.esm.js.map +1 -1
  39. package/dist/navigation/options.cjs.js +1 -1
  40. package/dist/navigation/options.cjs.js.map +1 -1
  41. package/dist/navigation/options.d.ts +12 -0
  42. package/dist/navigation/options.d.ts.map +1 -1
  43. package/dist/navigation/options.esm.js +4 -1
  44. package/dist/navigation/options.esm.js.map +1 -1
  45. package/dist/navigation/podContext.cjs.js +1 -1
  46. package/dist/navigation/podContext.cjs.js.map +1 -1
  47. package/dist/navigation/podContext.d.ts.map +1 -1
  48. package/dist/navigation/podContext.esm.js +14 -14
  49. package/dist/navigation/podContext.esm.js.map +1 -1
  50. package/dist/outline/manager2.cjs.js +1 -1
  51. package/dist/outline/manager2.cjs.js.map +1 -1
  52. package/dist/outline/manager2.esm.js +352 -321
  53. package/dist/outline/manager2.esm.js.map +1 -1
  54. package/dist/versionInfo.cjs.js +1 -1
  55. package/dist/versionInfo.cjs.js.map +1 -1
  56. package/dist/versionInfo.esm.js +3 -3
  57. package/dist/versionInfo.esm.js.map +1 -1
  58. package/package.json +2 -2
@@ -1,2 +1,2 @@
1
- const e=require("../utils/webIdUtils.cjs.js"),t=require("../utils/podUtils.cjs.js"),n=require("../utils/paneUtils.cjs.js");let r=require("solid-logic"),i=require("rdflib");var a=500,o=new Map,s=new Map,c=new Map;function l(e){try{let t=new URL(e),[n=``]=t.pathname.split(`/`).filter(Boolean);return`${t.origin}|${n}`}catch{return e}}function u(e){return(0,i.sym)(e).doc().uri}function d(e,t,n,r,i){let o=e.get(t);if(o)return o;let s=r().catch(r=>(console.warn(`Could not load the ${n} for ${t}`,r),e.get(t)===s&&e.delete(t),i));return e.set(t,s),e.size>a&&e.delete(e.keys().next().value),s}function f(t){return d(o,u(t),`owner of the pod`,async()=>{let n=(0,i.sym)(t),r=await e.loadProfileFromURI(n);return r.uri===n.uri&&!e.isWebIdUri(n)?void 0:r.value},void 0)}function p(e){return d(s,l(e),`storages of the pod`,()=>n.getFolderPanesFromURI((0,i.sym)(e)),[])}function m(e){return e?d(c,e,`storages of the viewer`,async()=>(await t.getPodStorages((0,i.sym)(e))).map(e=>e.uri),[]):Promise.resolve([])}async function h(e=window.location.href){let t=r.authn.currentUser()?.value,[n,i,a]=await Promise.all([f(e),p(e),m(t)]);return{viewer:t,owner:n,storagePanes:i,viewerStorages:a}}function g(e,t){return e.owner===t.owner&&e.viewer===t.viewer&&e.storagePanes.map(e=>e.subject.value).join()===t.storagePanes.map(e=>e.subject.value).join()}function _(e,t){return e.viewerStorages.some(e=>t.startsWith(e))}async function v(e){return _(await h(e),e)}exports.getPodContext=h,exports.isInViewerPod=_,exports.isPageInViewerPod=v,exports.isSamePod=g;
1
+ const e=require("../utils/webIdUtils.cjs.js"),t=require("../utils/podUtils.cjs.js"),n=require("../utils/paneUtils.cjs.js");let r=require("solid-logic"),i=require("rdflib");var a=500,o=new Map,s=new Map,c=new Map;function l(e){try{let t=new URL(e),[n=``]=t.pathname.split(`/`).filter(Boolean);return`${t.origin}|${n}`}catch{return e}}function u(e){return(0,i.sym)(e).doc().uri}function d(e,t,n,r,i){let o=e.get(t);if(o)return o;let s=r().catch(r=>(console.warn(`Could not load the ${n} for ${t}`,r),e.get(t)===s&&e.delete(t),i));return e.set(t,s),e.size>a&&e.delete(e.keys().next().value),s}function f(t){return d(o,u(t),`owner of the pod`,async()=>{let n=(0,i.sym)(t),r=await e.loadProfileFromURI(n);return r.uri===n.uri&&!e.isWebIdUri(n)?void 0:r.value},void 0)}function p(e,t){let r=t?(0,i.sym)(t):(0,i.sym)(e);return d(s,l(e),`storages of the pod`,()=>n.getFolderPanesFromURI(r),[])}function m(e){return e?d(c,e,`storages of the viewer`,async()=>(await t.getPodStorages((0,i.sym)(e))).map(e=>e.uri),[]):Promise.resolve([])}async function h(e=window.location.href){let t=r.authn.currentUser()?.value,[n,i]=await Promise.all([f(e),m(t)]);return{viewer:t,owner:n,storagePanes:await p(e,n),viewerStorages:i}}function g(){o.clear(),s.clear(),c.clear()}function _(e,t){return e.owner===t.owner&&e.viewer===t.viewer&&e.storagePanes.map(e=>e.subject.value).join()===t.storagePanes.map(e=>e.subject.value).join()}function v(e,t){return e.viewerStorages.some(e=>t.startsWith(e))}async function y(e){return v(await h(e),e)}exports.getPodContext=h,exports.isInViewerPod=v,exports.isPageInViewerPod=y,exports.isSamePod=_,exports.resetPodContexts=g;
2
2
  //# sourceMappingURL=podContext.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"podContext.cjs.js","names":["sym","loadProfileFromURI","isWebIdUri","getFolderPanesFromURI","getPodStorages","authn","require_webIdUtils","require_podUtils","require_paneUtils","solid_logic","rdflib","MAX_REMEMBERED","owners","storages","viewerStorages","podKey","url","pageUrl","first","documentKey","remember","existing","cache","key","created","load","what","error","fallback","ownerOf","subject","webId","storagesOf","storagesOfViewer","viewer","storage","getPodContext","owner","storagePanes","ownStorages","isSamePod","a","b","pane","isInViewerPod","context","isPageInViewerPod"],"sources":["../../src/navigation/podContext.ts"],"sourcesContent":["/*\n * Whose pod the page is in, and which storages the viewer owns.\n *\n * Several parts of the page need this: the navbar builds its items from it, the profile heading\n * shows the owner, and the outline decides whether the file explorer header fits. Each part is\n * looked up once and cached, so they no longer each look it up, or read it back from each\n * other's DOM.\n */\n\nimport { authn } from 'solid-logic'\nimport { sym } from 'rdflib'\nimport { isWebIdUri, loadProfileFromURI } from '../utils/webIdUtils'\nimport { getFolderPanesFromURI, type PaneItem } from '../utils/paneUtils'\nimport { getPodStorages } from '../utils/podUtils'\n\nexport interface PodContext {\n /** WebID of the logged-in user. */\n viewer?: string\n /** WebID of the person whose pod the page is in; unknown when no profile could be found. */\n owner?: string\n /** The storages of that pod, as panes the navbar can open. */\n storagePanes: PaneItem[]\n /** The storages the viewer owns. */\n viewerStorages: string[]\n}\n\nconst MAX_REMEMBERED = 500\n\n// What was found depends on different parts of the URL, so each part is remembered on its own:\n// - the owner depends on the document: the profile lookup can end with that document's own\n// foaf:primaryTopic, so two pages of one pod may not share an owner\n// - the storages depend on the pod, derived from the origin and the first path segment\n// - the viewer's storages depend only on who the viewer is\nconst owners = new Map<string, Promise<string | undefined>>()\nconst storages = new Map<string, Promise<PaneItem[]>>()\nconst viewerStorages = new Map<string, Promise<string[]>>()\n\nfunction podKey (pageUrl: string): string {\n try {\n const url = new URL(pageUrl)\n const [first = ''] = url.pathname.split('/').filter(Boolean)\n return `${url.origin}|${first}`\n } catch {\n return pageUrl\n }\n}\n\nfunction documentKey (pageUrl: string): string {\n return sym(pageUrl).doc().uri\n}\n\n/**\n * Remembers a lookup, unless it failed: a failure is not kept, so that the next request asks again.\n */\nfunction remember<T> (\n cache: Map<string, Promise<T>>,\n key: string,\n what: string,\n load: () => Promise<T>,\n fallback: T\n): Promise<T> {\n const existing = cache.get(key)\n if (existing) return existing\n\n const created: Promise<T> = load().catch(error => {\n console.warn(`Could not load the ${what} for ${key}`, error)\n if (cache.get(key) === created) cache.delete(key)\n return fallback\n })\n cache.set(key, created)\n if (cache.size > MAX_REMEMBERED) cache.delete(cache.keys().next().value as string)\n return created\n}\n\nfunction ownerOf (pageUrl: string): Promise<string | undefined> {\n return remember(owners, documentKey(pageUrl), 'owner of the pod', async () => {\n const subject = sym(pageUrl)\n const webId = await loadProfileFromURI(subject)\n // The lookup falls back to the URL itself when it finds no profile\n return webId.uri === subject.uri && !isWebIdUri(subject) ? undefined : webId.value\n }, undefined)\n}\n\nfunction storagesOf (pageUrl: string): Promise<PaneItem[]> {\n return remember(storages, podKey(pageUrl), 'storages of the pod', () => getFolderPanesFromURI(sym(pageUrl)), [])\n}\n\nfunction storagesOfViewer (viewer: string | undefined): Promise<string[]> {\n if (!viewer) return Promise.resolve([])\n return remember(viewerStorages, viewer, 'storages of the viewer', async () => {\n return (await getPodStorages(sym(viewer))).map(storage => storage.uri)\n }, [])\n}\n\n/** The context for the pod a URL is in; the page's own URL by default. */\nexport async function getPodContext (pageUrl: string = window.location.href): Promise<PodContext> {\n const viewer = authn.currentUser()?.value\n const [owner, storagePanes, ownStorages] = await Promise.all([\n ownerOf(pageUrl), storagesOf(pageUrl), storagesOfViewer(viewer)\n ])\n return { viewer, owner, storagePanes, viewerStorages: ownStorages }\n}\n\n/** Forget what was loaded, for example when tests start over. */\nexport function resetPodContexts (): void {\n owners.clear()\n storages.clear()\n viewerStorages.clear()\n}\n\n/** Whether two contexts describe the same pod, so that a navbar built from one fits the other. */\nexport function isSamePod (a: PodContext, b: PodContext): boolean {\n return a.owner === b.owner && a.viewer === b.viewer &&\n a.storagePanes.map(pane => pane.subject.value).join() === b.storagePanes.map(pane => pane.subject.value).join()\n}\n\nexport function isInViewerPod (context: PodContext, url: string): boolean {\n return context.viewerStorages.some(storage => url.startsWith(storage))\n}\n\n/** Whether the URL lies within one of the viewer's own storages. */\nexport async function isPageInViewerPod (url: string): Promise<boolean> {\n return isInViewerPod(await getPodContext(url), url)\n}\n"],"mappings":"A,4KA0BA,IAAMW,EAAiB,IAOjBC,EAAS,IAAI,IACbC,EAAW,IAAI,IACfC,EAAiB,IAAI,IAE3B,SAASC,EAAQ,EAAyB,CACxC,GAAI,CACF,IAAMC,EAAM,IAAI,IAAIC,CAAO,EACrB,CAACC,EAAQ,IAAMF,EAAI,SAAS,MAAM,GAAG,CAAC,CAAC,OAAO,OAAO,EAC3D,MAAO,GAAGA,EAAI,OAAO,GAAGE,GAC1B,MAAQ,CACN,OAAOD,CACT,CACF,CAEA,SAASE,EAAa,EAAyB,CAC7C,OAAA,EAAOnB,EAAAA,IAAAA,CAAIiB,CAAO,CAAC,CAAC,IAAI,CAAC,CAAC,GAC5B,CAKA,SAASG,EACP,EACA,EACA,EACA,EACA,EACY,CACZ,IAAMC,EAAWC,EAAM,IAAIC,CAAG,EAC9B,GAAIF,EAAU,OAAOA,EAErB,IAAMG,EAAsBC,EAAK,CAAC,CAAC,MAAM,IACvC,QAAQ,KAAK,sBAAsBC,EAAK,OAAOH,IAAOI,CAAK,EACvDL,EAAM,IAAIC,CAAG,IAAMC,GAASF,EAAM,OAAOC,CAAG,EACzCK,EACR,EAGD,OAFAN,EAAM,IAAIC,EAAKC,CAAO,EAClBF,EAAM,KAAOX,GAAgBW,EAAM,OAAOA,EAAM,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,KAAe,EAC1EE,CACT,CAEA,SAASK,EAAS,EAA8C,CAC9D,OAAOT,EAASR,EAAQO,EAAYF,CAAO,EAAG,mBAAoB,SAAY,CAC5E,IAAMa,GAAA,EAAU9B,EAAAA,IAAAA,CAAIiB,CAAO,EACrBc,EAAQ,MAAM9B,EAAAA,mBAAmB6B,CAAO,EAE9C,OAAOC,EAAM,MAAQD,EAAQ,KAAO,CAAC5B,EAAAA,WAAW4B,CAAO,EAAI,IAAA,GAAYC,EAAM,KAC/E,EAAG,IAAA,EAAS,CACd,CAEA,SAASC,EAAY,EAAsC,CACzD,OAAOZ,EAASP,EAAUE,EAAOE,CAAO,EAAG,0BAA6Bd,EAAAA,uBAAAA,EAAsBH,EAAAA,IAAAA,CAAIiB,CAAO,CAAC,EAAG,CAAC,CAAC,CACjH,CAEA,SAASgB,EAAkB,EAA+C,CAExE,OADKC,EACEd,EAASN,EAAgBoB,EAAQ,yBAA0B,UACxD,MAAM9B,EAAAA,gBAAAA,EAAeJ,EAAAA,IAAAA,CAAIkC,CAAM,CAAC,EAAA,CAAG,IAAI,GAAWC,EAAQ,GAAG,EACpE,CAAC,CAAC,EAHe,QAAQ,QAAQ,CAAC,CAAC,CAIxC,CAGA,eAAsBC,EAAe,EAAkB,OAAO,SAAS,KAA2B,CAChG,IAAMF,EAAS7B,EAAAA,MAAM,YAAY,CAAC,EAAE,MAC9B,CAACgC,EAAOC,EAAcC,GAAe,MAAM,QAAQ,IAAI,CAC3DV,EAAQZ,CAAO,EAAGe,EAAWf,CAAO,EAAGgB,EAAiBC,CAAM,CAChE,CAAC,EACD,MAAO,CAAE,SAAQ,QAAO,eAAc,eAAgBK,CAAY,CACpE,CAUA,SAAgBC,EAAW,EAAe,EAAwB,CAChE,OAAOC,EAAE,QAAUC,EAAE,OAASD,EAAE,SAAWC,EAAE,QAC3CD,EAAE,aAAa,IAAI,GAAQE,EAAK,QAAQ,KAAK,CAAC,CAAC,KAAK,IAAMD,EAAE,aAAa,IAAI,GAAQC,EAAK,QAAQ,KAAK,CAAC,CAAC,KAAK,CAClH,CAEA,SAAgBC,EAAe,EAAqB,EAAsB,CACxE,OAAOC,EAAQ,eAAe,KAAK,GAAW7B,EAAI,WAAWmB,CAAO,CAAC,CACvE,CAGA,eAAsBW,EAAmB,EAA+B,CACtE,OAAOF,EAAc,MAAMR,EAAcpB,CAAG,EAAGA,CAAG,CACpD,C"}
1
+ {"version":3,"file":"podContext.cjs.js","names":["sym","loadProfileFromURI","isWebIdUri","getFolderPanesFromURI","getPodStorages","authn","require_webIdUtils","require_podUtils","require_paneUtils","solid_logic","rdflib","MAX_REMEMBERED","owners","storages","viewerStorages","podKey","url","pageUrl","first","documentKey","remember","existing","cache","key","created","load","what","error","fallback","ownerOf","subject","webId","storagesOf","storageSubject","owner","storagesOfViewer","viewer","storage","getPodContext","ownStorages","resetPodContexts","isSamePod","a","b","pane","isInViewerPod","context","isPageInViewerPod"],"sources":["../../src/navigation/podContext.ts"],"sourcesContent":["/*\n * Whose pod the page is in, and which storages the viewer owns.\n *\n * Several parts of the page need this: the navbar builds its items from it, the profile heading\n * shows the owner, and the outline decides whether the file explorer header fits. Each part is\n * looked up once and cached, so they no longer each look it up, or read it back from each\n * other's DOM.\n */\n\nimport { authn } from 'solid-logic'\nimport { sym } from 'rdflib'\nimport { isWebIdUri, loadProfileFromURI } from '../utils/webIdUtils'\nimport { getFolderPanesFromURI, type PaneItem } from '../utils/paneUtils'\nimport { getPodStorages } from '../utils/podUtils'\n\nexport interface PodContext {\n /** WebID of the logged-in user. */\n viewer?: string\n /** WebID of the person whose pod the page is in; unknown when no profile could be found. */\n owner?: string\n /** The storages of that pod, as panes the navbar can open. */\n storagePanes: PaneItem[]\n /** The storages the viewer owns. */\n viewerStorages: string[]\n}\n\nconst MAX_REMEMBERED = 500\n\n// What was found depends on different parts of the URL, so each part is remembered on its own:\n// - the owner depends on the document: the profile lookup can end with that document's own\n// foaf:primaryTopic, so two pages of one pod may not share an owner\n// - the storages depend on the pod, derived from the origin and the first path segment\n// - the viewer's storages depend only on who the viewer is\nconst owners = new Map<string, Promise<string | undefined>>()\nconst storages = new Map<string, Promise<PaneItem[]>>()\nconst viewerStorages = new Map<string, Promise<string[]>>()\n\nfunction podKey (pageUrl: string): string {\n try {\n const url = new URL(pageUrl)\n const [first = ''] = url.pathname.split('/').filter(Boolean)\n return `${url.origin}|${first}`\n } catch {\n return pageUrl\n }\n}\n\nfunction documentKey (pageUrl: string): string {\n return sym(pageUrl).doc().uri\n}\n\n/**\n * Remembers a lookup, unless it failed: a failure is not kept, so that the next request asks again.\n */\nfunction remember<T> (\n cache: Map<string, Promise<T>>,\n key: string,\n what: string,\n load: () => Promise<T>,\n fallback: T\n): Promise<T> {\n const existing = cache.get(key)\n if (existing) return existing\n\n const created: Promise<T> = load().catch(error => {\n console.warn(`Could not load the ${what} for ${key}`, error)\n if (cache.get(key) === created) cache.delete(key)\n return fallback\n })\n cache.set(key, created)\n if (cache.size > MAX_REMEMBERED) cache.delete(cache.keys().next().value as string)\n return created\n}\n\nfunction ownerOf (pageUrl: string): Promise<string | undefined> {\n return remember(owners, documentKey(pageUrl), 'owner of the pod', async () => {\n const subject = sym(pageUrl)\n const webId = await loadProfileFromURI(subject)\n // The lookup falls back to the URL itself when it finds no profile\n return webId.uri === subject.uri && !isWebIdUri(subject) ? undefined : webId.value\n }, undefined)\n}\n\nfunction storagesOf (pageUrl: string, owner?: string): Promise<PaneItem[]> {\n const storageSubject = owner ? sym(owner) : sym(pageUrl)\n return remember(storages, podKey(pageUrl), 'storages of the pod', () => getFolderPanesFromURI(storageSubject), [])\n}\n\nfunction storagesOfViewer (viewer: string | undefined): Promise<string[]> {\n if (!viewer) return Promise.resolve([])\n return remember(viewerStorages, viewer, 'storages of the viewer', async () => {\n return (await getPodStorages(sym(viewer))).map(storage => storage.uri)\n }, [])\n}\n\n/** The context for the pod a URL is in; the page's own URL by default. */\nexport async function getPodContext (pageUrl: string = window.location.href): Promise<PodContext> {\n const viewer = authn.currentUser()?.value\n const [owner, ownStorages] = await Promise.all([\n ownerOf(pageUrl), storagesOfViewer(viewer)\n ])\n const storagePanes = await storagesOf(pageUrl, owner)\n return { viewer, owner, storagePanes, viewerStorages: ownStorages }\n}\n\n/** Forget what was loaded, for example when tests start over. */\nexport function resetPodContexts (): void {\n owners.clear()\n storages.clear()\n viewerStorages.clear()\n}\n\n/** Whether two contexts describe the same pod, so that a navbar built from one fits the other. */\nexport function isSamePod (a: PodContext, b: PodContext): boolean {\n return a.owner === b.owner && a.viewer === b.viewer &&\n a.storagePanes.map(pane => pane.subject.value).join() === b.storagePanes.map(pane => pane.subject.value).join()\n}\n\nexport function isInViewerPod (context: PodContext, url: string): boolean {\n return context.viewerStorages.some(storage => url.startsWith(storage))\n}\n\n/** Whether the URL lies within one of the viewer's own storages. */\nexport async function isPageInViewerPod (url: string): Promise<boolean> {\n return isInViewerPod(await getPodContext(url), url)\n}\n"],"mappings":"A,4KA0BA,IAAMW,EAAiB,IAOjBC,EAAS,IAAI,IACbC,EAAW,IAAI,IACfC,EAAiB,IAAI,IAE3B,SAASC,EAAQ,EAAyB,CACxC,GAAI,CACF,IAAMC,EAAM,IAAI,IAAIC,CAAO,EACrB,CAACC,EAAQ,IAAMF,EAAI,SAAS,MAAM,GAAG,CAAC,CAAC,OAAO,OAAO,EAC3D,MAAO,GAAGA,EAAI,OAAO,GAAGE,GAC1B,MAAQ,CACN,OAAOD,CACT,CACF,CAEA,SAASE,EAAa,EAAyB,CAC7C,OAAA,EAAOnB,EAAAA,IAAAA,CAAIiB,CAAO,CAAC,CAAC,IAAI,CAAC,CAAC,GAC5B,CAKA,SAASG,EACP,EACA,EACA,EACA,EACA,EACY,CACZ,IAAMC,EAAWC,EAAM,IAAIC,CAAG,EAC9B,GAAIF,EAAU,OAAOA,EAErB,IAAMG,EAAsBC,EAAK,CAAC,CAAC,MAAM,IACvC,QAAQ,KAAK,sBAAsBC,EAAK,OAAOH,IAAOI,CAAK,EACvDL,EAAM,IAAIC,CAAG,IAAMC,GAASF,EAAM,OAAOC,CAAG,EACzCK,EACR,EAGD,OAFAN,EAAM,IAAIC,EAAKC,CAAO,EAClBF,EAAM,KAAOX,GAAgBW,EAAM,OAAOA,EAAM,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,KAAe,EAC1EE,CACT,CAEA,SAASK,EAAS,EAA8C,CAC9D,OAAOT,EAASR,EAAQO,EAAYF,CAAO,EAAG,mBAAoB,SAAY,CAC5E,IAAMa,GAAA,EAAU9B,EAAAA,IAAAA,CAAIiB,CAAO,EACrBc,EAAQ,MAAM9B,EAAAA,mBAAmB6B,CAAO,EAE9C,OAAOC,EAAM,MAAQD,EAAQ,KAAO,CAAC5B,EAAAA,WAAW4B,CAAO,EAAI,IAAA,GAAYC,EAAM,KAC/E,EAAG,IAAA,EAAS,CACd,CAEA,SAASC,EAAY,EAAiB,EAAqC,CACzE,IAAMC,EAAiBC,GAAA,EAAQlC,EAAAA,IAAAA,CAAIkC,CAAK,GAAA,EAAIlC,EAAAA,IAAAA,CAAIiB,CAAO,EACvD,OAAOG,EAASP,EAAUE,EAAOE,CAAO,EAAG,0BAA6Bd,EAAAA,sBAAsB8B,CAAc,EAAG,CAAC,CAAC,CACnH,CAEA,SAASE,EAAkB,EAA+C,CAExE,OADKC,EACEhB,EAASN,EAAgBsB,EAAQ,yBAA0B,UACxD,MAAMhC,EAAAA,gBAAAA,EAAeJ,EAAAA,IAAAA,CAAIoC,CAAM,CAAC,EAAA,CAAG,IAAI,GAAWC,EAAQ,GAAG,EACpE,CAAC,CAAC,EAHe,QAAQ,QAAQ,CAAC,CAAC,CAIxC,CAGA,eAAsBC,EAAe,EAAkB,OAAO,SAAS,KAA2B,CAChG,IAAMF,EAAS/B,EAAAA,MAAM,YAAY,CAAC,EAAE,MAC9B,CAAC6B,EAAOK,GAAe,MAAM,QAAQ,IAAI,CAC7CV,EAAQZ,CAAO,EAAGkB,EAAiBC,CAAM,CAC3C,CAAC,EAED,MAAO,CAAE,SAAQ,QAAO,aAAA,MADGJ,EAAWf,EAASiB,CAAK,EACd,eAAgBK,CAAY,CACpE,CAGA,SAAgBC,GAA0B,CACxC5B,EAAO,MAAM,EACbC,EAAS,MAAM,EACfC,EAAe,MAAM,CACvB,CAGA,SAAgB2B,EAAW,EAAe,EAAwB,CAChE,OAAOC,EAAE,QAAUC,EAAE,OAASD,EAAE,SAAWC,EAAE,QAC3CD,EAAE,aAAa,IAAI,GAAQE,EAAK,QAAQ,KAAK,CAAC,CAAC,KAAK,IAAMD,EAAE,aAAa,IAAI,GAAQC,EAAK,QAAQ,KAAK,CAAC,CAAC,KAAK,CAClH,CAEA,SAAgBC,EAAe,EAAqB,EAAsB,CACxE,OAAOC,EAAQ,eAAe,KAAK,GAAW9B,EAAI,WAAWqB,CAAO,CAAC,CACvE,CAGA,eAAsBU,EAAmB,EAA+B,CACtE,OAAOF,EAAc,MAAMP,EAActB,CAAG,EAAGA,CAAG,CACpD,C"}
@@ -1 +1 @@
1
- {"version":3,"file":"podContext.d.ts","sourceRoot":"","sources":["../../src/navigation/podContext.ts"],"names":[],"mappings":"AAYA,OAAO,EAAyB,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAGzE,MAAM,WAAW,UAAU;IACzB,mCAAmC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,4FAA4F;IAC5F,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,8DAA8D;IAC9D,YAAY,EAAE,QAAQ,EAAE,CAAA;IACxB,oCAAoC;IACpC,cAAc,EAAE,MAAM,EAAE,CAAA;CACzB;AAsED,0EAA0E;AAC1E,wBAAsB,aAAa,CAAE,OAAO,GAAE,MAA6B,GAAG,OAAO,CAAC,UAAU,CAAC,CAMhG;AAED,iEAAiE;AACjE,wBAAgB,gBAAgB,IAAK,IAAI,CAIxC;AAED,kGAAkG;AAClG,wBAAgB,SAAS,CAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,GAAG,OAAO,CAGhE;AAED,wBAAgB,aAAa,CAAE,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAExE;AAED,oEAAoE;AACpE,wBAAsB,iBAAiB,CAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAEtE"}
1
+ {"version":3,"file":"podContext.d.ts","sourceRoot":"","sources":["../../src/navigation/podContext.ts"],"names":[],"mappings":"AAYA,OAAO,EAAyB,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAGzE,MAAM,WAAW,UAAU;IACzB,mCAAmC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,4FAA4F;IAC5F,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,8DAA8D;IAC9D,YAAY,EAAE,QAAQ,EAAE,CAAA;IACxB,oCAAoC;IACpC,cAAc,EAAE,MAAM,EAAE,CAAA;CACzB;AAuED,0EAA0E;AAC1E,wBAAsB,aAAa,CAAE,OAAO,GAAE,MAA6B,GAAG,OAAO,CAAC,UAAU,CAAC,CAOhG;AAED,iEAAiE;AACjE,wBAAgB,gBAAgB,IAAK,IAAI,CAIxC;AAED,kGAAkG;AAClG,wBAAgB,SAAS,CAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,GAAG,OAAO,CAGhE;AAED,wBAAgB,aAAa,CAAE,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAExE;AAED,oEAAoE;AACpE,wBAAsB,iBAAiB,CAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAEtE"}
@@ -28,34 +28,34 @@ function p(n) {
28
28
  return i.uri === r.uri && !e(r) ? void 0 : i.value;
29
29
  }, void 0);
30
30
  }
31
- function m(e) {
32
- return f(c, u(e), "storages of the pod", () => r(a(e)), []);
31
+ function m(e, t) {
32
+ let n = a(t || e);
33
+ return f(c, u(e), "storages of the pod", () => r(n), []);
33
34
  }
34
35
  function h(e) {
35
36
  return e ? f(l, e, "storages of the viewer", async () => (await n(a(e))).map((e) => e.uri), []) : Promise.resolve([]);
36
37
  }
37
38
  async function g(e = window.location.href) {
38
- let t = i.currentUser()?.value, [n, r, a] = await Promise.all([
39
- p(e),
40
- m(e),
41
- h(t)
42
- ]);
39
+ let t = i.currentUser()?.value, [n, r] = await Promise.all([p(e), h(t)]);
43
40
  return {
44
41
  viewer: t,
45
42
  owner: n,
46
- storagePanes: r,
47
- viewerStorages: a
43
+ storagePanes: await m(e, n),
44
+ viewerStorages: r
48
45
  };
49
46
  }
50
- function _(e, t) {
51
- return e.owner === t.owner && e.viewer === t.viewer && e.storagePanes.map((e) => e.subject.value).join() === t.storagePanes.map((e) => e.subject.value).join();
47
+ function _() {
48
+ s.clear(), c.clear(), l.clear();
52
49
  }
53
50
  function v(e, t) {
51
+ return e.owner === t.owner && e.viewer === t.viewer && e.storagePanes.map((e) => e.subject.value).join() === t.storagePanes.map((e) => e.subject.value).join();
52
+ }
53
+ function y(e, t) {
54
54
  return e.viewerStorages.some((e) => t.startsWith(e));
55
55
  }
56
- async function y(e) {
57
- return v(await g(e), e);
56
+ async function b(e) {
57
+ return y(await g(e), e);
58
58
  }
59
- export { g as getPodContext, v as isInViewerPod, y as isPageInViewerPod, _ as isSamePod };
59
+ export { g as getPodContext, y as isInViewerPod, b as isPageInViewerPod, v as isSamePod, _ as resetPodContexts };
60
60
 
61
61
  //# sourceMappingURL=podContext.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"podContext.esm.js","names":["MAX_REMEMBERED","owners","storages","viewerStorages","podKey","url","pageUrl","first","documentKey","sym","remember","existing","cache","key","created","load","what","error","fallback","ownerOf","subject","webId","loadProfileFromURI","isWebIdUri","storagesOf","getFolderPanesFromURI","storagesOfViewer","viewer","getPodStorages","storage","getPodContext","authn","owner","storagePanes","ownStorages","isSamePod","a","b","pane","isInViewerPod","context","isPageInViewerPod"],"sources":["../../src/navigation/podContext.ts"],"sourcesContent":["/*\n * Whose pod the page is in, and which storages the viewer owns.\n *\n * Several parts of the page need this: the navbar builds its items from it, the profile heading\n * shows the owner, and the outline decides whether the file explorer header fits. Each part is\n * looked up once and cached, so they no longer each look it up, or read it back from each\n * other's DOM.\n */\n\nimport { authn } from 'solid-logic'\nimport { sym } from 'rdflib'\nimport { isWebIdUri, loadProfileFromURI } from '../utils/webIdUtils'\nimport { getFolderPanesFromURI, type PaneItem } from '../utils/paneUtils'\nimport { getPodStorages } from '../utils/podUtils'\n\nexport interface PodContext {\n /** WebID of the logged-in user. */\n viewer?: string\n /** WebID of the person whose pod the page is in; unknown when no profile could be found. */\n owner?: string\n /** The storages of that pod, as panes the navbar can open. */\n storagePanes: PaneItem[]\n /** The storages the viewer owns. */\n viewerStorages: string[]\n}\n\nconst MAX_REMEMBERED = 500\n\n// What was found depends on different parts of the URL, so each part is remembered on its own:\n// - the owner depends on the document: the profile lookup can end with that document's own\n// foaf:primaryTopic, so two pages of one pod may not share an owner\n// - the storages depend on the pod, derived from the origin and the first path segment\n// - the viewer's storages depend only on who the viewer is\nconst owners = new Map<string, Promise<string | undefined>>()\nconst storages = new Map<string, Promise<PaneItem[]>>()\nconst viewerStorages = new Map<string, Promise<string[]>>()\n\nfunction podKey (pageUrl: string): string {\n try {\n const url = new URL(pageUrl)\n const [first = ''] = url.pathname.split('/').filter(Boolean)\n return `${url.origin}|${first}`\n } catch {\n return pageUrl\n }\n}\n\nfunction documentKey (pageUrl: string): string {\n return sym(pageUrl).doc().uri\n}\n\n/**\n * Remembers a lookup, unless it failed: a failure is not kept, so that the next request asks again.\n */\nfunction remember<T> (\n cache: Map<string, Promise<T>>,\n key: string,\n what: string,\n load: () => Promise<T>,\n fallback: T\n): Promise<T> {\n const existing = cache.get(key)\n if (existing) return existing\n\n const created: Promise<T> = load().catch(error => {\n console.warn(`Could not load the ${what} for ${key}`, error)\n if (cache.get(key) === created) cache.delete(key)\n return fallback\n })\n cache.set(key, created)\n if (cache.size > MAX_REMEMBERED) cache.delete(cache.keys().next().value as string)\n return created\n}\n\nfunction ownerOf (pageUrl: string): Promise<string | undefined> {\n return remember(owners, documentKey(pageUrl), 'owner of the pod', async () => {\n const subject = sym(pageUrl)\n const webId = await loadProfileFromURI(subject)\n // The lookup falls back to the URL itself when it finds no profile\n return webId.uri === subject.uri && !isWebIdUri(subject) ? undefined : webId.value\n }, undefined)\n}\n\nfunction storagesOf (pageUrl: string): Promise<PaneItem[]> {\n return remember(storages, podKey(pageUrl), 'storages of the pod', () => getFolderPanesFromURI(sym(pageUrl)), [])\n}\n\nfunction storagesOfViewer (viewer: string | undefined): Promise<string[]> {\n if (!viewer) return Promise.resolve([])\n return remember(viewerStorages, viewer, 'storages of the viewer', async () => {\n return (await getPodStorages(sym(viewer))).map(storage => storage.uri)\n }, [])\n}\n\n/** The context for the pod a URL is in; the page's own URL by default. */\nexport async function getPodContext (pageUrl: string = window.location.href): Promise<PodContext> {\n const viewer = authn.currentUser()?.value\n const [owner, storagePanes, ownStorages] = await Promise.all([\n ownerOf(pageUrl), storagesOf(pageUrl), storagesOfViewer(viewer)\n ])\n return { viewer, owner, storagePanes, viewerStorages: ownStorages }\n}\n\n/** Forget what was loaded, for example when tests start over. */\nexport function resetPodContexts (): void {\n owners.clear()\n storages.clear()\n viewerStorages.clear()\n}\n\n/** Whether two contexts describe the same pod, so that a navbar built from one fits the other. */\nexport function isSamePod (a: PodContext, b: PodContext): boolean {\n return a.owner === b.owner && a.viewer === b.viewer &&\n a.storagePanes.map(pane => pane.subject.value).join() === b.storagePanes.map(pane => pane.subject.value).join()\n}\n\nexport function isInViewerPod (context: PodContext, url: string): boolean {\n return context.viewerStorages.some(storage => url.startsWith(storage))\n}\n\n/** Whether the URL lies within one of the viewer's own storages. */\nexport async function isPageInViewerPod (url: string): Promise<boolean> {\n return isInViewerPod(await getPodContext(url), url)\n}\n"],"mappings":";;;;;;AA0BA,IAAMA,IAAiB,KAOjBC,oBAAS,IAAI,IAAyC,GACtDC,oBAAW,IAAI,IAAiC,GAChDC,oBAAiB,IAAI,IAA+B;AAE1D,SAASC,EAAQ,GAAyB;CACxC,IAAI;EACF,IAAMC,IAAM,IAAI,IAAIC,CAAO,GACrB,CAACC,IAAQ,MAAMF,EAAI,SAAS,MAAM,GAAG,CAAC,CAAC,OAAO,OAAO;EAC3D,OAAO,GAAGA,EAAI,OAAO,GAAGE;CAC1B,QAAQ;EACN,OAAOD;CACT;AACF;AAEA,SAASE,EAAa,GAAyB;CAC7C,OAAOC,EAAIH,CAAO,CAAC,CAAC,IAAI,CAAC,CAAC;AAC5B;AAKA,SAASI,EACP,GACA,GACA,GACA,GACA,GACY;CACZ,IAAMC,IAAWC,EAAM,IAAIC,CAAG;CAC9B,IAAIF,GAAU,OAAOA;CAErB,IAAMG,IAAsBC,EAAK,CAAC,CAAC,OAAM,OACvC,QAAQ,KAAK,sBAAsBC,EAAK,OAAOH,KAAOI,CAAK,GACvDL,EAAM,IAAIC,CAAG,MAAMC,KAASF,EAAM,OAAOC,CAAG,GACzCK,EACR;CAGD,OAFAN,EAAM,IAAIC,GAAKC,CAAO,GAClBF,EAAM,OAAOZ,KAAgBY,EAAM,OAAOA,EAAM,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,KAAe,GAC1EE;AACT;AAEA,SAASK,EAAS,GAA8C;CAC9D,OAAOT,EAAST,GAAQO,EAAYF,CAAO,GAAG,oBAAoB,YAAY;EAC5E,IAAMc,IAAUX,EAAIH,CAAO,GACrBe,IAAQ,MAAMC,EAAmBF,CAAO;EAE9C,OAAOC,EAAM,QAAQD,EAAQ,OAAO,CAACG,EAAWH,CAAO,IAAI,KAAA,IAAYC,EAAM;CAC/E,GAAG,KAAA,CAAS;AACd;AAEA,SAASG,EAAY,GAAsC;CACzD,OAAOd,EAASR,GAAUE,EAAOE,CAAO,GAAG,6BAA6BmB,EAAsBhB,EAAIH,CAAO,CAAC,GAAG,CAAC,CAAC;AACjH;AAEA,SAASoB,EAAkB,GAA+C;CAExE,OADKC,IACEjB,EAASP,GAAgBwB,GAAQ,0BAA0B,aACxD,MAAMC,EAAenB,EAAIkB,CAAM,CAAC,EAAA,CAAG,KAAI,MAAWE,EAAQ,GAAG,GACpE,CAAC,CAAC,IAHe,QAAQ,QAAQ,CAAC,CAAC;AAIxC;AAGA,eAAsBC,EAAe,IAAkB,OAAO,SAAS,MAA2B;CAChG,IAAMH,IAASI,EAAM,YAAY,CAAC,EAAE,OAC9B,CAACC,GAAOC,GAAcC,KAAe,MAAM,QAAQ,IAAI;EAC3Df,EAAQb,CAAO;EAAGkB,EAAWlB,CAAO;EAAGoB,EAAiBC,CAAM;CAChE,CAAC;CACD,OAAO;EAAE;EAAQ;EAAO;EAAc,gBAAgBO;CAAY;AACpE;AAUA,SAAgBC,EAAW,GAAe,GAAwB;CAChE,OAAOC,EAAE,UAAUC,EAAE,SAASD,EAAE,WAAWC,EAAE,UAC3CD,EAAE,aAAa,KAAI,MAAQE,EAAK,QAAQ,KAAK,CAAC,CAAC,KAAK,MAAMD,EAAE,aAAa,KAAI,MAAQC,EAAK,QAAQ,KAAK,CAAC,CAAC,KAAK;AAClH;AAEA,SAAgBC,EAAe,GAAqB,GAAsB;CACxE,OAAOC,EAAQ,eAAe,MAAK,MAAWnC,EAAI,WAAWwB,CAAO,CAAC;AACvE;AAGA,eAAsBY,EAAmB,GAA+B;CACtE,OAAOF,EAAc,MAAMT,EAAczB,CAAG,GAAGA,CAAG;AACpD"}
1
+ {"version":3,"file":"podContext.esm.js","names":["MAX_REMEMBERED","owners","storages","viewerStorages","podKey","url","pageUrl","first","documentKey","sym","remember","existing","cache","key","created","load","what","error","fallback","ownerOf","subject","webId","loadProfileFromURI","isWebIdUri","storagesOf","storageSubject","owner","getFolderPanesFromURI","storagesOfViewer","viewer","getPodStorages","storage","getPodContext","authn","ownStorages","resetPodContexts","isSamePod","a","b","pane","isInViewerPod","context","isPageInViewerPod"],"sources":["../../src/navigation/podContext.ts"],"sourcesContent":["/*\n * Whose pod the page is in, and which storages the viewer owns.\n *\n * Several parts of the page need this: the navbar builds its items from it, the profile heading\n * shows the owner, and the outline decides whether the file explorer header fits. Each part is\n * looked up once and cached, so they no longer each look it up, or read it back from each\n * other's DOM.\n */\n\nimport { authn } from 'solid-logic'\nimport { sym } from 'rdflib'\nimport { isWebIdUri, loadProfileFromURI } from '../utils/webIdUtils'\nimport { getFolderPanesFromURI, type PaneItem } from '../utils/paneUtils'\nimport { getPodStorages } from '../utils/podUtils'\n\nexport interface PodContext {\n /** WebID of the logged-in user. */\n viewer?: string\n /** WebID of the person whose pod the page is in; unknown when no profile could be found. */\n owner?: string\n /** The storages of that pod, as panes the navbar can open. */\n storagePanes: PaneItem[]\n /** The storages the viewer owns. */\n viewerStorages: string[]\n}\n\nconst MAX_REMEMBERED = 500\n\n// What was found depends on different parts of the URL, so each part is remembered on its own:\n// - the owner depends on the document: the profile lookup can end with that document's own\n// foaf:primaryTopic, so two pages of one pod may not share an owner\n// - the storages depend on the pod, derived from the origin and the first path segment\n// - the viewer's storages depend only on who the viewer is\nconst owners = new Map<string, Promise<string | undefined>>()\nconst storages = new Map<string, Promise<PaneItem[]>>()\nconst viewerStorages = new Map<string, Promise<string[]>>()\n\nfunction podKey (pageUrl: string): string {\n try {\n const url = new URL(pageUrl)\n const [first = ''] = url.pathname.split('/').filter(Boolean)\n return `${url.origin}|${first}`\n } catch {\n return pageUrl\n }\n}\n\nfunction documentKey (pageUrl: string): string {\n return sym(pageUrl).doc().uri\n}\n\n/**\n * Remembers a lookup, unless it failed: a failure is not kept, so that the next request asks again.\n */\nfunction remember<T> (\n cache: Map<string, Promise<T>>,\n key: string,\n what: string,\n load: () => Promise<T>,\n fallback: T\n): Promise<T> {\n const existing = cache.get(key)\n if (existing) return existing\n\n const created: Promise<T> = load().catch(error => {\n console.warn(`Could not load the ${what} for ${key}`, error)\n if (cache.get(key) === created) cache.delete(key)\n return fallback\n })\n cache.set(key, created)\n if (cache.size > MAX_REMEMBERED) cache.delete(cache.keys().next().value as string)\n return created\n}\n\nfunction ownerOf (pageUrl: string): Promise<string | undefined> {\n return remember(owners, documentKey(pageUrl), 'owner of the pod', async () => {\n const subject = sym(pageUrl)\n const webId = await loadProfileFromURI(subject)\n // The lookup falls back to the URL itself when it finds no profile\n return webId.uri === subject.uri && !isWebIdUri(subject) ? undefined : webId.value\n }, undefined)\n}\n\nfunction storagesOf (pageUrl: string, owner?: string): Promise<PaneItem[]> {\n const storageSubject = owner ? sym(owner) : sym(pageUrl)\n return remember(storages, podKey(pageUrl), 'storages of the pod', () => getFolderPanesFromURI(storageSubject), [])\n}\n\nfunction storagesOfViewer (viewer: string | undefined): Promise<string[]> {\n if (!viewer) return Promise.resolve([])\n return remember(viewerStorages, viewer, 'storages of the viewer', async () => {\n return (await getPodStorages(sym(viewer))).map(storage => storage.uri)\n }, [])\n}\n\n/** The context for the pod a URL is in; the page's own URL by default. */\nexport async function getPodContext (pageUrl: string = window.location.href): Promise<PodContext> {\n const viewer = authn.currentUser()?.value\n const [owner, ownStorages] = await Promise.all([\n ownerOf(pageUrl), storagesOfViewer(viewer)\n ])\n const storagePanes = await storagesOf(pageUrl, owner)\n return { viewer, owner, storagePanes, viewerStorages: ownStorages }\n}\n\n/** Forget what was loaded, for example when tests start over. */\nexport function resetPodContexts (): void {\n owners.clear()\n storages.clear()\n viewerStorages.clear()\n}\n\n/** Whether two contexts describe the same pod, so that a navbar built from one fits the other. */\nexport function isSamePod (a: PodContext, b: PodContext): boolean {\n return a.owner === b.owner && a.viewer === b.viewer &&\n a.storagePanes.map(pane => pane.subject.value).join() === b.storagePanes.map(pane => pane.subject.value).join()\n}\n\nexport function isInViewerPod (context: PodContext, url: string): boolean {\n return context.viewerStorages.some(storage => url.startsWith(storage))\n}\n\n/** Whether the URL lies within one of the viewer's own storages. */\nexport async function isPageInViewerPod (url: string): Promise<boolean> {\n return isInViewerPod(await getPodContext(url), url)\n}\n"],"mappings":";;;;;;AA0BA,IAAMA,IAAiB,KAOjBC,oBAAS,IAAI,IAAyC,GACtDC,oBAAW,IAAI,IAAiC,GAChDC,oBAAiB,IAAI,IAA+B;AAE1D,SAASC,EAAQ,GAAyB;CACxC,IAAI;EACF,IAAMC,IAAM,IAAI,IAAIC,CAAO,GACrB,CAACC,IAAQ,MAAMF,EAAI,SAAS,MAAM,GAAG,CAAC,CAAC,OAAO,OAAO;EAC3D,OAAO,GAAGA,EAAI,OAAO,GAAGE;CAC1B,QAAQ;EACN,OAAOD;CACT;AACF;AAEA,SAASE,EAAa,GAAyB;CAC7C,OAAOC,EAAIH,CAAO,CAAC,CAAC,IAAI,CAAC,CAAC;AAC5B;AAKA,SAASI,EACP,GACA,GACA,GACA,GACA,GACY;CACZ,IAAMC,IAAWC,EAAM,IAAIC,CAAG;CAC9B,IAAIF,GAAU,OAAOA;CAErB,IAAMG,IAAsBC,EAAK,CAAC,CAAC,OAAM,OACvC,QAAQ,KAAK,sBAAsBC,EAAK,OAAOH,KAAOI,CAAK,GACvDL,EAAM,IAAIC,CAAG,MAAMC,KAASF,EAAM,OAAOC,CAAG,GACzCK,EACR;CAGD,OAFAN,EAAM,IAAIC,GAAKC,CAAO,GAClBF,EAAM,OAAOZ,KAAgBY,EAAM,OAAOA,EAAM,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,KAAe,GAC1EE;AACT;AAEA,SAASK,EAAS,GAA8C;CAC9D,OAAOT,EAAST,GAAQO,EAAYF,CAAO,GAAG,oBAAoB,YAAY;EAC5E,IAAMc,IAAUX,EAAIH,CAAO,GACrBe,IAAQ,MAAMC,EAAmBF,CAAO;EAE9C,OAAOC,EAAM,QAAQD,EAAQ,OAAO,CAACG,EAAWH,CAAO,IAAI,KAAA,IAAYC,EAAM;CAC/E,GAAG,KAAA,CAAS;AACd;AAEA,SAASG,EAAY,GAAiB,GAAqC;CACzE,IAAMC,IAAyBhB,EAARiB,KAAyBpB,CAAO;CACvD,OAAOI,EAASR,GAAUE,EAAOE,CAAO,GAAG,6BAA6BqB,EAAsBF,CAAc,GAAG,CAAC,CAAC;AACnH;AAEA,SAASG,EAAkB,GAA+C;CAExE,OADKC,IACEnB,EAASP,GAAgB0B,GAAQ,0BAA0B,aACxD,MAAMC,EAAerB,EAAIoB,CAAM,CAAC,EAAA,CAAG,KAAI,MAAWE,EAAQ,GAAG,GACpE,CAAC,CAAC,IAHe,QAAQ,QAAQ,CAAC,CAAC;AAIxC;AAGA,eAAsBC,EAAe,IAAkB,OAAO,SAAS,MAA2B;CAChG,IAAMH,IAASI,EAAM,YAAY,CAAC,EAAE,OAC9B,CAACP,GAAOQ,KAAe,MAAM,QAAQ,IAAI,CAC7Cf,EAAQb,CAAO,GAAGsB,EAAiBC,CAAM,CAC3C,CAAC;CAED,OAAO;EAAE;EAAQ;EAAO,cAAA,MADGL,EAAWlB,GAASoB,CAAK;EACd,gBAAgBQ;CAAY;AACpE;AAGA,SAAgBC,IAA0B;CAGxC,AAFAlC,EAAO,MAAM,GACbC,EAAS,MAAM,GACfC,EAAe,MAAM;AACvB;AAGA,SAAgBiC,EAAW,GAAe,GAAwB;CAChE,OAAOC,EAAE,UAAUC,EAAE,SAASD,EAAE,WAAWC,EAAE,UAC3CD,EAAE,aAAa,KAAI,MAAQE,EAAK,QAAQ,KAAK,CAAC,CAAC,KAAK,MAAMD,EAAE,aAAa,KAAI,MAAQC,EAAK,QAAQ,KAAK,CAAC,CAAC,KAAK;AAClH;AAEA,SAAgBC,EAAe,GAAqB,GAAsB;CACxE,OAAOC,EAAQ,eAAe,MAAK,MAAWpC,EAAI,WAAW0B,CAAO,CAAC;AACvE;AAGA,eAAsBW,EAAmB,GAA+B;CACtE,OAAOF,EAAc,MAAMR,EAAc3B,CAAG,GAAGA,CAAG;AACpD"}
@@ -1,2 +1,2 @@
1
- (function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.obj{vertical-align:top;border:none;margin:.2em;padding:0 0 5px}.iconTD{vertical-align:top;border:none;width:0;margin:.2em;padding:0}.labelTD{width:100%}.strongHeader{margin:0 .6rem 0 0;padding:.1rem .4rem;font-size:150%}.tableFullWidth{width:100%;background:var(--color-background,#f8f9fb)!important}.placeholderTable{width:100%}.tdFlex{vertical-align:top;border-radius:5px;flex-direction:row;justify-content:space-between;display:flex;overflow:hidden}solid-ui-file-explorer-provider{flex-direction:column;gap:0;width:100%;min-width:0;height:100%;min-height:0;display:flex;overflow:hidden}solid-ui-file-explorer-provider.tdFlex{flex-direction:column;align-items:stretch}solid-ui-file-explorer-provider>solid-ui-file-explorer-header{flex:none;width:100%}solid-ui-file-explorer-provider>.paneDiv,solid-ui-file-explorer-provider>.exceptionPane{flex:auto;width:100%;min-height:0;margin:0;overflow:hidden auto}.paneDiv,.exceptionPane{box-sizing:border-box;width:100%;min-width:0;max-width:100%;display:block;overflow-x:hidden}.objectValue--literal{white-space:pre-wrap}.objectValue--integer,.objectValue--decimal,.objectValue--double{text-align:right;display:block}.objectValueAccessIcon,.objectValueLinkIcon,.phoneIcon{vertical-align:middle;display:inline-block}.objectValueLinkIcon,.phoneIcon{width:12px;height:12px}@media (width<=600px){.obj,.iconTD{vertical-align:top;font-size:100%;margin:0!important}}`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();const e=require("../_virtual/_rolldown/runtime.cjs.js");;const t=require("./propertyViews.cjs.js"),n=require("./outlineIcons.cjs.js"),r=require("./userInput.cjs.js"),i=require("./queryByExample.cjs.js"),a=require("../utils/webIdUtils.cjs.js"),o=require("../utils/podUtils.cjs.js"),s=require("../navigation/chrome.cjs.js"),c=require("../navigation/podContext.cjs.js"),l=require("../navigation/state.cjs.js"),u=require("../navigation/events.cjs.js"),d=require("../navigation/options.cjs.js"),f=require("../navigation/navbarVisibility.cjs.js"),p=require("./outlineDomHelpers.cjs.js"),m=require("./fileExplorerHelpers.cjs.js");let h=require("solid-ui");h=e.__toESM(h);let g=require("solid-logic"),_=require("pane-registry");_=e.__toESM(_);let v=require("rdflib");v=e.__toESM(v),require("solid-ui/components/file-explorer-provider"),require("solid-ui/components/file-explorer-header");let y=require("solid-ui/components/access-control-modal");y=e.__toESM(y);var b=`solid-ui-file-explorer-provider`;function x(e){let x=e.dom,S=new WeakMap,C=new WeakSet;this.document=e.dom,this.context=e,this.outlineIcons=n.outlineIcons,this.labeller=this.labeller||{},this.labeller.LanguagePreference=``;let w=this,T=this,E=[];this.selection=E,this.ancestor=h.utils.ancestor,this.sparql=v.UpdateManager,this.kb=g.store;let D=g.store,O=g.store.fetcher;x.outline=this,this.qs=new i.QuerySource,this.UserInput=new r.UserInput(this),this.clipboardAddress=`tabulator:clipboard`,this.UserInput.clipboardInit(this.clipboardAddress);let{outlineObjectDiv:k,outlinePredicateDiv:A,termWidget:j}=p.createOutlineDomHelpers({dom:x,UI:h,kb:g.store,outlineIcons:n.outlineIcons,expandMouseDownListener:se,selectableTDClickListener:fe,setSelected:G,viewAsBoringDefault:he,removeNodeIconMouseDownListener:de});this.outlineObjectDiv=k,this.outlinePredicateDiv=A,this.outlineObjectTD=k,this.outlinePredicateTD=A,this.termWidget=j,this.init=function(){let e=N();e.outline=this},this.getLayoutMode=function(){let e=this.context?.environment?.layout;if(e===`mobile`||e===`desktop`)return e;if(typeof window<`u`&&window.matchMedia){let e=Math.round(Math.min(window.innerWidth,window.visualViewport?.width||window.innerWidth)),t=window.matchMedia(`(pointer: coarse)`).matches||navigator.maxTouchPoints>0;return e<=768||t&&e<=1024?`mobile`:`desktop`}return`desktop`},M.lastkbsize=0;function M(e){let t=[];for(let e=arguments.length-1;e>0;e--)t[e-1]=arguments[e];let n=new Date().getTime(),r=e.apply(e,t),i=new Date().getTime();return h.log.info(`BENCHMARK: kb delta: `+(D.statements.length-M.lastkbsize)+`, time elapsed for `+e+` was `+(i-n)+`ms`),M.lastkbsize=D.statements.length,r}this.appendAccessIcons=function(e,t,n){if(n.termType!==`NamedNode`)return;let r=e.uris(n);r.sort();let i=null;for(let e=0;e<r.length;e++)r[e]!==i&&(i=r[e],T.appendAccessIcon(t,i))},this.appendAccessIcon=function(e,t){if(!t)return``;let r=v.uri.docpart(t);if(r.slice(0,5)!==`http:`)return``;let i=O.getState(r),a,o,s;switch(i){case`unrequested`:a=n.outlineIcons.src.icon_unrequested,o=`fetch`,s=ue;break;case`requested`:a=n.outlineIcons.src.icon_requested,o=`fetching`,s=J;break;case`fetched`:a=n.outlineIcons.src.icon_fetched,s=le,o=`loaded`;break;case`failed`:a=n.outlineIcons.src.icon_failed,o=`failed`,s=J;break;case`unpermitted`:a=n.outlineIcons.src.icon_failed,s=J,o=`no perm`;break;case`unfetchable`:a=n.outlineIcons.src.icon_failed,s=J,o=`cannot fetch`;break;default:h.log.error(`?? state = `+i)}let c=h.utils.AJARImage(a,o,n.outlineIcons.tooltips[a].replace(/[Tt]his resource/,r),x);return c.classList.add(`objectValueAccessIcon`),c.setAttribute(`uri`,t),c.addEventListener(`click`,s),oe(c,r),e.appendChild(c),c};function N(){return te(`OutlineView`,`Resource browser`)}function ee(e){f.refreshNavbarVisibility(e.uri).catch(e=>h.log.error(`Failed to update navbar visibility: `+e))}function te(e){if(e===`OutlineView`){let e=document.getElementById(`OutlineView`);if(e)return e;let t=document.getElementById(`MainContent`)||document.body;if(t){let e=document.createElement(`div`);return e.id=`OutlineView`,e.classList.add(`outline-view`),e.setAttribute(`aria-label`,`Resource browser`),t.appendChild(e),e}}}async function P(e,t){return e.uri.endsWith(`/`)&&await o.loadContainerRepresentation(e),h.getRelevantPanes(e,t,{excludedPaneNames:[`sharing`],fallbackPaneName:`internal`})}function ne(e,t){return e.find(e=>e.shouldGetFocus&&e.shouldGetFocus(t))||e[0]}function F(e){let t=x.getElementById(`queryButton`);t&&(e?t.removeAttribute(`style`):t.setAttribute(`style`,`display:none;`))}function I(t,n,r,i){if(!t||!r)return;let a;try{h.log.info(`outline: Rendering pane (menu): `+r.name),a=r.render(n,e,i)}catch(e){a=x.createElement(`div`),a.setAttribute(`class`,`exceptionPane`);let t=x.createElement(`pre`);a.appendChild(t),t.appendChild(x.createTextNode(h.utils.stackString(e)))}R(t,n,r,a)}function L(e,t,n){n?(F(!!n.requireQueryButton),e.pane=n,I(e,t,n,S.get(e)?.options||{})):h.log.warn(`outline: Unable to open pane in place: pane is undefined.`)}function R(t,n,r,i){let a=S.get(t);h.composeExplorer(t,{context:e,subjectUri:n.uri,pane:r,relevantPanes:t.relevantPanes||[],header:a&&s.explorerHeaderForPane(a.showHeader,r?.name)?{paneIcon:m.getPaneIcon(r,n,e),menuItems:a.menuItems}:void 0,paneElement:i})}async function re(t,n,r,i){r||={},i||=x.createElement(b);let o={generation:(S.get(i)?.generation||0)+1,menuItems:[],options:r};S.set(i,o),i.classList.add(`paneView`,`tdFlex`),i.setAttribute(`notSelectable`,`true`),i.setAttribute(`role`,`grid`),i.setAttribute(`about`,t.toNT()),r.hover&&i.classList.add(`hoverControl`),i.context=e,i.subjectUri=t.uri,i.soloPane=r.solo,C.has(i)||(i.addEventListener(h.FILE_EXPLORER_BACK_EVENT,e=>{h.isExplorerEvent(e,i)&&(e.stopPropagation(),ce({target:i}))}),i.addEventListener(h.FILE_EXPLORER_MANAGE_ACCESS_EVENT,e=>{e.stopPropagation();let t=v.sym(e.detail.subjectUri).doc();g.solidLogicSingleton.acl.findAccessGrants(t).then(e=>{h.showDialog(y.default,{props:{subjectUri:t.uri,accessGrants:e}})}).catch(e=>{h.log.error(`outline: Failed to open access controls: `+h.utils.stackString(e))})}),i.addEventListener(h.FILE_EXPLORER_OPEN_PANE_EVENT,t=>{if(!h.isExplorerEvent(t,i))return;t.stopPropagation();let n=e.session.paneRegistry.byName(t.detail.paneName);L(i,v.sym(t.detail.subjectUri),n)}),C.add(i));let l=r.hideList?[]:await P(t,e);if(S.get(i)!==o)return i;let u=e.session.logic?.resource||g.solidLogicSingleton.resource,d=t.uri.endsWith(`/`)?v.sym(`${t.uri}index.ttl`):null;if(r.solo&&!n&&d&&(typeof u?.containerHasIndexDocument==`function`&&u.containerHasIndexDocument(t)||D.holds(t,h.ns.ldp(`contains`),d,t.doc()))){if(t=typeof u?.getContainerIndexThing==`function`?u.getContainerIndexThing(t):v.sym(`${d.uri}#this`),await D.fetcher.load(t.doc()),l=await P(t,e),S.get(i)!==o)return i;i.subjectUri=t.uri,i.setAttribute(`about`,t.toNT())}i.relevantPanes=l,i.pane=n||ne(l,t);let f=!!(t&&t.uri&&t.site&&t.site().uri===t.uri),p=!!r.headerOnlyInViewerPod,w=!t.uri.endsWith(`/index.ttl#this`)&&s.deriveExplorerHeader({isRootResource:f,isWebId:a.isWebIdUri(t),viewerPodOnly:p,inViewerPod:!p||await c.isPageInViewerPod(x.location.href)});if(S.get(i)!==o)return i;if(o.showHeader=w,i.paneRenderOptions=r,i.soloPane=r.solo,i.openPane=(e,t)=>L(i,e,_.byName(t)),i.handleAccessClick=async()=>{try{let e=t.doc(),n=await g.solidLogicSingleton.acl.findAccessGrants(e);h.showDialog(y.default,{props:{subjectUri:e.uri,accessGrants:n}})}catch(e){h.log.error(`outline: Failed to open access controls: `+h.utils.stackString(e))}},i.pane?I(i,t,i.pane,r):R(i,t,i.pane),w){let n=await m.getPaneItems(t,e,l,(e,t)=>{i.dispatchEvent(new CustomEvent(h.FILE_EXPLORER_OPEN_PANE_EVENT,{bubbles:!0,composed:!0,detail:{subjectUri:e.uri,paneName:t}}))});S.get(i)===o&&(o.menuItems=n,R(i,t,i.pane))}return i}function ie(e){let t=e.parentNode,n=t.parentNode,r=x.createElement(`div`);n.replaceChild(r,t),t.removeChild(e),n.replaceChild(t,r)}let z=this.propertyTable=function(e,t,n,r){h.log.debug(`Property block for: `+e),e=D.canon(e);let i=t?t.matches?.(b)?t:t.firstElementChild||t:x.createElement(b);return re(e,n,r,i).catch(e=>{h.log.error(`outline: Failed to set up file explorer: `+h.utils.stackString(e))}),t&&h.log.info(`Re-expand: `+t),t||i};function B(e,t,n){let r=e.createElement(`div`);r.AJAR_statement=t,r.AJAR_inverse=n,r.setAttribute(`predTR`,`true`),r.setAttribute(`role`,`row`);let i=T.outlinePredicateDiv(t.predicate,r,n);return r.appendChild(i),r}this.propertyTR=B;function ae(e,t,n,r){if(h.log.debug(`Property list length = `+t.length),t.length===0)return``;let i,a,o;n?(i=function(e){return e.subject},t=t.sort(h.utils.RDFComparePredicateSubject)):(i=function(e){return e.object},t=t.sort(h.utils.RDFComparePredicateObject));let s=t.length;for(a=0;a<s;a++){let c=t[a];if(r&&!r(c.predicate,n))continue;let l=B(x,c,n);e.appendChild(l);let u=l.firstChild,d=$.defaults[c.predicate.uri],f=0,p=0,m=0;for(o=0;o+a<s&&t[a+o].predicate.sameTerm(c.predicate);o++)o>0&&i(t[a+o]).sameTerm(i(t[a+o-1]))&&f++,i(t[a+o]).lang&&w.labeller.LanguagePreference&&(p+=1,i(t[a+o]).lang.indexOf(w.labeller.LanguagePreference)>=0&&m++);if(m>0&&p===f+1){for(let e=a;e<=a+f;e++)if(w.labeller.LanguagePreference&&i(t[e]).lang.indexOf(w.labeller.LanguagePreference)>=0){l.appendChild(T.outlineObjectDiv(i(t[e]),d,void 0,c));break}a+=f}else l.appendChild(T.outlineObjectDiv(i(c),d,void 0,c)),l.showNobj=function(r){let s=o-f,l=2*r<s?r:s,p=[];if(s!==1){u.setAttribute(`rowspan`,l===s?s:r+1);let f;l<s&&l===1&&u.setAttribute(`rowspan`,2);let m=0;for(f=1;f<o;f++)if(D.canon(i(t[a+f])).sameTerm(D.canon(i(t[a+f-1]))))h.log.info(`there are duplicates here: %s`,t[a+f-1]);else{m++,c=t[a+f],d=$.defaults[c.predicate.uri];let r=x.createElement(`div`);r.style.colspan=`1`,r.appendChild(T.outlineObjectDiv(i(t[a+f]),d,void 0,c)),r.AJAR_statement=c,r.AJAR_inverse=n,e.appendChild(r),m>=l&&(r.style.display=`none`,p.push(r))}l===s&&u.setAttribute(`rowspan`,m+1)}if(l<s){let t=x.createElement(`div`),n=t.appendChild(x.createElement(`div`));if(n.setAttribute(`style`,`margin: 0.2em; border: none; padding: 0; vertical-align: top;`),n.classList.add(`obj`),n.setAttribute(`notSelectable`,`false`),s>r){let e=x.createElement(`a`);n.appendChild(e);let t=(function(e){return e(u,o,f,r)})(function(t,n,r,i){return function(n){e.innerHTML=``,n===`none`?(e.appendChild(h.utils.AJARImage(h.icons.originalIconBase+`tbl-more-trans.png`,`more`,`See all`,x)),e.appendChild(x.createTextNode(s-i+` more...`)),t.setAttribute(`rowspan`,i+1)):(e.appendChild(h.utils.AJARImage(h.icons.originalIconBase+`tbl-shrink.png`,`(less)`,void 0,x)),t.setAttribute(`rowspan`,s+1));for(let e=0;e<p.length;e++){let t=p[e];t.style.display=n}}}),i=`none`,a=function(e){return t(i),i=i===`none`?``:`none`,e&&e.stopPropagation(),!1};a(),e.addEventListener(`click`,a,!1)}e.appendChild(t)}},l.showAllobj=function(){l.showNobj(o-f)},l.showNobj(10),a+=o-1}}this.appendPropertyTRs=ae;function oe(e,t){h.log.debug(`Button callbacks for `+t+` added`);let r=function(r){return function(i){return i.indexOf(`#`),!e||!w.ancestor(e,`DIV`)?!1:(i===t&&(e.src=r,e.title=n.outlineIcons.tooltips[r]),!0)}};O.addCallback(`request`,r(n.outlineIcons.src.icon_requested)),O.addCallback(`done`,r(n.outlineIcons.src.icon_fetched)),O.addCallback(`fail`,r(n.outlineIcons.src.icon_failed))}function V(e){let t=e.getAttribute(`class`);return!!(t&&t.indexOf(`selected`)>=0)}function H(e){let t=T.targetOf(e).parentNode;j.replaceIcon(t.parentNode,n.outlineIcons.termWidgets.optOn,n.outlineIcons.termWidgets.optOff,U),t.parentNode.parentNode.removeAttribute(`optional`)}function U(e){let t=T.targetOf(e).parentNode;j.replaceIcon(t.parentNode,n.outlineIcons.termWidgets.optOff,n.outlineIcons.termWidgets.optOn,H),t.parentNode.parentNode.setAttribute(`optional`,`true`)}function W(e,t){let r=n.outlineIcons.termWidgets.optOn,i=n.outlineIcons.termWidgets.optOff,a=e=>!(!e||typeof e.getAttribute!=`function`||e.getAttribute(`predTR`)!==`true`&&e.getAttribute(`data-outline-node`)!==`predicate`);for(let n=e;n.parentNode;n=n.parentNode)for(;;)if(a(n)){let e=n.getAttribute(`parentOfSelected`);e=e?parseInt(e):0,e===0&&t>0&&j.addIcon(n.childNodes[0],n.getAttribute(`optional`)?r:i,n.getAttribute(`optional`)?H:U),e+=t,n.setAttribute(`parentOfSelected`,e),e===0&&(n.removeAttribute(`parentOfSelected`),j.removeIcon(n.childNodes[0],n.getAttribute(`optional`)?r:i));break}else if(n.previousElementSibling)n=n.previousElementSibling;else break}this.statusBarClick=function(e){let t=h.utils.getTarget(e);t.label&&(window.content.location=t.label)},this.showURI=function(e){e&&x.getElementById(`UserURI`)&&(x.getElementById(`UserURI`).value=e.termType===`NamedNode`?e.uri:``)},this.showSource=function(){if(typeof sourceWidget<`u`){for(let e in sourceWidget.sources)sourceWidget.sources[e].setAttribute(`class`,``);for(let e=0;e<E.length;e++){if(!E[e].parentNode)continue;let t=E[e].parentNode.AJAR_statement;if(!t)continue;let n=t.why;n&&n.uri&&sourceWidget.highlight(n,!0)}}},this.getSelection=function(){return E};function G(e,t){if(e.nodeName!==`TD`&&e.nodeName!==`DIV`)throw h.log.debug(`down`+e.nodeName),Error(`Expected TD or DIV in setSelected: `+e.nodeName+` : `+e.textContent);h.log.debug(`pass`);let r=e.getAttribute(`class`);if(r||=``,t){r+=` selected`,(r.indexOf(`pred`)>=0||r.indexOf(`obj`)>=0)&&W(e,1),E.push(e);let t=h.utils.getTerm(e);T.showURI(t);let i=e.AJAR_statement;if(i===void 0&&e.parentNode&&(i=e.parentNode.AJAR_statement),i){let t=i.why;g.store.updater.editable(t.uri,D)&&r.indexOf(`pred`)>=0&&j.addIcon(e,n.outlineIcons.termWidgets.addTri)}}else h.log.debug(`cla=$`+r+`$`),r===`selected`&&(r=``),r=r.replace(` selected`,``),(r.indexOf(`pred`)>=0||r.indexOf(`obj`)>=0)&&W(e,-1),r.indexOf(`pred`)>=0&&j.removeIcon(e,n.outlineIcons.termWidgets.addTri),E=E.filter(function(t){return t===e}),h.log.info(`Deselecting `+e.textContent);typeof sourceWidget<`u`&&T.showSource(),e.setAttribute(`class`,r)}function K(){let e=E.length;for(let t=e-1;t>=0;t--)G(E[t],!1);E=[]}this.targetOf=function(e){let t;if(e||=window.event,e.target)t=e.target;else if(e.srcElement)t=e.srcElement;else return h.log.error(`can't get target for event `+e),!1;return t.nodeType===3&&(t=t.parentNode),t},this.walk=function(e,t){let n=t||E[0],r;switch(e){case`down`:try{r=n.parentNode.nextSibling.lastChild}catch{this.walk(`up`);return}K(),G(r,!0);break;case`up`:try{r=n.parentNode.previousSibling.lastChild}catch{return}K(),G(r,!0);break;case`right`:{let e=n.matches?.(b)?n:n.querySelector?.(b),t=e?.querySelector?.(`[data-outline-node="object"]`);if(e){t&&(K(),G(t,!0));return}}if(K(),n.nextSibling||n.lastChild.tagName===`strong`)G(n.nextSibling,!0);else{let e=n.parentNode&&n.parentNode.nextSibling,t=e?e.lastChild:null;if(!t){G(n,!0);return}G(t,!0)}break;case`left`:if(K(),n.previousSibling&&n.previousSibling.className===`undetermined`)return G(n.previousSibling,!0),!0;G(q(n)?.block||n.parentNode&&n.parentNode.firstChild,!0);break;case`moveTo`:K(),G(t,!0)}e!==`down`&&e!==`up`||r.tabulatorSelect||this.walk(e)},this.OutlinerKeypressPanel=function(e){h.log.info(`Key `+e.keyCode+` pressed`);function t(e){e&&x.getElementById(`UserURI`)&&(x.getElementById(`UserURI`).value=e.termType===`NamedNode`?e.uri:``)}function n(e){return arguments[3]||(o(`right`,a),t(h.utils.getAbout(D,E[0]))),!0}let r,i;if(h.utils.getTarget(e).tagName===`TEXTAREA`||h.utils.getTarget(e).id===`UserURI`||E.length>1)return;if(E.length===0){(e.keyCode===13||e.keyCode===38||e.keyCode===40||e.keyCode===37||e.keyCode===39)&&(this.walk(`right`,T.focusTd),t(h.utils.getAbout(D,E[0])));return}let a=E[0];switch(O.removeCallback(`done`,`setSelectedAfterward`),O.removeCallback(`fail`,`setSelectedAfterward`),e.keyCode){case 13:if(h.utils.getTarget(e).tagName===`HTML`){let e=h.utils.getAbout(D,a);r=a.parentNode.AJAR_statement.why,i=g.store.updater.editable(r.uri,D),e?w.GotoSubject(e,!0):i&&T.UserInput.Enter(a)}else this.UserInput.Keypress(e),this.walk(`down`),e.stopPropagation();return;case 38:this.walk(`up`),e.stopPropagation(),e.preventDefault();break;case 40:this.walk(`down`),e.stopPropagation(),e.preventDefault()}if(h.utils.getTarget(e).tagName===`INPUT`)return;let o;switch(e.keyCode){case 46:case 8:r=a.parentNode.AJAR_statement.why,i=g.store.updater.editable(r.uri,D),i&&(e.preventDefault(),this.UserInput.Delete(a));break;case 37:{if(this.walk(`left`))return;let e=q(a);if(!e)break;let t=h.utils.getAbout(D,e.provider);t&&Z(e.block,t);break}case 39:{let e=h.utils.getAbout(D,a);if(e){if(o=this.walk,a.nextSibling){this.walk(`right`);return}a.firstElementChild?.matches(b)||(O.addCallback(`done`,n),O.addCallback(`fail`,n),X(a,e,{pane:_.byName(`defaultPane`)})),n()}}break;case 38:case 40:break;default:switch(e.charCode){case 99:if(e.ctrlKey){T.UserInput.copyToClipboard(T.clipboardAddress,a);break}break;case 118:case 112:if(e.ctrlKey){T.UserInput.pasteFromClipboard(T.clipboardAddress,a);break}break;default:h.utils.getTarget(e).tagName}}t(h.utils.getAbout(D,E[0]))},this.OutlinerMouseclickPanel=function(e){switch(T.UserInput._tabulatorMode){case 0:pe(e);break;case 1:T.UserInput.Click(e)}};function se(e){let t=T.targetOf(e),n,r;for(let e=t;e&&e!==x;e=e.parentNode)e.matches?.(`[data-outline-node="object"]`)&&(n=e),e.matches?.(`.outline-subject-block`)&&(r=e);let i=r||n||t.parentNode,a=h.utils.getAbout(D,t),o=e.altKey?_.byName(`internal`):void 0;e.shiftKey?Q(i,a,o):e.altKey?X(i,a,{pane:_.byName(`internal`),immediate:!0}):X(i,a)}function ce(e){let t=T.targetOf(e),n=e.altKey?_.byName(`internal`):void 0,r=q(t);if(!r)return;let i=h.utils.getAbout(D,r.provider);i&&Z(r.block,i,n)}function q(e){for(let t=e;t&&t!==x;t=t.parentNode){if(t.matches?.(`[data-outline-node="object"]`)){let e=t.querySelector?.(b);if(e)return{block:t,provider:e}}if(t.matches?.(b))return{block:t.closest?.(`[data-outline-node="object"]`)||t.closest?.(`.outline-subject-block`)||t,provider:t}}return null}function J(e){let t=T.targetOf(e).getAttribute(`uri`);e.altKey?O.fetch(v.uri.docpart(t),{force:!0}):O.refresh(D.sym(v.uri.docpart(t)))}function le(e){let t=T.targetOf(e).getAttribute(`uri`);e.altKey?O.fetch(v.uri.docpart(t),{force:!0}):O.refresh(D.sym(v.uri.docpart(t)))}function ue(e){let t=T.targetOf(e).getAttribute(`uri`);O.fetch(v.uri.docpart(t))}function de(e){let t=T.targetOf(e),n=t.node;n.childNodes.length>1&&(n=t.parentNode),ie(n)}function fe(e){if(T.UserInput._tabulatorMode)return T.UserInput.Click(e);let t=T.targetOf(e),n;for(n=h.utils.ancestor(t,`td`)||h.utils.ancestor(t,`tr`)||h.utils.ancestor(t,`div`);n&&n.getAttribute(`notSelectable`)!==`false`;n=h.utils.ancestor(n.parentNode,`td`)||h.utils.ancestor(n.parentNode,`tr`)||h.utils.ancestor(n.parentNode,`div`));if(!n)return;let r=V(n);if(h.log.debug(`Was node selected before: `+r),e.altKey)G(n,!V(n));else if(e.shiftKey)G(n,!0);else{if(K(),T.UserInput.clearInputAndSave(e),G(n,!0),e.detail===2){e.stopPropagation();return}let t;if(n.parentNode&&(t=n.parentNode.AJAR_statement),!t)return;let i=t.why,a=g.store.updater.editable(i.uri,D);r&&a&&T.UserInput.Click(e,E[0])}h.log.debug(`Was node selected after: `+V(n)+`, count=`+E.length),e.stopPropagation()}function pe(e){h.log.info(`@TabulatorMousedown, dom.location is now `+x.location);let t=T.targetOf(e);if(!t)return;let r=t.tagName;r!==`INPUT`&&r!==`TEXTAREA`&&(T.UserInput.clearMenu(),T.UserInput.lastModified&&T.UserInput.lastModified.parentNode.nextSibling&&T.UserInput.backOut(),(!t.src||t.src.slice(t.src.indexOf(`/icons/`)+1)!==n.outlineIcons.src.icon_show_choices&&t.src.slice(t.src.indexOf(`/icons/`)+1)!==n.outlineIcons.src.icon_add_triple)&&T.UserInput.clearInputAndSave(e),t.src&&t.src.slice(t.src.indexOf(`/icons/`)+1)===n.outlineIcons.src.icon_show_choices||T.UserInput.clearMenu(),e&&e.stopPropagation())}function Y(e){x.title=h.utils.label(e),x.location.href.startsWith(e.site().uri)}function X(e,t,n){n||={};let r=n.pane,i=!!n.already,a=n.immediate;h.log.info(`@outlineExpand, dom is now `+x.location),O.removeCallback(`done`,`expand`),O.removeCallback(`fail`,`expand`);let o=D.canon(t);function s(){if(o=D.canon(o),!e||!e.parentNode||!e.parentNode.parentNode)return!1;let t;h.log.info(`@@ REPAINTING `),t=i?z(o,e,r,n):z(o,void 0,r,n),i=!0,t!==e&&h.utils.emptyNode(e).appendChild(t),T.focusTd=e,h.log.debug(`expand: Node for `+o+` expanded`);let a=D.each(o,h.ns.rdfs(`seeAlso`));for(let e=0;e<a.length;e++)e===25&&h.log.warn(`expand: Warning: many (`+a.length+`) seeAlso links for `+o),O.lookUpThing(a[e],o)}function c(e){if(arguments[3])return!0;let t=D.canon(o);h.log.info(`@@ expand: relevant subject=`+t+`, uri=`+e+`, already=`+i);let n=D.sym(v.uri.docpart(e));if(e.indexOf(`#`)>=0)throw Error(`Internal error: hash in `+e);return!function(){if(!t.uri)return!0;let r=D.uris(t);if(!r)return!1;for(let t=0;t<r.length;t++)for(let n=v.uri.docpart(r[t]);n;n=D.HTTPRedirects[n])if(e===n)return!0;return!!D.anyStatementMatching(t,void 0,void 0,n)}()||(h.log.success(`@@ expand OK: relevant subject=`+t+`, uri=`+e+`, source=`+i),s(),!1)}n.solo&&Y(o),h.log.debug(`outlineExpand: dereferencing `+o);let l=x.createElement(`span`);if(e.appendChild(l),O.addCallback(`done`,c),O.addCallback(`fail`,c),o.uri&&o.uri.split(`:`)[0]===`rdf`)s();else if(o.uri&&!a&&!h.widgets.isAudio(o)&&!h.widgets.isVideo(o)){let t=o.doc()&&o.doc().uri?o.doc().uri:``+o.doc(),r=function(e){let t=!!(o&&o.uri&&o.site&&o.site().uri===o.uri);return e===403?t?`This root resource is not accessible with your current permissions. Try logging in with an authorized account or opening a public profile document.`:`This resource is not accessible with your current permissions.`:t?`This root resource is not publicly readable. Try logging in or opening a profile document.`:`This resource is not publicly readable. Try logging in or opening a different public resource.`},i=function(e,t){let n=typeof e==`string`?e:String(e||``),r=t?.status||t?.response?.status;return r===401||r===403?r:n.includes(`status: 403`)||n.includes(`status 403`)?403:n.includes(`status: 401`)||n.includes(`status 401`)?401:null},a=function(n,a){if(e.querySelector&&t&&e.querySelector(`[data-outline-error-for="`+t+`"]`))return;let o=i(n,a),s=o?r(o):n,c=h.widgets.errorMessageBlock(x,s,`#fee`,a instanceof Error?a:void 0);t&&c.setAttribute(`data-outline-error-for`,t),e.appendChild(c)},c=!1,l=O.nowOrWhenFetched(o.doc(),void 0,function(e,t){e?(O.lookUpThing(o),s(),n.solo&&Y(o)):(c=!0,a(t,void 0))});l&&typeof l.catch==`function`&&l.catch(function(e){c||(c=!0,a(e,e))})}else s()}function Z(e,t){let n=e.AJAR_statement||e.parentNode&&e.parentNode.AJAR_statement;h.log.debug(`Collapsing subject `+t);let r;n&&(h.log.debug(`looking up pred `+n.predicate.uri+`in defaults`),r=$.defaults[n.predicate.uri]),h.log.debug(`view= `+r);let i;e.parentNode&&e.parentNode.id===`outline`&&(i=e),T.replaceTD(T.outlineObjectDiv(t,r,i,n),e)}this.replaceTD=function(e,t){let n;V(t)&&(n=!0);for(let e=E.length-1;e>-1;e--)for(let n=E[e];n.parentNode;n=n.parentNode)n===t&&G(E[e],!1);t.parentNode.replaceChild(e,t),n&&G(e,!0)};function Q(e,t){h.utils.emptyNode(e).appendChild(z(t)),Y(t),e.setAttribute(`about`,t.toNT())}w.outlineRefocus=Q,this.GotoFormURI_enterKey=function(e){e.keyCode===13&&w.GotoFormURI(e)},this.GotoFormURI=function(e){me(x.getElementById(`UserURI`).value)};function me(e){let t=D.sym(e);this.GotoSubject(t,!0)}this.GotoURIinit=function(e){let t=D.sym(e);this.GotoSubject(t)},this.GotoSubject=function(e,t,n,r,i,a,o){let s=d.resolveSource(o)!==`accountMenu`,c=N();s&&(!a||a===c)&&ee(e);let f=a||c;r&&(f.style.width=`100%`,h.utils.emptyNode(f));let p=n&&n.subject&&n.subject.uri?n.subject:e;function m(){let e=x.createElement(`div`);e.classList.add(`outline-subject-block`);let t=T.outlineObjectDiv(p,void 0,e);return e.appendChild(t),f.appendChild(e),e}let g=r?m():f;if(r&&Y(p),t?X(g,p,{pane:n,solo:r,headerOnlyInViewerPod:!s||!!(n&&n.subject&&n.subject.uri)}):r||m(),r&&x&&x.defaultView&&x.defaultView.history){let t=x.defaultView.history.state||{},r=document.location.href!==e.uri,i=l.nextHistoryState(t,{pane:n?{name:n.name,subject:n.subject&&typeof n.subject.uri==`string`?n.subject.uri:void 0}:void 0,leavingPage:r,viaAccountMenu:!s});try{let n=new URL(document.location.href),a=new URL(e.uri,document.location.href);n.origin===a.origin&&(r?x.defaultView.history.pushState(i,e.uri,e.uri):JSON.stringify(t)!==JSON.stringify(i)&&x.defaultView.history.replaceState(i,e.uri,e.uri))}catch{}}return r&&u.announceNavigation(x),e};let $=t.propertyViews(x);function he(t){let r;if(t.termType===`Literal`){if(r=x.createElement(`span`),r.classList.add(`objectValue`,`objectValue--literal`),r.textContent=t.value,t.datatype&&t.datatype.uri){let e=h.ns.xsd(``).uri;t.datatype.uri.slice(0,e.length)===e&&r.classList.add(`objectValue--`+t.datatype.uri.slice(e.length))}}else if(t.termType===`NamedNode`||t.termType===`BlankNode`){if(r=x.createElement(`span`),r.classList.add(`objectValue`,`objectValue--resource`),r.setAttribute(`about`,t.toNT()),T.appendAccessIcons(D,r,t),t.termType===`NamedNode`){if(t.uri.slice(0,4)===`tel:`){let e=t.uri.slice(4),i=x.createElement(`a`);r.appendChild(x.createTextNode(e)),i.setAttribute(`href`,t.uri),i.appendChild(h.utils.AJARImage(n.outlineIcons.src.icon_telephone,`phone`,`phone `+e,x)),r.appendChild(i),i.firstChild.setAttribute(`class`,`phoneIcon`),i.firstChild.classList.add(`objectValueLinkIcon`)}else{r.appendChild(x.createTextNode(h.utils.label(t)));let e=h.widgets.linkIcon(x,t);e.firstChild&&e.firstChild.classList.add(`objectValueLinkIcon`),r.appendChild(e),h.widgets.makeDraggable(r,t)}}else r.appendChild(x.createTextNode(h.utils.label(t)))}else if(t.termType===`Collection`){r=x.createElement(`div`),r.setAttribute(`about`,t.toNT());for(let e=0;e<t.elements.length;e++){let n=t.elements[e],i=r.appendChild(x.createElement(`div`)),a=i.appendChild(x.createElement(`div`));a.classList.add(`obj`),a.setAttribute(`notSelectable`,`false`),a.setAttribute(`about`,t.toNT()),a.innerHTML=e+1+`)`,i.appendChild(T.outlineObjectDiv(n))}}else t.termType===`Graph`?(r=_.byName(`dataContentPane`).statementsAsTables(t.statements,e),r.setAttribute(`class`,`nestedFormula`)):(h.log.error(`Object `+t+` has unknown term type: `+t.termType),r=x.createTextNode(`[unknownTermType:`+t.termType+`]`));return h.log.debug(`contents: `+r.innerHTML),r}return this.createTabURI=function(){x.getElementById(`UserURI`).value=x.URL+`?uri=`+x.getElementById(`UserURI`).value},this.UserInput.setSelected=G,this.UserInput.deselectAll=K,this.UserInput.views=$,this.outlineExpand=X,this}exports.default=x;
1
+ (function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.obj{vertical-align:top;border:none;margin:.2em;padding:0 0 5px}.iconTD{vertical-align:top;border:none;width:0;margin:.2em;padding:0}.labelTD{width:100%}.strongHeader{margin:0 .6rem 0 0;padding:.1rem .4rem;font-size:150%}.tableFullWidth{width:100%;background:var(--color-background,#f8f9fb)!important}.placeholderTable{width:100%}.tdFlex{vertical-align:top;border-radius:5px;flex-direction:row;justify-content:space-between;display:flex;overflow:hidden}solid-ui-file-explorer-provider{flex-direction:column;gap:0;width:100%;min-width:0;height:100%;min-height:0;display:flex;overflow:hidden}solid-ui-file-explorer-provider.tdFlex{flex-direction:column;align-items:stretch}solid-ui-file-explorer-provider>solid-ui-file-explorer-header{flex:none;width:100%}solid-ui-file-explorer-provider>.paneDiv,solid-ui-file-explorer-provider>.exceptionPane{flex:auto;width:100%;min-height:0;margin:0;overflow:hidden auto}.paneDiv,.exceptionPane{box-sizing:border-box;width:100%;min-width:0;max-width:100%;display:block;overflow-x:hidden}.objectValue--literal{white-space:pre-wrap}.objectValue--integer,.objectValue--decimal,.objectValue--double{text-align:right;display:block}.objectValueAccessIcon,.objectValueLinkIcon,.phoneIcon{vertical-align:middle;display:inline-block}.objectValueLinkIcon,.phoneIcon{width:12px;height:12px}@media (width<=600px){.obj,.iconTD{vertical-align:top;font-size:100%;margin:0!important}}`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();const e=require("../_virtual/_rolldown/runtime.cjs.js");;const t=require("./propertyViews.cjs.js"),n=require("./outlineIcons.cjs.js"),r=require("./userInput.cjs.js"),i=require("./queryByExample.cjs.js"),a=require("../utils/webIdUtils.cjs.js"),o=require("../utils/podUtils.cjs.js"),s=require("../navigation/chrome.cjs.js"),c=require("../navigation/podContext.cjs.js"),l=require("../navigation/state.cjs.js"),u=require("../navigation/events.cjs.js"),d=require("../navigation/options.cjs.js"),f=require("../navigation/navbarVisibility.cjs.js"),p=require("./outlineDomHelpers.cjs.js"),m=require("./fileExplorerHelpers.cjs.js");let h=require("solid-ui");h=e.__toESM(h);let g=require("solid-logic"),_=require("pane-registry");_=e.__toESM(_);let v=require("rdflib");v=e.__toESM(v),require("solid-ui/components/file-explorer-provider"),require("solid-ui/components/file-explorer-header"),require("solid-ui/components/error-state");let y=require("solid-ui/components/access-control-modal");y=e.__toESM(y);var b=`solid-ui-file-explorer-provider`;function x(e){let x=e.dom,S=new WeakMap,C=new WeakSet;this.document=e.dom,this.context=e,this.outlineIcons=n.outlineIcons,this.labeller=this.labeller||{},this.labeller.LanguagePreference=``;let w=this,T=this,E=[];this.selection=E,this.ancestor=h.utils.ancestor,this.sparql=v.UpdateManager,this.kb=g.store;let D=g.store,O=g.store.fetcher;x.outline=this,this.qs=new i.QuerySource,this.UserInput=new r.UserInput(this),this.clipboardAddress=`tabulator:clipboard`,this.UserInput.clipboardInit(this.clipboardAddress);let{outlineObjectDiv:k,outlinePredicateDiv:A,termWidget:j}=p.createOutlineDomHelpers({dom:x,UI:h,kb:g.store,outlineIcons:n.outlineIcons,expandMouseDownListener:se,selectableTDClickListener:fe,setSelected:G,viewAsBoringDefault:he,removeNodeIconMouseDownListener:de});this.outlineObjectDiv=k,this.outlinePredicateDiv=A,this.outlineObjectTD=k,this.outlinePredicateTD=A,this.termWidget=j,this.init=function(){let e=N();e.outline=this},this.getLayoutMode=function(){let e=this.context?.environment?.layout;if(e===`mobile`||e===`desktop`)return e;if(typeof window<`u`&&window.matchMedia){let e=Math.round(Math.min(window.innerWidth,window.visualViewport?.width||window.innerWidth)),t=window.matchMedia(`(pointer: coarse)`).matches||navigator.maxTouchPoints>0;return e<=768||t&&e<=1024?`mobile`:`desktop`}return`desktop`},M.lastkbsize=0;function M(e){let t=[];for(let e=arguments.length-1;e>0;e--)t[e-1]=arguments[e];let n=new Date().getTime(),r=e.apply(e,t),i=new Date().getTime();return h.log.info(`BENCHMARK: kb delta: `+(D.statements.length-M.lastkbsize)+`, time elapsed for `+e+` was `+(i-n)+`ms`),M.lastkbsize=D.statements.length,r}this.appendAccessIcons=function(e,t,n){if(n.termType!==`NamedNode`)return;let r=e.uris(n);r.sort();let i=null;for(let e=0;e<r.length;e++)r[e]!==i&&(i=r[e],T.appendAccessIcon(t,i))},this.appendAccessIcon=function(e,t){if(!t)return``;let r=v.uri.docpart(t);if(r.slice(0,5)!==`http:`)return``;let i=O.getState(r),a,o,s;switch(i){case`unrequested`:a=n.outlineIcons.src.icon_unrequested,o=`fetch`,s=ue;break;case`requested`:a=n.outlineIcons.src.icon_requested,o=`fetching`,s=J;break;case`fetched`:a=n.outlineIcons.src.icon_fetched,s=le,o=`loaded`;break;case`failed`:a=n.outlineIcons.src.icon_failed,o=`failed`,s=J;break;case`unpermitted`:a=n.outlineIcons.src.icon_failed,s=J,o=`no perm`;break;case`unfetchable`:a=n.outlineIcons.src.icon_failed,s=J,o=`cannot fetch`;break;default:h.log.error(`?? state = `+i)}let c=h.utils.AJARImage(a,o,n.outlineIcons.tooltips[a].replace(/[Tt]his resource/,r),x);return c.classList.add(`objectValueAccessIcon`),c.setAttribute(`uri`,t),c.addEventListener(`click`,s),oe(c,r),e.appendChild(c),c};function N(){return te(`OutlineView`,`Resource browser`)}function ee(e){f.refreshNavbarVisibility(e.uri).catch(e=>h.log.error(`Failed to update navbar visibility: `+e))}function te(e){if(e===`OutlineView`){let e=document.getElementById(`OutlineView`);if(e)return e;let t=document.getElementById(`MainContent`)||document.body;if(t){let e=document.createElement(`div`);return e.id=`OutlineView`,e.classList.add(`outline-view`),e.setAttribute(`aria-label`,`Resource browser`),t.appendChild(e),e}}}async function P(e,t){return e.uri.endsWith(`/`)&&await o.loadContainerRepresentation(e),h.getRelevantPanes(e,t,{excludedPaneNames:[`sharing`],fallbackPaneName:`internal`})}function ne(e,t){return e.find(e=>e.shouldGetFocus&&e.shouldGetFocus(t))||e[0]}function F(e){let t=x.getElementById(`queryButton`);t&&(e?t.removeAttribute(`style`):t.setAttribute(`style`,`display:none;`))}function I(t,n,r,i){if(!t||!r)return;let a;try{h.log.info(`outline: Rendering pane (menu): `+r.name),a=r.render(n,e,i)}catch(e){a=x.createElement(`div`),a.setAttribute(`class`,`exceptionPane`);let t=x.createElement(`pre`);a.appendChild(t),t.appendChild(x.createTextNode(h.utils.stackString(e)))}R(t,n,r,a)}function L(e,t,n){n?(F(!!n.requireQueryButton),e.pane=n,I(e,t,n,S.get(e)?.options||{})):h.log.warn(`outline: Unable to open pane in place: pane is undefined.`)}function R(t,n,r,i){let a=S.get(t);h.composeExplorer(t,{context:e,subjectUri:n.uri,pane:r,relevantPanes:t.relevantPanes||[],header:a&&s.explorerHeaderForPane(a.showHeader,r?.name,a.options.folderView)?{paneIcon:m.getPaneIcon(r,n,e),menuItems:a.menuItems}:void 0,paneElement:i})}async function re(t,n,r,i){r||={},i||=x.createElement(b);let o={generation:(S.get(i)?.generation||0)+1,menuItems:[],options:r};S.set(i,o),i.classList.add(`paneView`,`tdFlex`),i.setAttribute(`notSelectable`,`true`),i.setAttribute(`role`,`grid`),i.setAttribute(`about`,t.toNT()),r.hover&&i.classList.add(`hoverControl`),i.context=e,i.subjectUri=t.uri,i.soloPane=r.solo,C.has(i)||(i.addEventListener(h.FILE_EXPLORER_BACK_EVENT,e=>{h.isExplorerEvent(e,i)&&(e.stopPropagation(),ce({target:i}))}),i.addEventListener(h.FILE_EXPLORER_MANAGE_ACCESS_EVENT,e=>{e.stopPropagation();let t=v.sym(e.detail.subjectUri).doc();g.solidLogicSingleton.acl.findAccessGrants(t).then(e=>{h.showDialog(y.default,{props:{subjectUri:t.uri,accessGrants:e}})}).catch(e=>{h.log.error(`outline: Failed to open access controls: `+h.utils.stackString(e))})}),i.addEventListener(h.FILE_EXPLORER_OPEN_PANE_EVENT,t=>{if(!h.isExplorerEvent(t,i))return;t.stopPropagation();let n=e.session.paneRegistry.byName(t.detail.paneName);L(i,v.sym(t.detail.subjectUri),n)}),C.add(i));let l=r.hideList?[]:await P(t,e);if(S.get(i)!==o)return i;let u=e.session.logic?.resource||g.solidLogicSingleton.resource,d=t.uri.endsWith(`/`)?v.sym(`${t.uri}index.ttl`):null;if(r.solo&&!n&&!r.folderView&&d&&(typeof u?.containerHasIndexDocument==`function`&&u.containerHasIndexDocument(t)||D.holds(t,h.ns.ldp(`contains`),d,t.doc()))){if(t=typeof u?.getContainerIndexThing==`function`?u.getContainerIndexThing(t):v.sym(`${d.uri}#this`),await D.fetcher.load(t.doc()),l=await P(t,e),S.get(i)!==o)return i;i.subjectUri=t.uri,i.setAttribute(`about`,t.toNT())}i.relevantPanes=l,i.pane=n||ne(l,t);let f=!!(t&&t.uri&&t.site&&t.site().uri===t.uri),p=!!r.headerOnlyInViewerPod,w=!t.uri.endsWith(`/index.ttl#this`)&&s.deriveExplorerHeader({isRootResource:f,isWebId:a.isWebIdUri(t),viewerPodOnly:p,inViewerPod:!p||await c.isPageInViewerPod(x.location.href)});if(S.get(i)!==o)return i;if(o.showHeader=w,i.paneRenderOptions=r,i.soloPane=r.solo,i.openPane=(e,t)=>L(i,e,_.byName(t)),i.handleAccessClick=async()=>{try{let e=t.doc(),n=await g.solidLogicSingleton.acl.findAccessGrants(e);h.showDialog(y.default,{props:{subjectUri:e.uri,accessGrants:n}})}catch(e){h.log.error(`outline: Failed to open access controls: `+h.utils.stackString(e))}},i.pane?I(i,t,i.pane,r):R(i,t,i.pane),w){let n=await m.getPaneItems(t,e,l,(e,t)=>{i.dispatchEvent(new CustomEvent(h.FILE_EXPLORER_OPEN_PANE_EVENT,{bubbles:!0,composed:!0,detail:{subjectUri:e.uri,paneName:t}}))});S.get(i)===o&&(o.menuItems=n,R(i,t,i.pane))}return i}function ie(e){let t=e.parentNode,n=t.parentNode,r=x.createElement(`div`);n.replaceChild(r,t),t.removeChild(e),n.replaceChild(t,r)}let z=this.propertyTable=function(e,t,n,r){h.log.debug(`Property block for: `+e),e=D.canon(e);let i=t?t.matches?.(b)?t:t.firstElementChild||t:x.createElement(b);return re(e,n,r,i).catch(e=>{h.log.error(`outline: Failed to set up file explorer: `+h.utils.stackString(e))}),t&&h.log.info(`Re-expand: `+t),t||i};function B(e,t,n){let r=e.createElement(`div`);r.AJAR_statement=t,r.AJAR_inverse=n,r.setAttribute(`predTR`,`true`),r.setAttribute(`role`,`row`);let i=T.outlinePredicateDiv(t.predicate,r,n);return r.appendChild(i),r}this.propertyTR=B;function ae(e,t,n,r){if(h.log.debug(`Property list length = `+t.length),t.length===0)return``;let i,a,o;n?(i=function(e){return e.subject},t=t.sort(h.utils.RDFComparePredicateSubject)):(i=function(e){return e.object},t=t.sort(h.utils.RDFComparePredicateObject));let s=t.length;for(a=0;a<s;a++){let c=t[a];if(r&&!r(c.predicate,n))continue;let l=B(x,c,n);e.appendChild(l);let u=l.firstChild,d=$.defaults[c.predicate.uri],f=0,p=0,m=0;for(o=0;o+a<s&&t[a+o].predicate.sameTerm(c.predicate);o++)o>0&&i(t[a+o]).sameTerm(i(t[a+o-1]))&&f++,i(t[a+o]).lang&&w.labeller.LanguagePreference&&(p+=1,i(t[a+o]).lang.indexOf(w.labeller.LanguagePreference)>=0&&m++);if(m>0&&p===f+1){for(let e=a;e<=a+f;e++)if(w.labeller.LanguagePreference&&i(t[e]).lang.indexOf(w.labeller.LanguagePreference)>=0){l.appendChild(T.outlineObjectDiv(i(t[e]),d,void 0,c));break}a+=f}else l.appendChild(T.outlineObjectDiv(i(c),d,void 0,c)),l.showNobj=function(r){let s=o-f,l=2*r<s?r:s,p=[];if(s!==1){u.setAttribute(`rowspan`,l===s?s:r+1);let f;l<s&&l===1&&u.setAttribute(`rowspan`,2);let m=0;for(f=1;f<o;f++)if(D.canon(i(t[a+f])).sameTerm(D.canon(i(t[a+f-1]))))h.log.info(`there are duplicates here: %s`,t[a+f-1]);else{m++,c=t[a+f],d=$.defaults[c.predicate.uri];let r=x.createElement(`div`);r.style.colspan=`1`,r.appendChild(T.outlineObjectDiv(i(t[a+f]),d,void 0,c)),r.AJAR_statement=c,r.AJAR_inverse=n,e.appendChild(r),m>=l&&(r.style.display=`none`,p.push(r))}l===s&&u.setAttribute(`rowspan`,m+1)}if(l<s){let t=x.createElement(`div`),n=t.appendChild(x.createElement(`div`));if(n.setAttribute(`style`,`margin: 0.2em; border: none; padding: 0; vertical-align: top;`),n.classList.add(`obj`),n.setAttribute(`notSelectable`,`false`),s>r){let e=x.createElement(`a`);n.appendChild(e);let t=(function(e){return e(u,o,f,r)})(function(t,n,r,i){return function(n){e.innerHTML=``,n===`none`?(e.appendChild(h.utils.AJARImage(h.icons.originalIconBase+`tbl-more-trans.png`,`more`,`See all`,x)),e.appendChild(x.createTextNode(s-i+` more...`)),t.setAttribute(`rowspan`,i+1)):(e.appendChild(h.utils.AJARImage(h.icons.originalIconBase+`tbl-shrink.png`,`(less)`,void 0,x)),t.setAttribute(`rowspan`,s+1));for(let e=0;e<p.length;e++){let t=p[e];t.style.display=n}}}),i=`none`,a=function(e){return t(i),i=i===`none`?``:`none`,e&&e.stopPropagation(),!1};a(),e.addEventListener(`click`,a,!1)}e.appendChild(t)}},l.showAllobj=function(){l.showNobj(o-f)},l.showNobj(10),a+=o-1}}this.appendPropertyTRs=ae;function oe(e,t){h.log.debug(`Button callbacks for `+t+` added`);let r=function(r){return function(i){return i.indexOf(`#`),!e||!w.ancestor(e,`DIV`)?!1:(i===t&&(e.src=r,e.title=n.outlineIcons.tooltips[r]),!0)}};O.addCallback(`request`,r(n.outlineIcons.src.icon_requested)),O.addCallback(`done`,r(n.outlineIcons.src.icon_fetched)),O.addCallback(`fail`,r(n.outlineIcons.src.icon_failed))}function V(e){let t=e.getAttribute(`class`);return!!(t&&t.indexOf(`selected`)>=0)}function H(e){let t=T.targetOf(e).parentNode;j.replaceIcon(t.parentNode,n.outlineIcons.termWidgets.optOn,n.outlineIcons.termWidgets.optOff,U),t.parentNode.parentNode.removeAttribute(`optional`)}function U(e){let t=T.targetOf(e).parentNode;j.replaceIcon(t.parentNode,n.outlineIcons.termWidgets.optOff,n.outlineIcons.termWidgets.optOn,H),t.parentNode.parentNode.setAttribute(`optional`,`true`)}function W(e,t){let r=n.outlineIcons.termWidgets.optOn,i=n.outlineIcons.termWidgets.optOff,a=e=>!(!e||typeof e.getAttribute!=`function`||e.getAttribute(`predTR`)!==`true`&&e.getAttribute(`data-outline-node`)!==`predicate`);for(let n=e;n.parentNode;n=n.parentNode)for(;;)if(a(n)){let e=n.getAttribute(`parentOfSelected`);e=e?parseInt(e):0,e===0&&t>0&&j.addIcon(n.childNodes[0],n.getAttribute(`optional`)?r:i,n.getAttribute(`optional`)?H:U),e+=t,n.setAttribute(`parentOfSelected`,e),e===0&&(n.removeAttribute(`parentOfSelected`),j.removeIcon(n.childNodes[0],n.getAttribute(`optional`)?r:i));break}else if(n.previousElementSibling)n=n.previousElementSibling;else break}this.statusBarClick=function(e){let t=h.utils.getTarget(e);t.label&&(window.content.location=t.label)},this.showURI=function(e){e&&x.getElementById(`UserURI`)&&(x.getElementById(`UserURI`).value=e.termType===`NamedNode`?e.uri:``)},this.showSource=function(){if(typeof sourceWidget<`u`){for(let e in sourceWidget.sources)sourceWidget.sources[e].setAttribute(`class`,``);for(let e=0;e<E.length;e++){if(!E[e].parentNode)continue;let t=E[e].parentNode.AJAR_statement;if(!t)continue;let n=t.why;n&&n.uri&&sourceWidget.highlight(n,!0)}}},this.getSelection=function(){return E};function G(e,t){if(e.nodeName!==`TD`&&e.nodeName!==`DIV`)throw h.log.debug(`down`+e.nodeName),Error(`Expected TD or DIV in setSelected: `+e.nodeName+` : `+e.textContent);h.log.debug(`pass`);let r=e.getAttribute(`class`);if(r||=``,t){r+=` selected`,(r.indexOf(`pred`)>=0||r.indexOf(`obj`)>=0)&&W(e,1),E.push(e);let t=h.utils.getTerm(e);T.showURI(t);let i=e.AJAR_statement;if(i===void 0&&e.parentNode&&(i=e.parentNode.AJAR_statement),i){let t=i.why;g.store.updater.editable(t.uri,D)&&r.indexOf(`pred`)>=0&&j.addIcon(e,n.outlineIcons.termWidgets.addTri)}}else h.log.debug(`cla=$`+r+`$`),r===`selected`&&(r=``),r=r.replace(` selected`,``),(r.indexOf(`pred`)>=0||r.indexOf(`obj`)>=0)&&W(e,-1),r.indexOf(`pred`)>=0&&j.removeIcon(e,n.outlineIcons.termWidgets.addTri),E=E.filter(function(t){return t===e}),h.log.info(`Deselecting `+e.textContent);typeof sourceWidget<`u`&&T.showSource(),e.setAttribute(`class`,r)}function K(){let e=E.length;for(let t=e-1;t>=0;t--)G(E[t],!1);E=[]}this.targetOf=function(e){let t;if(e||=window.event,e.target)t=e.target;else if(e.srcElement)t=e.srcElement;else return h.log.error(`can't get target for event `+e),!1;return t.nodeType===3&&(t=t.parentNode),t},this.walk=function(e,t){let n=t||E[0],r;switch(e){case`down`:try{r=n.parentNode.nextSibling.lastChild}catch{this.walk(`up`);return}K(),G(r,!0);break;case`up`:try{r=n.parentNode.previousSibling.lastChild}catch{return}K(),G(r,!0);break;case`right`:{let e=n.matches?.(b)?n:n.querySelector?.(b),t=e?.querySelector?.(`[data-outline-node="object"]`);if(e){t&&(K(),G(t,!0));return}}if(K(),n.nextSibling||n.lastChild.tagName===`strong`)G(n.nextSibling,!0);else{let e=n.parentNode&&n.parentNode.nextSibling,t=e?e.lastChild:null;if(!t){G(n,!0);return}G(t,!0)}break;case`left`:if(K(),n.previousSibling&&n.previousSibling.className===`undetermined`)return G(n.previousSibling,!0),!0;G(q(n)?.block||n.parentNode&&n.parentNode.firstChild,!0);break;case`moveTo`:K(),G(t,!0)}e!==`down`&&e!==`up`||r.tabulatorSelect||this.walk(e)},this.OutlinerKeypressPanel=function(e){h.log.info(`Key `+e.keyCode+` pressed`);function t(e){e&&x.getElementById(`UserURI`)&&(x.getElementById(`UserURI`).value=e.termType===`NamedNode`?e.uri:``)}function n(e){return arguments[3]||(o(`right`,a),t(h.utils.getAbout(D,E[0]))),!0}let r,i;if(h.utils.getTarget(e).tagName===`TEXTAREA`||h.utils.getTarget(e).id===`UserURI`||E.length>1)return;if(E.length===0){(e.keyCode===13||e.keyCode===38||e.keyCode===40||e.keyCode===37||e.keyCode===39)&&(this.walk(`right`,T.focusTd),t(h.utils.getAbout(D,E[0])));return}let a=E[0];switch(O.removeCallback(`done`,`setSelectedAfterward`),O.removeCallback(`fail`,`setSelectedAfterward`),e.keyCode){case 13:if(h.utils.getTarget(e).tagName===`HTML`){let e=h.utils.getAbout(D,a);r=a.parentNode.AJAR_statement.why,i=g.store.updater.editable(r.uri,D),e?w.GotoSubject(e,!0):i&&T.UserInput.Enter(a)}else this.UserInput.Keypress(e),this.walk(`down`),e.stopPropagation();return;case 38:this.walk(`up`),e.stopPropagation(),e.preventDefault();break;case 40:this.walk(`down`),e.stopPropagation(),e.preventDefault()}if(h.utils.getTarget(e).tagName===`INPUT`)return;let o;switch(e.keyCode){case 46:case 8:r=a.parentNode.AJAR_statement.why,i=g.store.updater.editable(r.uri,D),i&&(e.preventDefault(),this.UserInput.Delete(a));break;case 37:{if(this.walk(`left`))return;let e=q(a);if(!e)break;let t=h.utils.getAbout(D,e.provider);t&&Z(e.block,t);break}case 39:{let e=h.utils.getAbout(D,a);if(e){if(o=this.walk,a.nextSibling){this.walk(`right`);return}a.firstElementChild?.matches(b)||(O.addCallback(`done`,n),O.addCallback(`fail`,n),X(a,e,{pane:_.byName(`defaultPane`)})),n()}}break;case 38:case 40:break;default:switch(e.charCode){case 99:if(e.ctrlKey){T.UserInput.copyToClipboard(T.clipboardAddress,a);break}break;case 118:case 112:if(e.ctrlKey){T.UserInput.pasteFromClipboard(T.clipboardAddress,a);break}break;default:h.utils.getTarget(e).tagName}}t(h.utils.getAbout(D,E[0]))},this.OutlinerMouseclickPanel=function(e){switch(T.UserInput._tabulatorMode){case 0:pe(e);break;case 1:T.UserInput.Click(e)}};function se(e){let t=T.targetOf(e),n,r;for(let e=t;e&&e!==x;e=e.parentNode)e.matches?.(`[data-outline-node="object"]`)&&(n=e),e.matches?.(`.outline-subject-block`)&&(r=e);let i=r||n||t.parentNode,a=h.utils.getAbout(D,t),o=e.altKey?_.byName(`internal`):void 0;e.shiftKey?Q(i,a,o):e.altKey?X(i,a,{pane:_.byName(`internal`),immediate:!0}):X(i,a)}function ce(e){let t=T.targetOf(e),n=e.altKey?_.byName(`internal`):void 0,r=q(t);if(!r)return;let i=h.utils.getAbout(D,r.provider);i&&Z(r.block,i,n)}function q(e){for(let t=e;t&&t!==x;t=t.parentNode){if(t.matches?.(`[data-outline-node="object"]`)){let e=t.querySelector?.(b);if(e)return{block:t,provider:e}}if(t.matches?.(b))return{block:t.closest?.(`[data-outline-node="object"]`)||t.closest?.(`.outline-subject-block`)||t,provider:t}}return null}function J(e){let t=T.targetOf(e).getAttribute(`uri`);e.altKey?O.fetch(v.uri.docpart(t),{force:!0}):O.refresh(D.sym(v.uri.docpart(t)))}function le(e){let t=T.targetOf(e).getAttribute(`uri`);e.altKey?O.fetch(v.uri.docpart(t),{force:!0}):O.refresh(D.sym(v.uri.docpart(t)))}function ue(e){let t=T.targetOf(e).getAttribute(`uri`);O.fetch(v.uri.docpart(t))}function de(e){let t=T.targetOf(e),n=t.node;n.childNodes.length>1&&(n=t.parentNode),ie(n)}function fe(e){if(T.UserInput._tabulatorMode)return T.UserInput.Click(e);let t=T.targetOf(e),n;for(n=h.utils.ancestor(t,`td`)||h.utils.ancestor(t,`tr`)||h.utils.ancestor(t,`div`);n&&n.getAttribute(`notSelectable`)!==`false`;n=h.utils.ancestor(n.parentNode,`td`)||h.utils.ancestor(n.parentNode,`tr`)||h.utils.ancestor(n.parentNode,`div`));if(!n)return;let r=V(n);if(h.log.debug(`Was node selected before: `+r),e.altKey)G(n,!V(n));else if(e.shiftKey)G(n,!0);else{if(K(),T.UserInput.clearInputAndSave(e),G(n,!0),e.detail===2){e.stopPropagation();return}let t;if(n.parentNode&&(t=n.parentNode.AJAR_statement),!t)return;let i=t.why,a=g.store.updater.editable(i.uri,D);r&&a&&T.UserInput.Click(e,E[0])}h.log.debug(`Was node selected after: `+V(n)+`, count=`+E.length),e.stopPropagation()}function pe(e){h.log.info(`@TabulatorMousedown, dom.location is now `+x.location);let t=T.targetOf(e);if(!t)return;let r=t.tagName;r!==`INPUT`&&r!==`TEXTAREA`&&(T.UserInput.clearMenu(),T.UserInput.lastModified&&T.UserInput.lastModified.parentNode.nextSibling&&T.UserInput.backOut(),(!t.src||t.src.slice(t.src.indexOf(`/icons/`)+1)!==n.outlineIcons.src.icon_show_choices&&t.src.slice(t.src.indexOf(`/icons/`)+1)!==n.outlineIcons.src.icon_add_triple)&&T.UserInput.clearInputAndSave(e),t.src&&t.src.slice(t.src.indexOf(`/icons/`)+1)===n.outlineIcons.src.icon_show_choices||T.UserInput.clearMenu(),e&&e.stopPropagation())}function Y(e){x.title=h.utils.label(e),x.location.href.startsWith(e.site().uri)}function X(e,t,n){n||={};let r=n.pane,i=!!n.already,a=n.immediate;h.log.info(`@outlineExpand, dom is now `+x.location),O.removeCallback(`done`,`expand`),O.removeCallback(`fail`,`expand`);let o=D.canon(t),s=!1;function c(){if(s){if(O.getState(o.doc().uri)!==`fetched`)return!1;s=!1,i=!1}if(o=D.canon(o),!e||!e.parentNode||!e.parentNode.parentNode)return!1;let t;h.log.info(`@@ REPAINTING `),t=i?z(o,e,r,n):z(o,void 0,r,n),i=!0,t!==e&&h.utils.emptyNode(e).appendChild(t),T.focusTd=e,h.log.debug(`expand: Node for `+o+` expanded`);let a=D.each(o,h.ns.rdfs(`seeAlso`));for(let e=0;e<a.length;e++)e===25&&h.log.warn(`expand: Warning: many (`+a.length+`) seeAlso links for `+o),O.lookUpThing(a[e],o)}function l(e){if(arguments[3])return!0;let t=D.canon(o);h.log.info(`@@ expand: relevant subject=`+t+`, uri=`+e+`, already=`+i);let n=D.sym(v.uri.docpart(e));if(e.indexOf(`#`)>=0)throw Error(`Internal error: hash in `+e);return!function(){if(!t.uri)return!0;let r=D.uris(t);if(!r)return!1;for(let t=0;t<r.length;t++)for(let n=v.uri.docpart(r[t]);n;n=D.HTTPRedirects[n])if(e===n)return!0;return!!D.anyStatementMatching(t,void 0,void 0,n)}()||(h.log.success(`@@ expand OK: relevant subject=`+t+`, uri=`+e+`, source=`+i),c(),!1)}if(n.solo&&Y(o),r?.global){c();return}h.log.debug(`outlineExpand: dereferencing `+o);let u=x.createElement(`span`);if(e.appendChild(u),O.addCallback(`done`,l),O.addCallback(`fail`,l),o.uri&&o.uri.split(`:`)[0]===`rdf`)c();else if(o.uri&&!a&&!h.widgets.isAudio(o)&&!h.widgets.isVideo(o)){let t=o.doc()&&o.doc().uri?o.doc().uri:``+o.doc(),r=function(e){let t=!!(o&&o.uri&&o.site&&o.site().uri===o.uri);return e===403?t?`This root resource is not accessible with your current permissions. Try logging in with an authorized account or opening a public profile document.`:`This resource is not accessible with your current permissions.`:t?`This root resource is not publicly readable. Try logging in or opening a profile document.`:`This resource is not publicly readable. Try logging in or opening a different public resource.`},i=function(e,t){let n=typeof e==`string`?e:String(e||``),r=t?.status||t?.response?.status;return r===401||r===403?r:n.includes(`status: 403`)||n.includes(`status 403`)?403:n.includes(`status: 401`)||n.includes(`status 401`)?401:null},a=function(){let e=!!(o&&o.uri&&o.site&&o.site().uri===o.uri),t=!!g.solidLogicSingleton.authn.currentUser();return e?t?`You are logged in, but this root resource is not publicly readable. Select a storage location from the account menu to continue.`:`This root resource is not publicly readable. Try logging in or opening a profile document.`:t?`You are logged in, but your account does not have permission to view this resource.`:`This resource is not publicly readable. Log in to view it.`},l=function(){s=!0;let n=x.createElement(`solid-ui-error-state`);n.setAttribute(`title`,`Access denied`),n.setAttribute(`message`,a()),t&&n.setAttribute(`data-outline-error-for`,t),h.utils.emptyNode(e).appendChild(n),O.addCallback(`done`,function(n){return!s||!e.isConnected?!1:n!==t||(c(),!1)}),O.getState(t)===`fetched`&&c()},u=function(a,o){if(e.querySelector&&t&&e.querySelector(`[data-outline-error-for="`+t+`"]`))return;let s=i(a,o);if(s&&n.solo){if(!d&&g.solidLogicSingleton.authn.currentUser()){d=!0,f(!0);return}l();return}let c=s?r(s):a,u=h.widgets.errorMessageBlock(x,c,`#fee`,o instanceof Error?o:void 0);t&&u.setAttribute(`data-outline-error-for`,t),e.appendChild(u)},d=!1,f=function(e){let t=!1,r=O.nowOrWhenFetched(o.doc(),e?{force:!0}:{},function(e,r){e?(O.lookUpThing(o),c(),n.solo&&Y(o)):(t=!0,u(r,void 0))});r&&typeof r.catch==`function`&&r.catch(function(e){t||(t=!0,u(e,e))})},p=O.requested[t];f(!!n.solo&&(p===401||p===403))}else c()}function Z(e,t){let n=e.AJAR_statement||e.parentNode&&e.parentNode.AJAR_statement;h.log.debug(`Collapsing subject `+t);let r;n&&(h.log.debug(`looking up pred `+n.predicate.uri+`in defaults`),r=$.defaults[n.predicate.uri]),h.log.debug(`view= `+r);let i;e.parentNode&&e.parentNode.id===`outline`&&(i=e),T.replaceTD(T.outlineObjectDiv(t,r,i,n),e)}this.replaceTD=function(e,t){let n;V(t)&&(n=!0);for(let e=E.length-1;e>-1;e--)for(let n=E[e];n.parentNode;n=n.parentNode)n===t&&G(E[e],!1);t.parentNode.replaceChild(e,t),n&&G(e,!0)};function Q(e,t){h.utils.emptyNode(e).appendChild(z(t)),Y(t),e.setAttribute(`about`,t.toNT())}w.outlineRefocus=Q,this.GotoFormURI_enterKey=function(e){e.keyCode===13&&w.GotoFormURI(e)},this.GotoFormURI=function(e){me(x.getElementById(`UserURI`).value)};function me(e){let t=D.sym(e);this.GotoSubject(t,!0)}this.GotoURIinit=function(e){let t=D.sym(e);this.GotoSubject(t)},this.GotoSubject=function(e,t,n,r,i,a,o){let s=d.resolveSource(o)!==`accountMenu`,c=N();s&&(!a||a===c)&&ee(e);let f=a||c;r&&(f.style.width=`100%`,h.utils.emptyNode(f));let p=n&&n.subject&&n.subject.uri?n.subject:e;function m(){let e=x.createElement(`div`);e.classList.add(`outline-subject-block`);let t=T.outlineObjectDiv(p,void 0,e);return e.appendChild(t),f.appendChild(e),e}let g=r?m():f;if(r&&Y(p),t?X(g,p,{pane:n,solo:r,folderView:d.resolveFolderView(o),headerOnlyInViewerPod:!s||!!(n&&n.subject&&n.subject.uri)}):r||m(),r&&x&&x.defaultView&&x.defaultView.history){let t=o&&typeof o==`object`&&o.preserveUrl===!0,r=x.defaultView.history.state||{},i=document.location.href!==e.uri,a=l.nextHistoryState(r,{pane:n?{name:n.name,subject:n.subject&&typeof n.subject.uri==`string`?n.subject.uri:void 0}:void 0,leavingPage:i,viaAccountMenu:!s});try{let n=new URL(x.location.href),o=new URL(e.uri,x.location.href);t?x.defaultView.history.replaceState(a,``):n.origin===o.origin&&(i?x.defaultView.history.pushState(a,e.uri,e.uri):JSON.stringify(r)!==JSON.stringify(a)&&x.defaultView.history.replaceState(a,e.uri,e.uri))}catch{}}return r&&u.announceNavigation(x),e};let $=t.propertyViews(x);function he(t){let r;if(t.termType===`Literal`){if(r=x.createElement(`span`),r.classList.add(`objectValue`,`objectValue--literal`),r.textContent=t.value,t.datatype&&t.datatype.uri){let e=h.ns.xsd(``).uri;t.datatype.uri.slice(0,e.length)===e&&r.classList.add(`objectValue--`+t.datatype.uri.slice(e.length))}}else if(t.termType===`NamedNode`||t.termType===`BlankNode`){if(r=x.createElement(`span`),r.classList.add(`objectValue`,`objectValue--resource`),r.setAttribute(`about`,t.toNT()),T.appendAccessIcons(D,r,t),t.termType===`NamedNode`){if(t.uri.slice(0,4)===`tel:`){let e=t.uri.slice(4),i=x.createElement(`a`);r.appendChild(x.createTextNode(e)),i.setAttribute(`href`,t.uri),i.appendChild(h.utils.AJARImage(n.outlineIcons.src.icon_telephone,`phone`,`phone `+e,x)),r.appendChild(i),i.firstChild.setAttribute(`class`,`phoneIcon`),i.firstChild.classList.add(`objectValueLinkIcon`)}else{r.appendChild(x.createTextNode(h.utils.label(t)));let e=h.widgets.linkIcon(x,t);e.firstChild&&e.firstChild.classList.add(`objectValueLinkIcon`),r.appendChild(e),h.widgets.makeDraggable(r,t)}}else r.appendChild(x.createTextNode(h.utils.label(t)))}else if(t.termType===`Collection`){r=x.createElement(`div`),r.setAttribute(`about`,t.toNT());for(let e=0;e<t.elements.length;e++){let n=t.elements[e],i=r.appendChild(x.createElement(`div`)),a=i.appendChild(x.createElement(`div`));a.classList.add(`obj`),a.setAttribute(`notSelectable`,`false`),a.setAttribute(`about`,t.toNT()),a.innerHTML=e+1+`)`,i.appendChild(T.outlineObjectDiv(n))}}else t.termType===`Graph`?(r=_.byName(`dataContentPane`).statementsAsTables(t.statements,e),r.setAttribute(`class`,`nestedFormula`)):(h.log.error(`Object `+t+` has unknown term type: `+t.termType),r=x.createTextNode(`[unknownTermType:`+t.termType+`]`));return h.log.debug(`contents: `+r.innerHTML),r}return this.createTabURI=function(){x.getElementById(`UserURI`).value=x.URL+`?uri=`+x.getElementById(`UserURI`).value},this.UserInput.setSelected=G,this.UserInput.deselectAll=K,this.UserInput.views=$,this.outlineExpand=X,this}exports.default=x;
2
2
  //# sourceMappingURL=manager2.cjs.js.map