udp-stencil-component-library 25.18.2-beta.10 → 25.18.2-beta.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/dist/cjs/{SearchBuilder-C1sUitjQ.js → SearchBuilder-DYM_FL5l.js} +1 -1
  2. package/dist/cjs/advanced-search_12.cjs.entry.js +3 -3
  3. package/dist/cjs/ag-grid-base_6.cjs.entry.js +2 -2
  4. package/dist/cjs/ambient-template-grid.cjs.entry.js +3 -3
  5. package/dist/cjs/api-method-instance-grid.cjs.entry.js +1 -1
  6. package/dist/cjs/{apiUtils-DT-fLJOw.js → apiUtils-bDl8etNp.js} +1 -1
  7. package/dist/cjs/{catalog-store-BOiNPWZB.js → catalog-store-DIF1IDLi.js} +1 -1
  8. package/dist/cjs/entity-maintenance-grid.cjs.entry.js +2 -2
  9. package/dist/cjs/index.cjs.js +4 -4
  10. package/dist/cjs/loader.cjs.js +1 -1
  11. package/dist/cjs/{makeApiCall-CFfg9gI0.js → makeApiCall-B9MMU_Ob.js} +4 -1
  12. package/dist/cjs/search-method-grid.cjs.entry.js +2 -2
  13. package/dist/cjs/stencil-library.cjs.js +1 -1
  14. package/dist/cjs/udp-forms-builder.cjs.entry.js +4 -4
  15. package/dist/cjs/udp-forms-renderer.cjs.entry.js +37 -19
  16. package/dist/collection/components/forms/udp-forms/udp-forms-builder/udp-forms-builder.js +4 -4
  17. package/dist/collection/components/forms/udp-forms/udp-forms-renderer/udp-forms-renderer.js +38 -3
  18. package/dist/collection/components/forms/udp-forms/udp-forms-utils/form-handler/UdpFormHandler.js +7 -7
  19. package/dist/collection/components/forms/udp-forms/udp-forms-utils/form-submission-handler/FormSubmissionHandler.js +14 -5
  20. package/dist/collection/components/forms/udp-forms/udp-forms-utils/form-submission-handler/FormSubmissionHandlerFactory.js +2 -2
  21. package/dist/collection/udp-utilities/api/makeApiCall/makeApiCall.js +4 -1
  22. package/dist/components/makeApiCall.js +1 -1
  23. package/dist/components/udp-forms-builder.js +1 -1
  24. package/dist/components/udp-forms-renderer.js +1 -1
  25. package/dist/docs.json +33 -3
  26. package/dist/esm/{SearchBuilder-CvKqGlUH.js → SearchBuilder-BjVdKjci.js} +1 -1
  27. package/dist/esm/advanced-search_12.entry.js +3 -3
  28. package/dist/esm/ag-grid-base_6.entry.js +2 -2
  29. package/dist/esm/ambient-template-grid.entry.js +3 -3
  30. package/dist/esm/api-method-instance-grid.entry.js +1 -1
  31. package/dist/esm/{apiUtils-cUHs50y0.js → apiUtils-11-yfzUs.js} +1 -1
  32. package/dist/esm/{catalog-store-BhgNAUY6.js → catalog-store-CbwcwIKF.js} +1 -1
  33. package/dist/esm/entity-maintenance-grid.entry.js +2 -2
  34. package/dist/esm/index.js +4 -4
  35. package/dist/esm/loader.js +1 -1
  36. package/dist/esm/{makeApiCall-B-daVutk.js → makeApiCall-2umiVB6u.js} +4 -1
  37. package/dist/esm/search-method-grid.entry.js +2 -2
  38. package/dist/esm/stencil-library.js +1 -1
  39. package/dist/esm/udp-forms-builder.entry.js +4 -4
  40. package/dist/esm/udp-forms-renderer.entry.js +37 -19
  41. package/dist/stencil-library/{SearchBuilder-CvKqGlUH.js → SearchBuilder-BjVdKjci.js} +1 -1
  42. package/dist/stencil-library/advanced-search_12.entry.js +1 -1
  43. package/dist/stencil-library/ag-grid-base_6.entry.js +1 -1
  44. package/dist/stencil-library/ambient-template-grid.entry.js +1 -1
  45. package/dist/stencil-library/api-method-instance-grid.entry.js +1 -1
  46. package/dist/stencil-library/{apiUtils-cUHs50y0.js → apiUtils-11-yfzUs.js} +1 -1
  47. package/dist/stencil-library/{catalog-store-BhgNAUY6.js → catalog-store-CbwcwIKF.js} +1 -1
  48. package/dist/stencil-library/entity-maintenance-grid.entry.js +1 -1
  49. package/dist/stencil-library/index.esm.js +1 -1
  50. package/dist/stencil-library/makeApiCall-2umiVB6u.js +1 -0
  51. package/dist/stencil-library/search-method-grid.entry.js +1 -1
  52. package/dist/stencil-library/stencil-library.esm.js +1 -1
  53. package/dist/stencil-library/udp-forms-builder.entry.js +1 -1
  54. package/dist/stencil-library/udp-forms-renderer.entry.js +1 -1
  55. package/dist/types/components/forms/udp-forms/udp-forms-renderer/udp-forms-renderer.d.ts +1 -0
  56. package/dist/types/components/forms/udp-forms/udp-forms-utils/form-submission-handler/FormSubmissionHandler.d.ts +3 -1
  57. package/dist/types/components/forms/udp-forms/udp-forms-utils/form-submission-handler/FormSubmissionHandlerFactory.d.ts +1 -1
  58. package/dist/types/components.d.ts +4 -2
  59. package/dist/types/udp-utilities/api/makeApiCall/makeApiCall.d.ts +1 -1
  60. package/package.json +1 -1
  61. package/dist/stencil-library/makeApiCall-B-daVutk.js +0 -1
@@ -4,8 +4,8 @@ import { g as getCurrentTenantId } from './tenantUtils-Basdb1b1.js';
4
4
  import { f as fetchLatestForms } from './udp-form-api-utils-vPSYCvIA.js';
5
5
  import { b as UdpFormsSubmissionStatusEnum, U as UdpFormsPageIdEnum, c as UdpFormsFieldTypeEnum, a as UdpFormsTypeEnum } from './enums-D5dod6Ie.js';
6
6
  import { b as buildEmptyCurrentValues } from './utils-kwLwITIE.js';
7
- import { c as createFormData, m as makeApiCall } from './makeApiCall-B-daVutk.js';
8
- import { S as SearchBuilder, c as SearchOperators } from './SearchBuilder-CvKqGlUH.js';
7
+ import { c as createFormData, m as makeApiCall } from './makeApiCall-2umiVB6u.js';
8
+ import { S as SearchBuilder, c as SearchOperators } from './SearchBuilder-BjVdKjci.js';
9
9
  import { C as ConfigService } from './configService-BqLfkVKh.js';
10
10
  import { v4 } from 'uuid';
11
11
  import 'axios';
@@ -163,8 +163,17 @@ class UdpFormSubmission {
163
163
  * comments use dedicated comment endpoints once a submission exists.
164
164
  */
165
165
  class FormSubmissionHandler {
166
- constructor(accessMode) {
166
+ constructor(accessMode, tenantId) {
167
167
  this.accessMode = accessMode;
168
+ this.tenantId = tenantId;
169
+ }
170
+ get extraHeaders() {
171
+ // Public endpoints require currentTenantId header.
172
+ if (this.accessMode !== 'public')
173
+ return undefined;
174
+ if (!this.tenantId)
175
+ return undefined;
176
+ return { currentTenantId: String(this.tenantId) };
168
177
  }
169
178
  async addComment(udpFormSubmission, comment) {
170
179
  if (!(udpFormSubmission === null || udpFormSubmission === void 0 ? void 0 : udpFormSubmission.id)) {
@@ -184,7 +193,7 @@ class FormSubmissionHandler {
184
193
  // Backend contract: PUT /UdpFormSubmission/{submissionId}/comments/{commentId}
185
194
  // Body: { value, sectionKey, questionKey }
186
195
  const url = `${ConfigService.productV1ApiUrl}/UdpFormSubmission/${udpFormSubmission.id}/comments/${commentId}`;
187
- await makeApiCall('PUT', url, { value, sectionKey, questionKey }, true);
196
+ await makeApiCall('PUT', url, { value, sectionKey, questionKey }, true, this.extraHeaders);
188
197
  }
189
198
  async deleteComment(udpFormSubmission, args) {
190
199
  if (!(udpFormSubmission === null || udpFormSubmission === void 0 ? void 0 : udpFormSubmission.id)) {
@@ -193,7 +202,7 @@ class FormSubmissionHandler {
193
202
  const { commentId } = args;
194
203
  // Backend contract: DELETE /UdpFormSubmission/{submissionId}/comments/{commentId}
195
204
  const url = `${ConfigService.productV1ApiUrl}/UdpFormSubmission/${udpFormSubmission.id}/comments/${commentId}`;
196
- await makeApiCall('DELETE', url, null, true);
205
+ await makeApiCall('DELETE', url, null, true, this.extraHeaders);
197
206
  }
198
207
  async fetchAndPopulateUdpFormSubmissionObj(udpFormSubmission) {
199
208
  if (!(udpFormSubmission === null || udpFormSubmission === void 0 ? void 0 : udpFormSubmission.id)) {
@@ -232,7 +241,7 @@ class FormSubmissionHandler {
232
241
  async saveFormDataWithoutValues(udpFormSubmission, status) {
233
242
  const formData = udpFormSubmission.processSubmissionIntoFormDataWithoutValues(status);
234
243
  const { method, url } = this.getApiRequestInfo(udpFormSubmission);
235
- const response = await makeApiCall(method, url, formData, true);
244
+ const response = await makeApiCall(method, url, formData, true, this.extraHeaders);
236
245
  if (response === '') {
237
246
  return await this.fetchAndPopulateUdpFormSubmissionObj(udpFormSubmission);
238
247
  }
@@ -252,7 +261,7 @@ class FormSubmissionHandler {
252
261
  async saveSubmissionToDB(values, udpFormSubmission, status) {
253
262
  const formData = udpFormSubmission.processSubmissionIntoFormData(values, status);
254
263
  const { method, url } = this.getApiRequestInfo(udpFormSubmission);
255
- const response = await makeApiCall(method, url, formData, true);
264
+ const response = await makeApiCall(method, url, formData, true, this.extraHeaders);
256
265
  if (response === '') {
257
266
  return await this.fetchAndPopulateUdpFormSubmissionObj(udpFormSubmission);
258
267
  }
@@ -294,8 +303,8 @@ class FormSubmissionHandler {
294
303
  * Factory for creating form submission handlers.
295
304
  */
296
305
  class FormSubmissionHandlerFactory {
297
- static create(isPublic, userId) {
298
- return new FormSubmissionHandler(isPublic ? 'public' : 'private');
306
+ static create(isPublic, userId, currentTenantId) {
307
+ return new FormSubmissionHandler(isPublic ? 'public' : 'private', currentTenantId !== null && currentTenantId !== void 0 ? currentTenantId : undefined);
299
308
  }
300
309
  }
301
310
 
@@ -306,16 +315,16 @@ class UdpFormHandler {
306
315
  }
307
316
  buildDescribeUrl(formId, formVersion) {
308
317
  const base = ConfigService.productV1ApiUrl;
309
- if (this.isPublic) {
310
- return `${base}/UdpForm/${formId}/${formVersion}/describe/public`;
311
- }
312
- else {
313
- return `${base}/UdpForm/${formId}/${formVersion}/describe`;
314
- }
318
+ const versionSegment = typeof formVersion === 'number' ? `/${formVersion}` : '';
319
+ return this.isPublic
320
+ ? `${base}/UdpForm/${formId}${versionSegment}/describe/public`
321
+ : `${base}/UdpForm/${formId}${versionSegment}/describe`;
315
322
  }
316
323
  async getFormByFormIdAndFormVersion(formId, formVersion) {
317
324
  const url = this.buildDescribeUrl(formId, formVersion);
318
- const formData = await makeApiCall('GET', url);
325
+ // For public endpoints, backend requires currentTenantId in the header.
326
+ const extraHeaders = this.isPublic && this.tenantId ? { currentTenantId: String(this.tenantId) } : undefined;
327
+ const formData = await makeApiCall('GET', url, undefined, false, extraHeaders);
319
328
  if (formData.styleOverrides && typeof formData.styleOverrides === 'string') {
320
329
  formData.styleOverrides = JSON.parse(formData.styleOverrides);
321
330
  }
@@ -1078,6 +1087,15 @@ const UdpFormsRenderer = class {
1078
1087
  var _a;
1079
1088
  this.isLoading = true;
1080
1089
  try {
1090
+ // Public forms require currentTenantId in request headers. It must be provided via URL param.
1091
+ if (this.isPublic) {
1092
+ const params = new URLSearchParams(window.location.search);
1093
+ const currentTenantId = params.get('udpf_currentTenantId');
1094
+ if (!currentTenantId) {
1095
+ throw new Error('Public form renderer requires currentTenantId in the URL query string.');
1096
+ }
1097
+ this.tenantId = currentTenantId;
1098
+ }
1081
1099
  // Get client user info if available
1082
1100
  if (this.isPublic) {
1083
1101
  this.clientUserInfo.id = '00000000-0000-0000-0000-000000000001';
@@ -1091,7 +1109,7 @@ const UdpFormsRenderer = class {
1091
1109
  this.clientUserInfo.email = user.email || null;
1092
1110
  }
1093
1111
  }
1094
- this.formSubmissionHandler = FormSubmissionHandlerFactory.create(this.isPublic, this.clientUserInfo.id);
1112
+ this.formSubmissionHandler = FormSubmissionHandlerFactory.create(this.isPublic, this.clientUserInfo.id, this.tenantId);
1095
1113
  this.udpFormSubmission = new UdpFormSubmission({ id: this.submissionId, formId: this.formId, formVersion: this.version, unityUserId: this.clientUserInfo.id, generic1: this.urlContext.generic1, generic2: this.urlContext.generic2, generic3: this.urlContext.generic3 });
1096
1114
  // fetch existing submission from Udp.FormSubmission if submissionId is provided
1097
1115
  // take exisitng object, and populate with db values, and return new obj with updated values
@@ -1110,7 +1128,7 @@ const UdpFormsRenderer = class {
1110
1128
  formId = this.formId;
1111
1129
  formVersion = this.version;
1112
1130
  }
1113
- this.formHandler = new UdpFormHandler(this.tenantId);
1131
+ this.formHandler = new UdpFormHandler(this.tenantId, this.isPublic);
1114
1132
  const formData = await this.formHandler.getFormByFormIdAndFormVersion(formId, formVersion);
1115
1133
  this.udpForm = new UdpForm(formData);
1116
1134
  this.currentValues = buildEmptyCurrentValues(this.udpForm);
@@ -1324,7 +1342,7 @@ const UdpFormsRenderer = class {
1324
1342
  return this.isSubmitted || this.udpFormSubmission.unityUserId !== this.clientUserInfo.id;
1325
1343
  }
1326
1344
  render() {
1327
- return (h("div", { key: '37ec47fc7f3ecec70ba7ca3e12717789285be5d8', class: "forms-renderer-container", style: this.isLoading ? { minHeight: '100vh' } : {} }, this.renderFollowUpSideSheet(), h("udp-forms-ui", { udpForm: this.udpForm, currentValues: this.currentValues, udpFormSubmission: this.udpFormSubmission, submitSuccessful: this.submitSuccessful, isSaving: this.isSaving,
1345
+ return (h("div", { key: 'f53b65027554505a1301ab98379035e0316735dc', class: "forms-renderer-container", style: this.isLoading ? { minHeight: '100vh' } : {} }, this.renderFollowUpSideSheet(), h("udp-forms-ui", { udpForm: this.udpForm, currentValues: this.currentValues, udpFormSubmission: this.udpFormSubmission, submitSuccessful: this.submitSuccessful, isSaving: this.isSaving,
1328
1346
  // saveErrorMessage={this.saveErrorMessage}
1329
1347
  // showAutoSaveStatus={this.formSubmissionHandler.supportsAutoSave() && !!this.userId}
1330
1348
  readonly: this.isReadOnlyMode, handleSubmit: this.handleSubmit.bind(this), handleSave: values => Promise.resolve(this.debouncedManualSave(values)), handleChange: this.handleFormChange, handleAction: this.triggerAction, handleFinish: this.handleFinish, clientUserInfo: this.clientUserInfo, isSubmitted: this.isSubmitted, dynamicSections: this.dynamicSections, duplicateRepeatableSection: this.duplicateRepeatableSection, deleteRepeatableSection: this.deleteRepeatableSection, key: `form-rerender-key-${this.reRenderKey}`, isShowManualSaveIcon: this.isShowManualSaveIcon(), isLoading: this.isLoading, performBackgroundSaveAndUpdateLocalSubmissionState: this.performBackgroundSaveAndUpdateLocalSubmissionState })));
@@ -1 +1 @@
1
- import{m as r}from"./makeApiCall-B-daVutk.js";import{C as e}from"./configService-BqLfkVKh.js";var t,s,i;!function(r){r[r.And=1]="And",r[r.Or=2]="Or"}(t||(t={})),function(r){r.None="",r.Distinct="Distinct"}(s||(s={})),function(r){r.EQUALS="=",r.NOT_EQUALS="!=",r.LIKE="LIKE",r.GREATER_THAN=">",r.GREATER_THAN_OR_EQUAL=">=",r.LESS_THAN="<",r.LESS_THAN_OR_EQUAL="<=",r.IN="IN",r.NOT_IN="NOT IN",r.BETWEEN="BETWEEN",r.STARTSWITH="STARTSWITH",r.ENDSWITH="ENDSWITH"}(i||(i={}));class a{constructor(r=1,e=20){this.search={pageNumber:r,pageSize:e,filterElements:[],orderElements:[],filterGroups:[],eagerLoad:!1,logicalSearchOperator:t.And}}setEagerLoad(r){return this.search.eagerLoad=r,this}setPagination(r,e){return this.search.pageNumber=r,this.search.pageSize=e,this}setLogicalOperator(r){return this.search.logicalSearchOperator=r,this}addFilter(r,e,t=i.EQUALS,s,a){return this.search.filterElements.push({searchField:r,searchValue:e,searchOperator:t,searchValueType:s,groupId:a}),this}addFilters(r){return this.search.filterElements.push(...r),this}addOrder(r,e="ASC"){return this.search.orderElements.push({sortColumn:r,sortDirection:e}),this}addOrders(r){return this.search.orderElements.push(...r),this}setGrouping(r,e,t){return this.search.groupingType=r,this.search.groupProperty=e,this.search.groupOperationList=t,this}addFilterGroup(r,e,t){return this.search.filterGroups||(this.search.filterGroups=[]),this.search.filterGroups.push({groupId:r,groupOperator:e,parentGroupId:t}),this}clearFilters(){return this.search.filterElements=[],this}clearOrders(){return this.search.orderElements=[],this}clearFilterGroups(){return this.search.filterGroups=[],this}reset(r=1,e=20){return this.search={pageNumber:r,pageSize:e,filterElements:[],orderElements:[],filterGroups:[],eagerLoad:!1,logicalSearchOperator:t.And},this}build(){return Object.assign({},this.search)}async execute(r){const e=o.normalizeSearch(this.search);return o.executeSearch(e,r)}getSnapshot(){return Object.assign({},this.search)}}class o{static createSearchObject(r=[],e=1,i=20,a=!1,o=t.And,c=[]){const n={pageNumber:e,pageSize:i,filterElements:[],filterGroups:[],orderElements:[],groupingType:"",groupProperty:[],groupOperationList:[],eagerLoad:a,logicalSearchOperator:o};return r&&r.forEach((e=>{var t;const i=e.searchField;n.filterElements=r,e.sortDirection&&n.orderElements.push({sortColumn:i,sortDirection:e.sortDirection}),e.distinct&&(n.groupingType=s.Distinct,null===(t=n.groupProperty)||void 0===t||t.push(i))})),n.filterGroups=c,n}static createFilter(r,e,t=i.EQUALS,s,a){return{searchField:r,searchValue:e,searchOperator:t,searchValueType:s,groupId:a}}static createLikeFilter(r,e,t){return this.createFilter(r,`%${e}%`,i.LIKE,void 0,t)}static createInFilter(r,e,t){return this.createFilter(r,e.join(","),i.IN,void 0,t)}static createDateRangeFilter(r,e,t,s){return this.createFilter(r,`${e},${t}`,i.BETWEEN,void 0,s)}static createOrder(r,e="ASC"){return{sortColumn:r,sortDirection:e}}static mergeSearchObjects(...r){if(0===r.length)throw new Error("At least one search object is required");const e=r[0];for(let t=1;t<r.length;t++){const s=r[t];e.filterElements.push(...s.filterElements),e.orderElements.push(...s.orderElements),s.filterGroups&&(e.filterGroups=e.filterGroups||[],e.filterGroups.push(...s.filterGroups))}return e}static validateSearch(r){const e=[];return r?(void 0!==r.pageNumber&&r.pageNumber<1&&e.push("Page number must be greater than 0"),void 0!==r.pageSize&&r.pageSize<1&&e.push("Page size must be greater than 0"),{isValid:0===e.length,errors:e}):(e.push("Search object is required"),{isValid:!1,errors:e})}static normalizeSearch(r){return{pageNumber:r.pageNumber||1,pageSize:r.pageSize||15,filterElements:r.filterElements||[],orderElements:r.orderElements||[],filterGroups:r.filterGroups||[],eagerLoad:r.eagerLoad||!1,logicalSearchOperator:r.logicalSearchOperator||t.And,groupingType:r.groupingType||"",groupProperty:r.groupProperty||[],groupOperationList:r.groupOperationList||[]}}static async executeSearch(t,s){const i=this.normalizeSearch(t),a=this.validateSearch(i);if(!a.isValid)throw new Error(`Invalid search: ${a.errors.join(", ")}`);const o=`${e.productV1ApiUrl}/${s}/search`;try{return await r("POST",o,i)}catch(r){throw console.error(`Error executing search for table ${s}:`,r),r}}static async executeSearchWithEndpoint(e,t){const s=this.normalizeSearch(e),i=this.validateSearch(s);if(!i.isValid)throw new Error(`Invalid search: ${i.errors.join(", ")}`);try{return await r("POST",t,s)}catch(r){throw console.error(`Error executing search for endpoint ${t}:`,r),r}}}export{t as L,a as S,o as a,s as b,i as c}
1
+ import{m as r}from"./makeApiCall-2umiVB6u.js";import{C as e}from"./configService-BqLfkVKh.js";var t,i,s;!function(r){r[r.And=1]="And",r[r.Or=2]="Or"}(t||(t={})),function(r){r.None="",r.Distinct="Distinct"}(i||(i={})),function(r){r.EQUALS="=",r.NOT_EQUALS="!=",r.LIKE="LIKE",r.GREATER_THAN=">",r.GREATER_THAN_OR_EQUAL=">=",r.LESS_THAN="<",r.LESS_THAN_OR_EQUAL="<=",r.IN="IN",r.NOT_IN="NOT IN",r.BETWEEN="BETWEEN",r.STARTSWITH="STARTSWITH",r.ENDSWITH="ENDSWITH"}(s||(s={}));class a{constructor(r=1,e=20){this.search={pageNumber:r,pageSize:e,filterElements:[],orderElements:[],filterGroups:[],eagerLoad:!1,logicalSearchOperator:t.And}}setEagerLoad(r){return this.search.eagerLoad=r,this}setPagination(r,e){return this.search.pageNumber=r,this.search.pageSize=e,this}setLogicalOperator(r){return this.search.logicalSearchOperator=r,this}addFilter(r,e,t=s.EQUALS,i,a){return this.search.filterElements.push({searchField:r,searchValue:e,searchOperator:t,searchValueType:i,groupId:a}),this}addFilters(r){return this.search.filterElements.push(...r),this}addOrder(r,e="ASC"){return this.search.orderElements.push({sortColumn:r,sortDirection:e}),this}addOrders(r){return this.search.orderElements.push(...r),this}setGrouping(r,e,t){return this.search.groupingType=r,this.search.groupProperty=e,this.search.groupOperationList=t,this}addFilterGroup(r,e,t){return this.search.filterGroups||(this.search.filterGroups=[]),this.search.filterGroups.push({groupId:r,groupOperator:e,parentGroupId:t}),this}clearFilters(){return this.search.filterElements=[],this}clearOrders(){return this.search.orderElements=[],this}clearFilterGroups(){return this.search.filterGroups=[],this}reset(r=1,e=20){return this.search={pageNumber:r,pageSize:e,filterElements:[],orderElements:[],filterGroups:[],eagerLoad:!1,logicalSearchOperator:t.And},this}build(){return Object.assign({},this.search)}async execute(r){const e=o.normalizeSearch(this.search);return o.executeSearch(e,r)}getSnapshot(){return Object.assign({},this.search)}}class o{static createSearchObject(r=[],e=1,s=20,a=!1,o=t.And,c=[]){const n={pageNumber:e,pageSize:s,filterElements:[],filterGroups:[],orderElements:[],groupingType:"",groupProperty:[],groupOperationList:[],eagerLoad:a,logicalSearchOperator:o};return r&&r.forEach((e=>{var t;const s=e.searchField;n.filterElements=r,e.sortDirection&&n.orderElements.push({sortColumn:s,sortDirection:e.sortDirection}),e.distinct&&(n.groupingType=i.Distinct,null===(t=n.groupProperty)||void 0===t||t.push(s))})),n.filterGroups=c,n}static createFilter(r,e,t=s.EQUALS,i,a){return{searchField:r,searchValue:e,searchOperator:t,searchValueType:i,groupId:a}}static createLikeFilter(r,e,t){return this.createFilter(r,`%${e}%`,s.LIKE,void 0,t)}static createInFilter(r,e,t){return this.createFilter(r,e.join(","),s.IN,void 0,t)}static createDateRangeFilter(r,e,t,i){return this.createFilter(r,`${e},${t}`,s.BETWEEN,void 0,i)}static createOrder(r,e="ASC"){return{sortColumn:r,sortDirection:e}}static mergeSearchObjects(...r){if(0===r.length)throw new Error("At least one search object is required");const e=r[0];for(let t=1;t<r.length;t++){const i=r[t];e.filterElements.push(...i.filterElements),e.orderElements.push(...i.orderElements),i.filterGroups&&(e.filterGroups=e.filterGroups||[],e.filterGroups.push(...i.filterGroups))}return e}static validateSearch(r){const e=[];return r?(void 0!==r.pageNumber&&r.pageNumber<1&&e.push("Page number must be greater than 0"),void 0!==r.pageSize&&r.pageSize<1&&e.push("Page size must be greater than 0"),{isValid:0===e.length,errors:e}):(e.push("Search object is required"),{isValid:!1,errors:e})}static normalizeSearch(r){return{pageNumber:r.pageNumber||1,pageSize:r.pageSize||15,filterElements:r.filterElements||[],orderElements:r.orderElements||[],filterGroups:r.filterGroups||[],eagerLoad:r.eagerLoad||!1,logicalSearchOperator:r.logicalSearchOperator||t.And,groupingType:r.groupingType||"",groupProperty:r.groupProperty||[],groupOperationList:r.groupOperationList||[]}}static async executeSearch(t,i){const s=this.normalizeSearch(t),a=this.validateSearch(s);if(!a.isValid)throw new Error(`Invalid search: ${a.errors.join(", ")}`);const o=`${e.productV1ApiUrl}/${i}/search`;try{return await r("POST",o,s)}catch(r){throw console.error(`Error executing search for table ${i}:`,r),r}}static async executeSearchWithEndpoint(e,t){const i=this.normalizeSearch(e),s=this.validateSearch(i);if(!s.isValid)throw new Error(`Invalid search: ${s.errors.join(", ")}`);try{return await r("POST",t,i)}catch(r){throw console.error(`Error executing search for endpoint ${t}:`,r),r}}}export{t as L,a as S,o as a,i as b,s as c}
@@ -1 +1 @@
1
- import{r as e,c as t,f as i,h as s,a}from"./index-DFnjA9NX.js";import{u as o}from"./conversionFunctions-CNWYTvRs.js";import{s as n}from"./catalog-store-BhgNAUY6.js";import c from"@carbon/icons/es/close/24";import{v4 as r}from"uuid";import l from"@carbon/icons/es/save/16";import d from"@carbon/icons/es/close/16";import h from"@carbon/icons/es/list/16";import f from"@carbon/icons/es/download/16";import b from"@carbon/icons/es/settings/16";import p from"@carbon/icons/es/star/16";import u from"@carbon/icons/es/ibm-watson--discovery/16";import g from"@carbon/icons/es/idea/16";import m from"@carbon/icons/es/renew/16";import"@stencil/store";import"./apiUtils-cUHs50y0.js";import"deep-equal";import"./makeApiCall-B-daVutk.js";import"axios";import"./configService-BqLfkVKh.js";import"./tenantUtils-Basdb1b1.js";const y=class{constructor(s){e(this,s),this.advancedSearchItemChange=t(this,"advancedSearchItemChange"),this.filterList=[],this.filterRenderList=[],this.nestedData=new Map,this.searchObject=[],this.tempNestedData=new Map,this.testData=[],this.showChildren=!1,this.handleReferenceClick=async(e,t,i,s,a,c)=>{if(console.log("Clicked reference:",e,"Name:",t,"Parent Reference:",i,"parentFilter",s,"parent reference click test",a,c),!n.isLoadingCatalogData&&null!==n.catalogData)try{const i=await o(n.catalogData,e,!0,!0,t,s,a);Array.isArray(i)?this.updateNestedData(i):console.error("Extended search filter list is not an array")}catch(e){console.error("Error fetching filters:",e)}},this.updateNestedData=e=>{if(!Array.isArray(e)||0===e.length)return void console.error("Invalid or empty children data provided for updateNestedData");const t=e[0].extendedProperties.parent,s=o(n.catalogData,e[0].extendedProperties.fromFilter,!0,!0,name,"","");s&&s.forEach((i=>{i.name===t?i.referenceNode=e:i.reference&&i.referenceNode&&this.updateNestedDataRecursively(i.referenceNode,e,t)}));const a=(e,t,i)=>e.map((e=>{if(e.name===i){const i=t.filter((t=>!((e,t)=>e.some((e=>e.name===t.name)))(e.referenceNode||[],t)));return Object.assign(Object.assign({},e),{referenceNode:[...e.referenceNode||[],...i]})}return e.referenceNode?Object.assign(Object.assign({},e),{referenceNode:a(e.referenceNode,t,i)}):e}));this.testData=a(this.testData,e,t),i(this)},this.updateNestedDataRecursively=(e,t,i)=>{e.forEach((e=>{e.name===i?e.referenceNode=t:e.referenceNode&&this.updateNestedDataRecursively(e.referenceNode,t,i)}))},this.onTreeListItemClick=e=>{const t=e.detail;t.searchField=t.parentName&&t.parentPath?`${t.parentPath}.${t.parentName}.${t.searchField}`:t.parentName?`${t.parentName}.${t.searchField}`:`${t.searchField}`,t.searchField=t.searchField.split(".").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join("."),this.handleItemClick(t)}}componentWillLoad(){}filterListWatcher(e,t){e!==t&&(this.testData=e)}render(){const e=Array.isArray(this.testData)?this.testData:[],t=Array.isArray(this.filterRenderList)?this.filterRenderList:[];return s("div",{key:"749ac603c7d5998cab9cdc804eb26ae15ab9502c",class:"container"},s("div",{key:"19b11ac5eed4ebff194a2489bc647abfca3ee6bb",class:"left-column"},!e.length&&s("div",{key:"d6b693fca77ee5d6db78540dc218d70cd9558851",style:{marginRight:"8px"}},s("udp-grid-loader",{key:"4d1384371f5de5ee8f5eff618aaaaa4d20ccdf0a",width:"362px","num-columns":"1","num-rows":"20"})),s("div",{key:"e9e277276dffb7163b9df189945c25ebfcc7246e"},e.map(((e,t)=>{var i;return s("tree-list-item",{key:`${e.name}-${t}`,level:0,label:this.getHeaderFieldLabel(e.name),fieldName:e.name,reference:e.reference,parentName:"",parentFilter:e.extendedProperties.parentFilter,parentPath:"filter.extendedProperties.parentPath",parent:null===(i=e.extendedProperties)||void 0===i?void 0:i.parent,nestedItems:e.referenceNode,"onReference-clicked":e=>this.handleReferenceClick(e.detail.reference,e.detail.name,e.detail.parentReference,e.detail.parentFilter,e.detail.parent,e.detail.parentPath),onItemClick:this.onTreeListItemClick})})))),s("div",{key:"85759f73d86b502052e61f2d8b465e3498967566",class:"right-column"},s("udp-page-header",{key:"a825cfd6fdfec752270bd24b48512185a49f3ee9",onValueChanged:this.handleValueChanged}),s("filter-conditions",{key:"22a0cfe66f0ab58a87e4a51aec2694d34a37fb49"}),t.map((e=>e.filterElements.map(((e,t)=>{var i;return s("search-list-item",{key:`${e.searchField}-${t}`,label:null!==(i=null==e?void 0:e.searchLabel)&&void 0!==i?i:e.searchField,fieldName:e.searchField,handleDelete:()=>this.handleDelete({searchField:e.searchField,searchValue:e.searchValue}),name:e.searchValue})}))))))}static get watchers(){return{filterList:[{filterListWatcher:0}]}}};y.style=':host{display:block;height:100%}.container{display:flex;height:100vh}.left-column{flex:1;background-color:white;height:90vh;overflow:scroll;padding:8px}.right-column{flex:2;margin-left:16px;padding:16px;height:90vh;overflow:scroll}.filter-group[data-level="0"]{padding-left:0}.filter-group[data-level="1"]{padding-left:20px}.filter-group[data-level="2"]{padding-left:40px}.filter-group{margin-top:24px;border-left:1px solid #bababa}.search-input-list{height:100%;max-height:70vh;overflow:auto}.recent-searches{min-width:300px;margin-bottom:10px}';const v=class{constructor(s){e(this,s),this.advancedSearchItemChange=t(this,"advancedSearchItemChange"),this.searchItemChanged=t(this,"searchItemChanged"),this.searchOperatorChanged=t(this,"searchOperatorChanged"),this.filterList=[],this.filterRenderList=[],this.nestedData=new Map,this.searchObject=[],this.tempNestedData=new Map,this.testData=[],this.showChildren=!1,this.filterGroups=[],this.filterObjectsWithGroups=[],this.disableFilterSelection=!0,this.sharedId="",this.filters=[],this.recentSearchesOptions=[],this.handleReferenceClick=async(e,t,i,s,a,c)=>{if(console.log("Clicked reference:",e,"Name:",t,"Parent Reference:",i,"parentFilter",s,"parent reference click test",a,c),n.isLoadingCatalogData||null===n.catalogData)console.log("Catalog data is not ready yet.");else try{console.log("state.catalogData",n.catalogData);const i=await o(n.catalogData,e,!0,!0,t,s,a);console.log("extendedSearchFilterList",i),Array.isArray(i)?this.updateNestedData(i):console.error("Extended search filter list is not an array"),console.log("Updated nestedData:",Array.from(this.nestedData.entries()))}catch(e){console.error("Error fetching filters:",e)}},this.updateNestedData=e=>{if(!Array.isArray(e)||0===e.length)return void console.error("Invalid or empty children data provided for updateNestedData");console.log("children in updatedNest",e);const t=e[0].extendedProperties.parent,s=o(n.catalogData,e[0].extendedProperties.fromFilter,!0,!0,name,"","");console.log("testParentArray",s),s&&s.forEach((i=>{i.name===t?(i.referenceNode=e,console.log("add referenceNode array",e,s)):i.reference&&i.referenceNode&&this.updateNestedDataRecursively(i.referenceNode,e,t)}));const a=(e,t,i)=>e.map((e=>{if(e.name===i){const i=t.filter((t=>!((e,t)=>e.some((e=>e.name===t.name)))(e.referenceNode||[],t)));return Object.assign(Object.assign({},e),{referenceNode:[...e.referenceNode||[],...i]})}return e.referenceNode?Object.assign(Object.assign({},e),{referenceNode:a(e.referenceNode,t,i)}):e}));this.testData=a(this.testData,e,t),console.log("Updated testData",this.testData),i(this)},this.updateNestedDataRecursively=(e,t,i)=>{e.forEach((e=>{e.name===i?e.referenceNode=t:e.referenceNode&&this.updateNestedDataRecursively(e.referenceNode,t,i)}))},this.onTreeListItemClick=e=>{const t=e.detail;console.log("Tree list item clicked in grouped:",t),t.searchField=t.parentName&&t.parentPath?`${t.parentPath}.${t.parentName}.${t.searchField}`:t.parentName?`${t.parentName}.${t.searchField}`:`${t.searchField}`,t.searchField=t.searchField.split(".").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join("."),this.handleItemClick(t),this.disableFilterSelection=!0},this.currentLogicalOperator="AND"}componentWillLoad(){}filterListWatcher(e,t){e!==t&&(this.testData=e)}filterObjectsWithGroupsChanged(e,t){}updateFilterWithUserData(e,t){const i=this.filters.map((i=>i.id===e?Object.assign(Object.assign({},i),t):i));this.filters=i}updateGroupLogicalOperator(e,t){const i=(e,t,s)=>{for(const a of e){if(a.id===t)return a.logicalOperator=s,!0;if(a.children&&i(a.children,t,s))return!0}return!1};i(this.filterObjectsWithGroups,e,t)&&(this.filterObjectsWithGroups=[...this.filterObjectsWithGroups])}handleSearchItemChange(e){const{searchOperator:t,searchValue:i,filterGroupId:s,id:a}=e.detail,o=this.findGroupById(this.filterObjectsWithGroups,s);if(o){const e=o.filters.find((e=>e.id===a));e&&(e.searchOperator=t,e.searchValue=i,this.filterObjectsWithGroups=[...this.filterObjectsWithGroups])}this.searchItemChanged.emit(e.detail)}handleOperatorSelected(e,t){const i=this.getLogicalOperatorValue(e.detail.value);this.updateLogicalOperator(t,i),this.searchOperatorChanged.emit()}renderFilterGroup(e,t=0){const i="root"===e.id,a="default"===e.id,o={"padding-left":20*t+"px"},n=this.getLogicalOperatorCode(e.logicalOperator).toString(),r=s("udp-selector",{options:[{value:"1",label:"AND"},{value:"2",label:"OR"}],onChange:t=>this.handleOperatorSelected(t,e.filterGroupId),initialValue:n,disabled:i||a}),l=!i&&!a&&s("stencil-icon-button",{icon:c,onClick:()=>this.handleGroupDelete(e.filterGroupId)}),d=!i&&s("div",{class:"search-input-list"},e.filters.map(((e,t)=>{var i;return s("search-list-item",{key:`${e.id}-${t}`,isDefault:a,id:e.id,filterGroupId:e.filterGroupId,label:null!==(i=null==e?void 0:e.searchLabel)&&void 0!==i?i:e.searchField,fieldName:e.searchField,handleDelete:()=>this.handleDelete(e),name:e.searchValue,operator:e.searchOperator,onSearchItemChanged:e=>this.handleSearchItemChange(e),isInitialSearchItem:e.isInitialFilterElement})}))),h=!a&&s("div",{style:{display:"flex",gap:"8px",marginTop:"8px"}},!i&&s("custom-button",{variant:"outline",onClick:()=>this.addFilter(e.id,e.filterGroupId)},"+ Field"),s("custom-button",{variant:"outline",onClick:()=>this.handleAddNewGroup(i?"root":e.id,this.currentLogicalOperator)},"+ Group")),f=s("div",{class:"nested-groups"},(e.children||[]).map((e=>this.renderFilterGroup(e,t+1))));return s("div",{class:!i&&"filter-group",style:o},a&&0===e.filters.length?null:s("div",{style:{marginBottom:"16px"}},s("div",{style:{display:"flex",gap:"8px"}},r,l)),d,h,f)}addFilter(e,t){console.log("Adding filter..."),this.disableFilterSelection=!1,this.handleAddNewFilter&&this.handleAddNewFilter(t);const i={id:r(),groupId:e,filterGroupId:t,searchField:"",searchOperator:"=",searchValue:""};this.filters=[...this.filters,i]}render(){const e=Array.isArray(this.testData)?this.testData:[];return s("div",{key:"1d8d31637f4bff92f39d3fafddbcadc483b05b4a",class:"container"},s("div",{key:"3f35b059f1942e509871b617d7c76b6d11a7ae20",class:"left-column"},null!==this.selectRecentSearch&&null!==this.fullClearSearch&&s("div",{key:"07565a0d936a333ee8d1b6988ad603ef1442118d",class:"recent-searches"},"Recent Searches",s("div",{key:"d1f55b937654dd403cc01aebcb5e4467b95b26a5",style:{display:"flex",alignItems:"center"}},s("udp-selector",{key:"84d76292d5bed0273ea0625e25bd191dbf4a7ce7",options:this.recentSearchesOptions,onChange:e=>this.selectRecentSearch(e),style:{marginRight:"10px"}}),s("udp-function-button",{key:"ba4158888de93d98f75c9323bbccdc2801df4dd1",delete:!0,onClick:this.fullClearSearch}))),!e.length&&s("div",{key:"c372142871a8a4ab122ee92b1927003cdeb62887",style:{marginRight:"8px"}},s("udp-grid-loader",{key:"6469fa2ce8230c4542c452eea98ebd948ef0c0ff",width:"362px","num-columns":"1","num-rows":"20"})),s("div",{key:"9a66fd98df829c4896be3ede68252b07825a8277"},e.map(((e,t)=>{var i;return s("tree-list-item",{add:!0,showAdd:!0,key:`${e.name}-${t}`,level:0,label:this.getHeaderFieldLabel(e.name),fieldName:e.name,reference:e.reference,parentName:"",parentFilter:e.extendedProperties.parentFilter,parentPath:"filter.extendedProperties.parentPath",parent:null===(i=e.extendedProperties)||void 0===i?void 0:i.parent,nestedItems:e.referenceNode,"onReference-clicked":e=>this.handleReferenceClick(e.detail.reference,e.detail.name,e.detail.parentReference,e.detail.parentFilter,e.detail.parent,e.detail.parentPath),onItemClick:this.onTreeListItemClick})})))),s("div",{key:"0bfe019eb27dfdaa509c2556d114373cfd00c2c5",class:"right-column"},this.filterObjectsWithGroups.map((e=>this.renderFilterGroup(e)))),this.disableFilterSelection&&s("div",{key:"bd69af7520cf0e0e300f13eb2256269f8229ed0c",style:{width:"411px",height:"100vh",background:"white",position:"absolute",zIndex:"9",top:"45px",left:"px",opacity:"0.7"}}))}get el(){return a(this)}static get watchers(){return{filterList:[{filterListWatcher:0}],filterObjectsWithGroups:[{filterObjectsWithGroupsChanged:0}]}}};v.style=':host{display:block;height:100%}.container{display:flex;height:100vh}.left-column{flex:1;background-color:white;height:90vh;overflow:scroll;padding:8px}.right-column{flex:2;margin-left:16px;padding:16px;height:90vh;overflow:scroll}.filter-group[data-level="0"]{padding-left:0}.filter-group[data-level="1"]{padding-left:20px}.filter-group[data-level="2"]{padding-left:40px}.filter-group{margin-top:24px;border-left:1px solid #bababa}.search-input-list{height:100%;max-height:70vh;overflow:auto}.recent-searches{min-width:300px;margin-bottom:10px}';const k=class{constructor(t){e(this,t),this.height="calc(100vh - 200px)"}render(){return s("div",{key:"34090f535edf4f45e28eeacd5ab8da4012319dfd",id:"myGrid",style:{height:this.height,width:"100%"},class:"ag-theme-material"})}get el(){return a(this)}},x=class{constructor(t){e(this,t),this.name="",this.isPrivate=2,this.isDefault=!1,this.fetchedCurrentView=!1,this.handleGetExistingView=()=>{this.isPrivate=this.currentGridViewVisibilityTypeId,this.isDefault=this.currentIsDefault,console.log("isPrivate:",this.isPrivate,"isDefault:",this.isDefault),this.fetchedCurrentView=!0},this.handleNameChange=e=>{this.currentName=e.target.value,this.name=e.target.value},this.handlePrivateChange=()=>{this.isPrivate=1===this.isPrivate?2:1,this.currentGridViewVisibilityTypeId=1===this.currentGridViewVisibilityTypeId?2:1,console.log(this.isPrivate)},this.handleDefaultChange=()=>{this.isDefault=!this.isDefault,this.currentIsDefault=!this.currentIsDefault,console.log(this.isDefault)},this.handleSubmit=()=>{this.handleFormSubmit(this.gridId,this.name,this.isPrivate,this.isDefault)}}componentDidUpdate(){this.open&&this.handleGetExistingView()}componentWillRender(){this.name=this.currentName,this.gridId=this.currentGridId}resetFetchedCurrentView(){this.fetchedCurrentView=!1}render(){return s("fluent-dialog",{key:"148710ea0f7bea0484e3f84e862d0b9123bd79ac",open:this.open,actionOne:()=>{this.handleSubmit(),this.closeDialog(),this.resetFetchedCurrentView()},actionTwo:()=>{this.closeDialog(),this.resetFetchedCurrentView()},handleClose:this.handleClose,labelOne:"Save Update",labelTwo:"Cancel",title:this.title,disableOne:!this.name},s("form",{key:"743aa9a972a90176eb5458405f13cdea3ee56942",class:"edit-form"},s("text-field",{key:"b69c3ea8fa67eeb996ce7f92a9266aebd33cbcc5",label:"View Name",value:this.name,onInput:e=>this.handleNameChange(e)}),this.fetchedCurrentView&&s("div",{key:"7a887a7530065a3c639dfcc66b1d9e5b00b25090",class:"toggle-options"},s("div",{key:"60db77820677f5231298264162821c12f6a07c11"},s("stencil-toggle",{key:"3bda1b0d33a183bbb901aa4dd52dceb377585829",label:"Private",checked:1===this.isPrivate,onToggledChange:this.handlePrivateChange})," "),s("div",{key:"855ecc8457827f4188304177961d361747f5df19"},s("stencil-toggle",{key:"eae91f81bd56d29ba0055da06ab0c73f7be45978",label:"Default",checked:this.isDefault,onToggledChange:this.handleDefaultChange,style:{marginTop:"10px"}})))))}get el(){return a(this)}};x.style=".info-columns{display:flex}.column{width:100px}.toggle-options{display:flex;gap:16px;align-items:center;margin-bottom:16px}";const w=class{constructor(t){e(this,t),this.hiddenActionButtons=[],this.hiddenLabels=[],this.actionButtons=[],this.showAdvancedSearchFeature=!0,this.showFilterColumnFeature=!0,this.showGridOptions=!0,this.showHotlistButton=!1,this.hideExport=!1,this.showInsightsAction=!1,this.enableAdvancedSearch=!0,this.defaultActionButtons=[],this.showLabels=!0,this.hideBar=!1}checkWindowWidth(){const e=window.innerWidth;this.showLabels=e>=1e3}onResize(){this.checkWindowWidth()}componentWillLoad(){this.checkWindowWidth(),this.defaultActionButtons=this.initializeActionButtons(),this.updateHideBar()}componentDidLoad(){window.addEventListener("resize",this.checkWindowWidth.bind(this))}disconnectedCallback(){window.removeEventListener("resize",this.checkWindowWidth.bind(this))}updateHideBar(){const e=this.defaultActionButtons.filter((e=>e.visible));this.hideBar=e.every((e=>this.hiddenActionButtons.includes(e.label)))}initializeActionButtons(){let e=[{icon:l,tooltip:"Save View",label:"Save View",visible:!0,showLabel:!0,iconClassName:"save-icon-class",clickHandler:this.customSaveViewClick},{icon:p,tooltip:"Views",label:"Views",visible:!0,showLabel:!0,iconClassName:"save-icon-class",clickHandler:this.customShowViewClick},{icon:h,tooltip:"Hotlists",label:"Hotlists",visible:!0,showLabel:!0,iconClassName:"save-icon-class",clickHandler:this.customShowHotlistClick},{icon:u,tooltip:"Search",label:"Search",visible:this.enableAdvancedSearch,showLabel:!0,iconClassName:"save-icon-class",clickHandler:this.customShowCustomSearchClick},{icon:m,tooltip:"Refresh",label:"Refresh",visible:!0,showLabel:!0,iconClassName:"save-icon-class",clickHandler:this.customRefreshClick},{icon:d,tooltip:"Clear Search",label:"Clear Search",visible:!0,showLabel:!0,iconClassName:"save-icon-class",clickHandler:this.customClearClick}];return this.hideExport||e.splice(3,0,{icon:f,tooltip:"Export",label:"Export",visible:!0,showLabel:!0,iconClassName:"size-to-fit-icon-class",clickHandler:this.customExportClick}),this.showInsightsAction&&e.splice(this.hideExport?3:4,0,{icon:g,tooltip:"Insights",label:"Insights",visible:!0,showLabel:!0,iconClassName:"save-icon-class",clickHandler:this.customInsightsClick}),this.showHotlistButton||(e=e.filter((e=>"Hotlists"!==e.label))),this.showGridOptions&&e.push({icon:b,tooltip:"Grid Options",label:"Grid Options",visible:!0,showLabel:!1,iconClassName:"save-icon-class",clickHandler:this.customShowGridOptionsClick}),e}handleAdvancedSearchToggle(){this.defaultActionButtons=this.initializeActionButtons()}onHiddenActionButtonsChange(){this.updateHideBar()}render(){return s("div",{key:"021c035bf4d957e2644d1d620c47de8ad1a05e21",class:"header-bar",style:this.hideBar?void 0:{background:"var(--accent-color)"}},s("div",{key:"29e21c1ad5dc3b853c389c4927958335c9299a16",class:"title-section"},s("div",{key:"dd897565107bebd3efff6234f7f01bac7a9afdc6"},s("unity-typography",{key:"51602d8264ed458ba729a0a33b8081babed19d37",variant:"h4"},this.title," ")," ")),s("div",{key:"39d5748807927d63aafb3f99615b57b0f6f856ef",class:"button-section"},s("div",{key:"996c5f28c941dd40531a52abe0c06bcb65ca049e"},s("slot",{key:"06834b580236c4a7ac26b0ed6fc057526dcc4c02"})),this.defaultActionButtons.map((e=>!this.hiddenActionButtons.includes(e.label)&&e.visible?s("stencil-icon-button-grid-action-header",{showLabel:this.showLabels,secondary:e.secondary,icon:e.icon,onClick:t=>{e.clickHandler?e.clickHandler(t):console.log(`${e.label} Clicked but no custom handler defined`)},tooltip:e.tooltip,iconClassName:e.iconClassName},e.icon&&s("i",{class:e.icon}),"save"===e.label.toLowerCase()||!this.hiddenLabels.includes(e.label)&&e.showLabel?s("span",null,e.label):null):null)),this.primaryActionClick&&this.primaryActionLabel&&s("custom-button",{key:"50e0e03c0fc07a095b79c64e9867df14f64b8727",label:this.primaryActionLabel,onClick:e=>this.primaryActionClick(e),size:"tall"},this.primaryActionIcon&&s("udp-icon",{key:"cb521eecb5bca910373e5b3d28d692315f115504",iconName:this.primaryActionIcon,darkIcon:!1}))))}static get watchers(){return{"window:resize":[{onResize:0}],enableAdvancedSearch:[{handleAdvancedSearchToggle:0}],hiddenActionButtons:[{onHiddenActionButtonsChange:0}]}}};w.style=".header-bar{display:flex;justify-content:space-between;align-items:center;width:100%;background:var(--accent-color)}.title-section{flex:1;margin-left:16px;display:flex;gap:16px;align-items:center}.button-section{display:flex;gap:8px;align-items:center;padding-right:16px;padding-top:8px;padding-bottom:8px}";const C=class{constructor(t){e(this,t)}render(){return s("div",{key:"d8a6b07c2aa03300bb9a6e382981ba05658b2458",class:"kpi-container"},this.kpiValues.map(((e,t)=>s("div",{class:"kpi-item"},s("span",{class:"kpi-label",style:{fontSize:" 0.875rem",fontWeight:"300",lineHeight:"0.25",fontFamily:"sans-serif"}}," ",s("unity-typography",null," ",e.label,": ")," "),s("span",{class:"kpi-value",style:{fontSize:" 0.875rem",fontWeight:"600",lineHeight:"0.25",fontFamily:"sans-serif"}}," ",s("unity-typography",null," ",e.value.toLocaleString()," ")," "),t<this.kpiValues.length-1&&s("div",{class:"divider"})))))}};C.style=".kpi-container{display:flex;align-items:center;padding-top:8px;padding-bottom:8px;justify-content:flex-end;padding-right:16px;background-color:rgb(247, 245, 243)}.kpi-item{display:flex;align-items:center}.kpi-label{margin-right:5px;font-weight:700}.kpi-value{margin-left:5px}.divider{border-left:1px solid black;height:20px;margin:0 10px}";const N=class{constructor(t){e(this,t),this.name="",this.isPrivate=2,this.isDefault=!1,this.gridViewId="",this.fetchedCurrentView=!1,this.handleNameChange=e=>{this.name=e.target.value},this.handlePrivateChange=()=>{this.isPrivate=1===this.isPrivate?2:1},this.handleDefaultChange=()=>{this.isDefault=!this.isDefault},this.handleSubmit=()=>{this.handleFormSubmit(this.name,this.isPrivate,this.isDefault),this.resetForm()},this.handleViewUpdate=()=>{this.handleViewAndConfigurationSubmit(this.name,this.isPrivate,this.isDefault)},this.resetForm=()=>{this.name="",this.isPrivate=2,this.isDefault=!1}}handleModalOpen(e){var t,i;e&&(this.name=this.currentName||"",this.isPrivate=null!==(t=this.currentIsPrivate)&&void 0!==t?t:2,this.isDefault=null!==(i=this.currentIsDefault)&&void 0!==i&&i,this.gridViewId=this.currentGridViewId||"")}render(){return s("fluent-dialog",{key:"11d77e271d9052cb0d2dc01ab68a1711ba69341c",open:this.open,actionOne:()=>{this.handleSubmit()},actionTwo:this.closeDialog,actionThree:()=>{this.handleViewUpdate()},handleClose:this.handleClose,labelOne:"Save as Copy",labelTwo:"Cancel",labelThree:"Save View",title:this.title,disableOne:!this.name,buttonThreeHidden:!this.gridViewId},s("form",{key:"ef7e0089370810479fffe5009cd0a44d538ab88c",class:"save-form"},s("text-field",{key:"9321cbc06b7d79f0a5f5068e2a7ddca50ebf434f",label:"View Name",placeholder:"Create a name for your view",value:this.name,onInput:e=>this.handleNameChange(e)}),s("div",{key:"af902e7792f5de7b1d4333c274079f4544211531",class:"toggle-options"},s("div",{key:"0c4f78f6bd0716adb686607d78636cc366fb416d"},s("stencil-toggle",{key:"5a385cd828db721c4716d979b5391760c46925c2",label:"Private",checked:1===this.isPrivate,onToggledChange:this.handlePrivateChange})," "),s("div",{key:"775b8586ca7ac81668d18b76ee1e14082bada271"},s("stencil-toggle",{key:"b870f8bc34e04f93398536096cee79b0734ecdf1",label:"Default",checked:this.isDefault,onToggledChange:this.handleDefaultChange,style:{marginTop:"10px"}})))))}get el(){return a(this)}static get watchers(){return{open:[{handleModalOpen:0}]}}};N.style=".info-columns{display:flex}.column{width:100px}.toggle-options{display:flex;gap:16px;align-items:center;margin-bottom:16px}";const O=class{constructor(t){e(this,t),this.position="left",this.widthOption="long",this.disabled=!1,this.padding=!0,this.buttonTransform="translate(0,0)"}render(){const e="number"==typeof this.widthOption?"custom-width":this.widthOption,t="number"==typeof this.widthOption?{width:`${this.widthOption}px`}:{};return s("div",{key:"493885f8ff6fd42a33d7a91ceeaf2376896e78b9"},s("div",{key:"5f3fc796d16eac33ed3ee5caa591c55074f08b5d",class:{backdrop:!0,open:this.open},onClick:this.toggleDrawer}),s("div",{key:"5d91c44a3dfdef6e6e60dd8bb9932965c0b3c4d6",class:{"side-sheet":!0,open:this.open,close:!this.open,[this.position]:!0,[e]:!0},style:t},s("div",{key:"e585f7cda32111284edd65d43db8034f1fd4a3f1",class:"title"},s("div",{key:"47682a75bc55ea2b3699727e1d8b8005331fa053",class:"close-button"},s("stencil-icon-button",{key:"127217807a38574d7cc17b46f3b3480b1e780628",icon:c,onClick:this.toggleDrawer})),s("div",{key:"6e6ef59d9ae06d64b9b24723fa593a15e8713a89",class:"title"},s("unity-typography",{key:"e58a2a5b8fad9b6cc78fd1ae266d10a54bd70374",variant:"data-display-four"},this.title)),this.sideSheetButtonLabel&&s("custom-button",{key:"709251d45b26fd42dfb08aa3292b9d500184167e",style:{transform:this.buttonTransform},size:"tall",disabled:this.disabled,onCustomClick:()=>this.handleSideSheetButton()},this.sideSheetButtonLabel)),s("side-sheet-container",{key:"5a1321a0b09d030612e4787d1652666351057ffe",padding:this.padding},s("slot",{key:"eab8b1135a509ac45eccc573a5efe6e78efaf54d"}))))}};O.style=".side-sheet{height:100%;position:fixed;z-index:9999;top:0;bottom:0;overflow-x:hidden;overflow-y:hidden;background-color:#ffffff;transition:transform 0.3s ease;scrollbar-width:none;-ms-overflow-style:none;::-webkit-scrollbar{display:none}}.side-sheet.left{left:0;transform:translateX(-100%);}.side-sheet.right{right:0;transform:translateX(100%);}.side-sheet.long{width:1300px}.side-sheet.short{width:480px}.side-sheet.open{transform:translateX(0);}.backdrop{position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0, 0, 0, 0.5);z-index:9;opacity:0;pointer-events:none;transition:opacity 0.5s ease}.backdrop.open{opacity:1;pointer-events:auto}.title{display:flex;flex:1;align-items:center}.close-button{display:flex;align-items:center}.ag-root.ag-layout-normal{font-family:sans-serif !important;font-size:13px}";const j=class{constructor(t){e(this,t),this.name="",this.isPrivate=!1,this.handleNameChange=e=>{this.name=e.target.value},this.handlePrivateChange=()=>{this.isPrivate=!this.isPrivate},this.handleSubmit=e=>{e.preventDefault(),this.handleFormSubmit(this.name,this.isPrivate,this.columnState)},this.onCustomButtonClick=()=>{this.handleFormSubmit(this.name,this.isPrivate,this.columnState)}}render(){return s("div",{key:"25d3ac15ce75e21c38ee581fd6760acd0452cb6b",class:"wrapper"},s("form",{key:"23cb869dcf8111e10d5202ea00f066d64d6e955a",class:"save-form",onSubmit:this.handleSubmit},s("text-field",{key:"aeca29c646c86c96306f8baddc77fdf2d2421f25",label:"Hotlist Name",placeholder:"Create a name for your Hotlist",value:this.name,onChange:e=>this.handleNameChange(e)}),s("stencil-toggle",{key:"f0d4a73109796d9b8cd71cba4057327ad37abd86",label:"Private",checked:this.isPrivate,onToggledChange:this.handlePrivateChange}),s("div",{key:"0dcf360e9189ca180a425d1f3b7530d54db53c17",class:"submit-button"},s("custom-button",{key:"9f12210ec38cf756a601a418e7c4ca0653370fd8",variant:"outline",type:"submit",onCustomClick:this.handleCancelClick},"Cancel"),s("custom-button",{key:"aa24f4f10e50090d46fc0872acf9a350e12a76b2",disabled:!this.name,type:"submit",onCustomClick:this.onCustomButtonClick},"Create List"))))}get el(){return a(this)}};j.style=".submit-button{margin-top:18px;display:flex;justify-content:flex-end;margin-right:24px;gap:8px}.wrapper{border-bottom:1px solid #d9d9d9;padding-bottom:16px;margin-bottom:10px;width:480px}";const $=class{constructor(t){e(this,t),this.userCancel=!1,this.active=!1}activeChanged(e){e&&!this.userCancel&&setTimeout((()=>this.active=!1),3e3)}render(){const e=`status-${this.status}`;return s("div",{key:"cd2d073bfca62c063d4f8df897b848710be57c11",class:{"udp-notification":!0,visible:this.active,[e]:!0}},this.userCancel&&s("button",{key:"61c91bc421b31982330f91f078a24a1d8f6f3204",class:"close-button",onClick:()=>this.active=!1},"×"),s("span",{key:"e43710ce4dee2345953a7fb77f252dce8a1672fe",class:"message"}," ",s("unity-typography",{key:"2ebe60d75278ed5157b339b8679c6bedce322926",variant:"body"}," ",this.message," ")))}static get watchers(){return{active:[{activeChanged:0}]}}};$.style=":host{position:fixed;top:1rem;right:1rem;z-index:1000;display:block;}.udp-notification{min-width:250px;margin:0.5rem;padding:0.5rem 1rem;border-radius:4px;box-shadow:0 2px 10px rgba(0, 0, 0, 0.1);display:flex;align-items:center;justify-content:space-between;transition:transform 0.3s ease-in-out, opacity 0.3s ease-in-out;transform:translateY(-100%);opacity:0;visibility:hidden;background-color:#f4f4f4;}.visible{transform:translateY(0);opacity:1;visibility:visible}.status-success{border-left:4px solid #5aa700;}.status-error{border-left:4px solid #e0182d;}.status-warning{border-left:4px solid #ff832b;}.message{flex:1;padding:0 1rem}.close-button{background:none;border:none;font-size:1.5rem;cursor:pointer}";const L=class{constructor(t){e(this,t),this.isOpen=!1,this.handleClose=e=>{e&&this.el.shadowRoot.contains(e.target)||(this.isOpen=!1,document.removeEventListener("click",this.handleClose))}}componentWillLoad(){this.isOpen&&document.addEventListener("click",this.handleClose),document.removeEventListener("click",this.handleClose)}watchHandler(e){e?document.addEventListener("click",this.handleClose):document.removeEventListener("click",this.handleClose)}render(){const e={display:this.isOpen?"block":"none",position:"absolute",right:"6px"};if(this.anchorElement){const t=this.anchorElement.getBoundingClientRect();e.top=`${t.bottom}px`,e.left=`${t.left}px`}return s("div",{key:"511fb2756ab0c38c04ee500f31e964bfb52672f1",class:"popover",style:e},s("unity-typography",{key:"d0db9b3b955f5cf4429b0176df5b7e98a21c66e9",variant:"caption-text"},s("slot",{key:"8adc31948a622995a141e9d4ff74f28a97af6108"})))}get el(){return a(this)}static get watchers(){return{isOpen:[{watchHandler:0}]}}};L.style=".popover{background-color:white;border:1px solid #ccc;padding:10px;box-shadow:0px 2px 4px rgba(0, 0, 0, 0.1);z-index:1000;position:relative}";const I=class{constructor(t){e(this,t),this.type="info",this.message=""}render(){return s("div",{key:"e100527c51fc69bfdb74ecfba9a3d52d55aad4d6",class:`alert-banner ${this.type}`},s("unity-typography",{key:"ae237651e36d4f1a0f6df444dbd89eead388ab48",variant:"data-display-three"}," ",this.message," "))}};I.style=":host{display:block;width:100%;box-sizing:border-box}.alert-banner{display:flex;align-items:center;justify-content:space-between;padding:5px;padding-left:24px;padding-right:8px;box-sizing:border-box;background-color:var(--success-color-light);color:#000}.banner-group{display:flex;width:500px;}.info{background-color:var(--success-color-light);color:#000}.warning{background-color:var(--warning-color-main);color:#000}.error{background-color:var(--error-color-light);color:#000}.success{background-color:var(--success-color-light);color:#000}.stencil-icon-button{margin-left:auto;}";export{y as advanced_search,v as advanced_search_grouped,k as ag_table,x as edit_view_form_dialog,w as grid_primary_bar,C as kpi_list,N as save_view_form_dialog,O as side_sheet,j as udp_hotlist_form,$ as udp_notification,L as udp_pop_over_grid_action_header,I as upd_alert_banner}
1
+ import{r as e,c as t,f as i,h as s,a}from"./index-DFnjA9NX.js";import{u as o}from"./conversionFunctions-CNWYTvRs.js";import{s as n}from"./catalog-store-CbwcwIKF.js";import c from"@carbon/icons/es/close/24";import{v4 as r}from"uuid";import l from"@carbon/icons/es/save/16";import d from"@carbon/icons/es/close/16";import h from"@carbon/icons/es/list/16";import f from"@carbon/icons/es/download/16";import b from"@carbon/icons/es/settings/16";import p from"@carbon/icons/es/star/16";import u from"@carbon/icons/es/ibm-watson--discovery/16";import g from"@carbon/icons/es/idea/16";import m from"@carbon/icons/es/renew/16";import"@stencil/store";import"./apiUtils-11-yfzUs.js";import"deep-equal";import"./makeApiCall-2umiVB6u.js";import"axios";import"./configService-BqLfkVKh.js";import"./tenantUtils-Basdb1b1.js";const y=class{constructor(s){e(this,s),this.advancedSearchItemChange=t(this,"advancedSearchItemChange"),this.filterList=[],this.filterRenderList=[],this.nestedData=new Map,this.searchObject=[],this.tempNestedData=new Map,this.testData=[],this.showChildren=!1,this.handleReferenceClick=async(e,t,i,s,a,c)=>{if(console.log("Clicked reference:",e,"Name:",t,"Parent Reference:",i,"parentFilter",s,"parent reference click test",a,c),!n.isLoadingCatalogData&&null!==n.catalogData)try{const i=await o(n.catalogData,e,!0,!0,t,s,a);Array.isArray(i)?this.updateNestedData(i):console.error("Extended search filter list is not an array")}catch(e){console.error("Error fetching filters:",e)}},this.updateNestedData=e=>{if(!Array.isArray(e)||0===e.length)return void console.error("Invalid or empty children data provided for updateNestedData");const t=e[0].extendedProperties.parent,s=o(n.catalogData,e[0].extendedProperties.fromFilter,!0,!0,name,"","");s&&s.forEach((i=>{i.name===t?i.referenceNode=e:i.reference&&i.referenceNode&&this.updateNestedDataRecursively(i.referenceNode,e,t)}));const a=(e,t,i)=>e.map((e=>{if(e.name===i){const i=t.filter((t=>!((e,t)=>e.some((e=>e.name===t.name)))(e.referenceNode||[],t)));return Object.assign(Object.assign({},e),{referenceNode:[...e.referenceNode||[],...i]})}return e.referenceNode?Object.assign(Object.assign({},e),{referenceNode:a(e.referenceNode,t,i)}):e}));this.testData=a(this.testData,e,t),i(this)},this.updateNestedDataRecursively=(e,t,i)=>{e.forEach((e=>{e.name===i?e.referenceNode=t:e.referenceNode&&this.updateNestedDataRecursively(e.referenceNode,t,i)}))},this.onTreeListItemClick=e=>{const t=e.detail;t.searchField=t.parentName&&t.parentPath?`${t.parentPath}.${t.parentName}.${t.searchField}`:t.parentName?`${t.parentName}.${t.searchField}`:`${t.searchField}`,t.searchField=t.searchField.split(".").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join("."),this.handleItemClick(t)}}componentWillLoad(){}filterListWatcher(e,t){e!==t&&(this.testData=e)}render(){const e=Array.isArray(this.testData)?this.testData:[],t=Array.isArray(this.filterRenderList)?this.filterRenderList:[];return s("div",{key:"749ac603c7d5998cab9cdc804eb26ae15ab9502c",class:"container"},s("div",{key:"19b11ac5eed4ebff194a2489bc647abfca3ee6bb",class:"left-column"},!e.length&&s("div",{key:"d6b693fca77ee5d6db78540dc218d70cd9558851",style:{marginRight:"8px"}},s("udp-grid-loader",{key:"4d1384371f5de5ee8f5eff618aaaaa4d20ccdf0a",width:"362px","num-columns":"1","num-rows":"20"})),s("div",{key:"e9e277276dffb7163b9df189945c25ebfcc7246e"},e.map(((e,t)=>{var i;return s("tree-list-item",{key:`${e.name}-${t}`,level:0,label:this.getHeaderFieldLabel(e.name),fieldName:e.name,reference:e.reference,parentName:"",parentFilter:e.extendedProperties.parentFilter,parentPath:"filter.extendedProperties.parentPath",parent:null===(i=e.extendedProperties)||void 0===i?void 0:i.parent,nestedItems:e.referenceNode,"onReference-clicked":e=>this.handleReferenceClick(e.detail.reference,e.detail.name,e.detail.parentReference,e.detail.parentFilter,e.detail.parent,e.detail.parentPath),onItemClick:this.onTreeListItemClick})})))),s("div",{key:"85759f73d86b502052e61f2d8b465e3498967566",class:"right-column"},s("udp-page-header",{key:"a825cfd6fdfec752270bd24b48512185a49f3ee9",onValueChanged:this.handleValueChanged}),s("filter-conditions",{key:"22a0cfe66f0ab58a87e4a51aec2694d34a37fb49"}),t.map((e=>e.filterElements.map(((e,t)=>{var i;return s("search-list-item",{key:`${e.searchField}-${t}`,label:null!==(i=null==e?void 0:e.searchLabel)&&void 0!==i?i:e.searchField,fieldName:e.searchField,handleDelete:()=>this.handleDelete({searchField:e.searchField,searchValue:e.searchValue}),name:e.searchValue})}))))))}static get watchers(){return{filterList:[{filterListWatcher:0}]}}};y.style=':host{display:block;height:100%}.container{display:flex;height:100vh}.left-column{flex:1;background-color:white;height:90vh;overflow:scroll;padding:8px}.right-column{flex:2;margin-left:16px;padding:16px;height:90vh;overflow:scroll}.filter-group[data-level="0"]{padding-left:0}.filter-group[data-level="1"]{padding-left:20px}.filter-group[data-level="2"]{padding-left:40px}.filter-group{margin-top:24px;border-left:1px solid #bababa}.search-input-list{height:100%;max-height:70vh;overflow:auto}.recent-searches{min-width:300px;margin-bottom:10px}';const v=class{constructor(s){e(this,s),this.advancedSearchItemChange=t(this,"advancedSearchItemChange"),this.searchItemChanged=t(this,"searchItemChanged"),this.searchOperatorChanged=t(this,"searchOperatorChanged"),this.filterList=[],this.filterRenderList=[],this.nestedData=new Map,this.searchObject=[],this.tempNestedData=new Map,this.testData=[],this.showChildren=!1,this.filterGroups=[],this.filterObjectsWithGroups=[],this.disableFilterSelection=!0,this.sharedId="",this.filters=[],this.recentSearchesOptions=[],this.handleReferenceClick=async(e,t,i,s,a,c)=>{if(console.log("Clicked reference:",e,"Name:",t,"Parent Reference:",i,"parentFilter",s,"parent reference click test",a,c),n.isLoadingCatalogData||null===n.catalogData)console.log("Catalog data is not ready yet.");else try{console.log("state.catalogData",n.catalogData);const i=await o(n.catalogData,e,!0,!0,t,s,a);console.log("extendedSearchFilterList",i),Array.isArray(i)?this.updateNestedData(i):console.error("Extended search filter list is not an array"),console.log("Updated nestedData:",Array.from(this.nestedData.entries()))}catch(e){console.error("Error fetching filters:",e)}},this.updateNestedData=e=>{if(!Array.isArray(e)||0===e.length)return void console.error("Invalid or empty children data provided for updateNestedData");console.log("children in updatedNest",e);const t=e[0].extendedProperties.parent,s=o(n.catalogData,e[0].extendedProperties.fromFilter,!0,!0,name,"","");console.log("testParentArray",s),s&&s.forEach((i=>{i.name===t?(i.referenceNode=e,console.log("add referenceNode array",e,s)):i.reference&&i.referenceNode&&this.updateNestedDataRecursively(i.referenceNode,e,t)}));const a=(e,t,i)=>e.map((e=>{if(e.name===i){const i=t.filter((t=>!((e,t)=>e.some((e=>e.name===t.name)))(e.referenceNode||[],t)));return Object.assign(Object.assign({},e),{referenceNode:[...e.referenceNode||[],...i]})}return e.referenceNode?Object.assign(Object.assign({},e),{referenceNode:a(e.referenceNode,t,i)}):e}));this.testData=a(this.testData,e,t),console.log("Updated testData",this.testData),i(this)},this.updateNestedDataRecursively=(e,t,i)=>{e.forEach((e=>{e.name===i?e.referenceNode=t:e.referenceNode&&this.updateNestedDataRecursively(e.referenceNode,t,i)}))},this.onTreeListItemClick=e=>{const t=e.detail;console.log("Tree list item clicked in grouped:",t),t.searchField=t.parentName&&t.parentPath?`${t.parentPath}.${t.parentName}.${t.searchField}`:t.parentName?`${t.parentName}.${t.searchField}`:`${t.searchField}`,t.searchField=t.searchField.split(".").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join("."),this.handleItemClick(t),this.disableFilterSelection=!0},this.currentLogicalOperator="AND"}componentWillLoad(){}filterListWatcher(e,t){e!==t&&(this.testData=e)}filterObjectsWithGroupsChanged(e,t){}updateFilterWithUserData(e,t){const i=this.filters.map((i=>i.id===e?Object.assign(Object.assign({},i),t):i));this.filters=i}updateGroupLogicalOperator(e,t){const i=(e,t,s)=>{for(const a of e){if(a.id===t)return a.logicalOperator=s,!0;if(a.children&&i(a.children,t,s))return!0}return!1};i(this.filterObjectsWithGroups,e,t)&&(this.filterObjectsWithGroups=[...this.filterObjectsWithGroups])}handleSearchItemChange(e){const{searchOperator:t,searchValue:i,filterGroupId:s,id:a}=e.detail,o=this.findGroupById(this.filterObjectsWithGroups,s);if(o){const e=o.filters.find((e=>e.id===a));e&&(e.searchOperator=t,e.searchValue=i,this.filterObjectsWithGroups=[...this.filterObjectsWithGroups])}this.searchItemChanged.emit(e.detail)}handleOperatorSelected(e,t){const i=this.getLogicalOperatorValue(e.detail.value);this.updateLogicalOperator(t,i),this.searchOperatorChanged.emit()}renderFilterGroup(e,t=0){const i="root"===e.id,a="default"===e.id,o={"padding-left":20*t+"px"},n=this.getLogicalOperatorCode(e.logicalOperator).toString(),r=s("udp-selector",{options:[{value:"1",label:"AND"},{value:"2",label:"OR"}],onChange:t=>this.handleOperatorSelected(t,e.filterGroupId),initialValue:n,disabled:i||a}),l=!i&&!a&&s("stencil-icon-button",{icon:c,onClick:()=>this.handleGroupDelete(e.filterGroupId)}),d=!i&&s("div",{class:"search-input-list"},e.filters.map(((e,t)=>{var i;return s("search-list-item",{key:`${e.id}-${t}`,isDefault:a,id:e.id,filterGroupId:e.filterGroupId,label:null!==(i=null==e?void 0:e.searchLabel)&&void 0!==i?i:e.searchField,fieldName:e.searchField,handleDelete:()=>this.handleDelete(e),name:e.searchValue,operator:e.searchOperator,onSearchItemChanged:e=>this.handleSearchItemChange(e),isInitialSearchItem:e.isInitialFilterElement})}))),h=!a&&s("div",{style:{display:"flex",gap:"8px",marginTop:"8px"}},!i&&s("custom-button",{variant:"outline",onClick:()=>this.addFilter(e.id,e.filterGroupId)},"+ Field"),s("custom-button",{variant:"outline",onClick:()=>this.handleAddNewGroup(i?"root":e.id,this.currentLogicalOperator)},"+ Group")),f=s("div",{class:"nested-groups"},(e.children||[]).map((e=>this.renderFilterGroup(e,t+1))));return s("div",{class:!i&&"filter-group",style:o},a&&0===e.filters.length?null:s("div",{style:{marginBottom:"16px"}},s("div",{style:{display:"flex",gap:"8px"}},r,l)),d,h,f)}addFilter(e,t){console.log("Adding filter..."),this.disableFilterSelection=!1,this.handleAddNewFilter&&this.handleAddNewFilter(t);const i={id:r(),groupId:e,filterGroupId:t,searchField:"",searchOperator:"=",searchValue:""};this.filters=[...this.filters,i]}render(){const e=Array.isArray(this.testData)?this.testData:[];return s("div",{key:"1d8d31637f4bff92f39d3fafddbcadc483b05b4a",class:"container"},s("div",{key:"3f35b059f1942e509871b617d7c76b6d11a7ae20",class:"left-column"},null!==this.selectRecentSearch&&null!==this.fullClearSearch&&s("div",{key:"07565a0d936a333ee8d1b6988ad603ef1442118d",class:"recent-searches"},"Recent Searches",s("div",{key:"d1f55b937654dd403cc01aebcb5e4467b95b26a5",style:{display:"flex",alignItems:"center"}},s("udp-selector",{key:"84d76292d5bed0273ea0625e25bd191dbf4a7ce7",options:this.recentSearchesOptions,onChange:e=>this.selectRecentSearch(e),style:{marginRight:"10px"}}),s("udp-function-button",{key:"ba4158888de93d98f75c9323bbccdc2801df4dd1",delete:!0,onClick:this.fullClearSearch}))),!e.length&&s("div",{key:"c372142871a8a4ab122ee92b1927003cdeb62887",style:{marginRight:"8px"}},s("udp-grid-loader",{key:"6469fa2ce8230c4542c452eea98ebd948ef0c0ff",width:"362px","num-columns":"1","num-rows":"20"})),s("div",{key:"9a66fd98df829c4896be3ede68252b07825a8277"},e.map(((e,t)=>{var i;return s("tree-list-item",{add:!0,showAdd:!0,key:`${e.name}-${t}`,level:0,label:this.getHeaderFieldLabel(e.name),fieldName:e.name,reference:e.reference,parentName:"",parentFilter:e.extendedProperties.parentFilter,parentPath:"filter.extendedProperties.parentPath",parent:null===(i=e.extendedProperties)||void 0===i?void 0:i.parent,nestedItems:e.referenceNode,"onReference-clicked":e=>this.handleReferenceClick(e.detail.reference,e.detail.name,e.detail.parentReference,e.detail.parentFilter,e.detail.parent,e.detail.parentPath),onItemClick:this.onTreeListItemClick})})))),s("div",{key:"0bfe019eb27dfdaa509c2556d114373cfd00c2c5",class:"right-column"},this.filterObjectsWithGroups.map((e=>this.renderFilterGroup(e)))),this.disableFilterSelection&&s("div",{key:"bd69af7520cf0e0e300f13eb2256269f8229ed0c",style:{width:"411px",height:"100vh",background:"white",position:"absolute",zIndex:"9",top:"45px",left:"px",opacity:"0.7"}}))}get el(){return a(this)}static get watchers(){return{filterList:[{filterListWatcher:0}],filterObjectsWithGroups:[{filterObjectsWithGroupsChanged:0}]}}};v.style=':host{display:block;height:100%}.container{display:flex;height:100vh}.left-column{flex:1;background-color:white;height:90vh;overflow:scroll;padding:8px}.right-column{flex:2;margin-left:16px;padding:16px;height:90vh;overflow:scroll}.filter-group[data-level="0"]{padding-left:0}.filter-group[data-level="1"]{padding-left:20px}.filter-group[data-level="2"]{padding-left:40px}.filter-group{margin-top:24px;border-left:1px solid #bababa}.search-input-list{height:100%;max-height:70vh;overflow:auto}.recent-searches{min-width:300px;margin-bottom:10px}';const k=class{constructor(t){e(this,t),this.height="calc(100vh - 200px)"}render(){return s("div",{key:"34090f535edf4f45e28eeacd5ab8da4012319dfd",id:"myGrid",style:{height:this.height,width:"100%"},class:"ag-theme-material"})}get el(){return a(this)}},x=class{constructor(t){e(this,t),this.name="",this.isPrivate=2,this.isDefault=!1,this.fetchedCurrentView=!1,this.handleGetExistingView=()=>{this.isPrivate=this.currentGridViewVisibilityTypeId,this.isDefault=this.currentIsDefault,console.log("isPrivate:",this.isPrivate,"isDefault:",this.isDefault),this.fetchedCurrentView=!0},this.handleNameChange=e=>{this.currentName=e.target.value,this.name=e.target.value},this.handlePrivateChange=()=>{this.isPrivate=1===this.isPrivate?2:1,this.currentGridViewVisibilityTypeId=1===this.currentGridViewVisibilityTypeId?2:1,console.log(this.isPrivate)},this.handleDefaultChange=()=>{this.isDefault=!this.isDefault,this.currentIsDefault=!this.currentIsDefault,console.log(this.isDefault)},this.handleSubmit=()=>{this.handleFormSubmit(this.gridId,this.name,this.isPrivate,this.isDefault)}}componentDidUpdate(){this.open&&this.handleGetExistingView()}componentWillRender(){this.name=this.currentName,this.gridId=this.currentGridId}resetFetchedCurrentView(){this.fetchedCurrentView=!1}render(){return s("fluent-dialog",{key:"148710ea0f7bea0484e3f84e862d0b9123bd79ac",open:this.open,actionOne:()=>{this.handleSubmit(),this.closeDialog(),this.resetFetchedCurrentView()},actionTwo:()=>{this.closeDialog(),this.resetFetchedCurrentView()},handleClose:this.handleClose,labelOne:"Save Update",labelTwo:"Cancel",title:this.title,disableOne:!this.name},s("form",{key:"743aa9a972a90176eb5458405f13cdea3ee56942",class:"edit-form"},s("text-field",{key:"b69c3ea8fa67eeb996ce7f92a9266aebd33cbcc5",label:"View Name",value:this.name,onInput:e=>this.handleNameChange(e)}),this.fetchedCurrentView&&s("div",{key:"7a887a7530065a3c639dfcc66b1d9e5b00b25090",class:"toggle-options"},s("div",{key:"60db77820677f5231298264162821c12f6a07c11"},s("stencil-toggle",{key:"3bda1b0d33a183bbb901aa4dd52dceb377585829",label:"Private",checked:1===this.isPrivate,onToggledChange:this.handlePrivateChange})," "),s("div",{key:"855ecc8457827f4188304177961d361747f5df19"},s("stencil-toggle",{key:"eae91f81bd56d29ba0055da06ab0c73f7be45978",label:"Default",checked:this.isDefault,onToggledChange:this.handleDefaultChange,style:{marginTop:"10px"}})))))}get el(){return a(this)}};x.style=".info-columns{display:flex}.column{width:100px}.toggle-options{display:flex;gap:16px;align-items:center;margin-bottom:16px}";const w=class{constructor(t){e(this,t),this.hiddenActionButtons=[],this.hiddenLabels=[],this.actionButtons=[],this.showAdvancedSearchFeature=!0,this.showFilterColumnFeature=!0,this.showGridOptions=!0,this.showHotlistButton=!1,this.hideExport=!1,this.showInsightsAction=!1,this.enableAdvancedSearch=!0,this.defaultActionButtons=[],this.showLabels=!0,this.hideBar=!1}checkWindowWidth(){const e=window.innerWidth;this.showLabels=e>=1e3}onResize(){this.checkWindowWidth()}componentWillLoad(){this.checkWindowWidth(),this.defaultActionButtons=this.initializeActionButtons(),this.updateHideBar()}componentDidLoad(){window.addEventListener("resize",this.checkWindowWidth.bind(this))}disconnectedCallback(){window.removeEventListener("resize",this.checkWindowWidth.bind(this))}updateHideBar(){const e=this.defaultActionButtons.filter((e=>e.visible));this.hideBar=e.every((e=>this.hiddenActionButtons.includes(e.label)))}initializeActionButtons(){let e=[{icon:l,tooltip:"Save View",label:"Save View",visible:!0,showLabel:!0,iconClassName:"save-icon-class",clickHandler:this.customSaveViewClick},{icon:p,tooltip:"Views",label:"Views",visible:!0,showLabel:!0,iconClassName:"save-icon-class",clickHandler:this.customShowViewClick},{icon:h,tooltip:"Hotlists",label:"Hotlists",visible:!0,showLabel:!0,iconClassName:"save-icon-class",clickHandler:this.customShowHotlistClick},{icon:u,tooltip:"Search",label:"Search",visible:this.enableAdvancedSearch,showLabel:!0,iconClassName:"save-icon-class",clickHandler:this.customShowCustomSearchClick},{icon:m,tooltip:"Refresh",label:"Refresh",visible:!0,showLabel:!0,iconClassName:"save-icon-class",clickHandler:this.customRefreshClick},{icon:d,tooltip:"Clear Search",label:"Clear Search",visible:!0,showLabel:!0,iconClassName:"save-icon-class",clickHandler:this.customClearClick}];return this.hideExport||e.splice(3,0,{icon:f,tooltip:"Export",label:"Export",visible:!0,showLabel:!0,iconClassName:"size-to-fit-icon-class",clickHandler:this.customExportClick}),this.showInsightsAction&&e.splice(this.hideExport?3:4,0,{icon:g,tooltip:"Insights",label:"Insights",visible:!0,showLabel:!0,iconClassName:"save-icon-class",clickHandler:this.customInsightsClick}),this.showHotlistButton||(e=e.filter((e=>"Hotlists"!==e.label))),this.showGridOptions&&e.push({icon:b,tooltip:"Grid Options",label:"Grid Options",visible:!0,showLabel:!1,iconClassName:"save-icon-class",clickHandler:this.customShowGridOptionsClick}),e}handleAdvancedSearchToggle(){this.defaultActionButtons=this.initializeActionButtons()}onHiddenActionButtonsChange(){this.updateHideBar()}render(){return s("div",{key:"021c035bf4d957e2644d1d620c47de8ad1a05e21",class:"header-bar",style:this.hideBar?void 0:{background:"var(--accent-color)"}},s("div",{key:"29e21c1ad5dc3b853c389c4927958335c9299a16",class:"title-section"},s("div",{key:"dd897565107bebd3efff6234f7f01bac7a9afdc6"},s("unity-typography",{key:"51602d8264ed458ba729a0a33b8081babed19d37",variant:"h4"},this.title," ")," ")),s("div",{key:"39d5748807927d63aafb3f99615b57b0f6f856ef",class:"button-section"},s("div",{key:"996c5f28c941dd40531a52abe0c06bcb65ca049e"},s("slot",{key:"06834b580236c4a7ac26b0ed6fc057526dcc4c02"})),this.defaultActionButtons.map((e=>!this.hiddenActionButtons.includes(e.label)&&e.visible?s("stencil-icon-button-grid-action-header",{showLabel:this.showLabels,secondary:e.secondary,icon:e.icon,onClick:t=>{e.clickHandler?e.clickHandler(t):console.log(`${e.label} Clicked but no custom handler defined`)},tooltip:e.tooltip,iconClassName:e.iconClassName},e.icon&&s("i",{class:e.icon}),"save"===e.label.toLowerCase()||!this.hiddenLabels.includes(e.label)&&e.showLabel?s("span",null,e.label):null):null)),this.primaryActionClick&&this.primaryActionLabel&&s("custom-button",{key:"50e0e03c0fc07a095b79c64e9867df14f64b8727",label:this.primaryActionLabel,onClick:e=>this.primaryActionClick(e),size:"tall"},this.primaryActionIcon&&s("udp-icon",{key:"cb521eecb5bca910373e5b3d28d692315f115504",iconName:this.primaryActionIcon,darkIcon:!1}))))}static get watchers(){return{"window:resize":[{onResize:0}],enableAdvancedSearch:[{handleAdvancedSearchToggle:0}],hiddenActionButtons:[{onHiddenActionButtonsChange:0}]}}};w.style=".header-bar{display:flex;justify-content:space-between;align-items:center;width:100%;background:var(--accent-color)}.title-section{flex:1;margin-left:16px;display:flex;gap:16px;align-items:center}.button-section{display:flex;gap:8px;align-items:center;padding-right:16px;padding-top:8px;padding-bottom:8px}";const C=class{constructor(t){e(this,t)}render(){return s("div",{key:"d8a6b07c2aa03300bb9a6e382981ba05658b2458",class:"kpi-container"},this.kpiValues.map(((e,t)=>s("div",{class:"kpi-item"},s("span",{class:"kpi-label",style:{fontSize:" 0.875rem",fontWeight:"300",lineHeight:"0.25",fontFamily:"sans-serif"}}," ",s("unity-typography",null," ",e.label,": ")," "),s("span",{class:"kpi-value",style:{fontSize:" 0.875rem",fontWeight:"600",lineHeight:"0.25",fontFamily:"sans-serif"}}," ",s("unity-typography",null," ",e.value.toLocaleString()," ")," "),t<this.kpiValues.length-1&&s("div",{class:"divider"})))))}};C.style=".kpi-container{display:flex;align-items:center;padding-top:8px;padding-bottom:8px;justify-content:flex-end;padding-right:16px;background-color:rgb(247, 245, 243)}.kpi-item{display:flex;align-items:center}.kpi-label{margin-right:5px;font-weight:700}.kpi-value{margin-left:5px}.divider{border-left:1px solid black;height:20px;margin:0 10px}";const N=class{constructor(t){e(this,t),this.name="",this.isPrivate=2,this.isDefault=!1,this.gridViewId="",this.fetchedCurrentView=!1,this.handleNameChange=e=>{this.name=e.target.value},this.handlePrivateChange=()=>{this.isPrivate=1===this.isPrivate?2:1},this.handleDefaultChange=()=>{this.isDefault=!this.isDefault},this.handleSubmit=()=>{this.handleFormSubmit(this.name,this.isPrivate,this.isDefault),this.resetForm()},this.handleViewUpdate=()=>{this.handleViewAndConfigurationSubmit(this.name,this.isPrivate,this.isDefault)},this.resetForm=()=>{this.name="",this.isPrivate=2,this.isDefault=!1}}handleModalOpen(e){var t,i;e&&(this.name=this.currentName||"",this.isPrivate=null!==(t=this.currentIsPrivate)&&void 0!==t?t:2,this.isDefault=null!==(i=this.currentIsDefault)&&void 0!==i&&i,this.gridViewId=this.currentGridViewId||"")}render(){return s("fluent-dialog",{key:"11d77e271d9052cb0d2dc01ab68a1711ba69341c",open:this.open,actionOne:()=>{this.handleSubmit()},actionTwo:this.closeDialog,actionThree:()=>{this.handleViewUpdate()},handleClose:this.handleClose,labelOne:"Save as Copy",labelTwo:"Cancel",labelThree:"Save View",title:this.title,disableOne:!this.name,buttonThreeHidden:!this.gridViewId},s("form",{key:"ef7e0089370810479fffe5009cd0a44d538ab88c",class:"save-form"},s("text-field",{key:"9321cbc06b7d79f0a5f5068e2a7ddca50ebf434f",label:"View Name",placeholder:"Create a name for your view",value:this.name,onInput:e=>this.handleNameChange(e)}),s("div",{key:"af902e7792f5de7b1d4333c274079f4544211531",class:"toggle-options"},s("div",{key:"0c4f78f6bd0716adb686607d78636cc366fb416d"},s("stencil-toggle",{key:"5a385cd828db721c4716d979b5391760c46925c2",label:"Private",checked:1===this.isPrivate,onToggledChange:this.handlePrivateChange})," "),s("div",{key:"775b8586ca7ac81668d18b76ee1e14082bada271"},s("stencil-toggle",{key:"b870f8bc34e04f93398536096cee79b0734ecdf1",label:"Default",checked:this.isDefault,onToggledChange:this.handleDefaultChange,style:{marginTop:"10px"}})))))}get el(){return a(this)}static get watchers(){return{open:[{handleModalOpen:0}]}}};N.style=".info-columns{display:flex}.column{width:100px}.toggle-options{display:flex;gap:16px;align-items:center;margin-bottom:16px}";const O=class{constructor(t){e(this,t),this.position="left",this.widthOption="long",this.disabled=!1,this.padding=!0,this.buttonTransform="translate(0,0)"}render(){const e="number"==typeof this.widthOption?"custom-width":this.widthOption,t="number"==typeof this.widthOption?{width:`${this.widthOption}px`}:{};return s("div",{key:"493885f8ff6fd42a33d7a91ceeaf2376896e78b9"},s("div",{key:"5f3fc796d16eac33ed3ee5caa591c55074f08b5d",class:{backdrop:!0,open:this.open},onClick:this.toggleDrawer}),s("div",{key:"5d91c44a3dfdef6e6e60dd8bb9932965c0b3c4d6",class:{"side-sheet":!0,open:this.open,close:!this.open,[this.position]:!0,[e]:!0},style:t},s("div",{key:"e585f7cda32111284edd65d43db8034f1fd4a3f1",class:"title"},s("div",{key:"47682a75bc55ea2b3699727e1d8b8005331fa053",class:"close-button"},s("stencil-icon-button",{key:"127217807a38574d7cc17b46f3b3480b1e780628",icon:c,onClick:this.toggleDrawer})),s("div",{key:"6e6ef59d9ae06d64b9b24723fa593a15e8713a89",class:"title"},s("unity-typography",{key:"e58a2a5b8fad9b6cc78fd1ae266d10a54bd70374",variant:"data-display-four"},this.title)),this.sideSheetButtonLabel&&s("custom-button",{key:"709251d45b26fd42dfb08aa3292b9d500184167e",style:{transform:this.buttonTransform},size:"tall",disabled:this.disabled,onCustomClick:()=>this.handleSideSheetButton()},this.sideSheetButtonLabel)),s("side-sheet-container",{key:"5a1321a0b09d030612e4787d1652666351057ffe",padding:this.padding},s("slot",{key:"eab8b1135a509ac45eccc573a5efe6e78efaf54d"}))))}};O.style=".side-sheet{height:100%;position:fixed;z-index:9999;top:0;bottom:0;overflow-x:hidden;overflow-y:hidden;background-color:#ffffff;transition:transform 0.3s ease;scrollbar-width:none;-ms-overflow-style:none;::-webkit-scrollbar{display:none}}.side-sheet.left{left:0;transform:translateX(-100%);}.side-sheet.right{right:0;transform:translateX(100%);}.side-sheet.long{width:1300px}.side-sheet.short{width:480px}.side-sheet.open{transform:translateX(0);}.backdrop{position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0, 0, 0, 0.5);z-index:9;opacity:0;pointer-events:none;transition:opacity 0.5s ease}.backdrop.open{opacity:1;pointer-events:auto}.title{display:flex;flex:1;align-items:center}.close-button{display:flex;align-items:center}.ag-root.ag-layout-normal{font-family:sans-serif !important;font-size:13px}";const j=class{constructor(t){e(this,t),this.name="",this.isPrivate=!1,this.handleNameChange=e=>{this.name=e.target.value},this.handlePrivateChange=()=>{this.isPrivate=!this.isPrivate},this.handleSubmit=e=>{e.preventDefault(),this.handleFormSubmit(this.name,this.isPrivate,this.columnState)},this.onCustomButtonClick=()=>{this.handleFormSubmit(this.name,this.isPrivate,this.columnState)}}render(){return s("div",{key:"25d3ac15ce75e21c38ee581fd6760acd0452cb6b",class:"wrapper"},s("form",{key:"23cb869dcf8111e10d5202ea00f066d64d6e955a",class:"save-form",onSubmit:this.handleSubmit},s("text-field",{key:"aeca29c646c86c96306f8baddc77fdf2d2421f25",label:"Hotlist Name",placeholder:"Create a name for your Hotlist",value:this.name,onChange:e=>this.handleNameChange(e)}),s("stencil-toggle",{key:"f0d4a73109796d9b8cd71cba4057327ad37abd86",label:"Private",checked:this.isPrivate,onToggledChange:this.handlePrivateChange}),s("div",{key:"0dcf360e9189ca180a425d1f3b7530d54db53c17",class:"submit-button"},s("custom-button",{key:"9f12210ec38cf756a601a418e7c4ca0653370fd8",variant:"outline",type:"submit",onCustomClick:this.handleCancelClick},"Cancel"),s("custom-button",{key:"aa24f4f10e50090d46fc0872acf9a350e12a76b2",disabled:!this.name,type:"submit",onCustomClick:this.onCustomButtonClick},"Create List"))))}get el(){return a(this)}};j.style=".submit-button{margin-top:18px;display:flex;justify-content:flex-end;margin-right:24px;gap:8px}.wrapper{border-bottom:1px solid #d9d9d9;padding-bottom:16px;margin-bottom:10px;width:480px}";const $=class{constructor(t){e(this,t),this.userCancel=!1,this.active=!1}activeChanged(e){e&&!this.userCancel&&setTimeout((()=>this.active=!1),3e3)}render(){const e=`status-${this.status}`;return s("div",{key:"cd2d073bfca62c063d4f8df897b848710be57c11",class:{"udp-notification":!0,visible:this.active,[e]:!0}},this.userCancel&&s("button",{key:"61c91bc421b31982330f91f078a24a1d8f6f3204",class:"close-button",onClick:()=>this.active=!1},"×"),s("span",{key:"e43710ce4dee2345953a7fb77f252dce8a1672fe",class:"message"}," ",s("unity-typography",{key:"2ebe60d75278ed5157b339b8679c6bedce322926",variant:"body"}," ",this.message," ")))}static get watchers(){return{active:[{activeChanged:0}]}}};$.style=":host{position:fixed;top:1rem;right:1rem;z-index:1000;display:block;}.udp-notification{min-width:250px;margin:0.5rem;padding:0.5rem 1rem;border-radius:4px;box-shadow:0 2px 10px rgba(0, 0, 0, 0.1);display:flex;align-items:center;justify-content:space-between;transition:transform 0.3s ease-in-out, opacity 0.3s ease-in-out;transform:translateY(-100%);opacity:0;visibility:hidden;background-color:#f4f4f4;}.visible{transform:translateY(0);opacity:1;visibility:visible}.status-success{border-left:4px solid #5aa700;}.status-error{border-left:4px solid #e0182d;}.status-warning{border-left:4px solid #ff832b;}.message{flex:1;padding:0 1rem}.close-button{background:none;border:none;font-size:1.5rem;cursor:pointer}";const I=class{constructor(t){e(this,t),this.isOpen=!1,this.handleClose=e=>{e&&this.el.shadowRoot.contains(e.target)||(this.isOpen=!1,document.removeEventListener("click",this.handleClose))}}componentWillLoad(){this.isOpen&&document.addEventListener("click",this.handleClose),document.removeEventListener("click",this.handleClose)}watchHandler(e){e?document.addEventListener("click",this.handleClose):document.removeEventListener("click",this.handleClose)}render(){const e={display:this.isOpen?"block":"none",position:"absolute",right:"6px"};if(this.anchorElement){const t=this.anchorElement.getBoundingClientRect();e.top=`${t.bottom}px`,e.left=`${t.left}px`}return s("div",{key:"511fb2756ab0c38c04ee500f31e964bfb52672f1",class:"popover",style:e},s("unity-typography",{key:"d0db9b3b955f5cf4429b0176df5b7e98a21c66e9",variant:"caption-text"},s("slot",{key:"8adc31948a622995a141e9d4ff74f28a97af6108"})))}get el(){return a(this)}static get watchers(){return{isOpen:[{watchHandler:0}]}}};I.style=".popover{background-color:white;border:1px solid #ccc;padding:10px;box-shadow:0px 2px 4px rgba(0, 0, 0, 0.1);z-index:1000;position:relative}";const L=class{constructor(t){e(this,t),this.type="info",this.message=""}render(){return s("div",{key:"e100527c51fc69bfdb74ecfba9a3d52d55aad4d6",class:`alert-banner ${this.type}`},s("unity-typography",{key:"ae237651e36d4f1a0f6df444dbd89eead388ab48",variant:"data-display-three"}," ",this.message," "))}};L.style=":host{display:block;width:100%;box-sizing:border-box}.alert-banner{display:flex;align-items:center;justify-content:space-between;padding:5px;padding-left:24px;padding-right:8px;box-sizing:border-box;background-color:var(--success-color-light);color:#000}.banner-group{display:flex;width:500px;}.info{background-color:var(--success-color-light);color:#000}.warning{background-color:var(--warning-color-main);color:#000}.error{background-color:var(--error-color-light);color:#000}.success{background-color:var(--success-color-light);color:#000}.stencil-icon-button{margin-left:auto;}";export{y as advanced_search,v as advanced_search_grouped,k as ag_table,x as edit_view_form_dialog,w as grid_primary_bar,C as kpi_list,N as save_view_form_dialog,O as side_sheet,j as udp_hotlist_form,$ as udp_notification,I as udp_pop_over_grid_action_header,L as upd_alert_banner}
@@ -1 +1 @@
1
- import{h as i,r as t,c as e,a as o,H as s}from"./index-DFnjA9NX.js";import{ModuleRegistry as n,themeQuartz as a,createGrid as r}from"ag-grid-community-v33";import{AllEnterpriseModule as c,LicenseManager as d}from"ag-grid-enterprise-v33";import{x as l,i as h,s as u,u as p,p as b,y as m,w as v,o as g}from"./apiUtils-cUHs50y0.js";import{g as f}from"./iconUtils-DcPvHO4A.js";import{g as y}from"./getCurrentApiCatalogId-DeurXd9l.js";import{C as x}from"./configService-BqLfkVKh.js";import{g as k}from"./tenantUtils-Basdb1b1.js";import{S as w,I as C,D as _,C as S,A as O}from"./currency-renderer-D6zBtP2s.js";import{c as N}from"./configureUdpColumnMods-CoCTzhve.js";import j from"lodash/isEqual";import"deep-equal";import"./makeApiCall-B-daVutk.js";import"axios";import"@stencil/store";import"./iconMapping-CPerGeNF.js";import"@carbon/icons/es/add/16";import"@carbon/icons/es/add/32";import"@carbon/icons/es/add--alt/16";import"@carbon/icons/es/add--filled/16";import"@carbon/icons/es/arrows--horizontal/16";import"@carbon/icons/es/attachment/16";import"@carbon/icons/es/batch-job/16";import"@carbon/icons/es/box/16";import"@carbon/icons/es/close/16";import"@carbon/icons/es/close/24";import"@carbon/icons/es/close/32";import"@carbon/icons/es/close--filled/16";import"@carbon/icons/es/close--outline/16";import"@carbon/icons/es/checkmark/16";import"@carbon/icons/es/checkmark/24";import"@carbon/icons/es/checkmark/32";import"@carbon/icons/es/chevron--left/16";import"@carbon/icons/es/chevron--right/16";import"@carbon/icons/es/chevron--down/16";import"@carbon/icons/es/data-enrichment/16";import"@carbon/icons/es/document/16";import"@carbon/icons/es/document--add/16";import"@carbon/icons/es/document--attachment/16";import"@carbon/icons/es/document--pdf/16";import"@carbon/icons/es/document--video/16";import"@carbon/icons/es/document--audio/16";import"@carbon/icons/es/draggable/16";import"@carbon/icons/es/edit/16";import"@carbon/icons/es/export/16";import"@carbon/icons/es/flag/16";import"@carbon/icons/es/information/16";import"@carbon/icons/es/information/32";import"@carbon/icons/es/link/16";import"@carbon/icons/es/overflow-menu--vertical/16";import"@carbon/icons/es/overflow-menu--vertical/32";import"@carbon/icons/es/return/16";import"@carbon/icons/es/save/16";import"@carbon/icons/es/settings/16";import"@carbon/icons/es/subtract/16";import"@carbon/icons/es/subtract--alt/16";import"@carbon/icons/es/subtract--filled/16";import"@carbon/icons/es/trash-can/16";import"@carbon/icons/es/user/16";import"@carbon/icons/es/view/16";import"@carbon/icons/es/warning/16";import"@carbon/icons/es/warning/32";import"@carbon/icons/es/warning--alt/16";import"@carbon/icons/es/warning--alt/32";import"@carbon/icons/es/product/16";import"@carbon/icons/es/workspace/16";import"@carbon/icons/es/arrow--up/16";import"@carbon/icons/es/arrow--down/16";import"@carbon/icons/es/arrow--right/16";import"@carbon/icons/es/arrow--left/16";import"@carbon/icons/es/copy/16";import"@carbon/icons/es/star/16";import"@carbon/icons/es/data-table/16";import"@carbon/icons/es/fit-to-width/16";import"@carbon/icons/es/search--advanced/16";import"@carbon/icons/es/reset/16";import"@carbon/icons/es/column/16";import"@carbon/icons/es/column--delete/16";import"@carbon/icons/es/watson-health/rotate--360/16";import"@carbon/icons/es/filter/16";import"@carbon/icons/es/app-connectivity/16";import"@carbon/icons/es/text--font/16";import"@carbon/icons/es/text--long-paragraph/16";import"@carbon/icons/es/character--whole-number/16";import"@carbon/icons/es/checkbox--checked/16";import"@carbon/icons/es/radio-button--checked/16";import"@carbon/icons/es/event--schedule/16";import"@carbon/icons/es/view--off/16";import"@carbon/icons/es/time/16";import"@carbon/icons/es/calendar/16";import"@carbon/icons/es/list--checked/16";import"@carbon/icons/es/list--bulleted/16";import"@carbon/icons/es/cloud--upload/16";import"@carbon/icons/es/locked/16";import"@carbon/icons/es/pause/16";import"@carbon/icons/es/unlocked/16";import"@carbon/icons/es/send/16";import"@carbon/icons/es/email/16";import"@carbon/icons/es/checkmark--outline/16";import"@carbon/icons/es/migrate--alt/16";import"@carbon/icons/es/checkbox--checked--filled/16";import"@carbon/icons/es/checkbox/16";import"@carbon/icons/es/ZIP/16";import"@carbon/icons/es/image/16";import"@carbon/icons/es/PPT/16";import"@carbon/icons/es/XLS/16";function A(){return sessionStorage.getItem("user-id")}const T=async i=>{(null===document||void 0===document?void 0:document.startViewTransition)?(document.viewTransition&&await document.viewTransition.finished,document.startViewTransition(i)):i()},F={agGridExport:class{constructor(i="export.csv"){this.fileName=i}init(i){this.gridApi=i}onAction(i){"agGridExport"===i&&this.gridApi.exportDataAsCsv({fileName:this.fileName})}},openSavedViews:class{constructor(){this.isSidesheetOpen=!1,this.isDialogOpen=!1,this.viewName="",this.viewIsPrivate=!0,this.filteredViews=[],this.allViewData=[],this.activeView=null,this.loading=0,this.initialLoad=!0,this.addStateChangeListeners=()=>{this.api.addEventListener("columnVisible",this.handleManualColumnChange),this.api.addEventListener("columnPinned",this.handleManualColumnChange),this.api.addEventListener("columnMoved",this.handleManualColumnChange),this.api.addEventListener("columnPivotChanged",this.handleManualColumnChange),this.api.addEventListener("gridColumnsChanged",this.handleManualColumnChange),this.api.addEventListener("columnsReset",this.handleManualColumnChange),this.api.addEventListener("filterChanged",this.handleManualColumnChange),this.api.addEventListener("sortChanged",this.handleManualColumnChange)},this.removeStateChangeListeners=()=>{this.api.removeEventListener("columnVisible",this.handleManualColumnChange),this.api.removeEventListener("columnPinned",this.handleManualColumnChange),this.api.removeEventListener("columnMoved",this.handleManualColumnChange),this.api.removeEventListener("columnPivotChanged",this.handleManualColumnChange),this.api.removeEventListener("gridColumnsChanged",this.handleManualColumnChange),this.api.removeEventListener("columnsReset",this.handleManualColumnChange),this.api.removeEventListener("filterChanged",this.handleManualColumnChange),this.api.removeEventListener("sortChanged",this.handleManualColumnChange)},this.fetchViews=async()=>{var i,t;0!==(null===(i=this.api.getColumnDefs())||void 0===i?void 0:i.length)&&(this.loading=1,this.refresh(),this.api.removeEventListener("gridColumnsChanged",this.fetchViews),this.gridId=null===(t=this.api.getGridOption("context"))||void 0===t?void 0:t.gridId,this.gridId&&(this.allViewData=await l(A(),this.gridId),this.filterData(),this.initialLoad&&this.setDefaultView()),this.loading=0)},this.setDefaultView=()=>{const i=this.filteredViews.find((i=>null==i?void 0:i.isDefault));i&&this.setActiveView(i),this.initialLoad=!1},this.filterData=()=>{var i,t;this.entityName=null===(i=this.api.getGridOption("context"))||void 0===i?void 0:i.entityName,this.filteredViews=this.entityName?null===(t=this.allViewData)||void 0===t?void 0:t.filter((i=>(null==i?void 0:i.domain)===this.entityName)):this.allViewData,this.refresh()},this.setActiveView=i=>{var t,e;this.removeStateChangeListeners();const o=null===(t=null==i?void 0:i.gridViewGridViewGridConfiguration)||void 0===t?void 0:t.find((i=>1===i.gridViewGridConfigurationGridConfiguration.gridStateTypeId)),s=null===(e=null==i?void 0:i.gridViewGridViewGridConfiguration)||void 0===e?void 0:e.find((i=>4===i.gridViewGridConfigurationGridConfiguration.gridStateTypeId));if(o){const i={state:JSON.parse(o.gridViewGridConfigurationGridConfiguration.values),applyOrder:!0};this.api.applyColumnState(i)}this.api.setFilterModel(s?JSON.parse(s.gridViewGridConfigurationGridConfiguration.values):null),this.handleSidesheetClose(),T((()=>{this.activeView=i,this.refresh(),setTimeout(this.addStateChangeListeners,300)}))},this.deleteView=async i=>{this.loading=1,this.refresh(),await h(i.gridViewId,(()=>{this.fetchViews()})),this.loading=0,this.refresh()},this.postViewCallback=()=>{this.loading=0,this.fetchViews(),this.handleDialogClose()},this.removeActiveView=()=>{this.removeStateChangeListeners(),this.api.resetColumnState(),this.api.setFilterModel(null),T((()=>{this.activeView=null,this.refresh()}))},this.handleManualColumnChange=async()=>{this.removeStateChangeListeners(),this.activeView&&T((()=>{this.activeView=null,this.refresh()}))},this.handleNameChange=i=>{this.viewName=i.target.value,this.refresh()},this.handleViewIsPrivateToggleChange=()=>{this.viewIsPrivate=!this.viewIsPrivate,this.refresh()},this.handleSidesheetClose=()=>{this.isSidesheetOpen=!1,this.refresh()},this.handleDialogClose=()=>{this.isDialogOpen=!1,this.viewName="",this.refresh()},this.handleOpenModal=()=>{this.isDialogOpen=!0,this.refresh()}}init(i,t){this.api=i,this.refresh=t,this.api.addEventListener("gridColumnsChanged",this.fetchViews)}onAction(i){if("openSavedViews"===i){const i=this.api.getGridOption("context");(null==i?void 0:i.gridId)!==this.gridId?this.fetchViews():(null==i?void 0:i.entityName)!==this.entityName&&this.filterData(),this.isSidesheetOpen=!0,this.refresh()}}async postView(){var i,t;this.loading=1,this.refresh();const e=[];e.push({gridStateTypeId:1,gridId:null===(i=this.api.getGridOption("context"))||void 0===i?void 0:i.gridId,values:JSON.stringify(this.api.getColumnState())}),e.push({gridStateTypeId:4,gridId:null===(t=this.api.getGridOption("context"))||void 0===t?void 0:t.gridId,values:JSON.stringify(this.api.getFilterModel())});const o=this.api.getGridOption("context");try{await u(A(),null==o?void 0:o.gridId,y(),this.viewName,null==o?void 0:o.entityName,e,!0===this.viewIsPrivate?1:2,0,this.postViewCallback)}catch(i){console.error(i)}finally{this.refresh()}}async updateViewMarkedAsPrimary(i){this.loading=1,this.refresh();const t=this.api.getGridOption("context"),e=null==i?void 0:i.isDefault;await p(null==i?void 0:i.gridViewId,A(),null==t?void 0:t.gridId,y(),null==i?void 0:i.name,e?0:1,null==t?void 0:t.entityName,!0===this.viewIsPrivate?1:2,(()=>null)).then((async()=>{if(!e){const i=this.filteredViews.find((i=>null==i?void 0:i.isDefault));i&&await p(null==i?void 0:i.gridViewId,A(),null==t?void 0:t.gridId,y(),null==i?void 0:i.name,0,null==t?void 0:t.entityName,!0===this.viewIsPrivate?1:2,(()=>null)).catch((i=>console.log(i)))}await this.fetchViews(),this.loading=0,this.refresh()})).catch((i=>console.log(i)))}render(){var t,e;return i("div",null,i("div",{style:{viewTransitionName:"active-view-chip"},class:"grid-action-transition"},this.activeView&&i("div",{style:{margin:"4px"}},i("udp-chip",{label:null===(t=this.activeView)||void 0===t?void 0:t.name,variant:"filled",color:"secondary",deleteButton:!0,onChipDelete:this.removeActiveView}))),i("udp-dialog",{open:this.isDialogOpen,actionOne:()=>{this.postView()},actionTwo:this.handleDialogClose,handleClose:this.handleDialogClose,labelOne:"Create View",labelTwo:"Cancel",title:"Create a grid view",message:"The view will be created from the current column and filter state.",disableOne:!this.viewName,progress:this.loading},i("div",{style:{display:"flex",flexDirection:"column"}},i("div",{style:{marginBottom:"-4px",marginTop:"2em"}},i("text-field",{value:this.viewName,onInput:this.handleNameChange,placeholder:"View name"})),i("div",{style:{marginTop:"-4px"}},i("stencil-toggle",{label:"Private",checked:this.viewIsPrivate,onChange:this.handleViewIsPrivateToggleChange})))),i("udp-side-sheet",{title:"Views",open:this.isSidesheetOpen,position:"right",onUdpSideSheetClose:this.handleSidesheetClose,headerActionButtonLabel:"Create View",onUdpHeaderActionButtonClick:this.handleOpenModal,headerActionButtonIcon:"add",loading:!!this.loading},i("div",{style:{display:"flex",flexDirection:"column",gap:"10px"}},i("hint-panel",{hint:"Quickly access and manage your pre-configured grid views. These views are designed to help you focus on specific sets of data and streamline your workflow.",hideHintText:"Dismiss"}),this.entityName&&i("hint-panel",{hint:"Note: Displaying entity specific views."}),i("div",null,(null===(e=this.filteredViews)||void 0===e?void 0:e.length)>0?this.filteredViews.map((t=>{var e;return i("udp-list-item",{primaryText:t.name,clickable:!0,onListItemClick:()=>this.setActiveView(t)},i("div",{style:{display:"flex",flexDirection:"row",gap:"4px"},slot:"status-chip"},(null===(e=this.activeView)||void 0===e?void 0:e.gridViewId)===t.gridViewId&&i("udp-chip",{label:"Active",color:"success",variant:"filled"}),1===t.gridViewVisibilityTypeId&&i("udp-chip",{label:"Private",color:"gray",variant:"outlined"})),i("div",{slot:"actions"},i("udp-icon-button",{icon:f("star"),size:"small",variant:t.isDefault?"contained":"text",tooltip:2===t.gridViewVisibilityTypeId?"Cannot mark public view as primary":t.isDefault?"Remove as primary":"Mark as primary",onClick:()=>this.updateViewMarkedAsPrimary(t),disabled:2===t.gridViewVisibilityTypeId}),i("udp-icon-button",{icon:f("trashCan"),size:"small",variant:"text",tooltip:t.userId!==A()?"Cannot delete public view with different owner":"Delete View",onClick:()=>this.deleteView(t),disabled:t.userId!==A()})))})):i("udp-empty-state-display",{primaryText:"No Views to display"})))))}},agGridSizeColumnsToFit:class{init(i){this.gridApi=i}onAction(i){"agGridSizeColumnsToFit"===i&&this.gridApi.sizeColumnsToFit()}},agGridAutoSizeColumns:class{init(i){this.gridApi=i}onAction(i){"agGridAutoSizeColumns"===i&&this.gridApi.autoSizeAllColumns()}},bulkActions:class{constructor(){this.bulkActions=[],this.selectedRowCount=0,this.fetchedData=!1,this.isMenuOpen=!1,this.onRowSelectionChanged=()=>{var i;T((()=>{const i=this.api.getSelectedRows();this.selectedRows=i,this.selectedRowCount=i.length,this.refresh()})),this.fetchedData&&(null===(i=this.api.getGridOption("context"))||void 0===i?void 0:i.gridId)===this.gridId||this.fetchBulkActions()},this.setBulkActions=i=>{const t=i.map((i=>({label:i.name,onClick:()=>this.executeActionProviderAction(i.actionId)}))),e=this.localFunctions.map((i=>({label:i.label,onClick:()=>this.executeLocalFunction(i.label)})));this.bulkActions=[...t,...e],this.fetchedData=!0,this.refresh()},this.executeLocalFunction=i=>{const t=this.localFunctions.find((t=>t.label===i));t&&t.callback(this.selectedRows),this.refresh()},this.executeActionProviderAction=i=>{this.actionProviderCallback&&this.actionProviderCallback(i,this.selectedRows),this.refresh()},this.toggleMenu=()=>{this.isMenuOpen=!this.isMenuOpen,this.refresh()},this.closeMenu=()=>{this.isMenuOpen=!1,this.refresh()}}init(i,t,e){this.api=i,this.refresh=t,this.actionProviderCallback=null==e?void 0:e.actionProviderCallback,this.localFunctions=null==e?void 0:e.localFunctions;const o=this.api.getGridOption("rowModelType");this.api.setGridOption("rowSelection","clientSide"===o?{mode:"multiRow",enableClickSelection:!0}:{mode:"multiRow",enableClickSelection:!0,headerCheckbox:!1}),this.api.addEventListener("selectionChanged",this.onRowSelectionChanged)}onAction(i){"executeBulkAction"===i&&this.refresh()}async fetchBulkActions(){var i;try{this.gridId=null===(i=this.api.getGridOption("context"))||void 0===i?void 0:i.gridId,await b(this.gridId,!1,[],this.setBulkActions)}catch(i){console.error(i)}}render(){var t;return i("div",{style:{viewTransitionName:"bulk-action-button"},class:"grid-action-transition"},this.selectedRowCount>0&&[i("div",{style:{margin:"2px"}},i("udp-button",{ref:i=>{this.menuAnchorEl=i||void 0},onClick:this.toggleMenu,variant:"outlined",color:"primary",endIcon:i("udp-icon",{iconName:"chevronDown",style:{transform:this.isMenuOpen?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease-in-out"}})},`${this.selectedRowCount} Selected`)),i("udp-menu",{open:this.isMenuOpen,anchor:this.menuAnchorEl,handleClose:this.closeMenu},0===(null===(t=this.bulkActions)||void 0===t?void 0:t.length)?i("udp-menu-item",{label:"No available actions"}):this.bulkActions.map((t=>i("udp-menu-item",{label:t.label,onItemClick:()=>{t.onClick(),this.isMenuOpen=!1}}))))])}},chipFilter:class{constructor(){this.handleFilterChanged=i=>{var t,e,o;const s=null===(e=null===(t=null==i?void 0:i.columns)||void 0===t?void 0:t[0])||void 0===e?void 0:e.colId,n=null===(o=this.filterChips)||void 0===o?void 0:o.find((i=>i.field===s));if(n){const i=this.api.getColumnFilterModel(s),t=Object.assign(Object.assign({},n),{filterObjects:n.filterObjects.map((t=>{let e=!1;return(null==i?void 0:i.conditions)&&"AND"===(null==i?void 0:i.operator)?e=i.conditions.some((i=>JSON.stringify(i)===JSON.stringify(t.agGridFilterModel[s]))):i&&(e=JSON.stringify(i)===JSON.stringify(t.agGridFilterModel[s])),Object.assign(Object.assign({},t),{toggled:e})}))});this.filterChips=this.filterChips.map((i=>i.field===s?t:i)),this.refresh()}},this.syncChipsWithGridFilters=()=>{if(!this.filterChips||0===this.filterChips.length)return;const i=this.filterChips.map((i=>{const t=i.field,e=this.api.getColumnFilterModel(t);if(!e)return i;const o=i.filterObjects.map((i=>{let o=!1;return o=(null==e?void 0:e.conditions)&&"AND"===(null==e?void 0:e.operator)?e.conditions.some((e=>JSON.stringify(e)===JSON.stringify(i.agGridFilterModel[t]))):JSON.stringify(e)===JSON.stringify(i.agGridFilterModel[t]),Object.assign(Object.assign({},i),{toggled:o})}));return Object.assign(Object.assign({},i),{filterObjects:o})}));this.filterChips=i},this.getGridfilterChips=async()=>{var i,t;if(this.gridId!==(null===(i=this.api.getGridOption("context"))||void 0===i?void 0:i.gridId)){this.gridId=null===(t=this.api.getGridOption("context"))||void 0===t?void 0:t.gridId;const i=(await m(this.gridId,7)).map((i=>JSON.parse(i.values)));T((async()=>{this.filterChips=i.map((i=>Object.assign(Object.assign({},i),{filterObjects:i.filterObjects.map((i=>Object.assign(Object.assign({},i),{toggled:!1})))}))),this.syncChipsWithGridFilters(),this.getFilterChipCounts(),this.refresh()}))}},this.getFilterChipCounts=async()=>{var i;const t={pageNumber:1,pageSize:1,filterElements:[],filterGroups:[],orderElements:[],groupingType:"",groupProperty:[],groupOperationList:[],eagerLoad:!1,logicalSearchOperator:1},e=[];for(const o of this.filterChips){if(!(null==o?void 0:o.udpDomainSanitizedName))continue;const s=await v(y(),o.udpDomainSanitizedName,!0);for(const n of null!==(i=o.filterObjects)&&void 0!==i?i:[])(null==n?void 0:n.udpFilterElement)&&e.push((async()=>{var i;const e=Object.assign(Object.assign({},t),{filterElements:[n.udpFilterElement]});return{result:await g(e,null===(i=null==s?void 0:s.unityBaseSearchMethod)||void 0===i?void 0:i.apiMethodId,x.config.UNITY_API_DOMAIN,!1),groupField:o.field,objLabel:n.label}})())}const o=await Promise.all(e);this.filterChips=this.filterChips.map((i=>{const t=o.filter((t=>t.groupField===i.field));return Object.assign(Object.assign({},i),{filterObjects:i.filterObjects.map((i=>{var e,o;const s=t.find((t=>t.objLabel===i.label));return Object.assign(Object.assign({},i),{resultCount:null!==(o=null===(e=null==s?void 0:s.result)||void 0===e?void 0:e.total)&&void 0!==o?o:null})}))})})),this.refresh()},this.setSelectedFilterChip=i=>{this.filterChips=this.filterChips.map((t=>Object.assign(Object.assign({},t),{filterObjects:t.filterObjects.map((t=>t.label===i.label?Object.assign(Object.assign({},t),{toggled:!t.toggled}):t))}))),this.refresh();const t=Object.keys(i.agGridFilterModel)[0];!function(i,t,e){var o,s;const n=i.getColumn(t);if(!n)return void console.error("Invalid column id provided for filtering");if(!(null===(o=null==n?void 0:n.colDef)||void 0===o?void 0:o.filter))return void console.error(`Filtering not enabled for column: ${null==n?void 0:n.colId}`);const a=i.getColumnFilterModel(t);if(JSON.stringify(e)!==JSON.stringify(a)){if(null===(s=null==a?void 0:a.conditions)||void 0===s?void 0:s.some((i=>JSON.stringify(i)===JSON.stringify(e)))){const o=null==a?void 0:a.conditions.filter((i=>JSON.stringify(i)!==JSON.stringify(e)));if(1===o.length)return void i.setColumnFilterModel(t,o[0]).then((()=>i.onFilterChanged()));{const e=Object.assign(Object.assign({},a),{conditions:o});return void i.setColumnFilterModel(t,e).then((()=>i.onFilterChanged()))}}if(a)if(null==a?void 0:a.conditions){const o=[...null==a?void 0:a.conditions,e];i.setColumnFilterModel(t,{conditions:o,operator:"AND"}).then((()=>i.onFilterChanged()))}else a&&i.setColumnFilterModel(t,{conditions:[Object.assign({},a),e],operator:"AND"}).then((()=>i.onFilterChanged()));else i.setColumnFilterModel(n,e).then((()=>i.onFilterChanged()))}else i.setColumnFilterModel(t,null).then((()=>i.onFilterChanged()))}(this.api,t,i.agGridFilterModel[t])}}init(i,t){this.api=i,this.refresh=t,this.api.addEventListener("firstDataRendered",this.getGridfilterChips),this.api.addEventListener("filterChanged",this.handleFilterChanged)}onAction(i){"chipFilter"===i&&this.refresh()}render(){var t;return i("div",{class:"grid-action-transition",style:{display:"flex",flexWrap:"nowrap",gap:"5px",viewTransitionName:"view-chip-filters"}},(null===(t=this.filterChips)||void 0===t?void 0:t.length)>0&&this.filterChips.map(((t,e)=>[e>0&&i("div",{style:{width:"1px",backgroundColor:"#ddd",marginBottom:"5px",marginTop:"5px"}}),i("div",{style:{padding:"4px",display:"flex",flexWrap:"nowrap",gap:"3px"}},t.filterObjects.map((t=>i("udp-chip",{label:`${t.label} ${null!=t.resultCount?`(${t.resultCount})`:""}`,variant:t.toggled?"filled":"outlined",clickable:!0,onChipClick:()=>this.setSelectedFilterChip(t),color:"primary"}))))])))}},restoreGridState:class{constructor(){this.getPreviousState=()=>{T((()=>{this.api.removeEventListener("stateUpdated",this.saveState);const i=this.api.getGridOption("context");this.gridId=null==i?void 0:i.gridId,this.apiMethodInstanceId=(null==i?void 0:i.apiMethodInstanceId)||"",this.previousState=JSON.parse(localStorage.getItem(this.getStorageKey())),this.refresh(),this.api.addEventListener("stateUpdated",this.saveState)}))},this.getStorageKey=()=>{const i=k();return`saved-grid-state-${this.gridId}-${this.apiMethodInstanceId}-${i}`},this.saveState=()=>{const i=this.api.getGridOption("context");if((null==i?void 0:i.gridId)!==this.gridId||(null==i?void 0:i.apiMethodInstanceId)&&(null==i?void 0:i.apiMethodInstanceId)!==this.apiMethodInstanceId)this.getPreviousState();else{const i=this.api.getState();localStorage.setItem(this.getStorageKey(),JSON.stringify({date:new Date,state:i}))}},this.restoreState=async()=>{this.api.setState(this.previousState.state),setTimeout((()=>T((()=>{this.previousState=null,this.refresh()}))),0)},this.dismissMessage=()=>{T((()=>{this.previousState=null,this.refresh()}))}}init(i,t){this.api=i,this.refresh=t,this.api.addEventListener("firstDataRendered",this.getPreviousState)}getTimeAgo(i){const t=Math.floor((Date.now()-i.getTime())/1e3);if(t<60)return`${t} second${1!==t?"s":""} ago`;const e=Math.floor(t/60);if(e<60)return`${e} minute${1!==e?"s":""} ago`;const o=Math.floor(e/60);if(o<24)return`${o} hour${1!==o?"s":""} ago`;const s=Math.floor(o/24);return`${s} day${1!==s?"s":""} ago`}render(){var t;return i("div",{style:{viewTransitionName:"restore-grid-state"}},(null===(t=this.previousState)||void 0===t?void 0:t.date)&&i("div",{style:{margin:"4px"}},i("udp-ambient-tool-tip",{content:`Restore grid state from ${this.getTimeAgo(new Date(this.previousState.date))}?`},i("udp-chip",{startIcon:"rotate",label:"Restore state",variant:"outlined",color:"gray",deleteButton:!0,onChipDelete:this.dismissMessage,clickable:!0,onClick:this.restoreState}))))}},agGridResetColumns:class{init(i){this.gridApi=i}onAction(i){"agGridResetColumns"===i&&(this.gridApi.resetColumnState(),this.gridApi.setFilterModel(null))}},advancedSearch:class{init(i,t,e){this.onOpenCallback=null==e?void 0:e.callback}onAction(i){var t;"advancedSearch"===i&&(null===(t=this.onOpenCallback)||void 0===t||t.call(this))}},agGridHideShowColumns:class{init(i){this.gridApi=i}onAction(i){"agGridHideShowColumns"===i&&this.gridApi.showColumnChooser()}},udpExport:class{init(i,t,e){this.onOpenCallback=null==e?void 0:e.callback,this.api=i}onAction(i){var t;if("udpExport"===i){const i=this.api.getGridOption("context");null===(t=this.onOpenCallback)||void 0===t||t.call(this,null==i?void 0:i.searchObject,null==i?void 0:i.entityName)}}}},D=i=>{const t=i.value;if(null==t)return"";const e=new Date(t);return e?`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")} ${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`:""},G=a.withParams({wrapperBorderRadius:0,wrapperBorder:!1,headerCellHoverBackgroundColor:"var(--udp-grid-column-header-bg-hover)",borderColor:"#E9ECEF"}),E=class{constructor(i){t(this,i),this.gridReady=e(this,"gridReady"),this.headerConfig={},this.gridFunctions=[],this.refreshKey=0,this.gridFunctionInstances=[],this.updateGridHeight=()=>{if(this.gridEl){const i=this.gridEl.getBoundingClientRect(),t=window.innerHeight-i.top,e=10;this.gridEl.style.height=(t-e>400?t-e:400)+"px"}},this.scheduleHeightUpdate=()=>{clearTimeout(this.resizeDebounce),this.resizeDebounce=setTimeout(this.updateGridHeight,100)},this.refreshGridFunctions=()=>{this.refreshKey++},this.onGridReady=i=>{this.gridApi=i.api,this.updateGridContextValues(),this.gridFunctionInstances=this.gridFunctions.map((i=>{const t=F[i.name];if(!t)return null;const e=new t;return e.init(this.gridApi,this.refreshGridFunctions,i.params),e})).filter((i=>!!i)),this.gridApiCallback&&this.gridApiCallback({refreshServerSide:()=>this.gridApi.refreshServerSide(),getSelectedRows:()=>this.gridApi.getSelectedRows(),getSelectedNodes:()=>this.gridApi.getSelectedNodes(),getSearchObject:()=>{var i;return null===(i=this.gridApi.getGridOption("context"))||void 0===i?void 0:i.searchObject},getEntityName:()=>{var i;return null===(i=this.gridApi.getGridOption("context"))||void 0===i?void 0:i.entityName},getRowCount:()=>{var i;return null===(i=this.gridApi.getGridOption("context"))||void 0===i?void 0:i.rowCount},getFilterModel:()=>this.gridApi.getFilterModel(),setFilterModel:i=>this.gridApi.setFilterModel(i),onFilterChanged:()=>this.gridApi.onFilterChanged(),expandAll:()=>this.gridApi.expandAll(),collapseAll:()=>this.gridApi.collapseAll(),toggleLoadingOverlay:i=>this.gridApi.setGridOption("loading",i),refreshCells:()=>this.gridApi.refreshCells(),refreshClientSideRowModel:i=>this.gridApi.refreshClientSideRowModel(i),selectAll:(i,t)=>this.gridApi.selectAll(i,t),deselectAll:(i,t)=>this.gridApi.deselectAll(i,t),getServerSideSelectionState:()=>this.gridApi.getServerSideSelectionState(),setServerSideSelectionState:i=>this.gridApi.setServerSideSelectionState(i),forEachNode:i=>this.gridApi.forEachNode(i),forEachNodeAfterFilterAndSort:i=>this.gridApi.forEachNodeAfterFilterAndSort(i)}),this.setColumnDefs(),this.gridReady.emit(this.gridApi)},this.onHeaderAction=i=>{this.gridFunctionInstances.forEach((t=>{var e;return null===(e=t.onAction)||void 0===e?void 0:e.call(t,i.detail.name,i.detail.payload)}))},this.updateGridContextValues=()=>{this.gridApi.setGridOption("context",Object.assign(Object.assign({},this.gridApi.getGridOption("context")),{entityName:this.entityName,gridId:this.gridId}))}}componentWillLoad(){n.registerModules([c]),d.setLicenseKey("Using_this_{AG_Grid}_Enterprise_key_{AG-080613}_in_excess_of_the_licence_granted_is_not_permitted___Please_report_misuse_to_legal@ag-grid.com___For_help_with_changing_this_key_please_contact_info@ag-grid.com___{Univerus_Software_Inc}_is_granted_a_{Single_Application}_Developer_License_for_the_application_{MAIS_eRec}_only_for_{1}_Front-End_JavaScript_developer___All_Front-End_JavaScript_developers_working_on_{MAIS_eRec}_need_to_be_licensed___{MAIS_eRec}_has_not_been_granted_a_Deployment_License_Add-on___This_key_works_with_{AG_Grid}_Enterprise_versions_released_before_{28_June_2026}____[v3]_[01]_MTc4MjYwMTIwMDAwMA==5c7d1487ecb13b28e75415d34b7cf694")}componentDidLoad(){var i,t,e,o;const s=Object.assign(Object.assign({tooltipShowMode:"whenTruncated",tooltipShowDelay:500},this.gridOptions),{columnTypes:{booleanChip:{cellRenderer:"iconRenderer",cellRendererParams:{iconMappingConfig:{true:{iconName:"checkMark24",color:"success"},false:{iconName:"close24",color:"error"}}}}},dataTypeDefinitions:{dateTimeString:{baseDataType:"dateTimeString",extendsDataType:"dateTimeString",valueFormatter:D},boolean:{baseDataType:"boolean",extendsDataType:"boolean",columnTypes:"booleanChip"}},gridId:this.gridId,onGridReady:this.onGridReady,theme:G,components:Object.assign({actionsRenderer:O,currencyRenderer:S,dateTimeCellRenderer:_,iconRenderer:C,statusRenderer:w},null===(i=this.gridOptions)||void 0===i?void 0:i.components),domLayout:"normal",defaultColDef:Object.assign(Object.assign({sortable:!0,filter:!0,flex:1,minWidth:150,suppressHeaderMenuButton:!0},null===(t=this.gridOptions)||void 0===t?void 0:t.defaultColDef),{filterParams:Object.assign({buttons:["reset","apply"],closeOnApply:!0,maxNumConditions:10},null===(o=null===(e=this.gridOptions)||void 0===e?void 0:e.defaultColDef)||void 0===o?void 0:o.filterParams)})});r(this.el.querySelector("#myNewGrid"),s),this.gridHeight?this.gridEl.style.height=this.gridHeight:(this.updateGridHeight(),this.resizeObserver=new ResizeObserver(this.scheduleHeightUpdate),this.resizeObserver.observe(this.gridContainerEl))}disconnectedCallback(){var i;null===(i=this.gridApi)||void 0===i||i.destroy()}handleUpdateColumnDefs(i,t){j(i,t)||this.setColumnDefs()}setColumnDefs(){var i;if(this.columnDefs&&this.gridApi){const t=N(this.columnDefs,null===(i=this.gridFunctions)||void 0===i?void 0:i.some((i=>"advancedSearch"===(null==i?void 0:i.name))));this.gridApi.setGridOption("columnDefs",t)}}handleEntityNameChange(){this.updateGridContextValues()}render(){var t;const e=`variant-${(null===(t=this.headerConfig)||void 0===t?void 0:t.variant)||"light"}`;return i("div",{key:"24fa82598a8b3c7cd8908d279dd5d55fa56fb059",class:e,ref:i=>this.gridContainerEl=i},i("ghost-render",{key:"5a135714392f7edb7fee6d2146e231971ed0ca93"},i("div",{key:"f8a3749c2bff52ca09f110152d2a0c9d61d8458c"},i("udp-dialog",{key:"7c245a75a383f6acc3df2eae99beb1eca1b0ce3b"}),i("udp-list-item",{key:"00c826a169725fe7950b5f48e6c6018554885eaf"}),i("hint-panel",{key:"e36c1b28357c275c6d71caa245a5e5dfc0dcf8a8"}),i("udp-side-sheet",{key:"26ce13c227185842de854c0dca352a5bae875038"}))),i("div",{key:"97ec4f0e8a4e464965fddc7d27807797bf9690b1",class:"grid-base-header"},i("grid-header",{key:"2af72231d327d5ff5c6b6c082ca24c8389b71db6",headerConfig:this.headerConfig,gridFunctions:this.gridFunctions,onHeaderAction:this.onHeaderAction}),i("div",{key:"b3464f54b3c57d19d2deaa673e7a6b483573fa6c",class:"action-bar",style:{viewTransitionName:"action-bar"}},this.gridFunctionInstances.map((i=>{var t;return null===(t=i.render)||void 0===t?void 0:t.call(i)})))),i("div",{key:"851c7e4d8f06734ad7a0e5e5119ed61eb8556c57",id:"myNewGrid",ref:i=>this.gridEl=i,style:{viewTransitionName:"my-new-grid"}}))}get el(){return o(this)}static get watchers(){return{columnDefs:[{handleUpdateColumnDefs:0}],entityName:[{handleEntityNameChange:0}],gridId:[{handleEntityNameChange:0}]}}};E.style=":root{--udp-grid-base-header-bg:#EBECEF;--udp-grid-base-header-text:#000;--udp-grid-action-divider-color:rgba(0, 0, 0, 0.3);--udp-grid-action-bar-border-color:rgb(202, 197, 197)}.variant-dark{--udp-grid-base-header-bg:var(--primary-color-dark);--udp-grid-action-bar-bg:#F8F9FA;--udp-grid-column-header-bg:#F8F9FA;--udp-grid-column-header-bg-hover:#dce6f2;--udp-grid-column-header-text:var(--primary-color-dark);--udp-grid-action-bar-text-color:var(--primary-color-dark);--udp-grid-action-bar-border-color:rgba(0, 0, 0, 0.1)}.variant-light{--udp-grid-base-header-bg:#d8dfe6;--udp-grid-action-bar-bg:#f4f6f8;--udp-grid-column-header-bg:#f2f4f5;--udp-grid-column-header-bg-hover:#eef3f9;--udp-grid-column-header-text:var(--primary-color-dark);--udp-grid-action-bar-text-color:var(--primary-color-dark);--udp-grid-action-bar-border-color:rgba(0, 0, 0, 0.1)}::view-transition-group(*){animation-duration:0.2s}.grid-base-header{background-color:var(--udp-grid-base-header-bg);color:var(--udp-grid-base-header-text)}.action-bar{display:flex;flex-direction:row;align-items:center;flex-wrap:wrap;background-color:var(--udp-grid-action-bar-bg);color:var(--udp-grid-action-bar-text-color);padding:0px 8px 0px 12px;border-bottom:1px solid var(--udp-grid-action-bar-border-color)}.grid-wrapper{display:flex;flex-direction:column;height:100%}#myNewGrid{flex:1}";const I=class{constructor(i){t(this,i)}render(){return i(s,{key:"77d50c2b9c9ccbb58d00b4928fcbed63d13c1010"},i("slot",{key:"30730a259776f1452fca147be792d928ba2ee996"}))}};I.style=":host {\n display: none;\n }";const R=class{constructor(i){t(this,i),this.headerAction=e(this,"headerAction"),this.isMenuOpen=!1,this.toggleSettingsMenu=()=>{this.isMenuOpen=!this.isMenuOpen}}action(i,t){this.headerAction.emit({name:i,payload:t})}render(){var t,e,o,s,n,a,r,c,d,l,h,u,p,b,m,v,g,y,x,k,w,C,_,S;const O=!!(null===(e=null===(t=this.headerConfig)||void 0===t?void 0:t.title)||void 0===e?void 0:e.replace(/\u00A0/g," ").trim()),N=!!(null===(s=null===(o=this.headerConfig)||void 0===o?void 0:o.primaryActionButton)||void 0===s?void 0:s.label),j=((null===(a=null===(n=this.headerConfig)||void 0===n?void 0:n.secondaryActionButtons)||void 0===a?void 0:a.length)||0)>0,A=((null===(r=this.gridFunctions)||void 0===r?void 0:r.length)||0)>0;if(!(O||N||j||A))return null;const T=`variant-${(null===(c=this.headerConfig)||void 0===c?void 0:c.variant)||"light"}`,F=new Set(this.gridFunctions.map((i=>i.name))),D=["agGridSizeColumnsToFit","agGridAutoSizeColumns","agGridHideShowColumns","agGridResetColumns","agGridExport"].some((i=>F.has(i)));return i("div",{class:`header-bar ${T}`},i("unity-typography",{variant:"h6",color:"inherit"},this.headerConfig.title),i("div",{class:"actions"},D&&i("udp-icon-button",{class:{"settings-button":!0,"is-open":this.isMenuOpen},onClick:this.toggleSettingsMenu,ref:i=>{this.menuAnchorEl=i||void 0},icon:f("settings"),variant:"outlined",size:"small",color:"inherit"}),i("udp-menu",{open:this.isMenuOpen,anchor:this.menuAnchorEl,handleClose:()=>this.isMenuOpen=!1},F.has("agGridSizeColumnsToFit")&&i("udp-menu-item",{label:"Size Columns To Fit",iconName:"fitToWidth",onItemClick:()=>this.action("agGridSizeColumnsToFit")}),F.has("agGridAutoSizeColumns")&&i("udp-menu-item",{label:"Auto Size Columns",iconName:"column",onItemClick:()=>this.action("agGridAutoSizeColumns")}),F.has("agGridHideShowColumns")&&i("udp-menu-item",{label:"Hide/Show Columns",iconName:"hideColumn",onItemClick:()=>this.action("agGridHideShowColumns")}),F.has("agGridResetColumns")&&i("udp-menu-item",{label:"Reset Columns",iconName:"reset",onItemClick:()=>this.action("agGridResetColumns")}),F.has("agGridExport")&&i("udp-menu-item",{label:"CSV Export",iconName:"export",onItemClick:()=>this.action("agGridExport")})),F.has("openSavedViews")&&i("udp-chip",{color:"monochrome",variant:"outlined",startIcon:"dataTable",label:"Views",clickable:!0,onChipClick:()=>this.action("openSavedViews"),size:"medium"}),F.has("udpExport")&&i("udp-chip",{color:"monochrome",variant:"outlined",startIcon:"export",label:"Export",clickable:!0,onChipClick:()=>this.action("udpExport"),size:"medium"}),F.has("advancedSearch")&&i("udp-chip",{color:"monochrome",variant:"outlined",startIcon:"search",label:"Search",clickable:!0,onChipClick:()=>this.action("advancedSearch"),size:"medium"}),i("div",{class:"secondary-actions"},null===(l=null===(d=this.headerConfig)||void 0===d?void 0:d.secondaryActionButtons)||void 0===l?void 0:l.map((t=>i("udp-chip",{color:"monochrome",variant:"outlined",startIcon:null==t?void 0:t.iconName,label:null==t?void 0:t.label,clickable:!(null==t?void 0:t.disabled),onChipClick:t.onClick,size:"medium"})))),i("div",{class:"primary-action"},(null===(u=null===(h=this.headerConfig)||void 0===h?void 0:h.primaryActionButton)||void 0===u?void 0:u.label)&&i("udp-button",{variant:"contained",onButtonClick:null===(b=null===(p=this.headerConfig)||void 0===p?void 0:p.primaryActionButton)||void 0===b?void 0:b.onClick,color:"secondary",disabled:null===(v=null===(m=this.headerConfig)||void 0===m?void 0:m.primaryActionButton)||void 0===v?void 0:v.disabled,loading:null===(y=null===(g=this.headerConfig)||void 0===g?void 0:g.primaryActionButton)||void 0===y?void 0:y.loading,endIcon:(null===(k=null===(x=this.headerConfig)||void 0===x?void 0:x.primaryActionButton)||void 0===k?void 0:k.iconName)&&i("udp-icon",{iconName:null===(C=null===(w=this.headerConfig)||void 0===w?void 0:w.primaryActionButton)||void 0===C?void 0:C.iconName,color:"inherit"})},null===(S=null===(_=this.headerConfig)||void 0===_?void 0:_.primaryActionButton)||void 0===S?void 0:S.label))))}};R.style=".header-bar{display:flex;align-items:center;justify-content:space-between;padding:var(--spacing-03) var(--spacing-03) var(--spacing-03) var(--spacing-05);font-family:'Segoe UI', Tahoma, sans-serif;color:var(--grid-header-text);min-height:42px}.header-bar.variant-dark{--grid-header-text:#FFFFFF;--grid-header-icon-hover-bg:rgba(255, 255, 255, 0.12);}.header-bar.variant-light{--grid-header-text:black;--grid-header-icon-hover-bg:rgba(0, 0, 0, 0.08)}.header-bar .header-title{color:inherit;margin:0;white-space:nowrap}.header-bar .actions{display:flex;gap:0.4rem;flex-wrap:nowrap;align-items:center}.header-bar .secondary-actions{display:flex;gap:0.4rem}.menu-trigger-wrapper{position:relative;display:inline-flex}.settings-button{transition:transform 0.2s ease-in-out}.settings-button.is-open{transform:rotate(45deg)}";const z=class{constructor(i){t(this,i),this.showHint=!0,this.handleHideHint=()=>{this.showHint=!1}}render(){return i("div",{key:"a12706b04206a3155c828c4a3c74ab93f4f9a54b",class:"hint-container"},this.showHint&&i("div",{key:"61c421a9227f8da52e07b5a27c122aae9cbe7bd8",class:"hint-content"},i("div",{key:"e7e196b3de4cb3eff963e5663acb4b3665caa885"},i("unity-typography",{key:"326bafd6cc82f8020e49f59a5cd35174715bb34e",variant:"body"}," ",this.hint," ")),this.hideHintText&&i("div",{key:"8ff552c3eadde4f86cd793826bf5d2da1a6253f8",class:"hide-help"},i("udp-button",{key:"c4b13f7784eab8a0796d212489614cdd58bd6fe2",size:"small",color:"info",onClick:this.handleHideHint},this.hideHintText))))}};z.style=".hint-container{border-left:3px solid var(--info-color-main)}.hint-content{background-color:color-mix(in srgb, var(--info-color-hint) 70%, transparent);padding:8px}.hide-help{display:flex;justify-content:flex-end;margin-top:0.5rem}";const M=class{constructor(i){t(this,i),this.open=!1,this.titleId="dialog-title",this.descriptionId="dialog-description",this.buttonOneHidden=!1,this.buttonTwoHidden=!1,this.buttonThreeHidden=!0,this.originalBodyOverflow="",this.handleTransitionEnd=()=>{this.open||this.hostEl.parentElement!==document.body||document.body.removeChild(this.hostEl)},this.handleKeyDown=i=>{"Escape"===i.key&&this.handleClose&&this.handleClose()},this.handleOverlayClick=()=>{this.handleClose&&this.handleClose()}}handleOpenChange(i){i?(this.originalBodyOverflow=document.body.style.overflow,document.body.style.overflow="hidden",document.body.appendChild(this.hostEl),document.addEventListener("keydown",this.handleKeyDown),requestAnimationFrame((()=>{this.hostEl.classList.add("is-visible")}))):(this.hostEl.classList.remove("is-visible"),document.body.style.overflow=this.originalBodyOverflow,document.removeEventListener("keydown",this.handleKeyDown),this.hostEl.addEventListener("transitionend",this.handleTransitionEnd,{once:!0}))}disconnectedCallback(){"hidden"===document.body.style.overflow&&(document.body.style.overflow=this.originalBodyOverflow),document.removeEventListener("keydown",this.handleKeyDown)}render(){return i(s,{key:"5a90e0cfa060c1363fb823be98a2f3f7ff5682ef",onClick:this.handleOverlayClick},i("div",{key:"8ab6dd81074d401ed22b436c9cc21c21ec0210f8",class:"dialog-container",role:"dialog","aria-modal":"true","aria-labelledby":this.titleId,"aria-describedby":this.descriptionId,onClick:i=>i.stopPropagation()},i("div",{key:"6b4181bceeecbe7d316d13e902897b9dcfd3dff1",class:"dialog-title",id:this.titleId},i("unity-typography",{key:"cdc44f463dc5cce8fcc583fdb9b140cd0b651df2",variant:"h3"},this.title)),i("div",{key:"1b5147acd9da752ef77ece211e645b020766a90e",class:"dialog-content",id:this.descriptionId},this.message&&i("unity-typography",{key:"e3056d62d5b19dc4ab59491cd35ff5e876d5af69",variant:"body"},this.message),i("slot",{key:"7e3077ebd768e66fb38c96635d9270baa4e26b68"})),i("div",{key:"049b0fd822a3a6fd44264bd0c98db78bbe8860dc",class:"dialog-actions"},!this.buttonTwoHidden&&i("udp-button",{key:"4e2451c51e0d7f687e6a20208f7b128c9fa93cc8",variant:"text",disabled:this.disableTwo,onClick:()=>this.actionTwo()},this.labelTwo),!this.buttonThreeHidden&&i("udp-button",{key:"ffce2387c9aa1aed65706eb3901687e2f1843618",variant:"text",disabled:this.disableThree,onClick:()=>this.actionThree()},this.labelThree),!this.buttonOneHidden&&i("udp-button",{key:"66b2adc47093fa6f8ace3460390f59081451d2b9",variant:"contained",disabled:this.disableOne,onClick:()=>this.actionOne(),loading:!!this.progress},this.labelOne))))}get hostEl(){return o(this)}static get watchers(){return{open:[{handleOpenChange:0}]}}};M.style=":host{position:fixed;top:0;left:0;width:0;height:0;overflow:hidden;transform:translate(0);z-index:100000;display:flex;align-items:center;justify-content:center;visibility:hidden;background-color:rgba(0, 0, 0, 0);transition:background-color 0.2s ease-out, visibility 0s 0.2s, width 0s 0.2s, height 0s 0.2s;}:host(.is-visible){visibility:visible;background-color:rgba(0, 0, 0, 0.5);width:100%;height:100%;overflow:visible;transition-delay:0s}.dialog-container{background-color:#fff;box-shadow:0 12px 24px rgba(0, 0, 0, 0.16), 0 12px 24px rgba(0, 0, 0, 0.23);max-width:90vw;width:500px;max-height:90vh;display:flex;flex-direction:column;opacity:0;transition:opacity 0.2s ease-out}:host(.is-visible) .dialog-container{opacity:1}.dialog-title{padding:16px;flex-shrink:0}.dialog-content{padding:0 16px;overflow-y:auto}.dialog-actions{padding:16px;display:flex;justify-content:flex-end;gap:8px;flex-shrink:0}";const $=class{constructor(i){t(this,i),this.listItemClick=e(this,"listItemClick"),this.hasPrimaryTextSlot=!1,this.hasSecondaryTextSlot=!1,this.hasActionsSlot=!1,this.hasStatusChipSlot=!1,this.avatarBackgroundColor="info",this.avatarVariant="rounded",this.clickable=!1,this.variant="normal",this.handleClick=i=>{i.composedPath().some((i=>{var t,e;return(null===(t=i.classList)||void 0===t?void 0:t.contains("actions-container"))||(null===(e=i.classList)||void 0===e?void 0:e.contains("status-chip-container"))}))||this.clickable&&(this.listItemClick.emit(i),this.onClick&&this.onClick(i))},this.handleKeyPress=i=>{!this.clickable||"Enter"!==i.key&&" "!==i.key||(i.preventDefault(),this.handleClick(i))}}componentWillLoad(){this.hasPrimaryTextSlot=!!this.hostEl.querySelector('[slot="primary-text"]'),this.hasSecondaryTextSlot=!!this.hostEl.querySelector('[slot="secondary-text"]'),this.hasActionsSlot=!!this.hostEl.querySelector('[slot="actions"]'),this.hasStatusChipSlot=!!this.hostEl.querySelector('[slot="status-chip"]')}render(){const t=this.primaryText||this.hasPrimaryTextSlot,e=this.secondaryText||this.hasSecondaryTextSlot;return i(s,{key:"4e8edba80d5983c2f878b2ad0731b72238ea882e"},i("div",{key:"568adde99ec3bc362ab34d2c31c9e307002acac2",class:{"list-item":!0,clickable:this.clickable,"variant-compact":"compact"===this.variant},onClick:this.handleClick,onKeyPress:this.handleKeyPress,role:this.clickable?"button":void 0,tabindex:this.clickable?0:-1},this.iconName&&i("div",{key:"61b51b5dede1f2705dcc7b2825348a07c0a80efa",class:"avatar-container"},i("udp-avatar",{key:"108678bcb61b90c1390a54582e6388384d1ebd1e",iconName:this.iconName,variant:this.avatarVariant,color:this.avatarBackgroundColor})),i("div",{key:"10eac3586f355e87339e03d94ac41af2d1ef097b",class:"text-container"},t&&i("div",{key:"c3c0f2e589d2c5ba83840a6b08869f13d8ba2ff1",class:"primary-text"},i("slot",{key:"b01581a16a642c52e0700f7ccd19037d1b59958f",name:"primary-text"},i("unity-typography",{key:"01fcd927aeeb074067d03f795d123985f3a52bcb",variant:"body"},this.primaryText))),e&&i("div",{key:"a5bc8b98b185424a82d06d97a29ba4c2c32bc8c3",class:"secondary-text"},i("slot",{key:"da8cbda21c28f6ba5873d5eaf0f694ad906bb14f",name:"secondary-text"},i("unity-typography",{key:"f5d19214b90eb6c2b8a992dc43e529761d394d40",variant:"caption-text",color:"textSecondary"},this.secondaryText)))),this.hasStatusChipSlot&&i("div",{key:"3bcf146d66ec6671beefe002f3f5a84a2dd23944",class:"status-chip-container"},i("slot",{key:"9b5e6d67c50f113a52b3b20054a8d81a744d1f23",name:"status-chip"})),this.hasActionsSlot&&i("div",{key:"20a822232840d162030142618fcfc762d0d95e92",class:"actions-container"},i("slot",{key:"305560605b78e8f02ed30052e9013eb9b01b5a01",name:"actions"}))))}get hostEl(){return o(this)}};$.style=".list-item{display:flex;flex-direction:row;align-items:center;padding:var(--spacing-3, 12px) var(--spacing-4, 16px);background-color:var(--card-background-color, #FFF);transition:background-color 0.1s;gap:var(--spacing-4, 16px);position:relative}.list-item::after{content:'';position:absolute;bottom:0;height:1px;background-color:var(--border-color, #e0e0e0);left:var(--spacing-4, 16px);right:var(--spacing-4, 16px)}.list-item.variant-compact{padding-top:var(--spacing-1, 4px);padding-bottom:var(--spacing-1, 4px)}.list-item.clickable{cursor:pointer}.list-item.clickable:hover{background-color:color-mix(in srgb, var(--card-background-color, #FFF) 95%, black)}.avatar-container{align-items:center}.text-container{flex-grow:1;display:flex;flex-direction:column;justify-content:center}.primary-text{font-weight:400;line-height:1.4}.secondary-text{margin-top:2px}.status-chip-container{display:flex;align-items:center;flex-shrink:0}.actions-container{display:flex;flex-shrink:0}";export{E as ag_grid_base,I as ghost_render,R as grid_header,z as hint_panel,M as udp_dialog,$ as udp_list_item}
1
+ import{h as i,r as t,c as e,a as o,H as s}from"./index-DFnjA9NX.js";import{ModuleRegistry as n,themeQuartz as a,createGrid as r}from"ag-grid-community-v33";import{AllEnterpriseModule as c,LicenseManager as d}from"ag-grid-enterprise-v33";import{x as l,i as h,s as u,u as p,p as b,y as m,w as v,o as g}from"./apiUtils-11-yfzUs.js";import{g as f}from"./iconUtils-DcPvHO4A.js";import{g as y}from"./getCurrentApiCatalogId-DeurXd9l.js";import{C as x}from"./configService-BqLfkVKh.js";import{g as k}from"./tenantUtils-Basdb1b1.js";import{S as w,I as C,D as _,C as S,A as O}from"./currency-renderer-D6zBtP2s.js";import{c as N}from"./configureUdpColumnMods-CoCTzhve.js";import j from"lodash/isEqual";import"deep-equal";import"./makeApiCall-2umiVB6u.js";import"axios";import"@stencil/store";import"./iconMapping-CPerGeNF.js";import"@carbon/icons/es/add/16";import"@carbon/icons/es/add/32";import"@carbon/icons/es/add--alt/16";import"@carbon/icons/es/add--filled/16";import"@carbon/icons/es/arrows--horizontal/16";import"@carbon/icons/es/attachment/16";import"@carbon/icons/es/batch-job/16";import"@carbon/icons/es/box/16";import"@carbon/icons/es/close/16";import"@carbon/icons/es/close/24";import"@carbon/icons/es/close/32";import"@carbon/icons/es/close--filled/16";import"@carbon/icons/es/close--outline/16";import"@carbon/icons/es/checkmark/16";import"@carbon/icons/es/checkmark/24";import"@carbon/icons/es/checkmark/32";import"@carbon/icons/es/chevron--left/16";import"@carbon/icons/es/chevron--right/16";import"@carbon/icons/es/chevron--down/16";import"@carbon/icons/es/data-enrichment/16";import"@carbon/icons/es/document/16";import"@carbon/icons/es/document--add/16";import"@carbon/icons/es/document--attachment/16";import"@carbon/icons/es/document--pdf/16";import"@carbon/icons/es/document--video/16";import"@carbon/icons/es/document--audio/16";import"@carbon/icons/es/draggable/16";import"@carbon/icons/es/edit/16";import"@carbon/icons/es/export/16";import"@carbon/icons/es/flag/16";import"@carbon/icons/es/information/16";import"@carbon/icons/es/information/32";import"@carbon/icons/es/link/16";import"@carbon/icons/es/overflow-menu--vertical/16";import"@carbon/icons/es/overflow-menu--vertical/32";import"@carbon/icons/es/return/16";import"@carbon/icons/es/save/16";import"@carbon/icons/es/settings/16";import"@carbon/icons/es/subtract/16";import"@carbon/icons/es/subtract--alt/16";import"@carbon/icons/es/subtract--filled/16";import"@carbon/icons/es/trash-can/16";import"@carbon/icons/es/user/16";import"@carbon/icons/es/view/16";import"@carbon/icons/es/warning/16";import"@carbon/icons/es/warning/32";import"@carbon/icons/es/warning--alt/16";import"@carbon/icons/es/warning--alt/32";import"@carbon/icons/es/product/16";import"@carbon/icons/es/workspace/16";import"@carbon/icons/es/arrow--up/16";import"@carbon/icons/es/arrow--down/16";import"@carbon/icons/es/arrow--right/16";import"@carbon/icons/es/arrow--left/16";import"@carbon/icons/es/copy/16";import"@carbon/icons/es/star/16";import"@carbon/icons/es/data-table/16";import"@carbon/icons/es/fit-to-width/16";import"@carbon/icons/es/search--advanced/16";import"@carbon/icons/es/reset/16";import"@carbon/icons/es/column/16";import"@carbon/icons/es/column--delete/16";import"@carbon/icons/es/watson-health/rotate--360/16";import"@carbon/icons/es/filter/16";import"@carbon/icons/es/app-connectivity/16";import"@carbon/icons/es/text--font/16";import"@carbon/icons/es/text--long-paragraph/16";import"@carbon/icons/es/character--whole-number/16";import"@carbon/icons/es/checkbox--checked/16";import"@carbon/icons/es/radio-button--checked/16";import"@carbon/icons/es/event--schedule/16";import"@carbon/icons/es/view--off/16";import"@carbon/icons/es/time/16";import"@carbon/icons/es/calendar/16";import"@carbon/icons/es/list--checked/16";import"@carbon/icons/es/list--bulleted/16";import"@carbon/icons/es/cloud--upload/16";import"@carbon/icons/es/locked/16";import"@carbon/icons/es/pause/16";import"@carbon/icons/es/unlocked/16";import"@carbon/icons/es/send/16";import"@carbon/icons/es/email/16";import"@carbon/icons/es/checkmark--outline/16";import"@carbon/icons/es/migrate--alt/16";import"@carbon/icons/es/checkbox--checked--filled/16";import"@carbon/icons/es/checkbox/16";import"@carbon/icons/es/ZIP/16";import"@carbon/icons/es/image/16";import"@carbon/icons/es/PPT/16";import"@carbon/icons/es/XLS/16";function A(){return sessionStorage.getItem("user-id")}const T=async i=>{(null===document||void 0===document?void 0:document.startViewTransition)?(document.viewTransition&&await document.viewTransition.finished,document.startViewTransition(i)):i()},F={agGridExport:class{constructor(i="export.csv"){this.fileName=i}init(i){this.gridApi=i}onAction(i){"agGridExport"===i&&this.gridApi.exportDataAsCsv({fileName:this.fileName})}},openSavedViews:class{constructor(){this.isSidesheetOpen=!1,this.isDialogOpen=!1,this.viewName="",this.viewIsPrivate=!0,this.filteredViews=[],this.allViewData=[],this.activeView=null,this.loading=0,this.initialLoad=!0,this.addStateChangeListeners=()=>{this.api.addEventListener("columnVisible",this.handleManualColumnChange),this.api.addEventListener("columnPinned",this.handleManualColumnChange),this.api.addEventListener("columnMoved",this.handleManualColumnChange),this.api.addEventListener("columnPivotChanged",this.handleManualColumnChange),this.api.addEventListener("gridColumnsChanged",this.handleManualColumnChange),this.api.addEventListener("columnsReset",this.handleManualColumnChange),this.api.addEventListener("filterChanged",this.handleManualColumnChange),this.api.addEventListener("sortChanged",this.handleManualColumnChange)},this.removeStateChangeListeners=()=>{this.api.removeEventListener("columnVisible",this.handleManualColumnChange),this.api.removeEventListener("columnPinned",this.handleManualColumnChange),this.api.removeEventListener("columnMoved",this.handleManualColumnChange),this.api.removeEventListener("columnPivotChanged",this.handleManualColumnChange),this.api.removeEventListener("gridColumnsChanged",this.handleManualColumnChange),this.api.removeEventListener("columnsReset",this.handleManualColumnChange),this.api.removeEventListener("filterChanged",this.handleManualColumnChange),this.api.removeEventListener("sortChanged",this.handleManualColumnChange)},this.fetchViews=async()=>{var i,t;0!==(null===(i=this.api.getColumnDefs())||void 0===i?void 0:i.length)&&(this.loading=1,this.refresh(),this.api.removeEventListener("gridColumnsChanged",this.fetchViews),this.gridId=null===(t=this.api.getGridOption("context"))||void 0===t?void 0:t.gridId,this.gridId&&(this.allViewData=await l(A(),this.gridId),this.filterData(),this.initialLoad&&this.setDefaultView()),this.loading=0)},this.setDefaultView=()=>{const i=this.filteredViews.find((i=>null==i?void 0:i.isDefault));i&&this.setActiveView(i),this.initialLoad=!1},this.filterData=()=>{var i,t;this.entityName=null===(i=this.api.getGridOption("context"))||void 0===i?void 0:i.entityName,this.filteredViews=this.entityName?null===(t=this.allViewData)||void 0===t?void 0:t.filter((i=>(null==i?void 0:i.domain)===this.entityName)):this.allViewData,this.refresh()},this.setActiveView=i=>{var t,e;this.removeStateChangeListeners();const o=null===(t=null==i?void 0:i.gridViewGridViewGridConfiguration)||void 0===t?void 0:t.find((i=>1===i.gridViewGridConfigurationGridConfiguration.gridStateTypeId)),s=null===(e=null==i?void 0:i.gridViewGridViewGridConfiguration)||void 0===e?void 0:e.find((i=>4===i.gridViewGridConfigurationGridConfiguration.gridStateTypeId));if(o){const i={state:JSON.parse(o.gridViewGridConfigurationGridConfiguration.values),applyOrder:!0};this.api.applyColumnState(i)}this.api.setFilterModel(s?JSON.parse(s.gridViewGridConfigurationGridConfiguration.values):null),this.handleSidesheetClose(),T((()=>{this.activeView=i,this.refresh(),setTimeout(this.addStateChangeListeners,300)}))},this.deleteView=async i=>{this.loading=1,this.refresh(),await h(i.gridViewId,(()=>{this.fetchViews()})),this.loading=0,this.refresh()},this.postViewCallback=()=>{this.loading=0,this.fetchViews(),this.handleDialogClose()},this.removeActiveView=()=>{this.removeStateChangeListeners(),this.api.resetColumnState(),this.api.setFilterModel(null),T((()=>{this.activeView=null,this.refresh()}))},this.handleManualColumnChange=async()=>{this.removeStateChangeListeners(),this.activeView&&T((()=>{this.activeView=null,this.refresh()}))},this.handleNameChange=i=>{this.viewName=i.target.value,this.refresh()},this.handleViewIsPrivateToggleChange=()=>{this.viewIsPrivate=!this.viewIsPrivate,this.refresh()},this.handleSidesheetClose=()=>{this.isSidesheetOpen=!1,this.refresh()},this.handleDialogClose=()=>{this.isDialogOpen=!1,this.viewName="",this.refresh()},this.handleOpenModal=()=>{this.isDialogOpen=!0,this.refresh()}}init(i,t){this.api=i,this.refresh=t,this.api.addEventListener("gridColumnsChanged",this.fetchViews)}onAction(i){if("openSavedViews"===i){const i=this.api.getGridOption("context");(null==i?void 0:i.gridId)!==this.gridId?this.fetchViews():(null==i?void 0:i.entityName)!==this.entityName&&this.filterData(),this.isSidesheetOpen=!0,this.refresh()}}async postView(){var i,t;this.loading=1,this.refresh();const e=[];e.push({gridStateTypeId:1,gridId:null===(i=this.api.getGridOption("context"))||void 0===i?void 0:i.gridId,values:JSON.stringify(this.api.getColumnState())}),e.push({gridStateTypeId:4,gridId:null===(t=this.api.getGridOption("context"))||void 0===t?void 0:t.gridId,values:JSON.stringify(this.api.getFilterModel())});const o=this.api.getGridOption("context");try{await u(A(),null==o?void 0:o.gridId,y(),this.viewName,null==o?void 0:o.entityName,e,!0===this.viewIsPrivate?1:2,0,this.postViewCallback)}catch(i){console.error(i)}finally{this.refresh()}}async updateViewMarkedAsPrimary(i){this.loading=1,this.refresh();const t=this.api.getGridOption("context"),e=null==i?void 0:i.isDefault;await p(null==i?void 0:i.gridViewId,A(),null==t?void 0:t.gridId,y(),null==i?void 0:i.name,e?0:1,null==t?void 0:t.entityName,!0===this.viewIsPrivate?1:2,(()=>null)).then((async()=>{if(!e){const i=this.filteredViews.find((i=>null==i?void 0:i.isDefault));i&&await p(null==i?void 0:i.gridViewId,A(),null==t?void 0:t.gridId,y(),null==i?void 0:i.name,0,null==t?void 0:t.entityName,!0===this.viewIsPrivate?1:2,(()=>null)).catch((i=>console.log(i)))}await this.fetchViews(),this.loading=0,this.refresh()})).catch((i=>console.log(i)))}render(){var t,e;return i("div",null,i("div",{style:{viewTransitionName:"active-view-chip"},class:"grid-action-transition"},this.activeView&&i("div",{style:{margin:"4px"}},i("udp-chip",{label:null===(t=this.activeView)||void 0===t?void 0:t.name,variant:"filled",color:"secondary",deleteButton:!0,onChipDelete:this.removeActiveView}))),i("udp-dialog",{open:this.isDialogOpen,actionOne:()=>{this.postView()},actionTwo:this.handleDialogClose,handleClose:this.handleDialogClose,labelOne:"Create View",labelTwo:"Cancel",title:"Create a grid view",message:"The view will be created from the current column and filter state.",disableOne:!this.viewName,progress:this.loading},i("div",{style:{display:"flex",flexDirection:"column"}},i("div",{style:{marginBottom:"-4px",marginTop:"2em"}},i("text-field",{value:this.viewName,onInput:this.handleNameChange,placeholder:"View name"})),i("div",{style:{marginTop:"-4px"}},i("stencil-toggle",{label:"Private",checked:this.viewIsPrivate,onChange:this.handleViewIsPrivateToggleChange})))),i("udp-side-sheet",{title:"Views",open:this.isSidesheetOpen,position:"right",onUdpSideSheetClose:this.handleSidesheetClose,headerActionButtonLabel:"Create View",onUdpHeaderActionButtonClick:this.handleOpenModal,headerActionButtonIcon:"add",loading:!!this.loading},i("div",{style:{display:"flex",flexDirection:"column",gap:"10px"}},i("hint-panel",{hint:"Quickly access and manage your pre-configured grid views. These views are designed to help you focus on specific sets of data and streamline your workflow.",hideHintText:"Dismiss"}),this.entityName&&i("hint-panel",{hint:"Note: Displaying entity specific views."}),i("div",null,(null===(e=this.filteredViews)||void 0===e?void 0:e.length)>0?this.filteredViews.map((t=>{var e;return i("udp-list-item",{primaryText:t.name,clickable:!0,onListItemClick:()=>this.setActiveView(t)},i("div",{style:{display:"flex",flexDirection:"row",gap:"4px"},slot:"status-chip"},(null===(e=this.activeView)||void 0===e?void 0:e.gridViewId)===t.gridViewId&&i("udp-chip",{label:"Active",color:"success",variant:"filled"}),1===t.gridViewVisibilityTypeId&&i("udp-chip",{label:"Private",color:"gray",variant:"outlined"})),i("div",{slot:"actions"},i("udp-icon-button",{icon:f("star"),size:"small",variant:t.isDefault?"contained":"text",tooltip:2===t.gridViewVisibilityTypeId?"Cannot mark public view as primary":t.isDefault?"Remove as primary":"Mark as primary",onClick:()=>this.updateViewMarkedAsPrimary(t),disabled:2===t.gridViewVisibilityTypeId}),i("udp-icon-button",{icon:f("trashCan"),size:"small",variant:"text",tooltip:t.userId!==A()?"Cannot delete public view with different owner":"Delete View",onClick:()=>this.deleteView(t),disabled:t.userId!==A()})))})):i("udp-empty-state-display",{primaryText:"No Views to display"})))))}},agGridSizeColumnsToFit:class{init(i){this.gridApi=i}onAction(i){"agGridSizeColumnsToFit"===i&&this.gridApi.sizeColumnsToFit()}},agGridAutoSizeColumns:class{init(i){this.gridApi=i}onAction(i){"agGridAutoSizeColumns"===i&&this.gridApi.autoSizeAllColumns()}},bulkActions:class{constructor(){this.bulkActions=[],this.selectedRowCount=0,this.fetchedData=!1,this.isMenuOpen=!1,this.onRowSelectionChanged=()=>{var i;T((()=>{const i=this.api.getSelectedRows();this.selectedRows=i,this.selectedRowCount=i.length,this.refresh()})),this.fetchedData&&(null===(i=this.api.getGridOption("context"))||void 0===i?void 0:i.gridId)===this.gridId||this.fetchBulkActions()},this.setBulkActions=i=>{const t=i.map((i=>({label:i.name,onClick:()=>this.executeActionProviderAction(i.actionId)}))),e=this.localFunctions.map((i=>({label:i.label,onClick:()=>this.executeLocalFunction(i.label)})));this.bulkActions=[...t,...e],this.fetchedData=!0,this.refresh()},this.executeLocalFunction=i=>{const t=this.localFunctions.find((t=>t.label===i));t&&t.callback(this.selectedRows),this.refresh()},this.executeActionProviderAction=i=>{this.actionProviderCallback&&this.actionProviderCallback(i,this.selectedRows),this.refresh()},this.toggleMenu=()=>{this.isMenuOpen=!this.isMenuOpen,this.refresh()},this.closeMenu=()=>{this.isMenuOpen=!1,this.refresh()}}init(i,t,e){this.api=i,this.refresh=t,this.actionProviderCallback=null==e?void 0:e.actionProviderCallback,this.localFunctions=null==e?void 0:e.localFunctions;const o=this.api.getGridOption("rowModelType");this.api.setGridOption("rowSelection","clientSide"===o?{mode:"multiRow",enableClickSelection:!0}:{mode:"multiRow",enableClickSelection:!0,headerCheckbox:!1}),this.api.addEventListener("selectionChanged",this.onRowSelectionChanged)}onAction(i){"executeBulkAction"===i&&this.refresh()}async fetchBulkActions(){var i;try{this.gridId=null===(i=this.api.getGridOption("context"))||void 0===i?void 0:i.gridId,await b(this.gridId,!1,[],this.setBulkActions)}catch(i){console.error(i)}}render(){var t;return i("div",{style:{viewTransitionName:"bulk-action-button"},class:"grid-action-transition"},this.selectedRowCount>0&&[i("div",{style:{margin:"2px"}},i("udp-button",{ref:i=>{this.menuAnchorEl=i||void 0},onClick:this.toggleMenu,variant:"outlined",color:"primary",endIcon:i("udp-icon",{iconName:"chevronDown",style:{transform:this.isMenuOpen?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease-in-out"}})},`${this.selectedRowCount} Selected`)),i("udp-menu",{open:this.isMenuOpen,anchor:this.menuAnchorEl,handleClose:this.closeMenu},0===(null===(t=this.bulkActions)||void 0===t?void 0:t.length)?i("udp-menu-item",{label:"No available actions"}):this.bulkActions.map((t=>i("udp-menu-item",{label:t.label,onItemClick:()=>{t.onClick(),this.isMenuOpen=!1}}))))])}},chipFilter:class{constructor(){this.handleFilterChanged=i=>{var t,e,o;const s=null===(e=null===(t=null==i?void 0:i.columns)||void 0===t?void 0:t[0])||void 0===e?void 0:e.colId,n=null===(o=this.filterChips)||void 0===o?void 0:o.find((i=>i.field===s));if(n){const i=this.api.getColumnFilterModel(s),t=Object.assign(Object.assign({},n),{filterObjects:n.filterObjects.map((t=>{let e=!1;return(null==i?void 0:i.conditions)&&"AND"===(null==i?void 0:i.operator)?e=i.conditions.some((i=>JSON.stringify(i)===JSON.stringify(t.agGridFilterModel[s]))):i&&(e=JSON.stringify(i)===JSON.stringify(t.agGridFilterModel[s])),Object.assign(Object.assign({},t),{toggled:e})}))});this.filterChips=this.filterChips.map((i=>i.field===s?t:i)),this.refresh()}},this.syncChipsWithGridFilters=()=>{if(!this.filterChips||0===this.filterChips.length)return;const i=this.filterChips.map((i=>{const t=i.field,e=this.api.getColumnFilterModel(t);if(!e)return i;const o=i.filterObjects.map((i=>{let o=!1;return o=(null==e?void 0:e.conditions)&&"AND"===(null==e?void 0:e.operator)?e.conditions.some((e=>JSON.stringify(e)===JSON.stringify(i.agGridFilterModel[t]))):JSON.stringify(e)===JSON.stringify(i.agGridFilterModel[t]),Object.assign(Object.assign({},i),{toggled:o})}));return Object.assign(Object.assign({},i),{filterObjects:o})}));this.filterChips=i},this.getGridfilterChips=async()=>{var i,t;if(this.gridId!==(null===(i=this.api.getGridOption("context"))||void 0===i?void 0:i.gridId)){this.gridId=null===(t=this.api.getGridOption("context"))||void 0===t?void 0:t.gridId;const i=(await m(this.gridId,7)).map((i=>JSON.parse(i.values)));T((async()=>{this.filterChips=i.map((i=>Object.assign(Object.assign({},i),{filterObjects:i.filterObjects.map((i=>Object.assign(Object.assign({},i),{toggled:!1})))}))),this.syncChipsWithGridFilters(),this.getFilterChipCounts(),this.refresh()}))}},this.getFilterChipCounts=async()=>{var i;const t={pageNumber:1,pageSize:1,filterElements:[],filterGroups:[],orderElements:[],groupingType:"",groupProperty:[],groupOperationList:[],eagerLoad:!1,logicalSearchOperator:1},e=[];for(const o of this.filterChips){if(!(null==o?void 0:o.udpDomainSanitizedName))continue;const s=await v(y(),o.udpDomainSanitizedName,!0);for(const n of null!==(i=o.filterObjects)&&void 0!==i?i:[])(null==n?void 0:n.udpFilterElement)&&e.push((async()=>{var i;const e=Object.assign(Object.assign({},t),{filterElements:[n.udpFilterElement]});return{result:await g(e,null===(i=null==s?void 0:s.unityBaseSearchMethod)||void 0===i?void 0:i.apiMethodId,x.config.UNITY_API_DOMAIN,!1),groupField:o.field,objLabel:n.label}})())}const o=await Promise.all(e);this.filterChips=this.filterChips.map((i=>{const t=o.filter((t=>t.groupField===i.field));return Object.assign(Object.assign({},i),{filterObjects:i.filterObjects.map((i=>{var e,o;const s=t.find((t=>t.objLabel===i.label));return Object.assign(Object.assign({},i),{resultCount:null!==(o=null===(e=null==s?void 0:s.result)||void 0===e?void 0:e.total)&&void 0!==o?o:null})}))})})),this.refresh()},this.setSelectedFilterChip=i=>{this.filterChips=this.filterChips.map((t=>Object.assign(Object.assign({},t),{filterObjects:t.filterObjects.map((t=>t.label===i.label?Object.assign(Object.assign({},t),{toggled:!t.toggled}):t))}))),this.refresh();const t=Object.keys(i.agGridFilterModel)[0];!function(i,t,e){var o,s;const n=i.getColumn(t);if(!n)return void console.error("Invalid column id provided for filtering");if(!(null===(o=null==n?void 0:n.colDef)||void 0===o?void 0:o.filter))return void console.error(`Filtering not enabled for column: ${null==n?void 0:n.colId}`);const a=i.getColumnFilterModel(t);if(JSON.stringify(e)!==JSON.stringify(a)){if(null===(s=null==a?void 0:a.conditions)||void 0===s?void 0:s.some((i=>JSON.stringify(i)===JSON.stringify(e)))){const o=null==a?void 0:a.conditions.filter((i=>JSON.stringify(i)!==JSON.stringify(e)));if(1===o.length)return void i.setColumnFilterModel(t,o[0]).then((()=>i.onFilterChanged()));{const e=Object.assign(Object.assign({},a),{conditions:o});return void i.setColumnFilterModel(t,e).then((()=>i.onFilterChanged()))}}if(a)if(null==a?void 0:a.conditions){const o=[...null==a?void 0:a.conditions,e];i.setColumnFilterModel(t,{conditions:o,operator:"AND"}).then((()=>i.onFilterChanged()))}else a&&i.setColumnFilterModel(t,{conditions:[Object.assign({},a),e],operator:"AND"}).then((()=>i.onFilterChanged()));else i.setColumnFilterModel(n,e).then((()=>i.onFilterChanged()))}else i.setColumnFilterModel(t,null).then((()=>i.onFilterChanged()))}(this.api,t,i.agGridFilterModel[t])}}init(i,t){this.api=i,this.refresh=t,this.api.addEventListener("firstDataRendered",this.getGridfilterChips),this.api.addEventListener("filterChanged",this.handleFilterChanged)}onAction(i){"chipFilter"===i&&this.refresh()}render(){var t;return i("div",{class:"grid-action-transition",style:{display:"flex",flexWrap:"nowrap",gap:"5px",viewTransitionName:"view-chip-filters"}},(null===(t=this.filterChips)||void 0===t?void 0:t.length)>0&&this.filterChips.map(((t,e)=>[e>0&&i("div",{style:{width:"1px",backgroundColor:"#ddd",marginBottom:"5px",marginTop:"5px"}}),i("div",{style:{padding:"4px",display:"flex",flexWrap:"nowrap",gap:"3px"}},t.filterObjects.map((t=>i("udp-chip",{label:`${t.label} ${null!=t.resultCount?`(${t.resultCount})`:""}`,variant:t.toggled?"filled":"outlined",clickable:!0,onChipClick:()=>this.setSelectedFilterChip(t),color:"primary"}))))])))}},restoreGridState:class{constructor(){this.getPreviousState=()=>{T((()=>{this.api.removeEventListener("stateUpdated",this.saveState);const i=this.api.getGridOption("context");this.gridId=null==i?void 0:i.gridId,this.apiMethodInstanceId=(null==i?void 0:i.apiMethodInstanceId)||"",this.previousState=JSON.parse(localStorage.getItem(this.getStorageKey())),this.refresh(),this.api.addEventListener("stateUpdated",this.saveState)}))},this.getStorageKey=()=>{const i=k();return`saved-grid-state-${this.gridId}-${this.apiMethodInstanceId}-${i}`},this.saveState=()=>{const i=this.api.getGridOption("context");if((null==i?void 0:i.gridId)!==this.gridId||(null==i?void 0:i.apiMethodInstanceId)&&(null==i?void 0:i.apiMethodInstanceId)!==this.apiMethodInstanceId)this.getPreviousState();else{const i=this.api.getState();localStorage.setItem(this.getStorageKey(),JSON.stringify({date:new Date,state:i}))}},this.restoreState=async()=>{this.api.setState(this.previousState.state),setTimeout((()=>T((()=>{this.previousState=null,this.refresh()}))),0)},this.dismissMessage=()=>{T((()=>{this.previousState=null,this.refresh()}))}}init(i,t){this.api=i,this.refresh=t,this.api.addEventListener("firstDataRendered",this.getPreviousState)}getTimeAgo(i){const t=Math.floor((Date.now()-i.getTime())/1e3);if(t<60)return`${t} second${1!==t?"s":""} ago`;const e=Math.floor(t/60);if(e<60)return`${e} minute${1!==e?"s":""} ago`;const o=Math.floor(e/60);if(o<24)return`${o} hour${1!==o?"s":""} ago`;const s=Math.floor(o/24);return`${s} day${1!==s?"s":""} ago`}render(){var t;return i("div",{style:{viewTransitionName:"restore-grid-state"}},(null===(t=this.previousState)||void 0===t?void 0:t.date)&&i("div",{style:{margin:"4px"}},i("udp-ambient-tool-tip",{content:`Restore grid state from ${this.getTimeAgo(new Date(this.previousState.date))}?`},i("udp-chip",{startIcon:"rotate",label:"Restore state",variant:"outlined",color:"gray",deleteButton:!0,onChipDelete:this.dismissMessage,clickable:!0,onClick:this.restoreState}))))}},agGridResetColumns:class{init(i){this.gridApi=i}onAction(i){"agGridResetColumns"===i&&(this.gridApi.resetColumnState(),this.gridApi.setFilterModel(null))}},advancedSearch:class{init(i,t,e){this.onOpenCallback=null==e?void 0:e.callback}onAction(i){var t;"advancedSearch"===i&&(null===(t=this.onOpenCallback)||void 0===t||t.call(this))}},agGridHideShowColumns:class{init(i){this.gridApi=i}onAction(i){"agGridHideShowColumns"===i&&this.gridApi.showColumnChooser()}},udpExport:class{init(i,t,e){this.onOpenCallback=null==e?void 0:e.callback,this.api=i}onAction(i){var t;if("udpExport"===i){const i=this.api.getGridOption("context");null===(t=this.onOpenCallback)||void 0===t||t.call(this,null==i?void 0:i.searchObject,null==i?void 0:i.entityName)}}}},D=i=>{const t=i.value;if(null==t)return"";const e=new Date(t);return e?`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")} ${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`:""},G=a.withParams({wrapperBorderRadius:0,wrapperBorder:!1,headerCellHoverBackgroundColor:"var(--udp-grid-column-header-bg-hover)",borderColor:"#E9ECEF"}),E=class{constructor(i){t(this,i),this.gridReady=e(this,"gridReady"),this.headerConfig={},this.gridFunctions=[],this.refreshKey=0,this.gridFunctionInstances=[],this.updateGridHeight=()=>{if(this.gridEl){const i=this.gridEl.getBoundingClientRect(),t=window.innerHeight-i.top,e=10;this.gridEl.style.height=(t-e>400?t-e:400)+"px"}},this.scheduleHeightUpdate=()=>{clearTimeout(this.resizeDebounce),this.resizeDebounce=setTimeout(this.updateGridHeight,100)},this.refreshGridFunctions=()=>{this.refreshKey++},this.onGridReady=i=>{this.gridApi=i.api,this.updateGridContextValues(),this.gridFunctionInstances=this.gridFunctions.map((i=>{const t=F[i.name];if(!t)return null;const e=new t;return e.init(this.gridApi,this.refreshGridFunctions,i.params),e})).filter((i=>!!i)),this.gridApiCallback&&this.gridApiCallback({refreshServerSide:()=>this.gridApi.refreshServerSide(),getSelectedRows:()=>this.gridApi.getSelectedRows(),getSelectedNodes:()=>this.gridApi.getSelectedNodes(),getSearchObject:()=>{var i;return null===(i=this.gridApi.getGridOption("context"))||void 0===i?void 0:i.searchObject},getEntityName:()=>{var i;return null===(i=this.gridApi.getGridOption("context"))||void 0===i?void 0:i.entityName},getRowCount:()=>{var i;return null===(i=this.gridApi.getGridOption("context"))||void 0===i?void 0:i.rowCount},getFilterModel:()=>this.gridApi.getFilterModel(),setFilterModel:i=>this.gridApi.setFilterModel(i),onFilterChanged:()=>this.gridApi.onFilterChanged(),expandAll:()=>this.gridApi.expandAll(),collapseAll:()=>this.gridApi.collapseAll(),toggleLoadingOverlay:i=>this.gridApi.setGridOption("loading",i),refreshCells:()=>this.gridApi.refreshCells(),refreshClientSideRowModel:i=>this.gridApi.refreshClientSideRowModel(i),selectAll:(i,t)=>this.gridApi.selectAll(i,t),deselectAll:(i,t)=>this.gridApi.deselectAll(i,t),getServerSideSelectionState:()=>this.gridApi.getServerSideSelectionState(),setServerSideSelectionState:i=>this.gridApi.setServerSideSelectionState(i),forEachNode:i=>this.gridApi.forEachNode(i),forEachNodeAfterFilterAndSort:i=>this.gridApi.forEachNodeAfterFilterAndSort(i)}),this.setColumnDefs(),this.gridReady.emit(this.gridApi)},this.onHeaderAction=i=>{this.gridFunctionInstances.forEach((t=>{var e;return null===(e=t.onAction)||void 0===e?void 0:e.call(t,i.detail.name,i.detail.payload)}))},this.updateGridContextValues=()=>{this.gridApi.setGridOption("context",Object.assign(Object.assign({},this.gridApi.getGridOption("context")),{entityName:this.entityName,gridId:this.gridId}))}}componentWillLoad(){n.registerModules([c]),d.setLicenseKey("Using_this_{AG_Grid}_Enterprise_key_{AG-080613}_in_excess_of_the_licence_granted_is_not_permitted___Please_report_misuse_to_legal@ag-grid.com___For_help_with_changing_this_key_please_contact_info@ag-grid.com___{Univerus_Software_Inc}_is_granted_a_{Single_Application}_Developer_License_for_the_application_{MAIS_eRec}_only_for_{1}_Front-End_JavaScript_developer___All_Front-End_JavaScript_developers_working_on_{MAIS_eRec}_need_to_be_licensed___{MAIS_eRec}_has_not_been_granted_a_Deployment_License_Add-on___This_key_works_with_{AG_Grid}_Enterprise_versions_released_before_{28_June_2026}____[v3]_[01]_MTc4MjYwMTIwMDAwMA==5c7d1487ecb13b28e75415d34b7cf694")}componentDidLoad(){var i,t,e,o;const s=Object.assign(Object.assign({tooltipShowMode:"whenTruncated",tooltipShowDelay:500},this.gridOptions),{columnTypes:{booleanChip:{cellRenderer:"iconRenderer",cellRendererParams:{iconMappingConfig:{true:{iconName:"checkMark24",color:"success"},false:{iconName:"close24",color:"error"}}}}},dataTypeDefinitions:{dateTimeString:{baseDataType:"dateTimeString",extendsDataType:"dateTimeString",valueFormatter:D},boolean:{baseDataType:"boolean",extendsDataType:"boolean",columnTypes:"booleanChip"}},gridId:this.gridId,onGridReady:this.onGridReady,theme:G,components:Object.assign({actionsRenderer:O,currencyRenderer:S,dateTimeCellRenderer:_,iconRenderer:C,statusRenderer:w},null===(i=this.gridOptions)||void 0===i?void 0:i.components),domLayout:"normal",defaultColDef:Object.assign(Object.assign({sortable:!0,filter:!0,flex:1,minWidth:150,suppressHeaderMenuButton:!0},null===(t=this.gridOptions)||void 0===t?void 0:t.defaultColDef),{filterParams:Object.assign({buttons:["reset","apply"],closeOnApply:!0,maxNumConditions:10},null===(o=null===(e=this.gridOptions)||void 0===e?void 0:e.defaultColDef)||void 0===o?void 0:o.filterParams)})});r(this.el.querySelector("#myNewGrid"),s),this.gridHeight?this.gridEl.style.height=this.gridHeight:(this.updateGridHeight(),this.resizeObserver=new ResizeObserver(this.scheduleHeightUpdate),this.resizeObserver.observe(this.gridContainerEl))}disconnectedCallback(){var i;null===(i=this.gridApi)||void 0===i||i.destroy()}handleUpdateColumnDefs(i,t){j(i,t)||this.setColumnDefs()}setColumnDefs(){var i;if(this.columnDefs&&this.gridApi){const t=N(this.columnDefs,null===(i=this.gridFunctions)||void 0===i?void 0:i.some((i=>"advancedSearch"===(null==i?void 0:i.name))));this.gridApi.setGridOption("columnDefs",t)}}handleEntityNameChange(){this.updateGridContextValues()}render(){var t;const e=`variant-${(null===(t=this.headerConfig)||void 0===t?void 0:t.variant)||"light"}`;return i("div",{key:"24fa82598a8b3c7cd8908d279dd5d55fa56fb059",class:e,ref:i=>this.gridContainerEl=i},i("ghost-render",{key:"5a135714392f7edb7fee6d2146e231971ed0ca93"},i("div",{key:"f8a3749c2bff52ca09f110152d2a0c9d61d8458c"},i("udp-dialog",{key:"7c245a75a383f6acc3df2eae99beb1eca1b0ce3b"}),i("udp-list-item",{key:"00c826a169725fe7950b5f48e6c6018554885eaf"}),i("hint-panel",{key:"e36c1b28357c275c6d71caa245a5e5dfc0dcf8a8"}),i("udp-side-sheet",{key:"26ce13c227185842de854c0dca352a5bae875038"}))),i("div",{key:"97ec4f0e8a4e464965fddc7d27807797bf9690b1",class:"grid-base-header"},i("grid-header",{key:"2af72231d327d5ff5c6b6c082ca24c8389b71db6",headerConfig:this.headerConfig,gridFunctions:this.gridFunctions,onHeaderAction:this.onHeaderAction}),i("div",{key:"b3464f54b3c57d19d2deaa673e7a6b483573fa6c",class:"action-bar",style:{viewTransitionName:"action-bar"}},this.gridFunctionInstances.map((i=>{var t;return null===(t=i.render)||void 0===t?void 0:t.call(i)})))),i("div",{key:"851c7e4d8f06734ad7a0e5e5119ed61eb8556c57",id:"myNewGrid",ref:i=>this.gridEl=i,style:{viewTransitionName:"my-new-grid"}}))}get el(){return o(this)}static get watchers(){return{columnDefs:[{handleUpdateColumnDefs:0}],entityName:[{handleEntityNameChange:0}],gridId:[{handleEntityNameChange:0}]}}};E.style=":root{--udp-grid-base-header-bg:#EBECEF;--udp-grid-base-header-text:#000;--udp-grid-action-divider-color:rgba(0, 0, 0, 0.3);--udp-grid-action-bar-border-color:rgb(202, 197, 197)}.variant-dark{--udp-grid-base-header-bg:var(--primary-color-dark);--udp-grid-action-bar-bg:#F8F9FA;--udp-grid-column-header-bg:#F8F9FA;--udp-grid-column-header-bg-hover:#dce6f2;--udp-grid-column-header-text:var(--primary-color-dark);--udp-grid-action-bar-text-color:var(--primary-color-dark);--udp-grid-action-bar-border-color:rgba(0, 0, 0, 0.1)}.variant-light{--udp-grid-base-header-bg:#d8dfe6;--udp-grid-action-bar-bg:#f4f6f8;--udp-grid-column-header-bg:#f2f4f5;--udp-grid-column-header-bg-hover:#eef3f9;--udp-grid-column-header-text:var(--primary-color-dark);--udp-grid-action-bar-text-color:var(--primary-color-dark);--udp-grid-action-bar-border-color:rgba(0, 0, 0, 0.1)}::view-transition-group(*){animation-duration:0.2s}.grid-base-header{background-color:var(--udp-grid-base-header-bg);color:var(--udp-grid-base-header-text)}.action-bar{display:flex;flex-direction:row;align-items:center;flex-wrap:wrap;background-color:var(--udp-grid-action-bar-bg);color:var(--udp-grid-action-bar-text-color);padding:0px 8px 0px 12px;border-bottom:1px solid var(--udp-grid-action-bar-border-color)}.grid-wrapper{display:flex;flex-direction:column;height:100%}#myNewGrid{flex:1}";const I=class{constructor(i){t(this,i)}render(){return i(s,{key:"77d50c2b9c9ccbb58d00b4928fcbed63d13c1010"},i("slot",{key:"30730a259776f1452fca147be792d928ba2ee996"}))}};I.style=":host {\n display: none;\n }";const R=class{constructor(i){t(this,i),this.headerAction=e(this,"headerAction"),this.isMenuOpen=!1,this.toggleSettingsMenu=()=>{this.isMenuOpen=!this.isMenuOpen}}action(i,t){this.headerAction.emit({name:i,payload:t})}render(){var t,e,o,s,n,a,r,c,d,l,h,u,p,b,m,v,g,y,x,k,w,C,_,S;const O=!!(null===(e=null===(t=this.headerConfig)||void 0===t?void 0:t.title)||void 0===e?void 0:e.replace(/\u00A0/g," ").trim()),N=!!(null===(s=null===(o=this.headerConfig)||void 0===o?void 0:o.primaryActionButton)||void 0===s?void 0:s.label),j=((null===(a=null===(n=this.headerConfig)||void 0===n?void 0:n.secondaryActionButtons)||void 0===a?void 0:a.length)||0)>0,A=((null===(r=this.gridFunctions)||void 0===r?void 0:r.length)||0)>0;if(!(O||N||j||A))return null;const T=`variant-${(null===(c=this.headerConfig)||void 0===c?void 0:c.variant)||"light"}`,F=new Set(this.gridFunctions.map((i=>i.name))),D=["agGridSizeColumnsToFit","agGridAutoSizeColumns","agGridHideShowColumns","agGridResetColumns","agGridExport"].some((i=>F.has(i)));return i("div",{class:`header-bar ${T}`},i("unity-typography",{variant:"h6",color:"inherit"},this.headerConfig.title),i("div",{class:"actions"},D&&i("udp-icon-button",{class:{"settings-button":!0,"is-open":this.isMenuOpen},onClick:this.toggleSettingsMenu,ref:i=>{this.menuAnchorEl=i||void 0},icon:f("settings"),variant:"outlined",size:"small",color:"inherit"}),i("udp-menu",{open:this.isMenuOpen,anchor:this.menuAnchorEl,handleClose:()=>this.isMenuOpen=!1},F.has("agGridSizeColumnsToFit")&&i("udp-menu-item",{label:"Size Columns To Fit",iconName:"fitToWidth",onItemClick:()=>this.action("agGridSizeColumnsToFit")}),F.has("agGridAutoSizeColumns")&&i("udp-menu-item",{label:"Auto Size Columns",iconName:"column",onItemClick:()=>this.action("agGridAutoSizeColumns")}),F.has("agGridHideShowColumns")&&i("udp-menu-item",{label:"Hide/Show Columns",iconName:"hideColumn",onItemClick:()=>this.action("agGridHideShowColumns")}),F.has("agGridResetColumns")&&i("udp-menu-item",{label:"Reset Columns",iconName:"reset",onItemClick:()=>this.action("agGridResetColumns")}),F.has("agGridExport")&&i("udp-menu-item",{label:"CSV Export",iconName:"export",onItemClick:()=>this.action("agGridExport")})),F.has("openSavedViews")&&i("udp-chip",{color:"monochrome",variant:"outlined",startIcon:"dataTable",label:"Views",clickable:!0,onChipClick:()=>this.action("openSavedViews"),size:"medium"}),F.has("udpExport")&&i("udp-chip",{color:"monochrome",variant:"outlined",startIcon:"export",label:"Export",clickable:!0,onChipClick:()=>this.action("udpExport"),size:"medium"}),F.has("advancedSearch")&&i("udp-chip",{color:"monochrome",variant:"outlined",startIcon:"search",label:"Search",clickable:!0,onChipClick:()=>this.action("advancedSearch"),size:"medium"}),i("div",{class:"secondary-actions"},null===(l=null===(d=this.headerConfig)||void 0===d?void 0:d.secondaryActionButtons)||void 0===l?void 0:l.map((t=>i("udp-chip",{color:"monochrome",variant:"outlined",startIcon:null==t?void 0:t.iconName,label:null==t?void 0:t.label,clickable:!(null==t?void 0:t.disabled),onChipClick:t.onClick,size:"medium"})))),i("div",{class:"primary-action"},(null===(u=null===(h=this.headerConfig)||void 0===h?void 0:h.primaryActionButton)||void 0===u?void 0:u.label)&&i("udp-button",{variant:"contained",onButtonClick:null===(b=null===(p=this.headerConfig)||void 0===p?void 0:p.primaryActionButton)||void 0===b?void 0:b.onClick,color:"secondary",disabled:null===(v=null===(m=this.headerConfig)||void 0===m?void 0:m.primaryActionButton)||void 0===v?void 0:v.disabled,loading:null===(y=null===(g=this.headerConfig)||void 0===g?void 0:g.primaryActionButton)||void 0===y?void 0:y.loading,endIcon:(null===(k=null===(x=this.headerConfig)||void 0===x?void 0:x.primaryActionButton)||void 0===k?void 0:k.iconName)&&i("udp-icon",{iconName:null===(C=null===(w=this.headerConfig)||void 0===w?void 0:w.primaryActionButton)||void 0===C?void 0:C.iconName,color:"inherit"})},null===(S=null===(_=this.headerConfig)||void 0===_?void 0:_.primaryActionButton)||void 0===S?void 0:S.label))))}};R.style=".header-bar{display:flex;align-items:center;justify-content:space-between;padding:var(--spacing-03) var(--spacing-03) var(--spacing-03) var(--spacing-05);font-family:'Segoe UI', Tahoma, sans-serif;color:var(--grid-header-text);min-height:42px}.header-bar.variant-dark{--grid-header-text:#FFFFFF;--grid-header-icon-hover-bg:rgba(255, 255, 255, 0.12);}.header-bar.variant-light{--grid-header-text:black;--grid-header-icon-hover-bg:rgba(0, 0, 0, 0.08)}.header-bar .header-title{color:inherit;margin:0;white-space:nowrap}.header-bar .actions{display:flex;gap:0.4rem;flex-wrap:nowrap;align-items:center}.header-bar .secondary-actions{display:flex;gap:0.4rem}.menu-trigger-wrapper{position:relative;display:inline-flex}.settings-button{transition:transform 0.2s ease-in-out}.settings-button.is-open{transform:rotate(45deg)}";const z=class{constructor(i){t(this,i),this.showHint=!0,this.handleHideHint=()=>{this.showHint=!1}}render(){return i("div",{key:"a12706b04206a3155c828c4a3c74ab93f4f9a54b",class:"hint-container"},this.showHint&&i("div",{key:"61c421a9227f8da52e07b5a27c122aae9cbe7bd8",class:"hint-content"},i("div",{key:"e7e196b3de4cb3eff963e5663acb4b3665caa885"},i("unity-typography",{key:"326bafd6cc82f8020e49f59a5cd35174715bb34e",variant:"body"}," ",this.hint," ")),this.hideHintText&&i("div",{key:"8ff552c3eadde4f86cd793826bf5d2da1a6253f8",class:"hide-help"},i("udp-button",{key:"c4b13f7784eab8a0796d212489614cdd58bd6fe2",size:"small",color:"info",onClick:this.handleHideHint},this.hideHintText))))}};z.style=".hint-container{border-left:3px solid var(--info-color-main)}.hint-content{background-color:color-mix(in srgb, var(--info-color-hint) 70%, transparent);padding:8px}.hide-help{display:flex;justify-content:flex-end;margin-top:0.5rem}";const M=class{constructor(i){t(this,i),this.open=!1,this.titleId="dialog-title",this.descriptionId="dialog-description",this.buttonOneHidden=!1,this.buttonTwoHidden=!1,this.buttonThreeHidden=!0,this.originalBodyOverflow="",this.handleTransitionEnd=()=>{this.open||this.hostEl.parentElement!==document.body||document.body.removeChild(this.hostEl)},this.handleKeyDown=i=>{"Escape"===i.key&&this.handleClose&&this.handleClose()},this.handleOverlayClick=()=>{this.handleClose&&this.handleClose()}}handleOpenChange(i){i?(this.originalBodyOverflow=document.body.style.overflow,document.body.style.overflow="hidden",document.body.appendChild(this.hostEl),document.addEventListener("keydown",this.handleKeyDown),requestAnimationFrame((()=>{this.hostEl.classList.add("is-visible")}))):(this.hostEl.classList.remove("is-visible"),document.body.style.overflow=this.originalBodyOverflow,document.removeEventListener("keydown",this.handleKeyDown),this.hostEl.addEventListener("transitionend",this.handleTransitionEnd,{once:!0}))}disconnectedCallback(){"hidden"===document.body.style.overflow&&(document.body.style.overflow=this.originalBodyOverflow),document.removeEventListener("keydown",this.handleKeyDown)}render(){return i(s,{key:"5a90e0cfa060c1363fb823be98a2f3f7ff5682ef",onClick:this.handleOverlayClick},i("div",{key:"8ab6dd81074d401ed22b436c9cc21c21ec0210f8",class:"dialog-container",role:"dialog","aria-modal":"true","aria-labelledby":this.titleId,"aria-describedby":this.descriptionId,onClick:i=>i.stopPropagation()},i("div",{key:"6b4181bceeecbe7d316d13e902897b9dcfd3dff1",class:"dialog-title",id:this.titleId},i("unity-typography",{key:"cdc44f463dc5cce8fcc583fdb9b140cd0b651df2",variant:"h3"},this.title)),i("div",{key:"1b5147acd9da752ef77ece211e645b020766a90e",class:"dialog-content",id:this.descriptionId},this.message&&i("unity-typography",{key:"e3056d62d5b19dc4ab59491cd35ff5e876d5af69",variant:"body"},this.message),i("slot",{key:"7e3077ebd768e66fb38c96635d9270baa4e26b68"})),i("div",{key:"049b0fd822a3a6fd44264bd0c98db78bbe8860dc",class:"dialog-actions"},!this.buttonTwoHidden&&i("udp-button",{key:"4e2451c51e0d7f687e6a20208f7b128c9fa93cc8",variant:"text",disabled:this.disableTwo,onClick:()=>this.actionTwo()},this.labelTwo),!this.buttonThreeHidden&&i("udp-button",{key:"ffce2387c9aa1aed65706eb3901687e2f1843618",variant:"text",disabled:this.disableThree,onClick:()=>this.actionThree()},this.labelThree),!this.buttonOneHidden&&i("udp-button",{key:"66b2adc47093fa6f8ace3460390f59081451d2b9",variant:"contained",disabled:this.disableOne,onClick:()=>this.actionOne(),loading:!!this.progress},this.labelOne))))}get hostEl(){return o(this)}static get watchers(){return{open:[{handleOpenChange:0}]}}};M.style=":host{position:fixed;top:0;left:0;width:0;height:0;overflow:hidden;transform:translate(0);z-index:100000;display:flex;align-items:center;justify-content:center;visibility:hidden;background-color:rgba(0, 0, 0, 0);transition:background-color 0.2s ease-out, visibility 0s 0.2s, width 0s 0.2s, height 0s 0.2s;}:host(.is-visible){visibility:visible;background-color:rgba(0, 0, 0, 0.5);width:100%;height:100%;overflow:visible;transition-delay:0s}.dialog-container{background-color:#fff;box-shadow:0 12px 24px rgba(0, 0, 0, 0.16), 0 12px 24px rgba(0, 0, 0, 0.23);max-width:90vw;width:500px;max-height:90vh;display:flex;flex-direction:column;opacity:0;transition:opacity 0.2s ease-out}:host(.is-visible) .dialog-container{opacity:1}.dialog-title{padding:16px;flex-shrink:0}.dialog-content{padding:0 16px;overflow-y:auto}.dialog-actions{padding:16px;display:flex;justify-content:flex-end;gap:8px;flex-shrink:0}";const $=class{constructor(i){t(this,i),this.listItemClick=e(this,"listItemClick"),this.hasPrimaryTextSlot=!1,this.hasSecondaryTextSlot=!1,this.hasActionsSlot=!1,this.hasStatusChipSlot=!1,this.avatarBackgroundColor="info",this.avatarVariant="rounded",this.clickable=!1,this.variant="normal",this.handleClick=i=>{i.composedPath().some((i=>{var t,e;return(null===(t=i.classList)||void 0===t?void 0:t.contains("actions-container"))||(null===(e=i.classList)||void 0===e?void 0:e.contains("status-chip-container"))}))||this.clickable&&(this.listItemClick.emit(i),this.onClick&&this.onClick(i))},this.handleKeyPress=i=>{!this.clickable||"Enter"!==i.key&&" "!==i.key||(i.preventDefault(),this.handleClick(i))}}componentWillLoad(){this.hasPrimaryTextSlot=!!this.hostEl.querySelector('[slot="primary-text"]'),this.hasSecondaryTextSlot=!!this.hostEl.querySelector('[slot="secondary-text"]'),this.hasActionsSlot=!!this.hostEl.querySelector('[slot="actions"]'),this.hasStatusChipSlot=!!this.hostEl.querySelector('[slot="status-chip"]')}render(){const t=this.primaryText||this.hasPrimaryTextSlot,e=this.secondaryText||this.hasSecondaryTextSlot;return i(s,{key:"4e8edba80d5983c2f878b2ad0731b72238ea882e"},i("div",{key:"568adde99ec3bc362ab34d2c31c9e307002acac2",class:{"list-item":!0,clickable:this.clickable,"variant-compact":"compact"===this.variant},onClick:this.handleClick,onKeyPress:this.handleKeyPress,role:this.clickable?"button":void 0,tabindex:this.clickable?0:-1},this.iconName&&i("div",{key:"61b51b5dede1f2705dcc7b2825348a07c0a80efa",class:"avatar-container"},i("udp-avatar",{key:"108678bcb61b90c1390a54582e6388384d1ebd1e",iconName:this.iconName,variant:this.avatarVariant,color:this.avatarBackgroundColor})),i("div",{key:"10eac3586f355e87339e03d94ac41af2d1ef097b",class:"text-container"},t&&i("div",{key:"c3c0f2e589d2c5ba83840a6b08869f13d8ba2ff1",class:"primary-text"},i("slot",{key:"b01581a16a642c52e0700f7ccd19037d1b59958f",name:"primary-text"},i("unity-typography",{key:"01fcd927aeeb074067d03f795d123985f3a52bcb",variant:"body"},this.primaryText))),e&&i("div",{key:"a5bc8b98b185424a82d06d97a29ba4c2c32bc8c3",class:"secondary-text"},i("slot",{key:"da8cbda21c28f6ba5873d5eaf0f694ad906bb14f",name:"secondary-text"},i("unity-typography",{key:"f5d19214b90eb6c2b8a992dc43e529761d394d40",variant:"caption-text",color:"textSecondary"},this.secondaryText)))),this.hasStatusChipSlot&&i("div",{key:"3bcf146d66ec6671beefe002f3f5a84a2dd23944",class:"status-chip-container"},i("slot",{key:"9b5e6d67c50f113a52b3b20054a8d81a744d1f23",name:"status-chip"})),this.hasActionsSlot&&i("div",{key:"20a822232840d162030142618fcfc762d0d95e92",class:"actions-container"},i("slot",{key:"305560605b78e8f02ed30052e9013eb9b01b5a01",name:"actions"}))))}get hostEl(){return o(this)}};$.style=".list-item{display:flex;flex-direction:row;align-items:center;padding:var(--spacing-3, 12px) var(--spacing-4, 16px);background-color:var(--card-background-color, #FFF);transition:background-color 0.1s;gap:var(--spacing-4, 16px);position:relative}.list-item::after{content:'';position:absolute;bottom:0;height:1px;background-color:var(--border-color, #e0e0e0);left:var(--spacing-4, 16px);right:var(--spacing-4, 16px)}.list-item.variant-compact{padding-top:var(--spacing-1, 4px);padding-bottom:var(--spacing-1, 4px)}.list-item.clickable{cursor:pointer}.list-item.clickable:hover{background-color:color-mix(in srgb, var(--card-background-color, #FFF) 95%, black)}.avatar-container{align-items:center}.text-container{flex-grow:1;display:flex;flex-direction:column;justify-content:center}.primary-text{font-weight:400;line-height:1.4}.secondary-text{margin-top:2px}.status-chip-container{display:flex;align-items:center;flex-shrink:0}.actions-container{display:flex;flex-shrink:0}";export{E as ag_grid_base,I as ghost_render,R as grid_header,z as hint_panel,M as udp_dialog,$ as udp_list_item}