@qaecy/cue-ui 0.0.56 → 0.0.58

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/1051.js +1 -1
  2. package/1138.js +1 -1
  3. package/1153.js +1 -1
  4. package/1338.js +1 -1
  5. package/1520.js +1 -0
  6. package/1837.js +1 -1
  7. package/1985.js +1 -1
  8. package/2003.js +1 -0
  9. package/2014.js +1 -0
  10. package/2021.js +1 -1
  11. package/2081.js +1 -1
  12. package/2245.js +1 -1
  13. package/2283.js +1 -0
  14. package/2317.js +1 -1
  15. package/2775.js +1 -1
  16. package/2839.js +1 -1
  17. package/29.js +1 -1
  18. package/3036.js +1 -1
  19. package/3039.js +1 -1
  20. package/3288.js +1 -1
  21. package/3319.js +1 -0
  22. package/3577.js +1 -1
  23. package/3614.js +1 -1
  24. package/4098.js +1 -0
  25. package/4283.js +1 -1
  26. package/4311.js +1 -1
  27. package/4791.js +1 -0
  28. package/5277.js +1 -0
  29. package/5381.js +1 -0
  30. package/5448.js +1 -0
  31. package/5559.js +1 -1
  32. package/5649.js +1 -1
  33. package/5738.js +1 -1
  34. package/5872.js +1 -1
  35. package/5971.js +1 -0
  36. package/6027.js +1 -0
  37. package/617.js +1 -1
  38. package/6233.js +1 -1
  39. package/63.js +1 -1
  40. package/6419.js +1 -1
  41. package/6423.js +1 -1
  42. package/650.js +1 -1
  43. package/6947.js +1 -1
  44. package/7089.js +1 -0
  45. package/7154.js +1 -0
  46. package/7313.js +1 -0
  47. package/7441.js +1 -1
  48. package/7719.js +1 -1
  49. package/7802.js +1 -0
  50. package/7851.js +1 -0
  51. package/804.js +1 -1
  52. package/8194.js +1 -0
  53. package/8560.js +1 -1
  54. package/8659.js +1 -0
  55. package/880.js +1 -0
  56. package/8855.js +1 -1
  57. package/8957.js +1 -1
  58. package/928.js +1 -1
  59. package/9396.js +1 -1
  60. package/992.js +1 -0
  61. package/README.md +5 -5
  62. package/common.js +1 -1
  63. package/index.js +1 -1
  64. package/main.js +1 -1
  65. package/package.json +1 -1
  66. package/2399.js +0 -1
  67. package/2516.js +0 -1
  68. package/3537.js +0 -1
  69. package/4687.js +0 -1
  70. package/4879.js +0 -1
  71. package/5041.js +0 -1
  72. package/5071.js +0 -1
  73. package/5137.js +0 -1
  74. package/7056.js +0 -1
  75. package/8336.js +0 -1
  76. package/8791.js +0 -1
package/4687.js DELETED
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[4687],{3798(E,l,t){t.d(l,{Z:()=>g});var a=t(3236),d=t(9974),c=t(8750),o=t(4360),n=t(1584);function g(i,r=a.E){return function e(i){return(0,d.N)((r,s)=>{let f=!1,h=null,u=null,v=!1;const p=()=>{if(u?.unsubscribe(),u=null,f){f=!1;const _=h;h=null,s.next(_)}v&&s.complete()},D=()=>{u=null,v&&s.complete()};r.subscribe((0,o._)(s,_=>{f=!0,h=_,u||(0,c.Tg)(i(_)).subscribe(u=(0,o._)(s,p,D))},()=>{v=!0,(!f||!u||u.closed)&&s.complete()}))})}(()=>(0,n.O)(i,r))}},7384(E,l,t){t.d(l,{OE:()=>d,i8:()=>o});var a=t(5547);function d(e,n=0){return function c(e){return!isNaN(parseFloat(e))&&!isNaN(Number(e))}(e)?Number(e):2===arguments.length?n:0}function o(e){return e instanceof a.aKT?e.nativeElement:e}},7421(E,l,t){t.d(l,{O:()=>e});var a=t(5802),d=t(5547),c=t(177);let o;try{o=typeof Intl<"u"&&Intl.v8BreakIterator}catch{o=!1}let e=(()=>{class n{_platformId=(0,a.WQX)(d.Agw);isBrowser=this._platformId?(0,c.UE)(this._platformId):"object"==typeof document&&!!document;EDGE=this.isBrowser&&/(edge)/i.test(navigator.userAgent);TRIDENT=this.isBrowser&&/(msie|trident)/i.test(navigator.userAgent);BLINK=this.isBrowser&&!(!window.chrome&&!o)&&typeof CSS<"u"&&!this.EDGE&&!this.TRIDENT;WEBKIT=this.isBrowser&&/AppleWebKit/i.test(navigator.userAgent)&&!this.BLINK&&!this.EDGE&&!this.TRIDENT;IOS=this.isBrowser&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!("MSStream"in window);FIREFOX=this.isBrowser&&/(firefox|minefield)/i.test(navigator.userAgent);ANDROID=this.isBrowser&&/android/i.test(navigator.userAgent)&&!this.TRIDENT;SAFARI=this.isBrowser&&/safari/i.test(navigator.userAgent)&&this.WEBKIT;constructor(){}static \u0275fac=function(r){return new(r||n)};static \u0275prov=a.jDH({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})()},3293(E,l,t){t.d(l,{l:()=>e});var a=t(5802),d=t(7705),c=t(5547);const o=new WeakMap;let e=(()=>{class n{_appRef;_injector=(0,a.WQX)(a.zZn);_environmentInjector=(0,a.WQX)(a.uvJ);load(i){const r=this._appRef=this._appRef||this._injector.get(c.o8S);let s=o.get(r);s||(s={loaders:new Set,refs:[]},o.set(r,s),r.onDestroy(()=>{o.get(r)?.refs.forEach(f=>f.destroy()),o.delete(r)})),s.loaders.has(i)||(s.loaders.add(i),s.refs.push((0,d.a0P)(i,{environmentInjector:this._environmentInjector})))}static \u0275fac=function(r){return new(r||n)};static \u0275prov=a.jDH({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})()}}]);
package/4879.js DELETED
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[4879],{4879(O,M,d){d.d(M,{g:()=>Oe});var y=d(467),a=d(7705),h=d(2271),l=d(5802),I=d(2065),w=d(7284),_=d.n(w);var t=d(5547);let E=(()=>{class o{get calculatedWidth(){let e=this.localConfig().width||this.width()||1;return this.el.nativeElement.parentNode.offsetWidth>0&&e<=1&&e>0&&(e*=this.el.nativeElement.parentNode.offsetWidth),e}get calculatedHeight(){let e=this.localConfig().height||this.height()||400;return this.el.nativeElement.parentNode.offsetHeight>0&&e<=1&&e>0&&(e*=this.el.nativeElement.parentNode.offsetHeight),e}onResize(e){this.logMessage("debug","rezisze triggered"),window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout(()=>{this.options.realignOnResize&&this.reDraw()},200)}constructor(){this.data=(0,a.hFB)([]),this.width=(0,a.hFB)(),this.height=(0,a.hFB)(),this.step=(0,a.hFB)(),this.overflow=(0,a.hFB)(),this.strict=(0,a.hFB)(),this.zoomOnHover=(0,a.hFB)(),this.realignOnResize=(0,a.hFB)(),this.randomizeAngle=(0,a.hFB)(),this.background=(0,a.hFB)(),this.font=(0,a.hFB)(),this.delay=(0,a.hFB)(),this.config=(0,a.hFB)({}),this.log=(0,a.hFB)(),this.clicked=(0,a.CGW)(),this.afterInit=(0,a.CGW)(),this.afterChecked=(0,a.CGW)(),this.localConfig=(0,h.EW)(()=>{const n=this.config();return{...n,width:this.width()||n.width||500,height:this.height()||n.height||300,overflow:this.overflow()??(n.overflow||!0),strict:this.strict()??(n.strict||!1),zoomOnHover:this.zoomOnHover()||n.zoomOnHover||{transitionTime:0,scale:1,delay:0},realignOnResize:this.realignOnResize()??(n.realignOnResize||!1),randomizeAngle:this.randomizeAngle()??(n.randomizeAngle||!1),step:this.step()||n.step||2,log:this.log()||n.log||!1,delay:this.delay()||n.delay,background:this.background()||n.background,font:this.font()||n.font}}),this.cloudDataHtmlElements=[],this.dataArr=[],this.el=(0,l.WQX)(t.aKT),this.r2=(0,l.WQX)(t.sFG);const e=this.el.nativeElement;(0,l.QZP)(()=>{const n=this.localConfig();this.logMessage("warn","cloud configuration",n),n.font&&this.r2.setStyle(e,"font",n.font),n.background&&this.r2.setStyle(e,"background",n.background),this.reDraw()})}reDraw(){this.afterChecked?.emit(),this.logMessage("debug","dataChanges emitted"),this.cloudDataHtmlElements=[],this.data()?(this.el.nativeElement.innerHTML="",this.data()&&(this.dataArr=this.data()),this.options={...this.localConfig(),aspectRatio:this.calculatedWidth/this.calculatedHeight,width:this.calculatedWidth,height:this.calculatedHeight,center:{x:this.calculatedWidth/2,y:this.calculatedHeight/2}},this.r2.setStyle(this.el.nativeElement,"width",this.options.width+"px"),this.r2.setStyle(this.el.nativeElement,"height",this.options.height+"px"),this.drawWordCloud(),this.logMessage("debug","reDraw finished")):console.error("angular-tag-cloud: No data passed. Please pass an Array of CloudData")}descriptiveEntry(e){let n=e.text;return n+=e.color?`-${e.color}`:"",n+=e.external?`-${e.external}`:"",n+=e.link?`-${e.link}`:"",n+=e.rotate?`-${e.rotate}`:"",n}drawWordCloud(){this.dataArr.sort((i,s)=>this.descriptiveEntry(i).localeCompare(this.descriptiveEntry(s))),this.dataArr.sort((i,s)=>s.weight-i.weight);const e=this.dataArr.filter(i=>i.position),n=this.dataArr.filter(i=>!i.position);e.forEach((i,s)=>{this.drawWord(s,i)}),n.forEach((i,s)=>{this.drawWord(s,i)})}hitTest(e){for(const n of this.cloudDataHtmlElements)if(this.overlapping(e,n))return!0;return!1}overlapping(e,n){const{offsetLeft:i,offsetTop:s,offsetWidth:c,offsetHeight:u}=n;return!(e.right<i||e.left>i+c||e.bottom<s||e.top>s+u)}getWeightForWord(e){let n=5;return this.dataArr[0].weight>this.dataArr[this.dataArr.length-1].weight&&(this.options.strict?e.weight>10?(n=10,this.logMessage("warn",`[TagCloud strict] Weight property ${e.weight} > 10. Fallback to 10 as you are using strict mode`,e)):e.weight<1?(n=1,this.logMessage("warn",`[TagCloud strict] Given weight property ${e.weight} < 1. Fallback to 1 as you are using strict mode`,e)):e.weight%1!=0?(n=Math.round(e.weight),this.logMessage("warn",`[TagCloud strict] Given weight property ${e.weight} is not an integer. Rounded value to ${n}`,e)):n=e.weight:n=Math.round((e.weight-this.dataArr[this.dataArr.length-1].weight)/(this.dataArr[0].weight-this.dataArr[this.dataArr.length-1].weight)*9)+1),n}setWordColor(e,n){this.r2.setStyle(e,"color",n)}setTooltip(e,n){this.r2.addClass(e,"tooltip");const i=this.r2.createElement("span");i.className="tooltiptext";const s=this.r2.createText(n);i.appendChild(s),e.appendChild(i)}setWordRotation(e,n){const i=n?`rotate(${n}deg)`:"";return this.r2.setStyle(e,"transform",i),i}wrapNodeIntoAnchorElement(e,n){const i=this.r2.createElement("a");return i.href=n.link||"",void 0!==n.external&&n.external&&(i.target="_blank"),i.appendChild(e),i}applyZoomStyle(e,n,i,s){this.options.zoomOnHover&&1!==this.options.zoomOnHover.scale&&(this.options.zoomOnHover.transitionTime||(this.options.zoomOnHover.transitionTime=0),this.options.zoomOnHover.scale||(this.options.zoomOnHover.scale=1),n.onmouseover=()=>{this.options.zoomOnHover?.transitionTime&&this.r2.setStyle(n,"transition",`transform ${this.options.zoomOnHover.transitionTime}s`),this.options.zoomOnHover?.scale&&this.r2.setStyle(n,"transform",`scale(${this.options.zoomOnHover.scale}) ${s}`),this.options.zoomOnHover?.delay&&this.r2.setStyle(n,"transition-delay",`${this.options.zoomOnHover.delay}s`),this.options.zoomOnHover?.color&&this.r2.setStyle(i?e:n,"color",this.options.zoomOnHover.color)},n.onmouseout=()=>{this.r2.setStyle(n,"transform",`none ${s}`),this.options.zoomOnHover?.color&&this.r2.removeStyle(i?e:n,"color")})}setPosition(e,n,i){let s=this.options.randomizeAngle?6.28*Math.random():0,c=0;const u=e.style;u.position="absolute";const m=!!(n.position&&n.position.left&&n.position.top),r=e.offsetWidth,f=e.offsetHeight;let b=m&&n.position?.left?n.position.left:this.options.center.x-r/2,C=m&&n.position?.top?n.position.top:this.options.center.y-f/2;if(u.left=b+"px",u.top=C+"px",this.options.delay&&(e.classList.add("tag-animation-delay"),u.setProperty("--tag-animation-delay",this.options.delay*i+"ms")),!m)if(0===i)u.left=b+2*(Math.random()-.5)*(this.calculatedWidth/5)+"px",u.top=C+2*(Math.random()-.5)*(this.calculatedHeight/5)+"30px";else{for(;this.options.width&&this.options.height&&e.offsetHeight&&e.offsetWidth&&this.hitTest(new DOMRect(b,C,e.offsetWidth,e.offsetHeight));)c+=this.options.step||1,s+=(i%2==0?1:-1)*(this.options.step||1),b=this.options.center.x-r/2+c*Math.cos(s)*this.options.aspectRatio,C=this.options.center.y+c*Math.sin(s)-f/2;u.left=b+"px",u.top=C+"px"}if(!this.options.overflow&&(b<0||C<0||b+r>this.calculatedWidth||C+f>this.calculatedHeight))return this.logMessage("warn","Word did not fit into the cloud and overflow is set to 'false'. The element will be removed",e),void e.remove()}drawWord(e,n){let i;const s=this.getWeightForWord(n);i=this.r2.createElement("span"),i.className=`w${s}`,i.onclick=()=>{this.clicked?.emit(n)},i.onmouseenter=()=>{i.style.zIndex="2"},i.onmouseleave=()=>{i.style.zIndex="1"};let c=this.r2.createText(n.text);n.color&&this.setWordColor(i,n.color);const u=this.setWordRotation(i,n.rotate);n.link&&(c=this.wrapNodeIntoAnchorElement(c,n)),this.options.zoomOnHover&&1!==this.options.zoomOnHover.scale&&this.applyZoomStyle(c,i,n.link,u),i.appendChild(c),this.r2.appendChild(this.el.nativeElement,i),n.tooltip&&this.setTooltip(i,n.tooltip),i.id=`angular-tag-cloud-item-${e}`,this.setPosition(i,n,e),this.logMessage("debug","Adds new word <span>",i),this.cloudDataHtmlElements.push(i),this.logMessage("debug","Placed words",this.cloudDataHtmlElements)}logMessage(e,...n){this.localConfig()&&("debug"===this.localConfig().log?console.log(`[AngularTagCloudModule ${e}]`,...n):"warn"===this.localConfig().log&&"warn"===e&&console.warn(`[AngularTagCloudModule ${e}]`,...n))}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275cmp=t.VBU({type:o,selectors:[["angular-tag-cloud"],["ng-tag-cloud"],["ngtc"]],hostBindings:function(n,i){1&n&&t.bIt("resize",function(c){return i.onResize(c)},t.tSv)},inputs:{data:[1,"data"],width:[1,"width"],height:[1,"height"],step:[1,"step"],overflow:[1,"overflow"],strict:[1,"strict"],zoomOnHover:[1,"zoomOnHover"],realignOnResize:[1,"realignOnResize"],randomizeAngle:[1,"randomizeAngle"],background:[1,"background"],font:[1,"font"],delay:[1,"delay"],config:[1,"config"],log:[1,"log"]},outputs:{clicked:"clicked",afterInit:"afterInit",afterChecked:"afterChecked"},decls:0,vars:0,template:function(n,i){},styles:['[_nghost-%COMP%]{font-family:Helvetica,Arial,sans-serif;font-size:10px;line-height:normal;color:#09f;overflow:hidden;position:relative;display:block}.tag-animation-delay[_ngcontent-%COMP%]{--tag-animation-delay: .5s;animation:_ngcontent-%COMP%_fadeIn .5s;opacity:0;animation-fill-mode:forwards;animation-delay:var(--tag-animation-delay)}span[_ngcontent-%COMP%]{padding:0}span.w10[_ngcontent-%COMP%]{font-size:550%}span.w9[_ngcontent-%COMP%]{font-size:500%}span.w8[_ngcontent-%COMP%]{font-size:450%}span.w7[_ngcontent-%COMP%]{font-size:400%}span.w6[_ngcontent-%COMP%]{font-size:350%}span.w5[_ngcontent-%COMP%]{font-size:300%}span.w4[_ngcontent-%COMP%]{font-size:250%}span.w3[_ngcontent-%COMP%]{font-size:200%}span.w2[_ngcontent-%COMP%]{font-size:150%}span.w1[_ngcontent-%COMP%]{font-size:100%}a[_ngcontent-%COMP%]:hover{color:#0df}a[_ngcontent-%COMP%]:hover, span.w10[_ngcontent-%COMP%], span.w9[_ngcontent-%COMP%], span.w8[_ngcontent-%COMP%]{color:#0cf}span.w7[_ngcontent-%COMP%]{color:#39d}span.w6[_ngcontent-%COMP%]{color:#90c5f0}span.w5[_ngcontent-%COMP%]{color:#90a0dd}span.w4[_ngcontent-%COMP%]{color:#90c5f0}span.w3[_ngcontent-%COMP%]{color:#a0ddff}span.w2[_ngcontent-%COMP%]{color:#9ce}span.w1[_ngcontent-%COMP%]{color:#aab5f0}.tooltip[_ngcontent-%COMP%] .tooltiptext[_ngcontent-%COMP%]{visibility:hidden;width:inherit;background-color:#555;color:#fff;text-align:center;border-radius:6px;padding:5px 10px;position:absolute;bottom:100%;left:0;opacity:0;transition:opacity .3s}.tooltip[_ngcontent-%COMP%] .tooltiptext[_ngcontent-%COMP%]:after{content:"";position:absolute;top:100%;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:#555 transparent transparent transparent}.tooltip[_ngcontent-%COMP%]:hover .tooltiptext[_ngcontent-%COMP%]{visibility:visible;opacity:1}@keyframes _ngcontent-%COMP%_fadeIn{0%{opacity:0}to{opacity:1}}'],changeDetection:0})}}return o})();var W=d(5970);const j=["wordCloudContainer"];function H(o,g){if(1&o){const e=t.RV6();t.j41(0,"angular-tag-cloud",3),t.bIt("clicked",function(i){l.eBV(e);const s=t.XpG();return l.Njj(s.handleClicked(i))}),t.k0s()}if(2&o){const e=t.XpG();t.Y8G("data",e.data())("zoomOnHover",e.zoomOnHoverOptions())("width",e.containerSize().width)("height",e.containerSize().height)("overflow",e.overflow())("realignOnResize",!0)}}let L=(()=>{class o{words=(0,a.hFB)();entries=(0,a.hFB)();caseSensitive=(0,a.hFB)(!1);clickable=(0,a.hFB)(!1);multiSelect=(0,a.hFB)(!1);highlightSelection=(0,a.hFB)(!1);minWeight=(0,a.hFB)(1);maxWeight=(0,a.hFB)(5);maxWords=(0,a.hFB)(50);colorScheme=(0,a.hFB)(["var(--cue-chart-text-color)","var(--cue-chart-text-color-select)"]);overflow=(0,a.hFB)(!1);clickedWord=(0,a.CGW)();selectionChanged=(0,a.CGW)();wordCloudContainer;containerSize=(0,l.vPA)({width:0,height:0});selection=(0,l.vPA)([]);data=(0,h.EW)(()=>{const e=this.words(),n=this.entries();return n?.length||e?.length?n?.length?n:e?.length?this._buildEntriesFromWords(e):[]:[]});ngAfterViewInit(){const e=new MutationObserver(()=>{this._applySelectionStyles()});this.wordCloudContainer?.nativeElement&&e.observe(this.wordCloudContainer.nativeElement,{childList:!0,subtree:!0})}handleResize(e){0!==e.newRect.height&&this.containerSize.set({width:e.newRect.width,height:e.newRect.height})}styleSelection=(0,l.QZP)(()=>{this.selection(),this._applySelectionStyles()});zoomOnHoverOptions=(0,h.EW)(()=>({scale:1.1,transitionTime:this.clickable()?1.2:0,delay:.05}));_buildEntriesFromWords(e){const n=new Map;for(const r of e){const f=this.caseSensitive()?r:r.toLowerCase();n.set(f,(n.get(f)||0)+1)}const i=Array.from(n.entries());if(0===i.length)return[];const s=i.map(([,r])=>r),c=Math.min(...s),u=Math.max(...s);return u===c?i.map(([r])=>({text:r,weight:this.maxWeight()})):i.sort(([,r],[,f])=>f-r).slice(0,this.maxWords()).map(([r,f])=>({text:r,weight:this.minWeight()+(f-c)*(this.maxWeight()-this.minWeight())/(u-c),color:this.colorScheme()[Math.floor(Math.random()*this.colorScheme().length)]}))}_applySelectionStyles(){if(!this.highlightSelection())return;const e=this.wordCloudContainer?.nativeElement;void 0!==e&&e.querySelectorAll("span").forEach(i=>{i.textContent&&(this.selection().includes(i.textContent.trim())?i.classList.add("selected"):i.classList.remove("selected"))})}handleClicked(e){this.clickable()&&(this.clickedWord.emit(e.text),this.highlightSelection()&&(this.selection().includes(e.text)?this.selection.update(n=>n.filter(i=>i!==e.text)):this.multiSelect()?this.selection.update(n=>[...n,e.text]):this.selection.update(()=>[e.text])),this.selectionChanged.emit(this.selection()))}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=t.VBU({type:o,selectors:[["cue-word-cloud"]],viewQuery:function(n,i){if(1&n&&t.GBs(j,5),2&n){let s;t.mGM(s=t.lsd())&&(i.wordCloudContainer=s.first)}},inputs:{words:[1,"words"],entries:[1,"entries"],caseSensitive:[1,"caseSensitive"],clickable:[1,"clickable"],multiSelect:[1,"multiSelect"],highlightSelection:[1,"highlightSelection"],minWeight:[1,"minWeight"],maxWeight:[1,"maxWeight"],maxWords:[1,"maxWords"],colorScheme:[1,"colorScheme"],overflow:[1,"overflow"]},outputs:{clickedWord:"clickedWord",selectionChanged:"selectionChanged"},decls:3,vars:5,consts:[["wordCloudContainer",""],["cueResized","",1,"wordcloud-container",3,"resized"],[3,"data","zoomOnHover","width","height","overflow","realignOnResize"],[3,"clicked","data","zoomOnHover","width","height","overflow","realignOnResize"]],template:function(n,i){1&n&&(t.j41(0,"div",1,0),t.bIt("resized",function(c){return i.handleResize(c)}),t.nVh(2,H,1,6,"angular-tag-cloud",2),t.k0s()),2&n&&(t.xc7("display",i.data().length?"block":"none"),t.AVh("clickable",i.clickable()),t.R7$(2),t.vxM(i.data().length?2:-1))},dependencies:[E,W.C],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%;min-height:200px}.wordcloud-container[_ngcontent-%COMP%]{width:100%;height:100%} .wordcloud-container.clickable angular-tag-cloud span{cursor:pointer} .selected{text-decoration:underline}"],changeDetection:0})}return o})();var G=d(5971),V=d(5448),$=d(3319),F=d(4372),U=d(2611),Y=d(5661),Q=d(1096),R=d(5764),T=d(2245);function Z(o,g){if(1&o&&(l.qSk(),t.j41(0,"svg",0),t.nrm(1,"path",3)(2,"path",4),t.k0s()),2&o){const e=t.XpG();t.R7$(),t.BMQ("fill",e.colorDark()),t.R7$(),t.BMQ("fill",e.color())}}function K(o,g){if(1&o&&(l.qSk(),t.j41(0,"svg",1),t.nrm(1,"path",5)(2,"path",6)(3,"path",7),t.k0s()),2&o){const e=t.XpG();t.R7$(2),t.BMQ("fill",e.color())}}const x_blue="#175EBB",J={".dwg":x_blue,".dxf":x_blue,".doc":x_blue,".docx":x_blue,".ifc":"#9F388D",".pdf":"#E03833",".ppt":x_blue,".pptx":x_blue,".csv":"#0b7741",".xls":"#0b7741",".xlsx":"#0b7741",folder:"#9D9998"};let q=(()=>{class o{suffix=a.hFB.required();size=(0,a.hFB)("m");color=(0,h.EW)(()=>J[this.suffix()]??"#9D9998");label=(0,h.EW)(()=>this.suffix().startsWith(".")?this.suffix().toUpperCase().replace(/^\./,""):"");className=(0,h.EW)(()=>`size-${this.size()}`);colorDark=(0,h.EW)(()=>{const e=this.color(),n=parseInt(e.slice(1),16),s=n>>8&255,c=255&n;return`#${(Math.floor(.8*(n>>16&255))<<16|Math.floor(.8*s)<<8|Math.floor(.8*c)).toString(16).padStart(6,"0")}`});static \u0275fac=function(n){return new(n||o)};static \u0275cmp=t.VBU({type:o,selectors:[["cue-file-icon"]],hostVars:2,hostBindings:function(n,i){2&n&&t.HbH(i.className())},inputs:{suffix:[1,"suffix"],size:[1,"size"]},decls:4,vars:2,consts:[["xmlns","http://www.w3.org/2000/svg","width","100%","height","100%","viewBox","0 0 48 48"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 24 30"],["size","xs","align","center","weight","semibold"],["d","M40 12H22l-4-4H8c-2.2 0-4 1.8-4 4v8h40v-4c0-2.2-1.8-4-4-4"],["d","M40 12H8c-2.2 0-4 1.8-4 4v20c0 2.2 1.8 4 4 4h32c2.2 0 4-1.8 4-4V16c0-2.2-1.8-4-4-4"],["fill","var(--cue-border-color)","d","M16.2.5H4.1C2.1.5.5 2.1.5 4.1v22.3c0 1.7 1.4 3.1 3.1 3.1h16.8c1.7 0 3.1-1.4 3.1-3.1V7.8h-.1c0-.1-7-7.1-7-7.1h-.1l-.1-.2Z"],["d","M4.1 1C2.4 1 1 2.4 1 4.1v22.3C1 27.8 2.2 29 3.6 29h16.8c1.4 0 2.6-1.2 2.6-2.6V8l-7-7H4.1Z"],["fill","#fff","d","M16 6c0 1.1.9 2 2 2h5l-7-7v5Z","opacity",".3"]],template:function(n,i){1&n&&(t.nVh(0,Z,3,2,":svg:svg",0)(1,K,4,1,":svg:svg",1),t.j41(2,"cue-typography",2),t.EFF(3),t.k0s()),2&n&&(t.vxM("folder"===i.suffix()?0:1),t.R7$(3),t.JRh(i.label()))},dependencies:[T.Typography],styles:["[_nghost-%COMP%]{display:block;position:relative;aspect-ratio:30 / 24;width:var(--cue-dim-elem-m)}.size-xs[_nghost-%COMP%]{width:var(--cue-dim-elem-xs)}.size-s[_nghost-%COMP%]{width:var(--cue-dim-elem-s)}[_nghost-%COMP%] svg[_ngcontent-%COMP%]{display:block;width:100%;height:auto}[_nghost-%COMP%] cue-typography[_ngcontent-%COMP%]{color:#fff;text-transform:uppercase;position:absolute;left:50%;bottom:24%;transform:translate(-50%)}"]})}return o})(),ee=(()=>{class o{suffix=(0,l.vPA)("");iconSize=(0,l.vPA)("xs");agInit(e){this._apply(e)}refresh(e){return this._apply(e),!0}_apply(e){this.suffix.set(e.value||"folder"),this.iconSize.set({xs:"xs",s:"xs",m:"xs",l:"s",xl:"m"}[e.colDef?.cellRendererParams?.iconSize??e.iconSize??"xs"]??"xs")}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=t.VBU({type:o,selectors:[["cue-file-icon-cell-renderer"]],decls:1,vars:2,consts:[[3,"suffix","size"]],template:function(n,i){1&n&&t.nrm(0,"cue-file-icon",0),2&n&&t.Y8G("suffix",i.suffix())("size",i.iconSize())},dependencies:[q],styles:["[_nghost-%COMP%]{display:flex;align-items:center;justify-content:center;width:100%;height:100%}"],changeDetection:0})}return o})();var te=d(6117),ne=d(29),ie=d(1951),oe=d(1493),D=d(9352),se=d(5381),ae=d(9769),le=d(5187),ce=d(356),re=d(6279),de=d(7717),ue=d(7089);const he=(o,g)=>g.id;function ge(o,g){if(1&o){const e=t.RV6();t.j41(0,"li",9),t.bIt("click",function(){const i=l.eBV(e).$implicit,s=t.XpG(3);return l.Njj(s.handleSimpleRowClick(i))}),t.j41(1,"cue-typography",10),t.EFF(2),t.k0s(),t.j41(3,"cue-typography",11),t.EFF(4),t.k0s()()}if(2&o){const e=g.$implicit,n=t.XpG(3);t.AVh("active",n.selectedSimpleDocumentId()===e.id),t.R7$(),t.Y8G("noWrap",!0)("title",e.name),t.R7$(),t.SpI(" ",e.name," "),t.R7$(2),t.SpI(" ",(e.suffix||"").replace(".","").toUpperCase()," ")}}function me(o,g){if(1&o&&(t.j41(0,"ul",5),t.Z7z(1,ge,5,6,"li",8,he),t.k0s()),2&o){const e=t.XpG(2);t.R7$(),t.Dyx(e.simpleDocumentsInt())}}function pe(o,g){if(1&o&&(t.j41(0,"cue-flexcontainer",6)(1,"cue-typography",12),t.EFF(2),t.k0s()()),2&o){const e=t.XpG(2);t.R7$(2),t.SpI(" ",0===e.documentRefs().length&&0===e.documents().length&&e.handlers()?"No documents":e.infoLoading()," ")}}function fe(o,g){if(1&o){const e=t.RV6();t.j41(0,"cue-flexcontainer",7)(1,"cue-typography",13),t.EFF(2),t.k0s(),t.j41(3,"cue-flexcontainer",14)(4,"cue-button",15),t.bIt("click",function(){l.eBV(e);const i=t.XpG(2);return l.Njj(i.previousSimplePage())}),t.nrm(5,"cue-button-icon",16),t.k0s(),t.j41(6,"cue-button",15),t.bIt("click",function(){l.eBV(e);const i=t.XpG(2);return l.Njj(i.nextSimplePage())}),t.nrm(7,"cue-button-icon",17),t.k0s()()()}if(2&o){const e=t.XpG(2);t.R7$(2),t.E5c(" ",e.simpleDisplayStart(),"-",e.simpleDisplayEnd()," / ",e.documentsInt().length," "),t.R7$(2),t.Y8G("disabled",!e.simpleHasPreviousPage()),t.R7$(2),t.Y8G("disabled",!e.simpleHasNextPage())}}function ve(o,g){if(1&o&&(t.j41(0,"div",3),t.nVh(1,me,3,0,"ul",5)(2,pe,3,1,"cue-flexcontainer",6),t.nVh(3,fe,8,5,"cue-flexcontainer",7),t.k0s()),2&o){const e=t.XpG();t.R7$(),t.vxM(e.simpleDocumentsInt().length>0?1:2),t.R7$(2),t.vxM(e.documentsInt().length>0?3:-1)}}function _e(o,g){if(1&o&&t.nrm(0,"cue-svg-icon",34),2&o){const e=t.XpG().$implicit;t.Y8G("name",e.icon)}}function Ce(o,g){if(1&o){const e=t.RV6();t.j41(0,"cue-menu-item",33),t.bIt("click",function(){const i=l.eBV(e).$implicit;return l.Njj(null==i?null:i.action())}),t.nVh(1,_e,1,1,"cue-svg-icon",34),t.EFF(2),t.k0s()}if(2&o){const e=g.$implicit;t.R7$(),t.vxM(e.icon?1:-1),t.R7$(),t.SpI(" ",e.label)}}function be(o,g){if(1&o){const e=t.RV6();t.j41(0,"cue-flexcontainer",24)(1,"cue-menu",25)(2,"cue-button",26,2),t.nrm(4,"cue-button-icon",27),t.k0s(),t.j41(5,"cue-menu-wrap",28),t.Z7z(6,Ce,3,2,"cue-menu-item",null,t.Vm6),t.k0s()(),t.j41(8,"cue-button",29),t.nI1(9,"transloco"),t.bIt("click",function(){l.eBV(e);const i=t.XpG(2);return l.Njj(i.flipped.set(!0))}),t.nrm(10,"cue-button-icon",30),t.k0s()(),t.j41(11,"div",31)(12,"cue-ag-grid",32),t.bIt("gridApiReady",function(i){l.eBV(e);const s=t.XpG(2);return l.Njj(s.onGridReady(i))})("selectedRows",function(i){l.eBV(e);const s=t.XpG(2);return l.Njj(s.clickedDocument.emit(i[0]))}),t.k0s()()}if(2&o){const e=t.XpG(2);t.R7$(6),t.Dyx(e.tableMenu()),t.R7$(2),t.Y8G("cueTooltip",t.bMT(9,10,"components.documentList.tooltipColumnSettings")),t.R7$(4),t.AVh("hidden",e.tableHidden()),t.Y8G("paginationPageSize",e.pageSize())("size",e.size())("rowSelection",e.rowSelection)("rowData",e.documentsInt())("columnDefs",e.columnDefs())("overlaySettings",e.overlaySettings())("overlayActions",e.overlayActions())}}function De(o,g){if(1&o){const e=t.RV6();t.j41(0,"cue-flexcontainer",41),t.bIt("click",function(){l.eBV(e);const i=t.XpG(3);return l.Njj(i.applyTagFilter())}),t.j41(1,"cue-button",42)(2,"cue-button-label"),t.EFF(3,"Apply"),t.k0s()()()}}function we(o,g){if(1&o){const e=t.RV6();t.j41(0,"cue-flexcontainer",24)(1,"cue-button",35),t.bIt("click",function(){l.eBV(e);const i=t.XpG(2);return l.Njj(i.showFront())}),t.nrm(2,"cue-button-icon",36),t.k0s()(),t.j41(3,"cue-flexcontainer",37)(4,"cue-word-cloud",38),t.bIt("selectionChanged",function(i){l.eBV(e);const s=t.XpG(2);return l.Njj(s.tagSelection.set(i))}),t.k0s(),t.nVh(5,De,4,0,"cue-flexcontainer",39),t.k0s(),t.j41(6,"cue-ag-grid-column-select",40),t.mxI("columnDefsChange",function(i){l.eBV(e);const s=t.XpG(2);return t.DH7(s.columnDefs,i)||(s.columnDefs=i),l.Njj(i)}),t.k0s()}if(2&o){const e=t.XpG(2);t.R7$(3),t.AVh("hidden",!e.showTagFilterCloud()),t.R7$(),t.Y8G("words",e.tags())("clickable",!0)("overflow",!0)("multiSelect",!0)("highlightSelection",!0),t.R7$(),t.vxM(e.filterToBeApplied()?5:-1),t.R7$(),t.AVh("hidden",e.showTagFilterCloud()),t.Y8G("settings",e.columnSelectSettings),t.R50("columnDefs",e.columnDefs),t.Y8G("columnDefsGross",e.columnDefsGross())}}function xe(o,g){if(1&o&&(t.j41(0,"cue-card",20),t.eu8(1,43),t.k0s()),2&o){t.XpG();const e=t.sdS(3),n=t.XpG();t.Y8G("variant",n._cardVariant()),t.R7$(),t.Y8G("ngTemplateOutlet",e)}}function Me(o,g){if(1&o&&(t.j41(0,"div",21),t.eu8(1,43),t.k0s()),2&o){t.XpG();const e=t.sdS(3);t.R7$(),t.Y8G("ngTemplateOutlet",e)}}function ye(o,g){if(1&o&&(t.j41(0,"cue-card",22),t.eu8(1,43),t.k0s()),2&o){t.XpG();const e=t.sdS(5),n=t.XpG();t.Y8G("variant",n._cardVariant()),t.R7$(),t.Y8G("ngTemplateOutlet",e)}}function Se(o,g){if(1&o&&(t.j41(0,"div",23),t.eu8(1,43),t.k0s()),2&o){t.XpG();const e=t.sdS(5);t.R7$(),t.Y8G("ngTemplateOutlet",e)}}function Ie(o,g){if(1&o){const e=t.RV6();t.j41(0,"div",18),t.mxI("cueFlipChange",function(i){l.eBV(e);const s=t.XpG();return t.DH7(s.flipped,i)||(s.flipped=i),l.Njj(i)}),t.j41(1,"div",19),t.DNE(2,be,13,12,"ng-template",null,0,t.C5r)(4,we,7,13,"ng-template",null,1,t.C5r),t.nVh(6,xe,2,2,"cue-card",20)(7,Me,2,1,"div",21),t.nVh(8,ye,2,2,"cue-card",22)(9,Se,2,1,"div",23),t.k0s()()}if(2&o){const e=t.XpG();t.R50("cueFlip",e.flipped),t.R7$(6),t.vxM("none"!==e.variant()?6:7),t.R7$(2),t.vxM("none"!==e.variant()?8:9)}}let Oe=(()=>{class o{documents=(0,a.hFB)([]);availableContentCategories=(0,a.hFB)(void 0);detailedView=(0,a.hFB)(!1);simple=(0,a.hFB)(!1);pageSize=(0,a.hFB)(10);size=(0,a.hFB)("m");prefetchPages=(0,a.hFB)(3);privileges=(0,a.hFB)();showOpenInDocumentViewerAction=(0,a.hFB)(!0);showOpenInFileManagerAction=(0,a.hFB)(!0);customOverlayActions=(0,a.hFB)([]);variant=(0,a.hFB)("default");_cardVariant=(0,h.EW)(()=>this.variant());documentRefs=(0,a.hFB)([]);handlers=(0,a.hFB)(void 0);documentData=(0,a.hFB)({});clickedDocument=(0,a.CGW)();clickedDownloadDocument=(0,a.CGW)();clickedOpenInDir=(0,a.CGW)();clickedOpen=(0,a.CGW)();flipped=(0,l.vPA)(!1);simplePageIndex=(0,l.vPA)(0);selectedSimpleDocumentId=(0,l.vPA)(null);_simpleBufferedUntilIndex=(0,l.vPA)(0);_tableBufferedUntilIndex=(0,l.vPA)(0);_lastDocumentRefsKey="";_gridApi=null;_requestedIds=new Set;_isSorted=!1;_viewportCheckTimerId=null;_lazyMode=(0,h.EW)(()=>this.documentRefs().length>0);_leafContentCategoryIris=(0,h.EW)(()=>{const e=this.availableContentCategories();if(!e)return null;const n=new Set(e.map(i=>i.parent).filter(i=>!!i));return new Set(e.filter(i=>!n.has(i.iri)).map(i=>i.iri))});labelDownload=(0,D.Xx)("components.documentList.labelDownload");labelName=(0,D.Xx)("components.documentList.labelName");labelOpenInFileManager=(0,D.Xx)("components.documentList.labelOpenInFileManager");labelOpenInDocumentViewer=(0,D.Xx)("components.documentList.labelOpenInDocumentViewer");labelSubject=(0,D.Xx)("components.documentList.labelSubject");labelSummary=(0,D.Xx)("components.documentList.labelSummary");labelPages=(0,D.Xx)("components.documentList.labelPages");labelSize=(0,D.Xx)("components.documentList.labelSize");labelCategories=(0,D.Xx)("components.documentList.labelCategories");labelType=(0,D.Xx)("components.documentList.labelType");buttonShowCloudFilter=(0,D.Xx)("components.documentList.buttonShowCloudFilter");buttonHideCloudFilter=(0,D.Xx)("components.documentList.buttonHideCloudFilter");buttonDownloadCSV=(0,D.Xx)("components.documentList.buttonDownloadCSV");infoLoading=(0,D.Xx)("components.documentList.infoLoading");overlaySettings=(0,h.EW)(()=>({...new ie.K,mode:"row",buttonVariant:"accent"===this.variant()?"primary":"accent"}));overlayActions=(0,h.EW)(()=>{const e=[{label:this.labelDownload(),icon:"download",action:n=>{this.handlers()?.requestDownload?.(n.rowData),this.clickedDownloadDocument.emit(n.rowData)}}];return this.showOpenInDocumentViewerAction()&&e.push({label:this.labelOpenInDocumentViewer(),icon:"document",action:n=>{const i=n.rowData.contentIRI.split("/").pop()??n.rowData.contentIRI;this.handlers()?.requestOpen?.(i,n.rowData),this.clickedOpen.emit(n.rowData)}}),this.showOpenInFileManagerAction()&&e.push({label:this.labelOpenInFileManager(),icon:"folder",action:n=>{const i=n.rowData.contentIRI.split("/").pop()??n.rowData.contentIRI;this.handlers()?.requestOpenInDir?.(i,n.rowData),this.clickedOpenInDir.emit(n.rowData)}}),[...e,...this.customOverlayActions()||[]]});documentsInt=(0,h.EW)(()=>{let e;if(this._lazyMode()){const n=this.documentRefs(),i=this.documentData()||{};e=n.map(s=>{const c=i[s.id];return c?{...c,pages:s.pages??c.pages,...void 0!==s.sources?{sources:s.sources}:{},...void 0!==s.relevance?{relevance:s.relevance}:{},name:(0,F.M)(c.path),loading:!1}:{id:s.id,path:s.id,suffix:"",size:0,contentIRI:s.id,tags:[],summary:"",categories:[],relevance:s.relevance??0,pages:s.pages,sources:s.sources,name:this.infoLoading(),loading:!0}})}else e=(this.documents()||[]).map(n=>({...n,name:(0,F.M)(n.path),loading:!1}));return this.tagFilter().length?e.filter(n=>n.tags?.some(i=>this.tagFilter().some(s=>s.toLowerCase()===i.toLowerCase()))):e});simplePageCount=(0,h.EW)(()=>Math.max(1,Math.ceil(this.documentsInt().length/Math.max(1,this.pageSize()))));simpleStartIndex=(0,h.EW)(()=>this.simplePageIndex()*Math.max(1,this.pageSize()));simpleEndIndex=(0,h.EW)(()=>this.simpleStartIndex()+Math.max(1,this.pageSize()));simpleDocumentsInt=(0,h.EW)(()=>this.documentsInt().slice(this.simpleStartIndex(),this.simpleEndIndex()));simpleHasPreviousPage=(0,h.EW)(()=>this.simplePageIndex()>0);simpleHasNextPage=(0,h.EW)(()=>this.simplePageIndex()<this.simplePageCount()-1);simpleDisplayStart=(0,h.EW)(()=>this.documentsInt().length?this.simpleStartIndex()+1:0);simpleDisplayEnd=(0,h.EW)(()=>Math.min(this.simpleEndIndex(),this.documentsInt().length));tags=(0,h.EW)(()=>{const e=this.documentsInt(),n=[];return e.forEach(i=>{i.tags?.forEach(s=>n.push(s))}),n});showPageColumn=(0,h.EW)(()=>this.documentsInt().some(e=>void 0!==e.pages));hasSubjects=(0,h.EW)(()=>this.documentsInt().some(e=>void 0!==e.subject&&""!==e.subject));columnSelectSettings=new Q.e;columnDefs=(0,l.vPA)([]);columnDefsGross=(0,l.vPA)([]);tagSelection=(0,l.vPA)([]);tagFilter=(0,l.vPA)([]);showTagFilterCloud=(0,l.vPA)(!1);filterToBeApplied=(0,h.EW)(()=>{const e=this.tagSelection(),n=this.tagFilter();return JSON.stringify(e.sort())!==JSON.stringify(n.sort())});tableMenu=(0,h.EW)(()=>{const e=[];return this.showTagFilterCloud()?e.push({icon:"cloud-funnel",label:this.buttonHideCloudFilter(),variant:"accent",action:()=>{this.flipped.set(!1),this.showTagFilterCloud.set(!1)}}):e.push({icon:"cloud-funnel",label:this.buttonShowCloudFilter(),variant:"accent",action:()=>{this.flipped.set(!0),this.showTagFilterCloud.set(!0)}}),e.push({icon:"download",label:this.buttonDownloadCSV(),action:()=>function z(o,g,e="table.csv"){const n=function S(o,g){const e=function p(o,g){return o.map(e=>{const n={};return"id"in e&&(n.id=e.id),"key"in e&&(n.key=e.key),g.forEach(i=>{let s;"function"==typeof i.valueGetter?s=i.valueGetter({data:e,colDef:i,getValue:u=>e[u],node:void 0,column:void 0,api:void 0,context:void 0}):i.field&&(s=e[i.field]),"function"==typeof i.valueFormatter&&(s=i.valueFormatter({value:s,data:e,colDef:i,node:void 0,column:void 0,api:void 0,context:void 0}));const c=i.headerName||i.colId||i.field;void 0!==c&&(n[c]=s)}),n})}(o,g);if(0===e.length)return"";const n=e.some(c=>"id"in c),i=[];n&&i.push("id"),g.forEach(c=>{const u=c.headerName||c.colId||c.field;u&&"id"!==u&&!i.includes(u)&&i.push(u)});const s=e.map(c=>{const u={};return i.forEach(m=>{u[m]=c[m]}),u});return _().unparse(s,{columns:i})}(o,g);(0,I.YN)(n,e,"text/csv")}(this.documentsInt(),this.columnDefs())}),e});hideCloud(){this.flipped.set(!0),this.showTagFilterCloud.set(!0)}tableHidden=(0,h.EW)(()=>this.showTagFilterCloud()||this.flipped());rowSelection={mode:"singleRow",checkboxes:!1,enableClickSelection:!0};whenTableDataKnown=(0,l.QZP)(()=>{this.simple()||this._buildInitialColumnDefs(this.detailedView())});whenSimpleDataChanges=(0,l.QZP)(()=>{const e=this.documentsInt().length,n=Math.max(1,this.pageSize()),i=Math.max(0,Math.ceil(e/n)-1);this.simplePageIndex()>i&&this.simplePageIndex.set(i)});whenRefsChange=(0,l.QZP)(()=>{const n=this.documentRefs().map(i=>i.id).join("|");n!==this._lastDocumentRefsKey&&(this._lastDocumentRefsKey=n,this._requestedIds.clear(),this._simpleBufferedUntilIndex.set(0),this._tableBufferedUntilIndex.set(0),this.simplePageIndex.set(0))});whenSimpleLazyDataNeeded=(0,l.QZP)(()=>{if(!this.simple()||!this._lazyMode()||!this.handlers())return;const e=this.documentRefs();if(!e.length)return;const n=Math.max(1,this.pageSize()),s=n*Math.max(1,this.prefetchPages()),c=e.length,u=this.simpleStartIndex(),m=Math.min(c,u+n),r=this._simpleBufferedUntilIndex();let f=null;if(0===r?f=0:(u>=Math.max(0,r-n)||m>r)&&(f=r),null===f||f>=c)return;const b=Math.min(c,f+s),C=e.slice(f,b).map(v=>v.id).filter(v=>!this._requestedIds.has(v));this._simpleBufferedUntilIndex.set(Math.max(r,b)),C.length&&(C.forEach(v=>this._requestedIds.add(v)),setTimeout(()=>this.handlers()?.requestData(C)))});previousSimplePage(){this.simpleHasPreviousPage()&&this.simplePageIndex.update(e=>Math.max(0,e-1))}nextSimplePage(){this.simpleHasNextPage()&&this.simplePageIndex.update(e=>Math.min(this.simplePageCount()-1,e+1))}handleSimpleRowClick(e){this.selectedSimpleDocumentId.set(e.id),this.handleRowClick(e)}handleRowClick(e){var n=this;return(0,y.A)(function*(){n.clickedDocument.emit(e),window.cueDetachCellOverlay&&window.cueDetachCellOverlay(),n.overlayVisible&&"function"==typeof n.overlayVisible.set&&n.overlayVisible.set(!1)})()}showFront(){this.flipped.set(!1),this.showTagFilterCloud.set(!1)}applyTagFilter(){this.tagFilter.set(this.tagSelection()),this.flipped.set(!1),this.showTagFilterCloud.set(!1)}ngOnDestroy(){null!==this._viewportCheckTimerId&&(clearTimeout(this._viewportCheckTimerId),this._viewportCheckTimerId=null),this._gridApi=null}onGridReady(e){this._gridApi=e,e.addEventListener("viewportChanged",()=>this._checkViewport()),e.addEventListener("modelUpdated",()=>this._checkViewport()),e.addEventListener("paginationChanged",()=>this._checkViewport()),e.addEventListener("sortChanged",()=>{const n=e.getColumnState();this._isSorted=n.some(i=>null!=i.sort),this._isSorted&&this._requestAllUnloaded()}),this._viewportCheckTimerId=setTimeout(()=>{this._viewportCheckTimerId=null,this._checkViewport()},100)}_checkViewport(){if(!this._gridApi||this._gridApi.isDestroyed()||!this._lazyMode())return;if(this._isSorted)return void this._requestAllUnloaded();const e=this.documentRefs(),n=e.length;if(!n)return;const i=Math.max(1,this._gridApi.paginationGetPageSize?.()??10),c=Math.max(0,this._gridApi.paginationGetCurrentPage?.()??0)*i,u=Math.min(n,c+i),m=this._tableBufferedUntilIndex();let r=null;if(0===m?r=0:(c>=Math.max(0,m-i)||u>m)&&(r=m),null===r||r>=n)return;const f=i*Math.max(1,this.prefetchPages()),b=Math.min(n,r+f),C=e.slice(r,b).map(v=>v.id).filter(v=>!this._requestedIds.has(v));this._tableBufferedUntilIndex.set(Math.max(m,b)),C.length&&(C.forEach(v=>this._requestedIds.add(v)),setTimeout(()=>this.handlers()?.requestData(C)))}_requestAllUnloaded(){if(!this._gridApi||this._gridApi.isDestroyed()||!this._lazyMode())return;const e=[];if(this._gridApi.forEachNode(n=>{const i=n.data;i?.loading&&!this._requestedIds.has(i.contentIRI)&&e.push(i.contentIRI)}),e.length>0){const n=Array.from(new Set(e));n.forEach(i=>this._requestedIds.add(i)),setTimeout(()=>this.handlers()?.requestData(n))}}_buildInitialColumnDefs(e){const n=[],i=[];n.push({field:"name",headerName:this.labelName(),width:e?250:120,filter:!0,valueGetter:m=>!m.data?.name&&m.data?.loading?"Loading...":m.data?.name||m.data?.contentIRI}),this.hasSubjects()&&n.push({field:"subject",headerName:this.labelSubject(),flex:1,filter:!0,cellRenderer:R.l,cellRendererParams:{lineHeight:"1.8"},autoHeight:!0});const s={field:"summary",headerName:this.labelSummary(),flex:1,filter:!0,cellRenderer:R.l,cellRendererParams:{lineHeight:"1.8"},autoHeight:!0};this.detailedView()||(s.tooltipField="summary"),e?n.push(s):i.push(s),this.showPageColumn()&&n.push({field:"pages",headerName:this.labelPages(),width:100,filter:!0,valueGetter:m=>Array.isArray(m.data?.pages)?m.data.pages.map(r=>r.page).join(", "):""});const c={field:"size",headerName:this.labelSize(),width:100,filter:!0,valueGetter:m=>(0,oe.b)(m.data?.size||0)};e?n.push(c):i.push(c);const u={field:"categories",headerName:this.labelCategories(),width:120,filter:!0,valueGetter:m=>{const r=m.data?.categories||[],f=this._leafContentCategoryIris(),b=f?r.filter(v=>f.has(v)):r,C=b.slice(0,3).map(v=>this._getContentCategoryLabel(v)).join(", ");return b.length>3?`${C}...`:C}};e?n.push(u):i.push(u),n.push({field:"suffix",headerName:this.labelType(),width:80,filter:!0,headerClass:"header-align-right",cellStyle:{display:"flex",justifyContent:"flex-end"},cellRenderer:ee}),this.columnDefs.update(()=>[...n]),this.columnDefsGross.update(()=>[...n,...i])}_getContentCategoryLabel(e){const n=this.availableContentCategories();if(void 0!==n){const i=n.find(s=>s.iri===e);if(i)return i.label;console.warn(`No label found for content category IRI: ${e}`)}else console.warn("No availableContentCategories provided to DocumentList component");return(o=>{const g=o.split("#").pop()??o,e={AgreementDocument:"Agreement",ArchitecturalDesignDocument:"Architectural Design",AsBuiltDocument:"As-Built",BudgetEstimateDocument:"Budget Estimate",CertificationDocument:"Certification",ComplianceDocument:"Compliance",CorrespondenceDocument:"Correspondence",ConstructionContract:"Construction Contract",ConstructionProcessDocument:"Construction Process",ContractCondition:"Contract Condition",ContractRole:"Contract Role",ContractualDocument:"Contract",CostControlDocument:"Cost Control",DesignDocument:"Design Document",EmailAddress:"Email Address",EngineeringDesignDocument:"Engineering Design",FinancialAdministrativeDocument:"Financial/Administrative",FunctionalRequirementsDocument:"Functional Requirements",InspectionDocument:"Inspection",InsuranceBondDocument:"Insurance/Bond",InteriorDesignDocument:"Interior Design",MarketingCloseoutDocument:"Marketing Closeout",MiscDocument:"Miscellaneous",OperationManual:"Operation Manual",OperationsMaintenanceDocument:"Operations & Maintenance",OperationsManualDocument:"Operations Manual",OtherDocument:"Other",OtherContent:"Other Content",ProgressStatusReport:"Progress Status Report",QualityAssuranceDocument:"Quality Assurance",QualityControlDocument:"Quality Control",RegulatoryComplianceDocument:"Regulatory Compliance",SafetyDocument:"Safety",ScheduleDocument:"Schedule",SiteAssessmentDocument:"Site Assessment",TechnicalRequirementsDocument:"Technical Requirements",TechnicalSpecificationDocument:"Technical Specification",TenderingDocument:"Tendering Document",TermsAndConditionsDocument:"Terms & Conditions"};return void 0===e[g]&&console.log(`No pretty label for category: ${g}`),e[g]??g})(e)}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=t.VBU({type:o,selectors:[["cue-doc-list"]],inputs:{documents:[1,"documents"],availableContentCategories:[1,"availableContentCategories"],detailedView:[1,"detailedView"],simple:[1,"simple"],pageSize:[1,"pageSize"],size:[1,"size"],prefetchPages:[1,"prefetchPages"],privileges:[1,"privileges"],showOpenInDocumentViewerAction:[1,"showOpenInDocumentViewerAction"],showOpenInFileManagerAction:[1,"showOpenInFileManagerAction"],customOverlayActions:[1,"customOverlayActions"],variant:[1,"variant"],documentRefs:[1,"documentRefs"],handlers:[1,"handlers"],documentData:[1,"documentData"]},outputs:{clickedDocument:"clickedDocument",clickedDownloadDocument:"clickedDownloadDocument",clickedOpenInDir:"clickedOpenInDir",clickedOpen:"clickedOpen"},decls:2,vars:1,consts:[["frontContent",""],["backContent",""],["trigger",""],[1,"simple-container",2,"width","100%","height","auto"],[1,"flip-card",2,"width","100%","height","auto","overflow","hidden",3,"cueFlip"],[1,"simple-list"],["justify","center",1,"simple-empty"],["direction","row","justify","space-between","align","center",2,"padding","4px 8px"],[1,"simple-item",3,"active"],[1,"simple-item",3,"click"],["size","s",1,"simple-item-name",3,"noWrap","title"],["size","xs",1,"simple-item-meta"],["size","s"],["size","xs"],["direction","row","gap","s"],["size","xs","variant","tertiary",3,"click","disabled"],["icon","paginator-back"],["icon","paginator-next"],[1,"flip-card",2,"width","100%","height","auto","overflow","hidden",3,"cueFlipChange","cueFlip"],[1,"flip-content"],[1,"card-face","front",2,"width","100%","height","auto",3,"variant"],[1,"card-face","front",2,"width","100%","height","auto"],[1,"card-face","back",2,"width","100%","height","auto",3,"variant"],[1,"card-face","back",2,"width","100%","height","auto"],["direction","row","justify","end",2,"padding","2px"],["positioning","bottomleft"],["trigger","","variant","tertiary","size","s"],["icon","more-vert"],["menu",""],["variant","accent","size","s",3,"click","cueTooltip"],["icon","settings"],[2,"position","relative"],[3,"gridApiReady","selectedRows","paginationPageSize","size","rowSelection","rowData","columnDefs","overlaySettings","overlayActions"],[3,"click"],["before","",3,"name"],["variant","accent","size","s","cueTooltip","Back to table",3,"click"],["icon","arrow-back"],["justify","center",2,"height","350px"],[2,"height","100%","width","100%",3,"selectionChanged","words","clickable","overflow","multiSelect","highlightSelection"],["justify","center",1,"word-cloud-actions"],[3,"columnDefsChange","settings","columnDefs","columnDefsGross"],["justify","center",1,"word-cloud-actions",3,"click"],["variant","primary"],[3,"ngTemplateOutlet"]],template:function(n,i){1&n&&t.nVh(0,ve,4,2,"div",3)(1,Ie,10,3,"div",4),2&n&&t.vxM(i.simple()?0:1)},dependencies:[se.n,L,G.$,V.L,de.R,le.Card,ae.T3,$.a,U.R,Y.pL,ce.M,re.D,te.W,ne.A,ue.d,T.Typography,D.Kj],styles:[".hidden[_ngcontent-%COMP%]{display:none}.word-cloud-actions[_ngcontent-%COMP%]{position:absolute;z-index:10;right:0;left:0;bottom:10px;pointer-events:none}.word-cloud-actions[_ngcontent-%COMP%] cue-button[_ngcontent-%COMP%]{pointer-events:auto}.simple-container[_ngcontent-%COMP%]{width:100%}.simple-list[_ngcontent-%COMP%]{list-style:none;margin:0;padding:4px;max-height:420px;overflow-y:auto}.simple-item[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px;padding:9px 10px;border-radius:6px;cursor:pointer;transition:background .1s}.simple-item[_ngcontent-%COMP%]:hover{background:var(--cue-color-ultralightgray)}.simple-item.active[_ngcontent-%COMP%]{background:var(--cue-color-lightgray)}.simple-item-name[_ngcontent-%COMP%]{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.simple-item-meta[_ngcontent-%COMP%]{font-size:11px;color:var(--cue-color-midgray)}.simple-empty[_ngcontent-%COMP%]{padding:12px}"],changeDetection:0})}return o})()},4372(O,M,d){d.d(M,{M:()=>y});const y=a=>{const h=a.split("/");return h[h.length-1]}},2065(O,M,d){function h(w,_,p="text/plain"){return function y(w,_="data.zip"){const p=document.createElement("a"),S=URL.createObjectURL(w);p.href=S,p.download=_,document.body.appendChild(p),p.click(),document.body.removeChild(p),URL.revokeObjectURL(S)}(new Blob([w],{type:p}),_)}function l(w,_){const p=document.createElement("a");p.style.display="hidden",p.setAttribute("href",window.URL.createObjectURL(w)),p.setAttribute("download",_),document.body.appendChild(p),p.click(),p.remove()}d.d(M,{KE:()=>l,YN:()=>h})},1493(O,M,d){function y(a,h=!1,l=1){const I=h?1e3:1024;if(Math.abs(a)<I)return a+" B";const w=h?["kB","MB","GB","TB","PB","EB","ZB","YB"]:["KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"];let _=-1;const p=10**l;do{a/=I,++_}while(Math.round(Math.abs(a)*p)/p>=I&&_<w.length-1);return a.toFixed(l)+" "+w[_]}d.d(M,{b:()=>y})}}]);
package/5041.js DELETED
@@ -1 +0,0 @@
1
- (self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[5041,9695],{5448(A,B,g){"use strict";g.d(B,{L:()=>D});var h=g(7705),O=g(2245),a=g(5547);const e=["*"];let D=(()=>{class b{fontSize=(0,h.hFB)("m");italic=(0,h.hFB)(!1);noWrap=(0,h.hFB)(!0);static \u0275fac=function($){return new($||b)};static \u0275cmp=a.VBU({type:b,selectors:[["cue-button-label"]],inputs:{fontSize:[1,"fontSize"],italic:[1,"italic"],noWrap:[1,"noWrap"]},ngContentSelectors:e,decls:3,vars:3,consts:[[3,"size","italic","noWrap"]],template:function($,f){1&$&&(a.NAR(),a.j41(0,"div")(1,"cue-typography",0),a.SdG(2),a.k0s()()),2&$&&(a.R7$(),a.Y8G("size",f.fontSize())("italic",f.italic())("noWrap",f.noWrap()))},dependencies:[O.Typography],styles:["div[_ngcontent-%COMP%]{transform:translateY(.05em)}"]})}return b})()},9695(A,B,g){"use strict";g.d(B,{Switch:()=>b});var h=g(7705),O=g(29),a=g(5547);function e(w,C){if(1&w&&a.nrm(0,"cue-svg-icon",2),2&w){const $=a.XpG();a.Y8G("name",$.iconChecked())}}function D(w,C){if(1&w&&a.nrm(0,"cue-svg-icon",2),2&w){const $=a.XpG();a.Y8G("name",$.icon())}}let b=(()=>{class w{size=(0,h.hFB)("m");icon=(0,h.hFB)(void 0);iconChecked=(0,h.hFB)(void 0);disabled=(0,h.hFB)(!1);checked=(0,h.geq)(!1);toggleChange=(0,h.CGW)();toggle(){this.checked.set(!this.checked()),this.toggleChange.emit(this.checked())}static \u0275fac=function(f){return new(f||w)};static \u0275cmp=a.VBU({type:w,selectors:[["cue-input-switch"]],hostVars:5,hostBindings:function(f,v){2&f&&(a.BMQ("size",v.size()),a.AVh("checked",v.checked())("disabled",v.disabled()))},inputs:{size:[1,"size"],icon:[1,"icon"],iconChecked:[1,"iconChecked"],disabled:[1,"disabled"],checked:[1,"checked"]},outputs:{checked:"checkedChange",toggleChange:"toggleChange"},decls:4,vars:3,consts:[["type","checkbox",3,"click","checked","disabled"],[1,"indicator"],[3,"name"]],template:function(f,v){1&f&&(a.j41(0,"input",0),a.bIt("click",function(){return v.toggle()}),a.k0s(),a.j41(1,"div",1),a.nVh(2,e,1,1,"cue-svg-icon",2)(3,D,1,1,"cue-svg-icon",2),a.k0s()),2&f&&(a.Y8G("checked",v.checked())("disabled",v.disabled()),a.R7$(2),a.vxM(v.checked()&&v.iconChecked()?2:v.icon()?3:-1))},dependencies:[O.A],styles:["[_nghost-%COMP%]{--cue-input-switch-height: 18px;--cue-input-switch-width: calc(var(--cue-input-switch-height) * 1.7);--cue-input-switch-inset: 2px;--cue-input-switch-indicator-width: calc( var(--cue-input-switch-height) - (2 * var(--cue-input-switch-inset)) );--cue-input-switch-icon-width: calc( var(--cue-input-switch-indicator-width) - (2 * var(--cue-input-switch-inset)) );display:block;flex-shrink:0;position:relative;height:var(--cue-input-switch-height);width:var(--cue-input-switch-width);border-radius:var(--cue-input-switch-height);--cue-icon-width: var(--cue-input-switch-icon-width);background:var(--cue-input-switch-background);transition:background-color .4s ease}[size=xs][_nghost-%COMP%]{--cue-input-switch-height: 12px;--cue-input-switch-inset: 1px}[size=s][_nghost-%COMP%]{--cue-input-switch-height: 14px;--cue-input-switch-inset: 1px}[size=m][_nghost-%COMP%]{--cue-input-switch-height: 18px;--cue-input-switch-inset: 2px}[size=l][_nghost-%COMP%]{--cue-input-switch-height: 22px;--cue-input-switch-inset: 3px}[size=xl][_nghost-%COMP%]{--cue-input-switch-height: 28px;--cue-input-switch-inset: 3px}@container cue-container (width < 20em){[_nghost-%COMP%]{--cue-input-switch-height: 16px}[size=xs][_nghost-%COMP%]{--cue-input-switch-height: 10px}[size=s][_nghost-%COMP%]{--cue-input-switch-height: 12px}[size=m][_nghost-%COMP%]{--cue-input-switch-height: 16px}[size=l][_nghost-%COMP%]{--cue-input-switch-height: 18px}[size=xl][_nghost-%COMP%]{--cue-input-switch-height: 20px}}.checked[_nghost-%COMP%]{background:var(--cue-input-switch-checked-background)}.disabled[_nghost-%COMP%]{background:var(--cue-input-switch-disabled-background);cursor:default}[_nghost-%COMP%] .indicator[_ngcontent-%COMP%]{pointer-events:none;position:absolute;left:var(--cue-input-switch-inset);top:var(--cue-input-switch-inset);width:var(--cue-input-switch-indicator-width);aspect-ratio:1;border-radius:50%;display:flex;align-items:center;justify-content:center;background-color:var(--cue-input-switch-indicator-background);color:var(--cue-input-switch-indicator-foreground);transition:left .4s ease,background-color .4s ease,color .4s ease}.checked[_nghost-%COMP%] .indicator[_ngcontent-%COMP%]{left:calc(var(--cue-input-switch-width) - var(--cue-input-switch-inset) - var( --cue-input-switch-indicator-width ));background:var(--cue-input-switch-checked-indicator-background);color:var(--cue-input-switch-checked-indicator-foreground)}.disabled[_nghost-%COMP%] .indicator[_ngcontent-%COMP%]{background:var(--cue-input-switch-disabled-indicator-background);color:var(--cue-input-switch-disabled-indicator-foreground)}input[_ngcontent-%COMP%]{all:unset;position:absolute;inset:0;cursor:pointer;border-radius:var(--cue-input-switch-height)}input[_ngcontent-%COMP%]:focus-visible:not(:disabled) + .indicator[_ngcontent-%COMP%]{outline:1px solid var(--cue-input-switch-focus-color);outline-offset:2px}"]})}return w})()},5745(A,B,g){"use strict";g.d(B,{a:()=>I});var h=g(7705),O=g(5802),a=g(2271),e=g(5547);const D=["dialog"],b=["*",[["","modal-footer",""]]],w=["*","[modal-footer]"];function C(_,L){if(1&_&&(e.rj2(0,"h2",7),e.EFF(1),e.eux()),2&_){const u=e.XpG(3);e.R7$(),e.JRh(u.effectiveTitle())}}function $(_,L){if(1&_&&(e.rj2(0,"p",8),e.EFF(1),e.eux()),2&_){const u=e.XpG(3);e.R7$(),e.JRh(u.subtitle())}}function f(_,L){if(1&_){const u=e.RV6();e.rj2(0,"button",10),e.VwU("click",function(){O.eBV(u);const y=e.XpG(3);return O.Njj(y.onClose())}),O.qSk(),e.rj2(1,"svg",11),e.Hgh(2,"path",12),e.eux()()}}function v(_,L){if(1&_&&(e.rj2(0,"div",4)(1,"div",6),e.nVh(2,C,2,1,"h2",7),e.nVh(3,$,2,1,"p",8),e.eux(),e.nVh(4,f,3,0,"button",9),e.eux()),2&_){const u=e.XpG(2);e.R7$(2),e.vxM(u.effectiveTitle()?2:-1),e.R7$(),e.vxM(u.subtitle()?3:-1),e.R7$(),e.vxM(u.displayCloseBtn()?4:-1)}}function N(_,L){if(1&_&&(e.rj2(0,"div",3),e.VwU("click",function(P){return P.stopPropagation()}),e.nVh(1,v,5,3,"div",4),e.rj2(2,"div",5),e.SdG(3),e.eux(),e.SdG(4,1),e.eux()),2&_){const u=e.XpG();e.xc7("min-width",u.minWidth()),e.AVh("has-header",u.effectiveTitle()||u.displayCloseBtn()),e.R7$(),e.vxM(u.effectiveTitle()||u.displayCloseBtn()?1:-1)}}let I=(()=>{class _{visible=(0,h.geq)(!0);closeOnBackgroundClick=(0,h.hFB)(!0);displayCloseBtn=(0,h.hFB)(!0);label=(0,h.hFB)("");title=(0,h.hFB)("");subtitle=(0,h.hFB)("");minWidth=(0,h.hFB)();close=(0,h.CGW)();dialogRef=h.ebz.required("dialog");effectiveTitle=(0,a.EW)(()=>this.title()||this.label());constructor(){(0,O.QZP)(()=>{const u=this.dialogRef().nativeElement;this.visible()?u.open||u.showModal():u.open&&u.close()})}onBackdropClick(){this.closeOnBackgroundClick()&&this.onClose()}onClose(){this.visible.set(!1),this.close.emit()}static \u0275fac=function(P){return new(P||_)};static \u0275cmp=e.VBU({type:_,selectors:[["cue-modal"]],viewQuery:function(P,y){1&P&&e.wEZ(y.dialogRef,D,5),2&P&&e.NyB()},inputs:{visible:[1,"visible"],closeOnBackgroundClick:[1,"closeOnBackgroundClick"],displayCloseBtn:[1,"displayCloseBtn"],label:[1,"label"],title:[1,"title"],subtitle:[1,"subtitle"],minWidth:[1,"minWidth"]},outputs:{visible:"visibleChange",close:"close"},ngContentSelectors:w,decls:3,vars:1,consts:[["dialog",""],[1,"modal-dialog",3,"cancel","click"],[1,"panel",3,"has-header","minWidth"],[1,"panel",3,"click"],[1,"header"],[1,"body"],[1,"header-text"],[1,"modal-title"],[1,"modal-subtitle"],["type","button","aria-label","Close",1,"close-btn"],["type","button","aria-label","Close",1,"close-btn",3,"click"],["viewBox","0 0 256 256","xmlns","http://www.w3.org/2000/svg"],["fill","currentColor","d","M205.66 194.34a8 8 0 0 1-11.32 11.32L128 139.31l-66.34 66.35a8 8 0 0 1-11.32-11.32L116.69 128L61.34 72.66a8 8 0 0 1 11.32-11.32L128 116.69l66.34-66.35a8 8 0 0 1 11.32 11.32L139.31 128Z"]],template:function(P,y){1&P&&(e.NAR(b),e.rj2(0,"dialog",1,0),e.VwU("cancel",function(){return y.onClose()})("click",function(){return y.onBackdropClick()}),e.nVh(2,N,5,5,"div",2),e.eux()),2&P&&(e.R7$(2),e.vxM(y.visible()?2:-1))},styles:[".modal-dialog[_ngcontent-%COMP%]{padding:0;border:none;background:transparent;overflow:visible;margin:auto;outline:none;max-width:min(calc(100vw - 32px),80vw)}.modal-dialog[_ngcontent-%COMP%]::backdrop{background-color:var(--cue-modal-overlay-color, rgba(14, 24, 39, .55));-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}.panel[_ngcontent-%COMP%]{background:var(--cue-default);color:var(--cue-defaultContrast);border-radius:24px;border:1px solid var(--cue-border-color);box-shadow:0 12px 48px #00000047;max-height:88vh;overflow-y:auto;overflow-x:hidden;box-sizing:border-box;scrollbar-width:thin}.header[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:12px;padding:26px 26px 0;margin-bottom:20px}.header-text[_ngcontent-%COMP%]{flex:1}.modal-title[_ngcontent-%COMP%]{margin:0;font-size:20px;font-weight:700;letter-spacing:-.01em;font-family:var(--cue-font-family);color:var(--cue-defaultContrast)}.modal-subtitle[_ngcontent-%COMP%]{margin:5px 0 0;font-size:13px;color:var(--cue-color-midgray);letter-spacing:.02em;line-height:1.5}.close-btn[_ngcontent-%COMP%]{flex:none;width:34px;height:34px;border-radius:50%;border:none;background:transparent;cursor:pointer;display:flex;align-items:center;justify-content:center;color:var(--cue-color-midgray);padding:0;margin-top:-4px;transition:background .15s,color .15s}.close-btn[_ngcontent-%COMP%]:hover{background:var(--cue-main-background);color:var(--cue-main-foreground)}.close-btn[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{width:18px;height:18px;display:block}.body[_ngcontent-%COMP%]{padding:26px}.has-header[_ngcontent-%COMP%] .body[_ngcontent-%COMP%]{padding-top:0}"]})}return _})()},7374(A){A.exports=function(){"use strict";var g=6e4,h=36e5,O="millisecond",a="second",e="minute",D="hour",b="day",w="week",C="month",$="quarter",f="year",v="date",N="Invalid Date",I=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,_=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,L={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(c){var i=["th","st","nd","rd"],t=c%100;return"["+c+(i[(t-20)%10]||i[t]||i[0])+"]"}},u=function(c,i,t){var o=String(c);return!o||o.length>=i?c:""+Array(i+1-o.length).join(t)+c},P={s:u,z:function(c){var i=-c.utcOffset(),t=Math.abs(i),o=Math.floor(t/60),n=t%60;return(i<=0?"+":"-")+u(o,2,"0")+":"+u(n,2,"0")},m:function c(i,t){if(i.date()<t.date())return-c(t,i);var o=12*(t.year()-i.year())+(t.month()-i.month()),n=i.clone().add(o,C),s=t-n<0,r=i.clone().add(o+(s?-1:1),C);return+(-(o+(t-n)/(s?n-r:r-n))||0)},a:function(c){return c<0?Math.ceil(c)||0:Math.floor(c)},p:function(c){return{M:C,y:f,w,d:b,D:v,h:D,m:e,s:a,ms:O,Q:$}[c]||String(c||"").toLowerCase().replace(/s$/,"")},u:function(c){return void 0===c}},y="en",T={};T[y]=L;var H="$isDayjsObject",G=function(c){return c instanceof j||!(!c||!c[H])},U=function c(i,t,o){var n;if(!i)return y;if("string"==typeof i){var s=i.toLowerCase();T[s]&&(n=s),t&&(T[s]=t,n=s);var r=i.split("-");if(!n&&r.length>1)return c(r[0])}else{var d=i.name;T[d]=i,n=d}return!o&&n&&(y=n),n||!o&&y},M=function(c,i){if(G(c))return c.clone();var t="object"==typeof i?i:{};return t.date=c,t.args=arguments,new j(t)},l=P;l.l=U,l.i=G,l.w=function(c,i){return M(c,{locale:i.$L,utc:i.$u,x:i.$x,$offset:i.$offset})};var j=function(){function c(t){this.$L=U(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[H]=!0}var i=c.prototype;return i.parse=function(t){this.$d=function(o){var n=o.date,s=o.utc;if(null===n)return new Date(NaN);if(l.u(n))return new Date;if(n instanceof Date)return new Date(n);if("string"==typeof n&&!/Z$/i.test(n)){var r=n.match(I);if(r){var d=r[2]-1||0,p=(r[7]||"0").substring(0,3);return s?new Date(Date.UTC(r[1],d,r[3]||1,r[4]||0,r[5]||0,r[6]||0,p)):new Date(r[1],d,r[3]||1,r[4]||0,r[5]||0,r[6]||0,p)}}return new Date(n)}(t),this.init()},i.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},i.$utils=function(){return l},i.isValid=function(){return this.$d.toString()!==N},i.isSame=function(t,o){var n=M(t);return this.startOf(o)<=n&&n<=this.endOf(o)},i.isAfter=function(t,o){return M(t)<this.startOf(o)},i.isBefore=function(t,o){return this.endOf(o)<M(t)},i.$g=function(t,o,n){return l.u(t)?this[o]:this.set(n,t)},i.unix=function(){return Math.floor(this.valueOf()/1e3)},i.valueOf=function(){return this.$d.getTime()},i.startOf=function(t,o){var n=this,s=!!l.u(o)||o,r=l.p(t),d=function(z,x){var E=l.w(n.$u?Date.UTC(n.$y,x,z):new Date(n.$y,x,z),n);return s?E:E.endOf(b)},p=function(z,x){return l.w(n.toDate()[z].apply(n.toDate("s"),(s?[0,0,0,0]:[23,59,59,999]).slice(x)),n)},m=this.$W,k=this.$M,S=this.$D,R="set"+(this.$u?"UTC":"");switch(r){case f:return s?d(1,0):d(31,11);case C:return s?d(1,k):d(0,k+1);case w:var W=this.$locale().weekStart||0,F=(m<W?m+7:m)-W;return d(s?S-F:S+(6-F),k);case b:case v:return p(R+"Hours",0);case D:return p(R+"Minutes",1);case e:return p(R+"Seconds",2);case a:return p(R+"Milliseconds",3);default:return this.clone()}},i.endOf=function(t){return this.startOf(t,!1)},i.$set=function(t,o){var n,s=l.p(t),r="set"+(this.$u?"UTC":""),d=(n={},n[b]=r+"Date",n[v]=r+"Date",n[C]=r+"Month",n[f]=r+"FullYear",n[D]=r+"Hours",n[e]=r+"Minutes",n[a]=r+"Seconds",n[O]=r+"Milliseconds",n)[s],p=s===b?this.$D+(o-this.$W):o;if(s===C||s===f){var m=this.clone().set(v,1);m.$d[d](p),m.init(),this.$d=m.set(v,Math.min(this.$D,m.daysInMonth())).$d}else d&&this.$d[d](p);return this.init(),this},i.set=function(t,o){return this.clone().$set(t,o)},i.get=function(t){return this[l.p(t)]()},i.add=function(t,o){var n,s=this;t=Number(t);var r=l.p(o),d=function(k){var S=M(s);return l.w(S.date(S.date()+Math.round(k*t)),s)};if(r===C)return this.set(C,this.$M+t);if(r===f)return this.set(f,this.$y+t);if(r===b)return d(1);if(r===w)return d(7);var p=(n={},n[e]=g,n[D]=h,n[a]=1e3,n)[r]||1,m=this.$d.getTime()+t*p;return l.w(m,this)},i.subtract=function(t,o){return this.add(-1*t,o)},i.format=function(t){var o=this,n=this.$locale();if(!this.isValid())return n.invalidDate||N;var s=t||"YYYY-MM-DDTHH:mm:ssZ",r=l.z(this),d=this.$H,p=this.$m,m=this.$M,k=n.weekdays,S=n.months,W=function(x,E,Y,V){return x&&(x[E]||x(o,s))||Y[E].slice(0,V)},F=function(x){return l.s(d%12||12,x,"0")},z=n.meridiem||function(x,E,Y){var V=x<12?"AM":"PM";return Y?V.toLowerCase():V};return s.replace(_,function(x,E){return E||function(Y){switch(Y){case"YY":return String(o.$y).slice(-2);case"YYYY":return l.s(o.$y,4,"0");case"M":return m+1;case"MM":return l.s(m+1,2,"0");case"MMM":return W(n.monthsShort,m,S,3);case"MMMM":return W(S,m);case"D":return o.$D;case"DD":return l.s(o.$D,2,"0");case"d":return String(o.$W);case"dd":return W(n.weekdaysMin,o.$W,k,2);case"ddd":return W(n.weekdaysShort,o.$W,k,3);case"dddd":return k[o.$W];case"H":return String(d);case"HH":return l.s(d,2,"0");case"h":return F(1);case"hh":return F(2);case"a":return z(d,p,!0);case"A":return z(d,p,!1);case"m":return String(p);case"mm":return l.s(p,2,"0");case"s":return String(o.$s);case"ss":return l.s(o.$s,2,"0");case"SSS":return l.s(o.$ms,3,"0");case"Z":return r}return null}(x)||r.replace(":","")})},i.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},i.diff=function(t,o,n){var s,r=this,d=l.p(o),p=M(t),m=(p.utcOffset()-this.utcOffset())*g,k=this-p,S=function(){return l.m(r,p)};switch(d){case f:s=S()/12;break;case C:s=S();break;case $:s=S()/3;break;case w:s=(k-m)/6048e5;break;case b:s=(k-m)/864e5;break;case D:s=k/h;break;case e:s=k/g;break;case a:s=k/1e3;break;default:s=k}return n?s:l.a(s)},i.daysInMonth=function(){return this.endOf(C).$D},i.$locale=function(){return T[this.$L]},i.locale=function(t,o){if(!t)return this.$L;var n=this.clone(),s=U(t,o,!0);return s&&(n.$L=s),n},i.clone=function(){return l.w(this.$d,this)},i.toDate=function(){return new Date(this.valueOf())},i.toJSON=function(){return this.isValid()?this.toISOString():null},i.toISOString=function(){return this.$d.toISOString()},i.toString=function(){return this.$d.toUTCString()},c}(),K=j.prototype;return M.prototype=K,[["$ms",O],["$s",a],["$m",e],["$H",D],["$W",b],["$M",C],["$y",f],["$D",v]].forEach(function(c){K[c[1]]=function(i){return this.$g(i,c[0],c[1])}}),M.extend=function(c,i){return c.$i||(c(i,j,M),c.$i=!0),M},M.locale=U,M.isDayjs=G,M.unix=function(c){return M(1e3*c)},M.en=T[y],M.Ls=T,M.p={},M}()}}]);
package/5071.js DELETED
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[5071],{2014(W,k,f){f.d(k,{z:()=>T});var g=f(7705),s=f(2271),_=f(5547);const q=["*"];let T=(()=>{class N{justify=(0,g.hFB)("start");size=(0,g.hFB)("l");widthStyle=(0,s.EW)(()=>`var(--cue-button-label-padding-${this.size()}-x)`);static \u0275fac=function(w){return new(w||N)};static \u0275cmp=_.VBU({type:N,selectors:[["cue-button-padder"]],inputs:{justify:[1,"justify"],size:[1,"size"]},ngContentSelectors:q,decls:2,vars:4,template:function(w,F){1&w&&(_.NAR(),_.rj2(0,"div"),_.SdG(1),_.eux()),2&w&&_.xc7("justify-content",F.justify())("min-width",F.widthStyle())},styles:["div[_ngcontent-%COMP%]{display:flex;align-items:center;min-height:1px}"]})}return N})()},7293(W,k,f){f.d(k,{x:()=>w});var g=f(7705),s=f(5802),_=f(2271),q=f(4613),T=f(9352),N=f(7089),S=f(5547);function E(F,Y){1&F&&S.nrm(0,"cue-logo",4)}let w=(()=>{class F{projectId=(0,g.hFB)(void 0);resourceId=(0,g.hFB)(void 0);_active=(0,s.vPA)(!0);onHover(){this._active.set(!1),requestAnimationFrame(()=>this._active.set(!0))}_title=(0,_.EW)(()=>this.projectId()&&this.resourceId()?"components.logoLink.showResourceInCue":this.projectId()?"components.logoLink.openProjectInCue":"components.logoLink.openCuePortal");_href=(0,_.EW)(()=>{const j=this.projectId(),A=this.resourceId();return j&&A?`https://cue.qaecy.com/r/${encodeURIComponent(j)}/${encodeURIComponent(A)}`:j?`https://cue.qaecy.com/home/projects?p=${encodeURIComponent(j)}`:"https://cue.qaecy.com/home/projects"});static \u0275fac=function(A){return new(A||F)};static \u0275cmp=S.VBU({type:F,selectors:[["cue-logo-link"]],inputs:{projectId:[1,"projectId"],resourceId:[1,"resourceId"]},decls:6,vars:5,consts:[["target","_blank","rel","noopener noreferrer",1,"link",3,"mouseenter","href"],[1,"logo-stack",3,"cueTooltip"],["size","xs",1,"logo-bg"],[1,"logo-fg"],["size","xs"]],template:function(A,G){1&A&&(S.j41(0,"a",0),S.bIt("mouseenter",function(){return G.onHover()}),S.j41(1,"div",1),S.nI1(2,"transloco"),S.nrm(3,"cue-logo",2),S.j41(4,"div",3),S.nVh(5,E,1,0,"cue-logo",4),S.k0s()()()),2&A&&(S.Y8G("href",G._href(),S.B4B),S.R7$(),S.Y8G("cueTooltip",S.bMT(2,3,G._title())),S.R7$(4),S.vxM(G._active()?5:-1))},dependencies:[q.Logo,N.d,T.Kj],styles:["[_nghost-%COMP%]{display:inline-block;line-height:0}.link[_ngcontent-%COMP%]{display:block;text-decoration:none;cursor:pointer}.logo-stack[_ngcontent-%COMP%]{position:relative;display:inline-block;line-height:0}.logo-bg[_ngcontent-%COMP%]{display:block;opacity:.3;transition:opacity .2s ease}.link[_ngcontent-%COMP%]:hover .logo-bg[_ngcontent-%COMP%]{opacity:.15}.logo-fg[_ngcontent-%COMP%]{position:absolute;inset:0;opacity:0;transition:opacity .15s ease}.link[_ngcontent-%COMP%]:hover .logo-fg[_ngcontent-%COMP%]{opacity:1}"],changeDetection:0})}return F})()},5071(W,k,f){f.d(k,{CueSparqlTable:()=>en});var g=f(7705),s=f(5802),_=f(2271),q=f(3537),T=f(467),N=f(7374),S=f.n(N),E=f(7400);function w(i,d,t=""){const a=d.valueKey??"val",n=d.priorityKey,o=d.fallback??t,l=d.preProcess?i.map(p=>{const c=p[a];return null==c?p:{...p,[a]:(0,E.w9)(d.preProcess,c)}}):i,r=(n?[...l].sort((p,c)=>{const m=p[n],h=c[n],y=Number(m),C=Number(h);return isNaN(y)||isNaN(C)?(h??"").localeCompare(m??""):C-y}):l).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,m)=>c+m,0)):t}case"avg":{const p=r.map(Number).filter(c=>!isNaN(c));return p.length?String(p.reduce((c,m)=>c+m,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,m)=>S()(m).valueOf()-S()(c).valueOf())[0];case"oldest":return[...r].sort((c,m)=>S()(c).valueOf()-S()(m).valueOf())[0];case"map":{const{map:p}=d;return p[r[0]]??o}}}const Y=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"}),j=["first","last","random","join","count"],A={text:[...j,"longest","shortest","map"],number:[...j,"sum","avg","min","max"],date:[...j,"mostRecent","oldest"]},G={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"},se={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 U=f(7573);const H=`PREFIX qcy: <${U.E.qcy}>\nPREFIX qcy-e: <${U.E["qcy-e"]}>\n\nSELECT ?subject\nWHERE {\n ?subject a qcy:CanonicalEntity ;\n qcy:hasEntityCategory qcy-e:Person .\n}`;class re{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=>w(t,d,"")}return d=>Array.isArray(d)?d.map(t=>t?.val??"").filter(Boolean).join(", "):String(d??"")}}var Ce=f(4284);class Se{menuDisplaySettings=new Me;columnSelectSettings=new Re}class Me{hide=!0;buttonVariant="tertiary";buttonSize="s";showColumnSelect=!0;showDownload=!0}class Re{allowEditing=!0;allowToggleEditable=!0;allowToggleHideOnHover=!0;allowSettingTextAlign=!0;allowSettingLabel=!0}var Pe=f(222),I=f(6019);class xe{queryHandler=(0,T.A)(function*(){throw new Error("No query handler defined")})}var ue=f(7089),e=f(5547);function Fe(i,d){if(1&i&&(e.j41(0,"span",1),e.EFF(1),e.k0s()),2&i){const t=e.XpG();e.Y8G("cueTooltip",t._tooltip()),e.R7$(),e.SpI("\xd7",t._allValues().length)}}let je=(()=>{class i{_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,l=t.colDef?.cellRendererParams?.valueKey??"val",r=t.colDef?.cellRendererParams?.labelKey??l,p=n.map(m=>m[r]).filter(Boolean);this._allValues.set(p);const c=t.colDef?.cellRendererParams?.postProcess;this._displayValue.set((0,E.g4)(o?w(n,o):p[0]??"",c)),this._tooltip.set(p.map(m=>(0,E.g4)(m,c)).join("\n"))}static \u0275fac=function(a){return new(a||i)};static \u0275cmp=e.VBU({type:i,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,Fe,2,2,"span",1)),2&a&&(e.R7$(),e.JRh(n._displayValue()),e.R7$(),e.vxM(n._allValues().length>1?2:-1))},dependencies:[ue.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 i})();const de=["template","formula","pipeline"],pe=["add","subtract","multiply","divide"],Ne={template:"components.sparqlTable.evalTypeTemplate",formula:"components.sparqlTable.evalTypeFormula",pipeline:"components.sparqlTable.evalTypePipeline"},ke={template:"components.sparqlTable.evalTypeTemplateDesc",formula:"components.sparqlTable.evalTypeFormulaDesc",pipeline:"components.sparqlTable.evalTypePipelineDesc"},Ie={add:"components.sparqlTable.formulaOpAdd",subtract:"components.sparqlTable.formulaOpSubtract",multiply:"components.sparqlTable.formulaOpMultiply",divide:"components.sparqlTable.formulaOpDivide"};let B=(()=>{class i{_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,l])=>{this.keyVals[o]||(this.keyVals[o]={}),void 0===this.keyVals[o][t]&&(this.keyVals[o][t]=l)}),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});isLoading=(0,_.EW)(()=>this._columns().length>0&&this.fetchedColumns().length<this.totalQueryCount());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 m=c.data??{},h={};for(const y of p)if("data"===y.defType){const C=y.getFormatter();h[y.field]=(0,E.g4)(C(m[y.field]??[]),y.postProcess)}return function Ae(i,d,t="",a){switch(i.type){case"template":return i.template.replace(/\$\{([\w.-]+)\}/g,(n,o)=>d[o]??"").trim();case"formula":{const n=i.fields.map(o=>parseFloat(d[o])).filter(o=>!isNaN(o));if(0===n.length)return t;switch(i.op){case"add":return String(n.reduce((o,l)=>o+l,0));case"subtract":return String(n.reduce((o,l)=>o-l));case"multiply":return String(n.reduce((o,l)=>o*l,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:l,deduplicate:u,sort:r,limit:p,valueKey:c="val"}=i,m=i.separator??", ",h=i.fallback??t,y=new Set,C=[];for(const R of n){let D=(a?.[R]??[]).map(b=>b[c]??"").filter(b=>""!==b);o&&(D=D.map(b=>(0,E.w9)(o,b))),l?.length&&(D=D.filter(b=>!l.includes(b)));for(const b of D)u&&y.has(b)||(y.add(b),C.push(b))}r&&C.sort();const v=void 0!==p?C.slice(0,p):C;return 0===v.length?h:v.join(m)}}}(r,h,"",m)}})}}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?l=>l.data?.[a.field]??[]:l=>(0,E.g4)(n(l.data?.[a.field]??[]),a.postProcess),...o?{comparator:(l,u)=>{const r=Array.isArray(l)?l:[],p=Array.isArray(u)?u:[],c=(0,E.g4)(w(r,a.strategy,""),a.postProcess),m=(0,E.g4)(w(p,a.strategy,""),a.postProcess);return c.localeCompare(m)},cellRenderer:je,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,T.A)(function*(){const a=t._columns(),n=t._dataColumns(),o=a.filter(r=>"data"===r.defType&&!r.hide),l=n?.filter(r=>"data"===r.defType&&!r.hide);if(!o.length&&!l?.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))}),l?.forEach(r=>{u.push(t.fetchColumnData(r))}),yield Promise.all(u),t.emptyTableText.set("Table data downloaded")})()}fetchColumnData(t){var a=this;return(0,T.A)(function*(){if(a._requestedColumns.includes(t.field))return;a._requestedColumns.push(t.field);const n=(0,I.t)(t.query),o=yield a._handlers().queryHandler(t.query,n),l=new Set;o.results.bindings.forEach(u=>{const r=u.subject?.value,p=Object.keys(u).filter(m=>"subject"!==m),c={};p.forEach(m=>{const h=u[m]?.value;Object.keys(a.keyVals).includes(r)||(a.keyVals[r]={}),void 0===a.keyVals[r][t.field]&&(a.keyVals[r][t.field]=[]),c[m]=h}),a.keyVals[r][t.field].push(c),l.add(r)}),a.fetchedColumns.update(u=>[...u,t.field])})()}static \u0275fac=function(a){return new(a||i)};static \u0275prov=s.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),J=(()=>{class i{_isUpdating=!1;_pendingUpdate=!1;_dataFetchService=(0,s.WQX)(B);tableData=(0,s.vPA)([]);destroy(){this.tableData.update(()=>[])}onProcessedColumn=(0,s.QZP)((()=>{var t=this;return(0,T.A)(function*(){t._dataFetchService.fetchedColumns(),yield t._debouncedUpdateTableData()})})());_debouncedUpdateTableData(){var t=this;return(0,T.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,T.A)(function*(){return new Promise(a=>{const n={},o=Object.keys(t._dataFetchService.keyVals),l=[],u=t._dataFetchService.visibleColumns().map(p=>p.field);let r=!1;for(let p=0;p<o.length;p++){const c=o[p],m={};if(m.id=c,Object.keys(t._dataFetchService.keyVals[c]).forEach(h=>{Object.keys(n).includes(h)||(n[h]=0),m[h]=t._dataFetchService.keyVals[c][h]??[],""!==m[h]&&n[h]++}),l.push(m),!r&&9===p){let h=!0;for(const y of u)if(typeof m[y]>"u"){h=!1;break}h&&(t.tableData.update(()=>[...l]),r=!0)}}t.tableData.update(()=>l),a()})})()}static \u0275fac=function(a){return new(a||i)};static \u0275prov=s.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var V=f(2245),O=f(5381),Le=f(2611);function qe(i,d){if(1&i&&e.nrm(0,"cue-typography",1),2&i){const t=e.XpG();e.Y8G("innerHTML",t.instructions(),e.npT)}}let Ge=(()=>{class i{tableService=(0,s.WQX)(J);dataFetchService=(0,s.WQX)(B);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 Se);emptyTableText=(0,g.geq)("Building table");loading=(0,g.hFB)(!1);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 l=o.getColId(),u=this.columns().find(r=>r.field===l);u&&this.dataFetchService.fetchColumnData(u)})})}instructions=(0,s.vPA)("");buildInstructions=(0,s.QZP)((()=>{var t=this;return(0,T.A)(function*(){if(t.showInstructions()){const a=yield(0,Pe.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||i)};static \u0275cmp=e.VBU({type:i,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"],loading:[1,"loading"],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:8,consts:[["direction","column","gap","xl"],[3,"innerHTML"],[3,"gridApiReady","visibleRows","size","rowData","columnDefs","showPaginator","paginationPageSize","noRowsText","loading"]],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(l){return n._onGridApiReady(l)})("visibleRows",function(l){return n.visibleRows.emit(l)}),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())("loading",n.loading()||n.dataFetchService.isLoading()))},dependencies:[V.Typography,O.n,Le.R],encapsulation:2,changeDetection:0})}return i})();var Ve=f(9079),z=f(9352),_e=f(63),me=f(8957),Z=f(5971),fe=f(3319),ge=f(2530),ee=f(1096),he=f(5448),Oe=f(2014),Q=f(6593);const te=(i,d)=>d.field;function $e(i,d){if(1&i&&(e.j41(0,"cue-typography",6),e.EFF(1),e.k0s()),2&i){const t=e.XpG(2);e.R7$(),e.SpI(" ",t._queryError()," ")}}function Be(i,d){if(1&i){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&i&&(e.R7$(3),e.JRh(e.bMT(4,1,"components.sparqlTable.labelDiscard")))}function ze(i,d){1&i&&(e.j41(0,"cue-typography",11),e.EFF(1),e.nI1(2,"transloco"),e.k0s()),2&i&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"components.sparqlTable.labelQueryPending")," "))}function Xe(i,d){if(1&i&&(e.j41(0,"cue-typography",6),e.EFF(1),e.k0s()),2&i){const t=e.XpG(2);e.R7$(),e.SpI(" ",t._testError()," ")}}function Ke(i,d){if(1&i&&(e.j41(0,"cue-typography",19),e.EFF(1),e.k0s()),2&i){const t=d.$implicit;e.R7$(),e.JRh(t)}}function We(i,d){if(1&i&&(e.j41(0,"cue-typography",18),e.EFF(1),e.nI1(2,"transloco"),e.k0s(),e.Z7z(3,Ke,2,1,"cue-typography",19,e.Vm6)),2&i){const t=e.XpG(2);e.R7$(),e.JRh(e.bMT(2,1,"components.sparqlTable.labelTestResults")),e.R7$(2),e.Dyx(t._testRows())}}function Ye(i,d){if(1&i){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&i){const t=e.XpG(2);e.Y8G("label",e.bMT(1,2,"components.sparqlTable.labelSeparator"))("value",t._strategySeparator())}}function Ue(i,d){if(1&i){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&i){const t=e.XpG(2);e.Y8G("label",e.bMT(1,2,"components.sparqlTable.labelValueKey"))("value",t._strategyValueKey())}}function He(i,d){if(1&i){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&i){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 Je(i,d){if(1&i&&(e.j41(0,"cue-typography",6),e.EFF(1),e.k0s()),2&i){const t=e.XpG(3);e.R7$(),e.SpI(" ",t._strategyMapError()," ")}}function Ze(i,d){if(1&i){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,Je,2,1,"cue-typography",6)}if(2&i){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 et(i,d){if(1&i&&(e.j41(0,"cue-typography",6),e.EFF(1),e.k0s()),2&i){const t=e.XpG(2);e.R7$(),e.SpI(" ",t._strategyPreProcessError()," ")}}function tt(i,d){if(1&i){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,$e,2,1,"cue-typography",6),e.j41(7,"cue-flexcontainer",7),e.nVh(8,Be,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,ze,3,3,"cue-typography",11),e.nVh(17,Xe,2,1,"cue-typography",6),e.nVh(18,We,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,Ye,2,4,"cue-input",14),e.nVh(27,Ue,2,4,"cue-input",14),e.nVh(28,He,3,7,"cue-input",15),e.nVh(29,Ze,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,et,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&i){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 nt(i,d){if(1&i){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&i){const t=d.$implicit;e.Y8G("title",t.headerName),e.R7$(),e.JRh(t.token)}}function at(i,d){if(1&i&&(e.j41(0,"cue-typography",13),e.EFF(1),e.nI1(2,"transloco"),e.k0s(),e.j41(3,"cue-flexcontainer",24),e.Z7z(4,nt,2,2,"span",25,te),e.k0s()),2&i){const t=e.XpG(3);e.R7$(),e.SpI(" ",e.bMT(2,1,"components.sparqlTable.labelAvailableFields")," "),e.R7$(3),e.Dyx(t._dataColumnFields())}}function ot(i,d){if(1&i){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,at,6,3)}if(2&i){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 it(i,d){if(1&i){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&i){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 lt(i,d){if(1&i&&(e.j41(0,"span",30),e.EFF(1),e.k0s()),2&i){const t=e.XpG(5);e.R7$(),e.JRh(t._formulaOpSymbol())}}function st(i,d){if(1&i&&(e.j41(0,"span",29),e.EFF(1),e.k0s(),e.nVh(2,lt,2,1,"span",30)),2&i){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 rt(i,d){if(1&i&&(e.j41(0,"cue-flexcontainer",28),e.Z7z(1,st,3,2,null,null,e.fX1),e.k0s()),2&i){const t=e.XpG(3);e.R7$(),e.Dyx(t._formulaFields())}}function ct(i,d){if(1&i){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,it,2,4,"span",27,te),e.k0s(),e.nVh(8,rt,3,0,"cue-flexcontainer",28)}if(2&i){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 ut(i,d){if(1&i&&(e.j41(0,"cue-typography",23),e.EFF(1),e.nI1(2,"transloco"),e.k0s()),2&i){const t=e.XpG(2);e.R7$(),e.Lme(" ",e.bMT(2,2,"components.sparqlTable.labelEvalPreview"),": ",t._evalPreview()," ")}}function dt(i,d){if(1&i){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&i){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 pt(i,d){if(1&i&&(e.j41(0,"cue-typography",11),e.EFF(1),e.nI1(2,"transloco"),e.k0s()),2&i){const t=e.XpG(3);e.R7$(),e.Lme(" ",e.bMT(2,2,"components.sparqlTable.labelPipelineSourceOrder"),": ",t._pipelineSources().join(" \u2192 ")," ")}}function _t(i,d){if(1&i&&(e.j41(0,"cue-typography",6),e.EFF(1),e.k0s()),2&i){const t=e.XpG(3);e.R7$(),e.JRh(t._pipelineTransformError())}}function mt(i,d){if(1&i&&(e.j41(0,"cue-typography",6),e.EFF(1),e.k0s()),2&i){const t=e.XpG(3);e.R7$(),e.JRh(t._pipelineExcludeError())}}function ft(i,d){if(1&i){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,dt,2,4,"span",27,te),e.k0s(),e.nVh(7,pt,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,_t,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,mt,2,1,"cue-typography",6)}if(2&i){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 gt(i,d){if(1&i){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,ot,4,8),e.nVh(5,ct,9,10),e.nVh(6,ut,3,4,"cue-typography",23),e.nVh(7,ft,36,49)}if(2&i){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 ht=["join"],ye=["sum","avg","min","max","mostRecent","oldest","longest","shortest"],ve=["first","last","sum","avg","min","max","mostRecent","oldest","longest","shortest"],yt=["map"],be=["text","number","date"],vt=Object.assign(new ee.e,{});let bt=(()=>{class i{columnDef=g.geq.required();handlers=(0,g.hFB)();columns=(0,g.hFB)([]);close=(0,g.CGW)();updateColumnDef=(0,g.CGW)();agGridSettings=vt;_transloco=(0,s.WQX)(z.JO);_lang=(0,Ve.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,E.NF)(t)??void 0});evaluationTypeOptions=de;evaluationTypeLabelMap=(0,_.EW)(()=>(this._lang(),Object.fromEntries(de.map(t=>[t,this._transloco.translate(Ne[t])]))));_evalTypeDescription=(0,_.EW)(()=>(this._lang(),this._transloco.translate(ke[this._evalType()])));formulaOpOptions=pe;formulaOpLabelMap=(0,_.EW)(()=>(this._lang(),Object.fromEntries(pe.map(t=>[t,this._transloco.translate(Ie[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=be;datatypeLabelMap=(0,_.EW)(()=>(this._lang(),Object.fromEntries(be.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?A[t]:Y});strategyLabelMap=(0,_.EW)(()=>(this._lang(),Object.fromEntries(Y.map(t=>[t,this._transloco.translate(G[t])]))));_strategyDescription=(0,_.EW)(()=>(this._lang(),this._transloco.translate(se[this._strategyType()])));query=(0,_.EW)(()=>this.columnDef().query??"");_editedQuery=(0,_.uu)(()=>this.query());_queryError=(0,_.EW)(()=>{this._lang();const t=function Qe(i,d="val"){if(!i?.trim())return null;let t;try{t=new Q.Parser({sparqlStar:!0}).parse(i)}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(l=>l?.value??l?.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)(()=>ht.includes(this._strategyType()));_strategyNeedsValueKey=(0,_.EW)(()=>ye.includes(this._strategyType()));_strategyNeedsPriorityKey=(0,_.EW)(()=>ve.includes(this._strategyType())&&this._queryExtraBindings().length>0);_strategyNeedsMap=(0,_.EW)(()=>yt.includes(this._strategyType()));_strategyPreProcessError=(0,_.EW)(()=>{const t=this._strategyPreProcess();return t?(0,E.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 Q.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&&!A[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 ye.includes(t)?{type:t,valueKey:a,priorityKey:n,...u}:ve.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,T.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(l){t._testError.set(l?.message??String(l))}finally{t._testLoading.set(!1)}})()}_onColDefUpdate(t){this.updateColumnDef.emit(t)}static \u0275fac=function(a){return new(a||i)};static \u0275cmp=e.VBU({type:i,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(l){return n._onColDefUpdate(l)})("close",function(){return n.close.emit()}),e.j41(2,"cue-flexcontainer",1)(3,"cue-select",2),e.nI1(4,"transloco"),e.bIt("valueChange",function(l){return n.setDefType(l)}),e.k0s(),e.nVh(5,tt,37,51),e.nVh(6,gt,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:[ee.T,O.n,V.Typography,_e.Select,me.Input,Z.$,fe.a,ge.B,he.L,Oe.z,z.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 i})();var Dt=f(5187),Tt=f(7717),ne=f(5661),Ct=f(6117),St=f(356),Mt=f(6279),Rt=f(29),Pt=f(5821),Et=f(5745);const xt=(i,d)=>d.key;function wt(i,d){if(1&i){const t=e.RV6();e.j41(0,"cue-input",12),e.bIt("valueChange",function(n){s.eBV(t);const o=e.XpG().$implicit,l=e.XpG(2);return s.Njj(l._setVar(o.key,n))}),e.k0s()}if(2&i){const t=e.XpG().$implicit,a=e.XpG(2);e.Y8G("label",t.label)("value",a._varValues()[t.key]??a._filePathPlaceholder())}}function Ft(i,d){if(1&i){const t=e.RV6();e.j41(0,"cue-select",13),e.bIt("valueChange",function(n){s.eBV(t);const o=e.XpG().$implicit,l=e.XpG(2);return s.Njj(l._setVar(o.key,n))}),e.k0s()}if(2&i){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 jt(i,d){if(1&i&&e.nVh(0,wt,1,2,"cue-input",10)(1,Ft,1,6,"cue-select",11),2&i){const t=d.$implicit;e.vxM("text"===t.type?0:"select"===t.type?1:-1)}}function At(i,d){1&i&&e.Z7z(0,jt,2,1,null,null,xt),2&i&&e.Dyx(d.variables)}function Nt(i,d){1&i&&(e.j41(0,"div",6),e.EFF(1),e.nI1(2,"transloco"),e.k0s()),2&i&&(e.R7$(),e.JRh(e.bMT(2,1,d)))}const kt=new Q.Parser({sparqlStar:!0}),De=`PREFIX qcy: <${U.E.qcy}>`,ae=[{id:"files-in-directory",label:"Files in a specific directory",template:`${De}\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:`${De}\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 It=(()=>{class i{rowDefinitionQuery=(0,g.geq)(null);handlers=(0,g.hFB)(void 0);close=(0,g.CGW)();saved=(0,g.CGW)();_draft=(0,_.uu)(()=>this.rowDefinitionQuery()||H);_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?ae.find(a=>a.id===t)??null:null});_predefinedOptions=ae.map(t=>t.id);_predefinedLabelMap=Object.fromEntries(ae.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,T.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,T.A)(function*(){const n=t?.randomFilePath;if(!n)return;const o=yield n();if(o){const l=o.replace(/\/?[^\/]*$/,"/");a._filePathPlaceholder.set(l),a._setVar("THE_FILE_PATH",l)}})()}_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=kt.parse(t);if("SELECT"!==a?.queryType)return"components.sparqlTable.rowDefinitionErrorNotSelect";if(!a.variables.filter(l=>"*"!==l).map(l=>l?.value??l?.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||i)};static \u0275cmp=e.VBU({type:i,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(l){return n._onPredefinedChange(l)}),e.k0s(),e.nVh(7,At,2,0),e.j41(8,"div",4)(9,"cue-code-editor",5),e.bIt("contentChange",function(l){return n._draft.set(l)}),e.k0s()(),e.nVh(10,Nt,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,l;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((l=n._draft()&&n._validationError())?10:-1,l),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:[Et.a,O.n,V.Typography,Z.$,he.L,ge.B,_e.Select,me.Input,z.Kj],styles:[".row-def-error[_ngcontent-%COMP%]{color:var(--cue-color-error, #ef4444);font-size:12px;padding:2px 0}"],changeDetection:0})}return i})();var Lt=f(7284);function qt(i,d){if(1&i&&(e.j41(0,"div",13),e.nrm(1,"span",26),e.EFF(2),e.k0s()),2&i){const t=d;e.R7$(2),e.Lme(" ",t.done," / ",t.total," queries ")}}function Gt(i,d){1&i&&(e.j41(0,"div",13),e.nrm(1,"span",26),e.EFF(2," Building table for download\u2026 "),e.k0s())}function Vt(i,d){if(1&i){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&i&&(e.R7$(2),e.SpI(" ",e.bMT(3,1,"components.sparqlTable.rowDefinitionEmpty")," "))}function Ot(i,d){if(1&i){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&i){const t=e.XpG();e.Y8G("size",t._totalKeys())("pageSize",t.pageSize())}}function Qt(i,d){if(1&i){const t=e.RV6();e.j41(0,"cue-button",30),e.bIt("click",function(){const n=s.eBV(t),o=n.$implicit,l=n.index,u=e.XpG();return s.Njj(u._openSettings(o,l))}),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 $t(i,d){if(1&i){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 Bt(i,d){if(1&i){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),l=e.XpG();return s.Njj(l._applyColumnUpdate(o.index,n))}),e.k0s()}if(2&i){const t=e.XpG();e.R50("columnDef",d.col),e.Y8G("handlers",t.handlers())("columns",t.columns())}}function zt(i,d){if(1&i){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&i){const t=e.XpG();e.R50("rowDefinitionQuery",t.rowDefinition),e.Y8G("handlers",t.rowDefinitionHandlers())}}const Xt=new Q.Parser({sparqlStar:!0}),Kt=new Q.Generator;function K(i,d){return oe.apply(this,arguments)}function oe(){return oe=(0,T.A)(function*(i,d){const t=new Array(i.length);let a=0;function o(){return(o=(0,T.A)(function*(){for(;a<i.length;){const u=a++;t[u]=yield i[u]()}})).apply(this,arguments)}const l=Array.from({length:Math.min(d,i.length)},()=>function n(){return o.apply(this,arguments)}());return yield Promise.all(l),t}),oe.apply(this,arguments)}function ie(i,d){if(d.length>200)return i;try{const t=Xt.parse(i),a={type:"values",values:d.map(n=>({"?subject":{termType:"NamedNode",value:n}}))};return Array.isArray(t.where)&&(t.where=[a,...t.where]),Kt.stringify(t)}catch{const t=`VALUES ?subject { ${d.map(a=>`<${a}>`).join(" ")} }`;return i.replace(/WHERE\s*\{/i,`WHERE {\n ${t}`)}}let Yt=(()=>{class i{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)(H);pageSize=(0,g.hFB)(10);size=(0,g.hFB)("m");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)(B);_tableService=(0,s.WQX)(J);_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(l=>null!=l.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,T.A)(function*(){if(!t._fillingVisibleRows&&t._gridApi){t._fillingVisibleRows=!0;try{const a=t._gridApi.paginationGetPageSize?.()??t.pageSize(),o=(t._gridApi.paginationGetCurrentPage?.()??0)*a,l=[];for(let p=o;p<o+a;p++){const c=t._gridApi.getDisplayedRowAtIndex(p);if(!c?.data?.id)break;l.push(c.data.id)}if(!l.length)return;const u=t.columns().filter(p=>"data"===p.defType&&p.query&&!p.hide),r=t._dataFetchService.keyVals;yield K(u.map(p=>(0,T.A)(function*(){const c=l.filter(h=>void 0===r[h]?.[p.field]);if(!c.length)return;const m=ie(p.query,c);try{const h=yield t.handlers().queryHandler(m,(0,I.t)(m)),y={};h.results.bindings.forEach(C=>{const v=C.subject?.value;if(!v)return;y[v]||(y[v]=[]);const R={};Object.keys(C).filter(M=>"subject"!==M).forEach(M=>{R[M]=C[M]?.value}),y[v].push(R)}),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 l=Math.floor((a-o)/this.pageSize());if(this._gridApi)try{this._gridApi.paginationGoToPage(l)}catch{}if(l>=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,T.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=(0,I.t)(t),l=yield a.queryHandler(t,o),u=l.results.bindings.map(r=>r.subject?.value).filter(Boolean);console.log("[ROWDEF] _fetchRowDef received",l.results.bindings.length,"bindings,",u.length,"valid keys. meta=",l.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 l=this._prefetchCache.get(t);if(this._prefetchCache.delete(t),this._dataFetchService.resetData(),l?this._dataFetchService.injectPreloadedData(l.keyVals,l.fetchedColumnFields,l.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,T.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+$/,""),l=o?t.columns().find(u=>u.field===o&&"data"===u.defType&&u.query):void 0;if(!l)return t._fullDataMode.set(!0),void t._fetchingFullData.set(!1);try{if(a!==t._fullDataFetchVersion)return;const u=yield t.handlers().queryHandler(l.query,(0,I.t)(l.query));if(a!==t._fullDataFetchVersion)return;const r={};Object.entries(t._dataFetchService.keyVals).forEach(([v,R])=>{r[v]={...R}});const p=t._allKeys();p.forEach(v=>{r[v]||(r[v]={})}),console.log("[DeclarativeSPARQLTable] keyVals pre-seed: allKeys=",p.length,"keyVals size=",Object.keys(r).length);const c=[...t._dataFetchService.fetchedColumns()],m={...t._dataFetchService._columnQueries},h=[];if(u.results.bindings.forEach(v=>{const R=v.subject?.value;if(!R)return;r[R]||(r[R]={}),r[R][l.field]=[];const M={};Object.keys(v).filter(D=>"subject"!==D).forEach(D=>{M[D]=v[D]?.value}),r[R][l.field].push(M),h.push(R)}),c.includes(l.field)||c.push(l.field),m[l.field]=l.query,console.log("[FDM] after sort-col fetch: keyVals size=",Object.keys(r).length,"allKeys from sort col=",h.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,m),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(v=>"data"===v.defType&&v.query&&v.field!==l.field&&!v.hide),C=new Set(t._bufferKeys());yield K(y.map(v=>(0,T.A)(function*(){const R=h.filter(D=>C.has(D)&&void 0===r[D]?.[v.field]);if(!R.length||a!==t._fullDataFetchVersion)return;const M=ie(v.query,R);try{const D=yield t.handlers().queryHandler(M,(0,I.t)(M));if(a!==t._fullDataFetchVersion)return;const b={};D.results.bindings.forEach(P=>{const x=P.subject?.value;if(!x)return;b[x]||(b[x]=[]);const $={};Object.keys(P).filter(L=>"subject"!==L).forEach(L=>{$[L]=P[L]?.value}),b[x].push($)}),Object.entries(b).forEach(([P,x])=>{r[P]&&(r[P][v.field]=x)}),t._dataFetchService.mergeColumnData(v.field,b,v.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,T.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 l=a._patchColumns(a.columns(),n).filter(c=>"data"===c.defType&&!c.hide&&c.query),u={},r=[],p={};try{yield K(l.map(c=>(0,T.A)(function*(){try{(yield a.handlers().queryHandler(c.query,(0,I.t)(c.query))).results.bindings.forEach(h=>{const y=h.subject?.value;if(!y)return;u[y]||(u[y]={}),u[y][c.field]||(u[y][c.field]=[]);const C={};Object.keys(h).filter(v=>"subject"!==v).forEach(v=>{C[v]=h[v]?.value}),u[y][c.field].push(C)}),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:ie(n.query,a)}:n):t}_columnSelectSettings=Object.assign(new ee.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})),l=n.filter(u=>!a.has(u.field)).map(u=>({...u,hide:!0}));this.columns.set([...o,...l])}_applyColumnUpdate(t,a){const n=this.columns().map((o,l)=>l===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 l=this.rowDefinition();a=Object.assign(new re,{query:l?this._seedQueryFromRowDef(l):"",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(l=>[...l,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 re,{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: <${Ce.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(h=>h.colId===c.field||h.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(),l=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 m=c.cellStyle;return m&&"object"==typeof m?String(m.textAlign??m["text-align"]??"").toLowerCase():""})];return{headers:u,rows:l.map(c=>[String(c.id??""),...n.map(m=>{const h=m.colId??m.field??"",y=m.valueGetter;let C="function"==typeof y?y({data:c,colDef:m}):c[h];if(void 0===C&&a&&(C=(a[c.id]??{})[h]??[]),Array.isArray(C)){const v=m.cellRendererParams?.strategy,R=m.cellRendererParams?.postProcess,M=v?w(C,v,""):C.map(D=>D?.val??"").filter(Boolean).join(", ");return(0,E.g4)(M,R)}return String(C??"")})]),alignments:r}}_fetchAllColumnsForExport(t){var a=this;return(0,T.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 l=n.length?a._patchColumns(o,n):o,u={};return yield K(l.map(r=>(0,T.A)(function*(){try{(yield a.handlers().queryHandler(r.query,(0,I.t)(r.query))).results.bindings.forEach(c=>{const m=c.subject?.value;if(!m)return;u[m]||(u[m]={}),u[m][r.field]||(u[m][r.field]=[]);const h={};Object.keys(c).filter(y=>"subject"!==y).forEach(y=>{h[y]=c[y]?.value}),u[m][r.field].push(h)})}catch{}})),3),u})()}_downloadCsv(){var t=this;return(0,T.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:l,rows:u}=t._getFormattedData(a,o),r=Lt.unparse([l,...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,T.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:l,rows:u,alignments:r}=t._getFormattedData(a,o),p=yield t._buildStyledXlsxBlob(l,u,r);t._triggerDownload(p,"export.xlsx")}finally{t._exporting.set(!1)}}}).apply(this,arguments)}_buildStyledXlsxBlob(t,a,n){return(0,T.A)(function*(){const u=(D,b)=>D?"center"===b?2:"right"===b?3:1:"center"===b?4:"right"===b?5:0,r=(D,b,P,x)=>{const $=`${(D=>{let b="",P=D+1;for(;P>0;)b=String.fromCharCode(65+(P-1)%26)+b,P=Math.floor((P-1)/26);return b})(D)}${b}`,L=x>0?` s="${x}"`:"",le=Number(P);return 0===x&&""!==P&&!isNaN(le)&&isFinite(le)?`<c r="${$}"${L}><v>${le}</v></c>`:`<c r="${$}"${L} t="inlineStr"><is><t>${(D=>D.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"))(P)}</t></is></c>`},p=[];p.push(`<row r="1">${t.map((D,b)=>r(b,1,D,u(!0,n[b]??""))).join("")}</row>`),a.forEach((D,b)=>{p.push(`<row r="${b+2}">${D.map((P,x)=>r(x,b+2,P,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>`,M=new(0,(yield f.e(7247).then(f.t.bind(f,7247,23))).default);return M.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>'),M.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>'),M.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>'),M.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>'),M.file("xl/worksheets/sheet1.xml",c),M.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>'),M.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||i)};static \u0275cmp=e.VBU({type:i,selectors:[["cue-declarative-sparql-table"]],inputs:{columns:[1,"columns"],handlers:[1,"handlers"],rowDefinitionHandlers:[1,"rowDefinitionHandlers"],rowDefinition:[1,"rowDefinition"],pageSize:[1,"pageSize"],size:[1,"size"],bufferFactor:[1,"bufferFactor"]},outputs:{visibleRows:"visibleRows",columnDefsAG:"columnDefsAG",columns:"columnsChange",rowDefinition:"rowDefinitionChange"},features:[e.Jv_([B,J])],decls:39,vars:27,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","size","loading"],[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(l){return e.DH7(n._showSettings,l)||(n._showSettings=l),l}),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(l){return n._onGridApi(l)})("visibleRows",function(l){return n.visibleRows.emit(l)})("columnDefsAG",function(l){return n.columnDefsAG.emit(l)}),e.k0s(),e.nVh(23,qt,3,2,"div",13),e.nVh(24,Gt,3,0,"div",13),e.nVh(25,Vt,4,3,"div",14),e.nVh(26,Ot,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(l){return n._onShownChanged(l)}),e.DNE(35,Qt,4,0,"ng-template",22)(36,$t,2,0,"ng-template",23),e.k0s()()()(),e.nVh(37,Bt,1,3,"cue-declarative-sparql-column-settings-modal",24),e.nVh(38,zt,1,2,"cue-sparql-row-definition-modal",25)),2&a){let o,l;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())("size",n.size())("loading",n._rowDefLoading()),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,25,"components.sparqlTable.rowDefinitionTooltip")),e.R7$(5),e.Y8G("columnDefs",n._shownColumns())("columnDefsGross",n.columns())("settings",n._columnSelectSettings),e.R7$(3),e.vxM((l=n._activeColumn())?37:-1,l),e.R7$(),e.vxM(n._showRowDefModal()?38:-1)}},dependencies:[Ge,bt,It,ne.pL,ne.pC,ne.rx,Dt.Card,O.n,V.Typography,Z.$,fe.a,Tt.R,ue.d,Ct.W,St.M,Mt.D,Rt.A,Pt.m,z.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 i})();var Ut=f(7293);function Ht(i,d){if(1&i){const t=e.RV6();e.j41(0,"cue-declarative-sparql-table",3),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&i){const t=e.XpG();e.Y8G("handlers",d)("rowDefinitionHandlers",t._rowDefinitionHandlers()),e.R50("columns",t.columns)("rowDefinition",t.rowDefinition),e.Y8G("pageSize",t.pageSize())("size",t.size())("bufferFactor",t.bufferFactor())}}function Jt(i,d){1&i&&(e.j41(0,"cue-flexcontainer",1)(1,"cue-typography",4),e.EFF(2," No project connected. Pass a sdkState with cue and projectId. "),e.k0s()())}function Zt(i,d){if(1&i&&e.nrm(0,"cue-logo-link",2),2&i){let t;const a=e.XpG();e.Y8G("projectId",null==(t=a.sdkState())?null:t.projectId)}}let en=(()=>{class i{sdkState=(0,g.hFB)(void 0);columns=g.geq.required();rowDefinition=(0,g.geq)(H);pageSize=(0,g.hFB)(10,{transform:g.Udg});size=(0,g.hFB)("m");showLogo=(0,g.hFB)(!1,{transform:g.L39});bufferFactor=(0,g.hFB)(5,{transform:g.Udg});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:l=>a.api.sparql(l,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 q.g8(t.cue.api,t.projectId)),this._documents.set(new q.f$(t.cue.api,t.projectId))):(this._entities.set(void 0),this._documents.set(void 0))})}static \u0275fac=function(a){return new(a||i)};static \u0275cmp=e.VBU({type:i,selectors:[["cue-sparql-table"]],inputs:{sdkState:[1,"sdkState"],columns:[1,"columns"],rowDefinition:[1,"rowDefinition"],pageSize:[1,"pageSize"],size:[1,"size"],showLogo:[1,"showLogo"],bufferFactor:[1,"bufferFactor"]},outputs:{columns:"columnsChange",rowDefinition:"rowDefinitionChange",visibleRows:"visibleRows",columnDefsAG:"columnDefsAG"},decls:3,vars:2,consts:[[3,"handlers","rowDefinitionHandlers","columns","rowDefinition","pageSize","size","bufferFactor"],["direction","column","align","center","justify","center",2,"height","100%","width","100%","padding","8px"],[2,"position","absolute","top","26px","left","26px","z-index","5",3,"projectId"],[3,"columnsChange","rowDefinitionChange","visibleRows","columnDefsAG","handlers","rowDefinitionHandlers","columns","rowDefinition","pageSize","size","bufferFactor"],[2,"color","#9ca3af","font-size","13px"]],template:function(a,n){if(1&a&&(e.nVh(0,Ht,1,7,"cue-declarative-sparql-table",0)(1,Jt,3,0,"cue-flexcontainer",1),e.nVh(2,Zt,1,1,"cue-logo-link",2)),2&a){let o;e.vxM((o=n._handlers())?0:1,o),e.R7$(2),e.vxM(n.showLogo()?2:-1)}},dependencies:[Yt,O.n,V.Typography,Ut.x],styles:["[_nghost-%COMP%]{display:block;width:100%;position:relative}"],changeDetection:0})}return i})()},7573(W,k,f){f.d(k,{E:()=>g});const g={qcy:"https://dev.qaecy.com/ont#","qcy-e":"https://dev.qaecy.com/enum#","qcy-f":"https://dev.qaecy.com/functions#",obc:"https://w3id.org/obc#",dicc:"https://w3id.org/digitalconstruction/0.5/Contexts#",dicv:"https://w3id.org/digitalconstruction/0.5/Variables#",dice:"https://w3id.org/digitalconstruction/0.5/Entities#",dicp:"https://w3id.org/digitalconstruction/0.5/Processes#",dica:"https://w3id.org/digitalconstruction/0.5/Agents#",dici:"https://w3id.org/digitalconstruction/0.5/Information#",dicbm:"https://w3id.org/digitalconstruction/0.5/Materials#",dicob:"https://w3id.org/digitalconstruction/0.5/Occupancy#",dicl:"https://w3id.org/digitalconstruction/0.5/Lifecycle#",dices:"https://w3id.org/digitalconstruction/0.5/Energy#",dicu:"https://w3id.org/digitalconstruction/0.5/Units#",diclvl:"https://w3id.org/digitalconstruction/0.5/Levels#",dicstg:"https://w3id.org/digitalconstruction/0.5/Stages#"}}}]);
package/5137.js DELETED
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[5137],{5137(F,B,a){a.d(B,{BlockProjectDocuments:()=>L});var v=a(467),f=a(7705),r=a(5802),u=a(2271),y=a(6114),_=a(7993),C=a(3615),D=a(1493),S=a(9352),P=a(2245),z=a(5381),t=a(5547);const R=i=>({percent:i}),T=i=>({count:i});function O(i,d){if(1&i){const e=t.RV6();t.j41(0,"cue-block-documents-by-suffix",11),t.bIt("navigated",function(c){r.eBV(e);const s=t.XpG();return r.Njj(s.handleNavigated(c))}),t.k0s()}if(2&i){t.XpG();const e=t.r8f(2),n=t.r8f(4);t.Y8G("data",e)("config",n)}}function N(i,d){if(1&i){const e=t.RV6();t.j41(0,"cue-block-documents-by-content-category",11),t.bIt("navigated",function(c){r.eBV(e);const s=t.XpG();return r.Njj(s.handleNavigated(c))}),t.k0s()}if(2&i){t.XpG();const e=t.r8f(3),n=t.r8f(4);t.Y8G("data",e)("config",n)}}function E(i,d){if(1&i&&(t.nrm(0,"cue-typography",7),t.nI1(1,"transloco")),2&i){const e=t.XpG();t.Y8G("innerHTML",t.i5U(1,1,"components.contentBlocks.projectDocuments.pctOpenFormats",t.eq3(4,R,e.openFormatPct())),t.npT)}}function A(i,d){if(1&i){const e=t.RV6();t.j41(0,"cue-typography",12),t.nI1(1,"transloco"),t.bIt("click",function(){r.eBV(e);const c=t.XpG();return r.Njj(c.getDuplicates())}),t.k0s()}2&i&&t.Y8G("innerHTML",t.i5U(1,1,1===d?"components.contentBlocks.projectDocuments.duplicateFilesSingular":"components.contentBlocks.projectDocuments.duplicateFilesPlural",t.eq3(4,T,d)),t.npT)}function G(i,d){if(1&i&&(t.j41(0,"cue-typography",10),t.EFF(1),t.k0s()),2&i){const e=t.XpG();t.R7$(),t.SpI("\u2696\ufe0f ",e.humanSize()," ")}}function $(i,d){if(1&i&&(t.j41(0,"cue-typography",10),t.EFF(1),t.k0s()),2&i){const e=t.XpG();t.R7$(),t.E5c("",e.filterKey(),": ",e.humanSizeFiltered()," (",e.countFiltered(),")")}}let L=(()=>{class i{data=(0,f.hFB)(void 0);_data=(0,r.vPA)(void 0);constructor(){let e=null;(0,r.QZP)(()=>{const n=this.data();null!==e&&clearTimeout(e),(0,u.O8)(()=>this._data.set(n)),e=setTimeout(()=>{e=null,(0,u.O8)(()=>this._data.set(this.data()))},100)})}config=f.hFB.required();handlers=(0,u.EW)(()=>this.config().handlers);filterKey=(0,r.vPA)("");bySuffix=(0,u.EW)(()=>{const e=this._data();if(e?.documentsBySuffix&&0!==Object.keys(e.documentsBySuffix).length)return{documents:e.documentsBySuffix}});byContentCategory=(0,u.EW)(()=>{const e=this._data();if(e?.documentsByContentCategory&&0!==Object.keys(e.documentsByContentCategory).length)return{documents:e.documentsByContentCategory}});duplicateCount=(0,u.EW)(()=>this._data()?.duplicateCount??0);size=(0,u.EW)(()=>{const e=this._data();if(!e)return 0;const n=Object.values(e.documentsBySuffix||{}).reduce((s,o)=>s+(o?.size||0),0),c=Object.values(e.documentsByContentCategory||{}).reduce((s,o)=>s+(o?.size||0),0);return Math.max(n,c)});documentCount=(0,u.EW)(()=>{const e=this._data();if(!e)return 0;const n=Object.values(e.documentsBySuffix||{}).reduce((s,o)=>s+(o?.count||0),0),c=Object.values(e.documentsByContentCategory||{}).reduce((s,o)=>s+(o?.count||0),0);return Math.max(n,c)});sizeFiltered=(0,r.vPA)(0);countFiltered=(0,r.vPA)(0);humanSize=(0,u.EW)(()=>(0,D.b)(this.size()));humanSizeFiltered=(0,u.EW)(()=>(0,D.b)(this.sizeFiltered()));openFormatPct=(0,u.EW)(()=>{const e=this._data();if(!e?.documentsBySuffix)return 0;let n=0,c=0;for(const[o,l]of Object.entries(e.documentsBySuffix)){if(!l)continue;const g=Number(l.count||0);n+=g;const b=o.toLowerCase().trim(),x=b.startsWith(".")?b:`.${b}`;y.V[x]?.open&&(c+=g)}return n>0?Math.round(c/n*100):null});configWithFilterResolver=(0,u.EW)(()=>{var e=this;const n=this.config();return{...n,handlers:{...n.handlers,docListFilterRequest:(c=(0,v.A)(function*(s,o){if(console.log("[ProjectDocuments] docListFilterRequest",s,o),!o||0===o.length)return;const l="contentCat"===s?(i=>{const d=i.split("#").pop()??i,e={AgreementDocument:"Agreement",ArchitecturalDesignDocument:"Architectural Design",AsBuiltDocument:"As-Built",BudgetEstimateDocument:"Budget Estimate",CertificationDocument:"Certification",ComplianceDocument:"Compliance",CorrespondenceDocument:"Correspondence",ConstructionContract:"Construction Contract",ConstructionProcessDocument:"Construction Process",ContractCondition:"Contract Condition",ContractRole:"Contract Role",ContractualDocument:"Contract",CostControlDocument:"Cost Control",DesignDocument:"Design Document",EmailAddress:"Email Address",EngineeringDesignDocument:"Engineering Design",FinancialAdministrativeDocument:"Financial/Administrative",FunctionalRequirementsDocument:"Functional Requirements",InspectionDocument:"Inspection",InsuranceBondDocument:"Insurance/Bond",InteriorDesignDocument:"Interior Design",MarketingCloseoutDocument:"Marketing Closeout",MiscDocument:"Miscellaneous",OperationManual:"Operation Manual",OperationsMaintenanceDocument:"Operations & Maintenance",OperationsManualDocument:"Operations Manual",OtherDocument:"Other",OtherContent:"Other Content",ProgressStatusReport:"Progress Status Report",QualityAssuranceDocument:"Quality Assurance",QualityControlDocument:"Quality Control",RegulatoryComplianceDocument:"Regulatory Compliance",SafetyDocument:"Safety",ScheduleDocument:"Schedule",SiteAssessmentDocument:"Site Assessment",TechnicalRequirementsDocument:"Technical Requirements",TechnicalSpecificationDocument:"Technical Specification",TenderingDocument:"Tendering Document",TermsAndConditionsDocument:"Terms & Conditions"};return void 0===e[d]&&console.log(`No pretty label for category: ${d}`),e[d]??d})(o[0]):o[0];if(e.filterKey.set(l),"suffix"===s){const m=e._data()?.documentsBySuffix;if(m){const M=o.reduce((h,p)=>h+(m[p.toLowerCase()]?.size||0),0),k=o.reduce((h,p)=>h+(m[p.toLowerCase()]?.count||0),0);e.sizeFiltered.set(M),e.countFiltered.set(k)}}else if("contentCat"===s){const m=e._data()?.documentsByContentCategory;if(m){const M=o.reduce((h,p)=>h+(m[p]?.size||0),0),k=o.reduce((h,p)=>h+(m[p]?.count||0),0);e.sizeFiltered.set(M),e.countFiltered.set(k)}}const g=n.handlers?.requestDocumentsByFilter;if(!g)return void console.warn("No requestDocumentsByFilter handler defined");const x=yield g([{type:"suffix"===s?"suffix":"content",included:o,excluded:[]}]);return{ids:x.map(m=>({id:m})),totalCount:x.length}}),function(o,l){return c.apply(this,arguments)})}};var c});handleNavigated(e){if(!e)return this.sizeFiltered.set(0),this.countFiltered.set(0),void this.filterKey.set("");this.filterKey.set(e.label);const n=this._data();if(!n)return;let c=0,s=0;if("suffix"===e.filterBy){const o=n.documentsBySuffix;e.values.forEach(l=>{const g=l.toLowerCase();c+=o[g]?.size||0,s+=o[g]?.count||0})}else if("contentCat"===e.filterBy){const o=n.documentsByContentCategory;e.values.forEach(l=>{c+=o[l]?.size||0,s+=o[l]?.count||0})}this.sizeFiltered.set(c),this.countFiltered.set(s)}handleCanvasClick(){this.sizeFiltered.set(0),this.countFiltered.set(0)}getDuplicates(){var e=this;return(0,v.A)(function*(){const n=e.handlers()?.subsequentBlockRequest;if(void 0===n)return void console.warn("No handler for subsequent block request");const c=e.handlers()?.documentDuplicatesRequest;if(!c)return void console.warn("No documentDuplicatesRequest handler defined");const s=yield c();n({id:"document-duplicates",config:e.config(),data:s,focusOnAdd:!0},"Duplicates",!0)})()}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=t.VBU({type:i,selectors:[["cue-block-project-documents"]],inputs:{data:[1,"data"],config:[1,"config"]},decls:19,vars:13,consts:[["direction","column"],[1,"container",3,"click"],["id","chart-1",1,"chart"],[3,"data","config"],["id","chart-2",1,"chart"],["direction","column","align","center",1,"stats"],[1,"stat-line"],["size","l",3,"innerHTML"],["size","l",1,"clickable",3,"innerHTML"],["direction","column","align","center",1,"sizes"],["size","l"],[3,"navigated","data","config"],["size","l",1,"clickable",3,"click","innerHTML"]],template:function(n,c){if(1&n&&(t.j41(0,"cue-flexcontainer",0)(1,"div",1),t.bIt("click",function(){return c.handleCanvasClick()}),t.SS7(2)(3)(4),t.j41(5,"div",2),t.nVh(6,O,1,2,"cue-block-documents-by-suffix",3),t.k0s(),t.j41(7,"div",4),t.nVh(8,N,1,2,"cue-block-documents-by-content-category",3),t.k0s(),t.j41(9,"cue-flexcontainer",5)(10,"div",6),t.nVh(11,E,2,6,"cue-typography",7),t.k0s(),t.j41(12,"div",6),t.nVh(13,A,2,6,"cue-typography",8),t.k0s()(),t.j41(14,"cue-flexcontainer",9)(15,"div",6),t.nVh(16,G,2,1,"cue-typography",10),t.k0s(),t.j41(17,"div",6),t.nVh(18,$,2,3,"cue-typography",10),t.k0s()()()()),2&n){let s;t.R7$(2);const o=t.bH3(c.bySuffix());t.R7$();const l=t.bH3(c.byContentCategory());t.R7$(),t.bH3(c.configWithFilterResolver()),t.R7$(),t.xc7("opacity",o?1:0),t.R7$(),t.vxM(o?6:-1),t.R7$(),t.xc7("opacity",l?1:0),t.R7$(),t.vxM(l?8:-1),t.R7$(3),t.vxM(null!==c.openFormatPct()?11:-1),t.R7$(2),t.vxM((s=c.duplicateCount())?13:-1,s),t.R7$(3),t.vxM(c.size()>0?16:-1),t.R7$(2),t.vxM(c.sizeFiltered()>0?18:-1)}},dependencies:[P.Typography,z.n,_.o,C.Y,S.Kj],styles:[".container[_ngcontent-%COMP%]{height:700px;width:100%;position:relative;overflow:hidden}.chart[_ngcontent-%COMP%]{position:absolute;width:470px;height:350px;transition:opacity .5s ease-in-out}#chart-1[_ngcontent-%COMP%]{top:20px;left:0}#chart-2[_ngcontent-%COMP%]{bottom:50px;right:0}.stats[_ngcontent-%COMP%]{position:absolute;right:230px;top:180px;transform:translate(50%);min-height:80px;justify-content:center}.sizes[_ngcontent-%COMP%]{position:absolute;left:230px;bottom:180px;transform:translate(-50%);min-height:80px;justify-content:center}.stat-line[_ngcontent-%COMP%]{height:32px;display:flex;align-items:center;justify-content:center}.clickable[_ngcontent-%COMP%]:hover{cursor:pointer;transform:scale(1.05)}"],changeDetection:0})}return i})()},1493(F,B,a){function v(f,r=!1,u=1){const y=r?1e3:1024;if(Math.abs(f)<y)return f+" B";const _=r?["kB","MB","GB","TB","PB","EB","ZB","YB"]:["KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"];let C=-1;const D=10**u;do{f/=y,++C}while(Math.round(Math.abs(f)*D)/D>=y&&C<_.length-1);return f.toFixed(u)+" "+_[C]}a.d(B,{b:()=>v})}}]);
package/7056.js DELETED
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[4613,7056],{4613(x,v,l){l.d(v,{Logo:()=>o});var u=l(7705),a=l(5547),t=l(5802),r=l(2271),h=l(6170);let o=(()=>{class g{size=(0,u.hFB)("m");sizeMap={xs:"40px",s:"80px",m:"160px",l:"222px",xl:"320px"};active=(0,u.hFB)(!0,{transform:u.L39});continuous=(0,u.hFB)(!1,{transform:u.L39});mode=(0,u.hFB)("default");isDarkMode=(0,u.geq)(!1);handleDarkModeChange(i){this.isDarkMode.set(i),-1===this.raf&&this.animate()}colorA=(0,r.EW)(()=>this.isDarkMode()?[221,246,18]:[18,28,43]);colorB=[0,202,204];paths=[];raf=-1;playfulPhase="idle";playfulIdleUntil=0;playfulAnimStart=0;playfulAnimDuration=2e3;playfulRetractAmount=.3;appearTime=0;disappearTime=0;tip=0;toe=0;mix=[0,0,0];norm=0;animate=i=>{if(void 0!==i){const e=5e-4*(i-this.appearTime);"glow"===this.mode()?this.tip=e%1:"playful"!==this.mode()&&(this.tip=Math.min(1,e),this.active()||(this.toe=Math.min(1,6e-4*(i-this.disappearTime))))}if("playful"===this.mode())return void 0!==i&&("idle"===this.playfulPhase?i>=this.playfulIdleUntil&&(this.playfulPhase="animating",this.playfulAnimStart=i,this.playfulRetractAmount=.2+.75*Math.random(),this.playfulAnimDuration=2*this.playfulRetractAmount/5e-4):(i-this.playfulAnimStart)/this.playfulAnimDuration>=1&&(this.playfulPhase="idle",this.playfulIdleUntil=i+1e3+4e3*Math.random())),this.renderPlayful(i),void(void 0!==i&&(this.raf=requestAnimationFrame(this.animate)));if("glow"===this.mode()){const e=.06666666666666667,n=this.rgbToSvg(this.colorA());return this.paths.forEach((s,d)=>{this.norm=1/this.paths.length*d;let m=this.tip-this.norm;if(m<-(1-e)&&(m+=1),m>=0&&m<e){const p=1-m/e;s.setAttribute("stroke",this.rgbToSvg(this.colorB)),s.setAttribute("stroke-opacity",p.toFixed(3))}else s.setAttribute("stroke",n),s.setAttribute("stroke-opacity","0.005")}),void(this.raf=requestAnimationFrame(this.animate))}if(this.paths.forEach((e,n)=>{this.norm=1/this.paths.length*n,this.mix=this.mixRgb(this.colorA(),this.colorB,Math.max(0,Math.min(1,15*(this.tip-this.norm)))),e.setAttribute("stroke",this.tip*this.paths.length>n&&(this.active()||this.toe*this.paths.length<n)?this.rgbToSvg(this.mix):"transparent")}),this.tip>=1&&(this.active()||this.toe>=1))return this.continuous()?void setTimeout(()=>{this.appearTime=performance.now(),this.tip=0,this.toe=0,this.raf=requestAnimationFrame(this.animate)},500):void(this.raf=-1);this.raf=requestAnimationFrame(this.animate)};activate(){this.appearTime=performance.now(),"playful"===this.mode()&&(this.playfulPhase="intro",this.playfulAnimStart=this.appearTime),this.animate(this.appearTime)}deactivate(){this.disappearTime=performance.now(),-1===this.raf&&this.animate(this.disappearTime)}renderPlayful(i){if(void 0===i)return void this.renderPlayfulDraw(1);const e=Math.min(1,5e-4*(i-this.playfulAnimStart));if("intro"===this.playfulPhase)this.renderPlayfulDraw(e),e>=1&&(this.playfulPhase="idle",this.playfulIdleUntil=i+1e3+4e3*Math.random());else if("idle"===this.playfulPhase)this.renderPlayfulDraw(1);else{const n=Math.min(1,(i-this.playfulAnimStart)/this.playfulAnimDuration),d=1-this.playfulRetractAmount*(1-Math.cos(2*n*Math.PI))/2;this.renderPlayfulDraw(d)}}renderPlayfulDraw(i){const e=this.paths.length,n=this.colorA();this.paths.forEach((s,d)=>{if(this.norm=d/e,i*e>d){const m=Math.max(0,Math.min(1,15*(i-this.norm)));this.mix=this.mixRgb(n,this.colorB,m),s.setAttribute("stroke",this.rgbToSvg(this.mix)),s.setAttribute("stroke-opacity","1")}else s.setAttribute("stroke","transparent")})}mixChannel(i,e,n){return parseInt((i*n+e*(1-n)).toFixed())}mixRgb(i,e,n){return[this.mixChannel(i[0],e[0],n),this.mixChannel(i[1],e[1],n),this.mixChannel(i[2],e[2],n)]}rgbToSvg(i){return`rgb(${i[0]},${i[1]},${i[2]})`}constructor(){(0,t.QZP)(()=>{"glow"===this.mode()||"playful"===this.mode()||this.active()?this.activate():this.deactivate()}),(0,t.QZP)(()=>{this.isDarkMode(),this.animate()});const i=(0,t.WQX)(a.aKT);(0,a.mal)({read:()=>{if(this.paths.length)return;const e=i.nativeElement.querySelector("svg"),n=i.nativeElement.querySelector("#original-path");if(!n)return;const s=n.getTotalLength(),m=[];for(let p=0;p<400;p++){const f=n.getPointAtLength(s/400*p);m.push({x:parseFloat(f.x.toFixed(2)),y:parseFloat(f.y.toFixed(2))})}m.push(n.getPointAtLength(s)),m.reverse(),m.forEach((p,f)=>{if(0===f||1===f)return;const M=document.createElementNS("http://www.w3.org/2000/svg","path");M.setAttribute("d",`M${m[f-2].x},${m[f-2].y}L${m[f-1].x},${m[f-1].y}L${p.x},${p.y}`),M.setAttribute("fill","none"),M.setAttribute("stroke","transparent"),M.setAttribute("stroke-width",n?.getAttribute("stroke-width")||"1"),M.setAttribute("stroke-miterlimit",n?.getAttribute("stroke-miterlimit")||"1"),e.appendChild(M),this.paths.push(M)})}})}ngOnDestroy(){this.paths=[],cancelAnimationFrame(this.raf),this.raf=-1}static \u0275fac=function(e){return new(e||g)};static \u0275cmp=a.VBU({type:g,selectors:[["cue-logo"]],hostVars:2,hostBindings:function(e,n){2&e&&a.xc7("width",n.sizeMap[n.size()])},inputs:{size:[1,"size"],active:[1,"active"],continuous:[1,"continuous"],mode:[1,"mode"],isDarkMode:[1,"isDarkMode"]},outputs:{isDarkMode:"isDarkModeChange"},decls:2,vars:0,consts:[["cueDarkMode","","xmlns","http://www.w3.org/2000/svg","viewBox","0 0 221.545 86.191","width","222","height","86","overflow","visible",3,"darkModeChange"],["id","original-path","fill","none","stroke","transparent","stroke-miterlimit","10","stroke-width","12","d","M216.046 56.638s-10.561 24.201-36.192 22.991c-25.631-1.21-22.771-24.751-20.351-37.622 2.42-12.871 10.451-20.351 16.831-18.041 6.283 2.275 8.03 9.68 2.09 21.891-5.94 12.211-21.341 37.567-35.862 33.992-12.413-3.056-13.281-23.162-13.281-23.162V29.762v26.925c0 14.471-12.47 23.212-24.672 23.212s-24.672-8.301-24.672-23.212V29.829l-.006.105v13.031c0 20.416-16.55 36.966-36.966 36.966S6 63.381 6 42.966 22.55 6 42.966 6c6.91 0 13.377 1.896 18.91 5.196"]],template:function(e,n){1&e&&(t.qSk(),a.j41(0,"svg",0),a.bIt("darkModeChange",function(d){return n.handleDarkModeChange(d)}),a.nrm(1,"path",1),a.k0s())},dependencies:[h.R],styles:["[_nghost-%COMP%]{display:block}svg[_ngcontent-%COMP%]{flex:1;display:block;width:100%;height:auto}"]})}return g})()},6279(x,v,l){l.d(v,{D:()=>c});var u=l(7705),a=l(2271),t=l(2245),r=l(7089),h=l(5547);const o=[[["","before",""]],"*",[["","after",""]]],g=["[before]","*","[after]"];let c=(()=>{class i{selected=(0,u.hFB)(!1);disabled=(0,u.hFB)(!1);size=(0,u.hFB)("s");tooltip=(0,u.hFB)("");getClass=(0,a.EW)(()=>this.selected()?"selected":"");getTabindex=(0,a.EW)(()=>this.disabled()||this.selected()?"-1":"0");getStyles=(0,a.EW)(()=>`min-width: var(--cue-menu-item-${this.size()}-min-width);\n width: 100%;`);static \u0275fac=function(s){return new(s||i)};static \u0275cmp=h.VBU({type:i,selectors:[["cue-menu-item"]],inputs:{selected:[1,"selected"],disabled:[1,"disabled"],size:[1,"size"],tooltip:[1,"tooltip"]},ngContentSelectors:g,decls:6,vars:8,consts:[["tooltipPlacement","right",3,"disabled","cueTooltip"],[3,"noWrap"],[1,"flexer"]],template:function(s,d){1&s&&(h.NAR(o),h.j41(0,"button",0),h.SdG(1),h.j41(2,"cue-typography",1),h.SdG(3,1),h.k0s(),h.nrm(4,"div",2),h.SdG(5,2),h.k0s()),2&s&&(h.Aen(d.getStyles()),h.HbH(d.getClass()),h.Y8G("disabled",d.disabled())("cueTooltip",d.tooltip()),h.BMQ("tabIndex",d.getTabindex()),h.R7$(2),h.Y8G("noWrap",!0))},dependencies:[t.Typography,r.d],styles:["[_nghost-%COMP%]{display:contents}button[_ngcontent-%COMP%]{appearance:none;font:inherit;display:flex;border:0;align-items:center;justify-content:start;background:transparent;height:var(--cue-menu-item-height);border-radius:var(--cue-menu-item-border-radius);padding:0 var(--cue-menu-item-padding-x);gap:0 var(--cue-menu-item-gap);--cue-icon-width: var(--cue-menu-item-icon-size);background:var(--cue-menu-item-background-color)}button[_ngcontent-%COMP%]:focus{outline:none}button[_ngcontent-%COMP%]:hover:not(:disabled), button[_ngcontent-%COMP%]:focus:not(:disabled){background:var(--cue-menu-item-focus-background-color)}button.selected[_ngcontent-%COMP%]{background:var(--cue-menu-item-selected-background-color)!important}button[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:default!important;background:var(--cue-menu-item-background-color)!important}button[_ngcontent-%COMP%]:hover{cursor:pointer}button[_ngcontent-%COMP%]:disabled:hover{cursor:not-allowed}.flexer[_ngcontent-%COMP%]{flex:1}"]})}return i})()},356(x,v,l){l.d(v,{M:()=>h});var u=l(7705),a=l(2271),t=l(5547);const r=["*"];let h=(()=>{class o{maxHeight=(0,u.hFB)(void 0);size=(0,u.hFB)(void 0);maxHeightStyle=(0,a.EW)(()=>{const c=this.maxHeight();if(void 0!==c)return"number"==typeof c?`${c}px`:c});static \u0275fac=function(i){return new(i||o)};static \u0275cmp=t.VBU({type:o,selectors:[["cue-menu-wrap"]],hostVars:4,hostBindings:function(i,e){2&i&&(t.HbH(e.size()?"size-"+e.size():""),t.xc7("max-height",e.maxHeightStyle()))},inputs:{maxHeight:[1,"maxHeight"],size:[1,"size"]},ngContentSelectors:r,decls:2,vars:0,consts:[[1,"cue-menu-wrap-inner"]],template:function(i,e){1&i&&(t.NAR(),t.rj2(0,"div",0),t.SdG(1),t.eux())},styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:var(--cue-menu-gap);padding:var(--cue-menu-padding-y) var(--cue-menu-padding-x);border-radius:var(--cue-menu-border-radius);border:1px solid var(--cue-menu-border-color);background:var(--cue-menu-background-color);color:var(--cue-menu-foreground-color);max-height:var(--cue-menu-max-height);overflow-y:auto}.size-s[_nghost-%COMP%]{font-size:13px;--cue-menu-item-height: var(--cue-dim-elem-s);--cue-menu-item-padding-x: 10px;--cue-menu-item-gap: 10px;--cue-menu-item-icon-size: 16px;--cue-menu-padding-y: 6px;--cue-menu-padding-x: 6px;--cue-menu-gap: 4px}.size-xs[_nghost-%COMP%]{font-size:12px;--cue-menu-item-height: var(--cue-dim-elem-xs);--cue-menu-item-padding-x: 8px;--cue-menu-item-gap: 8px;--cue-menu-item-icon-size: 14px;--cue-menu-padding-y: 4px;--cue-menu-padding-x: 4px;--cue-menu-gap: 2px}.cue-menu-wrap-inner[_ngcontent-%COMP%]{--cue-input-value-color: var(--cue-menu-foreground-color);width:100%;height:100%;display:flex;flex-direction:column;gap:var(--cue-menu-gap)}"]})}return o})()},6117(x,v,l){l.d(v,{W:()=>i});var u=l(7705),a=l(7023),t=l(5547);const r=["contextMenuDirective"],h=[[["","trigger",""]],[["","menu",""]],[["","menu",""]]],o=["[trigger]","[menu]","[menu]"];function g(e,n){1&e&&t.SdG(0,1)}function c(e,n){1&e&&t.SdG(0,2)}let i=(()=>{class e{contextMenuData=(0,u.hFB)({});trigger=(0,u.hFB)("leftclick");positioning=(0,u.hFB)(void 0);size=(0,u.hFB)("m");contextEnabled=(0,u.hFB)(!0);menuClosed=(0,u.CGW)();keepOpenOnInsideClick=(0,u.hFB)(!1);contextMenuDirective=(0,u.ebz)("contextMenuDirective",{read:a.Q});onMenuClose(){this.menuClosed.emit()}closeMenu(){const s=this.contextMenuDirective();s&&s.closeContextMenu()}static \u0275fac=function(d){return new(d||e)};static \u0275cmp=t.VBU({type:e,selectors:[["cue-menu"]],viewQuery:function(d,m){1&d&&t.wEZ(m.contextMenuDirective,r,5,a.Q),2&d&&t.NyB()},inputs:{contextMenuData:[1,"contextMenuData"],trigger:[1,"trigger"],positioning:[1,"positioning"],size:[1,"size"],contextEnabled:[1,"contextEnabled"],keepOpenOnInsideClick:[1,"keepOpenOnInsideClick"]},outputs:{menuClosed:"menuClosed"},ngContentSelectors:o,decls:7,vars:7,consts:[["contextMenuDirective",""],["menuTemplate",""],[3,"contextMenuClose","cueContextMenu","contextMenuData","cueContextEnabled","trigger","positioning","menuSize","keepOpenOnInsideClick"]],template:function(d,m){if(1&d&&(t.NAR(h),t.j41(0,"div",2,0),t.bIt("contextMenuClose",function(){return m.onMenuClose()}),t.SdG(2),t.k0s(),t.DNE(3,g,1,0,"ng-template",null,1,t.C5r)(5,c,1,0,"ng-template",null,1,t.C5r)),2&d){const p=t.sdS(4);t.Y8G("cueContextMenu",p)("contextMenuData",m.contextMenuData)("cueContextEnabled",m.contextEnabled())("trigger",m.trigger())("positioning",m.positioning())("menuSize",m.size())("keepOpenOnInsideClick",m.keepOpenOnInsideClick())}},dependencies:[a.Q],styles:["[_nghost-%COMP%]{display:block}"]})}return e})()},7023(x,v,l){l.d(v,{Q:()=>g});var u=l(7705),a=l(5547),t=l(5802),r=l(9769),h=l(9595);let o=(()=>{class c{template=u.hFB.required();context=(0,u.hFB)({});positioning=(0,u.hFB)("bottomright");size=(0,u.hFB)("m");menuClick=(0,u.CGW)();positioningClass=()=>this.positioning();static \u0275fac=function(n){return new(n||c)};static \u0275cmp=a.VBU({type:c,selectors:[["cue-context-menu-container"]],hostVars:2,hostBindings:function(n,s){2&n&&a.HbH("clickoutside-ignore size-"+s.size()+" "+s.positioning())},inputs:{template:[1,"template"],context:[1,"context"],positioning:[1,"positioning"],size:[1,"size"]},outputs:{menuClick:"menuClick"},decls:2,vars:4,consts:[[1,"context-menu-wrapper","clickoutside-ignore",3,"click"],[3,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(n,s){1&n&&(a.j41(0,"div",0),a.bIt("click",function(){return s.menuClick.emit()}),a.eu8(1,1),a.k0s()),2&n&&(a.HbH(s.positioningClass()),a.R7$(),a.Y8G("ngTemplateOutlet",s.template())("ngTemplateOutletContext",s.context()))},dependencies:[r.MD,r.T3],styles:["[_nghost-%COMP%]{position:fixed;pointer-events:auto;z-index:10000;min-width:10px;min-height:10px}.topleft[_nghost-%COMP%]{transform:translate(-100%,-100%)}.topright[_nghost-%COMP%]{transform:translateY(-100%)}.bottomleft[_nghost-%COMP%]{transform:translate(-100%)}.bottomright[_nghost-%COMP%]{transform:translate(0)}.rightstart[_nghost-%COMP%]{transform:translate(0)}.rightend[_nghost-%COMP%]{transform:translateY(-100%)}.leftstart[_nghost-%COMP%]{transform:translate(-100%)}.leftend[_nghost-%COMP%]{transform:translate(-100%,-100%)}.size-s[_nghost-%COMP%]{font-size:13px;--cue-menu-item-height: var(--cue-dim-elem-s);--cue-menu-item-padding-x: 10px;--cue-menu-item-gap: 10px;--cue-menu-item-icon-size: 16px;--cue-menu-padding-y: 6px;--cue-menu-padding-x: 6px;--cue-menu-gap: 4px}.size-xs[_nghost-%COMP%]{font-size:12px;--cue-menu-item-height: var(--cue-dim-elem-xs);--cue-menu-item-padding-x: 8px;--cue-menu-item-gap: 8px;--cue-menu-item-icon-size: 14px;--cue-menu-padding-y: 4px;--cue-menu-padding-x: 4px;--cue-menu-gap: 2px}.context-menu-wrapper[_ngcontent-%COMP%]{pointer-events:auto;min-width:150px;min-height:10px;cursor:pointer}"]})}return c})(),g=(()=>{class c{elementRef=(0,t.WQX)(a.aKT);applicationRef=(0,t.WQX)(a.o8S);environmentInjector=(0,t.WQX)(t.uvJ);mousePressHandler=h.B.getInstance();static openMenus=[];cueContextMenu=u.hFB.required();contextMenuData=(0,u.hFB)();cueContextEnabled=(0,u.hFB)(!0);trigger=(0,u.hFB)("rightclick");positioning=(0,u.hFB)(void 0);positionAtCursor=(0,u.hFB)(!1);menuSize=(0,u.hFB)("m");keepOpenOnInsideClick=(0,u.hFB)(!1);contextMenuOpen=(0,u.CGW)();contextMenuClose=(0,u.CGW)();contextMenuRef=null;documentClickHandlerAttached=!1;documentClickHandler=this.onDocumentClick.bind(this);documentScrollHandler=this.onDocumentScroll.bind(this);hoverTimeout=null;closeTimeout=null;hoverDelay=150;menuMouseEnterHandler=null;menuMouseLeaveHandler=null;boundOnShortRightPress=this.onShortRightPress.bind(this);boundOnShortLeftPress=this.onShortLeftPress.bind(this);boundOnLongRightPress=this.onLongRightPress.bind(this);boundOnLongLeftPress=this.onLongLeftPress.bind(this);constructor(){(0,t.QZP)(()=>{!this.cueContextEnabled()&&this.contextMenuRef&&setTimeout(()=>{this.contextMenuRef&&this.closeContextMenu()},0)})}ngOnInit(){const e=document.querySelectorAll("cue-context-menu-container");if(e.length>0){const n=new Set(c.openMenus.filter(s=>s.contextMenuRef).map(s=>s.contextMenuRef.location.nativeElement));e.forEach(s=>{s.parentNode&&!n.has(s)&&s.parentNode.removeChild(s)})}("rightclick"===this.trigger()||"both"===this.trigger()||"longpress"===this.trigger())&&this.mousePressHandler.setSuppressNativeContextMenu(!0),this.mousePressHandler.events.addListener("shortPressedRight",this.boundOnShortRightPress),this.mousePressHandler.events.addListener("shortPressedLeft",this.boundOnShortLeftPress),"longpress"===this.trigger()&&(this.mousePressHandler.events.addListener("longPressedRight",this.boundOnLongRightPress),this.mousePressHandler.events.addListener("longPressedLeft",this.boundOnLongLeftPress)),"hover"===this.trigger()&&(this.elementRef.nativeElement.addEventListener("mouseenter",this.onMouseEnter.bind(this)),this.elementRef.nativeElement.addEventListener("mouseleave",this.onMouseLeave.bind(this)))}onShortRightPress(e){if(this.isEventOnThisElement(e)&&("rightclick"===this.trigger()||"both"===this.trigger())){if(this.contextMenuRef)return e.preventDefault(),e.stopPropagation(),void this.closeContextMenu();if(!this.cueContextEnabled?.())return;e.preventDefault(),e.stopPropagation(),this.showContextMenu(e)}}onShortLeftPress(e){if(this.isEventOnThisElement(e)&&("leftclick"===this.trigger()||"both"===this.trigger())){if(this.contextMenuRef)return e.preventDefault(),e.stopPropagation(),void this.closeContextMenu();if(!this.cueContextEnabled?.())return;e.preventDefault(),e.stopPropagation(),this.showContextMenu(e)}}onLongRightPress(e){this.cueContextEnabled?.()&&this.isEventOnThisElement(e)&&("longpress"===this.trigger()||"rightclick"===this.trigger()||"both"===this.trigger())&&(e.preventDefault(),e.stopPropagation(),this.showContextMenu(e))}onLongLeftPress(e){this.cueContextEnabled?.()&&this.isEventOnThisElement(e)&&("longpress"===this.trigger()||"leftclick"===this.trigger()||"both"===this.trigger())&&(e.preventDefault(),e.stopPropagation(),this.showContextMenu(e))}isEventOnThisElement(e){return this.elementRef.nativeElement.contains(e.target)}onMouseEnter(e){!this.cueContextEnabled?.()||"hover"!==this.trigger()||(this.hoverTimeout&&(clearTimeout(this.hoverTimeout),this.hoverTimeout=null),this.closeTimeout&&(clearTimeout(this.closeTimeout),this.closeTimeout=null),c.openMenus.slice().forEach(n=>{n!==this&&(n.contextMenuRef?.location.nativeElement?.contains(this.elementRef.nativeElement)||n.closeContextMenu())}),this.contextMenuRef||(this.hoverTimeout=setTimeout(()=>{this.showContextMenu(e)},this.hoverDelay)))}onMouseLeave(e){!this.cueContextEnabled?.()||"hover"!==this.trigger()||(this.hoverTimeout&&(clearTimeout(this.hoverTimeout),this.hoverTimeout=null),this.closeTimeout&&(clearTimeout(this.closeTimeout),this.closeTimeout=null),this.closeTimeout=setTimeout(()=>{this.contextMenuRef&&this.closeContextMenu()},this.hoverDelay))}onDocumentClick(e){if(!this.contextMenuRef)return;const s=this.contextMenuRef.location.nativeElement.contains(e.target),d=this.elementRef.nativeElement.contains(e.target);if(!s&&!d){if(this.keepOpenOnInsideClick()){const m=e.target;if(c.openMenus.some(f=>{const M=f.contextMenuRef?.location.nativeElement;return!!M&&M.contains(m)}))return}this.closeContextMenu()}}onDocumentScroll(e){this.contextMenuRef&&(this.contextMenuRef.location.nativeElement.contains(e.target)||this.closeContextMenu())}showContextMenu(e){const n=this.elementRef.nativeElement.getBoundingClientRect();c.openMenus.forEach(M=>{M!==this&&(M.contextMenuRef?.location.nativeElement?.contains(this.elementRef.nativeElement)||M.closeContextMenu())}),this.closeContextMenu();const s=this.calculatePositioning(e,n),d=this.cueContextMenu();if(!(d&&d instanceof a.C4Q))return void console.error("Invalid template provided to context menu");this.contextMenuRef=(0,u.a0P)(o,{environmentInjector:this.environmentInjector}),this.contextMenuRef.setInput("template",d),this.contextMenuRef.setInput("context",{$implicit:this.contextMenuData(),event:e}),this.contextMenuRef.setInput("positioning",s),this.contextMenuRef.setInput("size",this.menuSize());const m=this.contextMenuRef.instance.menuClick.subscribe(()=>{this.closeContextMenu()}),p=this.contextMenuRef.location.nativeElement;p.style.zIndex="10000","hover"!==this.trigger()||this.positionAtCursor()?(p.style.left=`${e.clientX}px`,p.style.top=`${e.clientY}px`):this.positionSubmenu(p,s,n),this.applicationRef.attachView(this.contextMenuRef.hostView),(this.elementRef.nativeElement.closest("dialog")||document.body).appendChild(p),this.contextMenuRef._menuClickSubscription=m,"hover"===this.trigger()&&(this.menuMouseEnterHandler=()=>{this.closeTimeout&&(clearTimeout(this.closeTimeout),this.closeTimeout=null)},this.menuMouseLeaveHandler=()=>{this.closeTimeout&&(clearTimeout(this.closeTimeout),this.closeTimeout=null),this.closeTimeout=setTimeout(()=>{this.contextMenuRef&&this.closeContextMenu()},this.hoverDelay)},p.addEventListener("mouseenter",this.menuMouseEnterHandler),p.addEventListener("mouseleave",this.menuMouseLeaveHandler)),this.documentClickHandlerAttached||(document.addEventListener("mousedown",this.documentClickHandler,!0),document.addEventListener("contextmenu",this.documentClickHandler,!0),document.addEventListener("scroll",this.documentScrollHandler,!0),this.documentClickHandlerAttached=!0),c.openMenus.includes(this)||c.openMenus.push(this),this.contextMenuOpen.emit({event:e,data:this.contextMenuData(),suggestedPositioning:s})}calculatePositioning(e,n){const s=this.positioning();if(s)return s;if("hover"===this.trigger()&&!this.positionAtCursor())return this.calculateSubmenuPositioning(n);const d=window.innerWidth,m=window.innerHeight,f=e.clientX>d-200,M=e.clientY>m-200;return f&&M?"topleft":f?"bottomleft":M?"topright":"bottomright"}calculateSubmenuPositioning(e){const n=window.innerWidth,s=window.innerHeight,C=n-e.right>=300,_=s-e.bottom>=150;return C&&_?"rightstart":C&&!_?"rightend":!C&&_?"leftstart":"leftend"}positionSubmenu(e,n,s){const m=this.elementRef.nativeElement.closest?.("cue-context-menu-container")?.getBoundingClientRect()??s;switch(n){case"rightstart":default:e.style.left=`${m.right}px`,e.style.top=`${s.top}px`;break;case"rightend":e.style.left=`${m.right}px`,e.style.top=`${s.bottom}px`;break;case"leftstart":e.style.left=`${m.left}px`,e.style.top=`${s.top}px`;break;case"leftend":e.style.left=`${m.left}px`,e.style.top=`${s.bottom}px`}requestAnimationFrame(()=>{if(!e.isConnected)return;const f=(e.querySelector(".context-menu-wrapper")??e).getBoundingClientRect(),M=window.innerWidth,C=window.innerHeight;let E=parseFloat(e.style.left)||0,y=parseFloat(e.style.top)||0;f.right>M-8&&(E-=f.right-(M-8)),f.left<8&&(E+=8-f.left),f.bottom>C-8&&(y-=f.bottom-(C-8)),f.top<8&&(y+=8-f.top),e.style.left=`${E}px`,e.style.top=`${y}px`})}closeContextMenu(){if(this.contextMenuRef){const n=this.contextMenuRef.location.nativeElement;this.menuMouseEnterHandler&&(n.removeEventListener("mouseenter",this.menuMouseEnterHandler),this.menuMouseEnterHandler=null),this.menuMouseLeaveHandler&&(n.removeEventListener("mouseleave",this.menuMouseLeaveHandler),this.menuMouseLeaveHandler=null),this.documentClickHandlerAttached&&(document.removeEventListener("mousedown",this.documentClickHandler,!0),document.removeEventListener("contextmenu",this.documentClickHandler,!0),document.removeEventListener("scroll",this.documentScrollHandler,!0),this.documentClickHandlerAttached=!1);const s=this.contextMenuRef._menuClickSubscription;s&&s.unsubscribe(),this.closeTimeout&&(clearTimeout(this.closeTimeout),this.closeTimeout=null);try{n.parentNode?n.parentNode.removeChild(n):document.body.contains(n)&&document.body.removeChild(n)}catch{try{n.remove&&n.remove()}catch{}}this.applicationRef.detachView(this.contextMenuRef.hostView),this.contextMenuRef.destroy(),this.contextMenuRef=null,this.contextMenuClose.emit()}const e=c.openMenus.indexOf(this);e>-1&&c.openMenus.splice(e,1)}ngOnDestroy(){this.mousePressHandler.setSuppressNativeContextMenu(!1),this.mousePressHandler.events.removeListener("shortPressedRight",this.boundOnShortRightPress),this.mousePressHandler.events.removeListener("shortPressedLeft",this.boundOnShortLeftPress),this.mousePressHandler.events.removeListener("longPressedRight",this.boundOnLongRightPress),this.mousePressHandler.events.removeListener("longPressedLeft",this.boundOnLongLeftPress),"hover"===this.trigger()&&(this.elementRef.nativeElement.removeEventListener("mouseenter",this.onMouseEnter),this.elementRef.nativeElement.removeEventListener("mouseleave",this.onMouseLeave)),this.hoverTimeout&&clearTimeout(this.hoverTimeout),this.closeTimeout&&clearTimeout(this.closeTimeout),this.closeContextMenu()}static \u0275fac=function(n){return new(n||c)};static \u0275dir=a.FsC({type:c,selectors:[["","cueContextMenu",""]],inputs:{cueContextMenu:[1,"cueContextMenu"],contextMenuData:[1,"contextMenuData"],cueContextEnabled:[1,"cueContextEnabled"],trigger:[1,"trigger"],positioning:[1,"positioning"],positionAtCursor:[1,"positionAtCursor"],menuSize:[1,"menuSize"],keepOpenOnInsideClick:[1,"keepOpenOnInsideClick"]},outputs:{contextMenuOpen:"contextMenuOpen",contextMenuClose:"contextMenuClose"}})}return c})()},6170(x,v,l){l.d(v,{R:()=>h});var u=l(7705),a=l(5802),t=l(2271),r=l(5547);let h=(()=>{class o{destroyRef=(0,a.WQX)(a.abz);_isDarkMode=(0,a.vPA)(this.hasDarkClass());isDarkMode=(0,t.EW)(()=>this._isDarkMode());darkModeChange=(0,u.CGW)();constructor(){const c=new MutationObserver(i=>{i.forEach(e=>{if("attributes"===e.type&&"class"===e.attributeName){const n=this.hasDarkClass();n!==this._isDarkMode()&&this._isDarkMode.set(n)}})});c.observe(document.body,{attributes:!0,attributeFilter:["class"]}),this.destroyRef.onDestroy(()=>c.disconnect()),(0,a.QZP)(()=>{this.darkModeChange.emit(this._isDarkMode()),document.documentElement.style.colorScheme=this._isDarkMode()?"dark":"light"})}hasDarkClass(){return document.body.classList.contains("dark")}toggleDarkMode(){document.body.classList.toggle("dark")}static \u0275fac=function(i){return new(i||o)};static \u0275dir=r.FsC({type:o,selectors:[["","cueDarkMode",""]],outputs:{darkModeChange:"darkModeChange"},exportAs:["darkModeDetector"]})}return o})()},7851(x,v,l){l.d(v,{k:()=>c});var u=l(7705),a=l(5547),t=l(5802),r=l(4613),h=l(2245);function o(i,e){if(1&i&&(a.j41(0,"cue-typography",1),a.EFF(1),a.k0s()),2&i){const n=a.XpG();a.R7$(),a.JRh(n.message)}}let g=(()=>{class i{message="";static \u0275fac=function(s){return new(s||i)};static \u0275cmp=a.VBU({type:i,selectors:[["cue-logo-loader-overlay"]],decls:2,vars:1,consts:[["size","m","mode","glow"],["size","s",1,"message"]],template:function(s,d){1&s&&(a.nrm(0,"cue-logo",0),a.nVh(1,o,2,1,"cue-typography",1)),2&s&&(a.R7$(),a.vxM(d.message?1:-1))},dependencies:[r.Logo,h.Typography],styles:["[_nghost-%COMP%]{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.75rem;z-index:1000;pointer-events:none}.message[_ngcontent-%COMP%]{color:var(--color-text-secondary)}"],changeDetection:0})}return i})(),c=(()=>{class i{cueLogoLoader=(0,u.hFB)(!1);cueLogoLoaderMessage=(0,u.hFB)("");el=(0,t.WQX)(a.aKT);appRef=(0,t.WQX)(a.o8S);envInjector=(0,t.WQX)(t.uvJ);renderer=(0,t.WQX)(a.sFG);overlayRef;constructor(){(0,t.QZP)(()=>{const n=this.cueLogoLoader(),s=this.cueLogoLoaderMessage();n?(this.overlayRef||this.createOverlay(),this.overlayRef&&(this.overlayRef.instance.message=s,this.overlayRef.changeDetectorRef.markForCheck())):this.destroyOverlay()})}createOverlay(){this.overlayRef=(0,u.a0P)(g,{environmentInjector:this.envInjector}),this.appRef.attachView(this.overlayRef.hostView),this.renderer.appendChild(this.el.nativeElement,this.overlayRef.hostView.rootNodes[0])}destroyOverlay(){this.overlayRef&&(this.appRef.detachView(this.overlayRef.hostView),this.overlayRef.destroy(),this.overlayRef=void 0)}ngOnDestroy(){this.destroyOverlay()}static \u0275fac=function(s){return new(s||i)};static \u0275dir=a.FsC({type:i,selectors:[["","cueLogoLoader",""]],hostVars:2,hostBindings:function(s,d){2&s&&a.xc7("position","relative")},inputs:{cueLogoLoader:[1,"cueLogoLoader"],cueLogoLoaderMessage:[1,"cueLogoLoaderMessage"]}})}return i})()},9595(x,v,l){l.d(v,{B:()=>t});var u=l(1339);let a=(()=>{class r{static _instance;_pressTimer;_shortPressDuration=300;_longPressDuration=1e3;_pressTime;_emittedLongPress=!1;events=new u.EventEmitter;constructor(){document.addEventListener("keydown",o=>{void 0===this._pressTime&&(this._pressTime=(new Date).getTime(),this._pressTimer=setTimeout(()=>{this._handleLongPress(o.key),this._emittedLongPress=!0,clearTimeout(this._pressTimer)},this._longPressDuration),this.events.emit("holdingKey",o.key))}),document.addEventListener("keyup",o=>{void 0!==this._pressTime&&(clearTimeout(this._pressTimer),this._pressTime-(new Date).getTime()<this._shortPressDuration&&!this._emittedLongPress&&this._handleShortPress(o.key),this._reset(),this.events.emit("releasedKey",o.key))})}static getInstance(){return this._instance||(this._instance=new r),this._instance}_handleShortPress(o){"Escape"===o&&this.events.emit("shortPressedEsc"),this.events.emit("shortPressedKey",o)}_handleLongPress(o){"Escape"===o&&this.events.emit("longPressedEsc"),this.events.emit("longPressedKey",o)}_reset(){this._pressTime=void 0,this._emittedLongPress=!1}}return r})(),t=(()=>{class r{static _instance;_pressTimer;_shortPressDuration=200;_pressTime;_emittedLongPress=!1;_holdingControl=!1;_keyPressHandler=a.getInstance();_suppressNativeContextMenu=!1;events=new u.EventEmitter;constructor(){this._keyPressHandler.events.addListener("holdingKey",o=>{this._holdingControl="Control"===o}),this._keyPressHandler.events.addListener("releasedKey",o=>{"Control"===o&&(this._holdingControl=!1)}),document.addEventListener("mousedown",o=>{void 0===this._pressTime&&(this._pressTime=(new Date).getTime(),this._pressTimer=setTimeout(()=>{this._handlePress(o,"long"),this._emittedLongPress=!0,clearTimeout(this._pressTimer)},this._shortPressDuration))}),document.addEventListener("mouseup",o=>{void 0!==this._pressTime&&(clearTimeout(this._pressTimer),this._pressTime-(new Date).getTime()<this._shortPressDuration&&!this._emittedLongPress&&this._handlePress(o,"short"),this._reset())}),document.addEventListener("contextmenu",o=>{this._suppressNativeContextMenu&&(o.preventDefault(),o.stopPropagation())})}static getInstance(){return this._instance||(this._instance=new r),this._instance}setSuppressNativeContextMenu(o){this._suppressNativeContextMenu=o}get suppressNativeContextMenu(){return this._suppressNativeContextMenu}_handlePress(o,g){0===o.button&&!this._holdingControl&&this.events.emit(`${g}PressedLeft`,o),0===o.button&&this._holdingControl&&this.events.emit(`${g}PressedRight`,o),2===o.button&&this.events.emit(`${g}PressedRight`,o)}_reset(){this._pressTime=void 0,this._emittedLongPress=!1}}return r})()},2001(x,v){var l=this&&this.__spreadArrays||function(){for(var a=0,t=0,r=arguments.length;t<r;t++)a+=arguments[t].length;var h=Array(a),o=0;for(t=0;t<r;t++)for(var g=arguments[t],c=0,i=g.length;c<i;c++,o++)h[o]=g[c];return h};Object.defineProperty(v,"__esModule",{value:!0});var u=function(){return function a(){var t=this;this.events={},this.maxListeners=1/0,this.emit=function(r){for(var h=[],o=1;o<arguments.length;o++)h[o-1]=arguments[o];if(t.events[r]){for(var g=t.events[r].length,i=0,e=Array.from(t.events[r]);i<e.length;i++)e[i].apply(void 0,h);return!!g}return!1},this.on=function(r,h){return t.addListener(r,h),t},this.once=function(r,h){var o=function(){for(var g=[],c=0;c<arguments.length;c++)g[c]=arguments[c];h.apply(void 0,g),t.removeListener(r,o)};return t.addListener(r,o),t},this.addListener=function(r,h){return r in t.events?t.events[r].push(h):t.events[r]=[h],t.maxListeners!==1/0&&t.maxListeners<=t.events[r].length&&console.warn('Maximum event listeners for "'+r+'" event!'),t},this.removeListener=function(r,h){if(r in t.events){var o=t.events[r].indexOf(h);-1!==o&&t.events[r].splice(o,1)}return t},this.hasListeners=function(r){return t.events[r]&&!!t.events[r].length},this.prependListener=function(r,h){return r in t.events?t.events[r].unshift(h):t.events[r]=[h],t},this.prependOnceListener=function(r,h){var o=function(){for(var g=[],c=0;c<arguments.length;c++)g[c]=arguments[c];h.apply(void 0,g),t.removeListener(r,o)};return t.prependListener(r,o),t},this.off=function(r,h){return t.removeListener(r,h)},this.removeAllListeners=function(r){return delete t.events[r],t},this.setMaxListeners=function(r){return t.maxListeners=r,t},this.getMaxListeners=function(){return t.maxListeners},this.listeners=function(r){return l(t.events[r])},this.rawListeners=function(r){return t.events[r]},this.eventNames=function(){return Object.keys(t.events)},this.listenerCount=function(r){return t.events[r]&&t.events[r].length||0}}}();v.EventEmitter=u},1339(x,v,l){function u(a){for(var t in a)v.hasOwnProperty(t)||(v[t]=a[t])}Object.defineProperty(v,"__esModule",{value:!0}),u(l(9146)),u(l(2001))},9146(x,v){Object.defineProperty(v,"__esModule",{value:!0}),v.asTypedEventEmitter=function l(u){return u}}}]);