@aquera/data-visualizer-sdk 0.0.7 → 0.0.9

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.
@@ -0,0 +1 @@
1
+ import{a,b}from"./chunk-XWT4F6AG.js";import"./chunk-JBOPWBL6.js";import"./chunk-JP5QY5S6.js";import"./chunk-Z5FDX7CX.js";import"./chunk-FK6H3RFT.js";import"./chunk-SYVY7IJY.js";import"./chunk-DPY4ZJSO.js";import"./chunk-T3NXAI3H.js";import"./chunk-JWVGGQEQ.js";import"./chunk-T4WJW6GR.js";import"./chunk-QXVITQOV.js";import"./chunk-I4TM4AGJ.js";import"./chunk-F6YL5NFN.js";import"./chunk-ATUZQYGW.js";import"./chunk-XCT4UKLK.js";import"./chunk-4XZ7RFFX.js";import"./chunk-YHTLTPEH.js";import"./chunk-LFSX3TZJ.js";import"./chunk-BTDKTIE6.js";import"./chunk-5CTM6JVQ.js";import"./chunk-W2HKCDVZ.js";import"./chunk-MPGDQZRI.js";import"./chunk-HOS2FAXH.js";import"./chunk-INJSG5RK.js";import"./chunk-RCWO45CI.js";import"./chunk-ZW5NV4UO.js";export{a as DVZ_DASHBOARDS_TAG,b as defineDvzDashboards};
@@ -0,0 +1,5 @@
1
+ var Z=(function(){var t={trace:function(){},yy:{},symbols_:{error:2,expressions:3,e:4,EndOfExpression:5,"-":6,"+":7,"*":8,"/":9,"^":10,mod:11,and:12,or:13,not:14,if:15,then:16,else:17,in:18,notIn:19,"(":20,")":21,Arguments:22,",":23,Number:24,Symbol:25,String:26,of:27,Relation:28,"%":29,"?":30,":":31,RelationalOperator:32,"==":33,"!=":34,"~=":35,"<":36,"<=":37,">=":38,">":39,$accept:0,$end:1},terminals_:{2:"error",5:"EndOfExpression",6:"-",7:"+",8:"*",9:"/",10:"^",11:"mod",12:"and",13:"or",14:"not",15:"if",16:"then",17:"else",18:"in",19:"notIn",20:"(",21:")",23:",",24:"Number",25:"Symbol",26:"String",27:"of",29:"%",30:"?",31:":",33:"==",34:"!=",35:"~=",36:"<",37:"<=",38:">=",39:">"},productions_:[0,[3,2],[4,2],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,2],[4,6],[4,3],[4,3],[4,3],[4,5],[4,1],[4,1],[4,1],[4,3],[4,3],[4,4],[4,1],[4,3],[4,5],[32,1],[32,1],[32,1],[32,1],[32,1],[32,1],[32,1],[28,3],[28,3],[22,1],[22,3]],performAction:function(i,o,a,f,u,e,x){var n=e.length-1;switch(u){case 1:return e[n-1];case 2:this.$=["(","ops['-'](",e[n],")",")"];break;case 3:this.$=["(","ops['",e[n-1],"'](",e[n-2],", ",e[n],")",")"];break;case 4:this.$=["(","ops['",e[n-1],"'](",e[n-2],", ",e[n],")",")"];break;case 5:this.$=["(","ops['",e[n-1],"'](",e[n-2],", ",e[n],")",")"];break;case 6:this.$=["(","ops['",e[n-1],"'](",e[n-2],", ",e[n],")",")"];break;case 7:this.$=["(","ops['",e[n-1],"'](",e[n-2],", ",e[n],")",")"];break;case 8:this.$=["(","ops.mod(",e[n-2],", ",e[n],")",")"];break;case 9:this.$=["(","","std.coerceBoolean","(",e[n-2],") && ","std.coerceBoolean","(",e[n],")",")"];break;case 10:this.$=["(","","std.coerceBoolean","(",e[n-2],") || ","std.coerceBoolean","(",e[n],")",")"];break;case 11:this.$=["(","! ","std.coerceBoolean","(",e[n],")",")"];break;case 12:this.$=["(","","std.coerceBoolean","(",e[n-4],") ? ",e[n-2]," : ",e[n],"",")"];break;case 13:this.$=["(","std.isSubset(",e[n-2],", ",e[n],")",")"];break;case 14:this.$=["(","!std.isSubset(",e[n-2],", ",e[n],")",")"];break;case 15:this.$=["(","",e[n-1],"",")"];break;case 16:this.$=["(","[ ",e[n-3],", ",e[n-1]," ]",")"];break;case 17:this.$=["",e[n],""];break;case 18:this.$=["prop(",e[n],", data)"];break;case 19:this.$=["",e[n],""];break;case 20:this.$=["prop(",e[n-2],", ",e[n],")"];break;case 21:this.$=["call(",e[n-2],")"];break;case 22:this.$=["call(",e[n-3],", ",e[n-1],")"];break;case 23:this.$=f.reduceRelation(e[n]);break;case 24:this.$=["std.warnDeprecated('modulo', ops['mod'](",e[n-2],", ",e[n],"))"];break;case 25:this.$=["std.warnDeprecated('ternary', ","std.coerceBoolean","(",e[n-4],") ? ",e[n-2]," : ",e[n],")"];break;case 26:this.$=["=="];break;case 27:this.$=["!="];break;case 28:this.$=["~="];break;case 29:this.$=["<"];break;case 30:this.$=["<="];break;case 31:this.$=[">="];break;case 32:this.$=[">"];break;case 33:this.$=[e[n-2],e[n-1],...e[n]];break;case 34:this.$=[e[n-2],e[n-1],e[n]];break;case 35:this.$=["",e[n],""];break;case 36:this.$=["",e[n-2],", ",e[n],""];break}},table:[{3:1,4:2,6:[1,3],14:[1,4],15:[1,5],20:[1,6],24:[1,7],25:[1,8],26:[1,9],28:10},{1:[3]},{5:[1,11],6:[1,13],7:[1,12],8:[1,14],9:[1,15],10:[1,16],11:[1,17],12:[1,18],13:[1,19],18:[1,20],19:[1,21],29:[1,22],30:[1,23],32:24,33:[1,25],34:[1,26],35:[1,27],36:[1,28],37:[1,29],38:[1,30],39:[1,31]},{4:32,6:[1,3],14:[1,4],15:[1,5],20:[1,6],24:[1,7],25:[1,8],26:[1,9],28:10},{4:33,6:[1,3],14:[1,4],15:[1,5],20:[1,6],24:[1,7],25:[1,8],26:[1,9],28:10},{4:34,6:[1,3],14:[1,4],15:[1,5],20:[1,6],24:[1,7],25:[1,8],26:[1,9],28:10},{4:35,6:[1,3],14:[1,4],15:[1,5],20:[1,6],22:36,24:[1,7],25:[1,8],26:[1,9],28:10},{5:[2,17],6:[2,17],7:[2,17],8:[2,17],9:[2,17],10:[2,17],11:[2,17],12:[2,17],13:[2,17],16:[2,17],17:[2,17],18:[2,17],19:[2,17],21:[2,17],23:[2,17],29:[2,17],30:[2,17],31:[2,17],33:[2,17],34:[2,17],35:[2,17],36:[2,17],37:[2,17],38:[2,17],39:[2,17]},{5:[2,18],6:[2,18],7:[2,18],8:[2,18],9:[2,18],10:[2,18],11:[2,18],12:[2,18],13:[2,18],16:[2,18],17:[2,18],18:[2,18],19:[2,18],20:[1,38],21:[2,18],23:[2,18],27:[1,37],29:[2,18],30:[2,18],31:[2,18],33:[2,18],34:[2,18],35:[2,18],36:[2,18],37:[2,18],38:[2,18],39:[2,18]},{5:[2,19],6:[2,19],7:[2,19],8:[2,19],9:[2,19],10:[2,19],11:[2,19],12:[2,19],13:[2,19],16:[2,19],17:[2,19],18:[2,19],19:[2,19],21:[2,19],23:[2,19],29:[2,19],30:[2,19],31:[2,19],33:[2,19],34:[2,19],35:[2,19],36:[2,19],37:[2,19],38:[2,19],39:[2,19]},{5:[2,23],6:[2,23],7:[2,23],8:[2,23],9:[2,23],10:[2,23],11:[2,23],12:[2,23],13:[2,23],16:[2,23],17:[2,23],18:[2,23],19:[2,23],21:[2,23],23:[2,23],29:[2,23],30:[2,23],31:[2,23],33:[2,23],34:[2,23],35:[2,23],36:[2,23],37:[2,23],38:[2,23],39:[2,23]},{1:[2,1]},{4:39,6:[1,3],14:[1,4],15:[1,5],20:[1,6],24:[1,7],25:[1,8],26:[1,9],28:10},{4:40,6:[1,3],14:[1,4],15:[1,5],20:[1,6],24:[1,7],25:[1,8],26:[1,9],28:10},{4:41,6:[1,3],14:[1,4],15:[1,5],20:[1,6],24:[1,7],25:[1,8],26:[1,9],28:10},{4:42,6:[1,3],14:[1,4],15:[1,5],20:[1,6],24:[1,7],25:[1,8],26:[1,9],28:10},{4:43,6:[1,3],14:[1,4],15:[1,5],20:[1,6],24:[1,7],25:[1,8],26:[1,9],28:10},{4:44,6:[1,3],14:[1,4],15:[1,5],20:[1,6],24:[1,7],25:[1,8],26:[1,9],28:10},{4:45,6:[1,3],14:[1,4],15:[1,5],20:[1,6],24:[1,7],25:[1,8],26:[1,9],28:10},{4:46,6:[1,3],14:[1,4],15:[1,5],20:[1,6],24:[1,7],25:[1,8],26:[1,9],28:10},{4:47,6:[1,3],14:[1,4],15:[1,5],20:[1,6],24:[1,7],25:[1,8],26:[1,9],28:10},{4:48,6:[1,3],14:[1,4],15:[1,5],20:[1,6],24:[1,7],25:[1,8],26:[1,9],28:10},{4:49,6:[1,3],14:[1,4],15:[1,5],20:[1,6],24:[1,7],25:[1,8],26:[1,9],28:10},{4:50,6:[1,3],14:[1,4],15:[1,5],20:[1,6],24:[1,7],25:[1,8],26:[1,9],28:10},{4:52,6:[1,3],14:[1,4],15:[1,5],20:[1,6],24:[1,7],25:[1,8],26:[1,9],28:51},{6:[2,26],14:[2,26],15:[2,26],20:[2,26],24:[2,26],25:[2,26],26:[2,26]},{6:[2,27],14:[2,27],15:[2,27],20:[2,27],24:[2,27],25:[2,27],26:[2,27]},{6:[2,28],14:[2,28],15:[2,28],20:[2,28],24:[2,28],25:[2,28],26:[2,28]},{6:[2,29],14:[2,29],15:[2,29],20:[2,29],24:[2,29],25:[2,29],26:[2,29]},{6:[2,30],14:[2,30],15:[2,30],20:[2,30],24:[2,30],25:[2,30],26:[2,30]},{6:[2,31],14:[2,31],15:[2,31],20:[2,31],24:[2,31],25:[2,31],26:[2,31]},{6:[2,32],14:[2,32],15:[2,32],20:[2,32],24:[2,32],25:[2,32],26:[2,32]},{5:[2,2],6:[2,2],7:[2,2],8:[2,2],9:[2,2],10:[1,16],11:[2,2],12:[2,2],13:[2,2],16:[2,2],17:[2,2],18:[2,2],19:[2,2],21:[2,2],23:[2,2],29:[2,2],30:[2,2],31:[2,2],32:24,33:[2,2],34:[2,2],35:[2,2],36:[2,2],37:[2,2],38:[2,2],39:[2,2]},{5:[2,11],6:[2,11],7:[2,11],8:[2,11],9:[2,11],10:[1,16],11:[2,11],12:[2,11],13:[2,11],16:[2,11],17:[2,11],18:[2,11],19:[2,11],21:[2,11],23:[2,11],29:[2,11],30:[2,11],31:[2,11],32:24,33:[2,11],34:[2,11],35:[2,11],36:[2,11],37:[2,11],38:[2,11],39:[2,11]},{6:[1,13],7:[1,12],8:[1,14],9:[1,15],10:[1,16],11:[1,17],12:[1,18],13:[1,19],16:[1,53],18:[1,20],19:[1,21],29:[1,22],30:[1,23],32:24,33:[1,25],34:[1,26],35:[1,27],36:[1,28],37:[1,29],38:[1,30],39:[1,31]},{6:[1,13],7:[1,12],8:[1,14],9:[1,15],10:[1,16],11:[1,17],12:[1,18],13:[1,19],18:[1,20],19:[1,21],21:[1,54],23:[2,35],29:[1,22],30:[1,23],32:24,33:[1,25],34:[1,26],35:[1,27],36:[1,28],37:[1,29],38:[1,30],39:[1,31]},{23:[1,55]},{4:56,6:[1,3],14:[1,4],15:[1,5],20:[1,6],24:[1,7],25:[1,8],26:[1,9],28:10},{4:59,6:[1,3],14:[1,4],15:[1,5],20:[1,6],21:[1,57],22:58,24:[1,7],25:[1,8],26:[1,9],28:10},{5:[2,3],6:[2,3],7:[2,3],8:[1,14],9:[1,15],10:[1,16],11:[1,17],12:[2,3],13:[2,3],16:[2,3],17:[2,3],18:[2,3],19:[2,3],21:[2,3],23:[2,3],29:[1,22],30:[2,3],31:[2,3],32:24,33:[2,3],34:[2,3],35:[2,3],36:[2,3],37:[2,3],38:[2,3],39:[2,3]},{5:[2,4],6:[2,4],7:[2,4],8:[1,14],9:[1,15],10:[1,16],11:[1,17],12:[2,4],13:[2,4],16:[2,4],17:[2,4],18:[2,4],19:[2,4],21:[2,4],23:[2,4],29:[1,22],30:[2,4],31:[2,4],32:24,33:[2,4],34:[2,4],35:[2,4],36:[2,4],37:[2,4],38:[2,4],39:[2,4]},{5:[2,5],6:[2,5],7:[2,5],8:[2,5],9:[2,5],10:[1,16],11:[2,5],12:[2,5],13:[2,5],16:[2,5],17:[2,5],18:[2,5],19:[2,5],21:[2,5],23:[2,5],29:[2,5],30:[2,5],31:[2,5],32:24,33:[2,5],34:[2,5],35:[2,5],36:[2,5],37:[2,5],38:[2,5],39:[2,5]},{5:[2,6],6:[2,6],7:[2,6],8:[2,6],9:[2,6],10:[1,16],11:[2,6],12:[2,6],13:[2,6],16:[2,6],17:[2,6],18:[2,6],19:[2,6],21:[2,6],23:[2,6],29:[2,6],30:[2,6],31:[2,6],32:24,33:[2,6],34:[2,6],35:[2,6],36:[2,6],37:[2,6],38:[2,6],39:[2,6]},{5:[2,7],6:[2,7],7:[2,7],8:[2,7],9:[2,7],10:[1,16],11:[2,7],12:[2,7],13:[2,7],16:[2,7],17:[2,7],18:[2,7],19:[2,7],21:[2,7],23:[2,7],29:[2,7],30:[2,7],31:[2,7],32:24,33:[2,7],34:[2,7],35:[2,7],36:[2,7],37:[2,7],38:[2,7],39:[2,7]},{5:[2,8],6:[2,8],7:[2,8],8:[2,8],9:[2,8],10:[1,16],11:[2,8],12:[2,8],13:[2,8],16:[2,8],17:[2,8],18:[2,8],19:[2,8],21:[2,8],23:[2,8],29:[2,8],30:[2,8],31:[2,8],32:24,33:[2,8],34:[2,8],35:[2,8],36:[2,8],37:[2,8],38:[2,8],39:[2,8]},{5:[2,9],6:[1,13],7:[1,12],8:[1,14],9:[1,15],10:[1,16],11:[1,17],12:[2,9],13:[2,9],16:[2,9],17:[2,9],18:[1,20],19:[1,21],21:[2,9],23:[2,9],29:[1,22],30:[2,9],31:[2,9],32:24,33:[1,25],34:[1,26],35:[1,27],36:[1,28],37:[1,29],38:[1,30],39:[1,31]},{5:[2,10],6:[1,13],7:[1,12],8:[1,14],9:[1,15],10:[1,16],11:[1,17],12:[1,18],13:[2,10],16:[2,10],17:[2,10],18:[1,20],19:[1,21],21:[2,10],23:[2,10],29:[1,22],30:[2,10],31:[2,10],32:24,33:[1,25],34:[1,26],35:[1,27],36:[1,28],37:[1,29],38:[1,30],39:[1,31]},{5:[2,13],6:[1,13],7:[1,12],8:[1,14],9:[1,15],10:[1,16],11:[1,17],12:[2,13],13:[2,13],16:[2,13],17:[2,13],18:[2,13],19:[2,13],21:[2,13],23:[2,13],29:[1,22],30:[2,13],31:[2,13],32:24,33:[1,25],34:[1,26],35:[1,27],36:[1,28],37:[1,29],38:[1,30],39:[1,31]},{5:[2,14],6:[1,13],7:[1,12],8:[1,14],9:[1,15],10:[1,16],11:[1,17],12:[2,14],13:[2,14],16:[2,14],17:[2,14],18:[2,14],19:[2,14],21:[2,14],23:[2,14],29:[1,22],30:[2,14],31:[2,14],32:24,33:[1,25],34:[1,26],35:[1,27],36:[1,28],37:[1,29],38:[1,30],39:[1,31]},{5:[2,24],6:[2,24],7:[2,24],8:[2,24],9:[2,24],10:[1,16],11:[2,24],12:[2,24],13:[2,24],16:[2,24],17:[2,24],18:[2,24],19:[2,24],21:[2,24],23:[2,24],29:[2,24],30:[2,24],31:[2,24],32:24,33:[2,24],34:[2,24],35:[2,24],36:[2,24],37:[2,24],38:[2,24],39:[2,24]},{6:[1,13],7:[1,12],8:[1,14],9:[1,15],10:[1,16],11:[1,17],12:[1,18],13:[1,19],18:[1,20],19:[1,21],29:[1,22],30:[1,23],31:[1,60],32:24,33:[1,25],34:[1,26],35:[1,27],36:[1,28],37:[1,29],38:[1,30],39:[1,31]},{5:[2,33],6:[2,33],7:[2,33],8:[2,33],9:[2,33],10:[2,33],11:[2,33],12:[2,33],13:[2,33],16:[2,33],17:[2,33],18:[2,33],19:[2,33],21:[2,33],23:[2,33],29:[2,33],30:[2,33],31:[2,33],33:[2,33],34:[2,33],35:[2,33],36:[2,33],37:[2,33],38:[2,33],39:[2,33]},{5:[2,34],6:[1,13],7:[1,12],8:[1,14],9:[1,15],10:[1,16],11:[1,17],12:[2,34],13:[2,34],16:[2,34],17:[2,34],18:[2,34],19:[2,34],21:[2,34],23:[2,34],29:[1,22],30:[2,34],31:[2,34],32:24,33:[1,25],34:[1,26],35:[1,27],36:[1,28],37:[1,29],38:[1,30],39:[1,31]},{4:61,6:[1,3],14:[1,4],15:[1,5],20:[1,6],24:[1,7],25:[1,8],26:[1,9],28:10},{5:[2,15],6:[2,15],7:[2,15],8:[2,15],9:[2,15],10:[2,15],11:[2,15],12:[2,15],13:[2,15],16:[2,15],17:[2,15],18:[2,15],19:[2,15],21:[2,15],23:[2,15],29:[2,15],30:[2,15],31:[2,15],33:[2,15],34:[2,15],35:[2,15],36:[2,15],37:[2,15],38:[2,15],39:[2,15]},{4:62,6:[1,3],14:[1,4],15:[1,5],20:[1,6],24:[1,7],25:[1,8],26:[1,9],28:10},{5:[2,20],6:[2,20],7:[2,20],8:[2,20],9:[2,20],10:[2,20],11:[2,20],12:[2,20],13:[2,20],16:[2,20],17:[2,20],18:[2,20],19:[2,20],21:[2,20],23:[2,20],29:[2,20],30:[2,20],31:[2,20],32:24,33:[2,20],34:[2,20],35:[2,20],36:[2,20],37:[2,20],38:[2,20],39:[2,20]},{5:[2,21],6:[2,21],7:[2,21],8:[2,21],9:[2,21],10:[2,21],11:[2,21],12:[2,21],13:[2,21],16:[2,21],17:[2,21],18:[2,21],19:[2,21],21:[2,21],23:[2,21],29:[2,21],30:[2,21],31:[2,21],33:[2,21],34:[2,21],35:[2,21],36:[2,21],37:[2,21],38:[2,21],39:[2,21]},{21:[1,63],23:[1,64]},{6:[1,13],7:[1,12],8:[1,14],9:[1,15],10:[1,16],11:[1,17],12:[1,18],13:[1,19],18:[1,20],19:[1,21],21:[2,35],23:[2,35],29:[1,22],30:[1,23],32:24,33:[1,25],34:[1,26],35:[1,27],36:[1,28],37:[1,29],38:[1,30],39:[1,31]},{4:65,6:[1,3],14:[1,4],15:[1,5],20:[1,6],24:[1,7],25:[1,8],26:[1,9],28:10},{6:[1,13],7:[1,12],8:[1,14],9:[1,15],10:[1,16],11:[1,17],12:[1,18],13:[1,19],17:[1,66],18:[1,20],19:[1,21],29:[1,22],30:[1,23],32:24,33:[1,25],34:[1,26],35:[1,27],36:[1,28],37:[1,29],38:[1,30],39:[1,31]},{6:[1,13],7:[1,12],8:[1,14],9:[1,15],10:[1,16],11:[1,17],12:[1,18],13:[1,19],18:[1,20],19:[1,21],21:[1,67],23:[2,36],29:[1,22],30:[1,23],32:24,33:[1,25],34:[1,26],35:[1,27],36:[1,28],37:[1,29],38:[1,30],39:[1,31]},{5:[2,22],6:[2,22],7:[2,22],8:[2,22],9:[2,22],10:[2,22],11:[2,22],12:[2,22],13:[2,22],16:[2,22],17:[2,22],18:[2,22],19:[2,22],21:[2,22],23:[2,22],29:[2,22],30:[2,22],31:[2,22],33:[2,22],34:[2,22],35:[2,22],36:[2,22],37:[2,22],38:[2,22],39:[2,22]},{4:68,6:[1,3],14:[1,4],15:[1,5],20:[1,6],24:[1,7],25:[1,8],26:[1,9],28:10},{5:[2,25],6:[1,13],7:[1,12],8:[1,14],9:[1,15],10:[1,16],11:[1,17],12:[1,18],13:[1,19],16:[2,25],17:[2,25],18:[1,20],19:[1,21],21:[2,25],23:[2,25],29:[1,22],30:[1,23],31:[2,25],32:24,33:[1,25],34:[1,26],35:[1,27],36:[1,28],37:[1,29],38:[1,30],39:[1,31]},{4:69,6:[1,3],14:[1,4],15:[1,5],20:[1,6],24:[1,7],25:[1,8],26:[1,9],28:10},{5:[2,16],6:[2,16],7:[2,16],8:[2,16],9:[2,16],10:[2,16],11:[2,16],12:[2,16],13:[2,16],16:[2,16],17:[2,16],18:[2,16],19:[2,16],21:[2,16],23:[2,16],29:[2,16],30:[2,16],31:[2,16],33:[2,16],34:[2,16],35:[2,16],36:[2,16],37:[2,16],38:[2,16],39:[2,16]},{6:[1,13],7:[1,12],8:[1,14],9:[1,15],10:[1,16],11:[1,17],12:[1,18],13:[1,19],18:[1,20],19:[1,21],21:[2,36],23:[2,36],29:[1,22],30:[1,23],32:24,33:[1,25],34:[1,26],35:[1,27],36:[1,28],37:[1,29],38:[1,30],39:[1,31]},{5:[2,12],6:[1,13],7:[1,12],8:[1,14],9:[1,15],10:[1,16],11:[1,17],12:[1,18],13:[1,19],16:[2,12],17:[2,12],18:[1,20],19:[1,21],21:[2,12],23:[2,12],29:[1,22],30:[1,23],31:[2,12],32:24,33:[1,25],34:[1,26],35:[1,27],36:[1,28],37:[1,29],38:[1,30],39:[1,31]}],defaultActions:{11:[2,1]},parseError:function(i,o){throw new Error(i)},parse:function(i){var o=this,a=[0],f=[null],u=[],e=this.table,x="",n=0,T=0,S=0,P=2,r=1;this.lexer.setInput(i),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,typeof this.lexer.yylloc>"u"&&(this.lexer.yylloc={});var c=this.lexer.yylloc;u.push(c);var d=this.lexer.options&&this.lexer.options.ranges;typeof this.yy.parseError=="function"&&(this.parseError=this.yy.parseError);function w(b){a.length=a.length-2*b,f.length=f.length-b,u.length=u.length-b}function N(){var b;return b=o.lexer.lex()||1,typeof b!="number"&&(b=o.symbols_[b]||b),b}for(var y,k,g,m,C,O={},F,_,K,D;;){if(g=a[a.length-1],this.defaultActions[g]?m=this.defaultActions[g]:((y===null||typeof y>"u")&&(y=N()),m=e[g]&&e[g][y]),typeof m>"u"||!m.length||!m[0]){var R="";if(!S){D=[];for(F in e[g])this.terminals_[F]&&F>2&&D.push("'"+this.terminals_[F]+"'");this.lexer.showPosition?R="Parse error on line "+(n+1)+`:
2
+ `+this.lexer.showPosition()+`
3
+ Expecting `+D.join(", ")+", got '"+(this.terminals_[y]||y)+"'":R="Parse error on line "+(n+1)+": Unexpected "+(y==1?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(R,{text:this.lexer.match,token:this.terminals_[y]||y,line:this.lexer.yylineno,loc:c,expected:D})}if(S==3){if(y==r)throw new Error(R||"Parsing halted.");T=this.lexer.yyleng,x=this.lexer.yytext,n=this.lexer.yylineno,c=this.lexer.yylloc,y=N()}for(;!(P.toString()in e[g]);){if(g===0)throw new Error(R||"Parsing halted.");w(1),g=a[a.length-1]}k=y==2?null:y,y=P,g=a[a.length-1],m=e[g]&&e[g][P],S=3}if(m[0]instanceof Array&&m.length>1)throw new Error("Parse Error: multiple actions possible at state: "+g+", token: "+y);switch(m[0]){case 1:a.push(y),f.push(this.lexer.yytext),u.push(this.lexer.yylloc),a.push(m[1]),y=null,k?(y=k,k=null):(T=this.lexer.yyleng,x=this.lexer.yytext,n=this.lexer.yylineno,c=this.lexer.yylloc,S>0&&S--);break;case 2:if(_=this.productions_[m[1]][1],O.$=f[f.length-_],O._$={first_line:u[u.length-(_||1)].first_line,last_line:u[u.length-1].last_line,first_column:u[u.length-(_||1)].first_column,last_column:u[u.length-1].last_column},d&&(O._$.range=[u[u.length-(_||1)].range[0],u[u.length-1].range[1]]),C=this.performAction.call(O,x,T,n,this.yy,m[1],f,u),typeof C<"u")return C;_&&(a=a.slice(0,-1*_*2),f=f.slice(0,-1*_),u=u.slice(0,-1*_)),a.push(this.productions_[m[1]][0]),f.push(O.$),u.push(O._$),K=e[a[a.length-2]][a[a.length-1]],a.push(K);break;case 3:return!0}}return!0}},s=(function(){var l={EOF:1,parseError:function(o,a){if(this.yy.parser)this.yy.parser.parseError(o,a);else throw new Error(o)},setInput:function(i){return this._input=i,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var o=i.match(/(?:\r\n?|\n).*/g);return o?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),i},unput:function(i){var o=i.length,a=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-o-1),this.offset-=o;var f=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),a.length-1&&(this.yylineno-=a.length-1);var u=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:a?(a.length===f.length?this.yylloc.first_column:0)+f[f.length-a.length].length-a[0].length:this.yylloc.first_column-o},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-o]),this},more:function(){return this._more=!0,this},less:function(i){this.unput(this.match.slice(i))},pastInput:function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var i=this.match;return i.length<20&&(i+=this._input.substr(0,20-i.length)),(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var i=this.pastInput(),o=new Array(i.length+1).join("-");return i+this.upcomingInput()+`
4
+ `+o+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var i,o,a,f,u;this._more||(this.yytext="",this.match="");for(var e=this._currentRules(),x=0;x<e.length&&(a=this._input.match(this.rules[e[x]]),!(a&&(!o||a[0].length>o[0].length)&&(o=a,f=x,!this.options.flex)));x++);return o?(u=o[0].match(/(?:\r\n?|\n).*/g),u&&(this.yylineno+=u.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:u?u[u.length-1].length-u[u.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+o[0].length},this.yytext+=o[0],this.match+=o[0],this.matches=o,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(o[0].length),this.matched+=o[0],i=this.performAction.call(this,this.yy,this,e[f],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i||void 0):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
5
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var o=this.next();return typeof o<"u"?o:this.lex()},begin:function(o){this.conditionStack.push(o)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(o){this.begin(o)}};return l.options={},l.performAction=function(o,a,f,u){switch(f){case 0:return"*";case 1:return"/";case 2:return"-";case 3:return"+";case 4:return"^";case 5:return"(";case 6:return")";case 7:return",";case 8:return"==";case 9:return"!=";case 10:return"~=";case 11:return">=";case 12:return"<=";case 13:return"<";case 14:return">";case 15:return"notIn";case 16:return"and";case 17:return"or";case 18:return"not";case 19:return"in";case 20:return"of";case 21:return"if";case 22:return"then";case 23:return"else";case 24:return"mod";case 25:break;case 26:return"Number";case 27:return a.yytext=JSON.stringify({name:a.yytext,type:"unescaped"}),"Symbol";case 28:return a.yytext=JSON.stringify({name:o.buildString("'",a.yytext),type:"single-quoted"}),"Symbol";case 29:return a.yytext=JSON.stringify(o.buildString('"',a.yytext)),"String";case 30:return"%";case 31:return"?";case 32:return":";case 33:return"EndOfExpression"}},l.rules=[/^(?:\*)/,/^(?:\/)/,/^(?:-)/,/^(?:\+)/,/^(?:\^)/,/^(?:\()/,/^(?:\))/,/^(?:\,)/,/^(?:==)/,/^(?:\!=)/,/^(?:\~=)/,/^(?:>=)/,/^(?:<=)/,/^(?:<)/,/^(?:>)/,/^(?:not\s+in[^\w])/,/^(?:and[^\w])/,/^(?:or[^\w])/,/^(?:not[^\w])/,/^(?:in[^\w])/,/^(?:of[^\w])/,/^(?:if[^\w])/,/^(?:then[^\w])/,/^(?:else[^\w])/,/^(?:mod[^\w])/,/^(?:\s+)/,/^(?:[0-9]+(?:\.[0-9]+)?(?![0-9\.]))/,/^(?:[a-zA-Z$_][\.a-zA-Z0-9$_]*)/,/^(?:'(?:\\'|\\\\|[^'\\])*')/,/^(?:"(?:\\"|\\\\|[^"\\])*")/,/^(?:\%)/,/^(?:\?)/,/^(?::)/,/^(?:$)/],l.conditions={INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33],inclusive:!0}},l})();t.lexer=s;function h(){this.yy={}}return h.prototype=t,t.Parser=h,new h})(),j=Z;Z.Parser;var G=class extends ReferenceError{I18N_STRING="UNKNOWN_FUNCTION";constructor(s){super(`Unknown function: ${s}()`),this.functionName=s}},M=class extends ReferenceError{I18N_STRING="UNKNOWN_PROPERTY";constructor(s){super(`Property \u201C${s}\u201D does not exist.`),this.propertyName=s}},Y=class extends TypeError{I18N_STRING="UNKNOWN_OPTION";constructor(s){super(`Unknown option: ${s}`),this.keyName=s}},E=class extends TypeError{I18N_STRING="UNEXPECTED_TYPE";constructor(s,h){super(`Expected a ${s}, but got a ${h} instead.`),this.expectedType=s,this.recievedType=h}},A=class extends Error{I18N_STRING="INTERNAL";constructor(s){super(s)}};function I(t,s){return typeof t=="object"||typeof t=="function"?Object.prototype.hasOwnProperty.call(t,s):!1}function V(t,s){return(t%s+s)%s}function X(t){if(typeof t!="object")return t;if(t instanceof Number||t instanceof String||t instanceof Boolean)return t.valueOf()}function B(t){return Array.isArray(t)&&t.length===1&&(t=t[0]),X(t)}function U(t){return t=B(t),t===void 0?"undefined":t===null?"null":t===!0?"true":t===!1?"false":typeof t=="number"?"number":typeof t=="string"?"text":typeof t!="object"&&typeof t!="function"?"unknown type":Array.isArray(t)?"list":"object"}function p(t){if(t=B(t),typeof t=="number")return t;throw new E("number",U(t))}function W(t){if(t=B(t),typeof t=="string")return t;throw new E("text",U(t))}function z(t){if(t=B(t),typeof t=="string"||typeof t=="number")return t;throw new E("text or number",U(t))}function H(t){if(t=B(t),typeof t=="boolean")return t;throw new E("logical value (\u201Ctrue\u201D or \u201Cfalse\u201D)",U(t))}function L(t){if(t==null)throw new E("list",U(t));return Array.isArray(t)?t:[t]}function J(t){let s=[...t],h=[];for(;s.length;){let l=s.pop();Array.isArray(l)?s.push(...l):h.push(l)}return h.reverse()}var q={isfn(t,s){return I(t,s)&&typeof t[s]=="function"},unknown(t){throw new G(t)},coerceArray:L,coerceNumber:p,coerceNumberOrString:z,coerceBoolean:H,isSubset(t,s){let h=L(t),l=L(s);return h.every(i=>l.includes(i))},warnDeprecated:(function(){let s={ternary:0,modulo:0};return(h,l)=>{switch(h){case"ternary":if(s.ternary++>=3)break;console.warn("The use of ? and : as conditional operators has been deprecated in Filtrex v3 in favor of the if..then..else ternary operator. See issue #34 for more information.");break;case"modulo":if(s.modulo++>=3)break;console.warn("The use of '%' as a modulo operator has been deprecated in Filtrex v3 in favor of the 'mod' operator. You can use it like this: '3 mod 2 == 1'. See issue #48 for more information.");break}return l}})(),buildString(t,s){t=String(t)[0],s=String(s);let h="";if(s[0]!==t||s[s.length-1]!==t)throw new A("Unexpected internal error: String literal doesn't begin/end with the right quotation mark.");for(let l=1;l<s.length-1;l++)if(s[l]==="\\"){if(l++,l>=s.length-1)throw new A("Unexpected internal error: Unescaped backslash at the end of string literal.");if(s[l]==="\\")h+="\\";else if(s[l]===t)h+=t;else throw new A(`Unexpected internal error: Invalid escaped character in string literal: ${s[l]}`)}else{if(s[l]===t)throw new A("Unexpected internal error: String literal contains unescaped quotation mark.");h+=s[l]}return h},reduceRelation(t){let s=[],h=[],l=J([t[0]]).join(""),i=0;for(let o=1;o<t.length-1;o+=2){let a=J([t[o+1]]).join(""),f=`tmp${i++}`;h.push(`ops["${t[o]}"](${l}, ${f} = ${a})`),l=f,s.push(f)}return`(function(){ var ${s.join(", ")}; return ${h.join(" && ")};})()`}};j.yy=Object.create(q);function Q(t,s,h,l){return h==null?h:s(t)}function v(t,s,h,l){if(l==="single-quoted")return s(t);let i=t.split(".");for(let o of i)if(I(h??{},o))h=h[o];else throw new M(o);return h}function $(t,s,h,l){if(h==null)return h;if(l==="single-quoted")return s(t);let i=t.split(".");for(let o of i){if(h==null)return h;h=h[o]}return h}function t1(t,s){if(arguments.length>2)throw new TypeError("Too many arguments.");s=typeof s=="object"?s:{};let h=["extraFunctions","constants","customProp","operators"],{extraFunctions:l,constants:i,customProp:o,operators:a}=s;for(let r of Object.keys(s))if(!h.includes(r))throw new Y(r);let f={abs:Math.abs,ceil:Math.ceil,floor:Math.floor,log:Math.log,log2:Math.log2,log10:Math.log10,max:Math.max,min:Math.min,round:Math.round,sqrt:Math.sqrt,exists:r=>r!=null,empty:r=>r==null||r===""||Array.isArray(r)&&r.length===0};if(l)for(let r of Object.keys(l))f[r]=l[r];let u={"+":(r,c)=>z(r)+z(c),"-":(r,c)=>c===void 0?-p(r):p(r)-p(c),"*":(r,c)=>p(r)*p(c),"/":(r,c)=>p(r)/p(c),"^":(r,c)=>Math.pow(p(r),p(c)),mod:(r,c)=>V(p(r),p(c)),"==":(r,c)=>r===c,"!=":(r,c)=>r!==c,"<":(r,c)=>p(r)<p(c),"<=":(r,c)=>p(r)<=p(c),">=":(r,c)=>p(r)>=p(c),">":(r,c)=>p(r)>p(c),"~=":(r,c)=>RegExp(W(c)).test(W(r))};if(a)for(let r of Object.keys(a))u[r]=a[r];a=u,i=i??{};let e=J(j.parse(t));e.unshift("return "),e.push(";");function x(r,c,d){if(I(c??{},r))return c[r];throw new M(r)}function n(r){return function(d){if(I(r??{},d))return r[d];throw new M(d)}}typeof o=="function"&&(x=(r,c,d)=>o(r,n(c),c,d));function T(r){return function(d){let{name:w}=d;for(var N=arguments.length,y=new Array(N>1?N-1:0),k=1;k<N;k++)y[k-1]=arguments[k];if(I(r,w)&&typeof r[w]=="function")return r[w](...y);throw new G(w)}}function S(r,c){let{name:d,type:w}=r;return w==="unescaped"&&I(i,d)?i[d]:x(d,c,w)}let P=new Function("call","ops","std","prop","data",e.join(""));return function(r){try{return P(T(f),a,q,S,r)}catch(c){return c}}}export{Q as a,v as b,$ as c,t1 as d};
@@ -0,0 +1,2 @@
1
+ import{$ as At,A as ge,B as yt,Ba as He,D as Ct,E as vt,F as xt,G as wt,Ga as A,H as Pt,I as Mt,Ia as Le,J as Dt,Ja as Wt,K as kt,L as St,M as Tt,Ma as Ht,N as De,Na as Lt,O as ke,Oa as $t,Pa as Fe,Q as Se,Sa as $e,Ta as Gt,Y as Te,Z as Ot,a as Ue,aa as Ft,b as je,ba as z,c as st,ca as Et,d as Pe,ea as It,f as Me,fa as Rt,g as $,h as X,i as lt,j as dt,k as ct,l as gt,n as pt,na as zt,o as ht,oa as Nt,p as oe,q as mt,r as ut,s as ce,t as ft,ta as Oe,ua as be,va as Vt,wa as Ae,xa as qt,y as _t,z as bt,za as pe}from"./chunk-JBOPWBL6.js";import{$b as le,Ab as D,Bb as ot,Eb as b,Ga as et,Gb as d,Ha as tt,Jb as se,Kb as K,La as c,Lb as Q,N as Z,Ob as q,Pb as rt,Qb as B,R as Ye,S as w,Sb as P,Tb as W,Ub as We,X as u,Xa as xe,Y as f,Z as Ke,_ as Qe,ab as H,ac as ie,ba as Je,bc as de,d as Ze,da as me,ea as ve,fb as G,fc as fe,ha as Xe,ia as _,kb as nt,kc as T,la as te,lb as ne,mb as y,nb as C,nc as _e,ob as Y,oc as J,p as F,pa as re,pb as it,qb as I,qc as at,rb as R,sb as v,tb as a,ub as l,vb as h,wb as ae,xb as we,yb as ue,zb as L}from"./chunk-Z5FDX7CX.js";import{a as x,b as E}from"./chunk-ZW5NV4UO.js";function Jt(){return{dashboardsTitle:"Dashboards",loadingDashboards:"Loading dashboards\u2026",noDashboardsTitle:"No dashboards yet",noDashboardsSub:"Generate one from your data, or create it in the builder.",generateDashboardButton:"Generate dashboard",refreshButton:"Refresh",exportButton:"Export",editButton:"Edit",renamePlaceholder:"Dashboard name",askAqueraButton:"Ask Aquera",errors:{loadFailedFallback:"Could not load dashboards",saveFailedFallback:"Could not save the dashboard",refreshFailedFallback:"Could not refresh the dashboard",exportFailedFallback:"Could not export the dashboard"}}}function Xt(){return{mcpGateway:ce.MCP_GATEWAY_ENABLED??!1,aiPrompt:!0,autoGenerate:!0,export:!0,rename:!0,refresh:!0,executiveSummary:!0,edit:!0}}function Bt(){return{baseUrl:ce.baseUrl??"",mcpUrl:ce.MCP_URL??null,tokenizedOrigins:[ce.baseUrl].filter(o=>!!o),headers:{},customerId:null,productId:null,productName:null,authMode:"inherit",authToken:null,getToken:null,resolvedToken:null,onUnauthorized:null,ssoEnabled:ce.SSO_ENABLED??!1,features:Xt(),ui:{theme:"light",density:"comfortable",header:!0,locale:"en"},copy:Jt(),hrefs:{askAquera:"/ask-aquera",builder:"/manage-dashboards"},initialDashboardId:null}}var Ut=ht("dashboards",Bt);function k(){return Ut.read()}function jt(o){let t=Bt(),e=E(x(x({},t),oe(o)),{features:x(x({},t.features),oe(o.features??{})),ui:x(x({},t.ui),oe(o.ui??{})),hrefs:x(x({},t.hrefs),oe(o.hrefs??{})),copy:E(x(x({},t.copy),oe(o.copy??{})),{errors:x(x({},t.copy.errors),oe(o.copy?.errors??{}))}),headers:x(x({},t.headers),o.headers??{})});return o.tokenizedOrigins||(e.tokenizedOrigins=[e.baseUrl,e.mcpUrl].filter(n=>!!n)),Ut.write(e)}var U=class o{requests$=new Ze;requests=this.requests$.asObservable();toAskAquera(){this.requests$.next({to:k().hrefs.askAquera})}toAskAqueraDashboard(t,e){this.requests$.next({to:`${k().hrefs.askAquera}/dashboard/${t}`,queryParams:e})}toBuilder(t){this.requests$.next({to:`${k().hrefs.builder}/${t}`})}static \u0275fac=function(e){return new(e||o)};static \u0275prov=Z({token:o,factory:o.\u0275fac})};var S={get baseUrl(){return k().baseUrl},get MCP_URL(){return k().mcpUrl??""},get MCP_GATEWAY_ENABLED(){return k().features.mcpGateway},get SSO_ENABLED(){return k().ssoEnabled}};function Zt(){return k().customerId??""}function O(){return k().productId??""}var he=class o{constructor(t){this.http=t}http;tokenStore=w(ge);publishRepo=w(A);lastSentCustomerId=null;lastSentProductId=null;get customerId(){return this.tokenStore.tenantId()??""}mcpGatewayUrl(){return`${S.baseUrl}/dviz-mcp`}async callMcpTool(t,e={}){let n=this.customerId,i=O(),r={};n!==this.lastSentCustomerId&&(r.customerId=n),i!==this.lastSentProductId&&(r.productId=i);let s;try{s=await F(this.http.post(this.mcpGatewayUrl(),{jsonrpc:"2.0",id:Date.now(),method:"tools/call",params:{name:t,arguments:e}},{headers:{Accept:"application/json, text/event-stream"},params:r})),this.lastSentCustomerId=n,this.lastSentProductId=i}catch(p){throw p instanceof $?new Error(p.error?.error?.message||p.error?.message||p.message):p}if(s.error)throw new Error(s.error.message);let g=s.result;if(g?.isError)throw new Error(g.structuredContent?.error?.message??g.content?.[0]?.text??`${t} failed`);return g?.structuredContent??{}}async loadDashboards(){return(await this.publishRepo.listDashboards({published:"true",limit:100})).filter(e=>e.isPublished===!0||e.version==="published").map(e=>({id:e.id,name:e.name??"Untitled",description:e.description,createdAt:e.createdAt??new Date().toISOString(),updatedAt:e.updatedAt,isAutoGenerated:e.isAutoGenerated===!0,category:e.category??null}))}async renameDashboard(t,e){if(!S.MCP_GATEWAY_ENABLED){try{await F(this.http.put(`${S.baseUrl}/api/customers/${this.customerId}/products/${O()}/workforce/dashboards/${t}?published=true`,{name:e}))}catch(n){throw n instanceof $?new Error(n.error?.error||n.message):n}return}await this.callMcpTool("updateDashboard",{dashboardId:t,name:e,published:!0})}async fetchDashboard(t){let e,n=!1;if(S.MCP_GATEWAY_ENABLED){let i=await this.callMcpTool("getDashboard",{dashboardId:t,published:"true"});e=i?.dashboard??{},n=i?.canRefresh===!0}else{let i=await F(this.http.get(`${S.baseUrl}/api/customers/${this.customerId}/products/${O()}/workforce/dashboards/${t}?published=true`));e=i?.data??i,n=i?.canRefresh===!0}return{id:e.id,name:e.name??"Untitled",widgets:await this.mapAndHydrateWidgets(e.widgets),connectionId:e.connectionId,isPipeline:e.isPipeline,adapterType:e.adapterType,category:e.category??null,canRefresh:n}}async refreshDashboard(t){if(!S.MCP_GATEWAY_ENABLED){let n=await F(this.http.post(`${S.baseUrl}/api/customers/${this.customerId}/products/${O()}/workforce/dashboards/${t}/refresh`,{})),i=n?.data??n;return{widgets:await this.mapAndHydrateWidgets(i?.widgets)}}let e=await this.callMcpTool("refreshDashboard",{dashboardId:t});return{widgets:await this.mapAndHydrateWidgets(e?.refresh?.widgets)}}async previewWidgetTemplateDetailPanel(t){return(await F(this.http.post(`${S.baseUrl}/api/customers/${this.customerId}/products/${O()}/workforce/widget-templates/${t}/detail-panel`,{}))).data}async previewWidgetDetailPanelDefinition(t){return(await F(this.http.post(`${S.baseUrl}/api/customers/${this.customerId}/products/${O()}/workforce/widget-templates/preview-detail-panel`,{detailPanel:t}))).data}async mapAndHydrateWidgets(t){let e=(t??[]).map(n=>({id:n.id,title:n.title,type:n.widgetType??"chart",layout:n.layout??{x:0,y:0,w:12,h:4},nileConfig:{chart:n.chart??n.config?.chart??{},aq:n.config?.aq??{},_meta:n.config?._meta},drilldownBy:Array.isArray(n.drilldownBy)?n.drilldownBy:void 0,dataSourceId:n.dataSourceId,queryMeta:n.queryMeta,category:n.category??null}));return await Promise.all(e.map(n=>be(n.nileConfig))),e}static \u0275fac=function(e){return new(e||o)(Ye(X))};static \u0275prov=Z({token:o,factory:o.\u0275fac,providedIn:"root"})};var j=class o{http=w(X);tokenStore=w(ge);get customerId(){return this.tokenStore.tenantId()??""}async fetchGridPage(t,e,n,i,r,s,g,p){let m=`${S.baseUrl}/api/customers/${this.customerId}/products/${O()}/workforce/data-grid/${t}?pageIndex=${e}&pageSize=${n}`,M=(i??[]).filter(V=>V&&V.value!=null&&String(V.value).trim()!=="");return M.length&&(m+=`&filters=${encodeURIComponent(JSON.stringify(M))}`),r&&Object.keys(r).length&&(m+=`&dashboardFilters=${encodeURIComponent(JSON.stringify(r))}`),g&&g.length&&(m+=`&resolvedFilters=${encodeURIComponent(JSON.stringify(g))}`),s&&(m+=`&dashboardId=${encodeURIComponent(s)}`),p&&(m+=`&conversationId=${encodeURIComponent(p)}`),F(this.http.get(m))}async generateWidget(t,e){let n=Ct()?{prompt:t}:{prompt:t,dataSourceId:e},i;try{i=await F(this.http.post(`${S.baseUrl}/api/customers/${this.customerId}/products/${O()}/workforce/widget/generate`,n))}catch(g){if(g instanceof $){let p=g.error?.error||g.message;throw new Error(p)}throw g}if(i?.success===!1)throw new Error(i.error||"Request failed");let r=i?.data??i;if(!r?.config)throw new Error("Invalid response from widget generate API");let s=r;return await be(s.config),s}async filterSuggest(t,e,n,i){let r=n.filter(p=>!!p.id).map(p=>({widgetId:p.id})),s;try{s=await F(this.http.post(`${S.baseUrl}/api/customers/${this.customerId}/products/${O()}/workforce/dashboards/${t}/filter/suggest?status=${i??"draft"}`,{query:e,refreshCache:!1,widgets:r}))}catch(p){throw p instanceof $?new Error(p.error?.error||p.message):p}if(s?.success===!1)throw new Error(s.error||"Request failed");let g=s?.data??s??{};return{nextToken:g.nextToken,completions:Array.isArray(g.completions)?g.completions:[],suggestions:Array.isArray(g.suggestions)?g.suggestions:[]}}async applyFilters(t,e,n,i,r,s){let g=await new Promise((qe,Ce)=>{let Be=this.http.post(`${S.baseUrl}/api/customers/${this.customerId}/products/${O()}/workforce/dashboards/${n}/filter/apply?status=${i??"draft"}`,qt(t,e,s)).subscribe({next:N=>qe(N),error:N=>{N instanceof $?Ce(new Error(N.error?.error||N.message)):Ce(N)}});if(r){if(r.aborted){Be.unsubscribe();let N=new Error("Aborted");N.name="AbortError",Ce(N);return}r.addEventListener("abort",()=>{Be.unsubscribe();let N=new Error("Aborted");N.name="AbortError",Ce(N)},{once:!0})}});if(g?.success===!1)throw new Error(g.error||"Request failed");let p=g?.data??g,m=Array.isArray(p)?p:p?.widgets;if(!Array.isArray(m))throw new Error("Invalid response from apply-filters API");let M=!Array.isArray(p)&&Array.isArray(p?.resolvedFilters)?p.resolvedFilters:[],V=!Array.isArray(p)&&Array.isArray(p?.filterGroups)?p.filterGroups:[];return await Promise.all(m.map(qe=>be(qe.config))),{widgets:m,resolvedFilters:M,filterGroups:V}}static \u0275fac=function(e){return new(e||o)};static \u0275prov=Z({token:o,factory:o.\u0275fac,providedIn:"root"})};var tn=["grid"];function nn(o,t){if(o&1&&P(0),o&2){let e=d(2);We(" ",e.widgetDetailPanelTitle," ")}}function on(o,t){o&1&&h(0,"nile-skeleton-loader",6)}function rn(o,t){if(o&1&&h(0,"shared-dashboard-grid",8),o&2){let e=d(2);v("widgets",e.widgetDetailPanelWidgets)("widgetsLoading",e.widgetDetailPanelLoading)("editMode",!1)("selectable",!1)("canSetAlert",!1)("canAddToStory",!1)("canForecast",!1)}}function an(o,t){o&1&&(a(0,"div",9)(1,"div",10),h(2,"nile-skeleton-loader",11)(3,"nile-skeleton-loader",11)(4,"nile-skeleton-loader",11),l(),h(5,"nile-skeleton-loader",12),l())}function sn(o,t){if(o&1){let e=D();a(0,"div",2)(1,"div",4)(2,"nile-breadcrumb",5),b("nile-click",function(){u(e);let i=d();return f(i.closeWidgetDetailPanel())}),a(3,"nile-breadcrumb-item"),P(4),l(),a(5,"nile-breadcrumb-item"),y(6,nn,1,1)(7,on,1,0,"nile-skeleton-loader",6),l()()(),a(8,"div",7),y(9,rn,1,7,"shared-dashboard-grid",8)(10,an,6,0,"div",9),l()()}if(o&2){let e=d();c(4),We(" ",e.dashboardName," "),c(2),C(e.widgetDetailPanelTitle?6:7),c(3),C(e.widgetDetailPanelWidgets.length?9:e.widgetDetailPanelLoading?10:-1)}}var ye=class o{widgets=[];dashboardId=null;applyingFilters=!1;widgetDetailPanelOpen=!1;widgetDetailPanelLoading=!1;widgetDetailPanelTitle=null;widgetDetailPanelWidgets=[];dashboardName=null;widgetDetailPanelSkeletonSlots=[];widgetDetailPanelSkeletonHeight(){return this.widgetDetailPanelSkeletonSlots.length?Math.max(...this.widgetDetailPanelSkeletonSlots.map(t=>(t.y+t.h)*72)):0}async onKpiWidgetClicked(t){if(this.widgetDetailPanelLoading)return;let e=t.config?._meta,n=e?.templateId??null,i=e?.detailPanel??null;if(!(!n&&!i)){this.beginCardMorph(t.id),this.runViewTransition(()=>{this.widgetDetailPanelOpen=!0,this.widgetDetailPanelLoading=!0,this.widgetDetailPanelTitle=i?.title??t.title??null,this.widgetDetailPanelSkeletonSlots=(i?.widgets??[]).map(r=>r.layout).filter(r=>!!r),this.widgetDetailPanelWidgets=this.detailPanelPlaceholders(i),this.cdr.markForCheck()});try{let r=i?await this.dashboardsService.previewWidgetDetailPanelDefinition(i):await this.dashboardsService.previewWidgetTemplateDetailPanel(String(n));if(!r.widgets.length){let g=r.skipped[0]?.reason;z({variant:"error",content:g?`Detail panel widgets failed to build: ${g}`:"This detail panel has no widgets configured."}),this.widgetDetailPanelOpen=!1;return}this.widgetDetailPanelTitle=r.title??t.title??null;let s=r.widgets.map((g,p)=>E(x({},g),{id:`detail-panel-${p}`}));this.widgetDetailPanelWidgets=s.every(g=>g.layout)?s:He(s),r.skipped.length&&z({variant:"error",content:`${r.skipped.length} widget(s) in the detail panel could not be built: ${r.skipped[0]?.reason??""}`})}catch{z({variant:"error",title:"Unable to load widget details",content:"Please try again."}),this.widgetDetailPanelOpen=!1}finally{this.widgetDetailPanelLoading=!1,this.cdr.markForCheck()}}}detailPanelPlaceholders(t){let e=t?.widgets??[];if(!e.length)return[];let n=e.map((i,r)=>E(x({},i),{id:`detail-panel-${r}`}));return n.every(i=>i.layout)?n:He(n)}closeWidgetDetailPanel(){this.runViewTransition(()=>{this.widgetDetailPanelOpen=!1,this.widgetDetailPanelTitle=null,this.widgetDetailPanelWidgets=[],this.widgetDetailPanelSkeletonSlots=[],this.cdr.markForCheck()},"back")}currentTimeRange=null;lastMonitoredTotal=null;isRefreshingData=!1;activeDashboardFilters=null;activeResolvedFilters=null;activeFilterGroups=[];applySummary=null;alertDrawerOpen=!1;alertWidget=null;alertFilterPredicates=null;alertFilterHasOr=!1;alertAuthoringMode="widget";alertSource=null;gridRef;http=w(X);zone=w(ve);navigator=w(U);openAiService=w(j);dashboardsService=w(he);forecastService=w(Tt);cdr=w(at);appRef=w(nt);hostEl=w(re);static MORPH_NAME="dv-detail-morph";morphSourceEl=null;beginCardMorph(t){if(!t||typeof CSS>"u"||!CSS.escape)return!1;let e=this.hostEl.nativeElement.querySelector(`.widget-card[data-widget-id="${CSS.escape(String(t))}"]`);if(!e)return!1;let n=e.getBoundingClientRect();return n.height>0&&n.bottom>0&&n.top<window.innerHeight?(e.style.viewTransitionName=o.MORPH_NAME,this.morphSourceEl=e,this.hostEl.nativeElement.classList.add("dv-morphing"),!0):!1}endCardMorph(){this.morphSourceEl&&(this.morphSourceEl.style.removeProperty("view-transition-name"),this.morphSourceEl=null),this.hostEl.nativeElement.classList.remove("dv-morphing")}runViewTransition(t,e="forward"){let n=document,i=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;if(typeof n.startViewTransition!="function"||i){t(),this.endCardMorph();return}let r=document.documentElement;e==="back"&&(r.dataset.vtDirection="back");let s=()=>{delete r.dataset.vtDirection,this.endCardMorph()};n.startViewTransition(()=>{t(),this.appRef.tick()})?.finished?.then(s,s)??s()}sessionMap=new Map;primedFilterWidgets=new Set;filterSuggestCache=new Map;filterSuggestInflight=new Set;applyFiltersSeq=0;applyFiltersAbort;viewInited=!1;openInBuilder(){!this.dashboardId||!k().features.edit||this.navigator.toBuilder(this.dashboardId)}set config(t){let e=t?.id??null,n=e!==this.dashboardId;if(n&&(this.primedFilterWidgets.clear(),this.filterSuggestCache.clear(),this.filterSuggestInflight.clear(),this.activeDashboardFilters=null,this.activeResolvedFilters=null,this.activeFilterGroups=[],this.applySummary=null,this.currentTimeRange=null,this.lastMonitoredTotal=null),!t){this.widgets=[],this.dashboardId=null,this.alertSource=null,this.dashboardName=null;return}this.dashboardId=e,this.dashboardName=t.name??null,this.alertSource={connectionId:t.connectionId,isPipeline:t.isPipeline,adapterType:t.adapterType},this.widgets=(t.widgets??[]).map(r=>({id:r.id,title:r.title??"",widgetType:r.type??"chart",layout:r.layout,config:r.nileConfig,drilldownBy:r.drilldownBy,dataSourceId:r.dataSourceId,queryMeta:r.queryMeta,category:r.category??null})),this.forecastable=t.forecastable??{};let i=this.collectInitialFilters(this.widgets);i?this.applyInitialFilters(i):n&&t.canRefresh&&this.refreshLoadedDashboardData(e),this.viewInited&&queueMicrotask(()=>this.primeFilterWidgets())}async refreshLoadedDashboardData(t){this.isRefreshingData=!0;try{let{widgets:e}=await this.dashboardsService.refreshDashboard(t);this.dashboardId===t&&!this.activeDashboardFilters&&(this.widgets=e.map(n=>({id:n.id,title:n.title??"",widgetType:n.type??"chart",layout:n.layout,config:n.nileConfig,drilldownBy:n.drilldownBy,dataSourceId:n.dataSourceId,queryMeta:n.queryMeta,category:n.category??null})))}catch(e){console.error("Failed to refresh dashboard data:",e)}finally{this.isRefreshingData=!1,this.cdr.markForCheck()}}collectInitialFilters(t){let e={};for(let n of t){let i=n.config?.chart;if(i?.type==="filter")for(let r of i.controls??[]){if(!r.id)continue;let s=r.value;s!=null&&(typeof s=="string"&&s.trim()===""||(e[r.id]=s))}}return Object.keys(e).length>0?e:null}async applyInitialFilters(t){let e=this.widgets.filter(r=>!pe(r));if(e.length===0||!this.dashboardId)return;this.applyFiltersAbort?.abort();let n=new AbortController;this.applyFiltersAbort=n;let i=++this.applyFiltersSeq;this.applyingFilters=!0;try{let{widgets:r,resolvedFilters:s,filterGroups:g}=await this.openAiService.applyFilters(e,t,this.dashboardId,"published",n.signal,{timeRange:this.currentTimeRange??void 0});if(i!==this.applyFiltersSeq)return;let p=new Map(r.map(m=>[m.id,m]));this.widgets=this.widgets.map(m=>{let M=p.get(m.id);return M?E(x(x({},m),M),{config:M.config??m.config}):m}),this.activeDashboardFilters=t,this.activeResolvedFilters=s,this.activeFilterGroups=g,this.applySummary=Ae(r,this.buildActiveFilters(t))}catch(r){if(r?.name==="AbortError")return;console.error("Apply initial filters failed:",r)}finally{i===this.applyFiltersSeq&&(this.applyingFilters=!1),this.cdr.markForCheck()}}ngAfterViewInit(){this.viewInited=!0,queueMicrotask(()=>this.primeFilterWidgets())}alertTargetWidget(){let t=this.widgets.filter(n=>!pe(n)),e=t.filter(n=>!!n.config?.chart?.gridId);return e.length===1?e[0]:t.find(n=>!!n.queryMeta?.sql)??null}onWidgetPatchedByGrid(t){this.widgets=this.widgets.map(e=>e.id===t.id?t:e),this.cdr.markForCheck()}forecastable={};forecastBusy=new Set;forecastingWidgetId=null;async onForecast(t){let e=this.dashboardId,n=String(t.widget.id);if(!(!e||this.forecastBusy.has(n))){this.forecastBusy.add(n),this.forecastingWidgetId=n,this.cdr.markForCheck();try{let i=t.enable?await this.forecastService.addToWidget(e,n,t.settings??{}):await this.forecastService.removeFromWidget(e,n);if(t.enable&&i?.guardrails&&i.guardrails.passed===!1){z({variant:"info",title:i.guardrails.title||"Not forecastable",content:i.guardrails.body||"This widget can\u2019t be forecast."});return}i?.widget&&this.applyForecastedWidget(i.widget),z({variant:"success",title:t.enable?t.settings?"Forecast updated":"Forecast added":"Forecast removed",content:t.enable?"The projection is shown with its confidence range.":"The chart is back to its measured history."})}catch(i){z({variant:"error",title:t.enable?"Couldn\u2019t add the forecast":"Couldn\u2019t remove the forecast",content:i?.error?.error??"Please try again."})}finally{this.forecastBusy.delete(n),this.forecastingWidgetId=null,this.cdr.markForCheck()}}}applyForecastedWidget(t){this.widgets=this.widgets.map(e=>String(e.id)===String(t.id)?E(x({},e),{config:t.config?.chart??t.nileConfig??e.config,queryMeta:t.queryMeta??e.queryMeta}):e)}onSetAlert(t){if(pe(t)){let e=this.alertTargetWidget();if(!e){z({variant:"error",title:"Cannot set alert",content:"This dashboard has no queryable widget to alert on."});return}this.alertWidget=e,this.alertFilterPredicates=this.activeResolvedFilters,this.alertFilterHasOr=this.activeFilterGroups.length>1,this.alertAuthoringMode="filter"}else this.alertWidget=t,this.alertFilterPredicates=null,this.alertFilterHasOr=!1,this.alertAuthoringMode="widget";this.alertDrawerOpen=!0,this.cdr.markForCheck()}onAlertClosed(){this.alertDrawerOpen=!1,this.cdr.markForCheck()}onAlertSaved(){this.alertDrawerOpen=!1,this.cdr.markForCheck()}onFilterChange(t){let e=t.widgetId,n=t.controlId;!e||!n||this.dashboardId&&this.fetchSuggestionsOnce(e,n,this.dashboardId)}fetchSuggestionsOnce(t,e,n){let i=this.filterSuggestCache.get(t);if(i){this.gridRef?.patchFilterSuggestions(t,e,i);return}this.filterSuggestInflight.has(t)||(this.filterSuggestInflight.add(t),(async()=>{try{let r=await this.openAiService.filterSuggest(n,"",this.widgets,"published");this.applyFilterSuggestions(t,e,r)}catch(r){console.warn("Filter suggest failed:",r)}finally{this.filterSuggestInflight.delete(t)}})())}async onFilterSubmit(t){if(this.isEmptyFilters(t.filters)){await this.reloadDashboard();return}let e=this.widgets.filter(r=>!pe(r));if(e.length===0||!this.dashboardId)return;this.applyFiltersAbort?.abort();let n=new AbortController;this.applyFiltersAbort=n;let i=++this.applyFiltersSeq;this.applyingFilters=!0;try{let{widgets:r,resolvedFilters:s,filterGroups:g}=await this.openAiService.applyFilters(e,t.filters,this.dashboardId,"published",n.signal,{mode:t.mode,prompt:t.prompt,timeRange:this.currentTimeRange??void 0});if(i!==this.applyFiltersSeq)return;let p=new Map(r.map(m=>[m.id,m]));this.widgets=this.widgets.map(m=>{let M=p.get(m.id);return M?E(x(x({},m),M),{config:M.config??m.config}):m}),this.activeDashboardFilters=t.filters,this.lastMonitoredTotal=null,this.activeResolvedFilters=s,this.activeFilterGroups=g,this.applySummary=Ae(r,this.buildActiveFilters(t.filters))}catch(r){if(r?.name==="AbortError")return;console.error("Apply filters failed:",r)}finally{i===this.applyFiltersSeq&&(this.applyingFilters=!1),this.cdr.markForCheck()}}async applyTimeRange(t){this.currentTimeRange=t;let e=this.widgets.filter(r=>!pe(r));if(e.length===0||!this.dashboardId)return;this.applyFiltersAbort?.abort();let n=new AbortController;this.applyFiltersAbort=n;let i=++this.applyFiltersSeq;this.applyingFilters=!0;try{let r=this.activeDashboardFilters??{},{widgets:s,resolvedFilters:g,filterGroups:p}=await this.openAiService.applyFilters(e,r,this.dashboardId,"published",n.signal,{resolvedFilters:this.activeResolvedFilters??[],timeRange:t});if(i!==this.applyFiltersSeq)return;let m=new Map(s.map(M=>[M.id,M]));this.widgets=this.widgets.map(M=>{let V=m.get(M.id);return V?E(x(x({},M),V),{config:V.config??M.config}):M}),this.activeResolvedFilters=g,this.activeFilterGroups=p,this.applySummary=Ae(s,this.buildActiveFilters(r)),this.checkForNewSinceLastCheck(t)}catch(r){if(r?.name==="AbortError")return;console.error("Apply time range failed:",r)}finally{i===this.applyFiltersSeq&&(this.applyingFilters=!1),this.cdr.markForCheck()}}checkForNewSinceLastCheck(t){if(!(Math.abs(Date.now()-new Date(t.to).getTime())<6e4))return;let n=this.kpiTotal(this.widgets);if(n!=null&&this.lastMonitoredTotal!=null&&n>this.lastMonitoredTotal){let i=n-this.lastMonitoredTotal;z({variant:"info",content:`+${i} new since last check`,duration:6e3})}n!=null&&(this.lastMonitoredTotal=n)}kpiTotal(t){let e=0,n=!1;for(let i of t){let r=i.config?.chart;if(r?.type!=="kpi")continue;let s=Number(r.value);Number.isFinite(s)&&(e+=s,n=!0)}return n?e:null}buildActiveFilters(t){return Nt(t,e=>this.filterFieldLabel(e))}filterFieldLabel(t){for(let e of this.filterSuggestCache.values()){let n=e.find(i=>i.type==="attribute"&&i.id===t);if(n)return n.label}return t}isEmptyFilters(t){if(!t)return!0;for(let e of Object.values(t))if(e!=null&&!(typeof e=="string"&&e.trim()==="")&&!(typeof e=="object"&&Object.keys(e).length===0))return!1;return!0}async reloadDashboard(){if(!this.dashboardId)return;this.applyFiltersAbort?.abort();let t=++this.applyFiltersSeq;this.applyingFilters=!0,this.activeDashboardFilters=null,this.lastMonitoredTotal=null,this.activeResolvedFilters=null,this.activeFilterGroups=[],this.applySummary=null;try{let e=await this.dashboardsService.fetchDashboard(this.dashboardId);if(t!==this.applyFiltersSeq)return;this.widgets=(e.widgets??[]).map(n=>({id:n.id,title:n.title??"",widgetType:n.type??"chart",layout:n.layout,config:Vt(n.nileConfig),drilldownBy:n.drilldownBy,dataSourceId:n.dataSourceId,queryMeta:n.queryMeta,category:n.category??null}))}catch(e){console.error("Reload dashboard failed:",e)}finally{t===this.applyFiltersSeq&&(this.applyingFilters=!1),this.cdr.markForCheck()}this.currentTimeRange&&t===this.applyFiltersSeq&&await this.applyTimeRange(this.currentTimeRange)}primeFilterWidgets(){if(this.dashboardId)for(let t of this.widgets){if(this.primedFilterWidgets.has(t.id))continue;let e=t.config?.chart;if(e?.type!=="filter")continue;let n=e.controls?.find(i=>i.variant==="prompt"||i.variant==="expression"||i.variant==="hybrid")??e.controls?.find(i=>i.id);n?.id&&(this.primedFilterWidgets.add(t.id),this.fetchSuggestionsOnce(t.id,n.id,this.dashboardId))}}applyFilterSuggestions(t,e,n){let i=Array.isArray(n.suggestions)?n.suggestions:[];if(!i.length){n.nextToken&&i.push({id:n.nextToken.value,label:n.nextToken.label,type:"attribute"});for(let r of n.completions)i.push({label:r,type:"suggestion"})}i.length!==0&&(this.filterSuggestCache.set(t,i),this.gridRef?.patchFilterSuggestions(t,e,i))}async onAiSend(t){if(!this.dashboardId)return;let e=this.sessionMap.get(t.widgetId)??t.sessionId;this.sessionMap.set(t.widgetId,e);try{let n=Zt(),i=await F(this.http.post(`${S.baseUrl}/api/customers/${n}/products/${O()}/workforce/dashboards/${this.dashboardId}/widgets/${t.widgetId}/chat`,{message:t.message,sessionId:e})),r=i?.reply?.content;r&&(this.sessionMap.set(t.widgetId,i.sessionId??e),this.zone.run(()=>{t.chartEl?.addAiResponse?.(r)}))}catch(n){console.error("Chat request failed:",n),this.zone.run(()=>{t.chartEl?.addAiResponse?.("Sorry, I couldn't process your request. Please try again.")})}}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=H({type:o,selectors:[["app-dashboard-viewer"]],viewQuery:function(e,n){if(e&1&&se(tn,5),e&2){let i;K(i=Q())&&(n.gridRef=i.first)}},inputs:{config:"config"},features:[le([{provide:Pt,useFactory:t=>t.fetchGridPage.bind(t),deps:[j]},{provide:Dt,useFactory:t=>t.fetchFilterValues.bind(t),deps:[A]},Se(A),De(A),ke(A),Te(A)])],decls:4,vars:21,consts:[["grid",""],[3,"forecast","aiSend","openAiBuilder","filterSubmit","filterChange","widgetChartTypeChanged","widgetFiltersChanged","setAlert","widgetClick","widgets","editMode","dashboardId","persistToPublished","widgetsLoading","dashboardFilters","resolvedFilters","applySummary","canSetAlert","canAddToStory","canForecast","forecastable","forecastingWidgetId"],[1,"aq-detail-overlay"],[3,"closed","saved","open","widget","dashboardId","source","filterPredicates","filterHasOr","authoringMode"],[1,"aq-detail-overlay__crumbs"],[3,"nile-click"],["variant","text","width","160","height","16"],[1,"aq-detail-overlay__body"],[3,"widgets","widgetsLoading","editMode","selectable","canSetAlert","canAddToStory","canForecast"],[1,"aq-detail-skeleton"],[1,"aq-detail-skeleton__row"],["variant","rectangular","width","100%","height","96","border-radius","12px"],["variant","rectangular","width","100%","height","280","border-radius","12px"]],template:function(e,n){e&1&&(a(0,"shared-dashboard-grid",1,0),b("forecast",function(r){return n.onForecast(r)})("aiSend",function(r){return n.onAiSend(r)})("openAiBuilder",function(){return n.openInBuilder()})("filterSubmit",function(r){return n.onFilterSubmit(r)})("filterChange",function(r){return n.onFilterChange(r)})("widgetChartTypeChanged",function(r){return n.onWidgetPatchedByGrid(r)})("widgetFiltersChanged",function(r){return n.onWidgetPatchedByGrid(r)})("setAlert",function(r){return n.onSetAlert(r)})("widgetClick",function(r){return n.onKpiWidgetClicked(r)}),l(),y(2,sn,11,3,"div",2),a(3,"app-alert-drawer",3),b("closed",function(){return n.onAlertClosed()})("saved",function(){return n.onAlertSaved()}),l()),e&2&&(v("widgets",n.widgets)("editMode",!1)("dashboardId",n.dashboardId)("persistToPublished",!0)("widgetsLoading",n.applyingFilters||n.isRefreshingData)("dashboardFilters",n.activeDashboardFilters)("resolvedFilters",n.activeResolvedFilters)("applySummary",n.applySummary)("canSetAlert",!0)("canAddToStory",!1)("canForecast",!0)("forecastable",n.forecastable)("forecastingWidgetId",n.forecastingWidgetId),c(2),C(n.widgetDetailPanelOpen?2:-1),c(),v("open",n.alertDrawerOpen)("widget",n.alertWidget)("dashboardId",n.dashboardId)("source",n.alertSource)("filterPredicates",n.alertFilterPredicates)("filterHasOr",n.alertFilterHasOr)("authoringMode",n.alertAuthoringMode))},dependencies:[Me,Oe,Fe],styles:['@charset "UTF-8";[_nghost-%COMP%]{display:block;position:relative;height:100%;view-transition-name:dv-viewer-pane}.aq-detail-overlay[_ngcontent-%COMP%]{position:absolute;inset:0;z-index:50;display:flex;flex-direction:column;background:#fff;view-transition-name:dv-detail-morph}.dv-morphing[_nghost-%COMP%]{view-transition-name:none}.aq-detail-overlay__crumbs[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px;box-sizing:border-box;min-height:56px;padding:10px 20px;border-bottom:1px solid #eaecf0;flex-shrink:0}.aq-detail-overlay__crumbs[_ngcontent-%COMP%] nile-breadcrumb[_ngcontent-%COMP%]{display:inline-flex;align-items:center}.aq-detail-overlay__body[_ngcontent-%COMP%]{flex:1 1 auto;min-height:0;overflow:auto;padding:20px;background:var(--nile-color-bg-subtle, #fbfbfd)}.aq-detail-skeleton[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px}.aq-detail-skeleton__row[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}.aq-detail-skeleton-grid[_ngcontent-%COMP%]{position:relative;width:100%}.aq-detail-skeleton-slot[_ngcontent-%COMP%]{position:absolute}.dv-skel-card[_ngcontent-%COMP%]{height:100%;display:flex;flex-direction:column;box-sizing:border-box;background:var(--ng-colors-bg-primary, #fff);border-radius:var(--ng-radius-xl, 12px);box-shadow:var(--ng-shadow-sm);overflow:hidden}.dv-skel-card__head[_ngcontent-%COMP%]{padding:13px 14px;border-bottom:1px solid #eef1f6;flex-shrink:0}.dv-skel-card__body[_ngcontent-%COMP%]{flex:1;min-height:0;padding:12px 14px}.dv-skel-card__body[_ngcontent-%COMP%] nile-skeleton-loader[_ngcontent-%COMP%], .dv-skel-card__body[_ngcontent-%COMP%] nile-skeleton-loader[_ngcontent-%COMP%]::part(base){height:100%}']})};var Ie=class o{http=w(X);tokenStore=w(ge);get customerId(){return this.tokenStore.tenantId()??""}async chat(t,e,n,i){let r=await new Promise((s,g)=>{let p=this.http.post(`${S.baseUrl}/api/customers/${this.customerId}/products/${O()}/workforce/dashboards/${e}/chat`,{message:t,sessionId:n}).subscribe({next:m=>s(m),error:m=>{m instanceof $?g(new Error(m.error?.error||m.message)):g(m)}});if(i){if(i.aborted){p.unsubscribe();let m=new Error("Aborted");m.name="AbortError",g(m);return}i.addEventListener("abort",()=>{p.unsubscribe();let m=new Error("Aborted");m.name="AbortError",g(m)},{once:!0})}});if(!r?.success)throw new Error("Chat request failed");return r}async getSuggestions(t){if(!t)return[];let e;try{e=await F(this.http.get(`${S.baseUrl}/api/customers/${this.customerId}/products/${O()}/workforce/dashboards/${t}/chat/suggestions`))}catch(n){throw n instanceof $?new Error(n.error?.error||n.message):n}if(Array.isArray(e))return e;if(e.success===!1)throw new Error("Suggestions request failed");return e.suggestions??e.data??[]}static \u0275fac=function(e){return new(e||o)};static \u0275prov=Z({token:o,factory:o.\u0275fac,providedIn:"root"})};var dn=["sliderGrid"],cn=o=>({"recommend-window":o}),gn=()=>({variant:"welcome"}),pn=()=>[1,2,3,4],hn=o=>({"mic-listening":o}),mn=o=>({disabled:o}),Yt=(o,t)=>t.title;function un(o,t){o&1&&L(0)}function fn(o,t){o&1&&(a(0,"div",18),h(1,"nile-skeleton-loader",19),l())}function _n(o,t){o&1&&(a(0,"div",17),I(1,fn,2,0,"div",18,Y),l()),o&2&&(c(),R(ie(0,pn)))}function bn(o,t){if(o&1){let e=D();a(0,"button",23),b("click",function(){let i=u(e).$implicit,r=d(5);return f(r.runPrompt(i.title))}),a(1,"div",24),h(2,"nile-icon",25),l(),a(3,"span",26),P(4),l()()}if(o&2){let e=t.$implicit;c(4),W(e.title)}}function yn(o,t){if(o&1){let e=D();a(0,"div",17),I(1,bn,5,1,"button",20,Yt),l(),a(3,"button",21),b("click",function(){u(e);let i=d(4);return f(i.openPromptGallery())}),h(4,"nile-glyph",22),a(5,"span"),P(6,"View prompt gallery"),l()()}if(o&2){let e=d(4);c(),R(e.topRecommended())}}function Cn(o,t){if(o&1&&(a(0,"div",9)(1,"div",12),h(2,"nile-icon",13),l(),a(3,"h2",14),P(4,"What would you like to ask?"),l(),a(5,"p",15),P(6,"Ask anything about your dashboard."),l(),G(7,un,1,0,"ng-container",16),y(8,_n,3,1,"div",17)(9,yn,7,0),l()),o&2){let e=d(3),n=q(3);c(7),v("ngTemplateOutlet",n)("ngTemplateOutletContext",ie(3,gn)),c(),C(e.loadingSuggestions()?8:e.recommended().length>0?9:-1)}}function vn(o,t){o&1&&(a(0,"div",10),h(1,"nile-icon",27),a(2,"div",28),P(3,"Generating your answer..."),l()()),o&2&&(c(),v("name","loader")("size","20"))}function xn(o,t){if(o&1&&(a(0,"div",29)(1,"div",30)(2,"span"),P(3),l()()()),o&2){let e=d().$implicit;c(3),W(e.content)}}function wn(o,t){if(o&1&&(a(0,"div")(1,"div",31),h(2,"nile-glyph",32),l(),a(3,"div",33),h(4,"div",34),l()()),o&2){let e=d().$implicit;c(4),v("innerHTML",e.content,tt)}}function Pn(o,t){if(o&1&&(y(0,xn,4,1,"div",29),y(1,wn,5,1,"div")),o&2){let e=t.$implicit;C(e.role==="user"?0:-1),c(),C(e.role==="assistant"?1:-1)}}function Mn(o,t){o&1&&L(0)}function Dn(o,t){if(o&1&&G(0,Mn,1,0,"ng-container",35),o&2){d(3);let e=q(3);v("ngTemplateOutlet",e)}}function kn(o,t){if(o&1){let e=D();a(0,"button",23),b("click",function(){let i=u(e).$implicit,r=d(4);return f(r.onGalleryPromptClick(i.title))}),a(1,"div",24),h(2,"nile-icon",25),l(),a(3,"span",26),P(4),l()()}if(o&2){let e=t.$implicit;c(4),W(e.title)}}function Sn(o,t){if(o&1){let e=D();a(0,"div",11)(1,"div",36)(2,"span",37),P(3,"Prompt gallery"),l(),a(4,"button",38),b("click",function(){u(e);let i=d(3);return f(i.closePromptGallery())}),h(5,"nile-glyph",39),l()(),a(6,"div",40)(7,"p",41),P(8,"Pick a suggestion to get started."),l(),a(9,"div",42),I(10,kn,5,1,"button",20,Yt),l()()()}if(o&2){let e=d(3);c(10),R(e.recommended())}}function Tn(o,t){if(o&1){let e=D();a(0,"div",6)(1,"nile-glyph",7),b("click",function(){u(e);let i=d(2);return f(i.closePanel.emit())}),l()(),a(2,"div",8),y(3,Cn,10,4,"div",9),y(4,vn,4,2,"div",10),I(5,Pn,2,2,null,null,Y),l(),y(7,Dn,1,1,"ng-container"),y(8,Sn,12,0,"div",11)}if(o&2){let e,n,i,r,s=d(2);c(2),v("ngClass",de(5,cn,!(!((e=s.chatsDetails())==null||e.message==null)&&e.message.length))),c(),C(!((n=s.chatsDetails())==null||n.message==null)&&n.message.length?-1:3),c(),C(s.isGenerating()?4:-1),c(),R((i=s.chatsDetails())==null?null:i.message),c(2),C(!((r=s.chatsDetails())==null||r.message==null)&&r.message.length?7:-1),c(),C(s.showPromptGallery()?8:-1)}}function On(o,t){if(o&1){let e=D();a(0,"div",43),b("pointerdown",function(i){u(e);let r=d(2);return f(r.onResizeStart(i))})("pointermove",function(i){u(e);let r=d(2);return f(r.onResizeMove(i))})("pointerup",function(i){u(e);let r=d(2);return f(r.onResizeEnd(i))})("pointercancel",function(i){u(e);let r=d(2);return f(r.onResizeEnd(i))}),l(),a(1,"div",44)(2,"div",45)(3,"shared-dashboard-grid",46,1),b("filterSubmit",function(i){u(e);let r=d(2);return f(r.onSliderFilterSubmit(i))})("filterChange",function(i){u(e);let r=d(2);return f(r.onSliderFilterChange(i))})("widgetChartTypeChanged",function(i){u(e);let r=d(2);return f(r.onSliderWidgetPatched(i))})("widgetFiltersChanged",function(i){u(e);let r=d(2);return f(r.onSliderWidgetPatched(i))})("setAlert",function(i){u(e);let r=d(2);return f(r.onSetAlert(i))}),l(),a(5,"app-alert-drawer",47),b("closed",function(){u(e);let i=d(2);return f(i.onAlertClosed())})("saved",function(){u(e);let i=d(2);return f(i.onAlertClosed())}),l()()()}if(o&2){let e=d(2);c(3),v("widgets",e.sliderWidgets())("editMode",!1)("outerMargin",!1)("dashboardId",e.dashboardId())("persistToPublished",!0)("canSetAlert",!0)("canAddToStory",!1),c(2),v("open",e.alertDrawerOpen())("widget",e.alertWidget())("dashboardId",e.dashboardId())("source",e.alertSource())}}function An(o,t){if(o&1&&(a(0,"div",4)(1,"div",5),y(2,Tn,9,7),l(),y(3,On,6,11),l()),o&2){let e=d();B("chat-layout--resizing",e.isResizing()),c(),rt("flex",e.chatColumnWidthPct()!==null?"0 0 "+e.chatColumnWidthPct()+"%":null),B("chat-column--split",!!e.dashboardConfig()&&!e.chatOnly()),c(),C(e.loadingChat()?-1:2),c(),C(e.dashboardConfig()&&!e.chatOnly()?3:-1)}}function Fn(o,t){if(o&1){let e=D();a(0,"div",48)(1,"label",49)(2,"input",50),b("input",function(i){u(e);let r=d();return f(r.queryString.set(i.target.value))})("keyup.enter",function(){u(e);let i=d();return f(i.postMessage())}),l(),a(3,"div",51)(4,"div",52)(5,"nile-glyph",53),b("click",function(){u(e);let i=d();return f(i.toggleMic())}),l(),a(6,"nile-glyph",54),b("click",function(){u(e);let i=d();return f(i.isGenerating()?i.cancelGenerate():i.postMessage())}),l()()()()()}if(o&2){let e=t.variant,n=d();B("input-query-container--welcome",e==="welcome"),c(2),v("value",n.queryString()),c(3),v("name",n.isMicListening()?"ng-mic":"ng-mic-off")("ngClass",de(8,hn,n.isMicListening())),c(),v("name",n.isGenerating()?"ng-circle-stop":"ng-send")("size",n.isGenerating()?"18":"16")("ngClass",de(10,mn,!n.isGenerating()&&!n.queryString()))}}var Re=class o{constructor(t,e,n){this.chatService=t;this.openAiService=e;this.sanitizer=n;te(()=>{let r=this.dashboardId();r&&this.loadSuggestions(r)});let i=null;te(()=>{let r=this.dashboardConfig(),s=r?.id??null;s!==i&&(this.primedFilterWidgets.clear(),i=s);let g=(r?.widgets??[]).map(p=>({id:p.id,title:p.title??"",widgetType:p.type??"chart",layout:p.layout,config:p.nileConfig,drilldownBy:p.drilldownBy,queryMeta:p.queryMeta,dataSourceId:p.dataSourceId}));this.sliderWidgets.set(g),queueMicrotask(()=>this.primeFilterWidgets())})}chatService;openAiService;sanitizer;closePanel=new me;dashboardId=J("");dashboardName=J("");dashboardConfig=J(null);chatOnly=J(!1);initialPrompt=J("");allChats=_([]);chatsDetails=_(null);isGenerating=_(!1);queryString=_("");searchTerm=_("");selectedChatContextId=_("");loadingChat=_(!1);loadingAllChat=_(!1);isDeleting=_(!1);isMicListening=_(!1);recognition=null;micBaseText="";silenceTimer=null;micSilenceMs=5e3;recommended=_([]);topRecommended=T(()=>this.recommended().slice(0,4));loadingSuggestions=_(!1);showPromptGallery=_(!1);chatColumnWidthPct=_(null);isResizing=_(!1);resizeRect=null;resizePointerId=null;resizeRafPending=!1;sliderWidgets=_([]);alertDrawerOpen=_(!1);alertWidget=_(null);onSetAlert(t){this.alertWidget.set(t),this.alertDrawerOpen.set(!0)}onSliderWidgetPatched(t){this.sliderWidgets.update(e=>e.map(n=>n.id===t.id?t:n))}onAlertClosed(){this.alertDrawerOpen.set(!1)}alertSource=T(()=>{let t=this.dashboardConfig();return t?{connectionId:t.connectionId,isPipeline:t.isPipeline,adapterType:t.adapterType}:null});sliderGridRef;applyingFilters=_(!1);filterSuggestTimers=new Map;filterSuggestSeq=new Map;primedFilterWidgets=new Set;applyFiltersSeq=0;applyFiltersAbort;generateAbort;formattedChats=T(()=>this.buildFormattedChats(this.allChats()));filteredFormattedChats=T(()=>{let t=this.formattedChats(),e=this.searchTerm().toLowerCase().trim();if(!e)return t;let n=i=>i.filter(r=>r.displayName.toLowerCase().includes(e));return{today:n(t.today),yesterday:n(t.yesterday),older:n(t.older)}});ngOnInit(){this.createNewChat();let t=this.initialPrompt();t&&(this.queryString.set(t),this.postMessage())}async loadSuggestions(t){this.loadingSuggestions.set(!0);try{let e=await this.chatService.getSuggestions(t);this.recommended.set(e.map(n=>({title:n})))}catch(e){console.error("Failed to load chat suggestions:",e),this.recommended.set([])}finally{this.loadingSuggestions.set(!1)}}runPrompt(t){this.queryString.set(t),this.postMessage()}openPromptGallery(){this.showPromptGallery.set(!0)}closePromptGallery(){this.showPromptGallery.set(!1)}onGalleryPromptClick(t){this.closePromptGallery(),this.runPrompt(t)}isFilterWidget(t){return t?.config?.chart?.type==="filter"}onSliderFilterChange(t){let e=t.widgetId,n=t.controlId;if(!e||!n)return;let i=this.dashboardId();if(!i)return;let r=this.filterSuggestTimers.get(e);r&&clearTimeout(r);let s=(t.query??"").trim();if(!s)return;let g=(this.filterSuggestSeq.get(e)??0)+1;this.filterSuggestSeq.set(e,g);let p=setTimeout(async()=>{try{let m=this.sliderWidgets(),M=await this.openAiService.filterSuggest(i,s,m,"published");if(this.filterSuggestSeq.get(e)!==g)return;this.applyFilterSuggestions(e,n,M)}catch(m){console.warn("Filter suggest failed:",m)}},400);this.filterSuggestTimers.set(e,p)}async onSliderFilterSubmit(t){let e=this.sliderWidgets(),n=e.filter(s=>!this.isFilterWidget(s));if(n.length===0)return;this.applyFiltersAbort?.abort();let i=new AbortController;this.applyFiltersAbort=i;let r=++this.applyFiltersSeq;this.applyingFilters.set(!0);try{let{widgets:s}=await this.openAiService.applyFilters(n,t.filters,this.dashboardId(),"published",i.signal,{mode:t.mode,prompt:t.prompt});if(r!==this.applyFiltersSeq)return;let g=new Map(s.map(p=>[p.id,p]));this.sliderWidgets.set(e.map(p=>{let m=g.get(p.id);return m?E(x(x({},p),m),{config:m.config??p.config}):p}))}catch(s){if(s?.name==="AbortError"||r!==this.applyFiltersSeq)return;let g=s instanceof Error?s.message:"Failed to apply filters.";this.pushSystemMessage("error",`Apply filters failed: ${g}`)}finally{r===this.applyFiltersSeq&&this.applyingFilters.set(!1)}}primeFilterWidgets(){let t=this.dashboardId();if(!t)return;let e=this.sliderWidgets();for(let n of e){if(this.primedFilterWidgets.has(n.id))continue;let i=n.config?.chart;if(i?.type!=="filter")continue;let r=i.controls?.find(g=>g.variant==="expression"||g.variant==="hybrid");if(!r?.id)continue;this.primedFilterWidgets.add(n.id);let s=r.id;(async()=>{try{let g=await this.openAiService.filterSuggest(t,"",e,"published");this.applyFilterSuggestions(n.id,s,g)}catch(g){this.primedFilterWidgets.delete(n.id),console.warn("Filter suggest prime failed:",g)}})()}}applyFilterSuggestions(t,e,n){let i=Array.isArray(n.suggestions)?n.suggestions:[];if(!i.length){n.nextToken&&i.push({id:n.nextToken.value,label:n.nextToken.label,type:"attribute"});for(let r of n.completions)i.push({label:r,type:"suggestion"})}i.length!==0&&this.sliderGridRef?.patchFilterSuggestions(t,e,i)}onResizeStart(t){t.preventDefault();let e=t.currentTarget,n=e.parentElement;n&&(this.resizeRect=n.getBoundingClientRect(),e.setPointerCapture(t.pointerId),this.resizePointerId=t.pointerId,this.isResizing.set(!0))}onResizeMove(t){if(!this.isResizing()||!this.resizeRect)return;let n=(t.clientX-this.resizeRect.left)/this.resizeRect.width*100,i=Math.min(75,Math.max(20,n));this.chatColumnWidthPct.set(i),this.scheduleGridReflow()}onResizeEnd(t){let e=t.currentTarget;this.resizePointerId!==null&&e.hasPointerCapture?.(this.resizePointerId)&&e.releasePointerCapture(this.resizePointerId),this.isResizing.set(!1),this.resizeRect=null,this.resizePointerId=null,this.scheduleGridReflow()}scheduleGridReflow(){this.resizeRafPending||(this.resizeRafPending=!0,requestAnimationFrame(()=>{this.resizeRafPending=!1,window.dispatchEvent(new Event("resize"))}))}createNewChat(){let t={id:crypto.randomUUID(),displayName:"New Chat",createdOn:new Date().toISOString(),sessionId:crypto.randomUUID(),message:[]};this.allChats.update(e=>[t,...e]),this.getChatDetails(t.id)}getChatDetails(t){this.selectedChatContextId.set(t);let e=this.allChats().find(n=>n.id===t);e&&this.chatsDetails.set(e),this.loadingChat.set(!1)}deleteChat(t){if(this.isDeleting.set(!0),this.allChats.update(e=>e.filter(n=>n.id!==t)),this.isDeleting.set(!1),this.chatsDetails()?.id===t){let e=this.allChats();e.length?this.getChatDetails(e[0].id):this.createNewChat()}}onSearchChat(t){this.searchTerm.set(t)}async postMessage(){let t=this.queryString().trim();if(!t||this.isGenerating())return;this.chatsDetails()||this.createNewChat();let e=this.chatsDetails();e.message.unshift({role:"user",content:t}),e.displayName==="New Chat"&&(e.displayName=t.length>20?t.substring(0,20):t,this.allChats.update(i=>[...i])),this.chatsDetails.set(x({},e)),this.queryString.set(""),this.isGenerating.set(!0);let n=new AbortController;this.generateAbort=n;try{let i=await this.chatService.chat(t,this.dashboardId(),e.sessionId,n.signal);e.sessionId=i.sessionId,e.message.unshift({role:"assistant",content:this.sanitizeHtml(i.reply.content)})}catch(i){if(i instanceof Error&&i.name==="AbortError")e.message=e.message.filter((r,s)=>!(s===0&&r.role==="user"));else{let r=i instanceof Error?i.message:"Failed to get response.";this.pushSystemMessage("error",`Chat failed: ${r}`)}}finally{this.generateAbort===n&&(this.generateAbort=void 0),this.chatsDetails.set(x({},e)),this.isGenerating.set(!1)}}cancelGenerate(){this.generateAbort?.abort()}toggleMic(){this.isMicListening()?(this.clearSilenceTimer(),this.recognition?.stop()):this.startListening()}startListening(){let t=window,e=t.SpeechRecognition??t.webkitSpeechRecognition;e&&(this.micBaseText=this.queryString(),this.recognition=new e,this.recognition.continuous=!0,this.recognition.interimResults=!0,this.recognition.lang="en-US",this.recognition.onresult=n=>{let i="";for(let s=0;s<n.results.length;s++)i+=n.results[s][0].transcript;let r=this.micBaseText&&!this.micBaseText.endsWith(" ")?" ":"";this.queryString.set(this.micBaseText+r+i),this.resetSilenceTimer()},this.recognition.onend=()=>{this.clearSilenceTimer(),this.isMicListening.set(!1),this.recognition=null},this.recognition.start(),this.isMicListening.set(!0),this.resetSilenceTimer())}resetSilenceTimer(){this.clearSilenceTimer(),this.silenceTimer=setTimeout(()=>{this.silenceTimer=null,this.recognition?.stop(),this.queryString().trim()&&this.postMessage()},this.micSilenceMs)}clearSilenceTimer(){this.silenceTimer!==null&&(clearTimeout(this.silenceTimer),this.silenceTimer=null)}pushSystemMessage(t,e){let n=this.chatsDetails();if(!n){this.showToast(t==="error"?"error":"success",t==="error"?"Notice":"Done",e);return}let i=String(e).trim().replace(/[.!?]+$/,"").replace(/[<>&]/g,s=>s==="<"?"&lt;":s===">"?"&gt;":"&amp;"),r=t==="error"?`ERROR: ${i}!`:i;n.message.unshift({role:"assistant",content:this.sanitizeHtml(`<p class="chat-system chat-system--${t}">${r}</p>`)}),this.chatsDetails.set(x({},n))}showToast(t,e,n){if(t==="error"){At(`${e}: ${n}`.replace(/^:\s*/,""));return}let i=document.createElement("nile-toast");i.variant=t,i.title=e,i.content=n,i.duration=5e3,i.closable=!0,i.toast(),Ft()}sanitizeHtml(t){return this.sanitizer.sanitize(et.HTML,t)??""}buildFormattedChats(t){let e=[...t].sort((i,r)=>new Date(r.createdOn).getTime()-new Date(i.createdOn).getTime()),n={today:[],yesterday:[],older:[]};return e.forEach(i=>{this.isToday(i.createdOn)?n.today.push(i):this.isYesterday(i.createdOn)?n.yesterday.push(i):n.older.push(i)}),n}isToday(t){let e=new Date(t),n=new Date;return e.getDate()===n.getDate()&&e.getMonth()===n.getMonth()&&e.getFullYear()===n.getFullYear()}isYesterday(t){let e=new Date(t),n=new Date;return n.setDate(n.getDate()-1),e.getDate()===n.getDate()&&e.getMonth()===n.getMonth()&&e.getFullYear()===n.getFullYear()}static \u0275fac=function(e){return new(e||o)(xe(Ie),xe(j),xe(ct))};static \u0275cmp=H({type:o,selectors:[["db-ai-prompt-panel"]],viewQuery:function(e,n){if(e&1&&se(dn,5),e&2){let i;K(i=Q())&&(n.sliderGridRef=i.first)}},inputs:{dashboardId:[1,"dashboardId"],dashboardName:[1,"dashboardName"],dashboardConfig:[1,"dashboardConfig"],chatOnly:[1,"chatOnly"],initialPrompt:[1,"initialPrompt"]},outputs:{closePanel:"closePanel"},features:[le([])],decls:4,vars:1,consts:[["promptInput",""],["sliderGrid",""],[1,"qna-panel"],[1,"chat-layout",3,"chat-layout--resizing"],[1,"chat-layout"],[1,"chat-column"],[1,"chat-header"],["name","close","size","16",1,"close-panel-icon",3,"click"],[1,"chat-message-container",3,"ngClass"],[1,"welcome-section"],[1,"generating-loader"],[1,"contained-panel","prompt-gallery-panel"],[1,"ai-badge","ai-badge--md","welcome-icon-wrap"],["color","#2970ff","name","smartcode","size","20"],[1,"welcome-title"],[1,"welcome-subtitle"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"recommended"],[1,"recommended-box","skeleton-box"],[2,"width","100%","height","64px","border-radius","12px"],["type","button",1,"recommended-box"],["type","button",1,"browse-more",3,"click"],["name","ng-lightbulb-05","method","stroke","size","14"],["type","button",1,"recommended-box",3,"click"],[1,"ai-badge","ai-badge--sm","rec-icon-wrap"],["color","#2970ff","name","ng-lightbulb-05","size","16","method","stroke"],[1,"rec-title"],[3,"name","size"],[1,"generating-text"],[1,"user-row"],[1,"user"],[1,"ai-badge","ai-badge--sm","assistant-icon"],["name","ng-stars-02","method","stroke","size","16","color","#2970ff"],[1,"assistant"],[1,"assistant-body",3,"innerHTML"],[4,"ngTemplateOutlet"],[1,"contained-panel__header"],[1,"contained-panel__title"],["type","button","aria-label","Close",1,"contained-panel__close",3,"click"],["name","close","size","16"],[1,"contained-panel__body"],[1,"prompt-gallery-subtitle"],[1,"prompt-gallery"],["role","separator","aria-orientation","vertical","aria-label","Resize chat column",1,"chat-layout__resizer",3,"pointerdown","pointermove","pointerup","pointercancel"],[1,"dashboard-slider"],[1,"dashboard-slider__body"],[3,"filterSubmit","filterChange","widgetChartTypeChanged","widgetFiltersChanged","setAlert","widgets","editMode","outerMargin","dashboardId","persistToPublished","canSetAlert","canAddToStory"],[3,"closed","saved","open","widget","dashboardId","source"],[1,"input-query-container"],[1,"chat-input-pill"],["type","text","placeholder","Enter your query",1,"input-query",3,"input","keyup.enter","value"],[1,"pill-toolbar"],[1,"pill-toolbar__right"],["method","stroke",1,"mic-icon",3,"click","name","ngClass"],["method","stroke",1,"send-icon",3,"click","name","size","ngClass"]],template:function(e,n){e&1&&(a(0,"div",2),y(1,An,4,8,"div",3),l(),G(2,Fn,7,12,"ng-template",null,0,fe)),e&2&&(c(),C(n.loadingAllChat()?-1:1))},dependencies:[Me,st,Pe,zt,Oe,Fe],styles:['@charset "UTF-8";[_nghost-%COMP%]{display:block;height:100%;min-height:0}.qna-panel[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;background:var(--ng-colors-bg-secondary, #f9fafb);font-family:var(--ng-font-family-body)}.chat-layout[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:row;overflow:hidden;min-height:0;container-type:inline-size}.chat-layout.chat-layout--resizing[_ngcontent-%COMP%]{cursor:col-resize;-webkit-user-select:none;user-select:none}.chat-layout.chat-layout--resizing[_ngcontent-%COMP%] .chat-column[_ngcontent-%COMP%]{transition:none!important}.chat-layout.chat-layout--resizing[_ngcontent-%COMP%] .chat-layout__resizer[_ngcontent-%COMP%]:after{opacity:1}.chat-layout__resizer[_ngcontent-%COMP%]{flex:0 0 1px;align-self:stretch;cursor:col-resize;touch-action:none;-webkit-user-select:none;user-select:none;position:relative;background:transparent}.chat-layout__resizer[_ngcontent-%COMP%]:before{content:"";position:absolute;top:0;bottom:0;left:50%;transform:translate(-50%);width:1px;background:var(--ng-colors-border-secondary, #e9eaeb);transition:background .15s}.chat-layout__resizer[_ngcontent-%COMP%]:after{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:4px;height:36px;border-radius:999px;background:#2970ff;opacity:0;transition:opacity .15s;pointer-events:none}.chat-layout__resizer[_ngcontent-%COMP%]:hover:before{background:#2970ff;opacity:0;transition:opacity .15s;pointer-events:none}.chat-layout__resizer[_ngcontent-%COMP%]:hover:after{opacity:1}.dashboard-slider[_ngcontent-%COMP%]{flex:1 1 auto;display:flex;flex-direction:column;overflow:hidden;min-width:0;min-height:0;background:var(--ng-colors-bg-secondary, #f9fafb);animation:_ngcontent-%COMP%_slider-in .25s ease-out}.dashboard-slider__header[_ngcontent-%COMP%]{height:56px;padding:0 16px;border-bottom:1px solid var(--ng-colors-border-secondary, #e9eaeb);flex-shrink:0;background:#fff;display:flex;align-items:center;justify-content:space-between;box-sizing:border-box}.dashboard-slider__title[_ngcontent-%COMP%]{font-size:13px;font-weight:600;color:var(--ng-colors-text-primary-900, #181d27)}.dashboard-slider__body[_ngcontent-%COMP%]{flex:1;min-height:0;min-width:0;overflow:auto;padding:8px}.dashboard-slider__body[_ngcontent-%COMP%] > shared-dashboard-grid[_ngcontent-%COMP%]{display:block;min-width:calc(66.6667cqw - 32px)}@keyframes _ngcontent-%COMP%_slider-in{0%{transform:translate(24px);opacity:0}to{transform:translate(0);opacity:1}}.chat-column[_ngcontent-%COMP%]{flex:1 1 auto;display:flex;flex-direction:column;overflow:hidden;min-width:0;position:relative;background:#fff;container-type:inline-size;transition:flex-basis .3s ease,flex .3s ease}.chat-column.chat-column--split[_ngcontent-%COMP%]{flex:0 0 33.333%}.chat-column[_ngcontent-%COMP%] .chat-header[_ngcontent-%COMP%]{padding:16px 16px 8px;flex-shrink:0;background:#fff;display:flex;align-items:center;justify-content:flex-end}.chat-column[_ngcontent-%COMP%] .chat-header[_ngcontent-%COMP%] .close-panel-icon[_ngcontent-%COMP%]{cursor:pointer;color:var(--ng-colors-text-tertiary-600, #535862);transition:color .15s}.chat-column[_ngcontent-%COMP%] .chat-header[_ngcontent-%COMP%] .close-panel-icon[_ngcontent-%COMP%]:hover{color:var(--ng-colors-text-primary-900, #181d27)}.chat-column[_ngcontent-%COMP%] .chat-message-container[_ngcontent-%COMP%]{flex:1;overflow:auto;padding:20px 24px;display:flex;flex-direction:column-reverse}.chat-column[_ngcontent-%COMP%] .chat-message-container.recommend-window[_ngcontent-%COMP%]{justify-content:center;align-items:center;padding:32px 40px}.chat-column[_ngcontent-%COMP%] .chat-message-container[_ngcontent-%COMP%] .user-row[_ngcontent-%COMP%]{display:flex;flex-direction:row-reverse;justify-content:flex-start;align-items:flex-start;gap:8px;margin-bottom:20px;margin-top:8px}.chat-column[_ngcontent-%COMP%] .chat-message-container[_ngcontent-%COMP%] .user[_ngcontent-%COMP%]{flex:0 1 auto;min-width:0}.chat-column[_ngcontent-%COMP%] .chat-message-container[_ngcontent-%COMP%] .user[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{background:#eff4ff;color:var(--ng-colors-text-primary-900, #181d27);padding:9px 14px;border-radius:14px 14px 2px;font-size:14px;display:inline-block;max-width:100%;text-align:left}.chat-column[_ngcontent-%COMP%] .chat-message-container[_ngcontent-%COMP%] .user-icon[_ngcontent-%COMP%]{flex-shrink:0;width:28px;height:28px;border-radius:50%;background:#eff4ff;color:#2970ff;display:inline-flex;align-items:center;justify-content:center}.chat-column[_ngcontent-%COMP%] .chat-message-container[_ngcontent-%COMP%] .assistant-icon[_ngcontent-%COMP%]{margin-bottom:6px}.chat-column[_ngcontent-%COMP%] .chat-message-container[_ngcontent-%COMP%] .assistant[_ngcontent-%COMP%]{padding:14px 16px;background:var(--ng-colors-bg-secondary, #f9fafb);border:1px solid var(--ng-colors-border-secondary, #e9eaeb);border-radius:2px 14px 14px;margin-bottom:14px;font-size:14px;line-height:1.65;color:var(--ng-colors-text-primary-900, #181d27)}.chat-column[_ngcontent-%COMP%] .chat-message-container[_ngcontent-%COMP%] .generating-loader[_ngcontent-%COMP%]{padding:10px 14px;height:40px;display:flex;gap:8px;align-items:center;background:var(--ng-colors-bg-secondary, #f9fafb);border:1px solid var(--ng-colors-border-secondary, #e9eaeb);border-radius:8px;font-size:13px;color:var(--ng-colors-text-tertiary-600, #535862);width:fit-content}.chat-column[_ngcontent-%COMP%] .chat-message-container[_ngcontent-%COMP%] .welcome-section[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:12px;width:100%;max-width:820px;text-align:center}.chat-column[_ngcontent-%COMP%] .chat-message-container[_ngcontent-%COMP%] .welcome-section[_ngcontent-%COMP%] .welcome-icon-wrap[_ngcontent-%COMP%]{margin-bottom:4px}.chat-column[_ngcontent-%COMP%] .chat-message-container[_ngcontent-%COMP%] .welcome-section[_ngcontent-%COMP%] .welcome-title[_ngcontent-%COMP%]{margin:0;font-size:22px;font-weight:700;color:var(--ng-colors-text-primary-900, #181d27);letter-spacing:-.02em}.chat-column[_ngcontent-%COMP%] .chat-message-container[_ngcontent-%COMP%] .welcome-section[_ngcontent-%COMP%] .welcome-subtitle[_ngcontent-%COMP%]{margin:0 0 8px;font-size:14px;color:var(--ng-colors-text-tertiary-600, #535862);max-width:440px;line-height:1.6}.chat-column[_ngcontent-%COMP%] .chat-message-container[_ngcontent-%COMP%] .browse-more[_ngcontent-%COMP%]{margin-top:4px;align-self:flex-end;display:inline-flex;align-items:center;gap:6px;padding:6px 4px;background:transparent;border:0;cursor:pointer;font-size:12px;font-weight:500;color:var(--ng-colors-text-tertiary-600, #535862);transition:color .15s}.chat-column[_ngcontent-%COMP%] .chat-message-container[_ngcontent-%COMP%] .browse-more[_ngcontent-%COMP%]:hover{color:#2970ff}.chat-column[_ngcontent-%COMP%] .chat-message-container[_ngcontent-%COMP%] .recommended[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;width:100%}.chat-column[_ngcontent-%COMP%] .chat-message-container[_ngcontent-%COMP%] .recommended[_ngcontent-%COMP%] .recommended-box[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;font:inherit;color:inherit;border:1px solid var(--ng-colors-border-secondary, #e9eaeb);border-radius:14px;padding:18px;cursor:pointer;transition:border-color .18s,box-shadow .18s,transform .15s;background:#fff;text-align:left}.chat-column[_ngcontent-%COMP%] .chat-message-container[_ngcontent-%COMP%] .recommended[_ngcontent-%COMP%] .recommended-box[_ngcontent-%COMP%]:hover{border-color:#2970ff;box-shadow:0 6px 24px #2970ff1a;transform:translateY(-2px)}.chat-column[_ngcontent-%COMP%] .chat-message-container[_ngcontent-%COMP%] .recommended[_ngcontent-%COMP%] .recommended-box[_ngcontent-%COMP%] .rec-title[_ngcontent-%COMP%]{font-size:13px;font-weight:600;color:var(--ng-colors-text-primary-900, #181d27);text-transform:capitalize;line-height:1.4}.chat-column[_ngcontent-%COMP%] .input-query-container[_ngcontent-%COMP%]{padding:14px 24px 18px;display:flex;justify-content:center;flex-shrink:0;background:#fff}.chat-column[_ngcontent-%COMP%] .input-query-container[_ngcontent-%COMP%] .chat-input-pill[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px;width:100%;max-width:760px;padding:14px 16px 12px;background:#fff;border:1px solid var(--ng-colors-border-secondary, #e9eaeb);border-radius:24px;box-shadow:0 1px 2px #1018280a,0 8px 24px #1018280f;cursor:text;transition:border-color .15s,box-shadow .15s}.chat-column[_ngcontent-%COMP%] .input-query-container[_ngcontent-%COMP%] .chat-input-pill[_ngcontent-%COMP%]:focus-within{border-color:#2970ff;box-shadow:0 0 0 3px #2970ff1f}.chat-column[_ngcontent-%COMP%] .input-query-container[_ngcontent-%COMP%] .input-query[_ngcontent-%COMP%]{width:100%;min-width:0;border:0;outline:0;background:transparent;padding:6px 2px;font:inherit;font-size:15px;color:var(--ng-colors-text-primary-900, #181d27);text-overflow:ellipsis}.chat-column[_ngcontent-%COMP%] .input-query-container[_ngcontent-%COMP%] .input-query[_ngcontent-%COMP%]::placeholder{color:var(--ng-colors-text-tertiary-600, #717680);overflow:hidden;text-overflow:ellipsis}.chat-column[_ngcontent-%COMP%] .input-query-container[_ngcontent-%COMP%] .pill-toolbar[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;gap:8px}.chat-column[_ngcontent-%COMP%] .input-query-container[_ngcontent-%COMP%] .pill-toolbar__right[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.chat-column[_ngcontent-%COMP%] .input-query-container[_ngcontent-%COMP%] .send-icon[_ngcontent-%COMP%]{cursor:pointer;flex-shrink:0;transition:opacity .15s,transform .15s}.chat-column[_ngcontent-%COMP%] .input-query-container[_ngcontent-%COMP%] .send-icon[_ngcontent-%COMP%]:hover{transform:translate(2px)}.chat-column[_ngcontent-%COMP%] .input-query-container[_ngcontent-%COMP%] .send-icon.disabled[_ngcontent-%COMP%]{opacity:.2;pointer-events:none}.chat-column[_ngcontent-%COMP%] .input-query-container[_ngcontent-%COMP%] .mic-icon[_ngcontent-%COMP%]{cursor:pointer;color:var(--ng-colors-text-tertiary-600, #535862);transition:color .15s}.chat-column[_ngcontent-%COMP%] .input-query-container[_ngcontent-%COMP%] .mic-icon[_ngcontent-%COMP%]:hover{color:#2970ff}.chat-column[_ngcontent-%COMP%] .input-query-container[_ngcontent-%COMP%] .mic-icon.mic-listening[_ngcontent-%COMP%]{color:#e53e3e;animation:_ngcontent-%COMP%_mic-pulse 1.2s ease-in-out infinite}.chat-column[_ngcontent-%COMP%] .input-query-container.input-query-container--welcome[_ngcontent-%COMP%]{border-top:0;background:transparent;padding:4px 0 12px;width:100%;max-width:680px}@keyframes _ngcontent-%COMP%_mic-pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.55;transform:scale(1.3)}}.dashboard-slider__body[_ngcontent-%COMP%]{padding:unset}.contained-panel[_ngcontent-%COMP%]{position:absolute;inset:0;display:flex;flex-direction:column;background:#fff;border-left:1px solid var(--ng-colors-border-secondary, #e9eaeb);box-shadow:-8px 0 24px #10182814;z-index:var(--z-floating);animation:_ngcontent-%COMP%_contained-slide .25s ease-out}.contained-panel__header[_ngcontent-%COMP%]{height:56px;padding:0 16px;border-bottom:1px solid var(--ng-colors-border-secondary, #e9eaeb);flex-shrink:0;background:#fff;display:flex;align-items:center;justify-content:space-between;gap:8px;box-sizing:border-box}.contained-panel__close[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;padding:4px;border:0;outline:0;background:transparent;color:var(--ng-colors-text-tertiary-600, #535862);cursor:pointer;transition:color .15s;flex-shrink:0}.contained-panel__close[_ngcontent-%COMP%]:hover{color:var(--ng-colors-text-primary-900, #181d27)}.contained-panel__title[_ngcontent-%COMP%]{font-size:14px;font-weight:600;color:var(--ng-colors-text-primary-900, #181d27);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.contained-panel__body[_ngcontent-%COMP%]{flex:1;min-height:0;overflow:auto;padding:16px 20px 20px}.prompt-gallery-subtitle[_ngcontent-%COMP%]{margin:0 0 24px;font-size:13px;color:var(--ng-colors-text-tertiary-600, #535862)}.prompt-gallery[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr;gap:12px;padding:6px 6px 8px}.prompt-gallery[_ngcontent-%COMP%] .recommended-box[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;gap:10px;border:1px solid var(--ng-colors-border-secondary, #e9eaeb);border-radius:12px;padding:12px 16px;cursor:pointer;background:#fff;text-align:left;font:inherit;color:inherit;transition:border-color .18s,box-shadow .18s,transform .15s}.prompt-gallery[_ngcontent-%COMP%] .recommended-box[_ngcontent-%COMP%]:hover{border-color:#2970ff;box-shadow:0 6px 24px #2970ff1a;transform:translateY(-2px)}.prompt-gallery[_ngcontent-%COMP%] .recommended-box[_ngcontent-%COMP%] .rec-title[_ngcontent-%COMP%]{font-size:13px;font-weight:500;color:var(--ng-colors-text-secondary-700, #414651);line-height:1.45}@keyframes _ngcontent-%COMP%_contained-slide{0%{transform:translate(8px);opacity:0}to{transform:translate(0);opacity:1}}.chat-system[_ngcontent-%COMP%]{margin:4px 0;font-size:13px;line-height:1.4;color:var(--ng-colors-text-tertiary-600, #535862)}.chat-system--error[_ngcontent-%COMP%]{color:var(--ng-colors-fg-error-primary, #d92d20);font-weight:500}']})};var En=o=>[o];function In(o,t){if(o&1&&ue(0,"nile-progress-bar",4),o&2){let e=d();ot("value",e.percent())}}var ze=class o{streamId;done=new me;failed=new me;streamService=w($t);totalCharts=_(0);widgetPhases=_([]);phaseLabel=_("Connecting to your data\u2026");dashboardNumber=_(0);barKey=_(0);pendingNewDashboard=!0;readyCount=T(()=>this.widgetPhases().filter(t=>t==="building"||t==="saving").length);percent=T(()=>{let t=this.totalCharts();if(!t)return 0;let e=this.widgetPhases(),n=0;for(let i=0;i<t;i++){let r=e[i];n+=r==="building"||r==="saving"?1:r==="querying"?.66:r==="analyzing"?.33:0}return Math.round(Math.min(1,n/t)*100)});countLabel=T(()=>{let t=this.totalCharts(),e=this.dashboardNumber();return!t||!e?"":`Dashboard ${e} \xB7 ${this.readyCount()} of ${t} charts`});finished=!1;dispose=null;ngOnInit(){if(!this.streamId){this.failed.emit();return}this.dispose=this.streamService.stream(this.streamId,t=>this.onEvent(t))}ngOnDestroy(){this.teardown()}onEvent(t){switch(t.kind){case"progress":{this.pendingNewDashboard&&(this.dashboardNumber.update(e=>e+1),this.pendingNewDashboard=!1),this.totalCharts.set(t.totalWidgets),this.widgetPhases.update(e=>{let n=[...e];return n[t.widgetIndex]=Lt(n[t.widgetIndex],t.phase),n}),this.phaseLabel.set(t.label);break}case"dashboard-start":{this.resetForNextDashboard(t.dashboardName?`Setting up ${t.dashboardName}\u2026`:"Preparing the next dashboard\u2026");break}case"saved":{this.resetForNextDashboard("Preparing the next dashboard\u2026");break}case"complete":{t.dashboardIds.length>0?this.finish(()=>this.done.emit(t.dashboardIds)):this.finish(()=>this.failed.emit());break}case"error":{t.dashboardIds.length>0?this.finish(()=>this.done.emit(t.dashboardIds)):this.finish(()=>this.failed.emit());break}}}resetForNextDashboard(t){this.barKey.update(e=>e+1),this.pendingNewDashboard=!0,this.totalCharts.set(0),this.widgetPhases.set([]),this.phaseLabel.set(t)}finish(t){this.finished||(this.finished=!0,this.teardown(),t())}teardown(){this.dispose?.(),this.dispose=null}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=H({type:o,selectors:[["app-dashboard-generating"]],inputs:{streamId:"streamId"},outputs:{done:"done",failed:"failed"},decls:13,vars:4,consts:[["role","status","aria-live","polite",1,"genbar"],["variant","informative","size","medium","pulse","",1,"genbar__light"],[1,"genbar__title"],["aria-hidden","true",1,"genbar__divider"],[1,"genbar__bar",3,"value"],[1,"genbar__count"],[1,"genbar__live"],["aria-hidden","true",1,"genbar__spinner"],[1,"genbar__status"]],template:function(e,n){e&1&&(ae(0,"div",0),ue(1,"nile-status-light",1),ae(2,"span",2),P(3,"Generating your dashboards"),we(),ue(4,"span",3),I(5,In,1,1,"nile-progress-bar",4,it),ae(7,"span",5),P(8),we(),ae(9,"div",6),ue(10,"nile-spinner",7),ae(11,"span",8),P(12),we()()()),e&2&&(c(5),R(de(2,En,n.barKey())),c(3),W(n.countLabel()),c(4),W(n.phaseLabel()))},styles:["[_nghost-%COMP%]{display:block;width:100%}.genbar[_ngcontent-%COMP%]{display:flex;align-items:center;gap:var(--ng-spacing-md, 12px);width:100%;min-width:0;padding-inline-start:var(--ng-spacing-lg, 16px)}.genbar__light[_ngcontent-%COMP%]{flex:none}.genbar__title[_ngcontent-%COMP%]{font-size:var(--ng-font-size-text-sm, 14px);font-weight:var(--ng-font-weight-semibold, 600);line-height:var(--ng-line-height-text-sm, 1.4);color:var(--ng-colors-text-primary-900, #181d27);white-space:nowrap}.genbar__divider[_ngcontent-%COMP%]{width:1px;height:20px;background:var(--ng-colors-border-secondary, #e9eaeb);flex:none}.genbar__bar[_ngcontent-%COMP%]{width:160px;flex:none}.genbar__count[_ngcontent-%COMP%]{font-size:var(--ng-font-size-text-sm, 14px);line-height:var(--ng-line-height-text-sm, 1.4);color:var(--ng-colors-text-tertiary-600, #535862);white-space:nowrap}.genbar__live[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;margin-left:auto;flex:none;min-width:0}.genbar__spinner[_ngcontent-%COMP%]{font-size:14px;--indicator-color: #2970ff;--track-color: rgba(41, 112, 255, .2);flex:none}.genbar__status[_ngcontent-%COMP%]{font-size:var(--ng-font-size-text-sm, 14px);line-height:var(--ng-line-height-text-sm, 1.4);color:var(--ng-colors-text-tertiary-600, #535862);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:260px}@media(max-width:760px){.genbar__divider[_ngcontent-%COMP%], .genbar__bar[_ngcontent-%COMP%], .genbar__count[_ngcontent-%COMP%]{display:none}}"]})};var Rn=["tabsScroller"],Qt=()=>({subtitle:"Explore your dashboards or ask your data a question"}),zn=()=>({subtitle:"Setting up your initial dashboards \u2014 crafting a starter set from your data."}),Kt=(o,t)=>t.id;function Nn(o,t){if(o&1&&(a(0,"header",8),L(1,16),l()),o&2){d(2);let e=q(6);c(),v("ngTemplateOutlet",e)("ngTemplateOutletContext",ie(2,Qt))}}function Vn(o,t){if(o&1&&h(0,"nile-skeleton-loader",11),o&2){let e=t.$implicit;ne("width",e)}}function qn(o,t){o&1&&h(0,"nile-skeleton-loader",14)}function Wn(o,t){o&1&&L(0)}function Hn(o,t){if(o&1&&(a(0,"div",5)(1,"div",7),y(2,Nn,2,3,"header",8),a(3,"div",9)(4,"div",10),I(5,Vn,1,1,"nile-skeleton-loader",11,Y),l(),h(7,"span",12)(8,"nile-skeleton-loader",13),I(9,qn,1,0,"nile-skeleton-loader",14,Y),l(),G(11,Wn,1,0,"ng-container",15),l()()),o&2){let e=d(),n=q(8);c(2),C(e.showHeader()?2:-1),c(3),R(e.skeletonTabWidths),c(4),R(e.skeletonActionBtns),c(2),v("ngTemplateOutlet",n)}}function Ln(o,t){if(o&1&&(a(0,"header",8),L(1,16),l()),o&2){d(2);let e=q(6);c(),v("ngTemplateOutlet",e)("ngTemplateOutletContext",ie(2,zn))}}function $n(o,t){if(o&1){let e=D();a(0,"app-dashboard-generating",18),b("done",function(i){u(e);let r=d(2);return f(r.onGenerationDone(i))})("failed",function(){u(e);let i=d(2);return f(i.onGenerationFailed())}),l()}if(o&2){let e=d(2);v("streamId",e.generationStreamId())}}function Gn(o,t){o&1&&L(0)}function Bn(o,t){if(o&1&&(a(0,"div",6)(1,"div",7),y(2,Ln,2,3,"header",8),a(3,"div",9),y(4,$n,1,1,"app-dashboard-generating",17),l()(),G(5,Gn,1,0,"ng-container",15),l()),o&2){let e=d(),n=q(8);c(2),C(e.showHeader()?2:-1),c(2),C(e.features().autoGenerate?4:-1),c(),v("ngTemplateOutlet",n)}}function Un(o,t){if(o&1&&(a(0,"header",8),L(1,16),l()),o&2){d(2);let e=q(6);c(),v("ngTemplateOutlet",e)("ngTemplateOutletContext",ie(2,Qt))}}function jn(o,t){o&1&&h(0,"nile-glyph",52)}function Zn(o,t){if(o&1){let e=D();a(0,"span",54),b("click",function(i){return i.stopPropagation()}),a(1,"input",55,3),b("input",function(){u(e);let i=q(2),r=d(4);return f(r.onRenameInputChange(i.value))})("keydown",function(i){u(e);let r=d().$implicit,s=d(3);return f(s.onRenameInputKeydown(i,r))})("click",function(i){return i.stopPropagation()}),l(),a(3,"button",56),b("click",function(i){u(e);let r=d().$implicit,s=d(3);return f(s.commitRenameDashboard(r,i))}),h(4,"nile-glyph",57),l()()}if(o&2){let e=d().$implicit,n=d(3);c(),v("value",n.renamingValue())("disabled",n.isRenamingDashboard()),ne("data-dashboard-id",e.id),c(2),v("disabled",n.isRenamingDashboard())}}function Yn(o,t){if(o&1){let e=D();a(0,"button",60),b("click",function(i){u(e);let r=d(2).$implicit,s=d(3);return f(s.startRenameDashboard(r,i))}),h(1,"nile-glyph",61),l()}}function Kn(o,t){if(o&1&&(a(0,"span",58),P(1),l(),y(2,Yn,2,0,"button",59)),o&2){let e=d().$implicit,n=d(3);c(),W(e.name),c(),C(n.features().rename&&!e.isAutoGenerated?2:-1)}}function Qn(o,t){if(o&1){let e=D();a(0,"nile-nav-tab",51),b("click",function(){let i=u(e).$implicit,r=d(3);return f(r.setActiveTab(i.id))}),y(1,jn,1,0,"nile-glyph",52),y(2,Zn,5,4,"span",53)(3,Kn,3,2),l()}if(o&2){let e=t.$implicit,n=d(3);ne("panel",e.id),c(),C(e.isAutoGenerated?1:-1),c(),C(n.renamingDashboardId()===e.id?2:3)}}function Jn(o,t){if(o&1){let e=D();a(0,"app-time-range-picker",62),b("apply",function(i){u(e);let r=d(3);return f(r.onTimeRangeApply(i))}),l()}if(o&2){let e=d(3);v("resetKey",e.activeTabId())}}function Xn(o,t){o&1&&h(0,"span",37)}function ei(o,t){o&1&&h(0,"nile-glyph",42)}function ti(o,t){o&1&&h(0,"nile-glyph",42)}function ni(o,t){if(o&1){let e=D();a(0,"button",40),b("click",function(){let i=u(e).$implicit,r=d(3);return f(r.onCategoryFilterChange(i.id))}),a(1,"span",41),P(2),l(),y(3,ti,1,0,"nile-glyph",42),l()}if(o&2){let e=t.$implicit,n=d(3);B("is-active",n.selectedCategory()===e.id),c(2),W(e.label),c(),C(n.selectedCategory()===e.id?3:-1)}}function ii(o,t){if(o&1){let e=D();a(0,"nile-lite-tooltip",47)(1,"button",63),b("click",function(){u(e);let i=d(3);return f(i.refreshActiveDashboard())}),h(2,"nile-glyph",64),l()()}if(o&2){let e=d(3);c(),v("disabled",!e.activeTabId()||e.refreshingDashboard()),c(),B("home-refresh-glyph--spinning",e.refreshingDashboard())}}function oi(o,t){if(o&1){let e=D();a(0,"nile-lite-tooltip",49)(1,"button",65),b("click",function(){u(e);let i=d(3);return f(i.selectHomeMenuItem("executiveSummary"))}),h(2,"nile-glyph",66),l()()}}function ri(o,t){if(o&1){let e=D();a(0,"nile-dropdown",67),b("nile-hide",function(){u(e);let i=d(3);return f(i.downloadMenuOpen.set(!1))}),a(1,"nile-lite-tooltip",68)(2,"button",69),b("click",function(){u(e);let i=d(3);return f(i.downloadMenuOpen.set(!i.downloadMenuOpen()))}),h(3,"nile-glyph",70),l()(),a(4,"nile-menu")(5,"nile-menu-item",71),b("click",function(){u(e);let i=d(3);return i.downloadMenuOpen.set(!1),f(i.selectHomeMenuItem("exportPdf"))}),h(6,"nile-glyph",72),P(7," Download as PDF "),l(),a(8,"nile-menu-item",71),b("click",function(){u(e);let i=d(3);return i.downloadMenuOpen.set(!1),f(i.selectHomeMenuItem("exportPng"))}),h(9,"nile-glyph",73),P(10," Download as PNG "),l()()()}if(o&2){let e=d(3);v("open",e.downloadMenuOpen())}}function ai(o,t){if(o&1){let e=D();a(0,"div",23)(1,"button",24),b("click",function(){u(e);let i=d(2);return f(i.scrollTabs(-1))}),h(2,"nile-glyph",25),l(),a(3,"div",26,2),b("scroll",function(){u(e);let i=d(2);return f(i.onTabsScroll())}),a(5,"nile-nav-tab-group",27),h(6,"nile-nav-tab",28),I(7,Qn,4,3,"nile-nav-tab",29,Kt),l()(),a(9,"button",30),b("click",function(){u(e);let i=d(2);return f(i.scrollTabs(1))}),h(10,"nile-glyph",31),l(),h(11,"span",12),y(12,Jn,1,1,"app-time-range-picker",32),a(13,"nile-dropdown",33),b("nile-hide",function(){u(e);let i=d(2);return f(i.categoryFilterOpen.set(!1))}),a(14,"nile-lite-tooltip",34)(15,"button",35),b("click",function(){u(e);let i=d(2);return f(i.categoryFilterOpen.set(!i.categoryFilterOpen()))}),h(16,"nile-glyph",36),y(17,Xn,1,0,"span",37),l()(),a(18,"div",38),b("mousedown",function(i){return i.stopPropagation()}),a(19,"span",39),P(20,"Filter by category"),l(),a(21,"button",40),b("click",function(){u(e);let i=d(2);return f(i.onCategoryFilterChange(null))}),a(22,"span",41),P(23,"All categories"),l(),y(24,ei,1,0,"nile-glyph",42),l(),I(25,ni,4,4,"button",43,Kt),l()(),a(27,"nile-lite-tooltip",44)(28,"button",45),b("click",function(){u(e);let i=d(2);return f(i.goToCreateDashboard())}),h(29,"nile-glyph",46),l()(),y(30,ii,3,3,"nile-lite-tooltip",47),a(31,"div",48),y(32,oi,3,0,"nile-lite-tooltip",49),y(33,ri,11,1,"nile-dropdown",50),l()()}if(o&2){let e=d(2);B("is-scrollable",e.canScrollLeft()||e.canScrollRight()),c(),v("disabled",!e.canScrollLeft()),c(4),ne("value",e.activeTabId()||"__sentinel__"),c(2),R(e.visibleDashboards()),c(2),v("disabled",!e.canScrollRight()),c(3),C(e.activeTabId()?12:-1),c(),v("open",e.categoryFilterOpen()),c(4),C(e.selectedCategory()?17:-1),c(4),B("is-active",!e.selectedCategory()),c(3),C(e.selectedCategory()?-1:24),c(),R(e.dashboardCategories),c(3),v("disabled",e.creatingDashboard()),c(2),C(e.features().refresh?30:-1),c(2),C(e.features().executiveSummary?32:-1),c(),C(e.features().export?33:-1)}}function si(o,t){if(o&1&&(a(0,"nile-nav-tab-panel",74),h(1,"app-dashboard-viewer",76),l()),o&2){let e=d(3);ne("name",e.activeTabId()),c(),v("config",e.loadedDashboards().get(e.activeTabId()))}}function li(o,t){o&1&&L(0)}function di(o,t){if(o&1&&(a(0,"div",75),G(1,li,1,0,"ng-container",15),l()),o&2){d(3);let e=q(8);c(),v("ngTemplateOutlet",e)}}function ci(o,t){if(o&1&&y(0,si,2,2,"nile-nav-tab-panel",74)(1,di,2,1,"div",75),o&2){let e=d(2);C(e.loadedDashboards().has(e.activeTabId())?0:e.isTabLoading()||e.refreshingDashboard()?1:-1)}}function gi(o,t){if(o&1){let e=D();a(0,"div",20)(1,"h2",77),P(2,"No dashboards in this category"),l(),a(3,"p",78),P(4,"Try a different category, or clear the filter to see everything."),l(),a(5,"nile-button",79),b("click",function(){u(e);let i=d(2);return f(i.onCategoryFilterChange(null))}),P(6," Clear filter "),l()()}}function pi(o,t){if(o&1){let e=D();a(0,"div",20)(1,"div",80),Ke(),a(2,"svg",81),h(3,"rect",82)(4,"rect",83)(5,"rect",84),a(6,"rect",85),h(7,"animate",86)(8,"animate",87),l(),a(9,"rect",88),h(10,"animate",89)(11,"animate",90),l(),a(12,"rect",91),h(13,"animate",92)(14,"animate",93),l(),a(15,"rect",94),h(16,"animate",95)(17,"animate",96),l(),a(18,"rect",97),h(19,"animate",98)(20,"animate",99),l(),h(21,"rect",100)(22,"rect",101)(23,"circle",102),a(24,"circle",103),h(25,"animate",104),l(),h(26,"rect",105)(27,"rect",106),a(28,"path",107),h(29,"animate",108),l(),a(30,"circle",109),h(31,"animate",110),l()()(),Qe(),a(32,"h2",77),P(33,"Build your dashboard"),l(),a(34,"p",78),P(35," Tap the below button to generate dashboard. "),l(),a(36,"nile-button",111),b("click",function(){u(e);let i=d(2);return f(i.goToCreateDashboard())}),h(37,"nile-glyph",112),P(38," Create dashboard "),l()()}if(o&2){let e=d(2);c(36),ne("disabled",e.creatingDashboard()?"":null)}}function hi(o,t){if(o&1){let e=D();a(0,"db-ai-prompt-panel",113),b("closePanel",function(){u(e);let i=d(2);return f(i.showAiPanel.set(!1))}),l()}if(o&2){let e=d(2);v("dashboardId",e.activeTabId())("dashboardName",e.activeDashboardName())("dashboardConfig",e.loadedDashboards().get(e.activeTabId())??null)("chatOnly",e.aiChatOnly())("initialPrompt",e.aiInitialPrompt())}}function mi(o,t){if(o&1){let e=D();a(0,"div",6)(1,"div",7),y(2,Un,2,3,"header",8),y(3,ai,34,15,"div",19),y(4,ci,2,1)(5,gi,7,0,"div",20)(6,pi,39,1,"div",20),a(7,"nile-drawer",21),b("nile-request-close",function(){u(e);let i=d();return f(i.showAiPanel.set(!1))}),y(8,hi,1,5,"db-ai-prompt-panel",22),l()()()}if(o&2){let e=d();c(2),C(e.showHeader()?2:-1),c(),C(e.allDashboards().length>0?3:-1),c(),C(e.activeTabId()?4:e.allDashboards().length>0?5:e.allDashboards().length===0?6:-1),c(3),v("open",e.showAiPanel()),c(),C(e.features().aiPrompt&&e.showAiPanel()?8:-1)}}function ui(o,t){if(o&1&&(a(0,"div",114)(1,"h1",115),P(2,"Dashboards"),l(),a(3,"p",116),P(4),l()()),o&2){let e=t.subtitle;c(4),W(e)}}function fi(o,t){o&1&&(a(0,"div",119)(1,"div",122),h(2,"nile-skeleton-loader",123)(3,"nile-skeleton-loader",124),l(),h(4,"nile-skeleton-loader",125),a(5,"div",126),h(6,"nile-skeleton-loader",127)(7,"nile-skeleton-loader",128),l(),h(8,"nile-skeleton-loader",129),l())}function _i(o,t){o&1&&(a(0,"div",121)(1,"div",130)(2,"div",131),h(3,"nile-skeleton-loader",132)(4,"nile-skeleton-loader",133),l(),h(5,"nile-skeleton-loader",134),l(),h(6,"nile-skeleton-loader",135),l())}function bi(o,t){if(o&1&&(a(0,"div",117)(1,"div",118),I(2,fi,9,0,"div",119,Y),l(),a(4,"div",120),I(5,_i,7,0,"div",121,Y),l()()),o&2){let e=d();c(2),R(e.skeletonKpis),c(3),R(e.skeletonWidgets)}}var Ge=4,Ne=class o{MAX_TABS=Ge;tabsScrollerEl;dashboardViewerRef;timeRangePickerRef;onTimeRangeApply(t){this.dashboardViewerRef?.applyTimeRange(t)}tabsScrollLeft=_(0);tabsClientWidth=_(0);tabsScrollWidth=_(0);canScrollLeft=T(()=>this.tabsScrollLeft()>0);canScrollRight=T(()=>this.tabsScrollLeft()+this.tabsClientWidth()<this.tabsScrollWidth()-1);onTabsScroll(){this.updateTabsScrollState()}updateTabsScrollState(){let t=this.tabsScrollerEl?.nativeElement;t&&(this.tabsScrollLeft.set(t.scrollLeft),this.tabsClientWidth.set(t.clientWidth),this.tabsScrollWidth.set(t.scrollWidth))}scrollTabs(t){let e=this.tabsScrollerEl?.nativeElement;e&&e.scrollBy({left:t*e.clientWidth*.8,behavior:"smooth"})}scrollActiveTabIntoView(){let t=this.tabsScrollerEl?.nativeElement;if(!t)return;let e=this.activeTabId();if(!e)return;let n=window.CSS&&CSS.escape?CSS.escape(e):e.replace(/"/g,'\\"'),i=t.querySelector(`nile-nav-tab[panel="${n}"]`);if(!i)return;let r=i.getBoundingClientRect(),s=t.getBoundingClientRect(),g=16;r.right>s.right?t.scrollBy({left:r.right-s.right+g,behavior:"smooth"}):r.left<s.left&&t.scrollBy({left:r.left-s.left-g,behavior:"smooth"})}onWindowResize=()=>this.ngZone.run(()=>this.updateTabsScrollState());showAiPanel=_(!1);aiChatOnly=_(!1);aiInitialPrompt=_("");allDashboards=_([]);selectedCategory=_(null);dashboardCategories=Gt;categoryFilterOpen=_(!1);visibleDashboards=T(()=>{let t=this.selectedCategory(),e=this.allDashboards();return t?e.filter(n=>n.category?.includes(t)):e});activeTabs=_([]);activeTabId=_("");loadedDashboards=_(new Map);isLoading=_(!0);isTabLoading=_(!1);skeletonTabWidths=[72,220,140];skeletonKpis=Array.from({length:4});skeletonWidgets=Array.from({length:4});skeletonActionBtns=Array.from({length:4});showMore=T(()=>this.allDashboards().length>0);activeDashboardName=T(()=>this.allDashboards().find(t=>t.id===this.activeTabId())?.name??"");activeConfig=T(()=>this.loadedDashboards().get(this.activeTabId())??null);isExporting=_(!1);showExportDropdown=_(!1);downloadMenuOpen=_(!1);creatingDashboard=_(!1);generationStreamId=_("");isGenerating=T(()=>this.generationStreamId()!=="");generationSettled=!1;showHeader(){return k().ui.header}features(){return k().features}copy(){return k().copy}service=w(he);ngZone=w(ve);el=w(re);navigator=w(U);routeProgress=w(Rt);autoDashboard=w(Ht);goToCreateDashboard(){this.creatingDashboard()||(this.creatingDashboard.set(!0),this.navigator.toAskAquera())}constructor(){te(()=>{this.activeTabId(),this.allDashboards(),queueMicrotask(()=>this.scrollActiveTabIntoView())})}ngAfterViewChecked(){this.updateTabsScrollState()}onExportTriggerClick(){this.showExportDropdown.set(!this.showExportDropdown())}selectHomeMenuItem(t){if(t==="askAi")this.aiChatOnly.set(!0),this.aiInitialPrompt.set(""),this.showAiPanel.set(!0);else if(t==="executiveSummary"){let e=this.activeTabId();e&&this.navigator.toAskAqueraDashboard(e,{summary:1})}else t==="exportPdf"?this.exportDashboardPdf():t==="exportPng"&&this.exportDashboardPng()}getDashboardTarget(){let t=this.activeTabId();return this.el.nativeElement.querySelector(`nile-nav-tab-panel[name="${t}"] app-dashboard-viewer gridster`)}async exportDashboardPdf(){if(this.isExporting())return;let t=this.getDashboardTarget();if(t){this.showExportDropdown.set(!1),this.isExporting.set(!0),await new Promise(e=>requestAnimationFrame(()=>requestAnimationFrame(e)));try{let e=t.scrollWidth,n=t.scrollHeight,i=await Le(t,{quality:1,width:e,height:n,cacheBust:!0,backgroundColor:"#ffffff",style:{height:`${n}px`,maxHeight:"none",overflow:"visible"}}),r=this.activeDashboardName()||"Dashboard",s=90,g=new Wt({orientation:e>n?"landscape":"portrait",unit:"px",format:[e,n+s]});g.setFillColor(245,245,248),g.rect(0,0,e,s,"F"),g.setFont("helvetica","bold"),g.setFontSize(28),g.setTextColor(50,50,60),g.text(r,e/2,s/2+7,{align:"center"}),g.addImage(i,"JPEG",0,s,e,n),g.save(`${r}.pdf`)}finally{this.isExporting.set(!1)}}}async exportDashboardPng(){if(this.isExporting())return;let t=this.getDashboardTarget();if(t){this.showExportDropdown.set(!1),this.isExporting.set(!0),await new Promise(e=>requestAnimationFrame(()=>requestAnimationFrame(e)));try{let e=t.scrollWidth,n=t.scrollHeight,i=await Le(t,{quality:1,width:e,height:n,cacheBust:!0,backgroundColor:"#ffffff",style:{height:`${n}px`,maxHeight:"none",overflow:"visible"}}),r=this.activeDashboardName()||"Dashboard",s=90,g=document.createElement("canvas");g.width=e,g.height=n+s;let p=g.getContext("2d");p.fillStyle="#f5f5f8",p.fillRect(0,0,e,s),p.fillStyle="#32323c",p.font="bold 28px helvetica",p.textAlign="center",p.textBaseline="middle",p.fillText(r,e/2,s/2+7);let m=new Image;m.src=i,await new Promise(V=>{m.onload=()=>V()}),p.drawImage(m,0,s,e,n);let M=document.createElement("a");M.href=g.toDataURL("image/png"),M.download=`${r}.png`,M.click()}finally{this.isExporting.set(!1)}}}toggleAiPanel(){this.showAiPanel.update(t=>!t)}onToggleAiPanel=()=>this.ngZone.run(()=>this.showAiPanel.update(t=>!t));ngOnInit(){this.loadList(),window.addEventListener("dv:toggle-ai-panel",this.onToggleAiPanel),window.addEventListener("resize",this.onWindowResize)}ngOnDestroy(){window.removeEventListener("dv:toggle-ai-panel",this.onToggleAiPanel),window.removeEventListener("resize",this.onWindowResize)}async loadList(){this.isLoading.set(!0);try{let t=await this.routeProgress.track(this.service.loadDashboards());this.ngZone.run(()=>{this.allDashboards.set(t);let e=t.slice(0,Ge);this.activeTabs.set(e),e.length>0&&!this.activeTabId()&&(this.activeTabId.set(e[0].id),this.loadTab(e[0].id))}),t.length===0&&await this.checkAutoDashboard()}catch(t){console.error("Failed to load dashboards list:",t)}finally{this.ngZone.run(()=>this.isLoading.set(!1))}}async checkAutoDashboard(){if(!(this.generationSettled||this.isGenerating()))try{let t=await this.autoDashboard.trigger();t?.success&&!t.skipped&&t.streamId&&this.ngZone.run(()=>{this.generationStreamId.set(t.streamId)})}catch{}}onGenerationDone(t){this.generationSettled=!0,this.generationStreamId.set("");let e=t.length;this.loadList().then(()=>{this.showReadyToast(e>1?`${e} dashboards are ready`:"Your dashboard is ready")})}onGenerationFailed(){this.generationSettled=!0,this.generationStreamId.set("")}showReadyToast(t){z({variant:"success",title:"All set",content:t})}async loadTab(t){if(!this.loadedDashboards().has(t)){this.isTabLoading.set(!0);try{let e=await this.routeProgress.track(this.service.fetchDashboard(t));this.ngZone.run(()=>{let n=new Map(this.loadedDashboards());n.set(t,e),this.loadedDashboards.set(n)})}catch(e){console.error(`Failed to load dashboard ${t}:`,e)}finally{this.ngZone.run(()=>this.isTabLoading.set(!1))}}}refreshingDashboard=_(!1);async refreshActiveDashboard(){let t=this.activeTabId();if(!t||this.refreshingDashboard())return;let e=this.loadedDashboards().get(t);this.refreshingDashboard.set(!0),this.ngZone.run(()=>{let n=new Map(this.loadedDashboards());n.delete(t),this.loadedDashboards.set(n)});try{let n=await this.routeProgress.track(this.service.fetchDashboard(t));this.ngZone.run(()=>{let i=new Map(this.loadedDashboards());i.set(t,n),this.loadedDashboards.set(i)})}catch(n){console.error(`Failed to refresh dashboard ${t}:`,n),e&&this.ngZone.run(()=>{let i=new Map(this.loadedDashboards());i.set(t,e),this.loadedDashboards.set(i)})}finally{this.ngZone.run(()=>{this.refreshingDashboard.set(!1),queueMicrotask(()=>this.timeRangePickerRef?.reapply())})}}onTabChange(t){let e=t.detail.value;e!==this.activeTabId()&&this.setActiveTab(e)}onCategoryFilterChange(t){this.selectedCategory.set(t),this.categoryFilterOpen.set(!1);let e=this.visibleDashboards();e.some(n=>n.id===this.activeTabId())||(e.length>0?this.setActiveTab(e[0].id):this.activeTabId.set(""))}setActiveTab(t){this.showAiPanel.set(!1),this.activeTabId.set(t),this.loadTab(t)}isInActiveTabs(t){return this.activeTabs().some(e=>e.id===t)}canAdd(){return this.activeTabs().length<Ge}isLastActiveDashboard(t){return this.activeTabs().length===1&&this.isInActiveTabs(t)}renamingDashboardId=_(null);renamingValue=_("");isRenamingDashboard=_(!1);startRenameDashboard(t,e){e.stopPropagation(),!t.isAutoGenerated&&(this.renamingDashboardId.set(t.id),this.renamingValue.set(t.name),queueMicrotask(()=>{let n=this.el.nativeElement.querySelector(`.tab-rename-input[data-dashboard-id="${t.id}"]`);n?.focus(),n?.select()}))}onRenameInputChange(t){this.renamingValue.set(t)}onRenameInputKeydown(t,e){t.key==="Enter"?(t.preventDefault(),this.commitRenameDashboard(e)):t.key==="Escape"&&(t.preventDefault(),this.cancelRenameDashboard(t))}cancelRenameDashboard(t){t?.stopPropagation(),this.renamingDashboardId.set(null),this.renamingValue.set("")}async commitRenameDashboard(t,e){e?.stopPropagation();let n=this.renamingValue().trim();if(!n||n===t.name){this.cancelRenameDashboard();return}this.isRenamingDashboard.set(!0);try{await this.service.renameDashboard(t.id,n),this.ngZone.run(()=>{let i=r=>r.map(s=>s.id===t.id?E(x({},s),{name:n}):s);this.allDashboards.update(i),this.activeTabs.update(i),this.renamingDashboardId.set(null),this.renamingValue.set("")}),z({variant:"success",title:"Renamed",content:"Dashboard renamed."})}catch(i){let r=i instanceof Error?i.message:"Failed to rename dashboard.";z({variant:"error",title:"Rename failed",content:r})}finally{this.ngZone.run(()=>this.isRenamingDashboard.set(!1))}}onDashboardToggle(t,e){if(e){if(!this.canAdd())return;this.activeTabs.update(n=>[...n,t]),this.setActiveTab(t.id)}else{let n=this.activeTabId()===t.id;if(this.activeTabs.update(i=>i.filter(r=>r.id!==t.id)),n){let i=this.activeTabs();i.length>0?this.setActiveTab(i[0].id):this.activeTabId.set("")}}}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=H({type:o,selectors:[["dvz-dashboards-page"]],viewQuery:function(e,n){if(e&1&&se(Rn,5)(ye,5)($e,5),e&2){let i;K(i=Q())&&(n.tabsScrollerEl=i.first),K(i=Q())&&(n.dashboardViewerRef=i.first),K(i=Q())&&(n.timeRangePickerRef=i.first)}},decls:9,vars:3,consts:[["pageTitleBlock",""],["dashboardSkeleton",""],["tabsScroller",""],["renameInput",""],[1,"home-page"],["aria-hidden","true",1,"tabs-wrapper","home-skeleton"],[1,"tabs-wrapper"],[1,"tabs-bar"],[1,"home-nav"],[1,"tabs-bar__nav","home-skeleton__tabs-row"],[1,"home-skeleton__tab-pills"],["variant","rounded","height","28",1,"home-skeleton__tab"],["aria-hidden","true",1,"home-menu-divider"],["variant","rounded","width","32","height","28","border-radius","8px"],["variant","circular","width","28","height","28"],[4,"ngTemplateOutlet"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"streamId"],[3,"done","failed","streamId"],[1,"tabs-bar__nav",3,"is-scrollable"],[1,"home-empty-state"],["contained","","no-header","","placement","end","label","Ask",1,"home-ai-drawer",3,"nile-request-close","open"],[3,"dashboardId","dashboardName","dashboardConfig","chatOnly","initialPrompt"],[1,"tabs-bar__nav"],["type","button","aria-label","Scroll tabs left",1,"tabs-scroll-btn","tabs-scroll-btn--left",3,"click","disabled"],["name","ng-chevron-left","method","stroke","size","16"],[1,"tabs-scroller",3,"scroll"],["variant","filled",1,"dashboard-tab-group"],["slot","nav","panel","__sentinel__",1,"tab-sentinel"],["slot","nav"],["type","button","aria-label","Scroll tabs right",1,"tabs-scroll-btn","tabs-scroll-btn--right",3,"click","disabled"],["name","ng-chevron-right","method","stroke","size","16"],[3,"resetKey"],["hoist","","placement","bottom-end",1,"home-category-filter",3,"nile-hide","open"],["slot","trigger","content","Filter by category"],["type","button","aria-label","Filter by category",1,"home-action-btn",3,"click"],["name","ng-filter-lines","method","stroke","size","18"],["aria-hidden","true",1,"home-category-filter__dot"],[1,"home-category-filter__panel",3,"mousedown"],[1,"home-category-filter__heading"],["type","button",1,"home-category-filter__item",3,"click"],[1,"home-category-filter__label"],["name","ng-check","size","14"],["type","button",1,"home-category-filter__item",3,"is-active"],["content","Create dashboard"],["type","button","aria-label","Create dashboard",1,"home-action-btn",3,"click","disabled"],["name","ng-plus","method","stroke","size","18"],["content","Refresh dashboard"],[1,"home-actions"],["content","Executive Summary"],["placement","bottom-end",1,"home-download",3,"open"],["slot","nav",3,"click"],["name","ng-stars-02","method","stroke","size","14","color","#7a5af8","aria-label","Auto-generated dashboard",1,"tab-auto-badge"],[1,"tab-rename"],[1,"tab-rename",3,"click"],["type","text",1,"tab-rename-input",3,"input","keydown","click","value","disabled"],["type","button","aria-label","Save dashboard name",1,"tab-rename-save",3,"click","disabled"],["name","ng-check","method","stroke","size","14","color","#2970ff"],[1,"tab-label"],["type","button","aria-label","Rename dashboard",1,"tab-edit-btn"],["type","button","aria-label","Rename dashboard",1,"tab-edit-btn",3,"click"],["name","ng-edit-02","method","stroke","size","12"],[3,"apply","resetKey"],["type","button","aria-label","Refresh dashboard",1,"home-action-btn",3,"click","disabled"],["name","ng-refresh-ccw","method","stroke","size","18",1,"home-refresh-glyph"],["type","button","aria-label","Executive Summary",1,"home-action-btn",3,"click"],["name","ng-file-02","method","stroke","size","18"],["placement","bottom-end",1,"home-download",3,"nile-hide","open"],["slot","trigger","content","Download"],["type","button","aria-label","Download",1,"home-action-btn",3,"click"],["name","ng-download-01","method","stroke","size","18"],[3,"click"],["slot","prefix","name","ng-file-06","method","stroke","size","14"],["slot","prefix","name","ng-image-03","method","stroke","size","14"],["active","",1,"viewer-scroll-container"],["aria-hidden","true",1,"home-skeleton"],[3,"config"],[1,"home-empty-state__title"],[1,"home-empty-state__desc"],["variant","tertiary",3,"click"],[1,"home-empty-state__graphic"],["viewBox","0 0 380 140","aria-hidden","true","preserveAspectRatio","xMidYMid meet"],["x","40","y","20","width","300","height","100","rx","8","fill","#fff","stroke","#80AED3","stroke-width","1.5","stroke-dasharray","4 4"],["x","56","y","36","width","84","height","68","rx","6","fill","#F7FAFC","stroke","#E6E9EB"],["x","64","y","44","width","40","height","3","rx","1.5","fill","#80AED3"],["x","64","y","80","width","6","height","20","rx","1","fill","#005EA6","opacity","0.7"],["attributeName","height","values","20;14;20","dur","2s","repeatCount","indefinite"],["attributeName","y","values","80;86;80","dur","2s","repeatCount","indefinite"],["x","76","y","74","width","6","height","26","rx","1","fill","#005EA6"],["attributeName","height","values","26;18;26","dur","2s","begin","0.2s","repeatCount","indefinite"],["attributeName","y","values","74;82;74","dur","2s","begin","0.2s","repeatCount","indefinite"],["x","88","y","68","width","6","height","32","rx","1","fill","#005EA6","opacity","0.85"],["attributeName","height","values","32;24;32","dur","2s","begin","0.4s","repeatCount","indefinite"],["attributeName","y","values","68;76;68","dur","2s","begin","0.4s","repeatCount","indefinite"],["x","100","y","78","width","6","height","22","rx","1","fill","#005EA6","opacity","0.6"],["attributeName","height","values","22;16;22","dur","2s","begin","0.6s","repeatCount","indefinite"],["attributeName","y","values","78;84;78","dur","2s","begin","0.6s","repeatCount","indefinite"],["x","112","y","66","width","6","height","34","rx","1","fill","#005EA6","opacity","0.85"],["attributeName","height","values","34;26;34","dur","2s","begin","0.8s","repeatCount","indefinite"],["attributeName","y","values","66;74;66","dur","2s","begin","0.8s","repeatCount","indefinite"],["x","148","y","36","width","84","height","68","rx","6","fill","#F7FAFC","stroke","#E6E9EB"],["x","156","y","44","width","40","height","3","rx","1.5","fill","#80AED3"],["cx","190","cy","78","r","14","fill","none","stroke","#E6EFF6","stroke-width","5"],["cx","190","cy","78","r","14","fill","none","stroke","#005EA6","stroke-width","5","stroke-linecap","round","stroke-dasharray","88","stroke-dashoffset","88","transform","rotate(-90 190 78)"],["attributeName","stroke-dashoffset","values","88;22;22;88","keyTimes","0;0.5;0.85;1","dur","2.6s","repeatCount","indefinite"],["x","240","y","36","width","84","height","68","rx","6","fill","#F7FAFC","stroke","#E6E9EB"],["x","248","y","44","width","40","height","3","rx","1.5","fill","#80AED3"],["d","M 250 92 L 264 80 L 278 86 L 292 72 L 306 78 L 320 64","fill","none","stroke","#005EA6","stroke-width","1.5","stroke-linecap","round","stroke-linejoin","round","stroke-dasharray","200","stroke-dashoffset","200"],["attributeName","stroke-dashoffset","values","200;0;0;200","keyTimes","0;0.5;0.85;1","dur","2.6s","repeatCount","indefinite"],["cx","320","cy","64","r","2.5","fill","#005EA6"],["attributeName","opacity","values","0;0;1;1;0","keyTimes","0;0.45;0.55;0.85;1","dur","2.6s","repeatCount","indefinite"],["variant","primary","aria-label","Create dashboard",1,"home-empty-state__cta",3,"click"],["slot","prefix","name","ng-plus","size","16"],[3,"closePanel","dashboardId","dashboardName","dashboardConfig","chatOnly","initialPrompt"],[1,"home-nav__title-block"],[1,"home-nav__title"],[1,"home-nav__sub"],[1,"home-skeleton__panel"],[1,"home-skeleton__kpis"],[1,"home-skeleton__kpi"],[1,"home-skeleton__widgets"],[1,"home-skeleton__widget"],[1,"home-skeleton__kpi-head"],["variant","text","width","56%","height","14"],["variant","rounded","width","32","height","32","border-radius","8px"],["variant","text","width","48%","height","30"],[1,"home-skeleton__kpi-row"],["variant","rounded","width","72","height","20","border-radius","999px"],["variant","text","width","38%","height","11"],["variant","rounded","width","100%","height","44","border-radius","8px",1,"home-skeleton__kpi-spark"],[1,"home-skeleton__widget-head"],[1,"home-skeleton__widget-titles"],["variant","text","width","42%","height","16"],["variant","text","width","64%","height","11"],["variant","circular","width","20","height","20"],["variant","rounded","width","100%","height","100%","border-radius","10px",1,"home-skeleton__widget-chart"]],template:function(e,n){e&1&&(a(0,"div",4),h(1,"wf-page-error"),y(2,Hn,12,2,"div",5),y(3,Bn,6,3,"div",6),y(4,mi,9,5,"div",6),l(),G(5,ui,5,1,"ng-template",null,0,fe)(7,bi,7,0,"ng-template",null,1,fe)),e&2&&(c(2),C(n.isLoading()?2:-1),c(),C(!n.isLoading()&&n.isGenerating()?3:-1),c(),C(!n.isLoading()&&!n.isGenerating()?4:-1))},dependencies:[Pe,ye,Re,ze,Et,$e],styles:['@charset "UTF-8";[_nghost-%COMP%]{display:block;height:100%;min-height:0}.home-page[_ngcontent-%COMP%]{height:100%;min-height:0;display:flex;flex-direction:column;background:var(--ng-colors-bg-active);overflow:visible;position:relative}.loading-state[_ngcontent-%COMP%], .empty-state[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;height:200px;color:var(--ng-colors-text-tertiary-600)}.home-empty-state[_ngcontent-%COMP%]{margin:24px;padding:56px 32px;display:flex;flex-direction:column;align-items:center;text-align:center;background:var(--ng-colors-bg-primary);border:1px solid var(--ng-colors-border-secondary, #e9eaeb);border-radius:12px}.home-empty-state__graphic[_ngcontent-%COMP%]{width:380px;max-width:100%;height:140px;margin-bottom:24px;display:block}.home-empty-state__graphic[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{display:block;width:100%;height:100%}.home-empty-state__title[_ngcontent-%COMP%]{margin:0 0 8px;font-size:16px;font-weight:600;color:var(--ng-colors-text-primary-900, #181d27);letter-spacing:-.01em}.home-empty-state__desc[_ngcontent-%COMP%]{margin:0;max-width:480px;font-size:14px;line-height:1.5;color:var(--ng-colors-text-tertiary-600, #535862)}.home-empty-state__cta[_ngcontent-%COMP%]{margin-top:24px}.toolbar[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;height:64px;padding:0 38px;background:var(--ng-componentcolors-alpha-white-100);border-bottom:1px solid var(--ng-componentcolors-alpha-black-10);position:fixed;top:var(--nav-height, 56px);left:0;right:0;z-index:var(--z-header)}.toolbar__right[_ngcontent-%COMP%]{display:flex;align-items:center;gap:var(--ng-spacing-3, 12px)}.tabs-wrapper[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;min-height:0}.tabs-bar[_ngcontent-%COMP%]{position:relative;min-height:0;display:flex;flex-direction:column}.tabs-bar[_ngcontent-%COMP%] .home-nav[_ngcontent-%COMP%]{position:sticky;top:0;z-index:var(--z-sticky-row);display:flex;align-items:center;justify-content:space-between;gap:16px;height:76px;margin:0;padding:0 22px;background:var(--ng-componentcolors-alpha-white-100, #ffffff);border-bottom:1px solid var(--ng-colors-border-secondary, #e9eaeb);flex-shrink:0}.tabs-bar[_ngcontent-%COMP%] .home-nav__title-block[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px;min-width:0}.tabs-bar[_ngcontent-%COMP%] .home-nav__title[_ngcontent-%COMP%]{margin:0;font-size:16px;font-weight:600;color:var(--ng-colors-text-primary-900, #181d27);line-height:1.2;letter-spacing:-.01em}.tabs-bar[_ngcontent-%COMP%] .home-nav__sub[_ngcontent-%COMP%]{margin:0;font-size:13px;font-weight:400;color:var(--ng-colors-text-tertiary-600, #535862);line-height:1.3}.tabs-bar[_ngcontent-%COMP%] .tabs-bar__nav[_ngcontent-%COMP%]{position:sticky;top:76px;height:56px;display:flex;align-items:center;gap:4px;z-index:var(--z-sticky-row);min-width:0;margin:0;padding:22px;background:var(--ng-componentcolors-alpha-white-100, #ffffff);border-bottom:1px solid var(--ng-colors-border-secondary, #e9eaeb)}.tabs-bar[_ngcontent-%COMP%] .home-menu-divider[_ngcontent-%COMP%]{width:1px;height:20px;background:var(--ng-colors-border-secondary, #e9eaeb);margin:0 6px 0 8px;flex-shrink:0}.tabs-bar[_ngcontent-%COMP%] .tabs-scroller[_ngcontent-%COMP%]{flex:1;min-width:0;overflow-x:auto;overflow-y:hidden;position:relative;scrollbar-width:none}.tabs-bar[_ngcontent-%COMP%] .tabs-scroller[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}.tabs-bar[_ngcontent-%COMP%] .dashboard-tab-group[_ngcontent-%COMP%]{display:block;width:max-content;min-width:100%}.tabs-bar[_ngcontent-%COMP%] .tab-sentinel[_ngcontent-%COMP%]{display:none!important}.tabs-bar[_ngcontent-%COMP%] .tab-auto-badge[_ngcontent-%COMP%]{display:inline-flex;vertical-align:text-bottom;margin-right:4px;flex:0 0 auto}.tabs-bar[_ngcontent-%COMP%] .tab-label[_ngcontent-%COMP%]{white-space:nowrap}.tabs-bar[_ngcontent-%COMP%] .tab-edit-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;margin-left:4px;padding:0;border:0;background:transparent;border-radius:4px;color:var(--ng-colors-text-tertiary-600, #535862);cursor:pointer;opacity:0;pointer-events:none;flex:0 0 auto;transition:background .15s,opacity .15s,color .15s}.tabs-bar[_ngcontent-%COMP%] .tab-edit-btn[_ngcontent-%COMP%]:hover, .tabs-bar[_ngcontent-%COMP%] .tab-edit-btn[_ngcontent-%COMP%]:focus-visible{background:var(--ng-colors-bg-active, #e9eaeb);color:var(--ng-colors-text-primary-900, #181d27)}.tabs-bar[_ngcontent-%COMP%] nile-nav-tab[_ngcontent-%COMP%]:hover .tab-edit-btn[_ngcontent-%COMP%], .tabs-bar[_ngcontent-%COMP%] .tab-edit-btn[_ngcontent-%COMP%]:focus-visible{opacity:1;pointer-events:auto}.tabs-bar[_ngcontent-%COMP%] .tab-rename[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:4px}.tabs-bar[_ngcontent-%COMP%] .tab-rename-input[_ngcontent-%COMP%]{width:140px;height:24px;padding:0 6px;font-size:13px;font-weight:600;color:var(--ng-colors-text-primary-900, #181d27);background:#fff;border:1px solid var(--ng-colors-border-secondary, #e9eaeb);border-radius:6px;outline:none}.tabs-bar[_ngcontent-%COMP%] .tab-rename-input[_ngcontent-%COMP%]:focus{border-color:#2970ff;box-shadow:0 0 0 3px #2970ff29}.tabs-bar[_ngcontent-%COMP%] .tab-rename-save[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;padding:0;border:0;background:transparent;border-radius:4px;cursor:pointer;flex:0 0 auto}.tabs-bar[_ngcontent-%COMP%] .tab-rename-save[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--ng-colors-bg-quaternary, #f2f4f7)}.tabs-bar[_ngcontent-%COMP%] .tab-rename-save[_ngcontent-%COMP%]:disabled{cursor:default;opacity:.5}.tabs-bar[_ngcontent-%COMP%] .tabs-scroll-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:0;outline:0;background:transparent;color:var(--ng-colors-text-tertiary-600, #535862);cursor:pointer;border-radius:6px;flex-shrink:0;opacity:0;pointer-events:none;transition:opacity .15s,background .15s,color .15s}.tabs-bar[_ngcontent-%COMP%] .tabs-scroll-btn[_ngcontent-%COMP%]:hover, .tabs-bar[_ngcontent-%COMP%] .tabs-scroll-btn[_ngcontent-%COMP%]:focus, .tabs-bar[_ngcontent-%COMP%] .tabs-scroll-btn[_ngcontent-%COMP%]:focus-visible{outline:0;background:var(--ng-colors-bg-active, #e9eaeb);color:var(--ng-colors-text-primary-900, #181d27)}.tabs-bar[_ngcontent-%COMP%] .tabs-scroll-btn[disabled][_ngcontent-%COMP%]{cursor:default;color:var(--ng-colors-text-disabled, #a4a7ae);background:transparent}.tabs-bar[_ngcontent-%COMP%] .tabs-bar__nav.is-scrollable[_ngcontent-%COMP%]:hover .tabs-scroll-btn[_ngcontent-%COMP%], .tabs-bar[_ngcontent-%COMP%] .tabs-bar__nav.is-scrollable[_ngcontent-%COMP%]:focus-within .tabs-scroll-btn[_ngcontent-%COMP%]{opacity:1;pointer-events:auto}.more-menu[_ngcontent-%COMP%]{width:260px;max-height:320px;overflow-y:auto;padding:var(--ng-spacing-xs) 0}.more-menu-item[_ngcontent-%COMP%]{padding:var(--ng-spacing-xs) var(--ng-spacing-md);display:flex;align-items:center;cursor:pointer}.more-menu-item[_ngcontent-%COMP%]:hover{background:var(--ng-colors-bg-secondary)}.more-menu-item[_ngcontent-%COMP%] nile-checkbox[_ngcontent-%COMP%]{width:100%}nile-tab-panel[_ngcontent-%COMP%], nile-nav-tab-panel[_ngcontent-%COMP%]{display:block;height:100%}.panel-loading[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;height:200px}.home-skeleton__tabs-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px}.home-skeleton__tab-pills[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;flex-shrink:0}.home-skeleton__tab[_ngcontent-%COMP%]{flex:0 0 auto}.home-skeleton__panel[_ngcontent-%COMP%]{flex:1;min-height:0;padding:18px 24px 32px;display:flex;flex-direction:column;gap:16px;overflow:auto}.home-skeleton__kpis[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(4,1fr);gap:16px}@media(max-width:1100px){.home-skeleton__kpis[_ngcontent-%COMP%]{grid-template-columns:repeat(2,1fr)}}.home-skeleton__kpi[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px;padding:18px 20px;border:1px solid var(--ng-colors-border-secondary, #e9eaeb);border-radius:12px;background:#fff}.home-skeleton__kpi-head[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:12px}.home-skeleton__kpi-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px;margin-top:4px}.home-skeleton__kpi-spark[_ngcontent-%COMP%]{margin-top:6px}.home-skeleton__widgets[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,1fr);gap:16px}@media(max-width:900px){.home-skeleton__widgets[_ngcontent-%COMP%]{grid-template-columns:1fr}}.home-skeleton__widget[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:18px;padding:20px 22px;border:1px solid var(--ng-colors-border-secondary, #e9eaeb);border-radius:12px;background:#fff;min-height:320px}.home-skeleton__widget-head[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.home-skeleton__widget-titles[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:6px;flex:1;min-width:0}.home-skeleton__widget-chart[_ngcontent-%COMP%]{display:block;flex:1;min-height:0}.viewer-scroll-container[_ngcontent-%COMP%]{display:block;flex:1;min-height:0;overflow:auto}.viewer-scroll-container[_ngcontent-%COMP%]::part(base){padding:unset;min-height:100%}[_nghost-%COMP%] .viewer-scroll-container:has(.aq-detail-overlay){overflow:hidden}app-dashboard-viewer[_ngcontent-%COMP%], nile-dashboard-viewer[_ngcontent-%COMP%]{display:block;width:100%;height:100%}.export-menu[_ngcontent-%COMP%] nile-menu-item[_ngcontent-%COMP%]{font-size:var(--ng-font-size-text-sm, 14px);font-weight:var(--ng-font-weight-medium, 500)}.home-actions[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:2px;flex-shrink:0}.home-action-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:0;outline:0;background:transparent;color:var(--ng-colors-text-tertiary-600, #535862);cursor:pointer;border-radius:6px;flex-shrink:0}.home-action-btn[_ngcontent-%COMP%]:hover, .home-action-btn[_ngcontent-%COMP%]:focus, .home-action-btn[_ngcontent-%COMP%]:focus-visible{outline:0;background:var(--ng-colors-bg-active, #e9eaeb);color:var(--ng-colors-text-primary-900, #181d27)}.home-category-filter[_ngcontent-%COMP%] .home-action-btn[_ngcontent-%COMP%]{position:relative}.home-category-filter__dot[_ngcontent-%COMP%]{position:absolute;top:3px;right:3px;width:6px;height:6px;border-radius:50%;background:var(--ng-colors-fg-brand-primary-600)}.home-category-filter[_ngcontent-%COMP%]::part(panel){background:transparent;box-shadow:none;border-radius:0}.home-category-filter__panel[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1px;min-width:200px;max-height:320px;overflow-y:auto;padding:6px;background:var(--ng-colors-bg-primary);border:1px solid var(--ng-colors-border-primary);border-radius:var(--ng-radius-lg);box-shadow:var(--ng-shadow-lg)}.home-refresh-glyph[_ngcontent-%COMP%]{display:inline-flex;transform-origin:50% 50%}.home-refresh-glyph--spinning[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_home-refresh-spin .9s linear infinite}@keyframes _ngcontent-%COMP%_home-refresh-spin{to{transform:rotate(360deg)}}.home-ai-drawer[_ngcontent-%COMP%]::part(base){z-index:var(--z-drawer, 900)}.home-ai-drawer[_ngcontent-%COMP%]::part(panel){width:100%;max-width:100%}.home-ai-drawer[_ngcontent-%COMP%]::part(body){padding:0;overflow:hidden}.home-ai-drawer[_ngcontent-%COMP%] db-ai-prompt-panel[_ngcontent-%COMP%]{display:block;height:100%;min-height:0}.home-category-filter__heading[_ngcontent-%COMP%]{display:block;padding:6px 10px 4px;font-size:10.5px;font-weight:700;letter-spacing:.07em;text-transform:uppercase;color:var(--ng-colors-text-tertiary-600)}.home-category-filter__item[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;padding:7px 10px;border:0;border-radius:7px;background:transparent;font:inherit;font-size:13px;color:var(--ng-colors-text-secondary-700);text-align:left;white-space:nowrap;cursor:pointer}.home-category-filter__item[_ngcontent-%COMP%]:hover{background:var(--ng-colors-bg-secondary)}.home-category-filter__item.is-active[_ngcontent-%COMP%]{color:var(--ng-colors-fg-brand-primary-600);font-weight:600;background:var(--ng-colors-bg-secondary)}.home-category-filter__label[_ngcontent-%COMP%]{min-width:0;overflow:hidden;text-overflow:ellipsis}']})};function yi(o,t){o&1&&h(0,"dvz-dashboards-page")}var Ve=class o{config=J(void 0);ready=_e({alias:"dvz-ready"});error=_e({alias:"dvz-error"});unauthorized=_e({alias:"dvz-unauthorized"});navigate=_e({alias:"dvz-navigate"});host=w(re);navigator=w(U);destroyRef=w(Je);stopAdopting=null;stopTokenRefresh=null;stopUi=null;configured=!1;constructor(){te(()=>{let t=this.config();t&&this.apply(t)}),this.navigator.requests.pipe(It(this.destroyRef)).subscribe(t=>this.navigate.emit(t)),queueMicrotask(()=>{let t=this.host.nativeElement.shadowRoot;t&&(this.stopAdopting=Ue(t))})}async apply(t){let e=t.auth,n=jt({baseUrl:t.api.baseUrl,mcpUrl:t.api.mcpUrl,tokenizedOrigins:t.api.tokenizedOrigins,headers:t.api.headers,customerId:t.tenant.customerId??null,productId:t.tenant.productId,productName:t.tenant.productName??null,authMode:e.mode,authToken:e.mode==="token"?e.token:null,getToken:e.mode==="callback"?e.getToken:null,onUnauthorized:()=>this.unauthorized.emit(),features:t.features,ui:t.ui,copy:t.copy,hrefs:t.hrefs,initialDashboardId:t.initial?.dashboardId??null});this.stopUi?.(),this.stopUi=je(this.host.nativeElement,t.ui),yt(t.api.baseUrl),ft(t.api,e),vt({productId:t.tenant.productId,name:t.tenant.productName}),bt(()=>this.unauthorized.emit());let i=n;if(await mt(i),this.stopTokenRefresh??=ut(i),!this.configured){this.configured=!0;let r=k();this.ready.emit({customerId:r.customerId??"",productId:r.productId??""})}}ngOnDestroy(){this.stopAdopting?.(),this.stopTokenRefresh?.(),this.stopUi?.()}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=H({type:o,selectors:[["dvz-dashboards-root"]],inputs:{config:[1,"config"]},outputs:{ready:"dvz-ready",error:"dvz-error",unauthorized:"dvz-unauthorized",navigate:"dvz-navigate"},features:[le([U])],decls:1,vars:1,template:function(e,n){e&1&&y(0,yi,1,0,"dvz-dashboards-page"),e&2&&C(n.config()?0:-1)},dependencies:[Ne],styles:[`:host{display:block;height:100%;min-height:0}
2
+ `],encapsulation:3,changeDetection:0})};pt();var Ci="dvz-dashboards";function vi(o={}){return gt(Ve,Ci,[Xe(),_t(),lt(dt([xt])),{provide:wt,useFactory:()=>k().baseUrl},Mt(j),kt(A),St(A),Se(A),De(A),ke(A),Te(A),Ot(A)],o)}vi();export{Ci as a,vi as b};