@qaecy/cue-ui 0.0.38 → 0.0.39

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/673.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[673],{5903(j,z,r){r.d(z,{L:()=>Ae});var c=r(7705),a=r(5802),g=r(2271),k=r(4853),V=r(9495),f=r(467),s=r(9352),_=r(5745),v=r(5381),y=r(5971),x=r(2245),w=r(9421),P=r(8957),R=r(5448),E=r(2444),m=r(9417),C=r(7374),d=r.n(C),M=r(3319),e=r(5547);const H=(o,u)=>u.date;function $(o,u){if(1&o&&(e.j41(0,"cue-typography",11),e.EFF(1),e.nI1(2,"transloco"),e.k0s()),2&o){const t=u.$implicit,i=e.XpG();e.Y8G("size",i.size()),e.R7$(),e.JRh(e.bMT(2,2,t))}}function L(o,u){if(1&o){const t=e.RV6();e.j41(0,"cue-button",13),e.bIt("click",function(){const n=a.eBV(t).$implicit,l=e.XpG();return a.Njj(l.selectDay(n))}),e.j41(1,"cue-button-label"),e.EFF(2),e.k0s()()}if(2&o){const t=u.$implicit,i=e.XpG();e.AVh("other-month",!t.isCurrentMonth)("today",t.isToday),e.Y8G("selected",t.isSelected)("size",i.size()),e.R7$(2),e.JRh(t.day)}}let X=(()=>{class o{date=c.geq.required();size=(0,c.hFB)("m");weekdays=["mon","tue","wed","thu","fri","sat","sun"].map(t=>`common.weekdaysShort.${t}`);yearOptions=Array.from({length:101},(t,i)=>(d()().year()-50+i).toString()).reverse();monthOptions=Array.from({length:12},(t,i)=>(i+1).toString());chevronSize=(0,g.EW)(()=>{const t=this.size();return"l"===t?"m":"m"===t?"s":"s"===t?"xs":"s"});monthLabels={1:"January",2:"February",3:"March",4:"April",5:"May",6:"June",7:"July",8:"August",9:"September",10:"October",11:"November",12:"December"};today=(0,g.EW)(()=>d()().format("YYYY-MM-DD"));calendarDays=(0,g.EW)(()=>{const t=this.year(),i=this.month(),n=d()(this.date()),l=this.today(),p=d()(`${t}-${i}-01`),h=p.endOf("month"),O=0===p.day()?p.subtract(6,"day"):p.subtract(p.day()-1,"day"),F=0===h.day()?h:h.add(7-h.day(),"day"),D=[];let b=O;for(;b.isBefore(F)||b.isSame(F);){const A=b.format("YYYY-MM-DD");D.push({date:A,day:b.date(),isCurrentMonth:b.month()+1===i,isSelected:b.isSame(n,"day"),isToday:A===l,dayjs:b}),b=b.add(1,"day")}return D});jsDate=(0,g.EW)(()=>d()(this.date()));year=(0,g.uu)(()=>this.jsDate().year());month=(0,g.uu)(()=>this.jsDate().month()+1);day=(0,g.uu)(()=>this.jsDate().date());updateDate(){const t=d()(new Date(this.year(),this.month()-1,this.day())).format("YYYY-MM-DD");this.date.set(t)}navigateMonth(t="next"){const i=d()(this.date()),n="next"===t?i.add(1,"month"):i.subtract(1,"month");this.date.set(n.format("YYYY-MM-DD"))}navigateYear(t="next"){const i=d()(this.date()),n="next"===t?i.add(1,"year"):i.subtract(1,"year");this.date.set(n.format("YYYY-MM-DD"))}selectDay(t){this.date.set(t.date),t.isCurrentMonth||(this.year.set(t.dayjs.year()),this.month.set(t.dayjs.month()+1))}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=e.VBU({type:o,selectors:[["cue-datepicker"]],inputs:{date:[1,"date"],size:[1,"size"]},outputs:{date:"dateChange"},decls:17,vars:10,consts:[["direction","column"],["gap","m","justify","center","align","center",2,"width","100%"],["variant","ghost",3,"size"],["icon","paginator-first",3,"click"],["icon","paginator-back",3,"click"],["justify","center",2,"width","200px"],["label","Month",3,"valueChange","size","options","labelMap","value"],["label","Year",3,"valueChange","size","options","value"],["icon","paginator-next",3,"click"],["icon","paginator-last",3,"click"],[1,"calendar-grid"],[3,"size"],["variant","ghost",3,"other-month","today","selected","size"],["variant","ghost",3,"click","selected","size"]],template:function(i,n){1&i&&(e.j41(0,"cue-flexcontainer",0)(1,"cue-flexcontainer",1)(2,"cue-button",2)(3,"cue-button-icon",3),e.bIt("click",function(){return n.navigateYear("prev")}),e.k0s(),e.j41(4,"cue-button-icon",4),e.bIt("click",function(){return n.navigateMonth("prev")}),e.k0s()(),e.j41(5,"cue-flexcontainer",5)(6,"cue-select",6),e.mxI("valueChange",function(p){return e.DH7(n.month,p)||(n.month=p),p}),e.bIt("valueChange",function(){return n.updateDate()}),e.k0s(),e.j41(7,"cue-select",7),e.mxI("valueChange",function(p){return e.DH7(n.year,p)||(n.year=p),p}),e.bIt("valueChange",function(){return n.updateDate()}),e.k0s()(),e.j41(8,"cue-button",2)(9,"cue-button-icon",8),e.bIt("click",function(){return n.navigateMonth("next")}),e.k0s()(),e.j41(10,"cue-button",2)(11,"cue-button-icon",9),e.bIt("click",function(){return n.navigateYear("next")}),e.k0s()()(),e.j41(12,"div",10),e.Z7z(13,$,3,4,"cue-typography",11,e.Vm6),e.Z7z(15,L,3,7,"cue-button",12,H),e.k0s()()),2&i&&(e.R7$(2),e.Y8G("size",n.chevronSize()),e.R7$(4),e.Y8G("size",n.size())("options",n.monthOptions)("labelMap",n.monthLabels),e.R50("value",n.month),e.R7$(),e.Y8G("size",n.size())("options",n.yearOptions),e.R50("value",n.year),e.R7$(),e.Y8G("size",n.chevronSize()),e.R7$(2),e.Y8G("size",n.chevronSize()),e.R7$(3),e.Dyx(n.weekdays),e.R7$(2),e.Dyx(n.calendarDays()))},dependencies:[v.n,E.l,y.$,R.L,x.Typography,M.a,s.Kj],styles:[".calendar-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(7,1fr);gap:2px;margin-top:12px}.other-month[_ngcontent-%COMP%]{opacity:.4}"],changeDetection:0})}return o})();var W=r(7023),K=r(5187);const Q=["inputField"];function J(o,u){1&o&&e.EFF(0," * ")}function U(o,u){if(1&o){const t=e.RV6();e.j41(0,"cue-card",8)(1,"cue-datepicker",9),e.mxI("dateChange",function(n){a.eBV(t);const l=e.XpG();return e.DH7(l.internalDateValue,n)||(l.internalDateValue=n),a.Njj(n)}),e.bIt("dateChange",function(n){a.eBV(t);const l=e.XpG();return a.Njj(l.onDateChange(n))})("click",function(n){return n.stopPropagation()}),e.k0s()()}if(2&o){const t=e.XpG();e.R7$(),e.R50("date",t.internalDateValue)}}function Z(o,u){if(1&o&&(e.j41(0,"cue-typography",7),e.EFF(1),e.k0s()),2&o){const t=e.XpG();e.R7$(),e.JRh(t.error())}}let q=(()=>{class o{value=(0,c.geq)("");label=(0,c.hFB)("");placeholder=(0,c.hFB)("");error=(0,c.hFB)(void 0);required=(0,c.hFB)(!1);size=(0,c.hFB)("m");datePickerPositioning=(0,c.hFB)(void 0);isFocused=!1;disabled=!1;iconSize=(0,g.EW)(()=>{switch(this.size()){case"l":return"m";case"m":default:return"s";case"s":case"xs":return"xs"}});contextMenuRef=null;inputField;internalDateValue=(0,g.uu)(()=>{const t=this.value();if(t){if(d()(t,"YYYY-MM-DD",!0).isValid())return t;const i=d()(t);return i.isValid()?i.format("YYYY-MM-DD"):d()().format("YYYY-MM-DD")}return d()().format("YYYY-MM-DD")});formattedDateValue=(0,g.EW)(()=>{const t=this.value();if(t){const i=d()(t);return i.isValid()?i.format("MMM D, YYYY"):t}return""});onValueChange=(0,a.QZP)(()=>this.valueChange.emit(this.value()));valueChange=(0,c.CGW)();onChange=t=>{};onTouched=()=>{};writeValue(t){this.value.set(t||"")}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.disabled=t}emitValue(t){const i=t.target.value;this.value.set(i),this.onChange(i)}focus(){this.isFocused=!0,this.inputField?.nativeElement&&this.inputField.nativeElement.focus()}onBlur(){this.isFocused=!1,this.onTouched()}onDateChange(t){this.value.set(t),this.onChange(t)}onDatePickerOpen(t){this.contextMenuRef=t}onDatePickerClose(){this.contextMenuRef=null}closeDatePicker(){this.contextMenuRef&&document.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window}))}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=e.VBU({type:o,selectors:[["cue-input-date"]],viewQuery:function(i,n){if(1&i&&e.GBs(Q,5),2&i){let l;e.mGM(l=e.lsd())&&(n.inputField=l.first)}},inputs:{value:[1,"value"],label:[1,"label"],placeholder:[1,"placeholder"],error:[1,"error"],required:[1,"required"],size:[1,"size"],datePickerPositioning:[1,"datePickerPositioning"]},outputs:{value:"valueChange",valueChange:"valueChange"},features:[e.Jv_([{provide:m.kq,useExisting:(0,a.Rfq)(()=>o),multi:!0}])],decls:11,vars:15,consts:[["inputField",""],["datePickerTemplate",""],[1,"form-field"],["size","s",1,"label"],["type","text","readonly","","trigger","leftclick",1,"input",3,"focus","blur","contextMenuOpen","contextMenuClose","value","placeholder","disabled","cueContextMenu","positioning"],["variant","ghost","trigger","leftclick",1,"calendar-button",3,"size","cueContextMenu","positioning"],["icon","calendar"],["size","s",1,"error-text"],[1,"date-picker-overlay","clickoutside-ignore"],["size","s",1,"clickoutside-ignore",3,"dateChange","click","date"]],template:function(i,n){if(1&i&&(e.j41(0,"div",2)(1,"cue-typography",3),e.EFF(2),e.nVh(3,J,1,0),e.k0s(),e.j41(4,"input",4,0),e.bIt("focus",function(){return n.isFocused=!0})("blur",function(){return n.onBlur()})("contextMenuOpen",function(p){return n.onDatePickerOpen(p)})("contextMenuClose",function(){return n.onDatePickerClose()}),e.k0s(),e.j41(6,"cue-button",5),e.nrm(7,"cue-button-icon",6),e.k0s(),e.DNE(8,U,2,1,"ng-template",null,1,e.C5r),e.nVh(10,Z,2,1,"cue-typography",7),e.k0s()),2&i){const l=e.sdS(9);e.HbH("size-"+n.size()),e.AVh("focused",n.isFocused||n.value()),e.R7$(2),e.SpI(" ",n.label()," "),e.R7$(),e.vxM(n.required()?3:-1),e.R7$(),e.Y8G("value",n.formattedDateValue())("placeholder",n.placeholder())("disabled",n.disabled)("cueContextMenu",l)("positioning",n.datePickerPositioning()??"bottomright"),e.R7$(2),e.Y8G("size",n.iconSize())("cueContextMenu",l)("positioning",n.datePickerPositioning()??"bottomright"),e.R7$(4),e.vxM(n.error()?10:-1)}},dependencies:[x.Typography,X,W.Q,K.Z,M.a,y.$],styles:['.form-field[_ngcontent-%COMP%]{position:relative}.input[_ngcontent-%COMP%]{color:var(--cue-input-value-color);width:100%;border:none;border-bottom:1px solid var(--cue-input-border-bottom-color);background:none;outline:none;font-family:var(--cue-font-family)}.size-xs[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]{padding:var(--cue-input-xs-padding);font-size:var(--cue-input-xs-font-size)}.size-s[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]{padding:var(--cue-input-s-padding);font-size:var(--cue-input-s-font-size)}.size-m[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]{padding:var(--cue-input-m-padding);font-size:var(--cue-input-m-font-size)}.size-l[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]{padding:var(--cue-input-l-padding);font-size:var(--cue-input-l-font-size)}.input[_ngcontent-%COMP%]::placeholder{color:var(--cue-input-placeholder-color);font-family:var(--cue-font-family)}.input[_ngcontent-%COMP%]:-webkit-autofill, .input[_ngcontent-%COMP%]:-webkit-autofill:hover, .input[_ngcontent-%COMP%]:-webkit-autofill:focus{-webkit-box-shadow:0 0 0px 1000px transparent inset;-webkit-transition:background-color 5000s ease-in-out 0s;transition:background-color 5000s ease-in-out 0s;-webkit-text-fill-color:var(--cue-input-value-color)}.label[_ngcontent-%COMP%]{position:absolute;pointer-events:none;transition:all .2s ease}.size-xs[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{top:var(--cue-input-xs-label-top);left:var(--cue-input-xs-label-left)}.size-s[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{top:var(--cue-input-s-label-top);left:var(--cue-input-s-label-left)}.size-m[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{top:var(--cue-input-m-label-top);left:var(--cue-input-m-label-left)}.size-l[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{top:var(--cue-input-l-label-top);left:var(--cue-input-l-label-left)}.form-field.focused[_ngcontent-%COMP%] .label[_ngcontent-%COMP%], .form-field[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]:not(:placeholder-shown) + .label[_ngcontent-%COMP%], .form-field[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:valid + .label[_ngcontent-%COMP%]{color:var(--cue-input-value-color)}.size-xs.focused[_ngcontent-%COMP%] .label[_ngcontent-%COMP%], .size-xs[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]:not(:placeholder-shown) + .label[_ngcontent-%COMP%], .size-xs[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:valid + .label[_ngcontent-%COMP%]{top:var(--cue-input-xs-label-focused-top);font-size:var(--cue-input-xs-label-focused-font-size)}.size-s.focused[_ngcontent-%COMP%] .label[_ngcontent-%COMP%], .size-s[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]:not(:placeholder-shown) + .label[_ngcontent-%COMP%], .size-s[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:valid + .label[_ngcontent-%COMP%]{top:var(--cue-input-s-label-focused-top);font-size:var(--cue-input-s-label-focused-font-size)}.size-m.focused[_ngcontent-%COMP%] .label[_ngcontent-%COMP%], .size-m[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]:not(:placeholder-shown) + .label[_ngcontent-%COMP%], .size-m[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:valid + .label[_ngcontent-%COMP%]{top:var(--cue-input-m-label-focused-top);font-size:var(--cue-input-m-label-focused-font-size)}.size-l.focused[_ngcontent-%COMP%] .label[_ngcontent-%COMP%], .size-l[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]:not(:placeholder-shown) + .label[_ngcontent-%COMP%], .size-l[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:valid + .label[_ngcontent-%COMP%]{top:var(--cue-input-l-label-focused-top);font-size:var(--cue-input-l-label-focused-font-size)}.underline[_ngcontent-%COMP%]{content:"";position:absolute;bottom:0;left:0;height:1px;width:0;background-color:var(--cue-input-border-bottom-color);transition:width .3s ease}.form-field.focused[_ngcontent-%COMP%] .underline[_ngcontent-%COMP%]{width:100%}.error-text[_ngcontent-%COMP%]{color:var(--cue-error);margin-top:4px;min-height:18px}.date-picker-overlay[_ngcontent-%COMP%]{box-shadow:0 4px 12px #00000026;min-width:320px;position:relative;z-index:10001}.date-picker-overlay[_ngcontent-%COMP%] [_ngcontent-%COMP%]:deep(cue-menu){z-index:10002!important}.date-picker-overlay[_ngcontent-%COMP%] [_ngcontent-%COMP%]:deep(.clickoutside-ignore){pointer-events:auto}.calendar-button[_ngcontent-%COMP%]{position:absolute;right:8px;top:50%;transform:translateY(-50%);z-index:10;opacity:.7;transition:opacity .2s ease}.calendar-button[_ngcontent-%COMP%]:hover{opacity:1}.input[_ngcontent-%COMP%]{padding-right:40px;box-sizing:border-box}.form-field[_ngcontent-%COMP%]{width:100%;max-width:none;box-sizing:border-box}'],changeDetection:0})}return o})();var ee=r(9695),N=r(1413),te=r(7421),ne=r(3293),I=r(7384),ie=r(3798);let oe=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275cmp=e.VBU({type:o,selectors:[["ng-component"]],hostAttrs:["cdk-text-field-style-loader",""],decls:0,vars:0,template:function(i,n){},styles:["textarea.cdk-textarea-autosize{resize:none}textarea.cdk-textarea-autosize-measuring{padding:2px 0 !important;box-sizing:content-box !important;height:auto !important;overflow:hidden !important}textarea.cdk-textarea-autosize-measuring-firefox{padding:2px 0 !important;box-sizing:content-box !important;height:0 !important}@keyframes cdk-text-field-autofill-start{/*!*/}@keyframes cdk-text-field-autofill-end{/*!*/}.cdk-text-field-autofill-monitored:-webkit-autofill{animation:cdk-text-field-autofill-start 0s 1ms}.cdk-text-field-autofill-monitored:not(:-webkit-autofill){animation:cdk-text-field-autofill-end 0s 1ms}\n"],encapsulation:2,changeDetection:0})}return o})(),le=(()=>{class o{_elementRef=(0,a.WQX)(e.aKT);_platform=(0,a.WQX)(te.O);_ngZone=(0,a.WQX)(a.SKi);_renderer=(0,a.WQX)(e.sFG);_resizeEvents=new N.B;_previousValue;_initialHeight;_destroyed=new N.B;_listenerCleanups;_minRows;_maxRows;_enabled=!0;_previousMinRows=-1;_textareaElement;get minRows(){return this._minRows}set minRows(t){this._minRows=(0,I.OE)(t),this._setMinHeight()}get maxRows(){return this._maxRows}set maxRows(t){this._maxRows=(0,I.OE)(t),this._setMaxHeight()}get enabled(){return this._enabled}set enabled(t){this._enabled!==t&&((this._enabled=t)?this.resizeToFitContent(!0):this.reset())}get placeholder(){return this._textareaElement.placeholder}set placeholder(t){this._cachedPlaceholderHeight=void 0,t?this._textareaElement.setAttribute("placeholder",t):this._textareaElement.removeAttribute("placeholder"),this._cacheTextareaPlaceholderHeight()}_cachedLineHeight;_cachedPlaceholderHeight;_document=(0,a.WQX)(a.qQL);_hasFocus=!1;_isViewInited=!1;constructor(){(0,a.WQX)(ne.l).load(oe),this._textareaElement=this._elementRef.nativeElement}_setMinHeight(){const t=this.minRows&&this._cachedLineHeight?this.minRows*this._cachedLineHeight+"px":null;t&&(this._textareaElement.style.minHeight=t)}_setMaxHeight(){const t=this.maxRows&&this._cachedLineHeight?this.maxRows*this._cachedLineHeight+"px":null;t&&(this._textareaElement.style.maxHeight=t)}ngAfterViewInit(){this._platform.isBrowser&&(this._initialHeight=this._textareaElement.style.height,this.resizeToFitContent(),this._ngZone.runOutsideAngular(()=>{this._listenerCleanups=[this._renderer.listen("window","resize",()=>this._resizeEvents.next()),this._renderer.listen(this._textareaElement,"focus",this._handleFocusEvent),this._renderer.listen(this._textareaElement,"blur",this._handleFocusEvent)],this._resizeEvents.pipe((0,ie.Z)(16)).subscribe(()=>{this._cachedLineHeight=this._cachedPlaceholderHeight=void 0,this.resizeToFitContent(!0)})}),this._isViewInited=!0,this.resizeToFitContent(!0))}ngOnDestroy(){this._listenerCleanups?.forEach(t=>t()),this._resizeEvents.complete(),this._destroyed.next(),this._destroyed.complete()}_cacheTextareaLineHeight(){if(this._cachedLineHeight)return;const t=this._textareaElement.cloneNode(!1),i=t.style;t.rows=1,i.position="absolute",i.visibility="hidden",i.border="none",i.padding="0",i.height="",i.minHeight="",i.maxHeight="",i.top=i.bottom=i.left=i.right="auto",i.overflow="hidden",this._textareaElement.parentNode.appendChild(t),this._cachedLineHeight=t.clientHeight,t.remove(),this._setMinHeight(),this._setMaxHeight()}_measureScrollHeight(){const t=this._textareaElement,i=t.style.marginBottom||"",l=this._hasFocus,p=this._platform.FIREFOX?"cdk-textarea-autosize-measuring-firefox":"cdk-textarea-autosize-measuring";l&&(t.style.marginBottom=`${t.clientHeight}px`),t.classList.add(p);const h=t.scrollHeight-4;return t.classList.remove(p),l&&(t.style.marginBottom=i),h}_cacheTextareaPlaceholderHeight(){if(!this._isViewInited||null!=this._cachedPlaceholderHeight)return;if(!this.placeholder)return void(this._cachedPlaceholderHeight=0);const t=this._textareaElement.value;this._textareaElement.value=this._textareaElement.placeholder,this._cachedPlaceholderHeight=this._measureScrollHeight(),this._textareaElement.value=t}_handleFocusEvent=t=>{this._hasFocus="focus"===t.type};ngDoCheck(){this._platform.isBrowser&&this.resizeToFitContent()}resizeToFitContent(t=!1){if(!this._enabled||(this._cacheTextareaLineHeight(),this._cacheTextareaPlaceholderHeight(),!this._cachedLineHeight))return;const i=this._elementRef.nativeElement,n=i.value;if(!t&&this._minRows===this._previousMinRows&&n===this._previousValue)return;const l=this._measureScrollHeight(),p=Math.max(l,this._cachedPlaceholderHeight||0);i.style.height=`${p}px`,this._ngZone.runOutsideAngular(()=>{typeof requestAnimationFrame<"u"?requestAnimationFrame(()=>this._scrollToCaretPosition(i)):setTimeout(()=>this._scrollToCaretPosition(i))}),this._previousValue=n,this._previousMinRows=this._minRows}reset(){void 0!==this._initialHeight&&(this._textareaElement.style.height=this._initialHeight)}_noopInputHandler(){}_scrollToCaretPosition(t){const{selectionStart:i,selectionEnd:n}=t;!this._destroyed.isStopped&&this._hasFocus&&t.setSelectionRange(i,n)}static \u0275fac=function(i){return new(i||o)};static \u0275dir=e.FsC({type:o,selectors:[["textarea","cdkTextareaAutosize",""]],hostAttrs:["rows","1",1,"cdk-textarea-autosize"],hostBindings:function(i,n){1&i&&e.bIt("input",function(){return n._noopInputHandler()})},inputs:{minRows:[0,"cdkAutosizeMinRows","minRows"],maxRows:[0,"cdkAutosizeMaxRows","maxRows"],enabled:[2,"cdkTextareaAutosize","enabled",c.L39],placeholder:"placeholder"},exportAs:["cdkTextareaAutosize"]})}return o})(),ae=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=e.$C({type:o});static \u0275inj=a.G2t({})}return o})();var G=r(29);const se=["inputField"];function ce(o,u){1&o&&e.EFF(0," * ")}function re(o,u){if(1&o&&(e.j41(0,"span",5),e.nrm(1,"cue-svg-icon",8),e.k0s()),2&o){const t=e.XpG();e.R7$(),e.Y8G("name",t.icon())}}function ue(o,u){if(1&o&&(e.j41(0,"cue-typography",7),e.EFF(1),e.k0s()),2&o){const t=e.XpG();e.R7$(),e.JRh(t.error())}}let de=(()=>{class o{value=(0,c.geq)("");label=(0,c.hFB)("");info=(0,c.hFB)("");placeholder=(0,c.hFB)("");error=(0,c.hFB)(void 0);required=(0,c.hFB)(!1);icon=(0,c.hFB)(void 0);size=(0,c.hFB)("m");isFocused=!1;disabled=!1;inputField;valueChange=(0,c.CGW)();onChange=t=>{};onTouched=()=>{};constructor(){(0,a.QZP)(()=>{this.valueChange.emit(this.value())})}writeValue(t){this.value.set(t||"")}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.disabled=t}emitValue(t){const i=t.target.value;this.value.set(i),this.onChange(i)}focus(){this.isFocused=!0,this.inputField?.nativeElement&&this.inputField.nativeElement.focus()}onBlur(){this.isFocused=!1,this.onTouched()}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=e.VBU({type:o,selectors:[["cue-input-multiline"]],viewQuery:function(i,n){if(1&i&&e.GBs(se,5),2&i){let l;e.mGM(l=e.lsd())&&(n.inputField=l.first)}},inputs:{value:[1,"value"],label:[1,"label"],info:[1,"info"],placeholder:[1,"placeholder"],error:[1,"error"],required:[1,"required"],icon:[1,"icon"],size:[1,"size"]},outputs:{value:"valueChange",valueChange:"valueChange"},features:[e.Jv_([{provide:m.kq,useExisting:(0,a.Rfq)(()=>o),multi:!0}])],decls:10,vars:14,consts:[["inputField",""],[1,"form-field"],["size","s",1,"label",3,"info"],[1,"input-container"],["align","center","gap","s"],[2,"height","12px"],["cdkTextareaAutosize","",1,"input","textarea",2,"resize","none","overflow","hidden",3,"input","focus","blur","cdkAutosizeMinRows","cdkAutosizeMaxRows","placeholder","value","disabled"],["size","s",1,"error-text"],[3,"name"]],template:function(i,n){1&i&&(e.j41(0,"div",1)(1,"cue-typography",2),e.EFF(2),e.nVh(3,ce,1,0),e.k0s(),e.j41(4,"div",3)(5,"cue-flexcontainer",4),e.nVh(6,re,2,1,"span",5),e.j41(7,"textarea",6,0),e.bIt("input",function(p){return n.emitValue(p)})("focus",function(){return n.isFocused=!0})("blur",function(){return n.onBlur()}),e.k0s()()(),e.nVh(9,ue,2,1,"cue-typography",7),e.k0s()),2&i&&(e.HbH("size-"+n.size()),e.AVh("focused",n.isFocused||n.value()),e.R7$(),e.Y8G("info",n.info()),e.R7$(),e.SpI(" ",n.label()," "),e.R7$(),e.vxM(n.required()?3:-1),e.R7$(3),e.vxM(n.icon()?6:-1),e.R7$(),e.Y8G("cdkAutosizeMinRows",1)("cdkAutosizeMaxRows",8)("placeholder",n.placeholder())("value",n.value())("disabled",n.disabled),e.R7$(2),e.vxM(n.error()?9:-1))},dependencies:[x.Typography,v.n,G.A,ae,le],styles:[".form-field[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column}.input-container[_ngcontent-%COMP%]{position:relative;z-index:2}.input.textarea[_ngcontent-%COMP%]{width:100%;min-height:32px;border:none;border-bottom:1px solid var(--cue-input-border-bottom-color);background:none;outline:none;font-family:var(--cue-font-family);resize:none;overflow:hidden;color:var(--cue-input-value-color);position:relative;z-index:2;padding-bottom:8px}.size-xs[_ngcontent-%COMP%] .input.textarea[_ngcontent-%COMP%]{padding:var(--cue-input-xs-padding);font-size:var(--cue-input-xs-font-size)}.size-s[_ngcontent-%COMP%] .input.textarea[_ngcontent-%COMP%]{padding:var(--cue-input-s-padding);font-size:var(--cue-input-s-font-size)}.size-m[_ngcontent-%COMP%] .input.textarea[_ngcontent-%COMP%]{padding:var(--cue-input-m-padding);font-size:var(--cue-input-m-font-size)}.size-l[_ngcontent-%COMP%] .input.textarea[_ngcontent-%COMP%]{padding:var(--cue-input-l-padding);font-size:var(--cue-input-l-font-size)}.input.textarea[_ngcontent-%COMP%]::placeholder{color:var(--cue-input-placeholder-color);font-family:var(--cue-font-family)}.input[_ngcontent-%COMP%]:-webkit-autofill, .input[_ngcontent-%COMP%]:-webkit-autofill:hover, .input[_ngcontent-%COMP%]:-webkit-autofill:focus{-webkit-box-shadow:0 0 0px 1000px transparent inset;-webkit-transition:background-color 5000s ease-in-out 0s;transition:background-color 5000s ease-in-out 0s;-webkit-text-fill-color:var(--cue-input-value-color)}.label[_ngcontent-%COMP%]{position:absolute;pointer-events:none;transition:all .2s ease;z-index:1;padding:0 4px;left:0}.size-xs[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{top:var(--cue-input-xs-label-top);left:var(--cue-input-xs-label-left)}.size-s[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{top:var(--cue-input-s-label-top);left:var(--cue-input-s-label-left)}.size-m[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{top:var(--cue-input-m-label-top);left:var(--cue-input-m-label-left)}.size-l[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{top:var(--cue-input-l-label-top);left:var(--cue-input-l-label-left)}.form-field.focused[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{color:var(--cue-input-value-color)}.size-xs.focused[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{top:var(--cue-input-xs-label-focused-top);font-size:var(--cue-input-xs-label-focused-font-size)}.size-s.focused[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{top:var(--cue-input-s-label-focused-top);font-size:var(--cue-input-s-label-focused-font-size)}.size-m.focused[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{top:var(--cue-input-m-label-focused-top);font-size:var(--cue-input-m-label-focused-font-size)}.size-l.focused[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{top:var(--cue-input-l-label-focused-top);font-size:var(--cue-input-l-label-focused-font-size)}.error-text[_ngcontent-%COMP%]{color:var(--cue-error);margin-top:4px;min-height:18px}.form-field[_ngcontent-%COMP%]:not(.focused) .input-container[_ngcontent-%COMP%]{margin-top:24px}.form-field.focused[_ngcontent-%COMP%] .input-container[_ngcontent-%COMP%]{margin-top:12px}"],changeDetection:0})}return o})();var T=r(6117),pe=r(356),ge=r(6279),_e=r(1359),me=r(7851);function he(o,u){if(1&o){const t=e.RV6();e.j41(0,"cue-typography",11),e.bIt("click",function(){a.eBV(t);const n=e.XpG();return a.Njj(!n.disabled()&&n.openMenu())}),e.EFF(1),e.k0s()}if(2&o){const t=e.XpG();e.Y8G("info",t.info()),e.R7$(),e.JRh(t.label())}}function fe(o,u){if(1&o&&e.nrm(0,"cue-svg-icon",12),2&o){const t=e.XpG();e.xc7("--cue-icon-width",t.iconSize()),e.Y8G("name",u)}}function ve(o,u){if(1&o){const t=e.RV6();e.j41(0,"cue-input",13),e.nI1(1,"transloco"),e.mxI("valueChange",function(n){a.eBV(t);const l=e.XpG();return e.DH7(l.filterValue,n)||(l.filterValue=n),a.Njj(n)}),e.k0s(),e.nrm(2,"div",14)}if(2&o){const t=e.XpG();e.R50("value",t.filterValue),e.Y8G("placeholder",e.bMT(1,2,"components.input.select.placeholderFilter"))}}function Me(o,u){1&o&&e.nrm(0,"cue-svg-icon",17),2&o&&e.Y8G("name",u)}function be(o,u){if(1&o){const t=e.RV6();e.j41(0,"cue-menu-item",15),e.bIt("click",function(n){const l=a.eBV(t).$implicit,p=e.XpG();return a.Njj(p.handleSelect(n,l.value))})("mousedown",function(n){a.eBV(t);const l=e.XpG();return a.Njj(l.preventEventBubbling(n))}),e.j41(1,"cue-checkbox",16),e.bIt("mousedown",function(n){a.eBV(t);const l=e.XpG();return a.Njj(l.preventEventBubbling(n))}),e.k0s(),e.nVh(2,Me,1,1,"cue-svg-icon",17),e.EFF(3),e.k0s()}if(2&o){let t;const i=u.$implicit,n=e.XpG();e.Y8G("size",n.size())("disabled",n.isFixedValue(i.value)&&n.isSelected(i.value))("selected",n.isSelected(i.value)),e.R7$(),e.Y8G("checked",n.isSelected(i.value))("disabled",n.isFixedValue(i.value)&&n.isSelected(i.value)),e.R7$(),e.vxM((t=n.icon(i.value))?2:-1,t),e.R7$(),e.SpI(" ",i.label," ")}}function Ce(o,u){if(1&o&&(e.j41(0,"cue-typography",10),e.EFF(1),e.k0s()),2&o){const t=e.XpG();e.R7$(),e.JRh(t.error())}}let xe=(()=>{class o{label=(0,c.hFB)("");info=(0,c.hFB)("");placeholder=(0,c.hFB)(void 0);menuPosition=(0,c.hFB)(void 0);options=(0,c.hFB)();labelMap=(0,c.hFB)({});iconMap=(0,c.hFB)({});value=(0,c.geq)([]);fixedValues=(0,c.hFB)([]);size=(0,c.hFB)("xs");disabled=(0,c.hFB)(!1);showFilter=(0,c.hFB)(!1);underline=(0,c.hFB)(!0);error=(0,c.hFB)(void 0);maxHeight=(0,c.hFB)(void 0);loading=(0,c.hFB)(!1);optionLabels=(0,g.EW)(()=>{const t=this.labelMap();return(this.options()??[]).map(n=>t[n]?t[n]:n.toString())});_multiSelectCount=(0,g.EW)(()=>(this.value()||[]).length);_multiSelectTranslated=(0,s.Xx)("components.input.multiSelect.itemsSelected",(0,g.EW)(()=>({count:this._multiSelectCount()})));_defaultPlaceholder=(0,s.Xx)("components.input.multiSelect.placeholderSelect");_placeholder=(0,g.EW)(()=>this.placeholder()??this._defaultPlaceholder());valueLabel=(0,g.EW)(()=>{const t=this.labelMap(),i=this.value()||[],n=this._multiSelectTranslated();let l;if(0===i.length)l="";else if(1===i.length){const p=i[0];l=t[p]?t[p]:p.toString()}else l=n;return l});menuIsOpen=(0,a.vPA)(void 0);filterInputEl=(0,c.ebz)(P.p);menuEl=(0,c.ebz)(T.W);filterValue=(0,a.vPA)("");optionsFiltered=(0,g.EW)(()=>this._appendFilter(this.options()??[],this.filterValue(),this.labelMap()));iconSize=(0,g.EW)(()=>`var(--cue-input-${this.size()}-font-size)`);handleSelect(t,i){const l=t.target.closest("cue-multi-select");(null!==l?.closest(".ag-filter-wrapper")||null!==l?.closest(".ag-popup")||null!==l?.closest(".ag-filter-apply-panel")||null!==l?.closest('[class*="ag-"]')||null!==document.querySelector(".ag-filter-wrapper"))&&t.stopPropagation(),t.preventDefault();const h=this.value()||[],O=h.includes(i),F=this.fixedValues().includes(i);if(O&&F)return;let D;D=O?h.filter(b=>b!==i):[...h,i],this.value.update(()=>[...D])}preventEventBubbling(t){const n=t.target.closest("cue-multi-select");(null!==n?.closest(".ag-filter-wrapper")||null!==n?.closest(".ag-popup")||null!==n?.closest(".ag-filter-apply-panel")||null!==n?.closest('[class*="ag-"]')||null!==document.querySelector(".ag-filter-wrapper"))&&(t.stopPropagation(),t.stopImmediatePropagation())}onMenuClosed(){this.menuIsOpen.set(!1)}openMenu(){this.menuIsOpen.set(!0),this.filterValue.set("")}handleSpace(t){t.preventDefault(),this.openMenu()}isSelected(t){return(this.value()||[]).includes(t)}isFixedValue(t){return this.fixedValues().includes(t)}constructor(){(0,a.QZP)(()=>{this.showFilter()&&this.menuIsOpen()&&setTimeout(()=>this.filterInputEl()?.focus(),20)}),(0,a.QZP)(()=>{const t=this.value()||[],n=this.fixedValues().filter(l=>!t.includes(l));if(n.length>0){const l=[...t,...n];this.value.set(l)}})}icon(t){if(void 0!==t)return this.iconMap()[t]}_appendFilter(t,i,n){const l=i.toLowerCase();return(""===i?t:t.filter(h=>(n[h]?n[h].toLowerCase():h.toString().toLowerCase()).startsWith(l))).map(h=>({value:h,label:n[h]?n[h]:h.toString()}))}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=e.VBU({type:o,selectors:[["cue-multi-select"]],viewQuery:function(i,n){1&i&&e.wEZ(n.filterInputEl,P.p,5)(n.menuEl,T.W,5),2&i&&e.NyB(2)},inputs:{label:[1,"label"],info:[1,"info"],placeholder:[1,"placeholder"],menuPosition:[1,"menuPosition"],options:[1,"options"],labelMap:[1,"labelMap"],iconMap:[1,"iconMap"],value:[1,"value"],fixedValues:[1,"fixedValues"],size:[1,"size"],disabled:[1,"disabled"],showFilter:[1,"showFilter"],underline:[1,"underline"],error:[1,"error"],maxHeight:[1,"maxHeight"],loading:[1,"loading"]},outputs:{value:"valueChange"},decls:15,vars:23,consts:[["trigger",""],[1,"form-field"],["size","s",1,"label",3,"info"],[3,"menuClosed","positioning","contextEnabled"],["trigger","","tabindex","0",1,"select-trigger",3,"click","keydown.enter","keydown.space"],["align","center","gap","s",1,"select-value"],[3,"--cue-icon-width","name"],["name","arrow-dropdown",1,"select-arrow"],["menu","",1,"menu",3,"maxHeight","cueLogoLoader"],[3,"size","disabled","selected"],["size","s",1,"error-text"],["size","s",1,"label",3,"click","info"],[3,"name"],[3,"valueChange","value","placeholder"],[2,"height","6px"],[3,"click","mousedown","size","disabled","selected"],["before","",3,"mousedown","checked","disabled"],["before","",3,"name"]],template:function(i,n){if(1&i&&(e.j41(0,"div",1),e.nVh(1,he,2,2,"cue-typography",2),e.j41(2,"cue-menu",3),e.bIt("menuClosed",function(){return n.onMenuClosed()}),e.EFF(3,"> "),e.j41(4,"div",4,0),e.bIt("click",function(){return!n.disabled()&&n.openMenu()})("keydown.enter",function(){return!n.disabled()&&n.openMenu()})("keydown.space",function(p){return!n.disabled()&&n.handleSpace(p)}),e.j41(6,"cue-flexcontainer",5),e.nVh(7,fe,1,3,"cue-svg-icon",6),e.EFF(8),e.k0s(),e.nrm(9,"cue-svg-icon",7),e.k0s(),e.j41(10,"cue-menu-wrap",8),e.nVh(11,ve,3,4),e.Z7z(12,be,4,7,"cue-menu-item",9,e.Vm6),e.k0s()(),e.nVh(14,Ce,2,1,"cue-typography",10),e.k0s()),2&i){let l;e.HbH("size-"+n.size()),e.AVh("focused",n.value()&&n.value().length>0||""!==n.placeholder())("menu-open",n.menuIsOpen())("underline",n.underline())("no-label",!n.label()),e.R7$(),e.vxM(n.label()?1:-1),e.R7$(),e.Y8G("positioning",n.menuPosition())("contextEnabled",!n.disabled()),e.R7$(2),e.AVh("disabled",n.disabled()),e.R7$(3),e.vxM((l=n.icon(1===n.value().length?n.value()[0]:void 0))?7:-1,l),e.R7$(),e.SpI(" ",n.value()&&n.value().length>0?n.valueLabel():n._placeholder()," "),e.R7$(2),e.xc7("min-height",n.loading()?"200px":null),e.Y8G("maxHeight",n.maxHeight())("cueLogoLoader",n.loading()),e.R7$(),e.vxM(n.showFilter()?11:-1),e.R7$(),e.Dyx(n.optionsFiltered()),e.R7$(2),e.vxM(n.error()?14:-1)}},dependencies:[T.W,pe.M,ge.D,x.Typography,P.p,_e.S,G.A,v.n,me.k,s.Kj],styles:[".form-field[_ngcontent-%COMP%]{position:relative}.select-trigger[_ngcontent-%COMP%]{color:var(--cue-input-value-color);width:100%;border:none;background:none;outline:none;font-family:var(--cue-font-family);display:flex;justify-content:space-between;align-items:center;cursor:pointer;box-sizing:border-box}.form-field.underline[_ngcontent-%COMP%] .select-trigger[_ngcontent-%COMP%]{border-bottom:1px solid var(--cue-input-border-bottom-color)}.form-field[_ngcontent-%COMP%]:not(.underline) .select-trigger[_ngcontent-%COMP%]{align-items:flex-start;padding-top:2px;padding-bottom:1px}.select-trigger.disabled[_ngcontent-%COMP%]{cursor:not-allowed;opacity:.6}.select-trigger[_ngcontent-%COMP%]:focus{outline:none}.size-xs[_ngcontent-%COMP%] .select-trigger[_ngcontent-%COMP%]{padding:var(--cue-input-xs-padding);font-size:var(--cue-input-xs-font-size)}.size-s[_ngcontent-%COMP%] .select-trigger[_ngcontent-%COMP%]{padding:var(--cue-input-s-padding);font-size:var(--cue-input-s-font-size)}.size-m[_ngcontent-%COMP%] .select-trigger[_ngcontent-%COMP%]{padding:var(--cue-input-m-padding);font-size:var(--cue-input-m-font-size)}.size-l[_ngcontent-%COMP%] .select-trigger[_ngcontent-%COMP%]{padding:var(--cue-input-l-padding);font-size:var(--cue-input-l-font-size)}.form-field.no-label.size-xs[_ngcontent-%COMP%] .select-trigger[_ngcontent-%COMP%], .form-field.no-label.size-s[_ngcontent-%COMP%] .select-trigger[_ngcontent-%COMP%], .form-field.no-label.size-m[_ngcontent-%COMP%] .select-trigger[_ngcontent-%COMP%], .form-field.no-label.size-l[_ngcontent-%COMP%] .select-trigger[_ngcontent-%COMP%]{padding-top:0}.select-value[_ngcontent-%COMP%]{color:var(--cue-input-value-color);font-family:var(--cue-font-family);flex:1;text-align:left}.form-field[_ngcontent-%COMP%]:not(.focused) .select-value[_ngcontent-%COMP%]{color:var(--cue-input-placeholder-color)}.select-arrow[_ngcontent-%COMP%]{color:var(--cue-input-value-color);margin-left:8px;display:inline-block;transition:transform .2s ease}.form-field.menu-open[_ngcontent-%COMP%] .select-arrow[_ngcontent-%COMP%]{transform:rotate(180deg)}.label[_ngcontent-%COMP%]{position:absolute;pointer-events:auto;transition:all .2s ease;cursor:pointer}.size-xs[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{top:var(--cue-input-xs-label-top);left:var(--cue-input-xs-label-left)}.size-s[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{top:var(--cue-input-s-label-top);left:var(--cue-input-s-label-left)}.size-m[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{top:var(--cue-input-m-label-top);left:var(--cue-input-m-label-left)}.size-l[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{top:var(--cue-input-l-label-top);left:var(--cue-input-l-label-left)}.form-field.focused[_ngcontent-%COMP%] .label[_ngcontent-%COMP%], .form-field.menu-open[_ngcontent-%COMP%] .label[_ngcontent-%COMP%], .form-field[_ngcontent-%COMP%] .select-trigger[_ngcontent-%COMP%]:not(:placeholder-shown) + .label[_ngcontent-%COMP%], .form-field[_ngcontent-%COMP%] select[_ngcontent-%COMP%]:valid + .label[_ngcontent-%COMP%]{color:var(--cue-input-value-color)}.size-xs.focused[_ngcontent-%COMP%] .label[_ngcontent-%COMP%], .size-xs.menu-open[_ngcontent-%COMP%] .label[_ngcontent-%COMP%], .size-xs[_ngcontent-%COMP%] .select-trigger[_ngcontent-%COMP%]:not(:placeholder-shown) + .label[_ngcontent-%COMP%], .size-xs[_ngcontent-%COMP%] select[_ngcontent-%COMP%]:valid + .label[_ngcontent-%COMP%]{top:var(--cue-input-xs-label-focused-top);font-size:var(--cue-input-xs-label-focused-font-size)}.size-s.focused[_ngcontent-%COMP%] .label[_ngcontent-%COMP%], .size-s.menu-open[_ngcontent-%COMP%] .label[_ngcontent-%COMP%], .size-s[_ngcontent-%COMP%] .select-trigger[_ngcontent-%COMP%]:not(:placeholder-shown) + .label[_ngcontent-%COMP%], .size-s[_ngcontent-%COMP%] select[_ngcontent-%COMP%]:valid + .label[_ngcontent-%COMP%]{top:var(--cue-input-s-label-focused-top);font-size:var(--cue-input-s-label-focused-font-size)}.size-m.focused[_ngcontent-%COMP%] .label[_ngcontent-%COMP%], .size-m.menu-open[_ngcontent-%COMP%] .label[_ngcontent-%COMP%], .size-m[_ngcontent-%COMP%] .select-trigger[_ngcontent-%COMP%]:not(:placeholder-shown) + .label[_ngcontent-%COMP%], .size-m[_ngcontent-%COMP%] select[_ngcontent-%COMP%]:valid + .label[_ngcontent-%COMP%]{top:var(--cue-input-m-label-focused-top);font-size:var(--cue-input-m-label-focused-font-size)}.size-l.focused[_ngcontent-%COMP%] .label[_ngcontent-%COMP%], .size-l.menu-open[_ngcontent-%COMP%] .label[_ngcontent-%COMP%], .size-l[_ngcontent-%COMP%] .select-trigger[_ngcontent-%COMP%]:not(:placeholder-shown) + .label[_ngcontent-%COMP%], .size-l[_ngcontent-%COMP%] select[_ngcontent-%COMP%]:valid + .label[_ngcontent-%COMP%]{top:var(--cue-input-l-label-focused-top);font-size:var(--cue-input-l-label-focused-font-size)}cue-menu[_ngcontent-%COMP%]{width:100%}.error-text[_ngcontent-%COMP%]{color:var(--cue-error);margin-top:4px;min-height:18px}"],changeDetection:0})}return o})();const ye=["*"],B=()=>[],S=()=>({});function Pe(o,u){if(1&o&&(e.j41(0,"cue-typography"),e.EFF(1),e.k0s()),2&o){const t=e.XpG(2);e.R7$(),e.JRh(t.config().message)}}function Oe(o,u){if(1&o&&(e.nrm(0,"cue-key-val",4),e.nI1(1,"transloco")),2&o){const t=e.XpG(2);e.Y8G("key",e.mNQ(e.bMT(1,3,"components.modals.rdfEdit.labelExistingValue")))("val",t.existingValue())}}function De(o,u){if(1&o){const t=e.RV6();e.j41(0,"cue-input",15),e.nI1(1,"transloco"),e.mxI("valueChange",function(n){a.eBV(t);const l=e.XpG(2);return e.DH7(l.newValue,n)||(l.newValue=n),a.Njj(n)}),e.k0s()}if(2&o){const t=e.XpG(2);e.Y8G("label",e.mNQ(e.bMT(1,4,"components.modals.rdfEdit.labelNewValue"))),e.R50("value",t.newValue),e.Y8G("error",t.valueError())}}function ze(o,u){if(1&o){const t=e.RV6();e.j41(0,"cue-input",16),e.nI1(1,"transloco"),e.mxI("valueChange",function(n){a.eBV(t);const l=e.XpG(2);return e.DH7(l.newValue,n)||(l.newValue=n),a.Njj(n)}),e.k0s()}if(2&o){const t=e.XpG(2);e.Y8G("label",e.mNQ(e.bMT(1,4,"components.modals.rdfEdit.labelNewValue"))),e.R50("value",t.newValue),e.Y8G("error",t.valueError())}}function ke(o,u){if(1&o){const t=e.RV6();e.j41(0,"cue-input-date",17),e.nI1(1,"transloco"),e.mxI("valueChange",function(n){a.eBV(t);const l=e.XpG(2);return e.DH7(l.newValue,n)||(l.newValue=n),a.Njj(n)}),e.k0s()}if(2&o){const t=e.XpG(2);e.Y8G("label",e.mNQ(e.bMT(1,4,"components.modals.rdfEdit.labelNewValue"))),e.R50("value",t.newValue),e.Y8G("error",t.valueError())}}function Ee(o,u){if(1&o){const t=e.RV6();e.j41(0,"cue-flexcontainer",8)(1,"cue-typography"),e.EFF(2),e.nI1(3,"transloco"),e.k0s(),e.j41(4,"cue-input-switch",18),e.bIt("checkedChange",function(n){a.eBV(t);const l=e.XpG(2);return a.Njj(l.onBooleanChange(n))}),e.k0s()()}if(2&o){const t=e.XpG(2);e.R7$(2),e.JRh(e.bMT(3,2,"components.modals.rdfEdit.labelSetNewValue")),e.R7$(2),e.Y8G("checked","true"===t.newValue())}}function Fe(o,u){if(1&o){const t=e.RV6();e.j41(0,"cue-select",19),e.nI1(1,"transloco"),e.mxI("valueChange",function(n){a.eBV(t);const l=e.XpG(2);return e.DH7(l.newValue,n)||(l.newValue=n),a.Njj(n)}),e.k0s()}if(2&o){const t=e.XpG(2);e.Y8G("label",e.mNQ(e.bMT(1,7,"components.modals.rdfEdit.labelNewValue"))),e.R50("value",t.newValue),e.Y8G("options",t.config().options||e.lJ4(9,B))("labelMap",t.config().optionLabelMap||e.lJ4(10,S))("showFilter",t.optionsCount()>5)("error",t.valueError())}}function Ve(o,u){if(1&o){const t=e.RV6();e.j41(0,"cue-multi-select",19),e.nI1(1,"transloco"),e.mxI("valueChange",function(n){a.eBV(t);const l=e.XpG(2);return e.DH7(l.newValue,n)||(l.newValue=n),a.Njj(n)}),e.k0s()}if(2&o){const t=e.XpG(2);e.Y8G("label",e.mNQ(e.bMT(1,7,"components.modals.rdfEdit.labelNewValue"))),e.R50("value",t.newValue),e.Y8G("options",t.config().options||e.lJ4(9,B))("labelMap",t.config().optionLabelMap||e.lJ4(10,S))("showFilter",t.optionsCount()>5)("error",t.valueError())}}function Re(o,u){if(1&o){const t=e.RV6();e.j41(0,"cue-input-multiline",20),e.nI1(1,"transloco"),e.mxI("valueChange",function(n){a.eBV(t);const l=e.XpG(2);return e.DH7(l.comment,n)||(l.comment=n),a.Njj(n)}),e.k0s()}if(2&o){const t=e.XpG(2);e.Y8G("label",e.mNQ(e.bMT(1,3,"components.modals.rdfEdit.labelComment"))),e.R50("value",t.comment)}}function we(o,u){if(1&o&&(e.j41(0,"cue-typography",11),e.EFF(1),e.k0s()),2&o){const t=e.XpG(2);e.R7$(),e.JRh(t.error())}}function Te(o,u){if(1&o){const t=e.RV6();e.j41(0,"cue-modal",1),e.bIt("close",function(){a.eBV(t);const n=e.XpG();return a.Njj(n.onClose())}),e.j41(1,"cue-flexcontainer",2),e.SdG(2),e.nVh(3,Pe,2,1,"cue-typography"),e.j41(4,"cue-flexcontainer",3),e.nVh(5,Oe,2,5,"cue-key-val",4),e.nVh(6,De,2,6,"cue-input",5),e.nVh(7,ze,2,6,"cue-input",6),e.nVh(8,ke,2,6,"cue-input-date",7),e.nVh(9,Ee,5,4,"cue-flexcontainer",8),e.nVh(10,Fe,2,11,"cue-select",9),e.nVh(11,Ve,2,11,"cue-multi-select",9),e.k0s(),e.nVh(12,Re,2,5,"cue-input-multiline",10),e.nVh(13,we,2,1,"cue-typography",11),e.j41(14,"cue-flexcontainer",12)(15,"cue-button",13),e.bIt("click",function(){a.eBV(t);const n=e.XpG();return a.Njj(n.onClose())}),e.j41(16,"cue-button-label"),e.EFF(17),e.nI1(18,"transloco"),e.k0s()(),e.j41(19,"cue-button",14),e.bIt("click",function(){a.eBV(t);const n=e.XpG();return a.Njj(n.onSave())}),e.j41(20,"cue-button-label"),e.EFF(21),e.nI1(22,"transloco"),e.k0s()()()()()}if(2&o){const t=e.XpG();e.Y8G("displayCloseBtn",!1)("closeOnBackgroundClick",!1),e.R7$(3),e.vxM(t.config().message?3:-1),e.R7$(2),e.vxM("boolean"!==t.config().dataType?5:-1),e.R7$(),e.vxM("string"===t.config().dataType?6:-1),e.R7$(),e.vxM("number"===t.config().dataType?7:-1),e.R7$(),e.vxM("date"===t.config().dataType?8:-1),e.R7$(),e.vxM("boolean"===t.config().dataType?9:-1),e.R7$(),e.vxM("select"===t.config().dataType?10:-1),e.R7$(),e.vxM("multiselect"===t.config().dataType?11:-1),e.R7$(),e.vxM(t.identical()?-1:12),e.R7$(),e.vxM(t.error()?13:-1),e.R7$(2),e.Y8G("disabled",t.saving()),e.R7$(2),e.JRh(e.bMT(18,17,"components.modals.rdfEdit.buttonCancel")),e.R7$(2),e.Y8G("disabled",t.saving()||t.identical())("loading",t.saving()),e.R7$(2),e.JRh(e.bMT(22,19,"components.modals.rdfEdit.buttonSave"))}}let je=(()=>{class o{visible=(0,c.geq)(!0);config=c.hFB.required();close=(0,c.CGW)();existingValue=(0,g.EW)(()=>{let t="";return t=Array.isArray(this.config().existingValue)?this.config().existingValue.map(n=>this._getLabel(n)).join(", "):this._getLabel(this.config().existingValue),t});newValue=(0,g.uu)(()=>this.config().existingValue);comment=(0,a.vPA)("");errorID=(0,c.geq)("");error=(0,s.Xx)(this.errorID);saving=(0,a.vPA)(!1);pristine=(0,a.vPA)(!0);identical=(0,g.EW)(()=>!this.config().hasExternalChanges&&this.newValue()===this.config().existingValue);valueErrorID=(0,g.EW)(()=>this.pristine()?"":this.identical()?"components.modals.rdfEdit.errorIdenticalValue":"");valueError=(0,s.Xx)(this.valueErrorID);optionsCount=(0,g.EW)(()=>this.config().options?.length||0);constructor(){(0,a.QZP)(()=>{this.pristine()&&this.newValue()!==this.config().existingValue&&this.pristine.set(!1)})}onSave(){var t=this;return(0,f.A)(function*(){t.saving.set(!0),t.errorID.set("");try{const i=t.config();yield i.requestSave({newValue:t.newValue(),comment:t.comment(),previousValue:i.existingValue}),t.visible.set(!1),t.close.emit(t.newValue())}catch(i){console.error("Error saving RDF edit:",i),t.errorID.set("components.modals.rdfEdit.errorSaving")}t.saving.set(!1)})()}onClose(){this.visible.set(!1),this.close.emit(null)}onBooleanChange(t){this.newValue.set(t?"true":"false")}_getLabel(t){const i=this.config().optionLabelMap;return void 0!==i&&i[t]||t}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=e.VBU({type:o,selectors:[["cue-modal-rdf-edit"]],inputs:{visible:[1,"visible"],config:[1,"config"],errorID:[1,"errorID"]},outputs:{visible:"visibleChange",close:"close",errorID:"errorIDChange"},ngContentSelectors:ye,decls:1,vars:1,consts:[[3,"displayCloseBtn","closeOnBackgroundClick"],[3,"close","displayCloseBtn","closeOnBackgroundClick"],["direction","column","align","center"],["direction","column","gap","m"],[3,"key","val"],["type","text",3,"label","value","error"],["type","number",3,"label","value","error"],[3,"label","value","error"],["direction","row","align","center","justify","space-between","gap","l"],[3,"value","options","labelMap","label","showFilter","error"],[2,"width","100%",3,"label","value"],[2,"color","var(--cue-error)"],["direction","row","justify","center",2,"width","100%"],[3,"click","disabled"],["variant","secondary",3,"click","disabled","loading"],["type","text",3,"valueChange","label","value","error"],["type","number",3,"valueChange","label","value","error"],[3,"valueChange","label","value","error"],[3,"checkedChange","checked"],[3,"valueChange","value","options","labelMap","label","showFilter","error"],[2,"width","100%",3,"valueChange","label","value"]],template:function(i,n){1&i&&(e.NAR(),e.nVh(0,Te,23,21,"cue-modal",0)),2&i&&e.vxM(n.visible()?0:-1)},dependencies:[_.a,v.n,y.$,x.Typography,w.F,P.p,R.L,E.l,xe,q,ee.d,de,s.Kj],styles:[".col[_ngcontent-%COMP%]{flex:1;min-width:0;height:100%}"]})}return o})();var Y=r(7335);function Ne(o,u){1&o&&(e.j41(0,"span",7),e.EFF(1),e.nI1(2,"transloco"),e.k0s()),2&o&&(e.R7$(),e.SpI("(",e.bMT(2,1,"components.keyVal.edited"),")"))}function Ie(o,u){if(1&o){const t=e.RV6();e.j41(0,"span",5),e.bIt("click",function(){a.eBV(t);const n=e.XpG();return a.Njj(n.onReadClick())}),e.j41(1,"span",6),e.EFF(2),e.k0s(),e.nVh(3,Ne,3,3,"span",7),e.k0s()}if(2&o){const t=e.XpG();e.AVh("interactive",!t.editDisabled()),e.Y8G("menuItems",t.hoverMenu()),e.R7$(2),e.Lme("",t.valueFormatted()," ",t.suffix()),e.R7$(),e.vxM(t.isDirty()?3:-1)}}function Ge(o,u){if(1&o){const t=e.RV6();e.j41(0,"cue-select",10),e.bIt("valueChange",function(n){a.eBV(t);const l=e.XpG(2);return a.Njj(l.selectionChange(n))}),e.k0s()}if(2&o){const t=e.XpG(2);e.Y8G("value",t.newValue())("options",t.options())}}function Be(o,u){if(1&o){const t=e.RV6();e.j41(0,"cue-inline-input",11),e.bIt("valueChange",function(n){a.eBV(t);const l=e.XpG(2);return a.Njj(l.inputChange(n))}),e.k0s(),e.EFF(1)}if(2&o){const t=e.XpG(2);e.Y8G("value",t.valueFormatted()),e.R7$(),e.SpI(" ",t.suffix()," ")}}function Se(o,u){if(1&o&&(e.j41(0,"cue-flexcontainer",3),e.nVh(1,Ge,1,2,"cue-select",8)(2,Be,2,2),e.nrm(3,"cue-entity-menu",9),e.k0s()),2&o){const t=e.XpG();e.R7$(),e.vxM(void 0!==t.options()&&t.options().length?1:2),e.R7$(2),e.Y8G("items",t.saveCancelMenu())}}function Ye(o,u){if(1&o){const t=e.RV6();e.j41(0,"cue-modal-rdf-edit",12),e.mxI("visibleChange",function(n){a.eBV(t);const l=e.XpG();return e.DH7(l.rdfModalVisible,n)||(l.rdfModalVisible=n),a.Njj(n)}),e.bIt("close",function(n){a.eBV(t);const l=e.XpG();return a.Njj(l.onRdfModalClose(n))}),e.k0s()}if(2&o){const t=e.XpG();e.Y8G("config",u),e.R50("visible",t.rdfModalVisible)}}let Ae=(()=>{class o{entityMenuDirective;size=(0,c.hFB)("m");key=c.hFB.required();val=c.geq.required();originalValue=(0,c.hFB)(void 0);options=(0,c.hFB)([]);suffix=(0,c.hFB)("");rdfConfig=(0,c.hFB)();editDisabled=(0,c.hFB)(!1);valueChange=(0,c.CGW)();editModeEnabled=(0,a.vPA)(!1);isDirty=(0,g.EW)(()=>{const t=this.originalValue();return void 0!==t&&this.val()!==t});valueChanged=(0,g.EW)(()=>this.val()!==this.newValue());newValue=(0,g.uu)(()=>this.val());rdfModalVisible=(0,a.vPA)(!1);valueFormatted=(0,g.EW)(()=>this._idToString(this.val()));hoverMenu=(0,g.EW)(()=>{if(this.editModeEnabled()||this.editDisabled())return[];const t=[{icon:"edit",label:"Edit",action:()=>this.onReadClick()}];return this.isDirty()&&t.push({icon:"close",label:"Revert to original",action:()=>this._revert()}),t});onReadClick(){this.editDisabled()||(this.rdfConfig()?this.rdfModalVisible.set(!0):this.editModeEnabled.set(!0),this.entityMenuDirective?.removeOverlayMenu())}labelSize=(0,g.EW)(()=>{switch(this.size()){case"s":return"xs";case"m":return"s";case"l":return"m";case"xl":return"l"}});onKeyPress(t){this.editModeEnabled()&&("Escape"===t.key?(this._reset(),t.stopPropagation()):"Enter"===t.key&&this._emitChange())}saveCancelMenu=(0,g.EW)(()=>{const t=[{icon:"close",label:"Cancel",action:()=>this._reset()}];return this.valueChanged()&&t.push({icon:"save",label:"Save",action:()=>this._emitChange()}),t});selectionChange(t){this.newValue.set(t?.toString()??"")}inputChange(t){this.newValue.set(t)}_emitChange(){this.valueChange.emit(this.newValue()),this.val.set(this.newValue()),this.editModeEnabled.set(!1)}_reset(){this.newValue.set(this.val()),this.editModeEnabled.set(!1)}_revert(){const t=this.originalValue();void 0!==t&&(this.val.set(t),this.newValue.set(t),this.valueChange.emit(t),this.entityMenuDirective?.removeOverlayMenu())}_idToString(t){const i=this.rdfConfig()?.optionLabelMap;return i?i[t]??t:t}onRdfModalClose(t){if(this.rdfModalVisible.set(!1),null===t)return;const i=Array.isArray(t)?t.join(", "):t;this.val.set(i)}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=e.VBU({type:o,selectors:[["cue-key-val-editable"]],viewQuery:function(i,n){if(1&i&&e.GBs(Y.e,5),2&i){let l;e.mGM(l=e.lsd())&&(n.entityMenuDirective=l.first)}},hostBindings:function(i,n){1&i&&e.bIt("keydown",function(p){return n.onKeyPress(p)},e.EBC)},inputs:{size:[1,"size"],key:[1,"key"],val:[1,"val"],originalValue:[1,"originalValue"],options:[1,"options"],suffix:[1,"suffix"],rdfConfig:[1,"rdfConfig"],editDisabled:[1,"editDisabled"]},outputs:{val:"valChange",valueChange:"valueChange"},decls:9,vars:5,consts:[[1,"key-val-container"],[3,"size"],["cueEntityMenu","",1,"read-mode-container",3,"interactive","menuItems"],["direction","row","align","center"],[3,"config","visible"],["cueEntityMenu","",1,"read-mode-container",3,"click","menuItems"],[1,"value-content"],[1,"dirty-indicator"],[3,"value","options"],[3,"items"],[3,"valueChange","value","options"],[3,"valueChange","value"],[3,"visibleChange","close","config","visible"]],template:function(i,n){if(1&i&&(e.j41(0,"dl",0)(1,"dt")(2,"cue-typography",1),e.EFF(3),e.k0s()(),e.j41(4,"dd")(5,"cue-typography",1),e.nVh(6,Ie,4,6,"span",2)(7,Se,4,2,"cue-flexcontainer",3),e.k0s()()(),e.nVh(8,Ye,1,2,"cue-modal-rdf-edit",4)),2&i){let l;e.R7$(2),e.Y8G("size",n.labelSize()),e.R7$(),e.JRh(n.key()),e.R7$(2),e.Y8G("size",n.size()),e.R7$(),e.vxM(n.editModeEnabled()?n.rdfConfig()?-1:7:6),e.R7$(2),e.vxM((l=n.rdfConfig())?8:-1,l)}},dependencies:[x.Typography,Y.e,E.l,k.H,v.n,V.I,je,s.Kj],styles:[".key-val-container[_ngcontent-%COMP%]{margin:0;display:flex;flex-direction:column;gap:var(--cue-grid-gap-s, 8px)}dt[_ngcontent-%COMP%], dd[_ngcontent-%COMP%]{margin:0}.read-mode-container[_ngcontent-%COMP%]{display:inline-flex;align-items:center;width:100%;position:relative}.read-mode-container.interactive[_ngcontent-%COMP%]:hover{cursor:pointer}.value-content[_ngcontent-%COMP%]{flex:1}[_nghost-%COMP%]{color:var(--cue-typography-text-color, inherit)}dt[_ngcontent-%COMP%] cue-typography[_ngcontent-%COMP%], dd[_ngcontent-%COMP%] cue-typography[_ngcontent-%COMP%], .value-content[_ngcontent-%COMP%]{color:var(--cue-typography-text-color, inherit)!important}dt[_ngcontent-%COMP%] cue-typography[_ngcontent-%COMP%] div[_ngcontent-%COMP%], dd[_ngcontent-%COMP%] cue-typography[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{color:var(--cue-typography-text-color, inherit)!important}[_ngcontent-%COMP%]:deep(cue-svg-icon), [_ngcontent-%COMP%]:deep(cue-entity-menu cue-svg-icon){color:var(--cue-icon-color, inherit)!important}.dirty-indicator[_ngcontent-%COMP%]{opacity:.8;margin-left:4px;color:var(--cue-typography-text-color, inherit)!important;font-weight:700;font-size:.4em;transform:translateY(-1em)}"]})}return o})()},8547(j,z,r){r.d(z,{T:()=>E});var c=r(7705),a=r(29),g=r(6117),k=r(6279),V=r(356),f=r(5802),s=r(5547);const _=(m,C)=>C.label;function v(m,C){if(1&m&&s.nrm(0,"cue-svg-icon",4),2&m){const d=s.XpG(2).$implicit;s.Y8G("name",d.icon)}}function y(m,C){if(1&m&&s.nrm(0,"cue-menu-nested",6),2&m){const d=s.XpG(2).$implicit,M=s.XpG();s.Y8G("items",d.children)("size",M.size())}}function x(m,C){if(1&m&&(s.j41(0,"cue-menu",1)(1,"cue-menu-item",3),s.nVh(2,v,1,1,"cue-svg-icon",4),s.EFF(3),s.nrm(4,"cue-svg-icon",5),s.k0s(),s.nVh(5,y,1,2,"cue-menu-nested",6),s.k0s()),2&m){const d=s.XpG().$implicit,M=s.XpG();s.Y8G("size",M.size()),s.R7$(),s.Y8G("title",d.tooltip),s.R7$(),s.vxM(d.icon?2:-1),s.R7$(),s.SpI(" ",d.label," "),s.R7$(2),s.vxM(d.children?5:-1)}}function w(m,C){if(1&m&&s.nrm(0,"cue-svg-icon",4),2&m){const d=s.XpG(2).$implicit;s.Y8G("name",d.icon)}}function P(m,C){if(1&m){const d=s.RV6();s.j41(0,"cue-menu-item",7),s.bIt("click",function(){f.eBV(d);const e=s.XpG().$implicit;return f.Njj(null==e.action?null:e.action())}),s.nVh(1,w,1,1,"cue-svg-icon",4),s.EFF(2),s.k0s()}if(2&m){const d=s.XpG().$implicit;s.Y8G("title",d.tooltip),s.R7$(),s.vxM(d.icon?1:-1),s.R7$(),s.SpI(" ",d.label," ")}}function R(m,C){if(1&m&&s.nVh(0,x,6,5,"cue-menu",1)(1,P,3,3,"cue-menu-item",2),2&m){const d=C.$implicit;s.vxM(null!=d.children&&d.children.length?0:1)}}let E=(()=>{class m{items=c.hFB.required();size=(0,c.hFB)("m");static \u0275fac=function(M){return new(M||m)};static \u0275cmp=s.VBU({type:m,selectors:[["cue-menu-nested"]],inputs:{items:[1,"items"],size:[1,"size"]},decls:3,vars:1,consts:[[3,"size"],["trigger","hover",3,"size"],[3,"title"],["trigger","",3,"title"],["before","",3,"name"],["after","","name","paginator-next"],["menu","",3,"items","size"],[3,"click","title"]],template:function(M,e){1&M&&(s.j41(0,"cue-menu-wrap",0),s.Z7z(1,R,2,1,null,null,_),s.k0s()),2&M&&(s.Y8G("size",e.size()),s.R7$(),s.Dyx(e.items()))},dependencies:[m,g.W,k.D,V.M,a.A],encapsulation:2})}return m})()},2065(j,z,r){function g(f,s,_="text/plain"){return function c(f,s="data.zip"){const _=document.createElement("a"),v=URL.createObjectURL(f);_.href=v,_.download=s,document.body.appendChild(_),_.click(),document.body.removeChild(_),URL.revokeObjectURL(v)}(new Blob([f],{type:_}),s)}function k(f,s){const _=document.createElement("a");_.style.display="hidden",_.setAttribute("href",window.URL.createObjectURL(f)),_.setAttribute("download",s),document.body.appendChild(_),_.click(),_.remove()}r.d(z,{KE:()=>k,YN:()=>g})}}]);
package/675.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[675],{1675(k,g,s){s.d(g,{CueProjectList:()=>F});var m=s(467),r=s(7705),i=s(5802),l=s(2271),j=s(6950),f=s(8017),h=s(6455),v=s(8334),u=s(2306),_=s(140),p=s(58),S=s(5187),t=s(5547);function x(n,d){if(1&n){const e=t.RV6();t.j41(0,"cue-tabs",0)(1,"cue-tab",1)(2,"cue-ag-grid",2),t.bIt("selectedRows",function(a){i.eBV(e);const c=t.XpG();return i.Njj(c.onSelectedRows(a))}),t.k0s()(),t.j41(3,"cue-tab",3)(4,"cue-map",4),t.bIt("clickedFeature",function(a){i.eBV(e);const c=t.XpG();return i.Njj(c.onMapFeatureClick(a))}),t.k0s()()()}if(2&n){const e=t.XpG();t.Y8G("variant",e.variant()),t.R7$(2),t.Y8G("rowData",e.projects())("columnDefs",e.columnDefs)("rowSelection",e.rowSelection)("showPaginator",!1),t.R7$(2),t.Y8G("layers",e.mapLayers())("settings",e._mapSettings())("zoomToFit",!0)("hoverTooltipFn",e.mapHoverTooltipFn)}}function P(n,d){if(1&n){const e=t.RV6();t.j41(0,"cue-card",5)(1,"cue-ag-grid",2),t.bIt("selectedRows",function(a){i.eBV(e);const c=t.XpG(2);return i.Njj(c.onSelectedRows(a))}),t.k0s()()}if(2&n){const e=t.XpG(2);t.Y8G("variant",e._cardVariant())("padded",!1),t.R7$(),t.Y8G("rowData",e.projects())("columnDefs",e.columnDefs)("rowSelection",e.rowSelection)("showPaginator",!1)}}function C(n,d){if(1&n){const e=t.RV6();t.j41(0,"cue-ag-grid",2),t.bIt("selectedRows",function(a){i.eBV(e);const c=t.XpG(2);return i.Njj(c.onSelectedRows(a))}),t.k0s()}if(2&n){const e=t.XpG(2);t.Y8G("rowData",e.projects())("columnDefs",e.columnDefs)("rowSelection",e.rowSelection)("showPaginator",!1)}}function w(n,d){if(1&n&&t.nVh(0,P,2,6,"cue-card",5)(1,C,1,4,"cue-ag-grid",6),2&n){const e=t.XpG();t.vxM("none"!==e.variant()?0:1)}}let y=(()=>{class n{projects=(0,r.hFB)([]);mapSettings=(0,r.hFB)(new u.yY);variant=(0,r.hFB)("none");projectSelected=(0,r.CGW)();_cardVariant=(0,l.EW)(()=>this.variant());columnDefs=[{field:"name",headerName:"Project",flex:1}];rowSelection={mode:"singleRow",checkboxes:!1,enableClickSelection:!0};_mapSettings=(0,l.EW)(()=>({...this.mapSettings(),contextMenu:{showProperties:!1,showFlyTo:!1}}));mapHoverTooltipFn=e=>e.name??null;onSelectedRows(e){const o=e[0]?.id;o&&this.projectSelected.emit(o)}onMapFeatureClick(e){const o=e.feature.properties?.id;o&&this.projectSelected.emit(o)}hasLocations=(0,l.EW)(()=>this.projects().some(e=>!!e.location));mapLayers=(0,l.EW)(()=>{const e=this.projects().filter(a=>!!a.location);if(!e.length)return[];const o=new u.ux("Projects","projects");return o.collection=new _.o(e.flatMap(a=>{const c=(0,p.S)(a.location);return c?[{type:"Feature",geometry:(0,p.n)(c),properties:{name:a.name,id:a.id}}]:[]})),[o]});static \u0275fac=function(o){return new(o||n)};static \u0275cmp=t.VBU({type:n,selectors:[["cue-proj-list"]],inputs:{projects:[1,"projects"],mapSettings:[1,"mapSettings"],variant:[1,"variant"]},outputs:{projectSelected:"projectSelected"},decls:2,vars:1,consts:[[2,"flex","1",3,"variant"],["label","List"],[3,"selectedRows","rowData","columnDefs","rowSelection","showPaginator"],["label","Map"],[3,"clickedFeature","layers","settings","zoomToFit","hoverTooltipFn"],[2,"height","100%","width","100%",3,"variant","padded"],[3,"rowData","columnDefs","rowSelection","showPaginator"]],template:function(o,a){1&o&&t.nVh(0,x,5,9,"cue-tabs",0)(1,w,2,1),2&o&&t.vxM(a.hasLocations()?0:1)},dependencies:[j.R,f.T,h.t,v.o,S.Z],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%}cue-tabs[_ngcontent-%COMP%]{flex:1}cue-ag-grid[_ngcontent-%COMP%]{flex:1}cue-map[_ngcontent-%COMP%]{flex:1;min-height:300px}"],changeDetection:0})}return n})();var T=s(5381),M=s(2245);function D(n,d){1&n&&(t.j41(0,"cue-flexcontainer",0)(1,"cue-typography",2),t.EFF(2," Loading projects\u2026 "),t.k0s()())}function b(n,d){if(1&n&&(t.j41(0,"cue-flexcontainer",0)(1,"cue-typography",3),t.EFF(2),t.k0s()()),2&n){const e=t.XpG();t.R7$(2),t.SpI(" ",e.errorMessage()," ")}}function L(n,d){if(1&n){const e=t.RV6();t.j41(0,"cue-proj-list",4),t.bIt("projectSelected",function(a){i.eBV(e);const c=t.XpG();return i.Njj(c.projectSelected.emit(a))}),t.k0s()}if(2&n){const e=t.XpG();t.Y8G("projects",e.projects())("mapSettings",e.mapSettings())("variant",e.variant())}}let F=(()=>{class n{sdkState=(0,r.hFB)(void 0);mapboxToken=(0,r.hFB)(void 0);variant=(0,r.hFB)("none");projectSelected=(0,r.CGW)();state=(0,i.vPA)("idle");errorMessage=(0,i.vPA)(null);_rawProjects=(0,i.vPA)([]);mapSettings=(0,l.EW)(()=>({...new u.yY,mapboxToken:this.mapboxToken()}));projects=(0,l.EW)(()=>this._rawProjects().map(e=>({id:e.id,name:e.name,location:e.location??void 0})));_lastCue;_inputWarningTimer;constructor(){this._inputWarningTimer=setTimeout(()=>{this.sdkState()?.cue||console.warn('[cue-project-list] Required input "sdkState" is not set or missing a `cue` property. Pass a { cue: Cue } object to enable project loading.')},3e3),(0,i.QZP)(()=>{const e=this.sdkState()?.cue;e!==this._lastCue&&(this._lastCue=e,e?this._loadProjects(e.projects):(this._rawProjects.set([]),this.state.set("idle"),this.errorMessage.set(null)))})}ngOnDestroy(){clearTimeout(this._inputWarningTimer)}_loadProjects(e){var o=this;return(0,m.A)(function*(){o.state.set("loading"),o.errorMessage.set(null);try{const a=yield e.listProjects();o._rawProjects.set(a),o.state.set("ready")}catch(a){console.error("[CueProjectList] Failed to load projects:",a),o.errorMessage.set(a instanceof Error?a.message:String(a)),o.state.set("error")}})()}static \u0275fac=function(o){return new(o||n)};static \u0275cmp=t.VBU({type:n,selectors:[["cue-project-list"]],inputs:{sdkState:[1,"sdkState"],mapboxToken:[1,"mapboxToken"],variant:[1,"variant"]},outputs:{projectSelected:"projectSelected"},decls:3,vars:1,consts:[["direction","column","align","center","justify","center",2,"height","100%","width","100%","padding","8px"],[2,"height","100%",3,"projects","mapSettings","variant"],[2,"color","var(--cue-defaultContrast)","opacity","0.5","font-size","13px"],[2,"color","#c44","font-size","13px"],[2,"height","100%",3,"projectSelected","projects","mapSettings","variant"]],template:function(o,a){1&o&&t.nVh(0,D,3,0,"cue-flexcontainer",0)(1,b,3,1,"cue-flexcontainer",0)(2,L,1,3,"cue-proj-list",1),2&o&&t.vxM("loading"===a.state()?0:"error"===a.state()?1:2)},dependencies:[y,T.n,M.Typography],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%}"],changeDetection:0})}return n})()}}]);
1
+ "use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[675],{1675(k,g,s){s.d(g,{CueProjectList:()=>F});var m=s(467),r=s(7705),i=s(5802),l=s(2271),j=s(2611),f=s(8017),h=s(6455),v=s(8334),u=s(2306),_=s(140),p=s(58),S=s(5187),t=s(5547);function x(n,d){if(1&n){const e=t.RV6();t.j41(0,"cue-tabs",0)(1,"cue-tab",1)(2,"cue-ag-grid",2),t.bIt("selectedRows",function(a){i.eBV(e);const c=t.XpG();return i.Njj(c.onSelectedRows(a))}),t.k0s()(),t.j41(3,"cue-tab",3)(4,"cue-map",4),t.bIt("clickedFeature",function(a){i.eBV(e);const c=t.XpG();return i.Njj(c.onMapFeatureClick(a))}),t.k0s()()()}if(2&n){const e=t.XpG();t.Y8G("variant",e.variant()),t.R7$(2),t.Y8G("rowData",e.projects())("columnDefs",e.columnDefs)("rowSelection",e.rowSelection)("showPaginator",!1),t.R7$(2),t.Y8G("layers",e.mapLayers())("settings",e._mapSettings())("zoomToFit",!0)("hoverTooltipFn",e.mapHoverTooltipFn)}}function P(n,d){if(1&n){const e=t.RV6();t.j41(0,"cue-card",5)(1,"cue-ag-grid",2),t.bIt("selectedRows",function(a){i.eBV(e);const c=t.XpG(2);return i.Njj(c.onSelectedRows(a))}),t.k0s()()}if(2&n){const e=t.XpG(2);t.Y8G("variant",e._cardVariant())("padded",!1),t.R7$(),t.Y8G("rowData",e.projects())("columnDefs",e.columnDefs)("rowSelection",e.rowSelection)("showPaginator",!1)}}function C(n,d){if(1&n){const e=t.RV6();t.j41(0,"cue-ag-grid",2),t.bIt("selectedRows",function(a){i.eBV(e);const c=t.XpG(2);return i.Njj(c.onSelectedRows(a))}),t.k0s()}if(2&n){const e=t.XpG(2);t.Y8G("rowData",e.projects())("columnDefs",e.columnDefs)("rowSelection",e.rowSelection)("showPaginator",!1)}}function w(n,d){if(1&n&&t.nVh(0,P,2,6,"cue-card",5)(1,C,1,4,"cue-ag-grid",6),2&n){const e=t.XpG();t.vxM("none"!==e.variant()?0:1)}}let y=(()=>{class n{projects=(0,r.hFB)([]);mapSettings=(0,r.hFB)(new u.yY);variant=(0,r.hFB)("none");projectSelected=(0,r.CGW)();_cardVariant=(0,l.EW)(()=>this.variant());columnDefs=[{field:"name",headerName:"Project",flex:1}];rowSelection={mode:"singleRow",checkboxes:!1,enableClickSelection:!0};_mapSettings=(0,l.EW)(()=>({...this.mapSettings(),contextMenu:{showProperties:!1,showFlyTo:!1}}));mapHoverTooltipFn=e=>e.name??null;onSelectedRows(e){const o=e[0]?.id;o&&this.projectSelected.emit(o)}onMapFeatureClick(e){const o=e.feature.properties?.id;o&&this.projectSelected.emit(o)}hasLocations=(0,l.EW)(()=>this.projects().some(e=>!!e.location));mapLayers=(0,l.EW)(()=>{const e=this.projects().filter(a=>!!a.location);if(!e.length)return[];const o=new u.ux("Projects","projects");return o.collection=new _.o(e.flatMap(a=>{const c=(0,p.S)(a.location);return c?[{type:"Feature",geometry:(0,p.n)(c),properties:{name:a.name,id:a.id}}]:[]})),[o]});static \u0275fac=function(o){return new(o||n)};static \u0275cmp=t.VBU({type:n,selectors:[["cue-proj-list"]],inputs:{projects:[1,"projects"],mapSettings:[1,"mapSettings"],variant:[1,"variant"]},outputs:{projectSelected:"projectSelected"},decls:2,vars:1,consts:[[2,"flex","1",3,"variant"],["label","List"],[3,"selectedRows","rowData","columnDefs","rowSelection","showPaginator"],["label","Map"],[3,"clickedFeature","layers","settings","zoomToFit","hoverTooltipFn"],[2,"height","100%","width","100%",3,"variant","padded"],[3,"rowData","columnDefs","rowSelection","showPaginator"]],template:function(o,a){1&o&&t.nVh(0,x,5,9,"cue-tabs",0)(1,w,2,1),2&o&&t.vxM(a.hasLocations()?0:1)},dependencies:[j.R,f.T,h.t,v.o,S.Z],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%}cue-tabs[_ngcontent-%COMP%]{flex:1}cue-ag-grid[_ngcontent-%COMP%]{flex:1}cue-map[_ngcontent-%COMP%]{flex:1;min-height:300px}"],changeDetection:0})}return n})();var T=s(5381),M=s(2245);function D(n,d){1&n&&(t.j41(0,"cue-flexcontainer",0)(1,"cue-typography",2),t.EFF(2," Loading projects\u2026 "),t.k0s()())}function b(n,d){if(1&n&&(t.j41(0,"cue-flexcontainer",0)(1,"cue-typography",3),t.EFF(2),t.k0s()()),2&n){const e=t.XpG();t.R7$(2),t.SpI(" ",e.errorMessage()," ")}}function L(n,d){if(1&n){const e=t.RV6();t.j41(0,"cue-proj-list",4),t.bIt("projectSelected",function(a){i.eBV(e);const c=t.XpG();return i.Njj(c.projectSelected.emit(a))}),t.k0s()}if(2&n){const e=t.XpG();t.Y8G("projects",e.projects())("mapSettings",e.mapSettings())("variant",e.variant())}}let F=(()=>{class n{sdkState=(0,r.hFB)(void 0);mapboxToken=(0,r.hFB)(void 0);variant=(0,r.hFB)("none");projectSelected=(0,r.CGW)();state=(0,i.vPA)("idle");errorMessage=(0,i.vPA)(null);_rawProjects=(0,i.vPA)([]);mapSettings=(0,l.EW)(()=>({...new u.yY,mapboxToken:this.mapboxToken()}));projects=(0,l.EW)(()=>this._rawProjects().map(e=>({id:e.id,name:e.name,location:e.location??void 0})));_lastCue;_inputWarningTimer;constructor(){this._inputWarningTimer=setTimeout(()=>{this.sdkState()?.cue||console.warn('[cue-project-list] Required input "sdkState" is not set or missing a `cue` property. Pass a { cue: Cue } object to enable project loading.')},3e3),(0,i.QZP)(()=>{const e=this.sdkState()?.cue;e!==this._lastCue&&(this._lastCue=e,e?this._loadProjects(e.projects):(this._rawProjects.set([]),this.state.set("idle"),this.errorMessage.set(null)))})}ngOnDestroy(){clearTimeout(this._inputWarningTimer)}_loadProjects(e){var o=this;return(0,m.A)(function*(){o.state.set("loading"),o.errorMessage.set(null);try{const a=yield e.listProjects();o._rawProjects.set(a),o.state.set("ready")}catch(a){console.error("[CueProjectList] Failed to load projects:",a),o.errorMessage.set(a instanceof Error?a.message:String(a)),o.state.set("error")}})()}static \u0275fac=function(o){return new(o||n)};static \u0275cmp=t.VBU({type:n,selectors:[["cue-project-list"]],inputs:{sdkState:[1,"sdkState"],mapboxToken:[1,"mapboxToken"],variant:[1,"variant"]},outputs:{projectSelected:"projectSelected"},decls:3,vars:1,consts:[["direction","column","align","center","justify","center",2,"height","100%","width","100%","padding","8px"],[2,"height","100%",3,"projects","mapSettings","variant"],[2,"color","var(--cue-defaultContrast)","opacity","0.5","font-size","13px"],[2,"color","#c44","font-size","13px"],[2,"height","100%",3,"projectSelected","projects","mapSettings","variant"]],template:function(o,a){1&o&&t.nVh(0,D,3,0,"cue-flexcontainer",0)(1,b,3,1,"cue-flexcontainer",0)(2,L,1,3,"cue-proj-list",1),2&o&&t.vxM("loading"===a.state()?0:"error"===a.state()?1:2)},dependencies:[y,T.n,M.Typography],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%}"],changeDetection:0})}return n})()}}]);
package/695.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[695],{695(Ut,ge,h){h.d(ge,{CueSparqlTable:()=>Ht});var g=h(7705),s=h(5802),_=h(2271),Z=h(6561),C=h(467),he=h(7374),q=h.n(he),P=h(7400);function A(l,d,t=""){const a=d.valueKey??"val",n=d.priorityKey,o=d.fallback??t,i=d.preProcess?l.map(p=>{const c=p[a];return null==c?p:{...p,[a]:(0,P.w9)(d.preProcess,c)}}):l,r=(n?[...i].sort((p,c)=>{const f=p[n],m=c[n],y=Number(f),T=Number(m);return isNaN(y)||isNaN(T)?(m??"").localeCompare(f??""):T-y}):i).map(p=>p[a]).filter(p=>null!=p);if(0===r.length)return o;switch(d.type){case"first":default:return r[0];case"last":return r[r.length-1];case"random":return r[Math.floor(Math.random()*r.length)];case"count":return String(r.length);case"join":return r.join(d.separator??", ");case"longest":return r.reduce((p,c)=>c.length>p.length?c:p);case"shortest":return r.reduce((p,c)=>c.length<p.length?c:p);case"sum":{const p=r.map(Number).filter(c=>!isNaN(c));return p.length?String(p.reduce((c,f)=>c+f,0)):t}case"avg":{const p=r.map(Number).filter(c=>!isNaN(c));return p.length?String(p.reduce((c,f)=>c+f,0)/p.length):t}case"min":{const p=r.map(Number).filter(c=>!isNaN(c));return p.length?String(Math.min(...p)):t}case"max":{const p=r.map(Number).filter(c=>!isNaN(c));return p.length?String(Math.max(...p)):t}case"mostRecent":return[...r].sort((c,f)=>q()(f).valueOf()-q()(c).valueOf())[0];case"oldest":return[...r].sort((c,f)=>q()(c).valueOf()-q()(f).valueOf())[0];case"map":{const{map:p}=d;return p[r[0]]??o}}}const ee=Object.keys({first:"First",last:"Last",random:"Random",join:"Concatenate",count:"Count",longest:"Longest text",shortest:"Shortest text",map:"Map lookup",sum:"Sum",avg:"Average",min:"Minimum",max:"Maximum",mostRecent:"Most recent date",oldest:"Oldest date"}),Q=["first","last","random","join","count"],te={text:[...Q,"longest","shortest","map"],number:[...Q,"sum","avg","min","max"],date:[...Q,"mostRecent","oldest"]},ye={first:"components.sparqlTable.strategyFirst",last:"components.sparqlTable.strategyLast",random:"components.sparqlTable.strategyRandom",join:"components.sparqlTable.strategyJoin",count:"components.sparqlTable.strategyCount",longest:"components.sparqlTable.strategyLongest",shortest:"components.sparqlTable.strategyShortest",map:"components.sparqlTable.strategyMap",sum:"components.sparqlTable.strategySum",avg:"components.sparqlTable.strategyAvg",min:"components.sparqlTable.strategyMin",max:"components.sparqlTable.strategyMax",mostRecent:"components.sparqlTable.strategyMostRecent",oldest:"components.sparqlTable.strategyOldest"},be={first:"components.sparqlTable.strategyFirstDesc",last:"components.sparqlTable.strategyLastDesc",random:"components.sparqlTable.strategyRandomDesc",join:"components.sparqlTable.strategyJoinDesc",count:"components.sparqlTable.strategyCountDesc",longest:"components.sparqlTable.strategyLongestDesc",shortest:"components.sparqlTable.strategyShortestDesc",map:"components.sparqlTable.strategyMapDesc",sum:"components.sparqlTable.strategySumDesc",avg:"components.sparqlTable.strategyAvgDesc",min:"components.sparqlTable.strategyMinDesc",max:"components.sparqlTable.strategyMaxDesc",mostRecent:"components.sparqlTable.strategyMostRecentDesc",oldest:"components.sparqlTable.strategyOldestDesc"};var O=h(7573);const $=`PREFIX qcy: <${O.E.qcy}>\nPREFIX qcy-e: <${O.E["qcy-e"]}>\n\nSELECT ?subject\nWHERE {\n ?subject a qcy:CanonicalEntity ;\n qcy:hasEntityCategory qcy-e:Person .\n}`;class ne{field;headerName;sortable;filter;editable;hide;minWidth;cellStyle;headerClass;query="";defType="data";calculatedFrom;evaluation;datatype;postProcess;strategy;valueKey;labelKey;formatter=void 0;constructor(d="",t=""){this.field=d,this.headerName=t}getFormatter=()=>{if(this.formatter)return this.formatter;if(this.strategy){const d=this.strategy;return t=>A(t,d,"")}return d=>Array.isArray(d)?d.map(t=>t?.val??"").filter(Boolean).join(", "):String(d??"")}}var De=h(4284);class Te{menuDisplaySettings=new Ce;columnSelectSettings=new Se}class Ce{hide=!0;buttonVariant="tertiary";buttonSize="s";showColumnSelect=!0;showDownload=!0}class Se{allowEditing=!0;allowToggleEditable=!0;allowToggleHideOnHover=!0;allowSettingTextAlign=!0;allowSettingLabel=!0}var Me=h(222),w=h(6593);function E(l){const d=new w.Parser({sparqlStar:!0});try{return d.parse(l)}catch(t){if(-1!=t.toString().indexOf("SPARQL*"))return{type:"query",queryType:"CONSTRUCT",sparqlStar:!0};throw"Couldn't get query details: "+t.toString()}}class xe{queryHandler=(0,C.A)(function*(){throw new Error("No query handler defined")})}var oe=h(7089),e=h(5547);function Ee(l,d){if(1&l&&(e.j41(0,"span",1),e.EFF(1),e.k0s()),2&l){const t=e.XpG();e.Y8G("cueTooltip",t._tooltip()),e.R7$(),e.SpI("\xd7",t._allValues().length)}}let Fe=(()=>{class l{_displayValue=(0,s.vPA)("");_allValues=(0,s.vPA)([]);_tooltip=(0,s.vPA)("");agInit(t){this._apply(t)}refresh(t){return this._apply(t),!0}_apply(t){const a=t.value,n=Array.isArray(a)?a:null!=a?[a]:[],o=t.colDef?.cellRendererParams?.strategy,i=t.colDef?.cellRendererParams?.valueKey??"val",r=t.colDef?.cellRendererParams?.labelKey??i,p=n.map(f=>f[r]).filter(Boolean);this._allValues.set(p);const c=t.colDef?.cellRendererParams?.postProcess;this._displayValue.set((0,P.g4)(o?A(n,o):p[0]??"",c)),this._tooltip.set(p.map(f=>(0,P.g4)(f,c)).join("\n"))}static \u0275fac=function(a){return new(a||l)};static \u0275cmp=e.VBU({type:l,selectors:[["cue-multi-binding-cell-renderer"]],decls:3,vars:2,consts:[[1,"cell-value"],["cueTooltipPosition","bottomleft",1,"badge",3,"cueTooltip"]],template:function(a,n){1&a&&(e.j41(0,"span",0),e.EFF(1),e.k0s(),e.nVh(2,Ee,2,2,"span",1)),2&a&&(e.R7$(),e.JRh(n._displayValue()),e.R7$(),e.vxM(n._allValues().length>1?2:-1))},dependencies:[oe.d],styles:["[_nghost-%COMP%]{display:flex;align-items:center;gap:4px;overflow:hidden;width:100%}.cell-value[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1}.badge[_ngcontent-%COMP%]{flex-shrink:0;font-size:10px;font-weight:600;background:var(--cue-color-blue, #2563eb);color:#fff;border-radius:8px;padding:0 5px;line-height:16px;cursor:default}"],changeDetection:0})}return l})();const le=["template","formula","pipeline"],ie=["add","subtract","multiply","divide"],Ae={template:"components.sparqlTable.evalTypeTemplate",formula:"components.sparqlTable.evalTypeFormula",pipeline:"components.sparqlTable.evalTypePipeline"},je={template:"components.sparqlTable.evalTypeTemplateDesc",formula:"components.sparqlTable.evalTypeFormulaDesc",pipeline:"components.sparqlTable.evalTypePipelineDesc"},Ne={add:"components.sparqlTable.formulaOpAdd",subtract:"components.sparqlTable.formulaOpSubtract",multiply:"components.sparqlTable.formulaOpMultiply",divide:"components.sparqlTable.formulaOpDivide"};let I=(()=>{class l{_requestedColumns=[];_columnQueries={};emptyTableText=(0,s.vPA)("Building table");_columns=(0,s.vPA)([]);_columnsGross=(0,s.vPA)(void 0);_dataColumns=(0,s.vPA)(void 0);columnDefsGross=(0,_.EW)(()=>void 0===this._columnsGross()?this._columns():this._columnsGross());keyVals={};_handlers=(0,s.vPA)(new xe);destroy(){this.keyVals={},this._requestedColumns=[],this._columnQueries={},this.fetchedColumns.update(()=>[])}resetData(){this.keyVals={},this._requestedColumns=[],this._columnQueries={},this.fetchedColumns.update(()=>[])}mergeColumnData(t,a,n){Object.entries(a).forEach(([o,i])=>{this.keyVals[o]||(this.keyVals[o]={}),void 0===this.keyVals[o][t]&&(this.keyVals[o][t]=i)}),this._requestedColumns.includes(t)||this._requestedColumns.push(t),this._columnQueries[t]=n,this.fetchedColumns.update(o=>[...o,t])}injectPreloadedData(t,a,n){this.keyVals=t,this._requestedColumns=[...a],this._columnQueries={...n},this.fetchedColumns.update(()=>[...a])}fetchedColumns=(0,s.vPA)([],{equal:(t,a)=>t.length===a.length});totalQueryCount=(0,_.EW)(()=>{const t=new Set;for(const a of this._columns())"data"===a.defType&&!a.hide&&a.query&&t.add(a.field);return t.size});columnDefsAG=(0,_.EW)(()=>{const t=[];return this._columns().forEach(a=>{const n=a.getFormatter();if("calculated"===a.defType){const o=this._columns().filter(r=>"data"===r.defType).map(r=>r.field);if(Array.from(new Set(o)).every(r=>this.fetchedColumns().includes(r))){const r=a.formatter??n;t.push({colId:a.field,headerName:a.headerName,sortable:!0,filter:!0,...a.minWidth?{minWidth:a.minWidth}:{},valueGetter:p=>r(null,p.data)})}}else if("evaluation"===a.defType){const o=this._columns().filter(r=>"data"===r.defType).map(r=>r.field);if(Array.from(new Set(o)).every(r=>this.fetchedColumns().includes(r))&&a.evaluation){const r=a.evaluation,p=this._columns();t.push({colId:a.field,headerName:a.headerName,hide:a.hide,flex:1,sortable:!0,filter:!0,valueGetter:c=>{const f=c.data??{},m={};for(const y of p)if("data"===y.defType){const T=y.getFormatter();m[y.field]=(0,P.g4)(T(f[y.field]??[]),y.postProcess)}return function we(l,d,t="",a){switch(l.type){case"template":return l.template.replace(/\$\{([\w.-]+)\}/g,(n,o)=>d[o]??"").trim();case"formula":{const n=l.fields.map(o=>parseFloat(d[o])).filter(o=>!isNaN(o));if(0===n.length)return t;switch(l.op){case"add":return String(n.reduce((o,i)=>o+i,0));case"subtract":return String(n.reduce((o,i)=>o-i));case"multiply":return String(n.reduce((o,i)=>o*i,1));case"divide":return n.length<2||0===n[1]?t:String(n[0]/n[1])}return t}case"pipeline":{const{sources:n,transform:o,exclude:i,deduplicate:u,sort:r,limit:p,valueKey:c="val"}=l,f=l.separator??", ",m=l.fallback??t,y=new Set,T=[];for(const M of n){let D=(a?.[M]??[]).map(v=>v[c]??"").filter(v=>""!==v);o&&(D=D.map(v=>(0,P.w9)(o,v))),i?.length&&(D=D.filter(v=>!i.includes(v)));for(const v of D)u&&y.has(v)||(y.add(v),T.push(v))}r&&T.sort();const b=void 0!==p?T.slice(0,p):T;return 0===b.length?m:b.join(f)}}}(r,m,"",f)}})}}else{const o=!!a.strategy;t.push({field:a.field,headerName:a.headerName,hide:a.hide,flex:1,sortable:!0,filter:!0,...a.minWidth?{minWidth:a.minWidth}:{},...a.cellStyle?{cellStyle:a.cellStyle}:{},...a.headerClass?{headerClass:a.headerClass}:{},valueGetter:o?i=>i.data?.[a.field]??[]:i=>(0,P.g4)(n(i.data?.[a.field]??[]),a.postProcess),...o?{comparator:(i,u)=>{const r=Array.isArray(i)?i:[],p=Array.isArray(u)?u:[],c=(0,P.g4)(A(r,a.strategy,""),a.postProcess),f=(0,P.g4)(A(p,a.strategy,""),a.postProcess);return c.localeCompare(f)},cellRenderer:Fe,cellRendererParams:{strategy:a.strategy,valueKey:a.valueKey??"val",labelKey:a.labelKey,postProcess:a.postProcess}}:{}})}}),t});set columns(t){t.forEach(a=>{a.field&&void 0!==this._columnQueries[a.field]&&this._columnQueries[a.field]!==a.query&&(this._requestedColumns=this._requestedColumns.filter(n=>n!==a.field),Object.values(this.keyVals).forEach(n=>delete n[a.field]),this.fetchedColumns.update(n=>n.filter(o=>o!==a.field))),this._columnQueries[a.field]=a.query}),this._columns.set(t),this.buildTable()}set columnsGross(t){this._columnsGross.set(t)}set dataColumns(t){this._dataColumns.set(t)}set handlers(t){this._handlers.set(t)}get visibleColumns(){return this._columns}buildTable(){var t=this;return(0,C.A)(function*(){const a=t._columns(),n=t._dataColumns(),o=a.filter(r=>"data"===r.defType&&!r.hide),i=n?.filter(r=>"data"===r.defType&&!r.hide);if(!o.length&&!i?.length)return void((a.length>0||(n?.length??0)>0)&&t.emptyTableText.set("No data columns defined"));t.emptyTableText.set("Building table...");const u=[];o.forEach(r=>{u.push(t.fetchColumnData(r))}),i?.forEach(r=>{u.push(t.fetchColumnData(r))}),yield Promise.all(u),t.emptyTableText.set("Table data downloaded")})()}fetchColumnData(t){var a=this;return(0,C.A)(function*(){if(a._requestedColumns.includes(t.field))return;a._requestedColumns.push(t.field);const n=E(t.query),o=yield a._handlers().queryHandler(t.query,n),i=new Set;o.results.bindings.forEach(u=>{const r=u.subject?.value,p=Object.keys(u).filter(f=>"subject"!==f),c={};p.forEach(f=>{const m=u[f]?.value;Object.keys(a.keyVals).includes(r)||(a.keyVals[r]={}),void 0===a.keyVals[r][t.field]&&(a.keyVals[r][t.field]=[]),c[f]=m}),a.keyVals[r][t.field].push(c),i.add(r)}),a.fetchedColumns.update(u=>[...u,t.field])})()}static \u0275fac=function(a){return new(a||l)};static \u0275prov=s.jDH({token:l,factory:l.\u0275fac,providedIn:"root"})}return l})(),B=(()=>{class l{_isUpdating=!1;_pendingUpdate=!1;_dataFetchService=(0,s.WQX)(I);tableData=(0,s.vPA)([]);destroy(){this.tableData.update(()=>[])}onProcessedColumn=(0,s.QZP)((()=>{var t=this;return(0,C.A)(function*(){t._dataFetchService.fetchedColumns(),yield t._debouncedUpdateTableData()})})());_debouncedUpdateTableData(){var t=this;return(0,C.A)(function*(){t._isUpdating?t._pendingUpdate=!0:(t._isUpdating=!0,yield t._updateTableData(),t._isUpdating=!1,t._pendingUpdate&&(t._pendingUpdate=!1,yield t._debouncedUpdateTableData()))})()}_updateTableData(){var t=this;return(0,C.A)(function*(){return new Promise(a=>{const n={},o=Object.keys(t._dataFetchService.keyVals),i=[],u=t._dataFetchService.visibleColumns().map(p=>p.field);let r=!1;for(let p=0;p<o.length;p++){const c=o[p],f={};if(f.id=c,Object.keys(t._dataFetchService.keyVals[c]).forEach(m=>{Object.keys(n).includes(m)||(n[m]=0),f[m]=t._dataFetchService.keyVals[c][m]??[],""!==f[m]&&n[m]++}),i.push(f),!r&&9===p){let m=!0;for(const y of u)if(typeof f[y]>"u"){m=!1;break}m&&(t.tableData.update(()=>[...i]),r=!0)}}t.tableData.update(()=>i),a()})})()}static \u0275fac=function(a){return new(a||l)};static \u0275prov=s.jDH({token:l,factory:l.\u0275fac,providedIn:"root"})}return l})();var j=h(2245),N=h(5381),ke=h(2611);function qe(l,d){if(1&l&&e.nrm(0,"cue-typography",1),2&l){const t=e.XpG();e.Y8G("innerHTML",t.instructions(),e.npT)}}let Ie=(()=>{class l{tableService=(0,s.WQX)(B);dataFetchService=(0,s.WQX)(I);handlers=g.hFB.required();columns=(0,g.geq)([]);columnsGross=(0,g.hFB)();dataColumns=(0,g.hFB)();showInstructions=(0,g.hFB)(!1);showPaginator=(0,g.hFB)(!0);paginationPageSize=(0,g.hFB)(10);settings=(0,g.hFB)(new Te);emptyTableText=(0,g.geq)("Building table");clickableRows=(0,g.hFB)(!1);useAGGrid=(0,g.hFB)(!1);size=(0,g.hFB)("m");clickedRow=(0,g.CGW)();hoveredRow=(0,g.CGW)();tableDataUpdated=(0,g.CGW)();gridApi=(0,g.CGW)();visibleRows=(0,g.CGW)();columnDefsAG=(0,g.CGW)();onAGColumnDefs=(0,s.QZP)(()=>{const t=this.dataFetchService.columnDefsAG();this.columnDefsAG.emit(t)});onTableDataChange=(0,s.QZP)(()=>{this.tableDataUpdated.emit(this.tableService.tableData())});onHandlersChange=(0,s.QZP)(()=>{this.dataFetchService.handlers=this.handlers()});onColumnsChange=(0,s.QZP)(()=>{this.dataFetchService.columns=this.columns()});onColumnsGrossChange=(0,s.QZP)(()=>{this.dataFetchService.columnsGross=this.columnsGross()});onDataColumnsChange=(0,s.QZP)(()=>{this.dataFetchService.dataColumns=this.dataColumns()});onEmptyTableTextChange=(0,s.QZP)(()=>{this.emptyTableText.set(this.emptyTableText())});_onGridApiReady(t){this.gridApi.emit(t),t.addEventListener("columnVisible",a=>{a.visible&&(a.columns??(a.column?[a.column]:[])).forEach(o=>{const i=o.getColId(),u=this.columns().find(r=>r.field===i);u&&this.dataFetchService.fetchColumnData(u)})})}instructions=(0,s.vPA)("");buildInstructions=(0,s.QZP)((()=>{var t=this;return(0,C.A)(function*(){if(t.showInstructions()){const a=yield(0,Me.xI)('The component takes an array of SPARQL table columns. It is an extension of the regular table that adds a query to the column definition and restricts the formatter to always start with an array of values that should be converted to a string value (per default by comma joining).\n\nThere are some requirements for the SPARQL query:\n\n- Must be a SELECT query \n- Must use variable `?subject` to bind to the row identifier\n- No grouping needed since the component automatically groups by key and returns the remaining bindings as an array\n\nExample query:\n\n```sparql\nSELECT ?subject ?val \nWHERE { \n ?subject qcy:entityCategory qcy-e:Space ;\n qcy:hasProperty [\n qcy:label "LongName" ;\n qcy:value ?val\n ]\n}\n```\n\nThis query will outputs for the formatter in the following form (in this case with two bindings to the key/val):\n\n```json\n[{"val": "Room 101"}, {"val": "Room 01"}]\n```\n\nThese can then be used in a simple formatter that simply returns the first value or a - in case there are no bindings:\n\n```typescript\n(row) => row[0]?.val ?? \'-\'\n```\n\nLet\'s imagine that we instead had a query that would return bindings on the variables *?val* and *?score* and return bindings like this:\n\n```json\n[{"val": "Room 101", "score": "1"}, {"val": "Room 01", "score": "0.9"}]\n```\n\nA formatter could then take the highest score value:\n\n```typescript\n(row) => {\n const maxScore = 0;\n let val = "";\n row.forEach(r => {\n if(parseFloat(r.score) > maxScore) {\n maxScore = parseFloat(r.score);\n val = r.val;\n }\n });\n return val;\n}\n```\n\nThe formatter can also be more advanced and for example first format the values as dates using a library like DayJS before taking the most recent.\n');t.instructions.set(a)}})})());ngOnDestroy(){this.tableService.destroy(),this.dataFetchService.destroy()}static \u0275fac=function(a){return new(a||l)};static \u0275cmp=e.VBU({type:l,selectors:[["cue-sparql-table-inner"]],inputs:{handlers:[1,"handlers"],columns:[1,"columns"],columnsGross:[1,"columnsGross"],dataColumns:[1,"dataColumns"],showInstructions:[1,"showInstructions"],showPaginator:[1,"showPaginator"],paginationPageSize:[1,"paginationPageSize"],settings:[1,"settings"],emptyTableText:[1,"emptyTableText"],clickableRows:[1,"clickableRows"],useAGGrid:[1,"useAGGrid"],size:[1,"size"]},outputs:{columns:"columnsChange",emptyTableText:"emptyTableTextChange",clickedRow:"clickedRow",hoveredRow:"hoveredRow",tableDataUpdated:"tableDataUpdated",gridApi:"gridApi",visibleRows:"visibleRows",columnDefsAG:"columnDefsAG"},decls:3,vars:7,consts:[["direction","column","gap","xl"],[3,"innerHTML"],[3,"gridApiReady","visibleRows","size","rowData","columnDefs","showPaginator","paginationPageSize","noRowsText"]],template:function(a,n){1&a&&(e.j41(0,"cue-flexcontainer",0),e.nVh(1,qe,1,1,"cue-typography",1),e.j41(2,"cue-ag-grid",2),e.bIt("gridApiReady",function(i){return n._onGridApiReady(i)})("visibleRows",function(i){return n.visibleRows.emit(i)}),e.k0s()()),2&a&&(e.R7$(),e.vxM(n.showInstructions()?1:-1),e.R7$(),e.Y8G("size",n.size())("rowData",n.tableService.tableData())("columnDefs",n.dataFetchService.columnDefsAG())("showPaginator",n.showPaginator())("paginationPageSize",n.paginationPageSize())("noRowsText",n.dataFetchService.emptyTableText()))},dependencies:[j.Typography,N.n,ke.R],encapsulation:2,changeDetection:0})}return l})();var Le=h(9079),L=h(9352),se=h(2444),re=h(8957),X=h(5971),ce=h(3319),ue=h(836),z=h(1096),de=h(5448),Ge=h(2014);const K=(l,d)=>d.field;function Qe(l,d){if(1&l&&(e.j41(0,"cue-typography",6),e.EFF(1),e.k0s()),2&l){const t=e.XpG(2);e.R7$(),e.SpI(" ",t._queryError()," ")}}function Oe(l,d){if(1&l){const t=e.RV6();e.j41(0,"cue-button",17),e.bIt("click",function(){s.eBV(t);const n=e.XpG(2);return s.Njj(n.discardQuery())}),e.nrm(1,"cue-button-padder"),e.j41(2,"cue-button-label"),e.EFF(3),e.nI1(4,"transloco"),e.k0s(),e.nrm(5,"cue-button-padder"),e.k0s()}2&l&&(e.R7$(3),e.JRh(e.bMT(4,1,"components.sparqlTable.labelDiscard")))}function $e(l,d){1&l&&(e.j41(0,"cue-typography",11),e.EFF(1),e.nI1(2,"transloco"),e.k0s()),2&l&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"components.sparqlTable.labelQueryPending")," "))}function Be(l,d){if(1&l&&(e.j41(0,"cue-typography",6),e.EFF(1),e.k0s()),2&l){const t=e.XpG(2);e.R7$(),e.SpI(" ",t._testError()," ")}}function Xe(l,d){if(1&l&&(e.j41(0,"cue-typography",19),e.EFF(1),e.k0s()),2&l){const t=d.$implicit;e.R7$(),e.JRh(t)}}function ze(l,d){if(1&l&&(e.j41(0,"cue-typography",18),e.EFF(1),e.nI1(2,"transloco"),e.k0s(),e.Z7z(3,Xe,2,1,"cue-typography",19,e.Vm6)),2&l){const t=e.XpG(2);e.R7$(),e.JRh(e.bMT(2,1,"components.sparqlTable.labelTestResults")),e.R7$(2),e.Dyx(t._testRows())}}function Ke(l,d){if(1&l){const t=e.RV6();e.j41(0,"cue-input",20),e.nI1(1,"transloco"),e.bIt("valueChange",function(n){s.eBV(t);const o=e.XpG(2);return s.Njj(o._strategySeparator.set(n))}),e.k0s()}if(2&l){const t=e.XpG(2);e.Y8G("label",e.bMT(1,2,"components.sparqlTable.labelSeparator"))("value",t._strategySeparator())}}function Ye(l,d){if(1&l){const t=e.RV6();e.j41(0,"cue-input",20),e.nI1(1,"transloco"),e.bIt("valueChange",function(n){s.eBV(t);const o=e.XpG(2);return s.Njj(o._strategyValueKey.set(n))}),e.k0s()}if(2&l){const t=e.XpG(2);e.Y8G("label",e.bMT(1,2,"components.sparqlTable.labelValueKey"))("value",t._strategyValueKey())}}function We(l,d){if(1&l){const t=e.RV6();e.j41(0,"cue-input",16),e.nI1(1,"transloco"),e.nI1(2,"transloco"),e.bIt("valueChange",function(n){s.eBV(t);const o=e.XpG(2);return o._strategyPriorityKey.set(n),s.Njj(o._applyStrategyChange())}),e.k0s()}if(2&l){const t=e.XpG(2);e.Y8G("label",e.bMT(1,3,"components.sparqlTable.labelPriorityKey"))("info",e.bMT(2,5,"components.sparqlTable.tooltipPriorityKey"))("value",t._strategyPriorityKey())}}function He(l,d){if(1&l&&(e.j41(0,"cue-typography",6),e.EFF(1),e.k0s()),2&l){const t=e.XpG(3);e.R7$(),e.SpI(" ",t._strategyMapError()," ")}}function Ue(l,d){if(1&l){const t=e.RV6();e.j41(0,"cue-typography",3),e.nI1(1,"transloco"),e.EFF(2),e.nI1(3,"transloco"),e.k0s(),e.j41(4,"div",21)(5,"cue-code-editor",22),e.bIt("contentChanged",function(n){s.eBV(t);const o=e.XpG(2);return s.Njj(o._onMapJsonChanged(n))}),e.k0s()(),e.nVh(6,He,2,1,"cue-typography",6)}if(2&l){const t=e.XpG(2);e.Y8G("info",e.bMT(1,4,"components.sparqlTable.tooltipMapJson")),e.R7$(2),e.SpI(" ",e.bMT(3,6,"components.sparqlTable.labelMapJson")," "),e.R7$(3),e.Y8G("content",t._strategyMapJson()),e.R7$(),e.vxM(t._strategyMapError()?6:-1)}}function Je(l,d){if(1&l&&(e.j41(0,"cue-typography",6),e.EFF(1),e.k0s()),2&l){const t=e.XpG(2);e.R7$(),e.SpI(" ",t._strategyPreProcessError()," ")}}function Ze(l,d){if(1&l){const t=e.RV6();e.j41(0,"cue-typography",3),e.nI1(1,"transloco"),e.EFF(2),e.nI1(3,"transloco"),e.k0s(),e.j41(4,"div",4)(5,"cue-code-editor",5),e.bIt("contentChanged",function(n){s.eBV(t);const o=e.XpG();return s.Njj(o.onQueryChanged(n))}),e.k0s()(),e.nVh(6,Qe,2,1,"cue-typography",6),e.j41(7,"cue-flexcontainer",7),e.nVh(8,Oe,6,3,"cue-button",8),e.j41(9,"cue-button",9),e.bIt("click",function(){s.eBV(t);const n=e.XpG();return s.Njj(n.testQuery())}),e.nrm(10,"cue-button-padder")(11,"cue-button-icon",10),e.j41(12,"cue-button-label"),e.EFF(13),e.nI1(14,"transloco"),e.k0s(),e.nrm(15,"cue-button-padder"),e.k0s()(),e.nVh(16,$e,3,3,"cue-typography",11),e.nVh(17,Be,2,1,"cue-typography",6),e.nVh(18,ze,5,3),e.j41(19,"cue-select",2),e.nI1(20,"transloco"),e.bIt("valueChange",function(n){s.eBV(t);const o=e.XpG();return s.Njj(o.setDatatype(n))}),e.k0s(),e.j41(21,"cue-select",12),e.nI1(22,"transloco"),e.nI1(23,"transloco"),e.bIt("valueChange",function(n){s.eBV(t);const o=e.XpG();return s.Njj(o.setStrategyType(n))}),e.k0s(),e.j41(24,"cue-typography",13),e.EFF(25),e.k0s(),e.nVh(26,Ke,2,4,"cue-input",14),e.nVh(27,Ye,2,4,"cue-input",14),e.nVh(28,We,3,7,"cue-input",15),e.nVh(29,Ue,7,8),e.j41(30,"cue-input",16),e.nI1(31,"transloco"),e.nI1(32,"transloco"),e.bIt("valueChange",function(n){s.eBV(t);const o=e.XpG();return o._strategyPreProcess.set(n),s.Njj(o._applyStrategyChange())}),e.k0s(),e.nVh(33,Je,2,1,"cue-typography",6),e.j41(34,"cue-input",16),e.nI1(35,"transloco"),e.nI1(36,"transloco"),e.bIt("valueChange",function(n){s.eBV(t);const o=e.XpG();return o._strategyFallback.set(n),s.Njj(o._applyStrategyChange())}),e.k0s()}if(2&l){const t=e.XpG();e.Y8G("info",e.bMT(1,31,"components.sparqlTable.tooltipQuery")),e.R7$(2),e.JRh(e.bMT(3,33,"components.sparqlTable.labelQuery")),e.R7$(3),e.Y8G("content",t.query()),e.R7$(),e.vxM(t._queryError()?6:-1),e.R7$(2),e.vxM(t._queryDirty()?8:-1),e.R7$(),e.Y8G("disabled",!!t._queryError()),e.R7$(4),e.JRh(e.bMT(14,35,"components.sparqlTable.labelTest")),e.R7$(3),e.vxM(t._queryDirty()&&!t._queryError()?16:-1),e.R7$(),e.vxM(t._testError()?17:-1),e.R7$(),e.vxM(t._testRows().length>0?18:-1),e.R7$(),e.Y8G("label",e.bMT(20,37,"components.sparqlTable.labelDatatype"))("value",t._datatype()??"")("options",t.datatypeOptions)("labelMap",t.datatypeLabelMap()),e.R7$(2),e.Y8G("label",e.bMT(22,39,"components.sparqlTable.labelStrategy"))("info",e.bMT(23,41,"components.sparqlTable.tooltipStrategy"))("value",t._strategyType())("options",t.availableStrategyTypes())("labelMap",t.strategyLabelMap()),e.R7$(4),e.JRh(t._strategyDescription()),e.R7$(),e.vxM(t._strategyNeedsSeparator()?26:-1),e.R7$(),e.vxM(t._strategyNeedsValueKey()?27:-1),e.R7$(),e.vxM(t._strategyNeedsPriorityKey()?28:-1),e.R7$(),e.vxM(t._strategyNeedsMap()?29:-1),e.R7$(),e.Y8G("label",e.bMT(31,43,"components.sparqlTable.labelPreProcess"))("info",e.bMT(32,45,"components.sparqlTable.tooltipPreProcess"))("value",t._strategyPreProcess()),e.R7$(3),e.vxM(t._strategyPreProcessError()?33:-1),e.R7$(),e.Y8G("label",e.bMT(35,47,"components.sparqlTable.labelFallback"))("info",e.bMT(36,49,"components.sparqlTable.tooltipFallback"))("value",t._strategyFallback())}}function et(l,d){if(1&l){const t=e.RV6();e.j41(0,"span",26),e.bIt("click",function(){const n=s.eBV(t).$implicit,o=e.XpG(4);return s.Njj(o._insertFieldIntoTemplate(n.field))}),e.EFF(1),e.k0s()}if(2&l){const t=d.$implicit;e.Y8G("title",t.headerName),e.R7$(),e.JRh(t.token)}}function tt(l,d){if(1&l&&(e.j41(0,"cue-typography",13),e.EFF(1),e.nI1(2,"transloco"),e.k0s(),e.j41(3,"cue-flexcontainer",24),e.Z7z(4,et,2,2,"span",25,K),e.k0s()),2&l){const t=e.XpG(3);e.R7$(),e.SpI(" ",e.bMT(2,1,"components.sparqlTable.labelAvailableFields")," "),e.R7$(3),e.Dyx(t._dataColumnFields())}}function nt(l,d){if(1&l){const t=e.RV6();e.j41(0,"cue-input",16),e.nI1(1,"transloco"),e.nI1(2,"transloco"),e.bIt("valueChange",function(n){s.eBV(t);const o=e.XpG(2);return o._evalTemplate.set(n),s.Njj(o._applyEvaluation())}),e.k0s(),e.nVh(3,tt,6,3)}if(2&l){const t=e.XpG(2);e.Y8G("label",e.bMT(1,4,"components.sparqlTable.labelEvalTemplate"))("info",e.bMT(2,6,"components.sparqlTable.tooltipEvalTemplate"))("value",t._evalTemplate()),e.R7$(3),e.vxM(t._dataColumnFields().length?3:-1)}}function at(l,d){if(1&l){const t=e.RV6();e.j41(0,"span",26),e.bIt("click",function(){const n=s.eBV(t).$implicit,o=e.XpG(3);return s.Njj(o._toggleFormulaField(n.field))}),e.EFF(1),e.k0s()}if(2&l){const t=d.$implicit,a=e.XpG(3);e.AVh("field-chip--active",a._formulaFields().includes(t.field)),e.Y8G("title",t.field),e.R7$(),e.JRh(t.headerName)}}function ot(l,d){if(1&l&&(e.j41(0,"span",30),e.EFF(1),e.k0s()),2&l){const t=e.XpG(5);e.R7$(),e.JRh(t._formulaOpSymbol())}}function lt(l,d){if(1&l&&(e.j41(0,"span",29),e.EFF(1),e.k0s(),e.nVh(2,ot,2,1,"span",30)),2&l){const t=d.$implicit,a=d.$index,n=d.$count,o=e.XpG(4);e.R7$(),e.JRh(o._fieldLabel(t)),e.R7$(),e.vxM(a!==n-1?2:-1)}}function it(l,d){if(1&l&&(e.j41(0,"cue-flexcontainer",28),e.Z7z(1,lt,3,2,null,null,e.fX1),e.k0s()),2&l){const t=e.XpG(3);e.R7$(),e.Dyx(t._formulaFields())}}function st(l,d){if(1&l){const t=e.RV6();e.j41(0,"cue-select",2),e.nI1(1,"transloco"),e.bIt("valueChange",function(n){s.eBV(t);const o=e.XpG(2);return s.Njj(o.setFormulaOp(n))}),e.k0s(),e.j41(2,"cue-typography",13),e.EFF(3),e.nI1(4,"transloco"),e.k0s(),e.j41(5,"cue-flexcontainer",24),e.Z7z(6,at,2,4,"span",27,K),e.k0s(),e.nVh(8,it,3,0,"cue-flexcontainer",28)}if(2&l){const t=e.XpG(2);e.Y8G("label",e.bMT(1,6,"components.sparqlTable.labelFormulaOp"))("value",t._formulaOp())("options",t.formulaOpOptions)("labelMap",t.formulaOpLabelMap()),e.R7$(3),e.SpI(" ",e.bMT(4,8,"components.sparqlTable.labelFormulaFields")," "),e.R7$(3),e.Dyx(t._dataColumnFields()),e.R7$(2),e.vxM(t._formulaFields().length?8:-1)}}function rt(l,d){if(1&l&&(e.j41(0,"cue-typography",23),e.EFF(1),e.nI1(2,"transloco"),e.k0s()),2&l){const t=e.XpG(2);e.R7$(),e.Lme(" ",e.bMT(2,2,"components.sparqlTable.labelEvalPreview"),": ",t._evalPreview()," ")}}function ct(l,d){if(1&l){const t=e.RV6();e.j41(0,"span",26),e.bIt("click",function(){const n=s.eBV(t).$implicit,o=e.XpG(3);return s.Njj(o._togglePipelineSource(n.field))}),e.EFF(1),e.k0s()}if(2&l){const t=d.$implicit,a=e.XpG(3);e.AVh("field-chip--active",a._pipelineSources().includes(t.field)),e.Y8G("title",t.field),e.R7$(),e.JRh(t.headerName)}}function ut(l,d){if(1&l&&(e.j41(0,"cue-typography",11),e.EFF(1),e.nI1(2,"transloco"),e.k0s()),2&l){const t=e.XpG(3);e.R7$(),e.Lme(" ",e.bMT(2,2,"components.sparqlTable.labelPipelineSourceOrder"),": ",t._pipelineSources().join(" \u2192 ")," ")}}function dt(l,d){if(1&l&&(e.j41(0,"cue-typography",6),e.EFF(1),e.k0s()),2&l){const t=e.XpG(3);e.R7$(),e.JRh(t._pipelineTransformError())}}function pt(l,d){if(1&l&&(e.j41(0,"cue-typography",6),e.EFF(1),e.k0s()),2&l){const t=e.XpG(3);e.R7$(),e.JRh(t._pipelineExcludeError())}}function _t(l,d){if(1&l){const t=e.RV6();e.j41(0,"cue-typography",3),e.nI1(1,"transloco"),e.EFF(2),e.nI1(3,"transloco"),e.k0s(),e.j41(4,"cue-flexcontainer",24),e.Z7z(5,ct,2,4,"span",27,K),e.k0s(),e.nVh(7,ut,3,4,"cue-typography",11),e.j41(8,"cue-input",16),e.nI1(9,"transloco"),e.nI1(10,"transloco"),e.bIt("valueChange",function(n){s.eBV(t);const o=e.XpG(2);return o._pipelineTransform.set(n),s.Njj(o._applyEvaluation())}),e.k0s(),e.nVh(11,dt,2,1,"cue-typography",6),e.j41(12,"cue-input",16),e.nI1(13,"transloco"),e.nI1(14,"transloco"),e.bIt("valueChange",function(n){s.eBV(t);const o=e.XpG(2);return o._pipelineLimit.set(n),s.Njj(o._applyEvaluation())}),e.k0s(),e.j41(15,"cue-input",20),e.nI1(16,"transloco"),e.bIt("valueChange",function(n){s.eBV(t);const o=e.XpG(2);return o._pipelineSeparator.set(n),s.Njj(o._applyEvaluation())}),e.k0s(),e.j41(17,"cue-input",16),e.nI1(18,"transloco"),e.nI1(19,"transloco"),e.bIt("valueChange",function(n){s.eBV(t);const o=e.XpG(2);return o._pipelineFallback.set(n),s.Njj(o._applyEvaluation())}),e.k0s(),e.j41(20,"cue-flexcontainer",31)(21,"label",32)(22,"input",33),e.bIt("change",function(){s.eBV(t);const n=e.XpG(2);return n._pipelineDeduplicate.set(!n._pipelineDeduplicate()),s.Njj(n._applyEvaluation())}),e.k0s(),e.EFF(23),e.nI1(24,"transloco"),e.k0s(),e.j41(25,"label",32)(26,"input",33),e.bIt("change",function(){s.eBV(t);const n=e.XpG(2);return n._pipelineSort.set(!n._pipelineSort()),s.Njj(n._applyEvaluation())}),e.k0s(),e.EFF(27),e.nI1(28,"transloco"),e.k0s()(),e.j41(29,"cue-typography",3),e.nI1(30,"transloco"),e.EFF(31),e.nI1(32,"transloco"),e.k0s(),e.j41(33,"div",34)(34,"cue-code-editor",22),e.bIt("contentChanged",function(n){s.eBV(t);const o=e.XpG(2);return s.Njj(o._onPipelineExcludeChanged(n))}),e.k0s()(),e.nVh(35,pt,2,1,"cue-typography",6)}if(2&l){const t=e.XpG(2);e.Y8G("info",e.bMT(1,23,"components.sparqlTable.tooltipPipelineSources")),e.R7$(2),e.SpI(" ",e.bMT(3,25,"components.sparqlTable.labelPipelineSources")," "),e.R7$(3),e.Dyx(t._dataColumnFields()),e.R7$(2),e.vxM(t._pipelineSources().length>1?7:-1),e.R7$(),e.Y8G("label",e.bMT(9,27,"components.sparqlTable.labelPipelineTransform"))("info",e.bMT(10,29,"components.sparqlTable.tooltipPipelineTransform"))("value",t._pipelineTransform()),e.R7$(3),e.vxM(t._pipelineTransformError()?11:-1),e.R7$(),e.Y8G("label",e.bMT(13,31,"components.sparqlTable.labelPipelineLimit"))("info",e.bMT(14,33,"components.sparqlTable.tooltipPipelineLimit"))("value",t._pipelineLimit()),e.R7$(3),e.Y8G("label",e.bMT(16,35,"components.sparqlTable.labelSeparator"))("value",t._pipelineSeparator()),e.R7$(2),e.Y8G("label",e.bMT(18,37,"components.sparqlTable.labelFallback"))("info",e.bMT(19,39,"components.sparqlTable.tooltipFallback"))("value",t._pipelineFallback()),e.R7$(5),e.Y8G("checked",t._pipelineDeduplicate()),e.R7$(),e.SpI(" ",e.bMT(24,41,"components.sparqlTable.labelPipelineDeduplicate")," "),e.R7$(3),e.Y8G("checked",t._pipelineSort()),e.R7$(),e.SpI(" ",e.bMT(28,43,"components.sparqlTable.labelPipelineSort")," "),e.R7$(2),e.Y8G("info",e.bMT(30,45,"components.sparqlTable.tooltipPipelineExclude")),e.R7$(2),e.SpI(" ",e.bMT(32,47,"components.sparqlTable.labelPipelineExclude")," "),e.R7$(3),e.Y8G("content",t._pipelineExcludeJson()),e.R7$(),e.vxM(t._pipelineExcludeError()?35:-1)}}function ft(l,d){if(1&l){const t=e.RV6();e.j41(0,"cue-select",2),e.nI1(1,"transloco"),e.bIt("valueChange",function(n){s.eBV(t);const o=e.XpG();return s.Njj(o.setEvalType(n))}),e.k0s(),e.j41(2,"cue-typography",13),e.EFF(3),e.k0s(),e.nVh(4,nt,4,8),e.nVh(5,st,9,10),e.nVh(6,rt,3,4,"cue-typography",23),e.nVh(7,_t,36,49)}if(2&l){const t=e.XpG();e.Y8G("label",e.bMT(1,9,"components.sparqlTable.labelEvalType"))("value",t._evalType())("options",t.evaluationTypeOptions)("labelMap",t.evaluationTypeLabelMap()),e.R7$(3),e.JRh(t._evalTypeDescription()),e.R7$(),e.vxM("template"===t._evalType()?4:-1),e.R7$(),e.vxM("formula"===t._evalType()?5:-1),e.R7$(),e.vxM(t._evalPreview()?6:-1),e.R7$(),e.vxM("pipeline"===t._evalType()?7:-1)}}const mt=["join"],pe=["sum","avg","min","max","mostRecent","oldest","longest","shortest"],_e=["first","last","sum","avg","min","max","mostRecent","oldest","longest","shortest"],gt=["map"],fe=["text","number","date"],ht=Object.assign(new z.e,{});let yt=(()=>{class l{columnDef=g.geq.required();handlers=(0,g.hFB)();columns=(0,g.hFB)([]);close=(0,g.CGW)();updateColumnDef=(0,g.CGW)();agGridSettings=ht;_transloco=(0,s.WQX)(L.JO);_lang=(0,Le.ot)(this._transloco.langChanges$,{initialValue:this._transloco.getActiveLang()});columnTypeOptions=["data","evaluation"];columnTypeLabelMap=(0,_.EW)(()=>(this._lang(),{data:this._transloco.translate("components.sparqlTable.columnTypeData"),evaluation:this._transloco.translate("components.sparqlTable.columnTypeEvaluation")}));_defType=(0,_.uu)(()=>"evaluation"===this.columnDef().defType?"evaluation":"data");setDefType(t){const a=t;if(this._defType.set(a),"evaluation"===a){const o=this.columnDef().evaluation??{type:"template",template:""};this.updateColumnDef.emit({defType:"evaluation",evaluation:o})}else this.updateColumnDef.emit({defType:"data"})}_evalType=(0,_.uu)(()=>this.columnDef().evaluation?.type??"template");_evalTemplate=(0,_.uu)(()=>{const t=this.columnDef().evaluation;return"template"===t?.type?t.template:""});_formulaOp=(0,_.uu)(()=>{const t=this.columnDef().evaluation;return"formula"===t?.type?t.op:"add"});_formulaFields=(0,_.uu)(()=>{const t=this.columnDef().evaluation;return"formula"===t?.type?[...t.fields]:[]});_pipelineSources=(0,_.uu)(()=>{const t=this.columnDef().evaluation;return"pipeline"===t?.type?[...t.sources]:[]});_pipelineTransform=(0,_.uu)(()=>{const t=this.columnDef().evaluation;return"pipeline"===t?.type?t.transform??"":""});_pipelineLimit=(0,_.uu)(()=>{const t=this.columnDef().evaluation;return"pipeline"===t?.type?String(t.limit??""):""});_pipelineSeparator=(0,_.uu)(()=>{const t=this.columnDef().evaluation;return"pipeline"===t?.type?t.separator??", ":", "});_pipelineFallback=(0,_.uu)(()=>{const t=this.columnDef().evaluation;return"pipeline"===t?.type?t.fallback??"":""});_pipelineDeduplicate=(0,_.uu)(()=>{const t=this.columnDef().evaluation;return"pipeline"===t?.type&&(t.deduplicate??!1)});_pipelineSort=(0,_.uu)(()=>{const t=this.columnDef().evaluation;return"pipeline"===t?.type&&(t.sort??!1)});_pipelineExcludeJson=(0,_.uu)(()=>{const t=this.columnDef().evaluation,a="pipeline"===t?.type?t.exclude??[]:[];try{return JSON.stringify(a,null,2)}catch{return"[]"}});_pipelineExcludeError=(0,s.vPA)("");_pipelineExcludeParsed=(0,s.vPA)([]);_pipelineTransformError=(0,_.EW)(()=>{const t=this._pipelineTransform();if(t)return(0,P.NF)(t)??void 0});evaluationTypeOptions=le;evaluationTypeLabelMap=(0,_.EW)(()=>(this._lang(),Object.fromEntries(le.map(t=>[t,this._transloco.translate(Ae[t])]))));_evalTypeDescription=(0,_.EW)(()=>(this._lang(),this._transloco.translate(je[this._evalType()])));formulaOpOptions=ie;formulaOpLabelMap=(0,_.EW)(()=>(this._lang(),Object.fromEntries(ie.map(t=>[t,this._transloco.translate(Ne[t])]))));_dataColumnFields=(0,_.EW)(()=>this.columns().filter(t=>"data"===t.defType&&t.field!==this.columnDef().field).map(t=>({field:t.field,headerName:t.headerName??t.field,token:"${"+t.field+"}"})));_evalPreview=(0,_.EW)(()=>{if("template"===this._evalType()){const t=this._evalTemplate();return t?t.replace(/\$\{([\w.-]+)\}/g,(a,n)=>`[${n}]`):""}if("formula"===this._evalType()){const t=this._formulaFields(),a=this._formulaOp();return 0===t.length?"":t.join(` ${{add:"+",subtract:"\u2212",multiply:"\xd7",divide:"\xf7"}[a]} `)}if("pipeline"===this._evalType()){const t=this._pipelineSources(),a=this._pipelineTransform(),n=this._pipelineLimit();if(0===t.length)return"";const o=[`sources: [${t.join(", ")}]`];return a&&o.push(`transform: ${a}`),this._pipelineDeduplicate()&&o.push("deduplicate"),this._pipelineSort()&&o.push("sort"),n&&o.push(`limit: ${n}`),o.join(" | ")}return""});setEvalType(t){if(t){if(this._evalType.set(t),"pipeline"===t&&0===this._pipelineSources().length){const a=this._dataColumnFields()[0];a&&this._pipelineSources.set([a.field])}this._applyEvaluation()}}setFormulaOp(t){t&&(this._formulaOp.set(t),this._applyEvaluation())}_toggleFormulaField(t){const a=this._formulaFields(),n=a.includes(t)?a.filter(o=>o!==t):[...a,t];this._formulaFields.set(n),this._applyEvaluation()}_fieldLabel(t){return this._dataColumnFields().find(a=>a.field===t)?.headerName??t}_formulaOpSymbol=(0,_.EW)(()=>({add:"+",subtract:"\u2212",multiply:"\xd7",divide:"\xf7"}[this._formulaOp()]));_insertFieldIntoTemplate(t){const a=this._evalTemplate();this._evalTemplate.set(a+`\${${t}}`),this._applyEvaluation()}_togglePipelineSource(t){const a=this._pipelineSources(),n=a.includes(t)?a.filter(o=>o!==t):[...a,t];this._pipelineSources.set(n),this._applyEvaluation()}_applyEvaluation(){let t;if("template"===this._evalType())t={type:"template",template:this._evalTemplate()};else if("pipeline"===this._evalType()){const a={type:"pipeline",sources:this._pipelineSources(),deduplicate:this._pipelineDeduplicate()||void 0,sort:this._pipelineSort()||void 0,separator:this._pipelineSeparator()||void 0,fallback:this._pipelineFallback()||void 0,transform:this._pipelineTransform()||void 0,exclude:this._pipelineExcludeParsed().length?this._pipelineExcludeParsed():void 0},n=parseInt(this._pipelineLimit(),10);!isNaN(n)&&n>0&&(a.limit=n),t=a}else t={type:"formula",fields:this._formulaFields(),op:this._formulaOp()};this.updateColumnDef.emit({evaluation:t})}_onPipelineExcludeChanged(t){this._pipelineExcludeJson.set(t);try{const a=JSON.parse(t);if(!Array.isArray(a))throw new Error("Must be a JSON array of strings");this._pipelineExcludeError.set(""),this._pipelineExcludeParsed.set(a),this._applyEvaluation()}catch(a){this._pipelineExcludeError.set(a?.message??"Invalid JSON")}}datatypeOptions=fe;datatypeLabelMap=(0,_.EW)(()=>(this._lang(),Object.fromEntries(fe.map(t=>[t,this._transloco.translate(`components.sparqlTable.datatype${t.charAt(0).toUpperCase()+t.slice(1)}`)]))));availableStrategyTypes=(0,_.EW)(()=>{const t=this._datatype();return t?te[t]:ee});strategyLabelMap=(0,_.EW)(()=>(this._lang(),Object.fromEntries(ee.map(t=>[t,this._transloco.translate(ye[t])]))));_strategyDescription=(0,_.EW)(()=>(this._lang(),this._transloco.translate(be[this._strategyType()])));query=(0,_.EW)(()=>this.columnDef().query??"");_editedQuery=(0,_.uu)(()=>this.query());_queryError=(0,_.EW)(()=>{this._lang();const t=function Ve(l,d="val"){if(!l?.trim())return null;let t;try{t=new w.Parser({sparqlStar:!0}).parse(l)}catch{return"validationErrorSyntax"}if("query"!==t?.type||"SELECT"!==t?.queryType)return"validationErrorNotSelect";const n=t.variables;if(1===n.length&&"*"===n[0])return null;const o=n.map(i=>i?.value??i?.variable?.value??"");return o.includes("subject")?o.includes(d)?null:"validationErrorMissingVal":"validationErrorMissingKey"}(this._editedQuery(),this._strategyValueKey()||"val");if(!t)return;const a=`components.sparqlTable.${t}`;return"validationErrorMissingVal"===t?this._transloco.translate(a,{var:this._strategyValueKey()||"val"}):this._transloco.translate(a)});_datatype=(0,_.uu)(()=>this.columnDef().datatype);_strategyType=(0,_.uu)(()=>this.columnDef().strategy?.type??"join");_strategySeparator=(0,_.uu)(()=>this.columnDef().strategy?.separator??", ");_strategyValueKey=(0,_.uu)(()=>this.columnDef().strategy?.valueKey??"val");_strategyPriorityKey=(0,_.uu)(()=>this.columnDef().strategy?.priorityKey??"");_strategyPreProcess=(0,_.uu)(()=>this.columnDef().strategy?.preProcess??"");_strategyFallback=(0,_.uu)(()=>this.columnDef().strategy?.fallback??"");_strategyMapJson=(0,_.uu)(()=>{const t=this.columnDef().strategy;if("map"!==t?.type)return"{}";try{return JSON.stringify(t.map,null,2)}catch{return"{}"}});_strategyMapError=(0,s.vPA)("");_strategyNeedsSeparator=(0,_.EW)(()=>mt.includes(this._strategyType()));_strategyNeedsValueKey=(0,_.EW)(()=>pe.includes(this._strategyType()));_strategyNeedsPriorityKey=(0,_.EW)(()=>_e.includes(this._strategyType())&&this._queryExtraBindings().length>0);_strategyNeedsMap=(0,_.EW)(()=>gt.includes(this._strategyType()));_strategyPreProcessError=(0,_.EW)(()=>{const t=this._strategyPreProcess();return t?(0,P.NF)(t)??void 0:void 0});_queryExtraBindings=(0,_.EW)(()=>{const t=this._editedQuery(),a=this._strategyValueKey()||"val";if(!t?.trim())return[];try{const n=new w.Parser({sparqlStar:!0}).parse(t);if("SELECT"!==n?.queryType)return[];const o=n.variables;return 1===o.length&&"*"===o[0]?[]:o.map(u=>u?.value??u?.variable?.value??"").filter(Boolean).filter(u=>"subject"!==u&&u!==a)}catch{return[]}});setDatatype(t){const a=t||void 0;if(this._datatype.set(a),a&&!te[a].includes(this._strategyType()))return this._strategyType.set("first"),void this.updateColumnDef.emit({strategy:{type:"first"},datatype:a});this.updateColumnDef.emit({datatype:a})}setStrategyType(t){if(!t)return;this._strategyType.set(t);const a=this._buildStrategy(t);this.updateColumnDef.emit({strategy:a})}_applyStrategyChange(){const t=this._buildStrategy(this._strategyType());this.updateColumnDef.emit({strategy:t})}_buildStrategy(t){const a=this._strategyValueKey()||"val",n=this._strategyPriorityKey()||void 0,u={preProcess:this._strategyPreProcess()||void 0,fallback:this._strategyFallback()||void 0};if("join"===t)return{type:t,separator:this._strategySeparator(),...u};if("map"===t){let r={};try{r=JSON.parse(this._strategyMapJson())}catch{}return{type:t,map:r,...u}}return pe.includes(t)?{type:t,valueKey:a,priorityKey:n,...u}:_e.includes(t)?{type:t,priorityKey:n,...u}:{type:t,...u}}_onMapJsonChanged(t){this._strategyMapJson.set(t);try{const a=JSON.parse(t);if("object"!=typeof a||Array.isArray(a))throw new Error("Must be a JSON object");this._strategyMapError.set(""),this._applyStrategyChange()}catch(a){this._strategyMapError.set(a?.message??"Invalid JSON")}}_queryDirty=(0,_.EW)(()=>this._editedQuery()!==this.query());onQueryChanged(t){this._editedQuery.set(t)}discardQuery(){this._editedQuery.set(this.query()),this._testRows.set([]),this._testError.set("")}_testRows=(0,s.vPA)([]);_testError=(0,s.vPA)("");_testLoading=(0,s.vPA)(!1);testQuery(){var t=this;return(0,C.A)(function*(){const a=t.handlers()?.queryHandler;if(!a)return void t._testError.set("No query handler available.");t._testRows.set([]),t._testError.set(""),t._testLoading.set(!0);const o=t._editedQuery().trim().replace(/\s*LIMIT\s+\d+\s*$/i,"")+"\nLIMIT 5";try{const u=((yield a(o,{}))?.results?.bindings??[]).map(r=>JSON.stringify(Object.fromEntries(Object.entries(r).map(([p,c])=>[p,c.value])),null,2));t._testRows.set(u),t.updateColumnDef.emit({query:t._editedQuery()})}catch(i){t._testError.set(i?.message??String(i))}finally{t._testLoading.set(!1)}})()}_onColDefUpdate(t){this.updateColumnDef.emit(t)}static \u0275fac=function(a){return new(a||l)};static \u0275cmp=e.VBU({type:l,selectors:[["cue-declarative-sparql-column-settings-modal"]],inputs:{columnDef:[1,"columnDef"],handlers:[1,"handlers"],columns:[1,"columns"]},outputs:{columnDef:"columnDefChange",close:"close",updateColumnDef:"updateColumnDef"},decls:7,vars:13,consts:[["minWidth","800px",3,"updateColumn","close","columnDef","settings","extraPanelLabel"],["cueExtraContent","","direction","column"],[3,"valueChange","label","value","options","labelMap"],["size","s",3,"info"],[2,"height","200px","min-height","120px"],["type","sparql",3,"contentChanged","content"],["size","s",2,"color","var(--cue-error)"],["direction","row","justify","end","gap","s"],["variant","ghost","size","s"],["variant","secondary","size","s",3,"click","disabled"],["icon","go"],["size","xs",2,"opacity","0.6","font-style","italic"],[3,"valueChange","label","info","value","options","labelMap"],["size","xs",2,"opacity","0.7"],[3,"label","value"],[3,"label","info","value"],[3,"valueChange","label","info","value"],["variant","ghost","size","s",3,"click"],["size","s"],["size","xs",2,"font-family","monospace","white-space","pre-wrap"],[3,"valueChange","label","value"],[2,"height","200px","min-height","120px","text-align","left"],["type","json",3,"contentChanged","content"],["size","xs",2,"opacity","0.7","font-style","italic"],["direction","row","wrap","wrap","gap","xs"],[1,"field-chip",3,"title"],[1,"field-chip",3,"click","title"],[1,"field-chip",3,"field-chip--active","title"],["direction","row","wrap","wrap","gap","xs",2,"align-items","center"],[1,"formula-token"],[1,"formula-op"],["direction","row","gap","m"],[2,"display","flex","align-items","center","gap","4px","font-size","0.85rem","cursor","pointer"],["type","checkbox",3,"change","checked"],[2,"height","160px","min-height","80px","text-align","left"]],template:function(a,n){1&a&&(e.j41(0,"cue-table-column-settings-modal",0),e.nI1(1,"transloco"),e.bIt("updateColumn",function(i){return n._onColDefUpdate(i)})("close",function(){return n.close.emit()}),e.j41(2,"cue-flexcontainer",1)(3,"cue-select",2),e.nI1(4,"transloco"),e.bIt("valueChange",function(i){return n.setDefType(i)}),e.k0s(),e.nVh(5,Ze,37,51),e.nVh(6,ft,8,11),e.k0s()()),2&a&&(e.Y8G("columnDef",n.columnDef())("settings",n.agGridSettings)("extraPanelLabel",e.bMT(1,9,"components.sparqlTable.panelLabel")),e.R7$(3),e.Y8G("label",e.bMT(4,11,"components.sparqlTable.labelColumnType"))("value",n._defType())("options",n.columnTypeOptions)("labelMap",n.columnTypeLabelMap()),e.R7$(2),e.vxM("data"===n._defType()?5:-1),e.R7$(),e.vxM("evaluation"===n._defType()?6:-1))},dependencies:[z.T,N.n,j.Typography,se.l,re.p,X.$,ce.a,ue.B,de.L,Ge.z,L.Kj],styles:[".field-chip[_ngcontent-%COMP%]{display:inline-block;padding:2px 8px;border-radius:4px;background:var(--cue-surface-2, #eee);font-family:monospace;font-size:.75rem;cursor:pointer;-webkit-user-select:none;user-select:none;transition:background .12s,outline .12s;outline:2px solid transparent}.field-chip[_ngcontent-%COMP%]:hover{background:var(--cue-primary-light, #c8e6c9)}.field-chip--active[_ngcontent-%COMP%]{background:var(--cue-primary, #4caf50);color:#fff;outline-color:var(--cue-primary, #4caf50)}.formula-token[_ngcontent-%COMP%]{display:inline-block;padding:2px 8px;border-radius:4px;background:var(--cue-primary, #4caf50);color:#fff;font-family:monospace;font-size:.75rem}.formula-op[_ngcontent-%COMP%]{font-size:1rem;font-weight:700;opacity:.6;padding:0 2px}"],changeDetection:0})}return l})();var bt=h(5187),vt=h(7717),Y=h(5661),Dt=h(6117),Tt=h(356),Ct=h(6279),St=h(29),Mt=h(5821),Rt=h(5745);const xt=(l,d)=>d.key;function Pt(l,d){if(1&l){const t=e.RV6();e.j41(0,"cue-input",12),e.bIt("valueChange",function(n){s.eBV(t);const o=e.XpG().$implicit,i=e.XpG(2);return s.Njj(i._setVar(o.key,n))}),e.k0s()}if(2&l){const t=e.XpG().$implicit,a=e.XpG(2);e.Y8G("label",t.label)("value",a._varValues()[t.key]??a._filePathPlaceholder())}}function Et(l,d){if(1&l){const t=e.RV6();e.j41(0,"cue-select",13),e.bIt("valueChange",function(n){s.eBV(t);const o=e.XpG().$implicit,i=e.XpG(2);return s.Njj(i._setVar(o.key,n))}),e.k0s()}if(2&l){const t=e.XpG().$implicit,a=e.XpG(2);e.Y8G("label",t.label)("options",a._categoryOptions())("labelMap",a._categoryLabelMap())("value",a._varValues()[t.key]??void 0)("disabled",a._categoriesLoading())("placeholder",a._categoriesLoading()?"Loading\u2026":"Select a category\u2026")}}function Ft(l,d){if(1&l&&e.nVh(0,Pt,1,2,"cue-input",10)(1,Et,1,6,"cue-select",11),2&l){const t=d.$implicit;e.vxM("text"===t.type?0:"select"===t.type?1:-1)}}function wt(l,d){1&l&&e.Z7z(0,Ft,2,1,null,null,xt),2&l&&e.Dyx(d.variables)}function At(l,d){1&l&&(e.j41(0,"div",6),e.EFF(1),e.nI1(2,"transloco"),e.k0s()),2&l&&(e.R7$(),e.JRh(e.bMT(2,1,d)))}const jt=new w.Parser({sparqlStar:!0}),me=`PREFIX qcy: <${O.E.qcy}>`,W=[{id:"files-in-directory",label:"Files in a specific directory",template:`${me}\n\nSELECT DISTINCT ?subject\nWHERE {\n ?subject a qcy:FileContent ;\n qcy:hasFileLocation ?fl .\n ?fl qcy:filePath ?path .\n FILTER(STRSTARTS(STR(?path), "\${THE_FILE_PATH}"))\n\n # EXCLUDE DERIVED FILES\n FILTER NOT EXISTS {?x qcy:alternativeRepresentation ?subject}\n}`,variables:[{key:"THE_FILE_PATH",label:"File path",type:"text"}]},{id:"entities-of-category",label:"Entities of a specific category",template:`${me}\n\nSELECT DISTINCT ?subject\nWHERE {\n ?subject a qcy:CanonicalEntity ;\n qcy:hasEntityCategory <\${CATEGORY_IRI}> .\n}`,variables:[{key:"CATEGORY_IRI",label:"Category",type:"select"}]}];let Nt=(()=>{class l{rowDefinitionQuery=(0,g.geq)(null);handlers=(0,g.hFB)(void 0);close=(0,g.CGW)();saved=(0,g.CGW)();_draft=(0,_.uu)(()=>this.rowDefinitionQuery()||$);_selectedPredefinedId=(0,s.vPA)(null);_varValues=(0,s.vPA)({});_categories=(0,s.vPA)([]);_categoriesLoading=(0,s.vPA)(!1);_filePathPlaceholder=(0,s.vPA)("");_selectedPredefined=(0,_.EW)(()=>{const t=this._selectedPredefinedId();return t?W.find(a=>a.id===t)??null:null});_predefinedOptions=W.map(t=>t.id);_predefinedLabelMap=Object.fromEntries(W.map(t=>[t.id,t.label]));_categoryOptions=(0,_.EW)(()=>this._categories().map(t=>t.iri));_categoryLabelMap=(0,_.EW)(()=>Object.fromEntries(this._categories().map(t=>[t.iri,t.label])));_resolvedTemplate=(0,_.EW)(()=>{const t=this._selectedPredefined();if(!t)return null;const a=this._varValues();let n=t.template;for(const o of t.variables)n=n.replaceAll(`\${${o.key}}`,a[o.key]??"");return n});constructor(){(0,s.QZP)(()=>{const t=this._selectedPredefined(),a=this.handlers();this._varValues.set({}),this._categories.set([]),this._filePathPlaceholder.set(""),t?.variables.some(n=>"select"===n.type)&&this._loadCategories(a),t?.variables.some(n=>"THE_FILE_PATH"===n.key)&&this._loadFilePathPlaceholder(a)}),(0,s.QZP)(()=>{const t=this._resolvedTemplate();null!==t&&this._draft.set(t)})}_loadCategories(t){var a=this;return(0,C.A)(function*(){const n=t?.contentCategoriesInProject;if(n){a._categoriesLoading.set(!0);try{const o=yield n();a._categories.set(o)}catch(o){console.error("[RowDefModal] _loadCategories \u2014 error:",o)}finally{a._categoriesLoading.set(!1)}}})()}_loadFilePathPlaceholder(t){var a=this;return(0,C.A)(function*(){const n=t?.randomFilePath;if(!n)return;const o=yield n();if(o){const i=o.replace(/\/?[^\/]*$/,"/");a._filePathPlaceholder.set(i),a._setVar("THE_FILE_PATH",i)}})()}_onPredefinedChange(t){this._selectedPredefinedId.set(null!=t?String(t):null)}_setVar(t,a){null!=a&&this._varValues.update(n=>({...n,[t]:String(a)}))}_validationError=(0,_.EW)(()=>{const t=this._draft().trim();if(!t)return null;try{const a=jt.parse(t);if("SELECT"!==a?.queryType)return"components.sparqlTable.rowDefinitionErrorNotSelect";if(!a.variables.filter(i=>"*"!==i).map(i=>i?.value??i?.variable?.value??"").includes("subject"))return"components.sparqlTable.rowDefinitionErrorMissingSubject"}catch{return"components.sparqlTable.rowDefinitionErrorSyntax"}return null});_isSaveDisabled=(0,_.EW)(()=>!!this._draft().trim()&&!!this._validationError());_save(){this._draft()&&this._validationError()||(this.rowDefinitionQuery.set(this._draft()),this.saved.emit(),this.close.emit())}static \u0275fac=function(a){return new(a||l)};static \u0275cmp=e.VBU({type:l,selectors:[["cue-sparql-row-definition-modal"]],inputs:{rowDefinitionQuery:[1,"rowDefinitionQuery"],handlers:[1,"handlers"]},outputs:{rowDefinitionQuery:"rowDefinitionQueryChange",close:"close",saved:"saved"},decls:20,vars:20,consts:[[3,"close","label","minWidth"],["direction","column","gap","m",2,"padding","4px 0"],["size","s","color","secondary"],["label","Predefined query","placeholder","Custom query\u2026",3,"valueChange","options","labelMap","value"],[2,"height","200px","display","flex","flex-direction","column"],["type","sparql",2,"flex","1",3,"contentChange","content"],[1,"row-def-error"],["direction","row","gap","s","justify","end"],["variant","tertiary","size","s",3,"click"],["variant","primary","size","s",3,"click","disabled"],[3,"label","value"],[3,"label","options","labelMap","value","disabled","placeholder"],[3,"valueChange","label","value"],[3,"valueChange","label","options","labelMap","value","disabled","placeholder"]],template:function(a,n){if(1&a&&(e.j41(0,"cue-modal",0),e.nI1(1,"transloco"),e.bIt("close",function(){return n.close.emit()}),e.j41(2,"cue-flexcontainer",1)(3,"cue-typography",2),e.EFF(4),e.nI1(5,"transloco"),e.k0s(),e.j41(6,"cue-select",3),e.bIt("valueChange",function(i){return n._onPredefinedChange(i)}),e.k0s(),e.nVh(7,wt,2,0),e.j41(8,"div",4)(9,"cue-code-editor",5),e.bIt("contentChange",function(i){return n._draft.set(i)}),e.k0s()(),e.nVh(10,At,3,3,"div",6),e.j41(11,"cue-flexcontainer",7)(12,"cue-button",8),e.bIt("click",function(){return n.close.emit()}),e.j41(13,"cue-button-label"),e.EFF(14),e.nI1(15,"transloco"),e.k0s()(),e.j41(16,"cue-button",9),e.bIt("click",function(){return n._save()}),e.j41(17,"cue-button-label"),e.EFF(18),e.nI1(19,"transloco"),e.k0s()()()()()),2&a){let o,i;e.Y8G("label",e.bMT(1,12,"components.sparqlTable.rowDefinitionModalTitle"))("minWidth","620px"),e.R7$(4),e.SpI(" ",e.bMT(5,14,"components.sparqlTable.rowDefinitionModalDescription")," "),e.R7$(2),e.Y8G("options",n._predefinedOptions)("labelMap",n._predefinedLabelMap)("value",n._selectedPredefinedId()??void 0),e.R7$(),e.vxM((o=n._selectedPredefined())?7:-1,o),e.R7$(2),e.Y8G("content",n._draft()),e.R7$(),e.vxM((i=n._draft()&&n._validationError())?10:-1,i),e.R7$(4),e.SpI(" ",e.bMT(15,16,"components.sparqlTable.rowDefinitionDiscard")," "),e.R7$(2),e.Y8G("disabled",n._isSaveDisabled()),e.R7$(2),e.SpI(" ",e.bMT(19,18,"components.sparqlTable.rowDefinitionSave")," ")}},dependencies:[Rt.a,N.n,j.Typography,X.$,de.L,ue.B,se.l,re.p,L.Kj],styles:[".row-def-error[_ngcontent-%COMP%]{color:var(--cue-color-error, #ef4444);font-size:12px;padding:2px 0}"],changeDetection:0})}return l})();var kt=h(7284);function qt(l,d){if(1&l&&(e.j41(0,"div",13),e.nrm(1,"span",26),e.EFF(2),e.k0s()),2&l){const t=d;e.R7$(2),e.Lme(" ",t.done," / ",t.total," queries ")}}function It(l,d){1&l&&(e.j41(0,"div",13),e.nrm(1,"span",26),e.EFF(2," Building table for download\u2026 "),e.k0s())}function Lt(l,d){if(1&l){const t=e.RV6();e.j41(0,"div",27),e.bIt("click",function(){s.eBV(t);const n=e.XpG();return s.Njj(n._openRowDefModal())}),e.j41(1,"cue-typography",28),e.EFF(2),e.nI1(3,"transloco"),e.k0s()()}2&l&&(e.R7$(2),e.SpI(" ",e.bMT(3,1,"components.sparqlTable.rowDefinitionEmpty")," "))}function Gt(l,d){if(1&l){const t=e.RV6();e.j41(0,"cue-paginator",29),e.bIt("currentPage",function(n){s.eBV(t);const o=e.XpG();return s.Njj(o._onPaginateEvent(n))}),e.k0s()}if(2&l){const t=e.XpG();e.Y8G("size",t._totalKeys())("pageSize",t.pageSize())}}function Vt(l,d){if(1&l){const t=e.RV6();e.j41(0,"cue-button",30),e.bIt("click",function(){const n=s.eBV(t),o=n.$implicit,i=n.index,u=e.XpG();return s.Njj(u._openSettings(o,i))}),e.nrm(1,"cue-button-icon",11),e.k0s(),e.j41(2,"cue-button",31),e.bIt("click",function(){const n=s.eBV(t).$implicit,o=e.XpG();return s.Njj(o._deleteColumn(n.field))}),e.nrm(3,"cue-button-icon",32),e.k0s()}}function Qt(l,d){if(1&l){const t=e.RV6();e.j41(0,"div",33),e.bIt("click",function(){s.eBV(t);const n=e.XpG();return s.Njj(n._addColumn())}),e.nrm(1,"cue-button-icon",34),e.k0s()}}function Ot(l,d){if(1&l){const t=e.RV6();e.j41(0,"cue-declarative-sparql-column-settings-modal",35),e.mxI("columnDefChange",function(n){const o=s.eBV(t);return e.DH7(o.col,n)||(o.col=n),s.Njj(n)}),e.bIt("close",function(){s.eBV(t);const n=e.XpG();return s.Njj(n._activeColumn.set(void 0))})("updateColumnDef",function(n){const o=s.eBV(t),i=e.XpG();return s.Njj(i._applyColumnUpdate(o.index,n))}),e.k0s()}if(2&l){const t=e.XpG();e.R50("columnDef",d.col),e.Y8G("handlers",t.handlers())("columns",t.columns())}}function $t(l,d){if(1&l){const t=e.RV6();e.j41(0,"cue-sparql-row-definition-modal",36),e.mxI("rowDefinitionQueryChange",function(n){s.eBV(t);const o=e.XpG();return e.DH7(o.rowDefinition,n)||(o.rowDefinition=n),s.Njj(n)}),e.bIt("saved",function(){s.eBV(t);const n=e.XpG();return s.Njj(n._onRowDefSaved())})("close",function(){s.eBV(t);const n=e.XpG();return s.Njj(n._showRowDefModal.set(!1))}),e.k0s()}if(2&l){const t=e.XpG();e.R50("rowDefinitionQuery",t.rowDefinition),e.Y8G("handlers",t.rowDefinitionHandlers())}}const Bt=new w.Parser({sparqlStar:!0}),Xt=new w.Generator;function V(l,d){return H.apply(this,arguments)}function H(){return H=(0,C.A)(function*(l,d){const t=new Array(l.length);let a=0;function o(){return(o=(0,C.A)(function*(){for(;a<l.length;){const u=a++;t[u]=yield l[u]()}})).apply(this,arguments)}const i=Array.from({length:Math.min(d,l.length)},()=>function n(){return o.apply(this,arguments)}());return yield Promise.all(i),t}),H.apply(this,arguments)}function U(l,d){if(d.length>200)return l;try{const t=Bt.parse(l),a={type:"values",values:d.map(n=>({"?subject":{termType:"NamedNode",value:n}}))};return Array.isArray(t.where)&&(t.where=[a,...t.where]),Xt.stringify(t)}catch{const t=`VALUES ?subject { ${d.map(a=>`<${a}>`).join(" ")} }`;return l.replace(/WHERE\s*\{/i,`WHERE {\n ${t}`)}}let Kt=(()=>{class l{visibleRows=(0,g.CGW)();columnDefsAG=(0,g.CGW)();columns=g.geq.required();handlers=g.hFB.required();rowDefinitionHandlers=(0,g.hFB)(void 0);rowDefinition=(0,g.geq)($);pageSize=(0,g.hFB)(10);bufferFactor=(0,g.hFB)(5);_bufferSize=(0,_.EW)(()=>this.pageSize()*this.bufferFactor());_noRowDef=(0,_.EW)(()=>null!==this.rowDefinition()&&!this.rowDefinition()&&!this._showSettings());_showSettings=(0,s.vPA)(!1);_activeColumn=(0,s.vPA)(void 0);_showRowDefModal=(0,s.vPA)(!1);_dataFetchService=(0,s.WQX)(I);_tableService=(0,s.WQX)(B);_allKeys=(0,s.vPA)([]);_totalKeys=(0,_.EW)(()=>this._allKeys().length);_bufferKeys=(0,s.vPA)([]);_bufferOffset=(0,s.vPA)(0);_rowDefLoading=(0,s.vPA)(!1);_rowDefError=(0,s.vPA)("");_gridApi=null;_fullDataMode=(0,s.vPA)(!1);_fetchingFullData=(0,s.vPA)(!1);_fullDataFetchVersion=0;_exporting=(0,s.vPA)(!1);_prefetchCache=new Map;_currentlyPrefetching=new Set;_displayColumns=(0,_.EW)(()=>{const t=this._bufferKeys();return null===this.rowDefinition()||t.length?this._patchColumns(this.columns(),t):[]});_queryProgress=(0,_.EW)(()=>{const t=!!this.rowDefinition(),a=t?1:0;if(this._fetchingFullData()){const p=this._dataFetchService.totalQueryCount(),c=a+Math.max(p,1);return 0===c?null:{done:0,total:c}}const n=t&&!this._rowDefLoading()&&this._allKeys().length>0?1:0,o=this._dataFetchService.totalQueryCount(),u=n+this._dataFetchService.fetchedColumns().length,r=a+o;return 0===r||u>=r?null:{done:u,total:r}});_handlers=(0,_.EW)(()=>({queryHandler:this.handlers().queryHandler}));constructor(){(0,s.QZP)(()=>{const t=this.rowDefinition(),a=this.handlers();t&&a&&this._fetchRowDef(t,a)})}_openRowDefModal(){this._showRowDefModal.set(!0)}_onGridApi(t){this._gridApi=t,null!==this.rowDefinition()&&(t.addEventListener("sortChanged",()=>this._checkSortFilterState(t)),t.addEventListener("filterChanged",()=>this._checkSortFilterState(t)))}_checkSortFilterState(t){if(!this.rowDefinition())return;const a=t.getColumnState().some(i=>null!=i.sort),n=Object.keys(t.getFilterModel()??{}).length>0,o=a||n;!o||this._fullDataMode()||this._fetchingFullData()?o&&this._fullDataMode()?this._fillVisibleRows():!o&&(this._fullDataMode()||this._fetchingFullData())&&this._exitFullDataMode():this._enterFullDataMode()}_fillingVisibleRows=!1;_fillVisibleRows(){var t=this;return(0,C.A)(function*(){if(!t._fillingVisibleRows&&t._gridApi){t._fillingVisibleRows=!0;try{const a=t._gridApi.paginationGetPageSize?.()??t.pageSize(),o=(t._gridApi.paginationGetCurrentPage?.()??0)*a,i=[];for(let p=o;p<o+a;p++){const c=t._gridApi.getDisplayedRowAtIndex(p);if(!c?.data?.id)break;i.push(c.data.id)}if(!i.length)return;const u=t.columns().filter(p=>"data"===p.defType&&p.query&&!p.hide),r=t._dataFetchService.keyVals;yield V(u.map(p=>(0,C.A)(function*(){const c=i.filter(m=>void 0===r[m]?.[p.field]);if(!c.length)return;const f=U(p.query,c);try{const m=yield t.handlers().queryHandler(f,E(f)),y={};m.results.bindings.forEach(T=>{const b=T.subject?.value;if(!b)return;y[b]||(y[b]=[]);const M={};Object.keys(T).filter(S=>"subject"!==S).forEach(S=>{M[S]=T[S]?.value}),y[b].push(M)}),t._dataFetchService.mergeColumnData(p.field,y,p.query)}catch{}})),3)}finally{t._fillingVisibleRows=!1}}})()}_onPaginateEvent(t){const a=t.startIndex,n=this._bufferSize(),o=Math.floor(a/n)*n;this._loadBuffer(o);const i=Math.floor((a-o)/this.pageSize());if(this._gridApi)try{this._gridApi.paginationGoToPage(i)}catch{}if(i>=Math.ceil(n/this.pageSize())-1){const r=o+n;r<this._allKeys().length&&this._prefetchBuffer(r)}}_fetchRowDef(t,a){var n=this;return(0,C.A)(function*(){n._rowDefLoading.set(!0),n._rowDefError.set(""),n._dataFetchService.emptyTableText.set("Loading\u2026"),n._allKeys.set([]),n._bufferKeys.set([]),n._bufferOffset.set(0),n._prefetchCache.clear(),n._currentlyPrefetching.clear();try{const o=E(t),i=yield a.queryHandler(t,o),u=i.results.bindings.map(r=>r.subject?.value).filter(Boolean);console.log("[ROWDEF] _fetchRowDef received",i.results.bindings.length,"bindings,",u.length,"valid keys. meta=",i.meta),n._allKeys.set(u),n._loadBuffer(0)}catch(o){n._rowDefError.set(String(o?.message??o))}finally{n._rowDefLoading.set(!1)}})()}_loadBuffer(t,a=!1){const n=this._allKeys().slice(t,t+this._bufferSize()),o=this._bufferKeys();if(!a&&n.length===o.length&&n.every((u,r)=>u===o[r]))return;const i=this._prefetchCache.get(t);if(this._prefetchCache.delete(t),this._dataFetchService.resetData(),i?this._dataFetchService.injectPreloadedData(i.keyVals,i.fetchedColumnFields,i.columnQueries):this._tableService.destroy(),this._bufferOffset.set(t),this._bufferKeys.set(n),this._gridApi)try{this._gridApi.paginationGoToPage(0)}catch{}}_enterFullDataMode(){var t=this;return(0,C.A)(function*(){if(console.log("[FDM] _enterFullDataMode called. _fetchingFullData=",t._fetchingFullData(),"_fullDataMode=",t._fullDataMode(),"_allKeys=",t._allKeys().length),t._fetchingFullData())return;t._fetchingFullData.set(!0);const a=++t._fullDataFetchVersion;let n;t._gridApi&&(n=t._gridApi.getColumnState().find(r=>null!=r.sort)?.colId,n||(n=Object.keys(t._gridApi.getFilterModel()??{})[0]));const o=n?.replace(/_\d+$/,""),i=o?t.columns().find(u=>u.field===o&&"data"===u.defType&&u.query):void 0;if(!i)return t._fullDataMode.set(!0),void t._fetchingFullData.set(!1);try{if(a!==t._fullDataFetchVersion)return;const u=yield t.handlers().queryHandler(i.query,E(i.query));if(a!==t._fullDataFetchVersion)return;const r={};Object.entries(t._dataFetchService.keyVals).forEach(([b,M])=>{r[b]={...M}});const p=t._allKeys();p.forEach(b=>{r[b]||(r[b]={})}),console.log("[DeclarativeSPARQLTable] keyVals pre-seed: allKeys=",p.length,"keyVals size=",Object.keys(r).length);const c=[...t._dataFetchService.fetchedColumns()],f={...t._dataFetchService._columnQueries},m=[];if(u.results.bindings.forEach(b=>{const M=b.subject?.value;if(!M)return;r[M]||(r[M]={}),r[M][i.field]=[];const S={};Object.keys(b).filter(D=>"subject"!==D).forEach(D=>{S[D]=b[D]?.value}),r[M][i.field].push(S),m.push(M)}),c.includes(i.field)||c.push(i.field),f[i.field]=i.query,console.log("[FDM] after sort-col fetch: keyVals size=",Object.keys(r).length,"allKeys from sort col=",m.length),console.log("[FDM] calling resetData()"),t._dataFetchService.resetData(),t._tableService.destroy(),console.log("[FDM] calling injectPreloadedData with",Object.keys(r).length,"rows"),t._dataFetchService.injectPreloadedData(r,c,f),console.log("[FDM] injectPreloadedData done. Service keyVals size=",Object.keys(t._dataFetchService.keyVals).length),t._fullDataMode.set(!0),a!==t._fullDataFetchVersion)return;const y=t.columns().filter(b=>"data"===b.defType&&b.query&&b.field!==i.field&&!b.hide),T=new Set(t._bufferKeys());yield V(y.map(b=>(0,C.A)(function*(){const M=m.filter(D=>T.has(D)&&void 0===r[D]?.[b.field]);if(!M.length||a!==t._fullDataFetchVersion)return;const S=U(b.query,M);try{const D=yield t.handlers().queryHandler(S,E(S));if(a!==t._fullDataFetchVersion)return;const v={};D.results.bindings.forEach(R=>{const x=R.subject?.value;if(!x)return;v[x]||(v[x]=[]);const k={};Object.keys(R).filter(F=>"subject"!==F).forEach(F=>{k[F]=R[F]?.value}),v[x].push(k)}),Object.entries(v).forEach(([R,x])=>{r[R]&&(r[R][b.field]=x)}),t._dataFetchService.mergeColumnData(b.field,v,b.query)}catch{}})),3)}catch(u){console.error("[DeclarativeSPARQLTable] Error in _enterFullDataMode:",u)}finally{a===t._fullDataFetchVersion&&t._fetchingFullData.set(!1)}})()}_exitFullDataMode(){if(console.log("[FDM] _exitFullDataMode called"),this._fullDataFetchVersion++,this._fetchingFullData.set(!1),this._fullDataMode.set(!1),this._dataFetchService.resetData(),this._tableService.destroy(),this._loadBuffer(this._bufferOffset(),!0),this._gridApi)try{this._gridApi.paginationGoToPage(0)}catch{}}_prefetchBuffer(t){var a=this;return(0,C.A)(function*(){if(a._prefetchCache.has(t)||a._currentlyPrefetching.has(t))return;const n=a._allKeys().slice(t,t+a._bufferSize());if(!n.length)return;a._currentlyPrefetching.add(t);const i=a._patchColumns(a.columns(),n).filter(c=>"data"===c.defType&&!c.hide&&c.query),u={},r=[],p={};try{yield V(i.map(c=>(0,C.A)(function*(){try{(yield a.handlers().queryHandler(c.query,E(c.query))).results.bindings.forEach(m=>{const y=m.subject?.value;if(!y)return;u[y]||(u[y]={}),u[y][c.field]||(u[y][c.field]=[]);const T={};Object.keys(m).filter(b=>"subject"!==b).forEach(b=>{T[b]=m[b]?.value}),u[y][c.field].push(T)}),r.push(c.field),p[c.field]=c.query}catch{}})),3),a._prefetchCache.set(t,{keyVals:u,fetchedColumnFields:r,columnQueries:p})}finally{a._currentlyPrefetching.delete(t)}})()}_patchColumns(t,a){return a.length?t.map(n=>n.query&&"data"===n.defType?{...n,query:U(n.query,a)}:n):t}_columnSelectSettings=Object.assign(new z.e,{allowEditing:!1});_shownColumns=(0,_.EW)(()=>this.columns().filter(t=>!t.hide));_openSettings(t,a){const n=this.columns().findIndex(o=>o.field===t.field);this._activeColumn.set({col:{...t},index:n})}_onShownChanged(t){const a=new Set(t.map(u=>u.field)),n=this.columns(),o=t.map(u=>({...n.find(p=>p.field===u.field)??u,hide:!1})),i=n.filter(u=>!a.has(u.field)).map(u=>({...u,hide:!0}));this.columns.set([...o,...i])}_applyColumnUpdate(t,a){const n=this.columns().map((o,i)=>i===t?Object.assign(Object.create(Object.getPrototypeOf(o)),o,a):o);this.columns.set(n)}_addColumn(){const t=this.columns();let a;if(t.length>0)a=t[t.length-1];else{const i=this.rowDefinition();a=Object.assign(new ne,{query:i?this._seedQueryFromRowDef(i):"",strategy:{type:"first"}})}const n=Object.assign(Object.create(Object.getPrototypeOf(a)),a,{field:`column_${Date.now()}`,headerName:`${a.headerName??a.field??"Column"} Copy`,hide:!1}),o=t.length;this.columns.update(i=>[...i,n]),this._activeColumn.set({col:{...n},index:o})}_deleteColumn(t){this.columns.update(a=>a.filter(n=>n.field!==t))}_onRowDefSaved(){if(this.columns().length>0)return;this._showSettings.set(!0);const t=this.rowDefinition(),a=t?this._seedQueryFromRowDef(t):"",n=Object.assign(new ne,{field:`column_${Date.now()}`,headerName:"Column 1",query:a,strategy:{type:"first"}});this.columns.set([n]),this._activeColumn.set({col:{...n},index:0})}_seedQueryFromRowDef(t){try{if(/qcy:FileContent\b/.test(t)){let n=t.replace(/SELECT\s+(?:DISTINCT\s+)?\?subject\b/i,"SELECT ?subject ?value");n=n.replace(/\s*ORDER\s+BY\s+[^\n{}]*/gi,""),/PREFIX\s+skos:/i.test(n)||(n=`PREFIX skos: <${De.B.skos}>\n`+n);const o=n.lastIndexOf("}");return-1!==o&&(n=n.slice(0,o)+" ?subject qcy:hasContentCategory ?cat .\n ?cat skos:prefLabel ?value .\n}"),n.trim()}{let n=t.replace(/SELECT\s+(?:DISTINCT\s+)?\?subject\b/i,"SELECT ?subject ?val");n=n.replace(/\s*ORDER\s+BY\s+[^\n{}]*/gi,"");const o=n.lastIndexOf("}");return-1!==o&&(n=n.slice(0,o)+" ?subject qcy:value ?val .\n}"),n.trim()}}catch{return t}}_getFormattedData(t=!1,a){const n=t?this.columns().filter(c=>"data"===c.defType&&c.query).map(c=>this._dataFetchService.columnDefsAG().find(m=>m.colId===c.field||m.field===c.field)??{colId:c.field,headerName:c.headerName??c.field,cellRendererParams:{strategy:c.strategy,postProcess:c.postProcess}}):this._dataFetchService.columnDefsAG().filter(c=>!c.hide),o=this._allKeys(),i=a?(o.length>0?o:Object.keys(a)).map(c=>({id:c,...a[c]??{}})):this._tableService.tableData(),u=["Key",...n.map(c=>c.headerName??c.field??"")],r=["",...n.map(c=>{const f=c.cellStyle;return f&&"object"==typeof f?String(f.textAlign??f["text-align"]??"").toLowerCase():""})];return{headers:u,rows:i.map(c=>[String(c.id??""),...n.map(f=>{const m=f.colId??f.field??"",y=f.valueGetter;let T="function"==typeof y?y({data:c,colDef:f}):c[m];if(void 0===T&&a&&(T=(a[c.id]??{})[m]??[]),Array.isArray(T)){const b=f.cellRendererParams?.strategy,M=f.cellRendererParams?.postProcess,S=b?A(T,b,""):T.map(D=>D?.val??"").filter(Boolean).join(", ");return(0,P.g4)(S,M)}return String(T??"")})]),alignments:r}}_fetchAllColumnsForExport(t){var a=this;return(0,C.A)(function*(){const n=a._allKeys();console.log("[EXPORT] _fetchAllColumnsForExport called for",t.length,"columns. allKeys=",n.length);const o=t.filter(r=>"data"===r.defType&&r.query);if(!o.length)return{};const i=n.length?a._patchColumns(o,n):o,u={};return yield V(i.map(r=>(0,C.A)(function*(){try{(yield a.handlers().queryHandler(r.query,E(r.query))).results.bindings.forEach(c=>{const f=c.subject?.value;if(!f)return;u[f]||(u[f]={}),u[f][r.field]||(u[f][r.field]=[]);const m={};Object.keys(c).filter(y=>"subject"!==y).forEach(y=>{m[y]=c[y]?.value}),u[f][r.field].push(m)})}catch{}})),3),u})()}_downloadCsv(){var t=this;return(0,C.A)(function*(a=!1){if(!t._exporting()){t._exporting.set(!0);try{const n=a?t.columns():t.columns().filter(c=>!c.hide),o=yield t._fetchAllColumnsForExport(n),{headers:i,rows:u}=t._getFormattedData(a,o),r=kt.unparse([i,...u]),p=new Blob([r],{type:"text/csv;charset=utf-8;"});t._triggerDownload(p,"export.csv")}finally{t._exporting.set(!1)}}}).apply(this,arguments)}_downloadXlsx(){var t=this;return(0,C.A)(function*(a=!1){if(!t._exporting()){t._exporting.set(!0);try{const n=a?t.columns():t.columns().filter(c=>!c.hide),o=yield t._fetchAllColumnsForExport(n),{headers:i,rows:u,alignments:r}=t._getFormattedData(a,o),p=yield t._buildStyledXlsxBlob(i,u,r);t._triggerDownload(p,"export.xlsx")}finally{t._exporting.set(!1)}}}).apply(this,arguments)}_buildStyledXlsxBlob(t,a,n){return(0,C.A)(function*(){const u=(D,v)=>D?"center"===v?2:"right"===v?3:1:"center"===v?4:"right"===v?5:0,r=(D,v,R,x)=>{const k=`${(D=>{let v="",R=D+1;for(;R>0;)v=String.fromCharCode(65+(R-1)%26)+v,R=Math.floor((R-1)/26);return v})(D)}${v}`,F=x>0?` s="${x}"`:"",J=Number(R);return 0===x&&""!==R&&!isNaN(J)&&isFinite(J)?`<c r="${k}"${F}><v>${J}</v></c>`:`<c r="${k}"${F} t="inlineStr"><is><t>${(D=>D.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"))(R)}</t></is></c>`},p=[];p.push(`<row r="1">${t.map((D,v)=>r(v,1,D,u(!0,n[v]??""))).join("")}</row>`),a.forEach((D,v)=>{p.push(`<row r="${v+2}">${D.map((R,x)=>r(x,v+2,R,u(!1,n[x]??""))).join("")}</row>`)});const c=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">\n <cols><col min="1" max="1" hidden="1"/></cols>\n <sheetData>${p.join("")}</sheetData>\n</worksheet>`,S=new(0,(yield h.e(628).then(h.t.bind(h,7247,23))).default);return S.file("[Content_Types].xml",'<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">\n <Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>\n <Default Extension="xml" ContentType="application/xml"/>\n <Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/>\n <Override PartName="/xl/worksheets/sheet1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/>\n <Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/>\n</Types>'),S.file("_rels/.rels",'<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">\n <Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/>\n</Relationships>'),S.file("xl/workbook.xml",'<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">\n <sheets><sheet name="Data" sheetId="1" r:id="rId1"/></sheets>\n</workbook>'),S.file("xl/_rels/workbook.xml.rels",'<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">\n <Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet1.xml"/>\n <Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/>\n</Relationships>'),S.file("xl/worksheets/sheet1.xml",c),S.file("xl/styles.xml",'<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n<styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">\n <fonts count="2">\n <font><sz val="11"/><name val="Calibri"/></font>\n <font><b/><color rgb="FFFFFFFF"/><sz val="11"/><name val="Poppins"/></font>\n </fonts>\n <fills count="3">\n <fill><patternFill patternType="none"/></fill>\n <fill><patternFill patternType="gray125"/></fill>\n <fill><patternFill patternType="solid"><fgColor rgb="FF2859E1"/><bgColor indexed="64"/></patternFill></fill>\n </fills>\n <borders count="1">\n <border><left/><right/><top/><bottom/><diagonal/></border>\n </borders>\n <cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs>\n <cellXfs count="6">\n <xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/>\n <xf numFmtId="0" fontId="1" fillId="2" borderId="0" xfId="0" applyFont="1" applyFill="1"/>\n <xf numFmtId="0" fontId="1" fillId="2" borderId="0" xfId="0" applyFont="1" applyFill="1" applyAlignment="1"><alignment horizontal="center"/></xf>\n <xf numFmtId="0" fontId="1" fillId="2" borderId="0" xfId="0" applyFont="1" applyFill="1" applyAlignment="1"><alignment horizontal="right"/></xf>\n <xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyAlignment="1"><alignment horizontal="center"/></xf>\n <xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyAlignment="1"><alignment horizontal="right"/></xf>\n </cellXfs>\n</styleSheet>'),S.generateAsync({type:"blob",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"})})()}_triggerDownload(t,a){const n=URL.createObjectURL(t),o=document.createElement("a");o.href=n,o.download=a,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(n)}static \u0275fac=function(a){return new(a||l)};static \u0275cmp=e.VBU({type:l,selectors:[["cue-declarative-sparql-table"]],inputs:{columns:[1,"columns"],handlers:[1,"handlers"],rowDefinitionHandlers:[1,"rowDefinitionHandlers"],rowDefinition:[1,"rowDefinition"],pageSize:[1,"pageSize"],bufferFactor:[1,"bufferFactor"]},outputs:{visibleRows:"visibleRows",columnDefsAG:"columnDefsAG",columns:"columnsChange",rowDefinition:"rowDefinitionChange"},features:[e.Jv_([I,B])],decls:39,vars:25,consts:[[1,"flip-card",3,"cueFlipChange","cueFlip"],[1,"flip-content"],[1,"card-face","front"],["direction","row","justify","end",2,"padding","2px"],["positioning","bottomleft"],["trigger","","variant","tertiary","size","s","cueTooltip","Export",3,"disabled"],["icon","more-vert"],["menu",""],[3,"click","disabled"],["before","","name","download"],["variant","accent","size","s","cueTooltip","Column settings",3,"click"],["icon","settings"],[3,"gridApi","visibleRows","columnDefsAG","handlers","columns","showPaginator","paginationPageSize"],[1,"query-status"],[1,"row-def-empty"],[3,"size","pageSize"],[1,"card-face","back",2,"min-height","var(--cue-table-m-height)",3,"maxHeight"],["variant","tertiary","size","s",3,"click","cueTooltip"],["icon","filter"],["variant","accent","size","s","cueTooltip","Back to table",3,"click"],["icon","arrow-back"],[3,"shown","columnDefs","columnDefsGross","settings"],["cueColumnItem",""],["cueColumnListFooter",""],[3,"columnDef","handlers","columns"],[3,"rowDefinitionQuery","handlers"],[1,"query-status-spinner"],[1,"row-def-empty",3,"click"],["size","s","color","muted"],[3,"currentPage","size","pageSize"],["variant","tertiary","size","s","cueTooltip","Edit column",3,"click"],["variant","tertiary","size","s","cueTooltip","Delete column",3,"click"],["icon","delete"],["cueTooltip","Add column definition",1,"add-column-row",3,"click"],["icon","add"],[3,"columnDefChange","close","updateColumnDef","columnDef","handlers","columns"],[3,"rowDefinitionQueryChange","saved","close","rowDefinitionQuery","handlers"]],template:function(a,n){if(1&a&&(e.j41(0,"div",0),e.mxI("cueFlipChange",function(i){return e.DH7(n._showSettings,i)||(n._showSettings=i),i}),e.j41(1,"div",1)(2,"cue-card",2)(3,"cue-flexcontainer",3)(4,"cue-menu",4)(5,"cue-button",5),e.nrm(6,"cue-button-icon",6),e.k0s(),e.j41(7,"cue-menu-wrap",7)(8,"cue-menu-item",8),e.bIt("click",function(){return n._downloadCsv()}),e.nrm(9,"cue-svg-icon",9),e.EFF(10," Download CSV "),e.k0s(),e.j41(11,"cue-menu-item",8),e.bIt("click",function(){return n._downloadCsv(!0)}),e.nrm(12,"cue-svg-icon",9),e.EFF(13," Download CSV (incl. hidden columns) "),e.k0s(),e.j41(14,"cue-menu-item",8),e.bIt("click",function(){return n._downloadXlsx()}),e.nrm(15,"cue-svg-icon",9),e.EFF(16," Download XLSX "),e.k0s(),e.j41(17,"cue-menu-item",8),e.bIt("click",function(){return n._downloadXlsx(!0)}),e.nrm(18,"cue-svg-icon",9),e.EFF(19," Download XLSX (incl. hidden columns) "),e.k0s()()(),e.j41(20,"cue-button",10),e.bIt("click",function(){return n._showSettings.set(!0)}),e.nrm(21,"cue-button-icon",11),e.k0s()(),e.j41(22,"cue-sparql-table-inner",12),e.bIt("gridApi",function(i){return n._onGridApi(i)})("visibleRows",function(i){return n.visibleRows.emit(i)})("columnDefsAG",function(i){return n.columnDefsAG.emit(i)}),e.k0s(),e.nVh(23,qt,3,2,"div",13),e.nVh(24,It,3,0,"div",13),e.nVh(25,Lt,4,3,"div",14),e.nVh(26,Gt,1,2,"cue-paginator",15),e.k0s(),e.j41(27,"cue-card",16)(28,"cue-flexcontainer",3)(29,"cue-button",17),e.nI1(30,"transloco"),e.bIt("click",function(){return n._openRowDefModal()}),e.nrm(31,"cue-button-icon",18),e.k0s(),e.j41(32,"cue-button",19),e.bIt("click",function(){return n._showSettings.set(!1)}),e.nrm(33,"cue-button-icon",20),e.k0s()(),e.j41(34,"cue-ag-grid-column-select",21),e.bIt("shown",function(i){return n._onShownChanged(i)}),e.DNE(35,Vt,4,0,"ng-template",22)(36,Qt,2,0,"ng-template",23),e.k0s()()()(),e.nVh(37,Ot,1,3,"cue-declarative-sparql-column-settings-modal",24),e.nVh(38,$t,1,2,"cue-sparql-row-definition-modal",25)),2&a){let o,i;e.R50("cueFlip",n._showSettings),e.R7$(5),e.Y8G("disabled",n._exporting()),e.R7$(3),e.Y8G("disabled",n._exporting()),e.R7$(3),e.Y8G("disabled",n._exporting()),e.R7$(3),e.Y8G("disabled",n._exporting()),e.R7$(3),e.Y8G("disabled",n._exporting()),e.R7$(5),e.AVh("hidden",n._showSettings()||n._noRowDef()),e.Y8G("handlers",n._handlers())("columns",n._displayColumns())("showPaginator",n._fullDataMode())("paginationPageSize",n.pageSize()),e.R7$(),e.vxM((o=n._queryProgress())?23:-1,o),e.R7$(),e.vxM(n._exporting()?24:-1),e.R7$(),e.vxM(n._noRowDef()?25:-1),e.R7$(),e.vxM(n.rowDefinition()&&!n._fullDataMode()?26:-1),e.R7$(),e.Y8G("maxHeight","var(--cue-table-m-height)"),e.R7$(2),e.Y8G("cueTooltip",e.bMT(30,23,"components.sparqlTable.rowDefinitionTooltip")),e.R7$(5),e.Y8G("columnDefs",n._shownColumns())("columnDefsGross",n.columns())("settings",n._columnSelectSettings),e.R7$(3),e.vxM((i=n._activeColumn())?37:-1,i),e.R7$(),e.vxM(n._showRowDefModal()?38:-1)}},dependencies:[Ie,yt,Nt,Y.pL,Y.pC,Y.rx,bt.Z,N.n,j.Typography,X.$,ce.a,vt.R,oe.d,Dt.W,Tt.M,Ct.D,St.A,Mt.m,L.Kj],styles:[".flip-card[_ngcontent-%COMP%]{width:100%}.flip-content[_ngcontent-%COMP%]{position:relative;width:100%}.card-face[_ngcontent-%COMP%]{width:100%}.hidden[_ngcontent-%COMP%]{display:none}.row-def-empty[_ngcontent-%COMP%]{flex:1;min-height:160px;display:flex;align-items:center;justify-content:center;padding:32px 16px;border:2px dashed var(--cue-color-border, #d1d5db);border-radius:8px;cursor:pointer;margin-top:8px;transition:border-color .15s}.row-def-empty[_ngcontent-%COMP%]:hover{border-color:var(--cue-color-accent, #4f46e5)}.query-status[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:6px 10px;font-size:12px;color:var(--cue-color-text-muted, #6b7280);background:var(--cue-color-surface-subtle, #f9fafb);border:1px solid var(--cue-color-border, #e5e7eb);border-radius:6px;margin-top:6px}@keyframes _ngcontent-%COMP%_spin{to{transform:rotate(360deg)}}.query-status-spinner[_ngcontent-%COMP%]{display:inline-block;width:11px;height:11px;border:2px solid currentColor;border-top-color:transparent;border-radius:50%;animation:_ngcontent-%COMP%_spin .7s linear infinite;flex-shrink:0}.add-column-row[_ngcontent-%COMP%]{padding:20px 10px;border-top:solid 1px #ccc;display:flex;align-items:center;justify-content:center;opacity:.4;cursor:pointer;transition:opacity .15s ease}.add-column-row[_ngcontent-%COMP%]:hover{opacity:.75}"],changeDetection:0})}return l})();function Yt(l,d){if(1&l){const t=e.RV6();e.j41(0,"cue-declarative-sparql-table",2),e.mxI("columnsChange",function(n){s.eBV(t);const o=e.XpG();return e.DH7(o.columns,n)||(o.columns=n),s.Njj(n)})("rowDefinitionChange",function(n){s.eBV(t);const o=e.XpG();return e.DH7(o.rowDefinition,n)||(o.rowDefinition=n),s.Njj(n)}),e.bIt("visibleRows",function(n){s.eBV(t);const o=e.XpG();return s.Njj(o.visibleRows.emit(n))})("columnDefsAG",function(n){s.eBV(t);const o=e.XpG();return s.Njj(o.columnDefsAG.emit(n))}),e.k0s()}if(2&l){const t=e.XpG();e.Y8G("handlers",d)("rowDefinitionHandlers",t._rowDefinitionHandlers()),e.R50("columns",t.columns)("rowDefinition",t.rowDefinition),e.Y8G("pageSize",t.pageSize())("bufferFactor",t.bufferFactor())}}function Wt(l,d){1&l&&(e.j41(0,"cue-flexcontainer",1)(1,"cue-typography",3),e.EFF(2," No project connected. Pass a sdkState with cue and projectId. "),e.k0s()())}let Ht=(()=>{class l{sdkState=(0,g.hFB)(void 0);columns=g.geq.required();rowDefinition=(0,g.geq)($);pageSize=(0,g.hFB)(10);bufferFactor=(0,g.hFB)(5);visibleRows=(0,g.CGW)();columnDefsAG=(0,g.CGW)();_entities=(0,s.vPA)(void 0);_documents=(0,s.vPA)(void 0);_handlers=(0,_.EW)(()=>{const t=this.sdkState();if(!t)return;const{cue:a,projectId:n,graphType:o="fuseki"}=t;return{queryHandler:i=>a.api.sparql(i,n,o)}});_rowDefinitionHandlers=(0,_.EW)(()=>{const t=this._entities(),a=this._documents();if(t&&a)return{contentCategoriesInProject:()=>t.contentCategoriesInProject(),randomFilePath:()=>a.randomFilePath()}});constructor(){(0,s.QZP)(()=>{const t=this.sdkState();t?.cue&&t?.projectId?(this._entities.set(new Z.g8(t.cue.api,t.projectId)),this._documents.set(new Z.f$(t.cue.api,t.projectId))):(this._entities.set(void 0),this._documents.set(void 0))})}static \u0275fac=function(a){return new(a||l)};static \u0275cmp=e.VBU({type:l,selectors:[["cue-sparql-table"]],inputs:{sdkState:[1,"sdkState"],columns:[1,"columns"],rowDefinition:[1,"rowDefinition"],pageSize:[1,"pageSize"],bufferFactor:[1,"bufferFactor"]},outputs:{columns:"columnsChange",rowDefinition:"rowDefinitionChange",visibleRows:"visibleRows",columnDefsAG:"columnDefsAG"},decls:2,vars:1,consts:[[3,"handlers","rowDefinitionHandlers","columns","rowDefinition","pageSize","bufferFactor"],["direction","column","align","center","justify","center",2,"height","100%","width","100%","padding","8px"],[3,"columnsChange","rowDefinitionChange","visibleRows","columnDefsAG","handlers","rowDefinitionHandlers","columns","rowDefinition","pageSize","bufferFactor"],[2,"color","#9ca3af","font-size","13px"]],template:function(a,n){if(1&a&&e.nVh(0,Yt,1,6,"cue-declarative-sparql-table",0)(1,Wt,3,0,"cue-flexcontainer",1),2&a){let o;e.vxM((o=n._handlers())?0:1,o)}},dependencies:[Kt,N.n,j.Typography],styles:["[_nghost-%COMP%]{display:block;width:100%}"],changeDetection:0})}return l})()}}]);