@qaecy/cue-ui 0.0.47 → 0.0.48

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/882.js DELETED
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[882],{3183(N,S,o){o.d(S,{A:()=>E});var M=o(7705),p=o(5802),s=o(9417),y=o(1359),I=o(8957),C=o(2245),L=o(5381),d=o(5547);const g=(v,f)=>f.value;function k(v,f){if(1&v){const r=d.RV6();d.j41(0,"cue-input",6),d.bIt("valueChange",function(u){p.eBV(r);const _=d.XpG();return _.searchText=u,p.Njj(_.onSearchChange())}),d.k0s()}if(2&v){const r=d.XpG();d.Y8G("value",r.searchText)}}function P(v,f){if(1&v){const r=d.RV6();d.j41(0,"cue-checkbox",7),d.bIt("checkedChange",function(u){const _=p.eBV(r).$implicit,T=d.XpG();return _.selected=u,p.Njj(T.onSelectionChange())}),d.k0s()}if(2&v){const r=f.$implicit;d.Y8G("label",r.value||"(blank)")("checked",r.selected)}}function R(v,f){1&v&&(d.j41(0,"cue-typography",5),d.EFF(1,"No results"),d.k0s())}let E=(()=>{class v{_cdr=(0,p.WQX)(M.gRc);_params;options=[];filteredOptions=[];searchText="";agInit(r){this._params=r}afterGuiAttached(r){this._refreshOptions(),this._cdr.markForCheck()}onNewRowsLoaded(){this._refreshOptions(),this._cdr.markForCheck()}isFilterActive(){return this.options.some(r=>!r.selected)}doesFilterPass(r){const h=new Set(this.options.filter(x=>x.selected).map(x=>x.value)),u=this._params.getValue(r.node),_=null==u?"":String(u);return"..."===_||"Loading..."===_||(""===_?h.has(""):_.split(", ").map(x=>x.trim()).some(x=>h.has(x)))}getModel(){return this.isFilterActive()?{selectedValues:this.options.filter(r=>r.selected).map(r=>r.value)}:null}setModel(r){if(r){const h=new Set(r.selectedValues);this.options.forEach(u=>u.selected=h.has(u.value))}else this.options.forEach(h=>h.selected=!0);this._applySearch(),this._cdr.markForCheck()}onSelectionChange(){this._params.filterChangedCallback(),this._cdr.markForCheck()}onSearchChange(){this._applySearch(),this._cdr.markForCheck()}get allSelected(){return this.options.length>0&&this.options.every(r=>r.selected)}toggleAll(r){this.options.forEach(h=>h.selected=r),this._applySearch(),this._params.filterChangedCallback(),this._cdr.markForCheck()}_refreshOptions(){const r=new Set;this._params.api.forEachNode(u=>{const _=this._params.getValue(u);if(null==_||""===_)r.add("");else{const T=String(_);if("..."===T||"Loading..."===T)return;const x=T.split(", ").map(F=>F.trim());for(const F of x)r.add(F)}});const h=new Map(this.options.map(u=>[u.value,u.selected]));this.options=Array.from(r).sort((u,_)=>u.localeCompare(_)).map(u=>({value:u,selected:h.get(u)??!0})),this._applySearch()}_applySearch(){const r=this.searchText.toLowerCase().trim();this.filteredOptions=r?this.options.filter(h=>h.value.toLowerCase().includes(r)):this.options}static \u0275fac=function(h){return new(h||v)};static \u0275cmp=d.VBU({type:v,selectors:[["cue-multi-select-filter"]],decls:7,vars:3,consts:[["direction","column","gap","s"],["placeholder","Search...","size","s",3,"value"],["size","s","label","Select all",3,"checkedChange","checked"],[1,"msf-list"],["size","s",3,"label","checked"],["size","s"],["placeholder","Search...","size","s",3,"valueChange","value"],["size","s",3,"checkedChange","label","checked"]],template:function(h,u){1&h&&(d.j41(0,"cue-flexcontainer",0),d.nVh(1,k,1,1,"cue-input",1),d.j41(2,"cue-checkbox",2),d.bIt("checkedChange",function(T){return u.toggleAll(T)}),d.k0s(),d.j41(3,"div",3),d.Z7z(4,P,1,2,"cue-checkbox",4,g),d.nVh(6,R,2,0,"cue-typography",5),d.k0s()()),2&h&&(d.R7$(),d.vxM(u.options.length>10?1:-1),d.R7$(),d.Y8G("checked",u.allSelected),d.R7$(2),d.Dyx(u.filteredOptions),d.R7$(2),d.vxM(0===u.filteredOptions.length?6:-1))},dependencies:[s.YN,y.S,I.p,C.Typography,L.n],styles:["[_nghost-%COMP%]{display:block;padding:var(--cue-card-padding-y) var(--cue-card-padding-x);min-width:200px;max-width:300px;box-sizing:border-box}.msf-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px;max-height:200px;overflow-y:auto}"],changeDetection:0})}return v})()},5902(N,S,o){o.d(S,{U:()=>R});var M=o(7705),p=o(5802),s=o(2271),y=o(9352),I=o(8957),C=o(2444),L=o(2245),d=o(5381),g=o(5547);function k(E,v){if(1&E){const f=g.RV6();g.j41(0,"cue-input",4),g.bIt("valueChange",function(h){p.eBV(f);const u=g.XpG();return p.Njj(u.onValueChange(h))}),g.k0s()}if(2&E){const f=g.XpG();g.Y8G("value",f.filterText)}}function P(E,v){if(1&E){const f=g.RV6();g.j41(0,"cue-typography",5),g.bIt("click",function(){p.eBV(f);const h=g.XpG();return p.Njj(h.clear())}),g.EFF(1,"Clear"),g.k0s()}}let R=(()=>{class E{_cdr=(0,p.WQX)(M.gRc);_params;filterText="";filterType="contains";filterTypeOptions=["contains","notContains","equals","notEqual","startsWith","endsWith","blank","notBlank"];_labelContains=(0,y.Xx)("components.agGridColumnSelect.textFilterContains");_labelNotContains=(0,y.Xx)("components.agGridColumnSelect.textFilterNotContains");_labelEquals=(0,y.Xx)("components.agGridColumnSelect.textFilterEquals");_labelNotEqual=(0,y.Xx)("components.agGridColumnSelect.textFilterNotEqual");_labelStartsWith=(0,y.Xx)("components.agGridColumnSelect.textFilterStartsWith");_labelEndsWith=(0,y.Xx)("components.agGridColumnSelect.textFilterEndsWith");_labelBlank=(0,y.Xx)("components.agGridColumnSelect.textFilterBlank");_labelNotBlank=(0,y.Xx)("components.agGridColumnSelect.textFilterNotBlank");filterTypeLabelMap=(0,s.EW)(()=>({contains:this._labelContains(),notContains:this._labelNotContains(),equals:this._labelEquals(),notEqual:this._labelNotEqual(),startsWith:this._labelStartsWith(),endsWith:this._labelEndsWith(),blank:this._labelBlank(),notBlank:this._labelNotBlank()}));showTextInput=(0,s.EW)(()=>!["blank","notBlank"].includes(this.filterType));agInit(f){this._params=f}afterGuiAttached(f){this._cdr.markForCheck()}isFilterActive(){return!!["blank","notBlank"].includes(this.filterType)||this.filterText.trim().length>0}doesFilterPass(f){const r=this._params.getValue(f.node),h=null==r?"":String(r),u=this.filterText.toLowerCase().trim(),_=h.toLowerCase();switch(this.filterType){case"contains":default:return _.includes(u);case"notContains":return!_.includes(u);case"equals":return _===u;case"notEqual":return _!==u;case"startsWith":return _.startsWith(u);case"endsWith":return _.endsWith(u);case"blank":return""===h;case"notBlank":return""!==h}}getModel(){return this.isFilterActive()?{filterType:"text",type:this.filterType,filter:this.filterText}:null}setModel(f){this.filterText=f?.filter??"",this.filterType=f?.type??"contains",this._cdr.markForCheck()}onValueChange(f){this.filterText=f,this._params.filterChangedCallback(),this._cdr.markForCheck()}onFilterTypeChange(f){this.filterType=String(f||"contains"),["blank","notBlank"].includes(this.filterType)&&(this.filterText=""),this._params.filterChangedCallback(),this._cdr.markForCheck()}clear(){this.filterText="",this.filterType="contains",this._params.filterChangedCallback(),this._cdr.markForCheck()}static \u0275fac=function(r){return new(r||E)};static \u0275cmp=g.VBU({type:E,selectors:[["cue-text-filter"]],decls:4,vars:5,consts:[["direction","column","gap","s"],["size","s",3,"valueChange","value","options","labelMap"],["placeholder","Filter...","size","s",3,"value"],["size","s",2,"cursor","pointer","text-align","right"],["placeholder","Filter...","size","s",3,"valueChange","value"],["size","s",2,"cursor","pointer","text-align","right",3,"click"]],template:function(r,h){1&r&&(g.j41(0,"cue-flexcontainer",0)(1,"cue-select",1),g.bIt("valueChange",function(_){return h.onFilterTypeChange(_)}),g.k0s(),g.nVh(2,k,1,1,"cue-input",2),g.nVh(3,P,2,0,"cue-typography",3),g.k0s()),2&r&&(g.R7$(),g.Y8G("value",h.filterType)("options",h.filterTypeOptions)("labelMap",h.filterTypeLabelMap()),g.R7$(),g.vxM(h.showTextInput()?2:-1),g.R7$(),g.vxM(h.filterText||"contains"!==h.filterType?3:-1))},dependencies:[I.p,C.l,L.Typography,d.n],styles:["[_nghost-%COMP%]{display:block;padding:var(--cue-card-padding-y) var(--cue-card-padding-x);min-width:180px;max-width:280px;box-sizing:border-box}"],changeDetection:0})}return E})()},5448(N,S,o){o.d(S,{L:()=>I});var M=o(7705),p=o(2245),s=o(5547);const y=["*"];let I=(()=>{class C{fontSize=(0,M.hFB)("m");italic=(0,M.hFB)(!1);noWrap=(0,M.hFB)(!0);static \u0275fac=function(g){return new(g||C)};static \u0275cmp=s.VBU({type:C,selectors:[["cue-button-label"]],inputs:{fontSize:[1,"fontSize"],italic:[1,"italic"],noWrap:[1,"noWrap"]},ngContentSelectors:y,decls:3,vars:3,consts:[[3,"size","italic","noWrap"]],template:function(g,k){1&g&&(s.NAR(),s.j41(0,"div")(1,"cue-typography",0),s.SdG(2),s.k0s()()),2&g&&(s.R7$(),s.Y8G("size",k.fontSize())("italic",k.italic())("noWrap",k.noWrap()))},dependencies:[p.Typography],styles:["div[_ngcontent-%COMP%]{transform:translateY(.05em)}"]})}return C})()},9882(N,S,o){o.d(S,{CueEntityList:()=>ee});var M=o(467),p=o(7705),s=o(5802),y=o(2271),I=o(2611),C=o(9352),L=o(1951),d=o(6455),g=o(8334),k=o(5949),P=o(2843),R=o(3646),E=o(8017),v=o(2306),f=o(6103);let r=(()=>{class l{mapboxToken=(0,s.vPA)(void 0);entityData=(0,s.vPA)({});availableEntityRelationships=(0,s.vPA)([]);settings=(0,y.EW)(()=>{const e=this.mapboxToken();if(!e)return;const n=new v.yY;return n.mapboxToken=e,n.contextMenu.showFlyTo=!1,n.contextMenu.showProperties=!1,n});layers=(0,y.EW)(()=>{const e=this.entityData(),n=this.availableEntityRelationships();return(0,f.N)({entityData:e,availableEntityRelationships:n})});static \u0275fac=function(n){return new(n||l)};static \u0275prov=s.jDH({token:l,factory:l.\u0275fac,providedIn:"root"})}return l})();var h=o(3183),u=o(5902);let _=(()=>{class l{entities=(0,s.vPA)([]);entityData=(0,s.vPA)({});orderByMentionCount=(0,s.vPA)(!1);availableEntityCategories=(0,s.vPA)(void 0);labelValue=(0,C.Xx)("components.entityList.labelValue");labelCategories=(0,C.Xx)("components.entityList.labelCategories");labelMentions=(0,C.Xx)("components.entityList.labelMentionCount");_filterChangeCounter=(0,s.vPA)(0);filterChangeCounter=this._filterChangeCounter.asReadonly();onFilterChanged(){this._filterChangeCounter.update(e=>e+1)}columnDefs=(0,y.EW)(()=>{const e=[{field:"value",headerName:this.labelValue(),flex:2,filter:u.U,valueGetter:n=>!n.data?.value&&n.data?.loading?"Loading...":n.data?.value||n.data?.entity},{field:"categories",headerName:this.labelCategories(),flex:1.5,filter:h.A,valueGetter:n=>{const i=n.data?.categories;if(!i)return n.data?.loading?"...":"";const a=Array.isArray(i)?i:[i],c=this._leafEntityCategoryIris();return(c?a.filter(b=>c.has(b)):a).map(b=>this._getEntityCategoryLabel(b)).join(", ")}}];return this.orderByMentionCount()&&e.push({field:"mentionCount",headerName:this.labelMentions(),flex:1,filter:"agNumberColumnFilter",valueGetter:n=>{const i=n.data;if(i?.loading)return"...";const a=i?.mentionCount??0;return a>0?a:""},cellStyle:{textAlign:"center"}}),e});rows=(0,y.EW)(()=>{const e=this.entities()||[],n=this.entityData()||{},i=e.map(a=>{const c=n[a];return{entity:a,value:c?.value,categories:c?.categories,mentionCount:c?.mentionCount,loading:!c}});return this.orderByMentionCount()?i.sort((a,c)=>(c.mentionCount||0)-(a.mentionCount||0)):i});_leafEntityCategoryIris=(0,y.EW)(()=>{const e=this.availableEntityCategories();if(!e)return null;const n=new Set(e.map(i=>i.parent).filter(i=>!!i));return new Set(e.filter(i=>!n.has(i.iri)).map(i=>i.iri))});_getEntityCategoryLabel(e){const n=this.availableEntityCategories();if(void 0!==n){const i=n.find(a=>a.iri===e);if(i)return i.label}return this._prettifyCategory(e)}_prettifyCategory(e){if(!e)return"";const n=e.split("#");return(n[n.length-1]||e).replace(/([A-Z])/g," $1").trim()}static \u0275fac=function(n){return new(n||l)};static \u0275prov=s.jDH({token:l,factory:l.\u0275fac,providedIn:"root"})}return l})();var T=o(5971),x=o(5448),F=o(2014),G=o(5381),t=o(5547);function j(l,B){if(1&l){const e=t.RV6();t.j41(0,"cue-flexcontainer",2)(1,"cue-button",5),t.bIt("click",function(){s.eBV(e);const i=t.XpG();return s.Njj(i.onOrderByMentionCountClick())}),t.nrm(2,"cue-button-padder"),t.j41(3,"cue-button-label"),t.EFF(4),t.nI1(5,"transloco"),t.k0s(),t.nrm(6,"cue-button-padder"),t.k0s()()}if(2&l){const e=t.XpG();t.R7$(),t.Y8G("tooltip",e.infoOrderByMentionCount()),t.R7$(3),t.JRh(t.bMT(5,2,"components.entityList.labelOrderByMentionCount"))}}function V(l,B){if(1&l){const e=t.RV6();t.j41(0,"cue-tab",1),t.nI1(1,"transloco"),t.j41(2,"cue-map",6),t.bIt("clickedFeature",function(i){s.eBV(e);const a=t.XpG();return s.Njj(a.onMapFeatureClick(i))}),t.k0s()()}if(2&l){t.XpG();const e=t.r8f(6),n=t.r8f(7);t.Y8G("label",t.bMT(1,3,"components.entityList.tabMap")),t.R7$(2),t.Y8G("layers",n)("settings",e)}}let z=(()=>{class l{map=(0,s.WQX)(r);table=(0,s.WQX)(_);entities=p.hFB.required();mapboxToken=(0,p.hFB)(void 0);handlers=p.hFB.required();availableEntityCategories=(0,p.hFB)(void 0);availableEntityRelationships=(0,p.hFB)();entityData=(0,p.hFB)({});paginationPageSize=(0,p.hFB)(10);prefetchPages=(0,p.hFB)(3);variant=(0,p.hFB)("none");rowClicked=(0,p.CGW)();clickedOpen=(0,p.CGW)();_gridApi=null;_requestedIris=new Set;_requestedLocationIris=new Set;_isSorted=!1;_pendingMapClickIri=(0,s.vPA)(null);_bufferedUntilIndex=(0,s.vPA)(0);_locationBufferedUntilIndex=0;_lastEntitiesKey="";_destroyed=!1;labelOpenInEntityViewer=(0,C.Xx)("components.entityList.labelOpenInEntityViewer");infoOrderByMentionCount=(0,C.Xx)("components.entityList.infoOrderByMentionCount");overlaySettings={...new L.K,mode:"row"};overlayActions=(0,y.EW)(()=>[{label:this.labelOpenInEntityViewer(),icon:"info",action:e=>{this.handlers().requestOpen?.(e.rowData),this.clickedOpen.emit(e.rowData)}}]);constructor(){(0,s.QZP)(()=>this.map.mapboxToken.set(this.mapboxToken())),(0,s.QZP)(()=>{const e=this.entityData();this.map.entityData.update(n=>{let i=!1;const a={...n};for(const[c,m]of Object.entries(e))(m.directMapGeometries?.length||m.indirectMapGeometries?.length)&&(a[c]={value:"",categories:[],directMapGeometries:m.directMapGeometries,indirectMapGeometries:m.indirectMapGeometries},i=!0);return i?a:n})}),(0,s.QZP)(()=>this.map.availableEntityRelationships.set(this.availableEntityRelationships()??[])),(0,s.QZP)(()=>this.table.availableEntityCategories.set(this.availableEntityCategories())),(0,s.QZP)(()=>this.table.entities.set(this.entities())),(0,s.QZP)(()=>this.table.entityData.set(this.entityData())),(0,s.QZP)(()=>{const e=this._pendingMapClickIri();if(!e)return;const n=this.entityData()[e];n&&(this._pendingMapClickIri.set(null),this.rowClicked.emit({entity:e,value:n.value,categories:n.categories,mentionCount:n.mentionCount,loading:!1}))}),(0,s.QZP)(()=>{const n=this.entities().join("|");if(n!==this._lastEntitiesKey)if(this._lastEntitiesKey=n,this._requestedIris.clear(),this._requestedLocationIris.clear(),this._bufferedUntilIndex.set(0),this._locationBufferedUntilIndex=0,this.handlers().checkHasLocations&&this.handlers().requestLocations){const i=(this.availableEntityCategories()??[]).map(a=>a.iri);this.handlers().checkHasLocations(i).then(a=>{a&&!this._destroyed&&this._requestLocationBatch()})}else this.handlers().requestLocations&&setTimeout(()=>this._requestLocationBatch())}),(0,s.QZP)(()=>{const e=this.table.orderByMentionCount(),n=this.table.filterChangeCounter();if(e||n>0){const c=this.entities().filter(m=>!this._requestedIris.has(m));c.length>0&&(c.forEach(m=>this._requestedIris.add(m)),this.handlers().requestData(c,e))}})}rowSelection={mode:"singleRow",checkboxes:!1,enableClickSelection:!0};onGridReady(e){this._gridApi=e,e.addEventListener("viewportChanged",()=>this._checkViewport()),e.addEventListener("modelUpdated",()=>this._checkViewport()),e.addEventListener("paginationChanged",()=>this._checkViewport()),e.addEventListener("sortChanged",()=>{const n=e.getColumnState();this._isSorted=n.some(i=>null!=i.sort),this._isSorted&&this._requestAllUnloaded()}),e.addEventListener("filterChanged",()=>{this.table.onFilterChanged()}),setTimeout(()=>this._checkViewport(),100)}onMapFeatureClick(e){var n=this;return(0,M.A)(function*(){const a=e.feature.properties?.iri;a&&(n._pendingMapClickIri.set(a),yield n.handlers().requestData?.([a],n.table.orderByMentionCount()))})()}_checkViewport(){if(!this._gridApi||this._gridApi.isDestroyed?.())return;if(this._isSorted)return void this._requestAllUnloaded();const e=this.entities(),n=e.length;if(!n)return;const i=Math.max(1,this._gridApi.paginationGetPageSize?.()??this.paginationPageSize()),c=Math.max(0,this._gridApi.paginationGetCurrentPage?.()??0)*i,m=Math.min(n,c+i),b=this._bufferedUntilIndex();let D=null;if(0===b?D=0:(c>=Math.max(0,b-i)||m>b)&&(D=b),null===D||D>=n)return;const A=i*Math.max(1,this.prefetchPages()),w=Math.min(n,D+A),W=e.slice(D,w).filter(O=>!this._requestedIris.has(O));this._bufferedUntilIndex.set(Math.max(b,w)),W.length&&(W.forEach(O=>this._requestedIris.add(O)),setTimeout(()=>this.handlers().requestData(W,this.table.orderByMentionCount())))}_requestLocationBatch(){if(!this.handlers().requestLocations)return;const e=this.entities(),n=e.length;if(this._locationBufferedUntilIndex>=n)return;const a=Math.min(n,this._locationBufferedUntilIndex+500),c=e.slice(this._locationBufferedUntilIndex,a).filter(m=>!this._requestedLocationIris.has(m));this._locationBufferedUntilIndex=a,c.length>0&&(c.forEach(m=>this._requestedLocationIris.add(m)),setTimeout(()=>this.handlers().requestLocations(c))),a<n&&!this._destroyed&&setTimeout(()=>this._requestLocationBatch(),200)}ngOnDestroy(){this._destroyed=!0,this._gridApi=null}_requestAllUnloaded(){if(!this._gridApi)return;const e=[];if(this._gridApi.forEachNode(n=>{const i=n.data;i?.loading&&!this._requestedIris.has(i.entity)&&e.push(i.entity)}),e.length>0){const n=Array.from(new Set(e));n.forEach(i=>this._requestedIris.add(i)),this.handlers().requestData(n,this.table.orderByMentionCount())}}onOrderByMentionCountClick(){this.table.orderByMentionCount.set(!this.table.orderByMentionCount())}static \u0275fac=function(n){return new(n||l)};static \u0275cmp=t.VBU({type:l,selectors:[["cue-ent-list-inner"]],inputs:{entities:[1,"entities"],mapboxToken:[1,"mapboxToken"],handlers:[1,"handlers"],availableEntityCategories:[1,"availableEntityCategories"],availableEntityRelationships:[1,"availableEntityRelationships"],entityData:[1,"entityData"],paginationPageSize:[1,"paginationPageSize"],prefetchPages:[1,"prefetchPages"],variant:[1,"variant"]},outputs:{rowClicked:"rowClicked",clickedOpen:"clickedOpen"},features:[t.Jv_([k.u,P.M,R.B,r,_])],decls:9,vars:14,consts:[[2,"position","relative","width","100%","height","100%","display","flex","flex-direction","column","gap","12px",3,"variant"],[3,"label"],["direction","row","justify","end",2,"width","100%","padding-bottom","6px"],[2,"flex","1","min-height","0","position","relative","display","flex","flex-direction","column"],["height","100%",2,"flex","1","min-height","0",3,"gridApiReady","selectedRows","columnDefs","rowData","rowSelection","paginationPageSize","overlaySettings","overlayActions"],["size","xs","variant","secondary",3,"click","tooltip"],[3,"clickedFeature","layers","settings"]],template:function(n,i){if(1&n&&(t.j41(0,"cue-tabs",0)(1,"cue-tab",1),t.nI1(2,"transloco"),t.nVh(3,j,7,4,"cue-flexcontainer",2),t.j41(4,"div",3)(5,"cue-ag-grid",4),t.bIt("gridApiReady",function(c){return i.onGridReady(c)})("selectedRows",function(c){return c[0]&&i.rowClicked.emit(c[0])}),t.k0s()()(),t.SS7(6)(7),t.nVh(8,V,3,5,"cue-tab",1),t.k0s()),2&n){t.Y8G("variant",i.variant()),t.R7$(),t.Y8G("label",t.bMT(2,10,"components.entityList.tabList")),t.R7$(2),t.vxM(i.table.orderByMentionCount()?-1:3),t.R7$(2),t.Y8G("columnDefs",i.table.columnDefs())("rowData",i.table.rows())("rowSelection",i.rowSelection)("paginationPageSize",i.paginationPageSize())("overlaySettings",i.overlaySettings)("overlayActions",i.overlayActions()),t.R7$();const a=t.bH3(i.map.settings());t.R7$();const c=t.bH3(i.map.layers());t.R7$(),t.vxM(c.length>0&&a?8:-1)}},dependencies:[I.R,d.t,g.o,E.T,T.$,x.L,F.z,G.n,C.Kj],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%}"],changeDetection:0})}return l})();var U=o(2245),X=o(9769),K=o(7851),$=o(7293);function Y(l,B){if(1&l&&(t.j41(0,"cue-flexcontainer",2)(1,"cue-typography",4),t.EFF(2),t.k0s()()),2&l){const e=t.XpG(2);t.R7$(2),t.SpI(" ",e.errorMessage()," ")}}function q(l,B){if(1&l){const e=t.RV6();t.j41(0,"cue-ent-list-inner",7),t.bIt("rowClicked",function(i){s.eBV(e);const a=t.XpG(3);return s.Njj(a.rowClicked.emit(i))})("clickedOpen",function(i){s.eBV(e);const a=t.XpG(3);return s.Njj(a.clickedOpen.emit(i))}),t.k0s()}if(2&l){const e=t.XpG(3);t.Y8G("entities",e._displayIris())("entityData",e.entityData())("handlers",e.handlers())("mapboxToken",e.mapboxToken())("paginationPageSize",e.paginationPageSize())("variant",e.variant())}}function Q(l,B){1&l&&(t.j41(0,"cue-flexcontainer",2)(1,"cue-typography",8),t.EFF(2," No project connected. "),t.k0s()())}function Z(l,B){if(1&l&&t.nrm(0,"cue-logo-link",6),2&l){let e;const n=t.XpG(3);t.Y8G("projectId",null==(e=n.sdkState())?null:e.projectId)}}function H(l,B){if(1&l&&(t.j41(0,"div",3),t.nVh(1,q,1,6,"cue-ent-list-inner",5)(2,Q,3,0,"cue-flexcontainer",2),t.nVh(3,Z,1,1,"cue-logo-link",6),t.k0s()),2&l){const e=t.XpG(2);t.Y8G("cueLogoLoader","loading"===e.state()),t.R7$(),t.vxM(e.handlers()?1:"loading"!==e.state()?2:-1),t.R7$(2),t.vxM(e.showLogo()?3:-1)}}function J(l,B){if(1&l&&t.nVh(0,Y,3,1,"cue-flexcontainer",2)(1,H,4,3,"div",3),2&l){const e=t.XpG();t.vxM("error"===e.state()?0:1)}}let ee=(()=>{class l{iris=(0,p.hFB)([]);categoryIris=(0,p.hFB)(void 0);sdkState=(0,p.hFB)(void 0);mapboxToken=(0,p.hFB)(void 0);paginationPageSize=(0,p.hFB)(10,{transform:p.Udg});variant=(0,p.hFB)("none");showLogo=(0,p.hFB)(!1,{transform:p.L39});rowClicked=(0,p.CGW)();clickedOpen=(0,p.CGW)();state=(0,s.vPA)("idle");errorMessage=(0,s.vPA)(null);entityData=(0,s.vPA)({});_entities=(0,s.vPA)(void 0);_categoryResolvedIris=(0,s.vPA)([]);_displayIris=(0,y.EW)(()=>void 0!==this.categoryIris()?this._categoryResolvedIris():this.iris());_unsubscribe;_inputWarningTimer;handlers=(0,y.EW)(()=>{var e=this;const n=this._entities();if(n)return{requestData:(i,a)=>{const c=i.map(m=>m.split("/").pop()).filter(Boolean);n.requestEntityData(c,a)},requestLocations:i=>{if(!this.mapboxToken())return void console.warn("[cue-entity-list] No mapboxToken provided \u2014 skipping map location fetch.");const a=i.map(c=>c.split("/").pop()).filter(Boolean);n.requestEntityLocations(a)},checkHasLocations:(i=(0,M.A)(function*(a){const c=e.sdkState()?.cue,m=e.sdkState()?.projectId;if(!(e.mapboxToken()&&c&&m&&a.length))return!1;const D=`PREFIX qcy: <https://dev.qaecy.com/ont#>\nASK WHERE {\n ?entity qcy:hasEntityCategory ?cat .\n FILTER(?cat IN (${a.map(A=>`<${A}>`).join(" ")}))\n { ?entity qcy:similarTo ?osm . FILTER(STRSTARTS(STR(?osm), "https://www.openstreetmap.org/")) }\n UNION\n { ?entity qcy:relatedEntity ?loc . ?loc qcy:similarTo ?osm . FILTER(STRSTARTS(STR(?osm), "https://www.openstreetmap.org/")) }\n}`;try{return!0===(yield c.api.sparql(D,m))?.boolean}catch{return!1}}),function(c){return i.apply(this,arguments)})};var i});constructor(){this._inputWarningTimer=setTimeout(()=>{this.sdkState()||console.warn('[cue-entity-list] Required input "sdkState" is not set. Pass a { entities: CueProjectEntities } (or include a `cue` instance) object to load entity data.')},3e3),(0,s.QZP)(()=>{this._setupEntities(this.sdkState()?.entities)}),(0,s.QZP)(()=>{const e=this.categoryIris(),n=this._entities();void 0!==e&&this._fetchByCategories(e,n)})}ngOnDestroy(){clearTimeout(this._inputWarningTimer),this._teardown()}_setupEntities(e){if(this._teardown(),!e)return this._entities.set(void 0),this.entityData.set({}),void this.state.set("idle");this._entities.set(e),this.state.set("ready"),this._syncEntityData(e),this._unsubscribe=e.entityInfoMap.subscribe(()=>{this._syncEntityData(e)})}_syncEntityData(e){const n=e.entityInfoMap.get(),i={};for(const a of Object.keys(n)){const c=n[a],m=Array.isArray(c.documentRefs)?c.documentRefs.map(b=>"string"==typeof b?{id:b}:b):c.documentRefs;i[e.entityIri(a)]={...c,documentRefs:m}}this.entityData.set(i)}_fetchByCategories(e,n){var i=this;return(0,M.A)(function*(){if(n&&e.length){i.state.set("loading");try{const a=yield n.entitiesByCategory(e);i._categoryResolvedIris.set(a.map(c=>c.iri)),i.state.set("ready")}catch(a){console.error("[cue-entity-list] Failed to fetch entities by category",a),i.errorMessage.set("Failed to load entities for the given categories."),i.state.set("error")}}else i._categoryResolvedIris.set([])})()}_teardown(){this._unsubscribe?.(),this._unsubscribe=void 0}static \u0275fac=function(n){return new(n||l)};static \u0275cmp=t.VBU({type:l,selectors:[["cue-entity-list"]],inputs:{iris:[1,"iris"],categoryIris:[1,"categoryIris"],sdkState:[1,"sdkState"],mapboxToken:[1,"mapboxToken"],paginationPageSize:[1,"paginationPageSize"],variant:[1,"variant"],showLogo:[1,"showLogo"]},outputs:{rowClicked:"rowClicked",clickedOpen:"clickedOpen"},decls:3,vars:1,consts:[["body",""],[3,"ngTemplateOutlet"],["direction","column","align","center","justify","center",2,"height","100%","width","100%","padding","8px"],[2,"position","relative","height","100%","width","100%",3,"cueLogoLoader"],[2,"color","#c44","font-size","13px"],[2,"height","100%",3,"entities","entityData","handlers","mapboxToken","paginationPageSize","variant"],[2,"position","absolute","top","12px","right","12px","z-index","5",3,"projectId"],[2,"height","100%",3,"rowClicked","clickedOpen","entities","entityData","handlers","mapboxToken","paginationPageSize","variant"],[2,"color","#9ca3af","font-size","13px"]],template:function(n,i){if(1&n&&(t.DNE(0,J,2,1,"ng-template",null,0,t.C5r),t.eu8(2,1)),2&n){const a=t.sdS(1);t.R7$(2),t.Y8G("ngTemplateOutlet",a)}},dependencies:[z,G.n,U.Typography,X.T3,K.k,$.x],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%}"],changeDetection:0})}return l})()}}]);