@qaecy/cue-ui 0.0.60 → 0.0.62
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.
- package/1359.js +1 -1
- package/1837.js +1 -1
- package/1842.js +1 -0
- package/2317.js +1 -1
- package/2538.js +1 -0
- package/2713.js +7 -0
- package/2775.js +1 -1
- package/2839.js +1 -1
- package/3036.js +1 -1
- package/3202.js +1 -1
- package/3418.js +1 -1
- package/3523.js +1 -1
- package/3577.js +1 -1
- package/3614.js +1 -1
- package/3654.js +1 -0
- package/3656.js +1 -1
- package/366.js +1 -0
- package/4098.js +1 -1
- package/426.js +1 -0
- package/468.js +1 -0
- package/4791.js +1 -1
- package/5649.js +1 -1
- package/5872.js +1 -1
- package/6233.js +1 -1
- package/6419.js +1 -1
- package/6947.js +1 -1
- package/7019.js +1 -0
- package/7193.js +1 -0
- package/7719.js +1 -1
- package/7727.js +1 -1
- package/8725.js +1 -0
- package/9396.js +1 -1
- package/992.js +1 -1
- package/index.js +1 -1
- package/main.js +1 -1
- package/package.json +1 -1
- package/1701.js +0 -1
- package/2530.js +0 -1
- package/329.js +0 -1
- package/3842.js +0 -1
- package/3869.js +0 -1
- package/4311.js +0 -1
- package/6040.js +0 -1
- package/7154.js +0 -1
- package/928.js +0 -1
package/3036.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[2014,3036],{2014(V,M,f){f.d(M,{ButtonPadder:()=>R});var n=f(7705),e=f(2271),a=f(5547);const t=["*"];let R=(()=>{class s{justify=(0,n.hFB)("start");size=(0,n.hFB)("l");widthStyle=(0,e.EW)(()=>`var(--cue-button-label-padding-${this.size()}-x)`);static \u0275fac=function(g){return new(g||s)};static \u0275cmp=a.VBU({type:s,selectors:[["cue-button-padder"]],inputs:{justify:[1,"justify"],size:[1,"size"]},ngContentSelectors:t,decls:2,vars:4,template:function(g,T){1&g&&(a.NAR(),a.rj2(0,"div"),a.SdG(1),a.eux()),2&g&&a.xc7("justify-content",T.justify())("min-width",T.widthStyle())},styles:["div[_ngcontent-%COMP%]{display:flex;align-items:center;min-height:1px}"]})}return s})()},3036(V,M,f){f.r(M),f.d(M,{DocumentViewer:()=>b});var n=f(467),e=f(9769),a=f(5802),t=f(7705),R=f(2271),s=f(5547),h=f(3418),c=f(6114);const g={bim:()=>Promise.all([f.e(7598),f.e(6419)]).then(f.bind(f,6419)).then(r=>r.BIMFragmentsViewer),cad:()=>Promise.all([f.e(7598),f.e(8560),f.e(1051)]).then(f.bind(f,1051)).then(r=>r.DXFViewer),image:()=>f.e(8560).then(f.bind(f,8560)).then(r=>r.ImageViewer),markdown:()=>Promise.all([f.e(222),f.e(6586)]).then(f.bind(f,6586)).then(r=>r.MarkdownViewer),pdf:()=>Promise.all([f.e(8560),f.e(4311)]).then(f.bind(f,4311)).then(r=>r.PDFViewer),text:()=>f.e(3523).then(f.bind(f,3523)).then(r=>r.TextViewer),spreadsheet:()=>Promise.all([f.e(2076),f.e(4791)]).then(f.bind(f,4791)).then(r=>r.Spreadsheet),code:()=>Promise.all([f.e(4284),f.e(2530),f.e(329)]).then(f.bind(f,329)).then(r=>r.CodeViewer),email:()=>f.e(5740).then(f.bind(f,5740)).then(r=>r.EmailViewer)},T=new Map([[c.N.DXF,"cad"],[c.N.FRAG,"bim"],[c.N.PDF,"pdf"],[c.N.PNG,"image"],[c.N.JPG,"image"],[c.N.JPEG,"image"],[c.N.SVG,"image"],[c.N.GIF,"image"],[c.N.WEBP,"image"],[c.N.BMP,"image"],[c.N.AVIF,"image"],[c.N.APNG,"image"],[c.N.CSV,"spreadsheet"],[c.N.XLSX,"spreadsheet"],[c.N.XLS,"spreadsheet"],[c.N.JSON,"code"],[c.N.JSONLD,"code"],[c.N.XML,"code"],[c.N.CSS,"code"],[c.N.JS,"code"],[c.N.HTML,"code"],[c.N.HTM,"code"],[c.N.SH,"code"],[c.N.TXT,"text"],[c.N.RST,"text"],[c.N.MD,"markdown"]]);var A=f(8807),E=f(2065);const C=["*"];let w=(()=>{class r{width=(0,t.hFB)("auto");height=(0,t.hFB)("auto");style=(0,t.hFB)("");getStyles=(0,R.EW)(()=>this.style());static \u0275fac=function(u){return new(u||r)};static \u0275cmp=s.VBU({type:r,selectors:[["cue-container"]],hostVars:6,hostBindings:function(u,d){2&u&&(s.Aen(d.getStyles()),s.xc7("max-width",d.width())("max-height",d.height()))},inputs:{width:[1,"width"],height:[1,"height"],style:[1,"style"]},ngContentSelectors:C,decls:1,vars:0,template:function(u,d){1&u&&(s.NAR(),s.SdG(0))},styles:["[_nghost-%COMP%]{display:flex;align-items:stretch;container-name:cue-container;container-type:inline-size}[_nghost-%COMP%] > *[_ngcontent-%COMP%]{flex:1;max-width:100%}"]})}return r})();var H=f(2245),X=f(5381),J=f(5971),U=f(3319),B=f(5448),y=f(2014),W=f(7851),v=f(3191);let P=(()=>{class r{searchService=(0,a.WQX)(v.g);entityBeingPlaced=(0,a.vPA)(void 0);confirmedPlacement=(0,a.vPA)(void 0);rdfBaseURL=(0,a.vPA)("");contentUUID=(0,a.vPA)("");activePdfDoc=(0,a.vPA)(null);currentPage=(0,a.vPA)(1);requestedPage=(0,a.vPA)(null);navigateToPage(p){this.currentPage.set(p),this.requestedPage.set(p)}entityTextSearchResults=(0,a.vPA)([]);entityTextSearchResultsOnCurrentPage=(0,R.EW)(()=>this.entityTextSearchResults().filter(p=>p.page===this.currentPage()));currentPlacementBbox=(0,a.vPA)(null);categoryPreviewBoxes=(0,a.vPA)([]);_lastMatchIndex=(0,a.vPA)(null);matchCycleDisplay=(0,R.EW)(()=>{const p=this._lastMatchIndex(),u=this.entityTextSearchResultsOnCurrentPage().length;return null===p||0===u?"":`${p+1}/${u}`});cycleTextMatch(){const p=this.entityTextSearchResultsOnCurrentPage();if(!p.length)return;const u=this._lastMatchIndex(),d=null===u?0:(u+1)%p.length;this._lastMatchIndex.set(d);const o=p[d].xywhStr.replace("percent:",""),[I,D,i,m]=o.split(",").map(Number),j=Math.max(0,I-.5),G=Math.max(0,D-.5),x=Math.min(100-j,i+1),N=Math.min(100-G,m+1);this.currentPlacementBbox.set({xywhStr:`percent:${j.toFixed(2)},${G.toFixed(2)},${x.toFixed(2)},${N.toFixed(2)}`,color:"rgba(255, 160, 0, 0.9)",allowRemove:!1})}setManualBbox(p){this._lastMatchIndex.set(null),this.currentPlacementBbox.set({...p,allowRemove:!1})}clearPlacement(){this.currentPlacementBbox.set(null),this._lastMatchIndex.set(null)}constructor(){(0,a.QZP)(()=>{const p=this.entityBeingPlaced(),u=this.activePdfDoc();p?.value&&u?this.searchService.searchAll(u,p.value).then(d=>{this.entityTextSearchResults.set(d)}):this.entityTextSearchResults.set([])}),(0,a.QZP)(()=>{this.currentPage(),this._lastMatchIndex.set(null),this.currentPlacementBbox.set(null)}),(0,a.QZP)(()=>{const p=this.entityBeingPlaced();this._lastMatchIndex.set(null),void 0===p&&this.currentPlacementBbox.set(null)})}static \u0275fac=function(u){return new(u||r)};static \u0275prov=a.jDH({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();var S=f(9352);const O=["viewerTarget"];function L(r,$){if(1&r){const p=s.RV6();s.j41(0,"cue-flexcontainer",2)(1,"cue-typography"),s.EFF(2),s.nI1(3,"transloco"),s.k0s(),s.j41(4,"cue-button",3),s.bIt("click",function(){a.eBV(p);const d=s.XpG();return a.Njj(d.downloadFile())}),s.j41(5,"cue-button-padder"),s.nrm(6,"cue-button-icon",4),s.k0s(),s.j41(7,"cue-button-label"),s.EFF(8),s.nI1(9,"transloco"),s.k0s()()()}2&r&&(s.R7$(2),s.JRh(s.bMT(3,2,"components.documentViewer.infoNoViewer")),s.R7$(6),s.JRh(s.bMT(9,4,"common.buttons.download")))}let b=(()=>{class r{_eps=(0,a.WQX)(P);_destroyed=!1;url=t.hFB.required();suffix=(0,t.hFB)();settings=(0,t.hFB)(new h.DocumentViewerSettings);viewerTypeOverride=(0,t.hFB)(void 0);interactions=(0,t.CGW)();viewerType=(0,R.EW)(()=>{const p=this.viewerTypeOverride();if(p)return p;const u=this.url(),d=void 0!==this.suffix()?this.suffix()?.trim():`.${u.split(".").pop()?.trim()}`,o=d?T.get(d):void 0;return console.log("[DocumentViewer] viewerType resolved",{url:u?.substring(0,80),suffix:d,viewerType:o}),void 0!==d?o:void 0});currentComponent=(0,a.vPA)(null);noViewer=(0,R.EW)(()=>null===this.currentComponent());isLoading=(0,a.vPA)(!1);viewerTarget;currentRef;_interactionsState=(0,a.vPA)(new h.DocumentViewerInteractions);constructor(){(0,a.QZP)(()=>{const p=this.viewerType(),u=this.url();console.log("[DocumentViewer] url/viewerType effect \u2014",{viewerType:p,url:u?.substring(0,80),destroyed:this._destroyed}),p?("pdf"!==p&&this._eps.activePdfDoc.set(null),this.isLoading.set(!0),this.loadViewerComponent(p,u,this.settings())):(this.viewerTarget.clear(),this.currentRef?.destroy(),this.currentRef=void 0,console.info("No viewer available for this file type"),this.currentComponent.set(null),this.isLoading.set(!1),this._eps.activePdfDoc.set(null))}),(0,a.QZP)(()=>{this.interactions.emit(this._interactionsState())}),(0,a.QZP)(()=>{const p=this.settings().pdf,u=this.currentRef;u&&u.setInput("settings",p)})}ngOnDestroy(){this._destroyed=!0,this.viewerTarget.clear(),this.currentRef?.destroy(),this.currentRef=void 0}loadViewerComponent(p,u,d){var o=this;return(0,n.A)(function*(){console.log("[DocumentViewer] loadViewerComponent",{viewerType:p,url:u?.substring(0,100)});try{const I=g[p],D=yield I();if(o._destroyed)return;if(o.currentComponent.set(D),o.isLoading.set(!1),o.viewerTarget.clear(),o.currentRef?.destroy(),o.currentRef=o.viewerTarget.createComponent(D),"pdf"===p)o.currentRef.setInput("src",u),void 0!==d?.pdf&&o.currentRef.setInput("settings",d.pdf),o.currentRef.instance.pdfLoaded&&o.currentRef.instance.pdfLoaded.subscribe(i=>{o._eps.currentPage.set(1),o._eps.activePdfDoc.set(i)}),o.currentRef.instance.settingsChange&&o.currentRef.instance.settingsChange.subscribe(i=>{const m=parseInt(i?.page,10);!isNaN(m)&&m>0&&o._eps.currentPage.set(m)}),o.currentRef.instance.artefactDrawn&&o.currentRef.instance.artefactDrawn.subscribe(i=>{"xywh"===i.type&&o._eps.setManualBbox(i.def)}),o.currentRef.instance.artefactEdited&&o.currentRef.instance.artefactEdited.subscribe(i=>{"bbox"===i.type&&o._eps.setManualBbox(i.after)});else if("bim"===p){const i=new A.di("model","Model",u);i.visible=!0,o.currentRef.setInput("data",{models:[i]}),void 0!==d?.bim&&o.currentRef.setInput("settings",d.bim),o.currentRef.instance.selectedElements&&o.currentRef.instance.selectedElements.subscribe(m=>{o._interactionsState.update(l=>(l.bim.selectedElements=m,Object.assign({},l)))}),o.currentRef.instance.clickedElement&&o.currentRef.instance.clickedElement.subscribe(m=>{o._interactionsState.update(l=>(l.bim.clickedElement=m,Object.assign({},l)))})}else if("cad"===p)o.currentRef.setInput("fileURL",u),void 0!==d?.cad&&o.currentRef.setInput("settings",d.cad);else if("image"===p)o.currentRef.setInput("src",u);else if("markdown"===p)o.currentRef.setInput("fileURL",u);else if("text"===p)o.currentRef.setInput("fileURL",u);else if("spreadsheet"===p){const i=o.suffix()?.split(".").pop()||u.split(".").pop()||"csv";o.currentRef.setInput("data",{url:u,format:i})}else if("code"===p){const l={".json":"json",".jsonld":"jsonld",".xml":"xml",".html":"xml",".htm":"xml",".css":"text",".js":"text",".sh":"text"}[o.suffix()??`.${u.split(".").pop()??""}`]??"text";o.currentRef.setInput("fileURL",u),o.currentRef.setInput("codeType",l)}else"email"===p&&o.currentRef.setInput("fileURL",u)}catch(I){console.error("Failed to load viewer component:",I),o.currentComponent.set(null)}})()}downloadFile(){var p=this;return(0,n.A)(function*(){const d=yield(yield fetch(p.url())).blob();(0,E.KE)(d,`document${p.suffix()??""}`)})()}static \u0275fac=function(u){return new(u||r)};static \u0275cmp=s.VBU({type:r,selectors:[["cue-doc-viewer"]],viewQuery:function(u,d){if(1&u&&s.GBs(O,7,s.c1b),2&u){let o;s.mGM(o=s.lsd())&&(d.viewerTarget=o.first)}},inputs:{url:[1,"url"],suffix:[1,"suffix"],settings:[1,"settings"],viewerTypeOverride:[1,"viewerTypeOverride"]},outputs:{interactions:"interactions"},decls:4,vars:2,consts:[["viewerTarget",""],[2,"height","100%","width","100%",3,"cueLogoLoader"],["direction","column","align","center","justify","center",2,"height","100%","width","100%"],[3,"click"],["icon","download"]],template:function(u,d){1&u&&(s.j41(0,"cue-container",1),s.eu8(1,null,0),s.nVh(3,L,10,6,"cue-flexcontainer",2),s.k0s()),2&u&&(s.Y8G("cueLogoLoader",d.isLoading()),s.R7$(3),s.vxM(!d.isLoading()&&d.noViewer()?3:-1))},dependencies:[e.MD,w,H.Typography,X.FlexContainer,J.Button,U.ButtonIcon,B.ButtonLabel,y.ButtonPadder,W.k,S.Kj],styles:["[_nghost-%COMP%]{display:contents}"],changeDetection:0})}return r})()},3191(V,M,f){f.d(M,{g:()=>a});var n=f(467),e=f(5802);let a=(()=>{class t{searchPage(s,h,c){return(0,n.A)(function*(){if(!c||!c.trim())return[];const g=c.toLowerCase(),T=yield s.getPage(h),A=T.getViewport({scale:1}),C=(yield T.getTextContent()).items,w=[];let H="";const X=[],J=[];for(let y=0;y<C.length;y++){const v=C[y].str??"";for(let P=0;P<v.length;P++)H+=v[P],X.push(y),J.push(P)}const U=H.toLowerCase();let B=0;for(;B<U.length;){const y=U.indexOf(g,B);if(-1===y)break;const W=y+g.length-1;B=y+1;const v=new Set;for(let D=y;D<=W;D++)v.add(X[D]);let P=1/0,S=1/0,O=-1/0,L=-1/0;for(const D of v){const i=C[D],[m,l,j,G,x,N]=i.transform,K=i.width??0,z=i.height??Math.abs(m||G||12),Z=Math.sqrt(m*m+l*l)||1,Q=m/Z,Y=l/Z,k=j/Z,q=G/Z,ne=[[x,N],[x+Q*K,N+Y*K],[x+Q*K+k*z,N+Y*K+q*z],[x+k*z,N+q*z]];for(const[fe,pe]of ne){const[F,_]=A.convertToViewportPoint(fe,pe);P=Math.min(P,F),S=Math.min(S,_),O=Math.max(O,F),L=Math.max(L,_)}}const b=A.width,r=A.height,$=.005*b,p=.005*r,d=(S-p)/r*100,o=(O-P+2*$)/b*100,I=(L-S+2*p)/r*100;o>0&&I>0&&w.push({page:h,xywhStr:`percent:${((P-$)/b*100).toFixed(2)},${d.toFixed(2)},${o.toFixed(2)},${I.toFixed(2)}`})}return w})()}searchAll(s,h){var c=this;return(0,n.A)(function*(){if(!h||!h.trim())return[];const g=s.numPages,T=[];for(let A=1;A<=g;A++){const E=yield c.searchPage(s,A,h);T.push(...E)}return T})()}static \u0275fac=function(h){return new(h||t)};static \u0275prov=e.jDH({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})()},6114(V,M,f){f.d(M,{N:()=>e,V:()=>a});var n=f(4820),e=function(t){return t.AAC=".aac",t.ABW=".abw",t.ARC=".arc",t.AVIF=".avif",t.AVI=".avi",t.APNG=".apng",t.BAK=".bak",t.BIN=".bin",t.BMC=".bmc",t.BMP=".bmp",t.BZ=".bz",t.BZ2=".bz2",t.C3D=".c3d",t.CPG=".cpg",t.CSS=".css",t.CSV=".csv",t.DAT=".dat",t.DOC=".doc",t.DOCX=".docx",t.E57=".e57",t.EPUB=".epub",t.EXE=".exe",t.FFS=".ffs",t.FME=".fme",t.FMW=".fmw",t.FRAG=".fragments",t.GH=".gh",t.GZ=".gz",t.GIF=".gif",t.HTML=".html",t.HTM=".htm",t.ICO=".ico",t.ICS=".ics",t.JAR=".jar",t.JPG=".jpg",t.JPEG=".jpeg",t.JSON=".json",t.JSONLD=".jsonld",t.JS=".js",t.MOV=".mov",t.MP3=".mp3",t.MP4=".mp4",t.MPEG=".mpeg",t.MSI=".msi",t.MTL=".mtl",t.ODP=".odp",t.ODS=".ods",t.ODT=".odt",t.OGA=".oga",t.OGG=".ogg",t.OGV=".ogv",t.OGX=".ogx",t.OTF=".otf",t.PNG=".png",t.PDF=".pdf",t.PHP=".php",t.PKG=".pkg",t.PPT=".ppt",t.PPTX=".pptx",t.PS=".ps",t.RAR=".rar",t.RCP=".rcp",t.RTF=".rtf",t.SH=".sh",t.SLK=".slk",t.SVG=".svg",t.TAR=".tar",t.TIFF=".tiff",t.TIF=".tif",t.TTF=".ttf",t.TXT=".txt",t.VGL=".vgl",t.VWX=".vwx",t.WAV=".wav",t.WEBM=".webm",t.WEBP=".webp",t.WMV=".wmv",t.WOFF=".woff",t.WOFF2=".woff2",t.XLS=".xls",t.XLSX=".xlsx",t.XHTML=".xhtml",t.XML=".xml",t.XYZ=".xyz",t.ZIP=".zip",t.SEVEN_Z=".7z",t.DBF=".dbf",t.EML=".eml",t.EMLX=".emlx",t.MBX=".mbx",t.MD=".md",t.MSG=".msg",t.RST=".rst",t.HEIC=".heic",t.MPP=".mpp",t.TSV=".tsv",t.B3DM=".b3dm",t.I3DM=".i3dm",t.PNTS=".pnts",t.CMPT=".cmpt",t.GLTF=".gltf",t.GLB=".glb",t.IFC=".ifc",t.IFCZIP=".ifczip",t.IFXML=".ifcxml",t.THREEDM=".3dm",t.THREEDS=".3ds",t.GHP=".ghp",t.RVT=".rvt",t.RFA=".rfa",t.RFT=".rft",t.RTE=".rte",t.PLA=".pla",t.PLN=".pln",t.GSM=".gsm",t.SMC=".smc",t.BCF=".bcf",t.DWG=".dwg",t.DWL=".dwl",t.DXF=".dxf",t.DGN=".dgn",t.NWD=".nwd",t.OBJ=".obj",t.C4D=".c4d",t.TEKLASTRUCTURES=".teklastructures",t.PTS=".pts",t.LAS=".las",t.LAZ=".laz",t.USDZ=".usdz",t.USDA=".usda",t.USDC=".usdc",t.USD=".usd",t.PSD=".psd",t.PSP=".psp",t.AI=".ai",t.SBN=".sbn",t.SBX=".sbx",t.SHX=".shx",t.SKP=".skp",t.STL=".stl",t.FBX=".fbx",t.KML=".kml",t.SHP=".shp",t}(e||{});const a={[e.AAC]:{type:n.p.AUDIO,open:!0,suffix:".aac"},[e.ABW]:{type:n.p.TEXT,open:!0,suffix:".abw"},[e.ARC]:{type:n.p.ARCHIVE,open:!1,suffix:".arc"},[e.AVIF]:{type:n.p.IMAGE,open:!0,suffix:".avif"},[e.AVI]:{type:n.p.VIDEO,open:!0,suffix:".avi"},[e.APNG]:{type:n.p.IMAGE,open:!0,suffix:".apng"},[e.BAK]:{type:n.p.BACKUP,open:!1,suffix:".bak"},[e.BIN]:{type:n.p.BINARY,open:!1,suffix:".bin"},[e.BMC]:{type:n.p.BIM,open:!1,suffix:".bmc"},[e.BMP]:{type:n.p.IMAGE,open:!0,suffix:".bmp"},[e.BZ]:{type:n.p.ARCHIVE,open:!0,suffix:".bz"},[e.BZ2]:{type:n.p.ARCHIVE,open:!0,suffix:".bz2"},[e.C3D]:{type:n.p.THREE_D,open:!0,suffix:".c3d"},[e.CPG]:{type:n.p.GEOSPATIAL,open:!0,suffix:".cpg"},[e.CSS]:{type:n.p.MARKUP,open:!0,suffix:".css"},[e.CSV]:{type:n.p.DATA,open:!0,suffix:".csv"},[e.DAT]:{type:n.p.DATA,open:!1,suffix:".dat"},[e.DBF]:{type:n.p.DATA,open:!0,suffix:".dbf"},[e.DOC]:{type:n.p.TEXT,open:!1,suffix:".doc"},[e.DOCX]:{type:n.p.TEXT,open:!0,suffix:".docx"},[e.E57]:{type:n.p.THREE_D,open:!0,suffix:".e57"},[e.EPUB]:{type:n.p.TEXT,open:!0,suffix:".epub"},[e.EXE]:{type:n.p.INSTALLER,open:!1,suffix:".exe"},[e.FFS]:{type:n.p.AUTOMATION,open:!1,suffix:".ffs"},[e.FME]:{type:n.p.AUTOMATION,open:!1,suffix:".fme"},[e.FMW]:{type:n.p.AUTOMATION,open:!1,suffix:".fmw"},[e.FRAG]:{type:n.p.BIM,open:!0,suffix:".fragments"},[e.GH]:{type:n.p.THREE_D,open:!1,suffix:".gh"},[e.GZ]:{type:n.p.ARCHIVE,open:!0,suffix:".gz"},[e.GIF]:{type:n.p.IMAGE,open:!0,suffix:".gif"},[e.HTML]:{type:n.p.MARKUP,open:!0,suffix:".html"},[e.HTM]:{type:n.p.MARKUP,open:!0,suffix:".htm"},[e.ICO]:{type:n.p.IMAGE,open:!1,suffix:".ico"},[e.ICS]:{type:n.p.DATA,open:!0,suffix:".ics"},[e.JAR]:{type:n.p.ARCHIVE,open:!0,suffix:".jar"},[e.JPG]:{type:n.p.IMAGE,open:!0,suffix:".jpg"},[e.JPEG]:{type:n.p.IMAGE,open:!0,suffix:".jpeg"},[e.JSON]:{type:n.p.DATA,open:!0,suffix:".json"},[e.JSONLD]:{type:n.p.DATA,open:!0,suffix:".jsonld"},[e.JS]:{type:n.p.SCRIPT,open:!0,suffix:".js"},[e.MSI]:{type:n.p.INSTALLER,open:!1,suffix:".msi"},[e.MOV]:{type:n.p.VIDEO,open:!0,suffix:".mov"},[e.MP3]:{type:n.p.AUDIO,open:!0,suffix:".mp3"},[e.MP4]:{type:n.p.VIDEO,open:!0,suffix:".mp4"},[e.MPEG]:{type:n.p.VIDEO,open:!0,suffix:".mpeg"},[e.MTL]:{type:n.p.THREE_D,open:!0,suffix:".mtl"},[e.ODP]:{type:n.p.PRESENTATION,open:!0,suffix:".odp"},[e.ODS]:{type:n.p.SPREADSHEET,open:!0,suffix:".ods"},[e.ODT]:{type:n.p.TEXT,open:!0,suffix:".odt"},[e.OGA]:{type:n.p.AUDIO,open:!0,suffix:".oga"},[e.OGG]:{type:n.p.AUDIO,open:!0,suffix:".ogg"},[e.OGV]:{type:n.p.VIDEO,open:!0,suffix:".ogv"},[e.OGX]:{type:n.p.VIDEO,open:!0,suffix:".ogx"},[e.OTF]:{type:n.p.FONT,open:!0,suffix:".otf"},[e.PNG]:{type:n.p.IMAGE,open:!0,suffix:".png"},[e.PDF]:{type:n.p.TEXT,open:!0,suffix:".pdf"},[e.PHP]:{type:n.p.SCRIPT,open:!0,suffix:".php"},[e.PKG]:{type:n.p.INSTALLER,open:!1,suffix:".pkg"},[e.PPT]:{type:n.p.PRESENTATION,open:!1,suffix:".ppt"},[e.PPTX]:{type:n.p.PRESENTATION,open:!0,suffix:".pptx"},[e.PS]:{type:n.p.IMAGE,open:!1,suffix:".ps"},[e.RAR]:{type:n.p.ARCHIVE,open:!1,suffix:".rar"},[e.RCP]:{type:n.p.THREE_D,open:!1,suffix:".rcp"},[e.RTF]:{type:n.p.TEXT,open:!0,suffix:".rtf"},[e.SBN]:{type:n.p.GEOSPATIAL,open:!1,suffix:".sbn"},[e.SBX]:{type:n.p.GEOSPATIAL,open:!1,suffix:".sbx"},[e.SHX]:{type:n.p.GEOSPATIAL,open:!0,suffix:".shx"},[e.SH]:{type:n.p.SCRIPT,open:!0,suffix:".sh"},[e.SLK]:{type:n.p.DATA,open:!0,suffix:".slk"},[e.SVG]:{type:n.p.IMAGE,open:!0,suffix:".svg"},[e.TAR]:{type:n.p.ARCHIVE,open:!0,suffix:".tar"},[e.TIFF]:{type:n.p.IMAGE,open:!0,suffix:".tiff"},[e.TIF]:{type:n.p.IMAGE,open:!0,suffix:".tif"},[e.TTF]:{type:n.p.FONT,open:!0,suffix:".ttf"},[e.TXT]:{type:n.p.TEXT,open:!0,suffix:".txt"},[e.VGL]:{type:n.p.THREE_D,open:!1,suffix:".vgl"},[e.VWX]:{type:n.p.CAD,open:!1,suffix:".vwx"},[e.WAV]:{type:n.p.AUDIO,open:!0,suffix:".wav"},[e.WEBM]:{type:n.p.VIDEO,open:!0,suffix:".webm"},[e.WEBP]:{type:n.p.IMAGE,open:!0,suffix:".webp"},[e.WMV]:{type:n.p.VIDEO,open:!0,suffix:".wmv"},[e.WOFF]:{type:n.p.FONT,open:!0,suffix:".woff"},[e.WOFF2]:{type:n.p.FONT,open:!0,suffix:".woff2"},[e.XLS]:{type:n.p.SPREADSHEET,open:!1,suffix:".xls"},[e.XLSX]:{type:n.p.SPREADSHEET,open:!0,suffix:".xlsx"},[e.XHTML]:{type:n.p.MARKUP,open:!0,suffix:".xhtml"},[e.XML]:{type:n.p.DATA,open:!0,suffix:".xml"},[e.XYZ]:{type:n.p.THREE_D,open:!0,suffix:".xyz"},[e.ZIP]:{type:n.p.ARCHIVE,open:!0,suffix:".zip"},[e.SEVEN_Z]:{type:n.p.ARCHIVE,open:!0,suffix:".7z"},[e.EML]:{type:n.p.EMAIL,open:!0,suffix:".eml"},[e.EMLX]:{type:n.p.EMAIL,open:!0,suffix:".emlx"},[e.MBX]:{type:n.p.EMAIL,open:!0,suffix:".mbx"},[e.MD]:{type:n.p.TEXT,open:!0,suffix:".md"},[e.MSG]:{type:n.p.EMAIL,open:!1,suffix:".msg"},[e.RST]:{type:n.p.TEXT,open:!0,suffix:".rst"},[e.HEIC]:{type:n.p.IMAGE,open:!1,suffix:".heic"},[e.MPP]:{type:n.p.PLANNING,open:!1,suffix:".mpp"},[e.TSV]:{type:n.p.DATA,open:!0,suffix:".tsv"},[e.B3DM]:{type:n.p.THREE_D,open:!0,suffix:".b3dm"},[e.I3DM]:{type:n.p.THREE_D,open:!0,suffix:".i3dm"},[e.PNTS]:{type:n.p.THREE_D,open:!1,suffix:".pnts"},[e.CMPT]:{type:n.p.THREE_D,open:!1,suffix:".cmpt"},[e.GLTF]:{type:n.p.THREE_D,open:!0,suffix:".gltf"},[e.GLB]:{type:n.p.THREE_D,open:!0,suffix:".glb"},[e.IFC]:{type:n.p.BIM,open:!0,suffix:".ifc"},[e.IFCZIP]:{type:n.p.BIM,open:!0,suffix:".ifczip"},[e.IFXML]:{type:n.p.BIM,open:!0,suffix:".ifcxml"},[e.THREEDM]:{type:n.p.CAD,open:!1,suffix:".3dm"},[e.THREEDS]:{type:n.p.THREE_D,open:!1,suffix:".3ds"},[e.GHP]:{type:n.p.CAD,open:!1,suffix:".ghp"},[e.RVT]:{type:n.p.BIM,open:!1,suffix:".rvt"},[e.RFA]:{type:n.p.BIM,open:!1,suffix:".rfa"},[e.RFT]:{type:n.p.BIM,open:!1,suffix:".rft"},[e.RTE]:{type:n.p.BIM,open:!1,suffix:".rte"},[e.PLA]:{type:n.p.BIM,open:!1,suffix:".pla"},[e.PLN]:{type:n.p.BIM,open:!1,suffix:".pln"},[e.GSM]:{type:n.p.BIM,open:!1,suffix:".gsm"},[e.SMC]:{type:n.p.BIM,open:!1,suffix:".smc"},[e.STL]:{type:n.p.THREE_D,open:!0,suffix:".stl"},[e.BCF]:{type:n.p.BIM,open:!0,suffix:".bcf"},[e.DWG]:{type:n.p.CAD,open:!1,suffix:".dwg"},[e.DWL]:{type:n.p.CAD,open:!1,suffix:".dwl"},[e.DXF]:{type:n.p.CAD,open:!0,suffix:".dxf"},[e.DGN]:{type:n.p.CAD,open:!1,suffix:".dgn"},[e.NWD]:{type:n.p.BIM,open:!1,suffix:".nwd"},[e.OBJ]:{type:n.p.THREE_D,open:!0,suffix:".obj"},[e.C4D]:{type:n.p.THREE_D,open:!1,suffix:".c4d"},[e.TEKLASTRUCTURES]:{type:n.p.BIM,open:!1,suffix:".teklastructures"},[e.PTS]:{type:n.p.THREE_D,open:!1,suffix:".pts"},[e.LAS]:{type:n.p.THREE_D,open:!0,suffix:".las"},[e.LAZ]:{type:n.p.THREE_D,open:!0,suffix:".laz"},[e.USDZ]:{type:n.p.THREE_D,open:!0,suffix:".usdz"},[e.USDA]:{type:n.p.THREE_D,open:!0,suffix:".usda"},[e.USDC]:{type:n.p.THREE_D,open:!0,suffix:".usdc"},[e.USD]:{type:n.p.THREE_D,open:!0,suffix:".usd"},[e.PSD]:{type:n.p.IMAGE,open:!1,suffix:".psd"},[e.PSP]:{type:n.p.IMAGE,open:!1,suffix:".psp"},[e.AI]:{type:n.p.IMAGE,open:!1,suffix:".ai"},[e.SKP]:{type:n.p.THREE_D,open:!1,suffix:".skp"},[e.FBX]:{type:n.p.THREE_D,open:!0,suffix:".fbx"},[e.KML]:{type:n.p.GEOSPATIAL,open:!0,suffix:".kml"},[e.SHP]:{type:n.p.GEOSPATIAL,open:!0,suffix:".shp"}}},4820(V,M,f){f.d(M,{p:()=>n});var n=function(e){return e.AUTOMATION="automation",e.ARCHIVE="archive",e.AUDIO="audio",e.BACKUP="backup",e.BINARY="binary",e.BIM="bim",e.CAD="cad",e.DATA="data",e.EMAIL="email",e.FONT="font",e.GEOSPATIAL="geospatial",e.IMAGE="image",e.INSTALLER="installer",e.MARKUP="markup",e.MULTIMEDIA="multimedia",e.PLANNING="planning",e.PRESENTATION="presentation",e.SCRIPT="script",e.SPREADSHEET="spreadsheet",e.TEXT="text",e.THREE_D="3d",e.UNKNOWN="unknown",e.VIDEO="video",e}(n||{})}}]);
|
|
1
|
+
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[2014,3036],{2014(V,M,n){n.d(M,{ButtonPadder:()=>R});var f=n(7705),e=n(2271),a=n(5547);const t=["*"];let R=(()=>{class u{justify=(0,f.hFB)("start");size=(0,f.hFB)("l");widthStyle=(0,e.EW)(()=>`var(--cue-button-label-padding-${this.size()}-x)`);static \u0275fac=function(g){return new(g||u)};static \u0275cmp=a.VBU({type:u,selectors:[["cue-button-padder"]],inputs:{justify:[1,"justify"],size:[1,"size"]},ngContentSelectors:t,decls:2,vars:4,template:function(g,D){1&g&&(a.NAR(),a.rj2(0,"div"),a.SdG(1),a.eux()),2&g&&a.xc7("justify-content",D.justify())("min-width",D.widthStyle())},styles:["div[_ngcontent-%COMP%]{display:flex;align-items:center;min-height:1px}"]})}return u})()},3036(V,M,n){n.r(M),n.d(M,{DocumentViewer:()=>b});var f=n(467),e=n(9769),a=n(5802),t=n(7705),R=n(2271),u=n(5547),h=n(3418),c=n(6114);const g={bim:()=>Promise.all([n.e(7598),n.e(6419)]).then(n.bind(n,6419)).then(r=>r.BIMFragmentsViewer),cad:()=>Promise.all([n.e(7598),n.e(8560),n.e(1051)]).then(n.bind(n,1051)).then(r=>r.DXFViewer),image:()=>n.e(8560).then(n.bind(n,8560)).then(r=>r.ImageViewer),markdown:()=>Promise.all([n.e(222),n.e(6586)]).then(n.bind(n,6586)).then(r=>r.MarkdownViewer),pdf:()=>Promise.all([n.e(8560),n.e(1842)]).then(n.bind(n,1842)).then(r=>r.PDFViewer),text:()=>n.e(3523).then(n.bind(n,3523)).then(r=>r.TextViewer),spreadsheet:()=>Promise.all([n.e(2076),n.e(4791)]).then(n.bind(n,4791)).then(r=>r.Spreadsheet),code:()=>Promise.all([n.e(4284),n.e(2538),n.e(7193)]).then(n.bind(n,329)).then(r=>r.CodeViewer),email:()=>n.e(5740).then(n.bind(n,5740)).then(r=>r.EmailViewer)},D=new Map([[c.N.DXF,"cad"],[c.N.FRAG,"bim"],[c.N.PDF,"pdf"],[c.N.PNG,"image"],[c.N.JPG,"image"],[c.N.JPEG,"image"],[c.N.SVG,"image"],[c.N.GIF,"image"],[c.N.WEBP,"image"],[c.N.BMP,"image"],[c.N.AVIF,"image"],[c.N.APNG,"image"],[c.N.CSV,"spreadsheet"],[c.N.XLSX,"spreadsheet"],[c.N.XLS,"spreadsheet"],[c.N.JSON,"code"],[c.N.JSONLD,"code"],[c.N.XML,"code"],[c.N.CSS,"code"],[c.N.JS,"code"],[c.N.HTML,"code"],[c.N.HTM,"code"],[c.N.SH,"code"],[c.N.TXT,"text"],[c.N.RST,"text"],[c.N.MD,"markdown"]]);var A=n(8807),E=n(2065);const C=["*"];let w=(()=>{class r{width=(0,t.hFB)("auto");height=(0,t.hFB)("auto");style=(0,t.hFB)("");getStyles=(0,R.EW)(()=>this.style());static \u0275fac=function(s){return new(s||r)};static \u0275cmp=u.VBU({type:r,selectors:[["cue-container"]],hostVars:6,hostBindings:function(s,d){2&s&&(u.Aen(d.getStyles()),u.xc7("max-width",d.width())("max-height",d.height()))},inputs:{width:[1,"width"],height:[1,"height"],style:[1,"style"]},ngContentSelectors:C,decls:1,vars:0,template:function(s,d){1&s&&(u.NAR(),u.SdG(0))},styles:["[_nghost-%COMP%]{display:flex;align-items:stretch;container-name:cue-container;container-type:inline-size}[_nghost-%COMP%] > *[_ngcontent-%COMP%]{flex:1;max-width:100%}"]})}return r})();var H=n(2245),X=n(5381),J=n(5971),U=n(3319),B=n(5448),y=n(2014),W=n(7851),v=n(3191);let P=(()=>{class r{searchService=(0,a.WQX)(v.g);entityBeingPlaced=(0,a.vPA)(void 0);confirmedPlacement=(0,a.vPA)(void 0);rdfBaseURL=(0,a.vPA)("");contentUUID=(0,a.vPA)("");activePdfDoc=(0,a.vPA)(null);currentPage=(0,a.vPA)(1);requestedPage=(0,a.vPA)(null);navigateToPage(p){this.currentPage.set(p),this.requestedPage.set(p)}entityTextSearchResults=(0,a.vPA)([]);entityTextSearchResultsOnCurrentPage=(0,R.EW)(()=>this.entityTextSearchResults().filter(p=>p.page===this.currentPage()));currentPlacementBbox=(0,a.vPA)(null);categoryPreviewBoxes=(0,a.vPA)([]);_lastMatchIndex=(0,a.vPA)(null);matchCycleDisplay=(0,R.EW)(()=>{const p=this._lastMatchIndex(),s=this.entityTextSearchResultsOnCurrentPage().length;return null===p||0===s?"":`${p+1}/${s}`});cycleTextMatch(){const p=this.entityTextSearchResultsOnCurrentPage();if(!p.length)return;const s=this._lastMatchIndex(),d=null===s?0:(s+1)%p.length;this._lastMatchIndex.set(d);const o=p[d].xywhStr.replace("percent:",""),[I,T,i,m]=o.split(",").map(Number),j=Math.max(0,I-.5),G=Math.max(0,T-.5),x=Math.min(100-j,i+1),N=Math.min(100-G,m+1);this.currentPlacementBbox.set({xywhStr:`percent:${j.toFixed(2)},${G.toFixed(2)},${x.toFixed(2)},${N.toFixed(2)}`,color:"rgba(255, 160, 0, 0.9)",allowRemove:!1})}setManualBbox(p){this._lastMatchIndex.set(null),this.currentPlacementBbox.set({...p,allowRemove:!1})}clearPlacement(){this.currentPlacementBbox.set(null),this._lastMatchIndex.set(null)}constructor(){(0,a.QZP)(()=>{const p=this.entityBeingPlaced(),s=this.activePdfDoc();p?.value&&s?this.searchService.searchAll(s,p.value).then(d=>{this.entityTextSearchResults.set(d)}):this.entityTextSearchResults.set([])}),(0,a.QZP)(()=>{this.currentPage(),this._lastMatchIndex.set(null),this.currentPlacementBbox.set(null)}),(0,a.QZP)(()=>{const p=this.entityBeingPlaced();this._lastMatchIndex.set(null),void 0===p&&this.currentPlacementBbox.set(null)})}static \u0275fac=function(s){return new(s||r)};static \u0275prov=a.jDH({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();var S=n(9352);const O=["viewerTarget"];function L(r,$){if(1&r){const p=u.RV6();u.j41(0,"cue-flexcontainer",2)(1,"cue-typography"),u.EFF(2),u.nI1(3,"transloco"),u.k0s(),u.j41(4,"cue-button",3),u.bIt("click",function(){a.eBV(p);const d=u.XpG();return a.Njj(d.downloadFile())}),u.j41(5,"cue-button-padder"),u.nrm(6,"cue-button-icon",4),u.k0s(),u.j41(7,"cue-button-label"),u.EFF(8),u.nI1(9,"transloco"),u.k0s()()()}2&r&&(u.R7$(2),u.JRh(u.bMT(3,2,"components.documentViewer.infoNoViewer")),u.R7$(6),u.JRh(u.bMT(9,4,"common.buttons.download")))}let b=(()=>{class r{_eps=(0,a.WQX)(P);_destroyed=!1;url=t.hFB.required();pdfBytes=(0,t.hFB)(void 0);suffix=(0,t.hFB)();settings=(0,t.hFB)(new h.DocumentViewerSettings);viewerTypeOverride=(0,t.hFB)(void 0);interactions=(0,t.CGW)();viewerType=(0,R.EW)(()=>{const p=this.viewerTypeOverride();if(p)return p;const s=this.url(),d=void 0!==this.suffix()?this.suffix()?.trim():`.${s.split(".").pop()?.trim()}`,o=d?D.get(d):void 0;return console.log("[DocumentViewer] viewerType resolved",{url:s?.substring(0,80),suffix:d,viewerType:o}),void 0!==d?o:void 0});currentComponent=(0,a.vPA)(null);noViewer=(0,R.EW)(()=>null===this.currentComponent());isLoading=(0,a.vPA)(!1);viewerTarget;currentRef;_interactionsState=(0,a.vPA)(new h.DocumentViewerInteractions);constructor(){(0,a.QZP)(()=>{const p=this.viewerType(),s=this.url();console.log("[DocumentViewer] url/viewerType effect \u2014",{viewerType:p,url:s?.substring(0,80),destroyed:this._destroyed}),p?("pdf"!==p&&this._eps.activePdfDoc.set(null),this.isLoading.set(!0),this.loadViewerComponent(p,s,this.settings())):(this.viewerTarget.clear(),this.currentRef?.destroy(),this.currentRef=void 0,console.info("No viewer available for this file type"),this.currentComponent.set(null),this.isLoading.set(!1),this._eps.activePdfDoc.set(null))}),(0,a.QZP)(()=>{this.interactions.emit(this._interactionsState())}),(0,a.QZP)(()=>{const p=this.settings().pdf,s=this.currentRef;s&&s.setInput("settings",p)})}ngOnDestroy(){this._destroyed=!0,this.viewerTarget.clear(),this.currentRef?.destroy(),this.currentRef=void 0}loadViewerComponent(p,s,d){var o=this;return(0,f.A)(function*(){console.log("[DocumentViewer] loadViewerComponent",{viewerType:p,url:s?.substring(0,100)});try{const I=g[p],T=yield I();if(o._destroyed)return;if(o.currentComponent.set(T),o.isLoading.set(!1),o.viewerTarget.clear(),o.currentRef?.destroy(),o.currentRef=o.viewerTarget.createComponent(T),"pdf"===p)o.currentRef.setInput("src",o.pdfBytes()??s),void 0!==d?.pdf&&o.currentRef.setInput("settings",d.pdf),o.currentRef.instance.pdfLoaded&&o.currentRef.instance.pdfLoaded.subscribe(i=>{o._eps.currentPage.set(1),o._eps.activePdfDoc.set(i)}),o.currentRef.instance.settingsChange&&o.currentRef.instance.settingsChange.subscribe(i=>{const m=parseInt(i?.page,10);!isNaN(m)&&m>0&&o._eps.currentPage.set(m)}),o.currentRef.instance.artefactDrawn&&o.currentRef.instance.artefactDrawn.subscribe(i=>{"xywh"===i.type&&o._eps.setManualBbox(i.def)}),o.currentRef.instance.artefactEdited&&o.currentRef.instance.artefactEdited.subscribe(i=>{"bbox"===i.type&&o._eps.setManualBbox(i.after)});else if("bim"===p){const i=new A.di("model","Model",s,!0,o.pdfBytes());i.visible=!0,o.currentRef.setInput("data",{models:[i]}),void 0!==d?.bim&&o.currentRef.setInput("settings",d.bim),o.currentRef.instance.selectedElements&&o.currentRef.instance.selectedElements.subscribe(m=>{o._interactionsState.update(l=>(l.bim.selectedElements=m,Object.assign({},l)))}),o.currentRef.instance.clickedElement&&o.currentRef.instance.clickedElement.subscribe(m=>{o._interactionsState.update(l=>(l.bim.clickedElement=m,Object.assign({},l)))})}else if("cad"===p)o.currentRef.setInput("fileURL",s),void 0!==d?.cad&&o.currentRef.setInput("settings",d.cad);else if("image"===p)o.currentRef.setInput("src",s);else if("markdown"===p)o.currentRef.setInput("fileURL",s);else if("text"===p)o.currentRef.setInput("fileURL",s);else if("spreadsheet"===p){const i=o.suffix()?.split(".").pop()||s.split(".").pop()||"csv";o.currentRef.setInput("data",{url:s,format:i})}else if("code"===p){const l={".json":"json",".jsonld":"jsonld",".xml":"xml",".html":"xml",".htm":"xml",".css":"text",".js":"text",".sh":"text"}[o.suffix()??`.${s.split(".").pop()??""}`]??"text";o.currentRef.setInput("fileURL",s),o.currentRef.setInput("codeType",l)}else"email"===p&&o.currentRef.setInput("fileURL",s)}catch(I){console.error("Failed to load viewer component:",I),o.currentComponent.set(null)}})()}downloadFile(){var p=this;return(0,f.A)(function*(){const d=yield(yield fetch(p.url())).blob();(0,E.KE)(d,`document${p.suffix()??""}`)})()}static \u0275fac=function(s){return new(s||r)};static \u0275cmp=u.VBU({type:r,selectors:[["cue-doc-viewer"]],viewQuery:function(s,d){if(1&s&&u.GBs(O,7,u.c1b),2&s){let o;u.mGM(o=u.lsd())&&(d.viewerTarget=o.first)}},inputs:{url:[1,"url"],pdfBytes:[1,"pdfBytes"],suffix:[1,"suffix"],settings:[1,"settings"],viewerTypeOverride:[1,"viewerTypeOverride"]},outputs:{interactions:"interactions"},decls:4,vars:2,consts:[["viewerTarget",""],[2,"height","100%","width","100%",3,"cueLogoLoader"],["direction","column","align","center","justify","center",2,"height","100%","width","100%"],[3,"click"],["icon","download"]],template:function(s,d){1&s&&(u.j41(0,"cue-container",1),u.eu8(1,null,0),u.nVh(3,L,10,6,"cue-flexcontainer",2),u.k0s()),2&s&&(u.Y8G("cueLogoLoader",d.isLoading()),u.R7$(3),u.vxM(!d.isLoading()&&d.noViewer()?3:-1))},dependencies:[e.MD,w,H.Typography,X.FlexContainer,J.Button,U.ButtonIcon,B.ButtonLabel,y.ButtonPadder,W.k,S.Kj],styles:["[_nghost-%COMP%]{display:contents}"],changeDetection:0})}return r})()},3191(V,M,n){n.d(M,{g:()=>a});var f=n(467),e=n(5802);let a=(()=>{class t{searchPage(u,h,c){return(0,f.A)(function*(){if(!c||!c.trim())return[];const g=c.toLowerCase(),D=yield u.getPage(h),A=D.getViewport({scale:1}),C=(yield D.getTextContent()).items,w=[];let H="";const X=[],J=[];for(let y=0;y<C.length;y++){const v=C[y].str??"";for(let P=0;P<v.length;P++)H+=v[P],X.push(y),J.push(P)}const U=H.toLowerCase();let B=0;for(;B<U.length;){const y=U.indexOf(g,B);if(-1===y)break;const W=y+g.length-1;B=y+1;const v=new Set;for(let T=y;T<=W;T++)v.add(X[T]);let P=1/0,S=1/0,O=-1/0,L=-1/0;for(const T of v){const i=C[T],[m,l,j,G,x,N]=i.transform,K=i.width??0,z=i.height??Math.abs(m||G||12),Z=Math.sqrt(m*m+l*l)||1,Q=m/Z,Y=l/Z,k=j/Z,q=G/Z,fe=[[x,N],[x+Q*K,N+Y*K],[x+Q*K+k*z,N+Y*K+q*z],[x+k*z,N+q*z]];for(const[ne,pe]of fe){const[F,_]=A.convertToViewportPoint(ne,pe);P=Math.min(P,F),S=Math.min(S,_),O=Math.max(O,F),L=Math.max(L,_)}}const b=A.width,r=A.height,$=.005*b,p=.005*r,d=(S-p)/r*100,o=(O-P+2*$)/b*100,I=(L-S+2*p)/r*100;o>0&&I>0&&w.push({page:h,xywhStr:`percent:${((P-$)/b*100).toFixed(2)},${d.toFixed(2)},${o.toFixed(2)},${I.toFixed(2)}`})}return w})()}searchAll(u,h){var c=this;return(0,f.A)(function*(){if(!h||!h.trim())return[];const g=u.numPages,D=[];for(let A=1;A<=g;A++){const E=yield c.searchPage(u,A,h);D.push(...E)}return D})()}static \u0275fac=function(h){return new(h||t)};static \u0275prov=e.jDH({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})()},6114(V,M,n){n.d(M,{N:()=>e,V:()=>a});var f=n(4820),e=function(t){return t.AAC=".aac",t.ABW=".abw",t.ARC=".arc",t.AVIF=".avif",t.AVI=".avi",t.APNG=".apng",t.BAK=".bak",t.BIN=".bin",t.BMC=".bmc",t.BMP=".bmp",t.BZ=".bz",t.BZ2=".bz2",t.C3D=".c3d",t.CPG=".cpg",t.CSS=".css",t.CSV=".csv",t.DAT=".dat",t.DOC=".doc",t.DOCX=".docx",t.E57=".e57",t.EPUB=".epub",t.EXE=".exe",t.FFS=".ffs",t.FME=".fme",t.FMW=".fmw",t.FRAG=".fragments",t.GH=".gh",t.GZ=".gz",t.GIF=".gif",t.HTML=".html",t.HTM=".htm",t.ICO=".ico",t.ICS=".ics",t.JAR=".jar",t.JPG=".jpg",t.JPEG=".jpeg",t.JSON=".json",t.JSONLD=".jsonld",t.JS=".js",t.MOV=".mov",t.MP3=".mp3",t.MP4=".mp4",t.MPEG=".mpeg",t.MSI=".msi",t.MTL=".mtl",t.ODP=".odp",t.ODS=".ods",t.ODT=".odt",t.OGA=".oga",t.OGG=".ogg",t.OGV=".ogv",t.OGX=".ogx",t.OTF=".otf",t.PNG=".png",t.PDF=".pdf",t.PHP=".php",t.PKG=".pkg",t.PPT=".ppt",t.PPTX=".pptx",t.PS=".ps",t.RAR=".rar",t.RCP=".rcp",t.RTF=".rtf",t.SH=".sh",t.SLK=".slk",t.SVG=".svg",t.TAR=".tar",t.TIFF=".tiff",t.TIF=".tif",t.TTF=".ttf",t.TXT=".txt",t.VGL=".vgl",t.VWX=".vwx",t.WAV=".wav",t.WEBM=".webm",t.WEBP=".webp",t.WMV=".wmv",t.WOFF=".woff",t.WOFF2=".woff2",t.XLS=".xls",t.XLSX=".xlsx",t.XHTML=".xhtml",t.XML=".xml",t.XYZ=".xyz",t.ZIP=".zip",t.SEVEN_Z=".7z",t.DBF=".dbf",t.EML=".eml",t.EMLX=".emlx",t.MBX=".mbx",t.MD=".md",t.MSG=".msg",t.RST=".rst",t.HEIC=".heic",t.MPP=".mpp",t.TSV=".tsv",t.B3DM=".b3dm",t.I3DM=".i3dm",t.PNTS=".pnts",t.CMPT=".cmpt",t.GLTF=".gltf",t.GLB=".glb",t.IFC=".ifc",t.IFCZIP=".ifczip",t.IFXML=".ifcxml",t.THREEDM=".3dm",t.THREEDS=".3ds",t.GHP=".ghp",t.RVT=".rvt",t.RFA=".rfa",t.RFT=".rft",t.RTE=".rte",t.PLA=".pla",t.PLN=".pln",t.GSM=".gsm",t.SMC=".smc",t.BCF=".bcf",t.DWG=".dwg",t.DWL=".dwl",t.DXF=".dxf",t.DGN=".dgn",t.NWD=".nwd",t.OBJ=".obj",t.C4D=".c4d",t.TEKLASTRUCTURES=".teklastructures",t.PTS=".pts",t.LAS=".las",t.LAZ=".laz",t.USDZ=".usdz",t.USDA=".usda",t.USDC=".usdc",t.USD=".usd",t.PSD=".psd",t.PSP=".psp",t.AI=".ai",t.SBN=".sbn",t.SBX=".sbx",t.SHX=".shx",t.SKP=".skp",t.STL=".stl",t.FBX=".fbx",t.KML=".kml",t.SHP=".shp",t}(e||{});const a={[e.AAC]:{type:f.p.AUDIO,open:!0,suffix:".aac"},[e.ABW]:{type:f.p.TEXT,open:!0,suffix:".abw"},[e.ARC]:{type:f.p.ARCHIVE,open:!1,suffix:".arc"},[e.AVIF]:{type:f.p.IMAGE,open:!0,suffix:".avif"},[e.AVI]:{type:f.p.VIDEO,open:!0,suffix:".avi"},[e.APNG]:{type:f.p.IMAGE,open:!0,suffix:".apng"},[e.BAK]:{type:f.p.BACKUP,open:!1,suffix:".bak"},[e.BIN]:{type:f.p.BINARY,open:!1,suffix:".bin"},[e.BMC]:{type:f.p.BIM,open:!1,suffix:".bmc"},[e.BMP]:{type:f.p.IMAGE,open:!0,suffix:".bmp"},[e.BZ]:{type:f.p.ARCHIVE,open:!0,suffix:".bz"},[e.BZ2]:{type:f.p.ARCHIVE,open:!0,suffix:".bz2"},[e.C3D]:{type:f.p.THREE_D,open:!0,suffix:".c3d"},[e.CPG]:{type:f.p.GEOSPATIAL,open:!0,suffix:".cpg"},[e.CSS]:{type:f.p.MARKUP,open:!0,suffix:".css"},[e.CSV]:{type:f.p.DATA,open:!0,suffix:".csv"},[e.DAT]:{type:f.p.DATA,open:!1,suffix:".dat"},[e.DBF]:{type:f.p.DATA,open:!0,suffix:".dbf"},[e.DOC]:{type:f.p.TEXT,open:!1,suffix:".doc"},[e.DOCX]:{type:f.p.TEXT,open:!0,suffix:".docx"},[e.E57]:{type:f.p.THREE_D,open:!0,suffix:".e57"},[e.EPUB]:{type:f.p.TEXT,open:!0,suffix:".epub"},[e.EXE]:{type:f.p.INSTALLER,open:!1,suffix:".exe"},[e.FFS]:{type:f.p.AUTOMATION,open:!1,suffix:".ffs"},[e.FME]:{type:f.p.AUTOMATION,open:!1,suffix:".fme"},[e.FMW]:{type:f.p.AUTOMATION,open:!1,suffix:".fmw"},[e.FRAG]:{type:f.p.BIM,open:!0,suffix:".fragments"},[e.GH]:{type:f.p.THREE_D,open:!1,suffix:".gh"},[e.GZ]:{type:f.p.ARCHIVE,open:!0,suffix:".gz"},[e.GIF]:{type:f.p.IMAGE,open:!0,suffix:".gif"},[e.HTML]:{type:f.p.MARKUP,open:!0,suffix:".html"},[e.HTM]:{type:f.p.MARKUP,open:!0,suffix:".htm"},[e.ICO]:{type:f.p.IMAGE,open:!1,suffix:".ico"},[e.ICS]:{type:f.p.DATA,open:!0,suffix:".ics"},[e.JAR]:{type:f.p.ARCHIVE,open:!0,suffix:".jar"},[e.JPG]:{type:f.p.IMAGE,open:!0,suffix:".jpg"},[e.JPEG]:{type:f.p.IMAGE,open:!0,suffix:".jpeg"},[e.JSON]:{type:f.p.DATA,open:!0,suffix:".json"},[e.JSONLD]:{type:f.p.DATA,open:!0,suffix:".jsonld"},[e.JS]:{type:f.p.SCRIPT,open:!0,suffix:".js"},[e.MSI]:{type:f.p.INSTALLER,open:!1,suffix:".msi"},[e.MOV]:{type:f.p.VIDEO,open:!0,suffix:".mov"},[e.MP3]:{type:f.p.AUDIO,open:!0,suffix:".mp3"},[e.MP4]:{type:f.p.VIDEO,open:!0,suffix:".mp4"},[e.MPEG]:{type:f.p.VIDEO,open:!0,suffix:".mpeg"},[e.MTL]:{type:f.p.THREE_D,open:!0,suffix:".mtl"},[e.ODP]:{type:f.p.PRESENTATION,open:!0,suffix:".odp"},[e.ODS]:{type:f.p.SPREADSHEET,open:!0,suffix:".ods"},[e.ODT]:{type:f.p.TEXT,open:!0,suffix:".odt"},[e.OGA]:{type:f.p.AUDIO,open:!0,suffix:".oga"},[e.OGG]:{type:f.p.AUDIO,open:!0,suffix:".ogg"},[e.OGV]:{type:f.p.VIDEO,open:!0,suffix:".ogv"},[e.OGX]:{type:f.p.VIDEO,open:!0,suffix:".ogx"},[e.OTF]:{type:f.p.FONT,open:!0,suffix:".otf"},[e.PNG]:{type:f.p.IMAGE,open:!0,suffix:".png"},[e.PDF]:{type:f.p.TEXT,open:!0,suffix:".pdf"},[e.PHP]:{type:f.p.SCRIPT,open:!0,suffix:".php"},[e.PKG]:{type:f.p.INSTALLER,open:!1,suffix:".pkg"},[e.PPT]:{type:f.p.PRESENTATION,open:!1,suffix:".ppt"},[e.PPTX]:{type:f.p.PRESENTATION,open:!0,suffix:".pptx"},[e.PS]:{type:f.p.IMAGE,open:!1,suffix:".ps"},[e.RAR]:{type:f.p.ARCHIVE,open:!1,suffix:".rar"},[e.RCP]:{type:f.p.THREE_D,open:!1,suffix:".rcp"},[e.RTF]:{type:f.p.TEXT,open:!0,suffix:".rtf"},[e.SBN]:{type:f.p.GEOSPATIAL,open:!1,suffix:".sbn"},[e.SBX]:{type:f.p.GEOSPATIAL,open:!1,suffix:".sbx"},[e.SHX]:{type:f.p.GEOSPATIAL,open:!0,suffix:".shx"},[e.SH]:{type:f.p.SCRIPT,open:!0,suffix:".sh"},[e.SLK]:{type:f.p.DATA,open:!0,suffix:".slk"},[e.SVG]:{type:f.p.IMAGE,open:!0,suffix:".svg"},[e.TAR]:{type:f.p.ARCHIVE,open:!0,suffix:".tar"},[e.TIFF]:{type:f.p.IMAGE,open:!0,suffix:".tiff"},[e.TIF]:{type:f.p.IMAGE,open:!0,suffix:".tif"},[e.TTF]:{type:f.p.FONT,open:!0,suffix:".ttf"},[e.TXT]:{type:f.p.TEXT,open:!0,suffix:".txt"},[e.VGL]:{type:f.p.THREE_D,open:!1,suffix:".vgl"},[e.VWX]:{type:f.p.CAD,open:!1,suffix:".vwx"},[e.WAV]:{type:f.p.AUDIO,open:!0,suffix:".wav"},[e.WEBM]:{type:f.p.VIDEO,open:!0,suffix:".webm"},[e.WEBP]:{type:f.p.IMAGE,open:!0,suffix:".webp"},[e.WMV]:{type:f.p.VIDEO,open:!0,suffix:".wmv"},[e.WOFF]:{type:f.p.FONT,open:!0,suffix:".woff"},[e.WOFF2]:{type:f.p.FONT,open:!0,suffix:".woff2"},[e.XLS]:{type:f.p.SPREADSHEET,open:!1,suffix:".xls"},[e.XLSX]:{type:f.p.SPREADSHEET,open:!0,suffix:".xlsx"},[e.XHTML]:{type:f.p.MARKUP,open:!0,suffix:".xhtml"},[e.XML]:{type:f.p.DATA,open:!0,suffix:".xml"},[e.XYZ]:{type:f.p.THREE_D,open:!0,suffix:".xyz"},[e.ZIP]:{type:f.p.ARCHIVE,open:!0,suffix:".zip"},[e.SEVEN_Z]:{type:f.p.ARCHIVE,open:!0,suffix:".7z"},[e.EML]:{type:f.p.EMAIL,open:!0,suffix:".eml"},[e.EMLX]:{type:f.p.EMAIL,open:!0,suffix:".emlx"},[e.MBX]:{type:f.p.EMAIL,open:!0,suffix:".mbx"},[e.MD]:{type:f.p.TEXT,open:!0,suffix:".md"},[e.MSG]:{type:f.p.EMAIL,open:!1,suffix:".msg"},[e.RST]:{type:f.p.TEXT,open:!0,suffix:".rst"},[e.HEIC]:{type:f.p.IMAGE,open:!1,suffix:".heic"},[e.MPP]:{type:f.p.PLANNING,open:!1,suffix:".mpp"},[e.TSV]:{type:f.p.DATA,open:!0,suffix:".tsv"},[e.B3DM]:{type:f.p.THREE_D,open:!0,suffix:".b3dm"},[e.I3DM]:{type:f.p.THREE_D,open:!0,suffix:".i3dm"},[e.PNTS]:{type:f.p.THREE_D,open:!1,suffix:".pnts"},[e.CMPT]:{type:f.p.THREE_D,open:!1,suffix:".cmpt"},[e.GLTF]:{type:f.p.THREE_D,open:!0,suffix:".gltf"},[e.GLB]:{type:f.p.THREE_D,open:!0,suffix:".glb"},[e.IFC]:{type:f.p.BIM,open:!0,suffix:".ifc"},[e.IFCZIP]:{type:f.p.BIM,open:!0,suffix:".ifczip"},[e.IFXML]:{type:f.p.BIM,open:!0,suffix:".ifcxml"},[e.THREEDM]:{type:f.p.CAD,open:!1,suffix:".3dm"},[e.THREEDS]:{type:f.p.THREE_D,open:!1,suffix:".3ds"},[e.GHP]:{type:f.p.CAD,open:!1,suffix:".ghp"},[e.RVT]:{type:f.p.BIM,open:!1,suffix:".rvt"},[e.RFA]:{type:f.p.BIM,open:!1,suffix:".rfa"},[e.RFT]:{type:f.p.BIM,open:!1,suffix:".rft"},[e.RTE]:{type:f.p.BIM,open:!1,suffix:".rte"},[e.PLA]:{type:f.p.BIM,open:!1,suffix:".pla"},[e.PLN]:{type:f.p.BIM,open:!1,suffix:".pln"},[e.GSM]:{type:f.p.BIM,open:!1,suffix:".gsm"},[e.SMC]:{type:f.p.BIM,open:!1,suffix:".smc"},[e.STL]:{type:f.p.THREE_D,open:!0,suffix:".stl"},[e.BCF]:{type:f.p.BIM,open:!0,suffix:".bcf"},[e.DWG]:{type:f.p.CAD,open:!1,suffix:".dwg"},[e.DWL]:{type:f.p.CAD,open:!1,suffix:".dwl"},[e.DXF]:{type:f.p.CAD,open:!0,suffix:".dxf"},[e.DGN]:{type:f.p.CAD,open:!1,suffix:".dgn"},[e.NWD]:{type:f.p.BIM,open:!1,suffix:".nwd"},[e.OBJ]:{type:f.p.THREE_D,open:!0,suffix:".obj"},[e.C4D]:{type:f.p.THREE_D,open:!1,suffix:".c4d"},[e.TEKLASTRUCTURES]:{type:f.p.BIM,open:!1,suffix:".teklastructures"},[e.PTS]:{type:f.p.THREE_D,open:!1,suffix:".pts"},[e.LAS]:{type:f.p.THREE_D,open:!0,suffix:".las"},[e.LAZ]:{type:f.p.THREE_D,open:!0,suffix:".laz"},[e.USDZ]:{type:f.p.THREE_D,open:!0,suffix:".usdz"},[e.USDA]:{type:f.p.THREE_D,open:!0,suffix:".usda"},[e.USDC]:{type:f.p.THREE_D,open:!0,suffix:".usdc"},[e.USD]:{type:f.p.THREE_D,open:!0,suffix:".usd"},[e.PSD]:{type:f.p.IMAGE,open:!1,suffix:".psd"},[e.PSP]:{type:f.p.IMAGE,open:!1,suffix:".psp"},[e.AI]:{type:f.p.IMAGE,open:!1,suffix:".ai"},[e.SKP]:{type:f.p.THREE_D,open:!1,suffix:".skp"},[e.FBX]:{type:f.p.THREE_D,open:!0,suffix:".fbx"},[e.KML]:{type:f.p.GEOSPATIAL,open:!0,suffix:".kml"},[e.SHP]:{type:f.p.GEOSPATIAL,open:!0,suffix:".shp"}}},4820(V,M,n){n.d(M,{p:()=>f});var f=function(e){return e.AUTOMATION="automation",e.ARCHIVE="archive",e.AUDIO="audio",e.BACKUP="backup",e.BINARY="binary",e.BIM="bim",e.CAD="cad",e.DATA="data",e.EMAIL="email",e.FONT="font",e.GEOSPATIAL="geospatial",e.IMAGE="image",e.INSTALLER="installer",e.MARKUP="markup",e.MULTIMEDIA="multimedia",e.PLANNING="planning",e.PRESENTATION="presentation",e.SCRIPT="script",e.SPREADSHEET="spreadsheet",e.TEXT="text",e.THREE_D="3d",e.UNKNOWN="unknown",e.VIDEO="video",e}(f||{})}}]);
|
package/3202.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[3202],{1625(S,F,r){r.d(F,{U:()=>W});var B=r(467),l=r(7705),g=r(2271),c=r(5381),I=r(1024),G=r(9421),x=r(5794),T=r(9352),R=r(6117),e=r(8547),N=r(3319),P=r(5971),_=r(7573),a=r(5547);function y(p,L){if(1&p&&(a.nrm(0,"cue-key-val",4),a.nI1(1,"transloco")),2&p){const h=a.XpG(2);a.Y8G("key",a.bMT(1,2,"components.entityInfo.labelValue"))("val",h.entity().value)}}function b(p,L){if(1&p&&(a.nrm(0,"cue-key-val-editable",5),a.nI1(1,"transloco"),a.nI1(2,"transloco")),2&p){const h=a.XpG(3);a.Y8G("key",1===h.entityCategories().length?a.bMT(1,4,"components.entityInfo.labelEntityCategory"):a.bMT(2,6,"components.entityInfo.labelEntityCategories"))("val",h.entityCategoriesString())("rdfConfig",h.rdfEditConfig())("editDisabled",!h.entityCategoriesEditable())}}function j(p,L){if(1&p&&(a.nrm(0,"hr"),a.nVh(1,b,3,8,"cue-key-val-editable",5)),2&p){const h=a.XpG(2);a.R7$(),a.vxM(h.entityCategories()&&h.entityCategories().length>0?1:-1)}}function w(p,L){if(1&p&&(a.j41(0,"cue-key-val-list"),a.nVh(1,y,2,4,"cue-key-val",4),a.nVh(2,j,2,1),a.k0s()),2&p){const h=a.XpG();a.R7$(),a.vxM(h.entity().value?1:-1),a.R7$(),a.vxM(h.collapsed()?-1:2)}}function O(p,L){if(1&p&&(a.j41(0,"cue-flexcontainer",3)(1,"cue-menu",6)(2,"cue-button",7,0),a.nrm(4,"cue-button-icon",8),a.k0s(),a.nrm(5,"cue-menu-nested",9),a.k0s()()),2&p){a.XpG();const h=a.r8f(3);a.R7$(5),a.Y8G("items",h)}}let W=(()=>{class p{entity=l.hFB.required();handlers=l.hFB.required();entityCategoriesEditable=(0,l.hFB)(!1);menuItems=(0,l.hFB)([]);availableEntityCategories=(0,l.hFB)([]);collapsed=(0,l.hFB)(!1);dataChanged=(0,l.CGW)();_entityCategories=(0,g.uu)(()=>this.entity()?.categories||[]);entityCategories=(0,g.EW)(()=>this._entityCategories());entityCategoriesString=(0,g.EW)(()=>this._entityCategories().map(h=>this._iriToString(h)).sort().join(", "));infoChangeEntityCategory=(0,T.Xx)("components.entityInfo.infoChangeEntityCategory");rdfEditConfig=(0,g.EW)(()=>{var h=this;const D=this.handlers()?.requestRDFChange;var v;if(void 0!==D)return{message:this.infoChangeEntityCategory(),existingValue:this._entityCategories(),dataType:"multiselect",options:this.availableEntityCategories()?.map(v=>v.iri),optionLabelMap:this.availableEntityCategories()?.reduce((v,f)=>(v[f.iri]=f.label,v),{}),requestSave:(v=(0,B.A)(function*(f){console.log(f);const V={subject:h.entity()?.iri,predicate:`${_.E.qcy}entityCategory`,objects:h._entityCategories(),newObjects:f.newValue,type:"entityCategory",comment:f.comment};yield D(V),h._entityCategories.set(f.newValue),h.dataChanged.emit({entityCategories:f.newValue})}),function(V){return v.apply(this,arguments)})};console.warn("No RDF change request handler defined")});_iriToString(h){const D=this.availableEntityCategories()?.find(v=>v.iri===h);return D?D.label:h}static \u0275fac=function(D){return new(D||p)};static \u0275cmp=a.VBU({type:p,selectors:[["cue-entity-info"]],inputs:{entity:[1,"entity"],handlers:[1,"handlers"],entityCategoriesEditable:[1,"entityCategoriesEditable"],menuItems:[1,"menuItems"],availableEntityCategories:[1,"availableEntityCategories"],collapsed:[1,"collapsed"]},outputs:{dataChanged:"dataChanged"},decls:5,vars:3,consts:[["trigger",""],["direction","row",2,"min-height","50px"],["direction","column",2,"flex","1 1"],["direction","column",2,"width","50px"],["size","l",3,"key","val"],["size","s",3,"key","val","rdfConfig","editDisabled"],["positioning","bottomleft"],["trigger","","variant","tertiary"],["icon","more-vert"],["menu","",3,"items"]],template:function(D,v){if(1&D&&(a.j41(0,"cue-flexcontainer",1)(1,"cue-flexcontainer",2),a.nVh(2,w,3,2,"cue-key-val-list"),a.k0s(),a.SS7(3),a.nVh(4,O,6,1,"cue-flexcontainer",3),a.k0s()),2&D){a.R7$(2),a.vxM(v.entity()?2:-1),a.R7$();const f=a.bH3(v.menuItems());a.R7$(),a.vxM(void 0!==f&&f.length>0?4:-1)}},dependencies:[c.FlexContainer,I.p,G.F,x.L,R.W,e.T,N.ButtonIcon,P.Button,T.Kj],encapsulation:2,changeDetection:0})}return p})()},6103(S,F,r){r.d(F,{N:()=>c});var B=r(2306),l=r(140),g=r(58);function c({entityData:I,availableEntityRelationships:G}){const x=_=>G.find(a=>a.iri===_)?.label??_.split("#").pop()??_,T=[],R={};for(const[_,a]of Object.entries(I)){for(const y of a.directMapGeometries??[])T.push({iri:_,wkt:y.wkt});for(const y of a.indirectMapGeometries??[]){R[y.rel]||(R[y.rel]=[]);for(const b of y.geometries)R[y.rel].push({iri:y.entityUUID,wkt:b.wkt})}}const e=(_,a,y)=>{if(!a.length)return null;const b=new B.ux(_,_);return b.category=y,b.collection=new l.o(a.flatMap(({iri:j,wkt:w})=>{const O=(0,g.S)(w);return O?[{type:"Feature",geometry:(0,g.n)(O),properties:{iri:j}}]:[]})),b},N=[],P=e("direct",T,"Direct");P&&N.push(P);for(const[_,a]of Object.entries(R)){const y=x(_),b=e(y,a,y);b&&N.push(b)}return N}},3202(S,F,r){r.d(F,{CueEntityViewer:()=>oe});var B=r(467),l=r(7705),g=r(2271),c=r(5802),I=r(8645),G=r(9769),x=r(9352),T=r(1625),R=r(3656),e=r(5547),N=r(9937),P=r(7573),_=r(4284);function a(i,m){if(1&i){const t=e.RV6();e.j41(0,"cue-rdf-graph",1),e.bIt("nodeHover",function(s){c.eBV(t);const o=e.XpG(2);return c.Njj(o.hoveredNode.set(s))}),e.k0s()}if(2&i){const t=e.XpG(),n=e.XpG();e.Y8G("doc",t)("collapseClasses",!0)("collapseAttributes",!0)("collapseRelationships",!0)("colorByCategory",!1)("categoryLabelsOnHover",!0)("showRelationshipLegend",!0)("legendPosition",n.legendPosition())("nodeMenuItems",n.nodeMenuItems())("focusNodes",n.focusNodes())("focusNodeColor",n.focusNodeColor())("zoomToFocusNodes",!1)}}function y(i,m){if(1&i&&e.nVh(0,a,1,12,"cue-rdf-graph",0),2&i){const t=e.XpG();e.vxM(t._containerReady()?0:-1)}}let b=(()=>{class i{entity=l.hFB.required();availableEntityCategories=l.hFB.required();availableEntityRelationships=(0,l.hFB)([]);relationships=(0,l.hFB)(void 0);legendPosition=(0,l.hFB)("top-left");showOpenEntityMenuItem=(0,l.hFB)(!0);clickedOpenEntity=(0,l.CGW)();doc=(0,c.vPA)(void 0);_containerReady=(0,c.vPA)(!1);_hostElement=(0,c.WQX)(e.aKT);_resolvedEntityIRI=(0,g.EW)(()=>{const t=this.entity()?.iri;if(t){if(!t.includes("://"))throw new Error(`Expected a full IRI but got: ${t}`);return t}});focusNodes=(0,g.EW)(()=>{const t=this._resolvedEntityIRI();return t?[t]:[]});focusNodeColor=(0,c.vPA)("green");_document=(0,c.WQX)(c.qQL);hoveredNode=(0,c.vPA)(void 0);labelOpenEntity=(0,x.Xx)("components.graph.entityGraph.labelOpenEntity");nodeMenuItems=(0,g.EW)(()=>{const t=[];return this.showOpenEntityMenuItem()&&this.hoveredNode()?.id!==this._resolvedEntityIRI()&&t.push({id:"open",label:this.labelOpenEntity(),action:n=>this.clickedOpenEntity.emit(n.id)}),t});constructor(){(0,e.mal)(()=>{const t=getComputedStyle(this._document.documentElement).getPropertyValue("--cue-color-green").trim();t&&this.focusNodeColor.set(t)}),(0,c.QZP)(()=>{const t=this.entity()?.iri,n=this.relationships();void 0===t||void 0===n||this._buildDoc(n)}),(0,e.mal)(()=>{if(this._containerReady())return;const t=this._hostElement.nativeElement,n=new ResizeObserver(s=>{if(this._containerReady())return void n.disconnect();const o=s[0]?.contentRect;o&&o.width>=100&&o.height>=100&&(this._containerReady.set(!0),n.disconnect())});return n.observe(t),()=>n.disconnect()})}ngAfterViewInit(){const t=this._hostElement.nativeElement;t.clientWidth>=100&&t.clientHeight>=100&&this._containerReady.set(!0)}_buildDoc(t){const{incoming:n,outgoing:s}=t,o={"@context":{qcy:`${P.E.qcy}`,"qcy-e":`${P.E["qcy-e"]}`,skos:`${_.B.skos}`},"@graph":[]},d=this._resolvedEntityIRI(),C={"@id":d,"qcy:value":this.entity()?.value,"@type":this.entity()?.categories};o["@graph"].push(C),s.forEach(u=>{o["@graph"].push({"@id":u.nodeIRI,"qcy:value":u.nodeValue,"@type":u.nodeCategories}),o["@graph"].push({"@id":d,[u.relIRI]:{"@id":u.nodeIRI}})}),n.forEach(u=>{o["@graph"].push({"@id":u.nodeIRI,"qcy:value":u.nodeValue,"@type":u.nodeCategories}),o["@graph"].push({"@id":u.nodeIRI,[u.relIRI]:{"@id":d}})});const M=new Set;n.forEach(u=>u.nodeCategories.forEach(E=>M.add(E))),s.forEach(u=>u.nodeCategories.forEach(E=>M.add(E))),this.entity()?.categories.forEach(u=>M.add(u)),M.forEach(u=>{const E=this.availableEntityCategories().find($=>$.iri===u)?.label;void 0!==E&&o["@graph"].push({"@id":u,"skos:prefLabel":E})}),new Set(n.map(u=>u.relIRI).concat(s.map(u=>u.relIRI))).forEach(u=>{const E=this.availableEntityRelationships().find($=>$.iri===u)?.label;void 0!==E&&o["@graph"].push({"@id":u,"skos:prefLabel":E})}),this.doc.update(()=>o)}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=e.VBU({type:i,selectors:[["cue-entity-graph"]],inputs:{entity:[1,"entity"],availableEntityCategories:[1,"availableEntityCategories"],availableEntityRelationships:[1,"availableEntityRelationships"],relationships:[1,"relationships"],legendPosition:[1,"legendPosition"],showOpenEntityMenuItem:[1,"showOpenEntityMenuItem"]},outputs:{clickedOpenEntity:"clickedOpenEntity"},decls:1,vars:1,consts:[[3,"doc","collapseClasses","collapseAttributes","collapseRelationships","colorByCategory","categoryLabelsOnHover","showRelationshipLegend","legendPosition","nodeMenuItems","focusNodes","focusNodeColor","zoomToFocusNodes"],[3,"nodeHover","doc","collapseClasses","collapseAttributes","collapseRelationships","colorByCategory","categoryLabelsOnHover","showRelationshipLegend","legendPosition","nodeMenuItems","focusNodes","focusNodeColor","zoomToFocusNodes"]],template:function(n,s){if(1&n&&e.nVh(0,y,1,1),2&n){let o;e.vxM((o=s.doc())?0:-1,o)}},dependencies:[N.t],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;min-height:400px;min-width:100px}"]})}return i})();var j=r(8017),w=r(2306),O=r(6103),W=r(6455),p=r(8334),L=r(2245),h=r(7851);function D(i,m){1&i&&(e.j41(0,"cue-typography",2),e.EFF(1),e.nI1(2,"transloco"),e.k0s()),2&i&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"components.entityData.infoNoData")," "))}function v(i,m){if(1&i&&(e.j41(0,"div",0),e.nVh(1,D,3,3,"cue-typography",2),e.k0s()),2&i){e.XpG();const t=e.r8f(6);e.Y8G("cueLogoLoader",t),e.R7$(),e.vxM(t?-1:1)}}function f(i,m){if(1&i){const t=e.RV6();e.j41(0,"cue-tab",3),e.nI1(1,"transloco"),e.j41(2,"cue-entity-graph",5),e.bIt("clickedOpenEntity",function(s){let o;c.eBV(t);const d=e.XpG(2);return d.clickedOpenEntity.emit(s),c.Njj(null==(o=d.handlers())||null==o.openEntity?null:o.openEntity(s))}),e.k0s()()}if(2&i){e.XpG();const t=e.r8f(1),n=e.XpG(),s=e.r8f(0);e.Y8G("label",e.bMT(1,5,"components.entityData.titleEntityGraph")),e.R7$(2),e.Y8G("entity",t)("availableEntityCategories",n.availableEntityCategories())("availableEntityRelationships",n.availableEntityRelationships())("relationships",s)}}function V(i,m){if(1&i){const t=e.RV6();e.j41(0,"cue-tab",4),e.nI1(1,"transloco"),e.j41(2,"cue-doc-list",6),e.bIt("clickedDocument",function(s){c.eBV(t);const o=e.XpG(2);return c.Njj(o.clickedDocument.emit(s))}),e.k0s()()}if(2&i){const t=e.XpG(2);e.Y8G("label",e.bMT(1,4,"components.entityData.titleRelatedDocuments")),e.R7$(2),e.Y8G("documentRefs",t.documentRefs())("handlers",t.internalDocumentListHandlers())("documentData",t.documentData())}}function X(i,m){if(1&i){const t=e.RV6();e.j41(0,"cue-tab",4),e.nI1(1,"transloco"),e.j41(2,"div",7)(3,"cue-map",8),e.bIt("clickedFeature",function(s){c.eBV(t);const o=e.XpG(2);return c.Njj(o.mapFeatureClicked.emit(s))}),e.k0s()()()}if(2&i){e.XpG(2);const t=e.r8f(3),n=e.r8f(4);e.Y8G("label",e.bMT(1,3,"components.entityData.titleMap")),e.R7$(3),e.Y8G("layers",t)("settings",n)}}function U(i,m){if(1&i&&(e.j41(0,"cue-tabs",1),e.SS7(1),e.nVh(2,f,3,7,"cue-tab",3),e.nVh(3,V,3,6,"cue-tab",4),e.nVh(4,X,4,5,"cue-tab",4),e.k0s()),2&i){const t=e.XpG(),n=e.r8f(1),s=e.r8f(2),o=e.r8f(5);e.Y8G("variant",t.variant()),e.R7$();const d=e.bH3(t.entity());e.R7$(),e.vxM(n&&d?2:-1),e.R7$(),e.vxM(s?3:-1),e.R7$(),e.vxM(o?4:-1)}}let H=(()=>{class i{iri=l.hFB.required();availableEntityCategories=l.hFB.required();availableEntityRelationships=(0,l.hFB)([]);mapboxToken=l.hFB.required();handlers=(0,l.hFB)(void 0);variant=(0,l.hFB)("none");clickedOpenEntity=(0,l.CGW)();clickedDocument=(0,l.CGW)();mapFeatureClicked=(0,l.CGW)();relationshipData=(0,l.hFB)(void 0);documentRefs=(0,l.hFB)([]);documentData=(0,l.hFB)({});entityDetailedData=(0,l.hFB)(void 0);_fetchedIRIs=new Set;_mapLayers=(0,c.vPA)([]);_isLoading=(0,c.vPA)(!1);mapSettings=(0,g.EW)(()=>{const t=this.mapboxToken();if(t)return{...new w.yY,mapboxToken:t}});mapLayers=this._mapLayers.asReadonly();isEntityLoading=this._isLoading.asReadonly();entity=(0,g.EW)(()=>{const t=this.entityDetailedData();return t?{iri:this.iri(),value:t.value,categories:t.categories}:void 0});internalDocumentListHandlers=(0,g.EW)(()=>{const t=this.handlers();return{requestData:n=>{t?.requestDocumentData?.(n)},requestDownload:t?.downloadDocument,requestOpen:t?.openDocument,requestOpenInDir:t?.openDocumentInFileManager}});constructor(){(0,c.QZP)(()=>{const t=this.iri(),n=this.handlers();if(!t||!n||this._fetchedIRIs.has(t))return;this._fetchedIRIs.add(t),this._isLoading.set(!0),this._mapLayers.set([]),n.requestEntityLocations?.([t]);const s=n.requestRelationships?.(t);s?s.then(()=>this._isLoading.set(!1)).catch(()=>this._isLoading.set(!1)):this._isLoading.set(!1)}),(0,c.QZP)(()=>{const t=this.entityDetailedData();if(!t)return;const n=this.iri(),s=(0,O.N)({entityData:{[n]:t},availableEntityRelationships:this.availableEntityRelationships()});this._mapLayers.set(s)})}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=e.VBU({type:i,selectors:[["cue-entity-data"]],inputs:{iri:[1,"iri"],availableEntityCategories:[1,"availableEntityCategories"],availableEntityRelationships:[1,"availableEntityRelationships"],mapboxToken:[1,"mapboxToken"],handlers:[1,"handlers"],variant:[1,"variant"],relationshipData:[1,"relationshipData"],documentRefs:[1,"documentRefs"],documentData:[1,"documentData"],entityDetailedData:[1,"entityDetailedData"]},outputs:{clickedOpenEntity:"clickedOpenEntity",clickedDocument:"clickedDocument",mapFeatureClicked:"mapFeatureClicked"},decls:9,vars:8,consts:[[2,"height","400px","width","100%","display","flex","align-items","center","justify-content","center","background","var(--cue-color-background-subtle, #f8f9fa)","border-radius","4px",3,"cueLogoLoader"],[2,"width","100%","flex","1","min-height","400px","height","100%",3,"variant"],[2,"text-align","center","color","var(--cue-color-text-muted, #6c757d)"],[2,"height","100%",3,"label"],[3,"label"],["legendPosition","top-right",2,"flex","1","min-height","400px","width","100%",3,"clickedOpenEntity","entity","availableEntityCategories","availableEntityRelationships","relationships"],[3,"clickedDocument","documentRefs","handlers","documentData"],[2,"display","flex","flex-direction","column","flex","1","min-height","400px","width","100%","position","relative"],[2,"width","100%",3,"clickedFeature","layers","settings"]],template:function(n,s){if(1&n&&(e.SS7(0)(1)(2)(3)(4)(5)(6),e.nVh(7,v,2,2,"div",0)(8,U,5,5,"cue-tabs",1)),2&n){const o=e.bH3(s.relationshipData());e.R7$();const d=e.bH3(o&&o.incoming.length+o.outgoing.length>0);e.R7$();const C=e.bH3(s.documentRefs().length>0);e.R7$();const M=e.bH3(s.mapLayers());e.R7$();const k=e.bH3(s.mapSettings());e.R7$();const u=e.bH3(void 0!==k&&M.length>0);e.R7$(),e.bH3(s.isEntityLoading()),e.R7$(),e.vxM(d||C||u?8:7)}},dependencies:[b,R.g,W.t,p.o,j.T,L.Typography,h.k,x.Kj],styles:["[_nghost-%COMP%]{display:contents}"],changeDetection:0})}return i})();var K=r(5381),Y=r(2403),z=r(7293);function Q(i,m){if(1&i&&(e.j41(0,"cue-flexcontainer",3)(1,"cue-typography",5),e.EFF(2),e.k0s()()),2&i){const t=e.XpG(2);e.R7$(2),e.SpI(" ",t.errorMessage()," ")}}function Z(i,m){1&i&&(e.j41(0,"cue-flexcontainer",3)(1,"cue-typography",6),e.EFF(2," No project connected. "),e.k0s()())}function J(i,m){1&i&&(e.j41(0,"cue-flexcontainer",3)(1,"cue-typography",6),e.EFF(2," No entity selected. "),e.k0s()())}function q(i,m){if(1&i&&e.nrm(0,"cue-entity-info",7),2&i){e.XpG();const t=e.r8f(0),n=e.XpG(2);e.Y8G("entity",t)("entityCategoriesEditable",!1)("availableEntityCategories",n.availableEntityCategories())("collapsed",!1)("handlers",n._entityInfoHandlers)}}function ee(i,m){1&i&&(e.j41(0,"cue-typography",8),e.EFF(1),e.nI1(2,"transloco"),e.k0s()),2&i&&(e.Y8G("cuePulse",!0),e.R7$(),e.JRh(e.bMT(2,2,"common.infoLoading")))}function te(i,m){if(1&i&&(e.SS7(0),e.nVh(1,q,1,5,"cue-entity-info",7)(2,ee,3,4,"cue-typography",8),e.nrm(3,"div",9),e.j41(4,"div",10),e.nrm(5,"cue-entity-data",11),e.k0s()),2&i){const t=e.XpG(2),n=e.bH3(t._entity());e.R7$(),e.vxM(n?1:2),e.R7$(4),e.Y8G("iri",t._currentIri())("availableEntityCategories",t.availableEntityCategories())("availableEntityRelationships",t.availableEntityRelationships())("mapboxToken",t.mapboxToken()??"")("handlers",t._entityDataHandlers())("relationshipData",t.relationshipData())("documentRefs",t.documentRefs())("documentData",t.documentData())("entityDetailedData",t.entityData())}}function ne(i,m){if(1&i&&e.nrm(0,"cue-logo-link",4),2&i){const t=e.XpG(2);e.Y8G("projectId",t.projectId())("resourceId",t._resourceId())}}function ie(i,m){if(1&i&&(e.j41(0,"div",2),e.nVh(1,Q,3,1,"cue-flexcontainer",3)(2,Z,3,0,"cue-flexcontainer",3)(3,J,3,0,"cue-flexcontainer",3)(4,te,6,11),e.nVh(5,ne,1,2,"cue-logo-link",4),e.k0s()),2&i){const t=e.XpG();e.R7$(),e.vxM("error"===t.state()?1:"idle"===t.state()?2:"no-entity"===t.state()?3:t._currentIri()?4:-1),e.R7$(4),e.vxM(t.showLogo()?5:-1)}}function A(i){return i.split("/").pop()}function ae(i){return{id:i.id,contentIRI:i.contentIRI??i.id,path:i.path??"",suffix:i.suffix??"",size:i.size??0,tags:i.tags??[],summary:i.summary??"",categories:i.categories??[],subject:i.subject,providerId:i.providerId,relevance:0}}let oe=(()=>{class i{cue=(0,l.hFB)(void 0);projectId=(0,l.hFB)(void 0);showLogo=(0,l.hFB)(!1,{transform:l.L39});_resourceId=(0,g.EW)(()=>{const t=this._currentIri();return t?t.split("/").pop():void 0});iri=(0,l.hFB)(void 0);mapboxToken=(0,l.hFB)(void 0);showTranslatedRelationshipLabels=(0,l.hFB)(!1,{transform:l.L39});variant=(0,l.hFB)("none");openEntity=(0,l.CGW)();state=(0,c.vPA)("idle");errorMessage=(0,c.vPA)(null);availableEntityCategories=(0,c.vPA)([]);availableEntityRelationships=(0,c.vPA)([]);relationshipData=(0,c.vPA)(void 0);documentRefs=(0,c.vPA)([]);documentData=(0,c.vPA)({});entityData=(0,c.vPA)(void 0);_entities=(0,c.vPA)(void 0);_documents=(0,c.vPA)(void 0);_unsubscribeEntities;_unsubscribeDocuments;_unsubscribeSchema;_lastIri;_inputWarningTimer;_currentIri=(0,g.EW)(()=>this.iri());_entity=(0,g.EW)(()=>{const t=this.entityData();return t?{iri:this.iri(),value:t.value,categories:t.categories}:void 0});_entityInfoHandlers={};_entityDataHandlers=(0,g.EW)(()=>{var t=this;const n=this._entities(),s=this._documents();return{requestRelationships:(o=(0,B.A)(function*(d){yield Promise.all([n?.fetchEntityRelationships(d).then(C=>t.relationshipData.set(C)),n?.fetchEntityDocuments(d).then(C=>{t.documentRefs.set(C.map(M=>({id:M}))),s&&C.length>0&&s.requestDocumentData(C)})])}),function(C){return o.apply(this,arguments)}),requestDocumentData:o=>s?.requestDocumentData(o),requestEntityLocations:o=>{if(!this.mapboxToken())return void console.warn("[cue-entity-viewer] No mapboxToken provided \u2014 skipping map location fetch.");const d=o.map(A).filter(Boolean);n?.requestEntityLocations(d)},openEntity:o=>this.openEntity.emit(o)};var o});constructor(){this._inputWarningTimer=setTimeout(()=>{this.cue()||console.warn('[cue-entity-viewer] Required input "cue" is not set. Pass an authenticated Cue SDK instance.'),this.projectId()||console.warn('[cue-entity-viewer] Required input "projectId" is not set. Pass the Cue project ID to display entity data.')},3e3),(0,c.QZP)(()=>{this._setup(this.cue(),this.projectId())}),(0,c.QZP)(()=>{const t=this._entities(),n=this.iri();t&&n&&void 0===this._entity()&&t.requestEntityData([A(n)],!1)}),(0,c.QZP)(()=>{const t=this._entities(),n=this.iri();!t||!n||(n!==this._lastIri&&(this._lastIri=n,this.relationshipData.set(void 0),this.documentRefs.set([]),this.entityData.set(void 0),this.state.set("ready")),this._syncEntityData(t,n))})}ngOnDestroy(){clearTimeout(this._inputWarningTimer),this._teardown()}_setup(t,n){if(this._teardown(),!t||!n)return this._entities.set(void 0),this._documents.set(void 0),void this.state.set("idle");const s=new I.g8(t.api,n),o=new I.f$(t.api,n);if(this._entities.set(s),this._documents.set(o),this._lastIri=void 0,this.state.set(this.iri()?"ready":"no-entity"),this._unsubscribeEntities=s.entityInfoMap.subscribe(()=>{const d=this.iri();d&&this._syncEntityData(s,d)}),this._unsubscribeDocuments=o.documentInfoMap.subscribe(()=>{this._syncDocumentData(o)}),s.contentCategoriesInProject(!0).then(d=>this.availableEntityCategories.set(d)).catch(d=>console.error("[cue-entity-viewer] Failed to fetch categories",d)),this.showTranslatedRelationshipLabels()){const d=new I.Ug(t.api,n,t.api.language);this._unsubscribeSchema=d.availableEntityRelationships.subscribe(()=>{this.availableEntityRelationships.set(d.availableEntityRelationships.get())})}}_syncEntityData(t,n){const s=A(n),o=t.entityInfoMap.get()[s];if(!o)return;const d=Array.isArray(o.documentRefs)?o.documentRefs.map(k=>"string"==typeof k?{id:k}:k):[],{documentRefs:C,...M}=o;this.entityData.set({...M,documentRefs:d}),d.length>0&&this.documentRefs.set(d)}_syncDocumentData(t){const n=t.documentInfoMap.get(),s={};for(const[o,d]of Object.entries(n))s[o]=ae(d);this.documentData.set(s)}_teardown(){this._unsubscribeEntities?.(),this._unsubscribeDocuments?.(),this._unsubscribeSchema?.(),this._unsubscribeEntities=void 0,this._unsubscribeDocuments=void 0,this._unsubscribeSchema=void 0}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=e.VBU({type:i,selectors:[["cue-entity-viewer-wc"]],inputs:{cue:[1,"cue"],projectId:[1,"projectId"],showLogo:[1,"showLogo"],iri:[1,"iri"],mapboxToken:[1,"mapboxToken"],showTranslatedRelationshipLabels:[1,"showTranslatedRelationshipLabels"],variant:[1,"variant"]},outputs:{openEntity:"openEntity"},decls:3,vars:1,consts:[["body",""],[3,"ngTemplateOutlet"],[2,"display","flex","flex-direction","column","height","100%","overflow","hidden","width","100%","position","relative"],["direction","column","align","center","justify","center",2,"height","100%","width","100%","padding","8px"],[2,"position","absolute","top","12px","right","12px","z-index","5",3,"projectId","resourceId"],[2,"color","#c44","font-size","13px"],[2,"color","#9ca3af","font-size","13px"],[3,"entity","entityCategoriesEditable","availableEntityCategories","collapsed","handlers"],["cuePulseMode","text",3,"cuePulse"],[2,"height","16px"],[2,"flex","1","min-height","0"],[2,"width","100%","height","100%",3,"iri","availableEntityCategories","availableEntityRelationships","mapboxToken","handlers","relationshipData","documentRefs","documentData","entityDetailedData"]],template:function(n,s){if(1&n&&(e.DNE(0,ie,6,2,"ng-template",null,0,e.C5r),e.eu8(2,1)),2&n){const o=e.sdS(1);e.R7$(2),e.Y8G("ngTemplateOutlet",o)}},dependencies:[T.U,H,K.FlexContainer,L.Typography,Y.V,G.T3,z.x,x.Kj],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%;overflow:hidden}"],changeDetection:0})}return i})()}}]);
|
|
1
|
+
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[3202],{1625(S,k,r){r.d(k,{U:()=>W});var F=r(467),l=r(7705),g=r(2271),c=r(5381),I=r(1024),B=r(9421),x=r(5794),T=r(9352),R=r(6117),N=r(8547),e=r(3319),P=r(5971),_=r(7573),a=r(5547);function m(p,O){if(1&p&&(a.nrm(0,"cue-key-val",4),a.nI1(1,"transloco")),2&p){const u=a.XpG(2);a.Y8G("key",a.bMT(1,2,"components.entityInfo.labelValue"))("val",u.entity().value)}}function b(p,O){if(1&p&&(a.nrm(0,"cue-key-val-editable",5),a.nI1(1,"transloco"),a.nI1(2,"transloco")),2&p){const u=a.XpG(3);a.Y8G("key",1===u.entityCategories().length?a.bMT(1,4,"components.entityInfo.labelEntityCategory"):a.bMT(2,6,"components.entityInfo.labelEntityCategories"))("val",u.entityCategoriesString())("rdfConfig",u.rdfEditConfig())("editDisabled",!u.entityCategoriesEditable())}}function j(p,O){if(1&p&&(a.nrm(0,"hr"),a.nVh(1,b,3,8,"cue-key-val-editable",5)),2&p){const u=a.XpG(2);a.R7$(),a.vxM(u.entityCategories()&&u.entityCategories().length>0?1:-1)}}function V(p,O){if(1&p&&(a.j41(0,"cue-key-val-list"),a.nVh(1,m,2,4,"cue-key-val",4),a.nVh(2,j,2,1),a.k0s()),2&p){const u=a.XpG();a.R7$(),a.vxM(u.entity().value?1:-1),a.R7$(),a.vxM(u.collapsed()?-1:2)}}function L(p,O){if(1&p&&(a.j41(0,"cue-flexcontainer",3)(1,"cue-menu",6)(2,"cue-button",7,0),a.nrm(4,"cue-button-icon",8),a.k0s(),a.nrm(5,"cue-menu-nested",9),a.k0s()()),2&p){a.XpG();const u=a.r8f(3);a.R7$(5),a.Y8G("items",u)}}let W=(()=>{class p{entity=l.hFB.required();handlers=l.hFB.required();entityCategoriesEditable=(0,l.hFB)(!1);menuItems=(0,l.hFB)([]);availableEntityCategories=(0,l.hFB)([]);collapsed=(0,l.hFB)(!1);dataChanged=(0,l.CGW)();_entityCategories=(0,g.uu)(()=>this.entity()?.categories||[]);entityCategories=(0,g.EW)(()=>this._entityCategories());entityCategoriesString=(0,g.EW)(()=>this._entityCategories().map(u=>this._iriToString(u)).sort().join(", "));infoChangeEntityCategory=(0,T.Xx)("components.entityInfo.infoChangeEntityCategory");rdfEditConfig=(0,g.EW)(()=>{var u=this;const D=this.handlers()?.requestRDFChange;var v;if(void 0!==D)return{message:this.infoChangeEntityCategory(),existingValue:this._entityCategories(),dataType:"multiselect",options:this.availableEntityCategories()?.map(v=>v.iri),optionLabelMap:this.availableEntityCategories()?.reduce((v,f)=>(v[f.iri]=f.label,v),{}),requestSave:(v=(0,F.A)(function*(f){console.log(f);const w={subject:u.entity()?.iri,predicate:`${_.E.qcy}entityCategory`,objects:u._entityCategories(),newObjects:f.newValue,type:"entityCategory",comment:f.comment};yield D(w),u._entityCategories.set(f.newValue),u.dataChanged.emit({entityCategories:f.newValue})}),function(w){return v.apply(this,arguments)})};console.warn("No RDF change request handler defined")});_iriToString(u){const D=this.availableEntityCategories()?.find(v=>v.iri===u);return D?D.label:u}static \u0275fac=function(D){return new(D||p)};static \u0275cmp=a.VBU({type:p,selectors:[["cue-entity-info"]],inputs:{entity:[1,"entity"],handlers:[1,"handlers"],entityCategoriesEditable:[1,"entityCategoriesEditable"],menuItems:[1,"menuItems"],availableEntityCategories:[1,"availableEntityCategories"],collapsed:[1,"collapsed"]},outputs:{dataChanged:"dataChanged"},decls:5,vars:3,consts:[["trigger",""],["direction","row",2,"min-height","50px"],["direction","column",2,"flex","1 1"],["direction","column",2,"width","50px"],["size","l",3,"key","val"],["size","s",3,"key","val","rdfConfig","editDisabled"],["positioning","bottomleft"],["trigger","","variant","tertiary"],["icon","more-vert"],["menu","",3,"items"]],template:function(D,v){if(1&D&&(a.j41(0,"cue-flexcontainer",1)(1,"cue-flexcontainer",2),a.nVh(2,V,3,2,"cue-key-val-list"),a.k0s(),a.SS7(3),a.nVh(4,L,6,1,"cue-flexcontainer",3),a.k0s()),2&D){a.R7$(2),a.vxM(v.entity()?2:-1),a.R7$();const f=a.bH3(v.menuItems());a.R7$(),a.vxM(void 0!==f&&f.length>0?4:-1)}},dependencies:[c.FlexContainer,I.p,B.F,x.L,R.W,N.T,e.ButtonIcon,P.Button,T.Kj],encapsulation:2,changeDetection:0})}return p})()},6103(S,k,r){r.d(k,{N:()=>c});var F=r(2306),l=r(140),g=r(58);function c({entityData:I,availableEntityRelationships:B}){const x=_=>B.find(a=>a.iri===_)?.label??_.split("#").pop()??_,T=[],R={};for(const[_,a]of Object.entries(I)){for(const m of a.directMapGeometries??[])T.push({iri:_,wkt:m.wkt});for(const m of a.indirectMapGeometries??[]){R[m.rel]||(R[m.rel]=[]);for(const b of m.geometries)R[m.rel].push({iri:m.entityUUID,wkt:b.wkt})}}const N=(_,a,m)=>{if(!a.length)return null;const b=new F.ux(_,_);return b.category=m,b.collection=new l.o(a.flatMap(({iri:j,wkt:V})=>{const L=(0,g.S)(V);return L?[{type:"Feature",geometry:(0,g.n)(L),properties:{iri:j}}]:[]})),b},e=[],P=N("direct",T,"Direct");P&&e.push(P);for(const[_,a]of Object.entries(R)){const m=x(_),b=N(m,a,m);b&&e.push(b)}return e}},3202(S,k,r){r.d(k,{CueEntityViewer:()=>le});var F=r(467),l=r(7705),g=r(2271),c=r(5802),I=r(4400),B=r(9769),x=r(9352),T=r(5187),R=r(1625),N=r(3656),e=r(5547),P=r(4523),_=r(7573),a=r(4284);function m(i,y){if(1&i){const t=e.RV6();e.j41(0,"cue-rdf-graph",1),e.bIt("nodeHover",function(s){c.eBV(t);const o=e.XpG(2);return c.Njj(o.hoveredNode.set(s))}),e.k0s()}if(2&i){const t=e.XpG(),n=e.XpG();e.Y8G("doc",t)("collapseClasses",!0)("collapseAttributes",!0)("collapseRelationships",!0)("colorByCategory",!1)("categoryLabelsOnHover",!0)("showRelationshipLegend",!0)("legendPosition",n.legendPosition())("nodeMenuItems",n.nodeMenuItems())("focusNodes",n.focusNodes())("focusNodeColor",n.focusNodeColor())("zoomToFocusNodes",!1)}}function b(i,y){if(1&i&&e.nVh(0,m,1,12,"cue-rdf-graph",0),2&i){const t=e.XpG();e.vxM(t._containerReady()?0:-1)}}let j=(()=>{class i{entity=l.hFB.required();availableEntityCategories=l.hFB.required();availableEntityRelationships=(0,l.hFB)([]);relationships=(0,l.hFB)(void 0);legendPosition=(0,l.hFB)("top-left");showOpenEntityMenuItem=(0,l.hFB)(!0);clickedOpenEntity=(0,l.CGW)();doc=(0,c.vPA)(void 0);_containerReady=(0,c.vPA)(!1);_hostElement=(0,c.WQX)(e.aKT);_resolvedEntityIRI=(0,g.EW)(()=>{const t=this.entity()?.iri;if(t){if(!t.includes("://"))throw new Error(`Expected a full IRI but got: ${t}`);return t}});focusNodes=(0,g.EW)(()=>{const t=this._resolvedEntityIRI();return t?[t]:[]});focusNodeColor=(0,c.vPA)("green");_document=(0,c.WQX)(c.qQL);hoveredNode=(0,c.vPA)(void 0);labelOpenEntity=(0,x.Xx)("components.graph.entityGraph.labelOpenEntity");nodeMenuItems=(0,g.EW)(()=>{const t=[];return this.showOpenEntityMenuItem()&&this.hoveredNode()?.id!==this._resolvedEntityIRI()&&t.push({id:"open",label:this.labelOpenEntity(),action:n=>this.clickedOpenEntity.emit(n.id)}),t});constructor(){(0,e.mal)(()=>{const t=getComputedStyle(this._document.documentElement).getPropertyValue("--cue-color-green").trim();t&&this.focusNodeColor.set(t)}),(0,c.QZP)(()=>{const t=this.entity()?.iri,n=this.relationships();void 0===t||void 0===n||this._buildDoc(n)}),(0,e.mal)(()=>{if(this._containerReady())return;const t=this._hostElement.nativeElement,n=new ResizeObserver(s=>{if(this._containerReady())return void n.disconnect();const o=s[0]?.contentRect;o&&o.width>=100&&o.height>=100&&(this._containerReady.set(!0),n.disconnect())});return n.observe(t),()=>n.disconnect()})}ngAfterViewInit(){const t=this._hostElement.nativeElement;t.clientWidth>=100&&t.clientHeight>=100&&this._containerReady.set(!0)}_buildDoc(t){const{incoming:n,outgoing:s}=t,o={"@context":{qcy:`${_.E.qcy}`,"qcy-e":`${_.E["qcy-e"]}`,skos:`${a.B.skos}`},"@graph":[]},d=this._resolvedEntityIRI(),C={"@id":d,"qcy:value":this.entity()?.value,"@type":this.entity()?.categories};o["@graph"].push(C),s.forEach(h=>{o["@graph"].push({"@id":h.nodeIRI,"qcy:value":h.nodeValue,"@type":h.nodeCategories}),o["@graph"].push({"@id":d,[h.relIRI]:{"@id":h.nodeIRI}})}),n.forEach(h=>{o["@graph"].push({"@id":h.nodeIRI,"qcy:value":h.nodeValue,"@type":h.nodeCategories}),o["@graph"].push({"@id":h.nodeIRI,[h.relIRI]:{"@id":d}})});const M=new Set;n.forEach(h=>h.nodeCategories.forEach(E=>M.add(E))),s.forEach(h=>h.nodeCategories.forEach(E=>M.add(E))),this.entity()?.categories.forEach(h=>M.add(h)),M.forEach(h=>{const E=this.availableEntityCategories().find($=>$.iri===h)?.label;void 0!==E&&o["@graph"].push({"@id":h,"skos:prefLabel":E})}),new Set(n.map(h=>h.relIRI).concat(s.map(h=>h.relIRI))).forEach(h=>{const E=this.availableEntityRelationships().find($=>$.iri===h)?.label;void 0!==E&&o["@graph"].push({"@id":h,"skos:prefLabel":E})}),this.doc.update(()=>o)}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=e.VBU({type:i,selectors:[["cue-entity-graph"]],inputs:{entity:[1,"entity"],availableEntityCategories:[1,"availableEntityCategories"],availableEntityRelationships:[1,"availableEntityRelationships"],relationships:[1,"relationships"],legendPosition:[1,"legendPosition"],showOpenEntityMenuItem:[1,"showOpenEntityMenuItem"]},outputs:{clickedOpenEntity:"clickedOpenEntity"},decls:1,vars:1,consts:[[3,"doc","collapseClasses","collapseAttributes","collapseRelationships","colorByCategory","categoryLabelsOnHover","showRelationshipLegend","legendPosition","nodeMenuItems","focusNodes","focusNodeColor","zoomToFocusNodes"],[3,"nodeHover","doc","collapseClasses","collapseAttributes","collapseRelationships","colorByCategory","categoryLabelsOnHover","showRelationshipLegend","legendPosition","nodeMenuItems","focusNodes","focusNodeColor","zoomToFocusNodes"]],template:function(n,s){if(1&n&&e.nVh(0,b,1,1),2&n){let o;e.vxM((o=s.doc())?0:-1,o)}},dependencies:[P.t],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;min-height:400px;min-width:100px}"]})}return i})();var V=r(8017),L=r(2306),W=r(6103),p=r(6455),O=r(8334),u=r(2245),D=r(7851);function v(i,y){1&i&&(e.j41(0,"cue-typography",2),e.EFF(1),e.nI1(2,"transloco"),e.k0s()),2&i&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"components.entityData.infoNoData")," "))}function f(i,y){if(1&i&&(e.j41(0,"div",0),e.nVh(1,v,3,3,"cue-typography",2),e.k0s()),2&i){e.XpG();const t=e.r8f(6);e.Y8G("cueLogoLoader",t),e.R7$(),e.vxM(t?-1:1)}}function w(i,y){if(1&i){const t=e.RV6();e.j41(0,"cue-tab",3),e.nI1(1,"transloco"),e.j41(2,"cue-entity-graph",5),e.bIt("clickedOpenEntity",function(s){let o;c.eBV(t);const d=e.XpG(2);return d.clickedOpenEntity.emit(s),c.Njj(null==(o=d.handlers())||null==o.openEntity?null:o.openEntity(s))}),e.k0s()()}if(2&i){e.XpG();const t=e.r8f(1),n=e.XpG(),s=e.r8f(0);e.Y8G("label",e.bMT(1,5,"components.entityData.titleEntityGraph")),e.R7$(2),e.Y8G("entity",t)("availableEntityCategories",n.availableEntityCategories())("availableEntityRelationships",n.availableEntityRelationships())("relationships",s)}}function X(i,y){if(1&i){const t=e.RV6();e.j41(0,"cue-tab",4),e.nI1(1,"transloco"),e.j41(2,"cue-doc-list",6),e.bIt("clickedDocument",function(s){c.eBV(t);const o=e.XpG(2);return c.Njj(o.clickedDocument.emit(s))}),e.k0s()()}if(2&i){const t=e.XpG(2);e.Y8G("label",e.bMT(1,4,"components.entityData.titleRelatedDocuments")),e.R7$(2),e.Y8G("documentRefs",t.documentRefs())("handlers",t.internalDocumentListHandlers())("documentData",t.documentData())}}function U(i,y){if(1&i){const t=e.RV6();e.j41(0,"cue-tab",4),e.nI1(1,"transloco"),e.j41(2,"div",7)(3,"cue-map",8),e.bIt("clickedFeature",function(s){c.eBV(t);const o=e.XpG(2);return c.Njj(o.mapFeatureClicked.emit(s))}),e.k0s()()()}if(2&i){e.XpG(2);const t=e.r8f(3),n=e.r8f(4);e.Y8G("label",e.bMT(1,3,"components.entityData.titleMap")),e.R7$(3),e.Y8G("layers",t)("settings",n)}}function H(i,y){if(1&i&&(e.j41(0,"cue-tabs",1),e.SS7(1),e.nVh(2,w,3,7,"cue-tab",3),e.nVh(3,X,3,6,"cue-tab",4),e.nVh(4,U,4,5,"cue-tab",4),e.k0s()),2&i){const t=e.XpG(),n=e.r8f(1),s=e.r8f(2),o=e.r8f(5);e.Y8G("variant",t.variant()),e.R7$();const d=e.bH3(t.entity());e.R7$(),e.vxM(n&&d?2:-1),e.R7$(),e.vxM(s?3:-1),e.R7$(),e.vxM(o?4:-1)}}let K=(()=>{class i{iri=l.hFB.required();availableEntityCategories=l.hFB.required();availableEntityRelationships=(0,l.hFB)([]);mapboxToken=l.hFB.required();handlers=(0,l.hFB)(void 0);variant=(0,l.hFB)("none");clickedOpenEntity=(0,l.CGW)();clickedDocument=(0,l.CGW)();mapFeatureClicked=(0,l.CGW)();relationshipData=(0,l.hFB)(void 0);documentRefs=(0,l.hFB)([]);documentData=(0,l.hFB)({});entityDetailedData=(0,l.hFB)(void 0);_fetchedIRIs=new Set;_mapLayers=(0,c.vPA)([]);_isLoading=(0,c.vPA)(!1);mapSettings=(0,g.EW)(()=>{const t=this.mapboxToken();if(t)return{...new L.yY,mapboxToken:t}});mapLayers=this._mapLayers.asReadonly();isEntityLoading=this._isLoading.asReadonly();entity=(0,g.EW)(()=>{const t=this.entityDetailedData();return t?{iri:this.iri(),value:t.value,categories:t.categories}:void 0});internalDocumentListHandlers=(0,g.EW)(()=>{const t=this.handlers();return{requestData:n=>{t?.requestDocumentData?.(n)},requestDownload:t?.downloadDocument,requestOpen:t?.openDocument,requestOpenInDir:t?.openDocumentInFileManager}});constructor(){(0,c.QZP)(()=>{const t=this.iri(),n=this.handlers();if(!t||!n||this._fetchedIRIs.has(t))return;this._fetchedIRIs.add(t),this._isLoading.set(!0),this._mapLayers.set([]),n.requestEntityLocations?.([t]);const s=n.requestRelationships?.(t);s?s.then(()=>this._isLoading.set(!1)).catch(()=>this._isLoading.set(!1)):this._isLoading.set(!1)}),(0,c.QZP)(()=>{const t=this.entityDetailedData();if(!t)return;const n=this.iri(),s=(0,W.N)({entityData:{[n]:t},availableEntityRelationships:this.availableEntityRelationships()});this._mapLayers.set(s)})}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=e.VBU({type:i,selectors:[["cue-entity-data"]],inputs:{iri:[1,"iri"],availableEntityCategories:[1,"availableEntityCategories"],availableEntityRelationships:[1,"availableEntityRelationships"],mapboxToken:[1,"mapboxToken"],handlers:[1,"handlers"],variant:[1,"variant"],relationshipData:[1,"relationshipData"],documentRefs:[1,"documentRefs"],documentData:[1,"documentData"],entityDetailedData:[1,"entityDetailedData"]},outputs:{clickedOpenEntity:"clickedOpenEntity",clickedDocument:"clickedDocument",mapFeatureClicked:"mapFeatureClicked"},decls:9,vars:8,consts:[[2,"height","400px","width","100%","display","flex","align-items","center","justify-content","center","background","var(--cue-color-background-subtle, #f8f9fa)","border-radius","4px",3,"cueLogoLoader"],[2,"width","100%","flex","1","min-height","400px","height","100%",3,"variant"],[2,"text-align","center","color","var(--cue-color-text-muted, #6c757d)"],[2,"height","100%",3,"label"],[3,"label"],["legendPosition","top-right",2,"flex","1","min-height","400px","width","100%",3,"clickedOpenEntity","entity","availableEntityCategories","availableEntityRelationships","relationships"],[3,"clickedDocument","documentRefs","handlers","documentData"],[2,"display","flex","flex-direction","column","flex","1","min-height","400px","width","100%","position","relative"],[2,"width","100%",3,"clickedFeature","layers","settings"]],template:function(n,s){if(1&n&&(e.SS7(0)(1)(2)(3)(4)(5)(6),e.nVh(7,f,2,2,"div",0)(8,H,5,5,"cue-tabs",1)),2&n){const o=e.bH3(s.relationshipData());e.R7$();const d=e.bH3(o&&o.incoming.length+o.outgoing.length>0);e.R7$();const C=e.bH3(s.documentRefs().length>0);e.R7$();const M=e.bH3(s.mapLayers());e.R7$();const G=e.bH3(s.mapSettings());e.R7$();const h=e.bH3(void 0!==G&&M.length>0);e.R7$(),e.bH3(s.isEntityLoading()),e.R7$(),e.vxM(d||C||h?8:7)}},dependencies:[j,N.g,p.t,O.o,V.T,u.Typography,D.k,x.Kj],styles:["[_nghost-%COMP%]{display:contents}"],changeDetection:0})}return i})();var Y=r(5381),z=r(2403),Q=r(7293);function Z(i,y){if(1&i&&(e.j41(0,"cue-flexcontainer",4)(1,"cue-typography",6),e.EFF(2),e.k0s()()),2&i){const t=e.XpG(2);e.R7$(2),e.SpI(" ",t.errorMessage()," ")}}function J(i,y){1&i&&(e.j41(0,"cue-flexcontainer",4)(1,"cue-typography",7),e.EFF(2," No project connected. "),e.k0s()())}function q(i,y){1&i&&(e.j41(0,"cue-flexcontainer",4)(1,"cue-typography",7),e.EFF(2," No entity selected. "),e.k0s()())}function ee(i,y){if(1&i&&e.nrm(0,"cue-entity-info",8),2&i){e.XpG();const t=e.r8f(0),n=e.XpG(2);e.Y8G("entity",t)("entityCategoriesEditable",!1)("availableEntityCategories",n.availableEntityCategories())("collapsed",!1)("handlers",n._entityInfoHandlers)}}function te(i,y){1&i&&(e.j41(0,"cue-typography",9),e.EFF(1),e.nI1(2,"transloco"),e.k0s()),2&i&&(e.Y8G("cuePulse",!0),e.R7$(),e.JRh(e.bMT(2,2,"common.infoLoading")))}function ne(i,y){if(1&i&&(e.SS7(0),e.nVh(1,ee,1,5,"cue-entity-info",8)(2,te,3,4,"cue-typography",9),e.nrm(3,"div",10),e.j41(4,"div",11),e.nrm(5,"cue-entity-data",12),e.k0s()),2&i){const t=e.XpG(2),n=e.bH3(t._entity());e.R7$(),e.vxM(n?1:2),e.R7$(4),e.Y8G("iri",t._currentIri())("availableEntityCategories",t.availableEntityCategories())("availableEntityRelationships",t.availableEntityRelationships())("mapboxToken",t.mapboxToken()??"")("handlers",t._entityDataHandlers())("relationshipData",t.relationshipData())("documentRefs",t.documentRefs())("documentData",t.documentData())("entityDetailedData",t.entityData())}}function ie(i,y){if(1&i&&e.nrm(0,"cue-logo-link",5),2&i){const t=e.XpG(2);e.Y8G("projectId",t.projectId())("resourceId",t._resourceId())}}function ae(i,y){if(1&i&&(e.j41(0,"div",3),e.nVh(1,Z,3,1,"cue-flexcontainer",4)(2,J,3,0,"cue-flexcontainer",4)(3,q,3,0,"cue-flexcontainer",4)(4,ne,6,11),e.nVh(5,ie,1,2,"cue-logo-link",5),e.k0s()),2&i){const t=e.XpG();e.R7$(),e.vxM("error"===t.state()?1:"idle"===t.state()?2:"no-entity"===t.state()?3:t._currentIri()?4:-1),e.R7$(4),e.vxM(t.showLogo()?5:-1)}}function oe(i,y){if(1&i&&(e.j41(0,"cue-card",1),e.eu8(1,2),e.k0s()),2&i){const t=e.XpG(),n=e.sdS(1);e.Y8G("variant",t._cardVariant())("padded",!0),e.R7$(),e.Y8G("ngTemplateOutlet",n)}}function se(i,y){if(1&i&&e.eu8(0,2),2&i){e.XpG();const t=e.sdS(1);e.Y8G("ngTemplateOutlet",t)}}function A(i){return i.split("/").pop()}function re(i){return{id:i.id,contentIRI:i.contentIRI??i.id,path:i.path??"",suffix:i.suffix??"",size:i.size??0,tags:i.tags??[],summary:i.summary??"",categories:i.categories??[],subject:i.subject,providerId:i.providerId,relevance:0}}let le=(()=>{class i{cue=(0,l.hFB)(void 0);projectId=(0,l.hFB)(void 0);showLogo=(0,l.hFB)(!1,{transform:l.L39});_resourceId=(0,g.EW)(()=>{const t=this._currentIri();return t?t.split("/").pop():void 0});iri=(0,l.hFB)(void 0);mapboxToken=(0,l.hFB)(void 0);showTranslatedRelationshipLabels=(0,l.hFB)(!1,{transform:l.L39});variant=(0,l.hFB)("none");_cardVariant=(0,g.EW)(()=>this.variant());openEntity=(0,l.CGW)();state=(0,c.vPA)("idle");errorMessage=(0,c.vPA)(null);availableEntityCategories=(0,c.vPA)([]);availableEntityRelationships=(0,c.vPA)([]);relationshipData=(0,c.vPA)(void 0);documentRefs=(0,c.vPA)([]);documentData=(0,c.vPA)({});entityData=(0,c.vPA)(void 0);_entities=(0,c.vPA)(void 0);_documents=(0,c.vPA)(void 0);_unsubscribeEntities;_unsubscribeDocuments;_unsubscribeSchema;_lastIri;_inputWarningTimer;_currentIri=(0,g.EW)(()=>this.iri());_entity=(0,g.EW)(()=>{const t=this.entityData();return t?{iri:this.iri(),value:t.value,categories:t.categories}:void 0});_entityInfoHandlers={};_entityDataHandlers=(0,g.EW)(()=>{var t=this;const n=this._entities(),s=this._documents();return{requestRelationships:(o=(0,F.A)(function*(d){yield Promise.all([n?.fetchEntityRelationships(d).then(C=>t.relationshipData.set(C)),n?.fetchEntityDocuments(d).then(C=>{t.documentRefs.set(C.map(M=>({id:M}))),s&&C.length>0&&s.requestDocumentData(C)})])}),function(C){return o.apply(this,arguments)}),requestDocumentData:o=>s?.requestDocumentData(o),requestEntityLocations:o=>{if(!this.mapboxToken())return void console.warn("[cue-entity-viewer] No mapboxToken provided \u2014 skipping map location fetch.");const d=o.map(A).filter(Boolean);n?.requestEntityLocations(d)},openEntity:o=>this.openEntity.emit(o)};var o});constructor(){this._inputWarningTimer=setTimeout(()=>{this.cue()||console.warn('[cue-entity-viewer] Required input "cue" is not set. Pass an authenticated Cue SDK instance.'),this.projectId()||console.warn('[cue-entity-viewer] Required input "projectId" is not set. Pass the Cue project ID to display entity data.')},3e3),(0,c.QZP)(()=>{this._setup(this.cue(),this.projectId())}),(0,c.QZP)(()=>{const t=this._entities(),n=this.iri();t&&n&&void 0===this._entity()&&t.requestEntityData([A(n)],!1)}),(0,c.QZP)(()=>{const t=this._entities(),n=this.iri();!t||!n||(n!==this._lastIri&&(this._lastIri=n,this.relationshipData.set(void 0),this.documentRefs.set([]),this.entityData.set(void 0),this.state.set("ready")),this._syncEntityData(t,n))})}ngOnDestroy(){clearTimeout(this._inputWarningTimer),this._teardown()}_setup(t,n){if(this._teardown(),!t||!n)return this._entities.set(void 0),this._documents.set(void 0),void this.state.set("idle");const s=new I.g8(t.api,n),o=new I.f$(t.api,n);if(this._entities.set(s),this._documents.set(o),this._lastIri=void 0,this.state.set(this.iri()?"ready":"no-entity"),this._unsubscribeEntities=s.entityInfoMap.subscribe(()=>{const d=this.iri();d&&this._syncEntityData(s,d)}),this._unsubscribeDocuments=o.documentInfoMap.subscribe(()=>{this._syncDocumentData(o)}),s.contentCategoriesInProject(!0).then(d=>this.availableEntityCategories.set(d)).catch(d=>console.error("[cue-entity-viewer] Failed to fetch categories",d)),this.showTranslatedRelationshipLabels()){const d=new I.Ug(t.api,n,t.api.language);this._unsubscribeSchema=d.availableEntityRelationships.subscribe(()=>{this.availableEntityRelationships.set(d.availableEntityRelationships.get())})}}_syncEntityData(t,n){const s=A(n),o=t.entityInfoMap.get()[s];if(!o)return;const d=Array.isArray(o.documentRefs)?o.documentRefs.map(G=>"string"==typeof G?{id:G}:G):[],{documentRefs:C,...M}=o;this.entityData.set({...M,documentRefs:d}),d.length>0&&this.documentRefs.set(d)}_syncDocumentData(t){const n=t.documentInfoMap.get(),s={};for(const[o,d]of Object.entries(n))s[o]=re(d);this.documentData.set(s)}_teardown(){this._unsubscribeEntities?.(),this._unsubscribeDocuments?.(),this._unsubscribeSchema?.(),this._unsubscribeEntities=void 0,this._unsubscribeDocuments=void 0,this._unsubscribeSchema=void 0}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=e.VBU({type:i,selectors:[["cue-entity-viewer-wc"]],inputs:{cue:[1,"cue"],projectId:[1,"projectId"],showLogo:[1,"showLogo"],iri:[1,"iri"],mapboxToken:[1,"mapboxToken"],showTranslatedRelationshipLabels:[1,"showTranslatedRelationshipLabels"],variant:[1,"variant"]},outputs:{openEntity:"openEntity"},decls:4,vars:1,consts:[["body",""],[2,"height","100%","width","100%",3,"variant","padded"],[3,"ngTemplateOutlet"],[2,"display","flex","flex-direction","column","height","100%","overflow","hidden","width","100%","position","relative"],["direction","column","align","center","justify","center",2,"height","100%","width","100%","padding","8px"],[2,"position","absolute","bottom","12px","right","12px","z-index","5",3,"projectId","resourceId"],[2,"color","#c44","font-size","13px"],[2,"color","#9ca3af","font-size","13px"],[3,"entity","entityCategoriesEditable","availableEntityCategories","collapsed","handlers"],["cuePulseMode","text",3,"cuePulse"],[2,"height","16px"],[2,"flex","1","min-height","0"],[2,"width","100%","height","100%",3,"iri","availableEntityCategories","availableEntityRelationships","mapboxToken","handlers","relationshipData","documentRefs","documentData","entityDetailedData"]],template:function(n,s){1&n&&(e.DNE(0,ae,6,2,"ng-template",null,0,e.C5r),e.nVh(2,oe,2,3,"cue-card",1)(3,se,1,1,"ng-container",2)),2&n&&(e.R7$(2),e.vxM("none"!==s.variant()?2:3))},dependencies:[R.U,K,Y.FlexContainer,u.Typography,z.V,B.T3,Q.x,T.Card,x.Kj],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%;overflow:hidden}"],changeDetection:0})}return i})()}}]);
|