@ngxviewbuilder/runtime 0.11.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -1
- package/fesm2022/ngxviewbuilder-runtime-autocomplete-element-D627PmE6.mjs +1 -0
- package/fesm2022/ngxviewbuilder-runtime-avatar-element-Bq1dfv2w.mjs +1 -0
- package/fesm2022/ngxviewbuilder-runtime-badge-element-C2f14QNw.mjs +1 -0
- package/fesm2022/ngxviewbuilder-runtime-breadcrumbs-element-DUD-zxsq.mjs +1 -0
- package/fesm2022/ngxviewbuilder-runtime-button-element-DLKWXLDr.mjs +1 -0
- package/fesm2022/ngxviewbuilder-runtime-chart-element-B8SBRRoW.mjs +1 -0
- package/fesm2022/ngxviewbuilder-runtime-checkbox-element-BUc3LIZY.mjs +1 -0
- package/fesm2022/ngxviewbuilder-runtime-column-CQL6_3oR.mjs +43 -0
- package/fesm2022/ngxviewbuilder-runtime-custom-html-element-BBZi5m3e.mjs +3 -0
- package/fesm2022/ngxviewbuilder-runtime-date-range-element-Dh0iamQ0.mjs +1 -0
- package/fesm2022/ngxviewbuilder-runtime-datepicker-element-BzrNzV5m.mjs +1 -0
- package/fesm2022/ngxviewbuilder-runtime-divider-element-DaWflvFL.mjs +1 -0
- package/fesm2022/ngxviewbuilder-runtime-dropdown-coordinator.service-CDJcQkrB.mjs +1 -0
- package/fesm2022/ngxviewbuilder-runtime-dynamic-text.pipe-DJNHX-1z.mjs +1 -0
- package/fesm2022/ngxviewbuilder-runtime-element-identity-host-Dh5Xi4Nx.mjs +1 -0
- package/fesm2022/ngxviewbuilder-runtime-element-wrapper-FxbwPLem.mjs +4 -0
- package/fesm2022/ngxviewbuilder-runtime-file-upload-element-CVmIguAo.mjs +1 -0
- package/fesm2022/ngxviewbuilder-runtime-icon-element-D1RfF2C0.mjs +1 -0
- package/fesm2022/ngxviewbuilder-runtime-iframe-element-DeU-ENc8.mjs +1 -0
- package/fesm2022/ngxviewbuilder-runtime-image-element-9xxf0IfB.mjs +1 -0
- package/fesm2022/ngxviewbuilder-runtime-input-mask.service-WZEF2C2_.mjs +1 -0
- package/fesm2022/ngxviewbuilder-runtime-list-box-element-BDz4--85.mjs +1 -0
- package/fesm2022/ngxviewbuilder-runtime-list-grid-element-BIyp-dce.mjs +1 -0
- package/fesm2022/ngxviewbuilder-runtime-message-card-element-D0JmZyvI.mjs +1 -0
- package/fesm2022/ngxviewbuilder-runtime-multi-select-element-kVcNNhEt.mjs +1 -0
- package/fesm2022/ngxviewbuilder-runtime-number-element-DctiWuS1.mjs +1 -0
- package/fesm2022/ngxviewbuilder-runtime-number-stepper-element-iBpT-zsi.mjs +1 -0
- package/fesm2022/ngxviewbuilder-runtime-nvb-select-BEN_kxMD.mjs +1 -0
- package/fesm2022/ngxviewbuilder-runtime-nvb-style-outlet-CVovePT_.mjs +1 -0
- package/fesm2022/ngxviewbuilder-runtime-page-title-element-CYS9yCvk.mjs +1 -0
- package/fesm2022/ngxviewbuilder-runtime-phone-input-element-D4rPIZgc.mjs +1 -0
- package/fesm2022/ngxviewbuilder-runtime-progress-bar-element-D780Bz4H.mjs +1 -0
- package/fesm2022/ngxviewbuilder-runtime-radio-element-CMnPn8dr.mjs +1 -0
- package/fesm2022/ngxviewbuilder-runtime-rich-text-element-jeeNhKfo.mjs +2 -0
- package/fesm2022/ngxviewbuilder-runtime-rolldown-runtime-DpJrqANO.mjs +1 -0
- package/fesm2022/ngxviewbuilder-runtime-router-outlet-element-DSIY_9ES.mjs +1 -0
- package/fesm2022/ngxviewbuilder-runtime-select-button-element-D3ECf6NN.mjs +1 -0
- package/fesm2022/ngxviewbuilder-runtime-select-element-CL95ygLj.mjs +1 -0
- package/fesm2022/ngxviewbuilder-runtime-signature-pad-element-DNWzJf8n.mjs +1 -0
- package/fesm2022/ngxviewbuilder-runtime-single-checkbox-element-CwUV4QeU.mjs +1 -0
- package/fesm2022/ngxviewbuilder-runtime-slider-element-DG3yzEol.mjs +1 -0
- package/fesm2022/ngxviewbuilder-runtime-spacer-element-DmK0-mBg.mjs +1 -0
- package/fesm2022/ngxviewbuilder-runtime-stats-card-element-BwF1DgRq.mjs +1 -0
- package/fesm2022/ngxviewbuilder-runtime-table-element-DEQz2d-s.mjs +1 -0
- package/fesm2022/ngxviewbuilder-runtime-text-element-CMGjmapD.mjs +1 -0
- package/fesm2022/ngxviewbuilder-runtime-textarea-element-BXIAOW-5.mjs +1 -0
- package/fesm2022/ngxviewbuilder-runtime-time-picker-element-DcaL0iul.mjs +1 -0
- package/fesm2022/ngxviewbuilder-runtime-toast-element-Dz0k7DJQ.mjs +1 -0
- package/fesm2022/ngxviewbuilder-runtime-toggle-switch-element-D2X34AZt.mjs +1 -0
- package/fesm2022/ngxviewbuilder-runtime-video-element-Cn45kYTv.mjs +1 -0
- package/fesm2022/ngxviewbuilder-runtime-viewport-breakpoints-CnsMrbX1.mjs +1 -0
- package/fesm2022/ngxviewbuilder-runtime.mjs +1 -1
- package/package.json +1 -1
- package/styles/components.css +3 -3
- package/styles/element.css +8 -8
- package/styles/tokens.css +6 -4
- package/types/ngxviewbuilder-runtime.d.ts +10147 -9171
- package/fesm2022/ngxviewbuilder-runtime-avatar-element-CinoDWeT.mjs +0 -1
- package/fesm2022/ngxviewbuilder-runtime-breadcrumbs-element-DbY1LinO.mjs +0 -1
- package/fesm2022/ngxviewbuilder-runtime-icon-element-BDOiPmS_.mjs +0 -1
- package/fesm2022/ngxviewbuilder-runtime-ngxviewbuilder-runtime-C9Kow4Ye.mjs +0 -49
- package/fesm2022/ngxviewbuilder-runtime-toast-element-CRVkV1HD.mjs +0 -1
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{At as X,C as zt,It as fr,Ut as vr,Vt as ee,Xt as B,an as M,c as O,d as D,dn as b,g as be,h as br,hn as Sr,in as te,kt as yr,l as wr,mn as v,n as Nt,on as re,p as Tr,pn as xr,r as Er,rt as Lt,t as Bt,un as W,v as Ar,w as Cr,y as R,zt as Se}from"./ngxviewbuilder-runtime-dynamic-text.pipe-DJNHX-1z.mjs";import*as h from"@angular/core";import{ChangeDetectionStrategy as ye,Component as we,DestroyRef as _r,HostBinding as Te,HostListener as Ft,Injectable as A,Injector as ne,SecurityContext as $t,ViewEncapsulation as Vr,computed as U,effect as Mr,inject as g,input as V,output as Zt,signal as E,viewChild as Dr}from"@angular/core";import{DOCUMENT as xe}from"@angular/common";import{get as x,has as Ht,isEqual as k,set as ie,unset as Rr}from"lodash-es";import{filter as Pr,firstValueFrom as P}from"rxjs";import{HttpResponse as qr}from"@angular/common/http";import{NavigationEnd as kr,Router as jt}from"@angular/router";import Ir from"jexl";import{__decorate as zr}from"tslib";import{DomSanitizer as Nr}from"@angular/platform-browser";var Ee=class{type;label;hint;category;value;section;order;hidden;hiddenIf;expresionValue;applyConditions;actionsRenderAsControls;triggers;choices;error;expression;requiredFeaturePacks;requiredCapabilities;requiredPlugins;requiredPluginCapabilities;component;loadChoices;constructor(u){if(u)Object.assign(this,u)}filterChoices(u){this.choices=this.choices.filter(e=>e.value!=u)}callHttpClient(u){}};const Ot={account_circle:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M222-255q63-44 125-67.5T480-346q71 0 133.5 23.5T739-255q44-54 62.5-109T820-480q0-145-97.5-242.5T480-820q-145 0-242.5 97.5T140-480q0 61 19 116t63 109Zm257.81-195q-57.81 0-97.31-39.69-39.5-39.68-39.5-97.5 0-57.81 39.69-97.31 39.68-39.5 97.5-39.5 57.81 0 97.31 39.69 39.5 39.68 39.5 97.5 0 57.81-39.69 97.31-39.68 39.5-97.5 39.5Zm.66 370Q398-80 325-111.5t-127.5-86q-54.5-54.5-86-127.27Q80-397.53 80-480.27 80-563 111.5-635.5q31.5-72.5 86-127t127.27-86q72.76-31.5 155.5-31.5 82.73 0 155.23 31.5 72.5 31.5 127 86t86 127.03q31.5 72.53 31.5 155T848.5-325q-31.5 73-86 127.5t-127.03 86Q562.94-80 480.47-80Zm-.47-60q55 0 107.5-16T691-212q-51-36-104-55t-107-19q-54 0-107 19t-104 55q51 40 103.5 56T480-140Zm0-370q34 0 55.5-21.5T557-587q0-34-21.5-55.5T480-664q-34 0-55.5 21.5T403-587q0 34 21.5 55.5T480-510Zm0-77Zm0 374Z\"/></svg>",add:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M450-450H200v-60h250v-250h60v250h250v60H510v250h-60v-250Z\"/></svg>",add_box:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M450-280h60v-170h170v-60H510v-170h-60v170H280v60h170v170ZM180-120q-24 0-42-18t-18-42v-600q0-24 18-42t42-18h600q24 0 42 18t18 42v600q0 24-18 42t-42 18H180Zm0-60h600v-600H180v600Zm0-600v600-600Z\"/></svg>",add_circle:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M453-280h60v-166h167v-60H513v-174h-60v174H280v60h173v166Zm27.27 200q-82.74 0-155.5-31.5Q252-143 197.5-197.5t-86-127.34Q80-397.68 80-480.5t31.5-155.66Q143-709 197.5-763t127.34-85.5Q397.68-880 480.5-880t155.66 31.5Q709-817 763-763t85.5 127Q880-563 880-480.27q0 82.74-31.5 155.5Q817-252 763-197.68q-54 54.31-127 86Q563-80 480.27-80Zm.23-60Q622-140 721-239.5t99-241Q820-622 721.19-721T480-820q-141 0-240.5 98.81T140-480q0 141 99.5 240.5t241 99.5Zm-.5-340Z\"/></svg>",alt_route:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M450-80v-200q0-48-16-79t-49-64l43-43q13 11 27.5 30t24.5 35q17-26 33.5-45t31.5-32q58-47 83.5-113.5T648-766l-90 90-42-42 162-162 162 162-42 42-90-90q5 126-24.5 198.5T585-432q-44 40-59.5 73T510-280v200h-60ZM258-636q-4-18-6.5-52.5T251-765l-89 89-42-42 162-162 162 162-42 42-90-90q-2 38-1 66.5t5 49.5l-58 14Zm84 171q-17-18-37.5-47.5T273-577l59-15q9 25 24 48t28 37l-42 42Z\"/></svg>",arrow_downward:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M450-800v526L202-522l-42 42 320 320 320-320-42-42-248 248v-526h-60Z\"/></svg>",arrow_downward_alt:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M479-240 238-481l42-43 170 167v-400h60v402l168-168 42 42-241 241Z\"/></svg>",arrow_upward:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M450-160v-526L202-438l-42-42 320-320 320 320-42 42-248-248v526h-60Z\"/></svg>",auto_awesome_mosaic:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M451-120H180q-24 0-42-18t-18-42v-600q0-24 18-42t42-18h271v720Zm-60-60v-600H180v600h211Zm120-331v-329h269q24 0 42 18t18 42v269H511Zm60-60h209v-209H571v209Zm-60 451v-331h329v271q0 24-18 42t-42 18H511Zm60-60h209v-211H571v211ZM391-480Zm180-91Zm0 180Z\"/></svg>",backspace:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path fill-rule=\"evenodd\" d=\"M360-760h440v560H360L160-480ZM390-690h350v420H390L240-480ZM440-365l-25-25 90-90-90-90 25-25 90 90 90-90 25 25-90 90 90 90-25 25-90-90-90 90Z\"/></svg>",bar_chart:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M660-160v-280h140v280H660Zm-250 0v-640h140v640H410Zm-250 0v-440h140v440H160Z\"/></svg>",bolt:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"m393-165 279-335H492l36-286-253 366h154l-36 255Zm-73 85 40-280H160l360-520h80l-40 320h240L400-80h-80Zm154-396Z\"/></svg>",bookmark:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M240-160v-640h480v640L480-320 240-160Z\"/></svg>",call:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M798-100q-121 0-236.5-44.5T353-270Q228-396 164-511.5T100-798q0-24 16-41t40-17h114q21 0 36 13.5t19 34.5l23 106q3 17 1 31.5T335-643l-71 67q22 41 52 80t68 76q36 36 75 66t83 57l65-65q12-12 26.5-16.5T665-380l101 22q21 5 34.5 21t13.5 36v109q0 24-17.5 41T798-100Z\"/></svg>",calendar_month:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M180-80q-24 0-42-18t-18-42v-620q0-24 18-42t42-18h65v-60h65v60h340v-60h65v60h65q24 0 42 18t18 42v620q0 24-18 42t-42 18H180Zm0-60h600v-430H180v430Zm0-490h600v-130H180v130Zm0 0v-130 130Zm300 230q-17 0-28.5-11.5T440-440q0-17 11.5-28.5T480-480q17 0 28.5 11.5T520-440q0 17-11.5 28.5T480-400Zm-160 0q-17 0-28.5-11.5T280-440q0-17 11.5-28.5T320-480q17 0 28.5 11.5T360-440q0 17-11.5 28.5T320-400Zm320 0q-17 0-28.5-11.5T600-440q0-17 11.5-28.5T640-480q17 0 28.5 11.5T680-440q0 17-11.5 28.5T640-400ZM480-240q-17 0-28.5-11.5T440-280q0-17 11.5-28.5T480-320q17 0 28.5 11.5T520-280q0 17-11.5 28.5T480-240Zm-160 0q-17 0-28.5-11.5T280-280q0-17 11.5-28.5T320-320q17 0 28.5 11.5T360-280q0 17-11.5 28.5T320-240Zm320 0q-17 0-28.5-11.5T600-280q0-17 11.5-28.5T640-320q17 0 28.5 11.5T680-280q0 17-11.5 28.5T640-240Z\"/></svg>",category:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"m261-526 220-354 220 354H261ZM706-80q-74 0-124-50t-50-124q0-74 50-124t124-50q74 0 124 50t50 124q0 74-50 124T706-80Zm-586-25v-304h304v304H120Zm586.08-35Q754-140 787-173.08q33-33.09 33-81Q820-302 786.92-335q-33.09-33-81-33Q658-368 625-334.92q-33 33.09-33 81Q592-206 625.08-173q33.09 33 81 33ZM180-165h184v-184H180v184Zm189-421h224L481-767 369-586Zm112 0ZM364-349Zm342 95Z\"/></svg>",check:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M378-246 154-470l43-43 181 181 384-384 43 43-427 427Z\"/></svg>",check_box:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"m419-321 289-289-43-43-246 246-119-119-43 43 162 162ZM180-120q-24 0-42-18t-18-42v-600q0-24 18-42t42-18h600q24 0 42 18t18 42v600q0 24-18 42t-42 18H180Zm0-60h600v-600H180v600Zm0-600v600-600Z\"/></svg>",check_box_outline_blank:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M180-120q-24 0-42-18t-18-42v-600q0-24 18-42t42-18h600q24 0 42 18t18 42v600q0 24-18 42t-42 18H180Zm0-60h600v-600H180v600Zm0-600v600-600Z\"/></svg>",chevron_left:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M561-240 320-481l241-241 43 43-198 198 198 198-43 43Z\"/></svg>",chevron_right:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M530-481 332-679l43-43 241 241-241 241-43-43 198-198Z\"/></svg>",close:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"m249-207-42-42 231-231-231-231 42-42 231 231 231-231 42 42-231 231 231 231-42 42-231-231-231 231Z\"/></svg>",content_copy:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M360-240q-33 0-56.5-23.5T280-320v-440q0-33 23.5-56.5T360-840h360q33 0 56.5 23.5T800-760v440q0 33-23.5 56.5T720-240H360Zm0-80h360v-440H360v440Zm-120 200q-33 0-56.5-23.5T160-200v-520h80v520h400v80H240Z\"/></svg>",code_blocks:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"m379-343 44-44-93-93 92-92-44-44-136 136 137 137Zm202 0 137-137-137-137-44 44 93 93-93 93 44 44ZM180-120q-24 0-42-18t-18-42v-600q0-24 18-42t42-18h600q24 0 42 18t18 42v600q0 24-18 42t-42 18H180Zm0-60h600v-600H180v600Zm0-600v600-600Z\"/></svg>",data_object:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M570-160v-60h120q21 0 35.5-14.38Q740-248.75 740-270v-100q0-37 22.5-66t57.5-40v-8q-35-10-57.5-39.5T740-590v-100q0-21.25-14.37-35.63Q711.25-740 690-740H570v-60h120q46 0 78 32.08 32 32.09 32 77.92v100q0 21.25 14.38 35.62Q828.75-540 850-540h30v120h-30q-21.25 0-35.62 14.37Q800-391.25 800-370v100q0 45.83-32.08 77.92Q735.83-160 690-160H570Zm-300 0q-46 0-78-32.08-32-32.09-32-77.92v-100q0-21.25-14.37-35.63Q131.25-420 110-420H80v-120h30q21.25 0 35.63-14.38Q160-568.75 160-590v-100q0-45.83 32.08-77.92Q224.17-800 270-800h120v60H270q-21 0-35.5 14.37Q220-711.25 220-690v100q0 37-22.5 66.5T140-484v8q35 11 57.5 40t22.5 66v100q0 21.25 14.38 35.62Q248.75-220 270-220h120v60H270Z\"/></svg>",database:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M480-120q-151 0-255.5-46.5T120-280v-400q0-66 105.5-113T480-840q149 0 254.5 47T840-680v400q0 67-104.5 113.5T480-120Zm0-488q86 0 176.5-26.5T773-694q-27-32-117.5-59T480-780q-88 0-177 26t-117 60q28 35 116 60.5T480-608Zm-1 214q42 0 84-4.5t80.5-13.5q38.5-9 73.5-22t63-29v-155q-29 16-64 29t-74 22q-39 9-80 14t-83 5q-42 0-84-5t-80.5-14q-38.5-9-73-22T180-618v155q27 16 61 29t72.5 22q38.5 9 80.5 13.5t85 4.5Zm1 214q48 0 99-8.5t93.5-22.5q42.5-14 72-31t35.5-35v-125q-28 16-63 28.5T643.5-352q-38.5 9-80 13.5T479-334q-43 0-85-4.5T313.5-352q-38.5-9-72.5-21.5T180-402v126q5 17 34 34.5t72 31q43 13.5 94 22t100 8.5Z\"/></svg>",description:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M319-250h322v-60H319v60Zm0-170h322v-60H319v60ZM220-80q-24 0-42-18t-18-42v-680q0-24 18-42t42-18h361l219 219v521q0 24-18 42t-42 18H220Zm331-554v-186H220v680h520v-494H551ZM220-820v186-186 680-680Z\"/></svg>",delete:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M261-120q-24.75 0-42.37-17.63Q201-155.25 201-180v-570h-41v-60h188v-30h264v30h188v60h-41v570q0 24-18 42t-42 18H261Zm438-630H261v570h438v-570ZM367-266h60v-399h-60v399Zm166 0h60v-399h-60v399ZM261-750v570-570Z\"/></svg>",design_services:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"m357-513 90-90-75-75-48 48-42-42 48-48-75-74-90 90 192 191Zm346 348 90-91-75-75-48 48-42-42 48-48-74-74-90 90 191 192Zm8-615 70 70-70-70ZM276-120H120v-156l194-194L80-704l174-176 236 235 178-178q9-9 20-13t22-4q11 0 22 4t20 13l71 71q9 9 13 20t4 22q0 11-4 22t-13 20L645-490l235 235L705-81 471-315 276-120Zm-96-60h70l393-394-70-70-393 394v70Zm428-429-35-35 70 70-35-35Z\"/></svg>",dns:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M286.88-717q-20.88 0-35.38 14.62-14.5 14.62-14.5 35.5 0 20.88 14.62 35.38 14.62 14.5 35.5 14.5 20.88 0 35.38-14.62 14.5-14.62 14.5-35.5 0-20.88-14.62-35.38-14.62-14.5-35.5-14.5Zm0 414q-20.88 0-35.38 14.62-14.5 14.62-14.5 35.5 0 20.88 14.62 35.38 14.62 14.5 35.5 14.5 20.88 0 35.38-14.62 14.5-14.62 14.5-35.5 0-20.88-14.62-35.38-14.62-14.5-35.5-14.5ZM154-839h651q16 0 25.5 9.5t9.5 25.81V-535q0 17.42-9.5 29.21T805-494H154q-15 0-24.5-11.79T120-535v-268.69q0-16.31 9.5-25.81T154-839Zm26 60v225h600v-225H180Zm-26 353h647q15 0 27 12.5t12 28.53V-121q0 20-12 30.5T801-80H159q-16 0-27.5-10.5T120-121v-263.97q0-16.03 9.5-28.53T154-426Zm26 60v226h600v-226H180Zm0-413v225-225Zm0 413v226-226Z\"/></svg>",do_not_disturb_on:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M280-453h400v-60H280v60ZM480-80q-82 0-155-31.5t-127.5-86Q143-252 111.5-325T80-480q0-83 31.5-156t86-127Q252-817 325-848.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 82-31.5 155T763-197.5q-54 54.5-127 86T480-80Zm0-60q142 0 241-99.5T820-480q0-142-99-241t-241-99q-141 0-240.5 99T140-480q0 141 99.5 240.5T480-140Zm0-340Z\"/></svg>",do_not_touch:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"m840-206-60-60v-504q0-12.75 8.68-21.38 8.67-8.62 21.5-8.62 12.82 0 21.32 8.62 8.5 8.63 8.5 21.38v564ZM340-705l-60-60v-45q0-12.75 8.68-21.38 8.67-8.62 21.5-8.62 12.82 0 21.32 8.62 8.5 8.63 8.5 21.38v105Zm167 166-60-59v-292q0-12.75 8.68-21.38 8.67-8.62 21.5-8.62 12.82 0 21.32 8.62 8.5 8.63 8.5 21.38v351Zm167 59h-60v-370q0-12.75 8.68-21.38 8.67-8.62 21.5-8.62 12.82 0 21.32 8.62 8.5 8.63 8.5 21.38v370Zm77 357L340-534v252L166-410l195 288q7 11 17.5 16.5T402-100h288q16.9 0 32.95-6Q739-112 751-123ZM402-40q-27 0-51.5-12.5T311-88L54-468l20-16q17-15 39.5-19t44.57 13.19L280-397v-197L26-848l43-43L876-84l-43 43-40-40q-20 19-46.56 30Q719.88-40 690-40H402Zm143-289Zm21-151Z\"/></svg>",done_all:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M294-242 70-466l43-43 181 181 43 43-43 43Zm170 0L240-466l43-43 181 181 384-384 43 43-427 427Zm0-170-43-43 257-257 43 43-257 257Z\"/></svg>",draft:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M220-80q-24 0-42-18t-18-42v-680q0-24 18-42t42-18h361l219 219v521q0 24-18 42t-42 18H220Zm331-554v-186H220v680h520v-494H551ZM220-820v186-186 680-680Z\"/></svg>",drag_indicator:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M349.91-160q-28.91 0-49.41-20.59-20.5-20.59-20.5-49.5t20.59-49.41q20.59-20.5 49.5-20.5t49.41 20.59q20.5 20.59 20.5 49.5t-20.59 49.41q-20.59 20.5-49.5 20.5Zm260 0q-28.91 0-49.41-20.59-20.5-20.59-20.5-49.5t20.59-49.41q20.59-20.5 49.5-20.5t49.41 20.59q20.5 20.59 20.5 49.5t-20.59 49.41q-20.59 20.5-49.5 20.5Zm-260-250q-28.91 0-49.41-20.59-20.5-20.59-20.5-49.5t20.59-49.41q20.59-20.5 49.5-20.5t49.41 20.59q20.5 20.59 20.5 49.5t-20.59 49.41q-20.59 20.5-49.5 20.5Zm260 0q-28.91 0-49.41-20.59-20.5-20.59-20.5-49.5t20.59-49.41q20.59-20.5 49.5-20.5t49.41 20.59q20.5 20.59 20.5 49.5t-20.59 49.41q-20.59 20.5-49.5 20.5Zm-260-250q-28.91 0-49.41-20.59-20.5-20.59-20.5-49.5t20.59-49.41q20.59-20.5 49.5-20.5t49.41 20.59q20.5 20.59 20.5 49.5t-20.59 49.41q-20.59 20.5-49.5 20.5Zm260 0q-28.91 0-49.41-20.59-20.5-20.59-20.5-49.5t20.59-49.41q20.59-20.5 49.5-20.5t49.41 20.59q20.5 20.59 20.5 49.5t-20.59 49.41q-20.59 20.5-49.5 20.5Z\"/></svg>",dropdown:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M471-471h250v-250H471v250ZM180-120q-24 0-42-18t-18-42v-600q0-24 18-42t42-18h600q24 0 42 18t18 42v600q0 24-18 42t-42 18H180Zm0-60h600v-600H180v600Zm0-600v600-600Z\"/></svg>",edit:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M200-200h57l373-373-57-57-373 373v57Zm-80 80v-170l527-527q12-12 28-18t33-6q17 0 33 6t28 18l57 57q12 12 18 28t6 33q0 17-6 33t-18 28L290-120H120Zm560-560-57-57 57 57Z\"/></svg>",emoji_symbols:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M120-820v-60h313v60H120Zm127 285v-183H120v-60h313v60H306v183h-59ZM547-96l-43-43 313-313 43 43L547-96Zm37-229q-23 0-38.5-15.5T530-379q0-23 15.5-38.5T584-433q23 0 38.5 15.5T638-379q0 23-15.5 38.5T584-325Zm202 207q-23 0-38.5-15.5T732-172q0-23 15.5-38.5T786-226q23 0 38.5 15.5T840-172q0 23-15.5 38.5T786-118ZM628-520q-38 0-64-27.5T538-610q0-38 26-64t64-26q13 0 23.5 3.5T670-688v-163q0-12 8.5-20.5T699-880h141v59H718v211q0 38-26 64t-64 26ZM211-80q-38 0-64.5-26.5T120-171q0-20 7-36.5t21-30.5l52-52-20-20q-14-14-21.5-31.5T151-376q0-38 26.5-64.5T242-467q38 0 64.5 26.5T333-376q0 17-5.5 34.5T308-310l-20 20 50 50 60-60 42 42-63 63 53 53-41 41-59-59-51 51q-14 14-31 21.5T211-80Zm31-250 23-23q5-5 6.5-10t1.5-13q0-14-8.5-22.5T242-407q-14 0-22.5 8.5T211-376q0 8 1.5 13t6.5 10l23 23Zm-31 190q5 0 12-3t12-8l52-52-43-43-53 53q-5 5-7.5 11t-2.5 12q0 14 8 22t22 8Z\"/></svg>",error:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M479.98-280q14.02 0 23.52-9.48t9.5-23.5q0-14.02-9.48-23.52t-23.5-9.5q-14.02 0-23.52 9.48t-9.5 23.5q0 14.02 9.48 23.52t23.5 9.5ZM453-433h60v-253h-60v253Zm27.27 353q-82.74 0-155.5-31.5Q252-143 197.5-197.5t-86-127.34Q80-397.68 80-480.5t31.5-155.66Q143-709 197.5-763t127.34-85.5Q397.68-880 480.5-880t155.66 31.5Q709-817 763-763t85.5 127Q880-563 880-480.27q0 82.74-31.5 155.5Q817-252 763-197.68q-54 54.31-127 86Q563-80 480.27-80Zm.23-60Q622-140 721-239.5t99-241Q820-622 721.19-721T480-820q-141 0-240.5 98.81T140-480q0 141 99.5 240.5t241 99.5Zm-.5-340Z\"/></svg>",event:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M596.82-220Q556-220 528-248.18q-28-28.19-28-69Q500-358 528.18-386q28.19-28 69-28Q638-414 666-385.82q28 28.19 28 69Q694-276 665.82-248q-28.19 28-69 28ZM180-80q-24 0-42-18t-18-42v-620q0-24 18-42t42-18h65v-60h65v60h340v-60h65v60h65q24 0 42 18t18 42v620q0 24-18 42t-42 18H180Zm0-60h600v-430H180v430Zm0-490h600v-130H180v130Zm0 0v-130 130Z\"/></svg>",extension:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M356-120H180q-24 0-42-18t-18-42v-176q44-5 75.5-34.5T227-463q0-43-31.5-72.5T120-570v-176q0-24 18-42t42-18h177q11-40 39.5-67t68.5-27q40 0 68.5 27t39.5 67h173q24 0 42 18t18 42v173q40 11 65.5 41.5T897-461q0 40-25.5 67T806-356v176q0 24-18 42t-42 18H570q-5-48-35.5-77.5T463-227q-41 0-71.5 29.5T356-120Zm-176-60h130q25-61 69.89-84t83-23Q501-287 546-264t70 84h130v-235h45q20 0 33-13t13-33q0-20-13-33t-33-13h-45v-239H511v-48q0-20-13-33t-33-13q-20 0-33 13t-13 33v48H180v130q48.15 17.82 77.58 59.69Q287-514.45 287-462.78 287-412 257.5-370T180-310v130Zm285-281Z\"/></svg>",fiber_manual_record:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M478-478Zm2 278q-117 0-198.5-81.5T200-480q0-117 81.5-198.5T480-760q117 0 198.5 81.5T760-480q0 117-81.5 198.5T480-200Zm0-60q92 0 156-64t64-156q0-92-64-156t-156-64q-92 0-156 64t-64 156q0 92 64 156t156 64Z\"/></svg>",float_portrait_2:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M280-530h270v-230H280v230Zm520 390q0 24-18 42t-42 18H220q-24 0-42-18t-18-42v-680q0-24 18-42t42-18h520q24 0 42 18t18 42v680Zm-60 0v-680H220v680h520Zm0-680H220h520Z\"/></svg>",format_list_bulleted:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M377-198v-60h463v60H377Zm0-252v-60h463v60H377Zm0-253v-60h463v60H377ZM189-161q-28.05 0-48.02-19Q121-199 121-227.5t19.5-48q19.5-19.5 48-19.5t47.5 19.98q19 19.97 19 48.02 0 27.23-19.39 46.61Q216.23-161 189-161Zm0-252q-28.05 0-48.02-19.68Q121-452.36 121-480t19.98-47.32Q160.95-547 189-547q27.23 0 46.61 19.68Q255-507.64 255-480t-19.39 47.32Q216.23-413 189-413Zm-1-253q-27.64 0-47.32-19.68T121-733q0-27.64 19.68-47.32T188-800q27.64 0 47.32 19.68T255-733q0 27.64-19.68 47.32T188-666Z\"/></svg>",format_shapes:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M40-40v-213h79v-454H40v-213h213v79h454v-79h213v213h-79v454h79v213H707v-79H253v79H40Zm213-139h454v-74h74v-454h-74v-74H253v74h-74v454h74v74Zm54-127 149-392h47l150 392h-51l-40-108H403l-40 108h-56Zm110-154h126l-60-166h-7l-59 166ZM100-767h93v-93h-93v93Zm667 0h93v-93h-93v93Zm0 667h93v-93h-93v93Zm-667 0h93v-93h-93v93Zm93-667Zm574 0Zm0 574Zm-574 0Z\"/></svg>",frame_exclamation:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M450-380v-380h60v380h-60Zm0 180v-60h60v60h-60ZM223-40H100q-24 0-42-18t-18-42v-123h60v123h123v60Zm514 0v-60h123v-123h60v123q0 24-18 42t-42 18H737ZM40-737v-123q0-24 18-42t42-18h123v60H100v123H40Zm820 0v-123H737v-60h123q24 0 42 18t18 42v123h-60Z\"/></svg>",grid_on:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M180-120q-24 0-42-18t-18-42v-600q0-24 18-42t42-18h600q24 0 42 18t18 42v600q0 24-18 42t-42 18H180Zm0-60h160v-160H180v160Zm220 0h160v-160H400v160Zm220 0h160v-160H620v160ZM180-400h160v-160H180v160Zm220 0h160v-160H400v160Zm220 0h160v-160H620v160ZM180-620h160v-160H180v160Zm220 0h160v-160H400v160Zm220 0h160v-160H620v160Z\"/></svg>",help:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M484-247q16 0 27-11t11-27q0-16-11-27t-27-11q-16 0-27 11t-11 27q0 16 11 27t27 11Zm-35-146h59q0-26 6.5-47.5T555-490q31-26 44-51t13-55q0-53-34.5-85T486-713q-49 0-86.5 24.5T345-621l53 20q11-28 33-43.5t52-15.5q34 0 55 18.5t21 47.5q0 22-13 41.5T508-512q-30 26-44.5 51.5T449-393Zm31 313q-82 0-155-31.5t-127.5-86Q143-252 111.5-325T80-480q0-83 31.5-156t86-127Q252-817 325-848.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 82-31.5 155T763-197.5q-54 54.5-127 86T480-80Zm0-60q142 0 241-99.5T820-480q0-142-99-241t-241-99q-141 0-240.5 99T140-480q0 141 99.5 240.5T480-140Zm0-340Z\"/></svg>",horizontal_rule:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M160-450v-60h640v60H160Z\"/></svg>",html:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M0-360v-240h48v89h108v-89h48v240h-48v-103H48v103H0Zm316 0v-192h-70v-48h188v48h-70v192h-48Zm160 0v-206q0-15 9.5-24.5T510-600h200q15 0 24.5 9.5T744-566v206h-48v-192h-62v150h-48v-150h-62v192h-48Zm326 0v-240h48v192h110v48H802Z\"/></svg>",image:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M180-120q-24 0-42-18t-18-42v-600q0-24 18-42t42-18h600q24 0 42 18t18 42v600q0 24-18 42t-42 18H180Zm0-60h600v-600H180v600Zm56-97h489L578-473 446-302l-93-127-117 152Zm-56 97v-600 600Z\"/></svg>",ink_eraser:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M678-220h203v60H618l60-60Zm-499 60-81-84q-18-17-17.5-41.5T97-327l458-498q16-17 40.57-17 24.56 0 41.43 17l205 215q17 17 18 42t-16 42L503-160H179Zm301-60 324-352-207-217-455 503 64 66h274Zm0-260Z\"/></svg>",input:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M140-160q-24 0-42-18t-18-42v-169h60v169h680v-520H140v171H80v-171q0-24 18-42t42-18h680q24 0 42 18t18 42v520q0 24-18 42t-42 18H140Zm319-143-43-43 103-103H80v-60h439L416-612l43-43 176 176-176 176Z\"/></svg>",keyboard_arrow_down:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M480-344 240-584l43-43 197 197 197-197 43 43-240 240Z\"/></svg>",keyboard_arrow_up:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M480-554 283-357l-43-43 240-240 240 240-43 43-197-197Z\"/></svg>",keyboard_double_arrow_left:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M440-240 200-480l240-240 56 56-184 184 184 184-56 56Zm264 0L464-480l240-240 56 56-184 184 184 184-56 56Z\"/></svg>",keyboard_double_arrow_right:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M383-480 200-664l56-56 240 240-240 240-56-56 183-184Zm264 0L464-664l56-56 240 240-240 240-56-56 183-184Z\"/></svg>",lists:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M80-160v-173h173v173H80Zm233 0v-173h567v173H313ZM80-393v-174h173v174H80Zm233 0v-174h567v174H313ZM80-627v-173h173v173H80Zm233 0v-173h567v173H313Z\"/></svg>",monitoring:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M120-120v-76l60-60v136h-60Zm165 0v-236l60-60v296h-60Zm165 0v-296l60 61v235h-60Zm165 0v-235l60-60v295h-60Zm165 0v-396l60-60v456h-60ZM120-356v-85l280-278 160 160 280-281v85L560-474 400-634 120-356Z\"/></svg>",more_vert:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M479.86-160Q460-160 446-174.14t-14-34Q432-228 446.14-242t34-14Q500-256 514-241.86t14 34Q528-188 513.86-174t-34 14Zm0-272Q460-432 446-446.14t-14-34Q432-500 446.14-514t34-14Q500-528 514-513.86t14 34Q528-460 513.86-446t-34 14Zm0-272Q460-704 446-718.14t-14-34Q432-772 446.14-786t34-14Q500-800 514-785.86t14 34Q528-732 513.86-718t-34 14Z\"/></svg>",note_stack_add:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M280-140v-480q0-25.06 17.5-42.53Q315-680 340-680h480q24.75 0 42.38 17.62Q880-644.75 880-620v340L680-80H340q-24.75 0-42.37-17.63Q280-115.25 280-140ZM81-725q-5-25 9.5-44.5T130-794l473-84q25-5 44.5 9t24.5 39l16 90h-60l-14-79-473 83 79 450v83q-20-2-35-15t-19-34L81-725Zm259 105v480h308l172-172v-308H340Zm240 240Zm-30 150h60v-120h120v-60H610v-120h-60v120H430v60h120v120Z\"/></svg>",notification_important:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M450-426h60v-214h-60v214Zm29.98 106q14.02 0 23.52-9.48t9.5-23.5q0-14.02-9.48-23.52t-23.5-9.5q-14.02 0-23.52 9.48t-9.5 23.5q0 14.02 9.48 23.52t23.5 9.5ZM160-200v-60h80v-304q0-84 49.5-150.5T420-798v-22q0-25 17.5-42.5T480-880q25 0 42.5 17.5T540-820v22q81 17 130.5 83.5T720-564v304h80v60H160Zm320-302Zm0 422q-33 0-56.5-23.5T400-160h160q0 33-23.5 56.5T480-80ZM300-260h360v-304q0-75-52.5-127.5T480-744q-75 0-127.5 52.5T300-564v304Z\"/></svg>",notifications_active:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M120-566q0-90 40-165t107-125l36 48q-56 42-89.5 104.5T180-566h-60Zm660 0q0-75-33.5-137.5T657-808l36-48q67 50 107 125t40 165h-60ZM160-200v-60h80v-304q0-84 49.5-150.5T420-798v-22q0-25 17.5-42.5T480-880q25 0 42.5 17.5T540-820v22q81 17 130.5 83.5T720-564v304h80v60H160Zm320-302Zm0 422q-33 0-56.5-23.5T400-160h160q0 33-23.5 56.5T480-80ZM300-260h360v-304q0-75-52.5-127.5T480-744q-75 0-127.5 52.5T300-564v304Z\"/></svg>",picture_as_pdf:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M331-431h37v-83h48q15.73 0 26.36-10.64Q453-535.28 453-551v-48q0-15.72-10.64-26.36Q431.73-636 416-636h-85v205Zm37-120v-48h48v48h-48Zm129 120h84q15 0 26-10.64 11-10.63 11-26.36v-131q0-15.72-11-26.36Q596-636 581-636h-84v205Zm37-37v-131h47v131h-47Zm133 37h37v-83h50v-37h-50v-48h50v-37h-87v205ZM260-200q-24 0-42-18t-18-42v-560q0-24 18-42t42-18h560q24 0 42 18t18 42v560q0 24-18 42t-42 18H260Zm0-60h560v-560H260v560ZM140-80q-24 0-42-18t-18-42v-620h60v620h620v60H140Zm120-740v560-560Z\"/></svg>",pin:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M140-160q-24 0-42-18t-18-42v-520q0-24 18-42t42-18h680q24 0 42 18t18 42v520q0 24-18 42t-42 18H140Zm107-194h42v-252h-32l-73 49 21 33 42-28v198Zm133 0h163v-38H434v-2q14-12 30.5-26.5T494-448q21-20 33-38.5t12-44.5q0-32-22-53.5T460-606q-30 0-50.5 14T379-555l38 18q5-11 17-19t26-8q18 0 28 10t10 24q0 20-10 33.5T461-468q-23 21-40.5 37T380-393v39Zm314 0q36 0 59.5-17.5T777-426q0-25-13-41t-34-18v-1q19-6 28.5-19.5T768-541q0-30-21.5-47.5T693-606q-22 0-42 12t-33 35l34 18q8-11 18.5-17.5T693-565q15 0 24.5 8.5T727-533q0 17-11.5 23t-30.5 6h-14v39h15q19 0 34.5 10t15.5 29q0 18-11.5 27.5T694-389q-15 0-29-10t-20-27l-35 13q8 27 28.5 43t55.5 16ZM140-220h680v-520H140v520Zm0 0v-520 520Z\"/></svg>",radio_button_checked:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M480-294q78 0 132-54t54-132q0-78-54-132t-132-54q-78 0-132 54t-54 132q0 78 54 132t132 54Zm0 214q-82 0-155-31.5t-127.5-86Q143-252 111.5-325T80-480q0-83 31.5-156t86-127Q252-817 325-848.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 82-31.5 155T763-197.5q-54 54.5-127 86T480-80Zm0-60q142 0 241-99.5T820-480q0-142-99-241t-241-99q-141 0-240.5 99T140-480q0 141 99.5 240.5T480-140Z\"/></svg>",redo:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M392-200q-95 0-163.5-64T160-422q0-94 68.5-158T392-644h294L572-758l42-42 186 186-186 186-42-42 114-114H391q-70 0-120.5 46.5T220-422q0 69 50.5 115.5T391-260h310v60H392Z\"/></svg>",save:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M840-680v480q0 33-23.5 56.5T760-120H200q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h480l160 160ZM480-240q50 0 85-35t35-85q0-50-35-85t-85-35q-50 0-85 35t-35 85q0 50 35 85t85 35ZM240-560h360v-160H240v160Z\"/></svg>",search:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M796-121 533-384q-30 26-69.96 40.5Q423.08-329 378-329q-108.16 0-183.08-75Q120-479 120-585t75-181q75-75 181.5-75t181 75Q632-691 632-584.85 632-542 618-502q-14 40-42 75l264 262-44 44ZM377-389q81.25 0 138.13-57.5Q572-504 572-585t-56.87-138.5Q458.25-781 377-781q-82.08 0-139.54 57.5Q180-666 180-585t57.46 138.5Q294.92-389 377-389Z\"/></svg>",sell:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M863-404 557-97q-9 8.5-20.25 12.75T514.25-80Q503-80 492-84.5T472-97L98-472q-8-8-13-18.96-5-10.95-5-23.04v-306q0-24.75 17.63-42.38Q115.25-880 140-880h307q12.07 0 23.39 4.87Q481.7-870.25 490-862l373 373q9.39 9 13.7 20.25 4.3 11.25 4.3 22.5t-4.5 22.75Q872-412 863-404ZM516-138l306-307-375-375H140v304l376 378ZM245-664q21 0 36.5-15.5T297-716q0-21-15.5-36.5T245-768q-21 0-36.5 15.5T193-716q0 21 15.5 36.5T245-664Zm236 185Z\"/></svg>",smart_display:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"m392-313 260-169-260-169v338ZM140-160q-24 0-42-18t-18-42v-520q0-24 18-42t42-18h680q24 0 42 18t18 42v520q0 24-18 42t-42 18H140Zm0-60h680v-520H140v520Zm0 0v-520 520Z\"/></svg>",space_bar:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M160-360v-240h60v180h520v-180h60v240H160Z\"/></svg>",space_dashboard:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M180-120q-24 0-42-18t-18-42v-600q0-24 18-42t42-18h600q24 0 42 18t18 42v600q0 24-18 42t-42 18H180Zm0-60h270v-600H180v600Zm330 0h270v-301H510v301Zm0-361h270v-239H510v239Z\"/></svg>",swap_vert:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M280-400v-320h80v320h-80ZM320-820l-100 140h200l-100-140ZM600-560v320h80v-320h-80ZM640-140l-100-140h200l-100 140Z\"/></svg>",tab:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M140-220h680v-347H524v-173H140v520Zm0 60q-24 0-42-18t-18-42v-520q0-24 18-42t42-18h680q24 0 42 18t18 42v520q0 24-18 42t-42 18H140Zm0-60v-520 520Z\"/></svg>",table_view:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M300-80q-24 0-42-18t-18-42v-520q0-24 18-42t42-18h520q24 0 42 18t18 42v520q0 24-18 42t-42 18H300Zm0-60h230v-147H300v147Zm290 0h230v-147H590v147ZM80-244v-576q0-24 18-42t42-18h576v60H140v576H80Zm220-103h230v-148H300v148Zm290 0h230v-148H590v148ZM300-555h520v-105H300v105Z\"/></svg>",tabs:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M180-120q-24 0-42-18t-18-42v-600q0-24 18-42t42-18h600q24 0 42 18t18 42v600q0 24-18 42t-42 18H180Zm0-60h600v-313H180v313Zm0-373h600v-227H180v227Zm381-137h189v-60H561v60ZM180-553v-227 227Z\"/></svg>",text_ad:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M210-290h540v-60H210v60Zm0-160h540v-60H210v60Zm0-160h378v-60H210v60Zm-70 450q-24 0-42-18t-18-42v-520q0-24 18-42t42-18h680q24 0 42 18t18 42v520q0 24-18 42t-42 18H140Zm0-60h680v-520H140v520Zm0 0v-520 520Z\"/></svg>",timeline:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M109.91-240Q81-240 60.5-260.59 40-281.18 40-310.09t20.49-49.41q20.5-20.5 49.28-20.5 5.23 0 10.23.5t13 2.5l200-200q-2-8-2.5-13t-.5-10.23q0-28.78 20.59-49.28Q371.18-670 400.09-670t49.41 20.63q20.5 20.64 20.5 49.61 0 1.76-3 22.76l110 110q8-2 13-2.5t10-.5q5 0 10 .5t13 2.5l160-160q-2-8-2.5-13t-.5-10.23q0-28.78 20.59-49.28Q821.18-720 850.09-720t49.41 20.59q20.5 20.59 20.5 49.5t-20.49 49.41q-20.5 20.5-49.28 20.5-5.23 0-10.23-.5t-13-2.5L667-423q2 8 2.5 13t.5 10.23q0 28.78-20.59 49.28Q628.82-330 599.91-330t-49.41-20.49q-20.5-20.5-20.5-49.28 0-5.23.5-10.23t2.5-13L423-533q-8 2-13 2.5t-10.25.5q-1.75 0-22.75-3L177-333q2 8 2.5 13t.5 10.23q0 28.78-20.59 49.28Q138.82-240 109.91-240Z\"/></svg>",title:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M430-160v-540H200v-100h560v100H530v540H430Z\"/></svg>",tune:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M427-120v-225h60v83h353v60H487v82h-60Zm-307-82v-60h247v60H120Zm187-166v-82H120v-60h187v-84h60v226h-60Zm120-82v-60h413v60H427Zm166-165v-225h60v82h187v60H653v83h-60Zm-473-83v-60h413v60H120Z\"/></svg>",undo:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M259-200v-60h310q70 0 120.5-46.5T740-422q0-69-50.5-115.5T569-584H274l114 114-42 42-186-186 186-186 42 42-114 114h294q95 0 163.5 64T800-422q0 94-68.5 158T568-200H259Z\"/></svg>",unfold_more:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M480-120 300-300l44-44 136 136 136-136 44 44-180 180ZM344-612l-44-44 180-180 180 180-44 44-136-136-136 136Z\"/></svg>",upload:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M450-313v-371L330-564l-43-43 193-193 193 193-43 43-120-120v371h-60ZM220-160q-24 0-42-18t-18-42v-143h60v143h520v-143h60v143q0 24-18 42t-42 18H220Z\"/></svg>",upload_file:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M452-202h60v-201l82 82 42-42-156-152-154 154 42 42 84-84v201ZM220-80q-24 0-42-18t-18-42v-680q0-24 18-42t42-18h361l219 219v521q0 24-18 42t-42 18H220Zm331-554v-186H220v680h520v-494H551ZM220-820v186-186 680-680Z\"/></svg>",view_column:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M120-260v-440q0-24.75 17.63-42.38Q155.25-760 180-760h600q24.75 0 42.38 17.62Q840-724.75 840-700v440q0 24.75-17.62 42.37Q804.75-200 780-200H180q-24.75 0-42.37-17.63Q120-235.25 120-260Zm60 0h160v-440H180v440Zm220 0h160v-440H400v440Zm220 0h160v-440H620v440Z\"/></svg>",view_list:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M350-220h470v-137H350v137ZM140-603h150v-137H140v137Zm0 187h150v-127H140v127Zm0 196h150v-137H140v137Zm210-196h470v-127H350v127Zm0-187h470v-137H350v137ZM140-160q-24 0-42-18t-18-42v-520q0-24 18-42t42-18h680q24 0 42 18t18 42v520q0 24-18 42t-42 18H140Z\"/></svg>",view_module:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M621-510h159v-190H621v190Zm-221 0h161v-190H400v190Zm-219 0h159v-190H181v190Zm0 250h159v-190H181v190Zm219 0h161v-190H400v190Zm221 0h159v-190H621v190Zm-500 0v-440q0-24.75 17.63-42.38Q156.25-760 181-760h599q24.75 0 42.38 17.62Q840-724.75 840-700v440q0 24.75-17.62 42.37Q804.75-200 780-200H181q-24.75 0-42.37-17.63Q121-235.25 121-260Z\"/></svg>",visibility:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M480-320q66 0 113-47t47-113q0-66-47-113t-113-47q-66 0-113 47t-47 113q0 66 47 113t113 47Zm0-80q-33 0-56.5-23.5T400-480q0-33 23.5-56.5T480-560q33 0 56.5 23.5T560-480q0 33-23.5 56.5T480-400Zm0 240q-122 0-221.5-68.5T100-400q59-103 158.5-171.5T480-640q122 0 221.5 68.5T860-400q-59 103-158.5 171.5T480-160Z\"/></svg>",web_asset:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M140-160q-24 0-42-18t-18-42v-520q0-24 18-42t42-18h680q24 0 42 18t18 42v520q0 24-18 42t-42 18H140Zm0-60h680v-436H140v436Z\"/></svg>",widgets:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M679-466 466-679l213-213 213 213-213 213Zm-559-72v-301h301v301H120Zm418 418v-301h301v301H538Zm-418 0v-301h301v301H120Zm60-478h181v-181H180v181Zm502 51 129-129-129-129-129 129 129 129Zm-84 367h181v-181H598v181Zm-418 0h181v-181H180v181Zm181-418Zm192-78ZM361-361Zm237 0Z\"/></svg>",zoom_in:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M796-121 533-384q-30 26-70 40.5T378-329q-108 0-183-75t-75-181q0-106 75-181t181.5-75q106.5 0 181 75T632-585q0 43-14 83t-42 75l264 262-44 44ZM377-389q81 0 138-57.5T572-585q0-81-57-138.5T377-781q-82 0-139.5 57.5T180-585q0 81 57.5 138.5T377-389Zm-30-85v-81h-81v-60h81v-81h60v81h81v60h-81v81h-60Z\"/></svg>",settings:"<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"#e3e3e3\"><path d=\"m370-80-16-128q-13-5-24.5-12T307-235l-119 50L78-375l103-78q-1-7-1-13.5v-27q0-6.5 1-13.5L78-585l110-190 119 50q11-8 23-15t24-12l16-128h220l16 128q13 5 24.5 12t22.5 15l119-50 110 190-103 78q1 7 1 13.5v27q0 6.5-2 13.5l103 78-110 190-118-50q-11 8-23 15t-24 12L590-80H370Zm70-80h79l14-106q31-8 57.5-23.5T639-327l99 41 39-68-86-65q5-14 7-29.5t2-31.5q0-16-2-31.5t-7-29.5l86-65-39-68-99 42q-22-23-48.5-38.5T533-694l-13-106h-79l-14 106q-31 8-57.5 23.5T321-633l-99-41-39 68 86 64q-5 15-7 30t-2 32q0 16 2 31t7 30l-86 65 39 68 99-42q22 23 48.5 38.5T427-266l13 106Zm42-180q58 0 99-41t41-99q0-58-41-99t-99-41q-59 0-99.5 41T342-480q0 58 40.5 99t99.5 41Zm-2-140Z\"/></svg>",remove:"<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"#e3e3e3\"><path d=\"M200-440v-80h560v80H200Z\"/></svg>",translate:"<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"#e3e3e3\"><path d=\"m476-80 182-480h84L924-80h-84l-43-122H603L560-80h-84ZM160-200l-56-56 202-202q-35-35-63.5-80T190-640h84q20 39 40 68t48 58q33-33 68.5-92.5T484-720H40v-80h280v-80h80v80h280v80H564q-21 72-63 148t-83 116l96 98-30 82-122-125-202 201Zm468-72h144l-72-204-72 204Z\"/></svg>",stylus_note:"<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"#e3e3e3\"><path d=\"m499-287 335-335-52-52-335 335 52 52Zm-261 87q-100-5-149-42T40-349q0-65 53.5-105.5T242-503q39-3 58.5-12.5T320-542q0-26-29.5-39T193-600l7-80q103 8 151.5 41.5T400-542q0 53-38.5 83T248-423q-64 5-96 23.5T120-349q0 35 28 50.5t94 18.5l-4 80Zm280 7L353-358l382-382q20-20 47.5-20t47.5 20l70 70q20 20 20 47.5T900-575L518-193Zm-159 33q-17 4-30-9t-9-30l33-159 165 165-159 33Z\"/></svg>",zoom_out:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M796-121 533-384q-30 26-70 40.5T378-329q-108 0-183-75t-75-181q0-106 75-181t181.5-75q106.5 0 181 75T632-585q0 43-14 83t-42 75l264 262-44 44ZM377-389q81 0 138-57.5T572-585q0-81-57-138.5T377-781q-82 0-139.5 57.5T180-585q0 81 57.5 138.5T377-389ZM266-555v-60h222v60H266Z\"/></svg>",azm:"<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"#e3e3e3\"><path d=\"M400-40v-360H40l400-400h360v360L400-40Zm240-353 80-80v-247H473l-80 80h247v247ZM480-233l80-80v-247H313l-80 80h247v247Z\"/></svg>",step:"<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"#e3e3e3\"><path d=\"M760-360q-51 0-85.5-34.5T640-480q0-51 34.5-85.5T760-600q51 0 85.5 34.5T880-480q0 51-34.5 85.5T760-360Zm-400 80-56-57 103-103H80v-80h327L304-624l56-56 200 200-200 200Z\"/></svg>",schedule:"<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"#e3e3e3\"><path d=\"m612-292 56-56-148-148v-184h-80v216l172 172ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 320q133 0 226.5-93.5T800-480q0-133-93.5-226.5T480-800q-133 0-226.5 93.5T160-480q0 133 93.5 226.5T480-160Z\"/></svg>",date_range:"<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"#e3e3e3\"><path d=\"M291.5-411.5Q280-423 280-440t11.5-28.5Q303-480 320-480t28.5 11.5Q360-457 360-440t-11.5 28.5Q337-400 320-400t-28.5-11.5Zm160 0Q440-423 440-440t11.5-28.5Q463-480 480-480t28.5 11.5Q520-457 520-440t-11.5 28.5Q497-400 480-400t-28.5-11.5Zm160 0Q600-423 600-440t11.5-28.5Q623-480 640-480t28.5 11.5Q680-457 680-440t-11.5 28.5Q657-400 640-400t-28.5-11.5ZM200-80q-33 0-56.5-23.5T120-160v-560q0-33 23.5-56.5T200-800h40v-80h80v80h320v-80h80v80h40q33 0 56.5 23.5T840-720v560q0 33-23.5 56.5T760-80H200Zm0-80h560v-400H200v400Zm0-480h560v-80H200v80Zm0 0v-80 80Z\"/></svg>",verified:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"m344-60-76-128-144-32 14-148-98-112 98-112-14-148 144-32 76-128 136 58 136-58 76 128 144 32-14 148 98 112-98 112 14 148-144 32-76 128-136-58-136 58Zm34-102 102-44 104 44 56-96 110-26-10-112 74-84-74-86 10-112-110-24-58-96-102 44-104-44-56 96-110 24 10 112-74 86 74 84-10 114 110 24 58 96Zm102-318Zm-42 142 226-226-56-58-170 170-86-84-56 56 142 142Z\"/></svg>",label:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M160-160q-33 0-56.5-23.5T80-240v-480q0-33 23.5-56.5T160-800h440q19 0 36 8.5t28 23.5l216 288-216 288q-11 15-28 23.5t-36 8.5H160Zm0-80h440l180-240-180-240H160v480Zm220-240Z\"/></svg>",north_east:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"m202-160-42-42 498-498H364v-60h396v396h-60v-294L202-160Z\"/></svg>",south_east:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M364-200v-60h294L160-758l42-42 498 498v-294h60v396H364Z\"/></svg>",info:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M453-280h60v-240h-60v240Zm50.5-323.2q9.5-9.2 9.5-22.8 0-14.45-9.48-24.22-9.48-9.78-23.5-9.78t-23.52 9.78Q447-640.45 447-626q0 13.6 9.48 22.8 9.48 9.2 23.5 9.2t23.52-9.2ZM480.27-80q-82.74 0-155.5-31.5Q252-143 197.5-197.5t-86-127.34Q80-397.68 80-480.5t31.5-155.66Q143-709 197.5-763t127.34-85.5Q397.68-880 480.5-880t155.66 31.5Q709-817 763-763t85.5 127Q880-563 880-480.27q0 82.74-31.5 155.5Q817-252 763-197.68q-54 54.31-127 86Q563-80 480.27-80Zm.23-60Q622-140 721-239.5t99-241Q820-622 721.19-721T480-820q-141 0-240.5 98.81T140-480q0 141 99.5 240.5t241 99.5Zm-.5-340Z\"/></svg>",restart_alt:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M451-122q-123-10-207-101t-84-216q0-77 35.5-145T295-695l43 43q-56 33-87 90.5T220-439q0 100 66 173t165 84v60Zm60 0v-60q100-12 165-84.5T741-439q0-109-75.5-184.5T481-699h-20l60 60-43 43-133-133 133-133 43 43-60 60h20q134 0 227 93.5T801-439q0 125-83.5 216T511-122Z\"/></svg>",fullscreen:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M120-120v-193h60v133h133v60H120Zm527 0v-60h133v-133h60v193H647ZM120-647v-193h193v60H180v133h-60Zm660 0v-133H647v-60h193v193h-60Z\"/></svg>",fullscreen_exit:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M253-120v-133H120v-60h193v193h-60Zm394 0v-193h193v60H707v133h-60ZM120-647v-60h133v-133h60v193H120Zm527 0v-193h60v133h133v60H647Z\"/></svg>",open_in_new:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M180-120q-24 0-42-18t-18-42v-600q0-24 18-42t42-18h279v60H180v600h600v-279h60v279q0 24-18 42t-42 18H180Zm202-219-42-43 398-398H519v-60h321v321h-60v-218L382-339Z\"/></svg>",refresh:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M480-160q-133 0-226.5-93.5T160-480q0-133 93.5-226.5T480-800q85 0 149 34.5T740-671v-129h60v254H546v-60h168q-38-60-97-97t-137-37q-109 0-184.5 75.5T220-480q0 109 75.5 184.5T480-220q83 0 152-47.5T728-393h62q-29 105-115 169t-195 64Z\"/></svg>",article:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M277-279h275v-60H277v60Zm0-171h406v-60H277v60Zm0-171h406v-60H277v60Zm-97 501q-24 0-42-18t-18-42v-600q0-24 18-42t42-18h600q24 0 42 18t18 42v600q0 24-18 42t-42 18H180Zm0-60h600v-600H180v600Zm0-600v600-600Z\"/></svg>"};const Lr={campaign:"notifications_active",check_circle:"check",construction:"do_not_touch",edit_note:"edit",error_outline:"error",expand_less:"keyboard_arrow_up",expand_more:"keyboard_arrow_down",manage_search:"search",checklist:"done_all",help_outline:"help",iframe:"web_asset",info_outline:"info",lightbulb:"bolt",notifications:"notifications_active",rule:"code_blocks",splitscreen:"view_column",star:"sell",sync:"redo",task_alt:"check",thumb_up:"check",toggle_on:"check_box",toggle_off:"check_box_outline_blank",download:"arrow_downward_alt",ios_share:"upload",first_page:"chevron_left",last_page:"chevron_right",icon:"emoji_symbols",smart_button:"smart_display",warning:"error",settings:"settings",translate:"translate"};const Br="help";function Wt(u){const e=String(u??"").trim();if(!e)return Br;return Lr[e]??e}function Fr(u){const e=Wt(u);return Ot[e]??Ot["help"]??null}var I=class ut{sanitizer=g(Nr);documentRef=g(xe);richTextAllowedTags=new Set(["a","abbr","acronym","address","article","aside","b","bdi","bdo","big","center","blockquote","br","caption","cite","code","col","colgroup","dd","del","dfn","div","dl","dt","em","figcaption","figure","font","footer","h1","h2","h3","h4","h5","h6","header","hgroup","hr","iframe","img","i","ins","kbd","label","li","main","mark","menu","nav","ol","p","pre","q","rp","rt","ruby","s","samp","section","small","span","strike","strong","sub","sup","table","tbody","td","tfoot","th","thead","time","tr","tt","u","ul","var","video"]);richTextDropTags=new Set(["audio","base","button","canvas","embed","form","input","link","math","meta","object","script","select","style","svg","textarea"]);sanitizeHtml(e){const t=String(e??"");if(!t.trim())return"";const r=this.sanitizeHtmlForParsing(t);return this.sanitizer.sanitize($t.HTML,r)??""}sanitizeHtmlForParsing(e){const t=String(e??"");if(!t.trim())return"";return this.stripUnsafeMarkup(t)}sanitizeSvg(e){const t=String(e??"");if(!t.trim())return"";const r=this.documentRef;if(!r||typeof r.createElement!=="function")return t.includes("<svg")?t:"";const n=r.createElement("template");n.innerHTML=t;n.content.querySelectorAll("script,style,foreignObject,iframe,object,embed,link,meta,base").forEach(s=>{s.remove()});const i=n.content.querySelector("svg");if(!i)return"";this.scrubSvgElement(i);Array.from(i.querySelectorAll("*")).forEach(s=>{this.scrubSvgElement(s)});return i.outerHTML}sanitizeRichTextHtml(e){const t=String(e??"");if(!t.trim())return"";const r=this.documentRef;if(!r||typeof r.createElement!=="function")return this.sanitizeHtml(t);const n=r.createElement("template");n.innerHTML=t;Array.from(n.content.querySelectorAll("*")).forEach(i=>{this.scrubRichTextElement(i)});return this.sanitizer.sanitize($t.HTML,n.innerHTML)??""}sanitizeCssText(e){return String(e??"").replace(/@import[\s\S]*?;/gi,"").replace(/expression\s*\([^)]*\)/gi,"").replace(/behavior\s*:[^;]+;?/gi,"").replace(/-moz-binding\s*:[^;]+;?/gi,"").replace(/url\s*\(\s*(['"]?)(?:javascript:|vbscript:|data:)[^)]*\)/gi,"url()").trim()}sanitizeNavigationUrl(e){return this.sanitizeUrl(e,["http","https","mailto","tel"],true)}sanitizeIframeUrl(e){return this.sanitizeUrl(e,["http","https"],true)}sanitizeFileUrl(e){const t=String(e??"").replace(/[\u0000-\u001F\u007F]+/g,"").trim();if(!t)return null;const r=this.detectScheme(t);if(r==="blob")return/^blob:https?:\/\//i.test(t)?t:null;if(r==="data"){const n=t.slice(t.indexOf(":")+1).split(/[;,]/,1)[0].trim().toLowerCase();return!n||/html|xml|svg|javascript|ecmascript/.test(n)?null:t}return this.sanitizeUrl(t,["http","https"],true)}sanitizeUrl(e,t,r){const n=String(e??"").replace(/[\u0000-\u001F\u007F]+/g,"").trim();if(!n)return null;const i=this.detectScheme(n);if(i&&!t.includes(i))return null;if(r&&this.isSafeRelativeUrl(n))return n;const s=n.indexOf(":");if(s<=0)return null;const a=n.slice(0,s).replace(/\s+/g,"").toLowerCase();if(!t.includes(a))return null;if((a==="http"||a==="https")&&!this.isSafeHttpUrl(n))return null;const o=n.slice(s+1).trim();if((a==="mailto"||a==="tel")&&!o)return null;return n}isSafeRelativeUrl(e){if(!e)return false;if(e.startsWith("//")||e.startsWith("\\\\"))return false;return!Boolean(this.detectScheme(e))}detectScheme(e){const t=String(e??"").match(/^([a-zA-Z][a-zA-Z\d+.\-\s]*)\s*:/);if(!t)return null;return String(t[1]??"").replace(/\s+/g,"").toLowerCase()||null}isSafeHttpUrl(e){try{const t=new URL(e);return t.protocol==="http:"||t.protocol==="https:"}catch{return false}}stripUnsafeMarkup(e){const t=this.documentRef;if(!t||typeof t.createElement!=="function")return this.stripUnsafeMarkupFallback(e);const r=t.createElement("template");r.innerHTML=e;r.content.querySelectorAll("script,style,iframe,object,embed,link,meta,base").forEach(n=>{n.remove()});r.content.querySelectorAll("*").forEach(n=>{this.scrubElementAttributes(n)});return r.innerHTML}scrubRichTextElement(e){const t=String(e.tagName??"").trim().toLowerCase();if(!t){e.remove();return}if(this.richTextDropTags.has(t)){e.remove();return}if(!this.richTextAllowedTags.has(t)){this.unwrapElement(e);return}Array.from(e.attributes).forEach(r=>{const n=String(r.name??"").trim().toLowerCase();if(!n)return;if(n.startsWith("on")||n==="srcdoc"){e.removeAttribute(r.name);return}if(n==="style"){const i=this.sanitizeRichTextStyle(r.value);if(i)e.setAttribute("style",i);else e.removeAttribute(r.name);return}if(n==="class"){const i=this.sanitizeRichTextClassNames(r.value);if(i)e.setAttribute("class",i);else e.removeAttribute(r.name);return}if(t==="a"&&n==="href"){const i=this.sanitizeNavigationUrl(r.value);if(i)e.setAttribute("href",i);else e.removeAttribute(r.name);return}if(t==="img"&&n==="src"){const i=this.sanitizeRichTextImageUrl(r.value);if(i)e.setAttribute("src",i);else e.remove();return}if(t==="iframe"&&n==="src"){const i=this.sanitizeRichTextEmbedUrl(r.value);if(i)e.setAttribute("src",i);else e.remove();return}if(t==="video"&&n==="src"){const i=this.sanitizeRichTextVideoUrl(r.value);if(i)e.setAttribute("src",i);else e.remove();return}if(t==="a"&&(n==="target"||n==="rel"))return;if(t==="img"&&(n==="alt"||n==="loading"||n==="width"||n==="height"))return;if(t==="iframe"&&(n==="title"||n==="loading"||n==="width"||n==="height"||n==="allow"||n==="allowfullscreen"||n==="frameborder"))return;if(t==="video"&&(n==="controls"||n==="muted"||n==="loop"||n==="playsinline"||n==="preload"||n==="poster"||n==="width"||n==="height"))return;if((t==="td"||t==="th")&&(n==="colspan"||n==="rowspan"))return;if(t==="font"&&(n==="color"||n==="face"||n==="size"))return;if((t==="del"||t==="ins")&&n==="datetime")return;if((t==="q"||t==="blockquote"||t==="del"||t==="ins")&&n==="cite"){const i=this.sanitizeNavigationUrl(r.value);if(i)e.setAttribute("cite",i);else e.removeAttribute(r.name);return}if((t==="col"||t==="colgroup")&&n==="span")return;if(n==="dir"||n==="lang"||n==="title")return;e.removeAttribute(r.name)});if(t==="a"){const r=e;if(r.getAttribute("href")){r.setAttribute("target","_blank");r.setAttribute("rel","noopener noreferrer")}else{r.removeAttribute("target");r.removeAttribute("rel")}return}if(t==="img"){const r=e;if(!r.getAttribute("src")){r.remove();return}r.removeAttribute("href");r.removeAttribute("target");r.removeAttribute("rel");return}if(t==="iframe"){const r=e;if(!r.getAttribute("src")){r.remove();return}r.removeAttribute("href");r.removeAttribute("target");r.removeAttribute("rel");return}if(t==="video"){const r=e;if(!r.getAttribute("src")){r.remove();return}r.removeAttribute("href");r.removeAttribute("target");r.removeAttribute("rel");return}e.removeAttribute("href");e.removeAttribute("target");e.removeAttribute("rel")}sanitizeRichTextClassNames(e){return String(e??"").split(/\s+/).map(t=>t.trim()).filter(t=>/^[a-z_][a-z0-9_-]*$/i.test(t)).filter((t,r,n)=>n.indexOf(t)===r).join(" ")}unwrapElement(e){const t=e.parentNode;if(!t){e.remove();return}while(e.firstChild)t.insertBefore(e.firstChild,e);t.removeChild(e)}sanitizeRichTextStyle(e){return String(e??"").split(";").map(t=>t.trim()).filter(Boolean).map(t=>{const r=t.indexOf(":");if(r<=0)return null;const n=t.slice(0,r).trim().toLowerCase();const i=t.slice(r+1).trim();if(!this.isAllowedRichTextStyle(n,i))return null;return`${n}: ${i}`}).filter(t=>Boolean(t)).join("; ")}isAllowedRichTextStyle(e,t){const r=String(t??"").trim();if(!r)return false;if(/(?:expression|url\s*\(|javascript:|vbscript:|data:|@import|behavior\s*:)/i.test(r))return false;switch(e){case"font-weight":return/^(normal|bold|[1-9]00)$/i.test(r);case"font-style":return/^(normal|italic|oblique)$/i.test(r);case"text-decoration":return/^(none|underline|line-through|underline line-through|line-through underline)$/i.test(r);case"text-align":return/^(left|center|right|justify|start|end)$/i.test(r);case"color":case"background-color":return this.isAllowedColorValue(r);case"font-size":case"padding-left":case"padding-right":case"padding-top":case"padding-bottom":case"margin-left":case"margin-right":case"margin-top":case"margin-bottom":case"border-radius":case"border-width":case"gap":case"row-gap":case"column-gap":case"width":case"height":case"min-width":case"min-height":case"max-width":case"max-height":case"letter-spacing":return/^-?\d+(\.\d+)?(px|rem|em|%)$/i.test(r);case"margin":case"padding":return/^-?\d+(\.\d+)?(px|rem|em|%)(\s+-?\d+(\.\d+)?(px|rem|em|%)){0,3}$/i.test(r);case"line-height":return/^\d+(\.\d+)?(px|rem|em|%)?$/i.test(r);case"opacity":return/^(0|1|0?\.\d+)$/.test(r);case"border-style":return/^(none|solid|dashed|dotted|double)$/i.test(r);case"border-color":return this.isAllowedColorValue(r);case"border":case"border-top":case"border-right":case"border-bottom":case"border-left":return/^\d+(\.\d+)?(px|rem|em)\s+(none|solid|dashed|dotted|double)(\s+\S+)?$/i.test(r);case"text-transform":return/^(none|uppercase|lowercase|capitalize)$/i.test(r);case"vertical-align":return/^(baseline|top|middle|bottom|sub|super|text-top|text-bottom)$/i.test(r);case"white-space":return/^(normal|nowrap|pre|pre-wrap|pre-line|break-spaces)$/i.test(r);case"border-collapse":return/^(collapse|separate)$/i.test(r);case"justify-content":case"align-items":return/^(flex-start|flex-end|center|space-between|space-around|space-evenly|start|end|stretch|baseline)$/i.test(r);case"flex-direction":return/^(row|row-reverse|column|column-reverse)$/i.test(r);case"flex-wrap":return/^(nowrap|wrap|wrap-reverse)$/i.test(r);case"font-family":return/^[a-z0-9\s,"'\-]+$/i.test(r);case"list-style-type":return/^(decimal|disc|circle|square|lower-alpha|upper-alpha|lower-roman|upper-roman|none)$/i.test(r);case"list-style-position":return/^(inside|outside)$/i.test(r);case"direction":return/^(ltr|rtl)$/i.test(r);case"display":return/^(block|inline-block|inline|inline-flex|flex|grid|table|table-row|table-cell|list-item|none)$/i.test(r);case"float":return/^(left|right|none)$/i.test(r);case"clear":return/^(left|right|both|none)$/i.test(r);case"unicode-bidi":return/^(normal|plaintext|embed|isolate|bidi-override|isolate-override)$/i.test(r);default:return false}}isAllowedColorValue(e){return/^(#[0-9a-f]{3,8}|rgba?\([\d\s,.%]+\)|hsla?\([\d\s,.%]+\)|[a-z]+)$/i.test(String(e??"").trim())}sanitizeRichTextImageUrl(e){const t=String(e??"").replace(/[\u0000-\u001F\u007F]+/g,"").trim();if(!t)return null;if(/^data:image\/[a-z0-9.+-]+;base64,[a-z0-9+/=\s]+$/i.test(t))return t.replace(/\s+/g,"");return this.sanitizeUrl(t,["http","https"],true)}sanitizeRichTextVideoUrl(e){const t=String(e??"").replace(/[\u0000-\u001F\u007F]+/g,"").trim();if(!t)return null;return this.sanitizeUrl(t,["http","https"],true)}sanitizeRichTextEmbedUrl(e){const t=String(e??"").replace(/[\u0000-\u001F\u007F]+/g,"").trim();if(!t)return null;const r=this.sanitizeUrl(t,["http","https"],true);if(!r)return null;try{const n=new URL(r,"https://example.local").hostname.toLowerCase();if(n==="www.youtube.com"||n==="youtube.com"||n==="www.youtube-nocookie.com"||n==="youtube-nocookie.com"||n==="player.vimeo.com")return r;return null}catch{return null}}scrubSvgElement(e){const t=String(e.tagName??"").trim().toLowerCase();if(!new Set(["svg","path","g","circle","rect","line","polyline","polygon","ellipse","defs","clippath","title","desc"]).has(t)){e.remove();return}const r=new Set(["xmlns","viewbox","width","height","fill","fill-rule","fill-opacity","stroke","stroke-width","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-dasharray","stroke-dashoffset","stroke-opacity","d","transform","opacity","cx","cy","r","rx","ry","x","y","x1","y1","x2","y2","points","id","clip-path","mask","preserveaspectratio","focusable","aria-hidden","role","class","version"]);Array.from(e.attributes).forEach(n=>{const i=String(n.name??"").trim().toLowerCase();const s=String(n.value??"").trim();if(!i||i.startsWith("on")||i==="style"||i==="href"||i==="xlink:href"){e.removeAttribute(n.name);return}if(!r.has(i)){e.removeAttribute(n.name);return}if((i==="clip-path"||i==="mask")&&s&&!/^url\(#[-\w]+\)$/i.test(s)){e.removeAttribute(n.name);return}if(/(javascript:|vbscript:|data:|expression\s*\(|behavior\s*:|@import|url\s*\((?!#))/i.test(s))e.removeAttribute(n.name)})}scrubElementAttributes(e){const t=String(e.tagName??"").trim().toLowerCase();Array.from(e.attributes).forEach(r=>{const n=String(r.name??"").trim().toLowerCase();if(!n)return;if(n.startsWith("on")||n==="style"||n==="srcdoc"){e.removeAttribute(r.name);return}if(!this.isUrlAttribute(n))return;if(!this.sanitizeGenericElementUrl(t,n,r.value))e.removeAttribute(r.name)})}sanitizeGenericElementUrl(e,t,r){if(e==="img"&&t==="src")return this.sanitizeRichTextImageUrl(r);if(e==="video"&&t==="src")return this.sanitizeRichTextVideoUrl(r);if(e==="video"&&t==="poster")return this.sanitizeRichTextImageUrl(r);if(e==="iframe"&&t==="src")return this.sanitizeIframeUrl(r);if(t==="src")return this.sanitizeIframeUrl(r);return this.sanitizeNavigationUrl(r)}isUrlAttribute(e){return e==="href"||e==="src"||e==="xlink:href"||e==="action"||e==="formaction"||e==="poster"||e==="data"}stripUnsafeMarkupFallback(e){return String(e??"").replace(/<\s*(script|style|iframe|object|embed|link|meta|base)\b[\s\S]*?<\s*\/\s*\1\s*>/gi,"").replace(/<\s*(script|style|iframe|object|embed|link|meta|base)\b[^>]*\/?>/gi,"").replace(/\son[a-z0-9_-]+\s*=\s*(".*?"|'.*?'|[^\s>]+)/gi,"").replace(/\sstyle\s*=\s*(".*?"|'.*?'|[^\s>]+)/gi,"").replace(/\ssrcdoc\s*=\s*(".*?"|'.*?'|[^\s>]+)/gi,"")}static ɵfac=h.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:ut,deps:[],target:h.ɵɵFactoryTarget.Injectable});static ɵprov=h.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:ut,providedIn:"root"})};h.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:I,decorators:[{type:A,args:[{providedIn:"root"}]}]});var F=class dt{customSvgMap=new Map;sanitizedSvgCache=new Map;trackedRoots=new Set;baseStyledRoots=new WeakSet;iconRegistryVersion=E(0,...ngDevMode?[{debugName:"iconRegistryVersion"}]:[]);markupSecurityService=g(I);iconSetVersion=this.iconRegistryVersion.asReadonly();getSvg(e){const t=this.normalizeIconName(e);const r=Wt(t);const n=`${t}|${r}`;const i=this.sanitizedSvgCache.get(n);if(i!==void 0)return i;const s=this.customSvgMap.get(t);const a=s?this.markupSecurityService.sanitizeSvg(s):"";if(s){this.sanitizedSvgCache.set(n,a);return a}const o=this.customSvgMap.get(r);const l=o?this.markupSecurityService.sanitizeSvg(o):"";if(o){this.sanitizedSvgCache.set(n,l);return l}const c=this.markupSecurityService.sanitizeSvg(Fr(r)??"");this.sanitizedSvgCache.set(n,c);return c}registerSvgIcon(e,t,r=true){if(!this.upsertCustomSvgIcon(e,t,r))return false;this.notifyRegistryChanged();return true}registerSvgIcons(e,t=true){if(!e||typeof e!=="object")return[];const r=[];Object.keys(e).forEach(n=>{if(!this.upsertCustomSvgIcon(n,e[n],t))return;const i=this.normalizeIconName(n);r.push(i)});if(r.length>0)this.notifyRegistryChanged();return r}clearRegisteredSvgIcons(){if(this.customSvgMap.size===0)return;this.customSvgMap.clear();this.notifyRegistryChanged()}async registerSvgIconDirectory(e){const t=this.normalizeBasePath(e?.basePath);const r=this.normalizeIconNames(e?.names??[]);const n=String(e?.prefix??"").trim();const i=this.normalizeExtension(e?.extension);const s=e?.overwrite!==false;if(!t||r.length===0||typeof fetch!=="function")return{loaded:[],failed:[...r]};const a=[];const o=[];await Promise.all(r.map(async l=>{const c=`${t}/${n}${l}${i}`;try{const d=await fetch(c,{cache:"no-store"});if(!d.ok)throw new Error(`HTTP ${d.status}`);const m=(await d.text()).trim();if(!m)throw new Error("Empty SVG");if(this.upsertCustomSvgIcon(l,m,s))a.push(l)}catch{o.push(l)}}));if(a.length>0)this.notifyRegistryChanged();return{loaded:a,failed:o}}applyLegacyMaterialIcons(e){this.trackedRoots.add(e);this.ensureBaseIconStyles(e);e.querySelectorAll(".material-symbols-outlined").forEach(t=>{this.renderLegacyElement(t)})}applyIconSlots(e){this.trackedRoots.add(e);this.ensureBaseIconStyles(e);e.querySelectorAll(".nvb-icon-svg").forEach(t=>{this.renderIconSlotElement(t)})}ensureBaseIconStyles(e){if(this.baseStyledRoots.has(e))return;const t=e.ownerDocument;if(!t||typeof t.createElement!=="function")return;this.baseStyledRoots.add(e);const r=t.createElement("style");r.setAttribute("data-nvb-icon-base-styles","");r.textContent=".nvb-icon-svg{display:inline-flex;align-items:center;justify-content:center;width:1em;height:1em;overflow:hidden;line-height:1;vertical-align:middle;color:currentColor;flex-shrink:0}.nvb-icon-svg__content{display:inline-flex;width:100%;height:100%}.nvb-icon-svg svg{width:100%;height:100%;display:block;fill:currentColor;max-width:100%;max-height:100%}";e.prepend(r)}renderIconSlotElement(e){if(e.querySelector(":scope > .nvb-icon-svg__content"))return;const t=String(e.textContent??"").trim();if(!t)return;const r=this.getSvg(t);if(!r)return;const n=e.ownerDocument.createElement("span");n.className="nvb-icon-svg__content";n.innerHTML=r;e.textContent="";e.appendChild(n)}renderLegacySpan(e,t){this.renderLegacyElement(e,t)}renderLegacyElement(e,t){const r=this.resolveLegacyIconName(e,t);if(!r)return;const n=String(e.getAttribute("data-nvb-icon-name")??"").trim();if(e.getAttribute("data-nvb-icon-rendered")==="true"&&n===r)return;const i=this.getSvg(r);if(!i)return;e.setAttribute("data-icon",r);e.setAttribute("data-nvb-icon-name",r);e.setAttribute("data-nvb-icon-rendered","true");e.textContent="";e.insertAdjacentHTML("afterbegin",i)}resolveLegacyIconName(e,t){const r=this.normalizeIconName(t);if(r)return r;const n=this.normalizeIconName(e.getAttribute("data-icon"));if(n)return n;const i=e.childElementCount===0?this.normalizeIconName(e.textContent):"";if(i)return i;const s=this.normalizeIconName(e.getAttribute("data-nvb-icon-name"));if(s)return s;return""}notifyRegistryChanged(){this.sanitizedSvgCache.clear();this.iconRegistryVersion.update(e=>e+1);this.refreshTrackedRoots()}refreshTrackedRoots(){const e=[];this.trackedRoots.forEach(t=>{if(!this.isRootConnected(t)){e.push(t);return}this.applyLegacyMaterialIcons(t);this.applyIconSlots(t)});e.forEach(t=>{this.trackedRoots.delete(t)})}isRootConnected(e){if(e instanceof ShadowRoot)return Boolean(e.host?.isConnected);return Boolean(e.isConnected)}normalizeIconName(e){return String(e??"").trim()}normalizeBasePath(e){return String(e??"").trim().replace(/\/+$/,"")}normalizeExtension(e){const t=String(e??".svg").trim();if(!t)return".svg";return t.startsWith(".")?t:`.${t}`}normalizeIconNames(e){const t=new Set;e.forEach(r=>{const n=this.normalizeIconName(r);if(!n)return;t.add(n)});return[...t]}upsertCustomSvgIcon(e,t,r){const n=this.normalizeIconName(e);const i=this.markupSecurityService.sanitizeSvg(String(t??"").trim());if(!n||!i)return false;if(!r&&this.customSvgMap.has(n))return false;if(this.customSvgMap.get(n)===i)return false;this.customSvgMap.set(n,i);return true}static ɵfac=h.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:dt,deps:[],target:h.ɵɵFactoryTarget.Injectable});static ɵprov=h.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:dt,providedIn:"root"})};h.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:F,decorators:[{type:A,args:[{providedIn:"root"}]}]});var Ae=class ht{nestedStyleAtRules=["@container","@document","@layer","@media","@scope","@starting-style","@supports"];markupSecurityService=g(I);scopeCssText(e,t){const r=this.markupSecurityService.sanitizeCssText(String(e??"")).trim();const n=String(t??"").trim();if(!r||!n)return r;const i=this.flattenNestedCss(r);return this.scopeCssBlock(i,n)}scopeCssBlock(e,t){const r=String(e??"");let n=0;let i="";while(n<r.length){const s=this.findNextCssBlockOpen(r,n);if(s<0){i+=r.slice(n);break}const a=r.slice(n,s).trim();const o=this.findMatchingCssBrace(r,s);if(o<0){i+=r.slice(n);break}const l=r.slice(s+1,o);if(!a){n=o+1;continue}if(a.startsWith("@")){const m=a.toLowerCase();if(this.nestedStyleAtRules.some(p=>m.startsWith(p)))i+=`${a}{${this.scopeCssBlock(l,t)}}`;else i+=`${a}{${l}}`;n=o+1;continue}const c=this.splitCssSelectors(a).map(m=>this.prefixCssSelector(m,t)).join(", ");i+=`${c}{${l}}`;const d=this.extractDeclarationOnlyBody(l);if(d&&d.trim()!==l.trim())i+=`${c}{${d}}`;n=o+1}return i.trim()}flattenNestedCss(e){return this.flattenNestedCssBlock(String(e??"")).trim()}flattenNestedCssBlock(e){const t=String(e??"");let r=0;const n=[];while(r<t.length){const i=this.findNextCssBlockOpen(t,r);if(i<0){const c=t.slice(r).trim();if(c)n.push(c);break}const s=t.slice(r,i).trim();const a=this.findMatchingCssBrace(t,i);if(a<0){const c=t.slice(r).trim();if(c)n.push(c);break}const o=t.slice(i+1,a);if(!s){r=a+1;continue}if(s.startsWith("@")){const c=s.toLowerCase();if(this.nestedStyleAtRules.some(d=>c.startsWith(d)))n.push(`${s}{${this.flattenNestedCssBlock(o)}}`);else n.push(`${s}{${o}}`);r=a+1;continue}const l=this.splitCssSelectors(s);if(l.length>0){const c=this.flattenNestedRule(l,o);if(c)n.push(c)}r=a+1}return n.join("\n").trim()}flattenNestedRule(e,t){const r=e.map(a=>String(a??"").trim()).filter(a=>a.length>0);if(r.length===0)return"";const n=this.parseNestedRuleBody(t);const i=[];const s=n.declarations.trim();if(s)i.push(`${r.join(", ")}{${s}}`);n.nestedBlocks.forEach(a=>{const o=String(a.header??"").trim();if(!o)return;if(o.startsWith("@")){const d=o.toLowerCase();if(this.nestedStyleAtRules.some(m=>d.startsWith(m))){const m=this.flattenNestedRule(r,a.body);if(m.trim())i.push(`${o}{${m}}`)}else i.push(`${o}{${a.body}}`);return}const l=this.combineNestedSelectors(r,this.splitCssSelectors(o));if(l.length===0)return;const c=this.flattenNestedRule(l,a.body);if(c.trim())i.push(c)});return i.join("\n").trim()}parseNestedRuleBody(e){const t=String(e??"");let r=0;let n="";const i=[];while(r<t.length){const s=this.findNextCssBlockOpen(t,r);if(s<0){n+=t.slice(r);break}const a=this.findMatchingCssBrace(t,s);if(a<0){n+=t.slice(r);break}const o=t.slice(r,s);const l=o.lastIndexOf(";");let c="";if(l>=0){n+=o.slice(0,l+1);c=o.slice(l+1).trim()}else c=o.trim();if(c)i.push({header:c,body:t.slice(s+1,a)});else n+=o;r=a+1}return{declarations:n.trim(),nestedBlocks:i}}combineNestedSelectors(e,t){const r=[];e.forEach(n=>{const i=String(n??"").trim();if(!i)return;t.forEach(s=>{const a=String(s??"").trim();if(!a)return;if(a.includes("&")){r.push(a.replaceAll("&",i).trim());return}if(a.startsWith(":")){r.push(`${i}${a}`);return}if(a.startsWith(">")||a.startsWith("+")||a.startsWith("~")){r.push(`${i} ${a}`);return}r.push(`${i} ${a}`)})});return r.filter(n=>n.length>0)}findNextCssBlockOpen(e,t){let r=null;let n=false;for(let i=t;i<e.length;i+=1){const s=e[i];const a=e[i+1];if(n){if(s==="*"&&a==="/"){n=false;i+=1}continue}if(!r&&s==="/"&&a==="*"){n=true;i+=1;continue}if(r){if(s==="\\"){i+=1;continue}if(s===r)r=null;continue}if(s==="'"||s==='"'){r=s;continue}if(s==="{")return i}return-1}findMatchingCssBrace(e,t){let r=0;let n=null;let i=false;for(let s=t;s<e.length;s+=1){const a=e[s];const o=e[s+1];if(i){if(a==="*"&&o==="/"){i=false;s+=1}continue}if(!n&&a==="/"&&o==="*"){i=true;s+=1;continue}if(n){if(a==="\\"){s+=1;continue}if(a===n)n=null;continue}if(a==="'"||a==='"'){n=a;continue}if(a==="{"){r+=1;continue}if(a==="}"){r-=1;if(r===0)return s}}return-1}prefixCssSelector(e,t){const r=String(e??"").trim();if(!r)return t;if(r.includes(t))return r;if(r===":root"||r==="html"||r==="body")return t;if(r.startsWith(":host"))return r.replace(/:host\b/g,t);return`${t} ${r}`}splitCssSelectors(e){const t=String(e??"");const r=[];let n="";let i=null;let s=0;let a=0;for(let l=0;l<t.length;l+=1){const c=t[l];if(i){n+=c;if(c==="\\"){const d=t[l+1];if(d!==void 0){n+=d;l+=1}continue}if(c===i)i=null;continue}if(c==="'"||c==='"'){i=c;n+=c;continue}if(c==="("){s+=1;n+=c;continue}if(c===")"&&s>0){s-=1;n+=c;continue}if(c==="["){a+=1;n+=c;continue}if(c==="]"&&a>0){a-=1;n+=c;continue}if(c===","&&s===0&&a===0){const d=n.trim();if(d)r.push(d);n="";continue}n+=c}const o=n.trim();if(o)r.push(o);return r}extractDeclarationOnlyBody(e){const t=String(e??"");if(!t.includes("{"))return t.trim();let r="";let n=0;let i=null;let s=false;for(let a=0;a<t.length;a+=1){const o=t[a];const l=t[a+1];if(s){if(o==="*"&&l==="/"){s=false;a+=1}if(n===0)r+=o;continue}if(!i&&o==="/"&&l==="*"){s=true;if(n===0)r+=o;continue}if(i){if(n===0)r+=o;if(o==="\\"){const c=t[a+1];if(c!==void 0){if(n===0)r+=c;a+=1}continue}if(o===i)i=null;continue}if(o==="'"||o==='"'){i=o;if(n===0)r+=o;continue}if(o==="{"){if(n===0){const c=r.lastIndexOf(";");r=c>=0?r.slice(0,c+1):""}n+=1;continue}if(o==="}"){if(n>0){n-=1;continue}}if(n===0)r+=o}return r.trim()}static ɵfac=h.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:ht,deps:[],target:h.ɵɵFactoryTarget.Injectable});static ɵprov=h.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:ht,providedIn:"root"})};h.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:Ae,decorators:[{type:A,args:[{providedIn:"root"}]}]});const $r=["===","!==",">=","<=","!=","==","=",">","<"];function Ut(u,e,t,r){if(!Array.isArray(u)||u.length===0)return[];let n=[...u];n=Qt(n,r?.filterIfEqual,r?.valuePath,t,true);n=Qt(n,r?.filterIfNotEqual,r?.valuePath,t,false);const i=String(e??"").trim();if(!i)return n;if(Or(i))return n.filter(a=>Wr(i,a,t));const s=jr(i);if(!s)return n;return n.filter(a=>Ur(a,s))}function Qt(u,e,t,r,n=true){const i=Zr(e,r);if(!i.shouldApply)return u;const s=String(t??"value").trim()||"value";return u.filter(a=>{const o=Ce(x(a,s),i.value);return n?o:!o})}function Zr(u,e){const t=String(u??"").trim();if(!t)return{shouldApply:false,value:void 0};const r=t.match(/^\{([^}]+)\}$/);if(r)return Kt(r[1].trim(),e);if(Hr(t,e))return Kt(t,e);return{shouldApply:true,value:Jt(t)}}function Hr(u,e){if(!e||typeof e!=="object")return false;const t=String(u??"").trim();if(!t)return false;if(Object.prototype.hasOwnProperty.call(e,t)||t.includes(".")||t.includes("["))return true;return x(e,t)!==void 0}function Kt(u,e){if(!u||!e||typeof e!=="object")return{shouldApply:false,value:void 0};const t=x(e,u);if(t===null||t===void 0)return{shouldApply:false,value:t};if(typeof t==="string"&&t.trim().length===0)return{shouldApply:false,value:t};return{shouldApply:true,value:t}}function jr(u){const e=String(u??"").trim();if(!e)return null;for(const t of $r){const r=e.indexOf(t);if(r<=0)continue;const n=e.slice(0,r).trim();if(!n)return null;return{path:n,operator:t,expectedRaw:e.slice(r+t.length).trim()}}return{path:e}}function Or(u){return u.includes("{")||u.includes("}")||u.includes("&&")||u.includes("||")||u.includes("item.")||u.includes("(")||u.includes(")")}function Wr(u,e,t){const r=u.replaceAll("{","").replaceAll("}","").trim();if(!r)return true;const n=t&&typeof t==="object"?{...t,item:e,$item:e}:{item:e,$item:e};try{fr();return Boolean(Ir.evalSync(r,n))}catch{return true}}function Ur(u,e){const t=x(u,e.path);if(!e.operator)return Qr(t);const r=Jt(e.expectedRaw??"");switch(e.operator){case"===":case"=":return t===r;case"!==":return t!==r;case"==":return Ce(t,r);case"!=":return!Ce(t,r);case">":return se(t,r,(n,i)=>n>i);case"<":return se(t,r,(n,i)=>n<i);case">=":return se(t,r,(n,i)=>n>=i);case"<=":return se(t,r,(n,i)=>n<=i);default:return false}}function Qr(u){if(Array.isArray(u))return u.length>0;if(typeof u==="string")return u.trim().length>0;return Boolean(u)}function Jt(u){const e=String(u??"").trim();if(!e)return"";const t=e[0];const r=e[e.length-1];if(e.length>=2&&(t==='"'&&r==='"'||t==="'"&&r==="'"))return e.slice(1,-1);const n=e.toLowerCase();if(n==="true")return true;if(n==="false")return false;if(n==="null")return null;if(n==="undefined")return void 0;const i=Number(e);if(!Number.isNaN(i))return i;return e}function Ce(u,e){if(u===e)return true;const t=u===null||u===void 0;const r=e===null||e===void 0;if(t||r)return t&&r;const n=ae(u);const i=ae(e);if(n!==null&&i!==null)return n===i;return String(u).trim()===String(e).trim()}function se(u,e,t){const r=ae(u);const n=ae(e);if(r!==null&&n!==null)return t(r,n);if(u===null||u===void 0)return false;if(e===null||e===void 0)return false;return t(String(u),String(e))}function ae(u){if(typeof u==="number")return Number.isNaN(u)?null:u;if(typeof u==="string"){const e=u.trim();if(!e)return null;const t=Number(e);return Number.isNaN(t)?null:t}return null}const oe=new Set(["required","minlength","maxlength","min","max","pattern","email","strictoptions","custom"]);var $=class mt{validationDisplayEnabled=E(false,...ngDevMode?[{debugName:"validationDisplayEnabled"}]:[]);validationTouchedElements=E({},...ngDevMode?[{debugName:"validationTouchedElements"}]:[]);validationRenderVersion=E(0,...ngDevMode?[{debugName:"validationRenderVersion"}]:[]);ruleValidationErrors=new Map;externalValidationErrors=new Map;registeredValidatorTypes=new Map;registeredValidatorTypeDescriptors=E([],...ngDevMode?[{debugName:"registeredValidatorTypeDescriptors"}]:[]);warnedUnknownValidatorTypes=new Set;structureService=g(R);dataService=g(M);expressionService=g(D);constructor(){this.dataService.onValueChanged.add(e=>{const t=this.resolveEventElement(e.sender,e.dataPath);if(String(e.trigger??"change").trim().toLowerCase()==="blur")this.markElementValidationVisible(t,e.dataPath);if(this.validationDisplayEnabled()){this.scheduleAllValidators();return}if(!this.shouldEvaluateForTrigger(e.trigger,t?.validationExecutionMode,t??void 0))return;this.scheduleAllValidators()});this.dataService.onDataMutated.add(e=>{const t=this.resolveEventElement(e.sender,e.dataPath);if(!this.isExpressionDrivenElement(t))return;this.markElementValidationVisible(t,e.dataPath);this.scheduleAllValidators()})}isExpressionDrivenElement(e){return String(e?.expression??"").trim().length>0}registerValidatorTypes(e){if(!Array.isArray(e))return;e.forEach(t=>this.registerValidatorType(t))}registerValidatorType(e){const t=this.normalizeValidatorType(e?.type);if(!t||typeof e?.isValid!=="function")return;if(oe.has(t)){console.warn(`[NgxViewBuilder] Validator type "${t}" is built in and cannot be replaced. Use a different type name.`);return}this.registeredValidatorTypes.set(t,{type:t,label:String(e.label??"").trim()||String(e.type??"").trim(),defaultMessage:String(e.defaultMessage??"").trim(),hasValue:Boolean(e.hasValue),valueLabel:String(e.valueLabel??"").trim(),valuePlaceholder:String(e.valuePlaceholder??"").trim(),appliesTo:this.normalizeValidatorAppliesTo(e.appliesTo),validateEmpty:Boolean(e.validateEmpty),isValid:e.isValid});this.warnedUnknownValidatorTypes.delete(t);this.publishRegisteredValidatorTypes()}getRegisteredValidatorTypes(){return this.registeredValidatorTypeDescriptors()}getRegisteredValidatorType(e){return this.registeredValidatorTypes.get(this.normalizeValidatorType(e))??null}isBuiltInValidatorType(e){return oe.has(this.normalizeValidatorType(e))}hasValidatorType(e){const t=this.normalizeValidatorType(e);return oe.has(t)||this.registeredValidatorTypes.has(t)}clearRegisteredValidatorTypes(){this.registeredValidatorTypes.clear();this.publishRegisteredValidatorTypes()}setValidationDisplayEnabled(e){const t=Boolean(e);this.validationDisplayEnabled.set(t);if(!t)this.validationTouchedElements.set({})}isValidationDisplayEnabled(){return this.validationDisplayEnabled()}isElementValidationVisible(e){if(!e)return false;if(this.validationDisplayEnabled())return true;const t=this.resolveElementValidationKey(e,e.dataPath);if(!t)return false;return Boolean(this.validationTouchedElements()[t])}async handleElementBlur(e){if(!e)return;this.markElementValidationVisible(e,e.dataPath);if(this.validationDisplayEnabled()){await this.evaluateAllValidators();return}if(this.shouldEvaluateForTrigger("blur",e.validationExecutionMode,e)){await this.evaluateAllValidators();return}await this.evaluateValidators(e)}getValidationRenderVersion(){return this.validationRenderVersion()}validationScheduled=false;scheduleAllValidators(){if(this.validationScheduled)return;this.validationScheduled=true;setTimeout(()=>{this.validationScheduled=false;this.evaluateAllValidators()},0)}async evaluateAllValidators(){const e=Object.values(this.structureService.flatModelMap??{});await Promise.all(e.map(t=>this.evaluateValidators(t)))}async validateForm(){this.setValidationDisplayEnabled(true);await this.evaluateAllValidators();return!this.hasValidationErrors()}hasValidationErrors(){return Object.values(this.structureService.flatModelMap??{}).some(e=>{const t=e;return Array.isArray(t?.errors)&&t.errors.length>0})}getValidationIssues(){return Object.values(this.structureService.flatModelMap??{}).map(e=>e).filter(e=>Array.isArray(e?.errors)&&e.errors.length>0).map(e=>({elementName:String(e.name??""),dataPath:String(e.dataPath??""),errors:[...e.errors]}))}setExternalElementErrors(e,t){const r=this.resolveElementValidationKey(e,e?.dataPath);if(!e||!r)return;const n=this.normalizeExternalErrors(t);if(n.length>0){this.externalValidationErrors.set(r,n);this.markElementValidationVisible(e,e.dataPath)}else this.externalValidationErrors.delete(r);this.applyMergedElementErrors(e)}clearExternalElementErrors(e){this.setExternalElementErrors(e,[])}async evaluateValidators(e){if(!e)return;if(!this.isDataPathMaterialized(e?.dataPath)){this.setRuleElementErrors(e,[]);return}if(e.hidden||e.disabled){this.setRuleElementErrors(e,[]);return}const t=this.getElementValue(e);const r=[];if(e.required&&this.isEmptyValue(t))r.push(this.resolveRequiredMessage(e));const n=Array.isArray(e.validators)?[...e.validators]:[];const i=[...this.resolveImplicitValidators(e,n),...n];if(this.shouldApplyImplicitStrictOptions(e,n))i.unshift({type:"strictOptions"});if(i.length>0){const s=this.createValidationContext(e,t,this.dataService.getData());for(const a of i){if(!a||typeof a!=="object")continue;const o=a;if(!await this.shouldApplyValidator(o,e,s))continue;const l=await this.evaluateSingleValidator(o,e,t,s);if(!l.valid)r.push(l.message)}}this.setRuleElementErrors(e,Array.from(new Set(r)))}createValidationContext(e,t,r){const n=String(e?.name??"").trim();const i={...r??{},value:t};if(n)i[n]=t;return i}async shouldApplyValidator(e,t,r){const n=String(e?.applyIf??"").trim();if(!n)return true;try{const i=await this.expressionService.runPropertyCondition(r,n,t);return Boolean(i)}catch{return false}}async evaluateSingleValidator(e,t,r,n){const i=this.normalizeValidatorType(e?.type);if(i==="required"){const o=!this.isEmptyValue(r);return this.createValidationResult(o,String(e.message??"").trim()||this.resolveRequiredMessage(t),t)}if(i==="minlength"){const o=this.toNumber(e?.value);if(o===null||this.isEmptyValue(r))return{valid:true,message:""};const l=String(r??"").length>=o;return this.createValidationResult(l,e.message||`Minimum length: ${o}.`,t)}if(i==="maxlength"){const o=this.toNumber(e?.value);if(o===null||this.isEmptyValue(r))return{valid:true,message:""};const l=String(r??"").length<=o;return this.createValidationResult(l,e.message||`Maximum length: ${o}.`,t)}if(i==="pattern"){const o=String(e?.value??"").trim();if(!o||this.isEmptyValue(r))return{valid:true,message:""};try{const l=new RegExp(o).test(String(r??""));return this.createValidationResult(l,e.message||"Value does not match the pattern.",t)}catch{return this.createValidationResult(false,e.message||"Invalid regex pattern.",t)}}if(i==="min"){const o=this.toNumber(e?.value);const l=this.toNumber(r);if(o===null||l===null)return{valid:true,message:""};const c=l>=o;return this.createValidationResult(c,e.message||`Value must be >= ${o}.`,t)}if(i==="max"){const o=this.toNumber(e?.value);const l=this.toNumber(r);if(o===null||l===null)return{valid:true,message:""};const c=l<=o;return this.createValidationResult(c,e.message||`Value must be <= ${o}.`,t)}if(i==="email"){if(this.isEmptyValue(r))return{valid:true,message:""};const o=/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(r??""));return this.createValidationResult(o,e.message||"Invalid email format.",t)}if(i==="strictoptions"){if(this.isEmptyValue(r))return{valid:true,message:""};const o=this.findInvalidStrictOptionValues(t,r).length===0;return this.createValidationResult(o,e.message||(Array.isArray(r)?"Some selected values are not in the available options list.":"Value must be one of the available options."),t)}const s=this.registeredValidatorTypes.get(i);if(s){if(!s.validateEmpty&&this.isEmptyValue(r))return{valid:true,message:""};const o=e.message||s.defaultMessage||"Invalid value.";try{const l=await s.isValid({value:r,validatorValue:e?.value,validator:e,element:t,data:this.dataService.getData()});return this.createValidationResult(Boolean(l),o,t)}catch(l){console.error(`[NgxViewBuilder] Validator type "${s.type}" threw an error.`,l);return this.createValidationResult(false,o,t)}}const a=String(e?.condition??"").trim();if(!a){this.warnUnknownValidatorType(i);return{valid:true,message:""}}try{const o=await this.expressionService.runPropertyCondition(n,a,t);const l=Boolean(o);return this.createValidationResult(!l,e.message||"Invalid value.",t)}catch{return this.createValidationResult(false,e.message||"Invalid value.",t)}}getElementValue(e){if(!e?.dataPath)return e?.value;const t=this.dataService.getValue(e.dataPath);return t===void 0?e.value:t}isEmptyValue(e){if(e===null||e===void 0)return true;if(typeof e==="string")return e.trim().length===0;if(Array.isArray(e))return e.length===0;if(typeof e==="number")return Number.isNaN(e);if(typeof e==="object")return Object.keys(e).length===0;return false}resolveRequiredMessage(e){const t=String(e?.requiredMessage??"").trim();return this.resolveValidationMessagePlaceholders(t||"This field is required.",e)}createValidationResult(e,t,r){return{valid:e,message:this.resolveValidationMessagePlaceholders(t,r)}}resolveValidationMessagePlaceholders(e,t){const r=String(e??"");if(!r.includes("{"))return r.trim();return r.replace(/\{([^}]+)\}/g,(n,i)=>{return this.resolveValidationTokenValue(i,t)??String(i??"").trim()}).trim()}resolveValidationTokenValue(e,t){const r=String(e??"").trim();if(!r)return null;const n=this.expressionService.evaluateInlineExpression(`{${r}}`,t);const i=this.stringifyValidationMessageValue(n);if(i!==null)return i;const s=t?String(this.expressionService.applyContextToExpression(r,t)).trim():r;const a=this.resolveValidationMessageElement(s)??this.resolveValidationMessageElement(r);if(!a)return null;return this.stringifyValidationMessageValue(this.getElementValue(a))}resolveValidationMessageElement(e){const t=String(e??"").trim();if(!t)return null;const r=this.structureService.flatModelMap[t];if(r)return r;const n=Object.values(this.structureService.flatModelMap??{}).find(s=>String(s?.name??"").trim()===t);if(n)return n;const i=this.structureService.getStructure()?.elements?.[t];if(i)return i;return this.structureService.getPreviewStructure()?.elements?.[t]??null}stringifyValidationMessageValue(e){if(e===null||e===void 0)return null;if(typeof e==="string")return e;if(typeof e==="number"||typeof e==="boolean"||typeof e==="bigint")return String(e);if(e instanceof Date)return e.toISOString();if(Array.isArray(e))return e.map(t=>this.stringifyValidationMessageValue(t)).filter(t=>t!==null).join(", ");try{return JSON.stringify(e)}catch{return String(e)}}setElementErrors(e,t){const r=Array.isArray(t)?[...t]:[];const n=Array.isArray(e?.errors)?e.errors:[];if(n.length===r.length&&n.every((i,s)=>i===r[s])){e.errors=r;return}e.errors=r;this.validationRenderVersion.update(i=>i+1)}setRuleElementErrors(e,t){const r=this.resolveElementValidationKey(e,e?.dataPath);if(!r){this.setElementErrors(e,t);return}const n=this.normalizeExternalErrors(t);if(n.length>0)this.ruleValidationErrors.set(r,n);else this.ruleValidationErrors.delete(r);this.applyMergedElementErrors(e)}applyMergedElementErrors(e){const t=this.resolveElementValidationKey(e,e?.dataPath);if(!t){this.setElementErrors(e,[]);return}this.setElementErrors(e,[...this.getStoredErrors(this.ruleValidationErrors,t),...this.getStoredErrors(this.externalValidationErrors,t)])}getStoredErrors(e,t){const r=e.get(t);return Array.isArray(r)?[...r]:[]}normalizeExternalErrors(e){const t=(Array.isArray(e)?e:e?[e]:[]).map(r=>String(r??"").trim()).filter(Boolean);return Array.from(new Set(t))}toNumber(e){if(typeof e==="number")return Number.isFinite(e)?e:null;const t=String(e??"").trim();if(!t)return null;const r=Number(t);if(Number.isFinite(r))return r;const n=t.replace(/\s+/g,"");if(!n)return null;const i=Number(n.replace(",","."));if(Number.isFinite(i))return i;return this.parseGroupedNumber(n)}parseGroupedNumber(e){const t=String(e??"").trim();if(!t)return null;const r=t.startsWith("-")?"-":t.startsWith("+")?"+":"";const n=r?t.slice(1):t;if(!/^[0-9.,]+$/.test(n))return null;const i=n.lastIndexOf(",");const s=n.lastIndexOf(".");const a=Math.max(i,s);if(a<0){const m=Number(`${r}${n}`);return Number.isFinite(m)?m:null}const o=n.slice(0,a).replace(/[.,]/g,"");const l=n.slice(a+1).replace(/[.,]/g,"");const c=`${r}${o||"0"}${l?`.${l}`:""}`;const d=Number(c);return Number.isFinite(d)?d:null}normalizeValidatorType(e){return String(e??"custom").trim().toLowerCase()}normalizeValidatorAppliesTo(e){if(!Array.isArray(e))return[];return e.map(t=>String(t??"").trim().toLowerCase()).filter(t=>t.length>0)}publishRegisteredValidatorTypes(){const e=Array.from(this.registeredValidatorTypes.values()).map(t=>({type:t.type,label:t.label,defaultMessage:t.defaultMessage,hasValue:t.hasValue,valueLabel:t.valueLabel,valuePlaceholder:t.valuePlaceholder,appliesTo:[...t.appliesTo],validateEmpty:t.validateEmpty}));e.sort((t,r)=>t.label.localeCompare(r.label));this.registeredValidatorTypeDescriptors.set(e)}warnUnknownValidatorType(e){const t=this.normalizeValidatorType(e);if(oe.has(t)||this.warnedUnknownValidatorTypes.has(t))return;this.warnedUnknownValidatorTypes.add(t);console.warn(`[NgxViewBuilder] Validator type "${t}" is not registered in this application, so the rule is skipped. Register it with the API service (registerValidatorTypes) before rendering views that use it.`)}resolveImplicitValidators(e,t){const r=[];const n=new Set(t.filter(i=>i&&typeof i==="object").map(i=>this.normalizeValidatorType(i.type)));if(String(e?.type??"").trim().toLowerCase()==="number"){const i=this.toNumber(e["min"]);if(i!==null&&!n.has("min"))r.push({type:"min",value:i});const s=this.toNumber(e["max"]);if(s!==null&&!n.has("max"))r.push({type:"max",value:s})}return r}shouldApplyImplicitStrictOptions(e,t){if(!this.supportsStrictOptions(e))return false;if(e["strictOptions"]===false)return false;return!t.some(r=>{if(!r||typeof r!=="object")return false;return this.normalizeValidatorType(r.type)==="strictoptions"})}supportsStrictOptions(e){const t=String(e?.type??"").trim().toLowerCase();return(t==="select"||t==="multiselect"||t==="radio"||t==="selectbutton"||t==="checkbox")&&Array.isArray(e["options"])}findInvalidStrictOptionValues(e,t){const r=this.resolveStrictOptionValues(e);return(Array.isArray(t)?[...t]:[t]).filter(n=>!r.some(i=>this.isSameOptionValue(i,n)))}resolveStrictOptionValues(e){const t=Array.isArray(e["options"])?[...e["options"]]:[];return this.collectStrictOptionValues(e,t)}collectStrictOptionValues(e,t){const r=[];t.forEach(n=>{const i=Array.isArray(n?.["items"])?n["items"]:null;if(i){r.push(...this.collectStrictOptionValues(e,i));return}if(!this.passesStrictOptionFilters(e,n)||!this.isStrictOptionVisible(e,n))return;r.push(n["value"])});return r}passesStrictOptionFilters(e,t){const r=e["dataSource"]??null;const n=String(e["filterOptionsBy"]??"").trim()||String(r?.["filterOptionsBy"]??"").trim();const i=String(e["filterIfEqual"]??"").trim();const s=String(e["filterIfNotEqual"]??"").trim();if(!n&&!i&&!s)return true;const a=this.dataService.getData()??{};return Ut([t],n,a,{valuePath:"value",filterIfEqual:i,filterIfNotEqual:s}).length>0}isStrictOptionVisible(e,t){const r=String(t?.["visibleIf"]??"").trim();if(!r)return true;try{const n=this.expressionService.applyContextToExpression(r.replace(/{/g,"").replace(/}/g,"").trim(),e);if(!n)return true;return Boolean(this.expressionService.runPropertyConditionSync(this.dataService.getData(),n))}catch{return true}}isSameOptionValue(e,t){if(e===t)return true;if(e===null||e===void 0||t===null||t===void 0)return false;if(typeof e==="object"||typeof t==="object")try{return JSON.stringify(e)===JSON.stringify(t)}catch{return false}return String(e)===String(t)}resolveEventElement(e,t){if(e)return e;const r=String(t??"").trim();if(!r)return null;return this.structureService.flatModelMap[r]??null}markElementValidationVisible(e,t){const r=this.resolveElementValidationKey(e,t);if(!r)return;this.validationTouchedElements.update(n=>{if(n[r])return n;return{...n,[r]:true}})}resolveElementValidationKey(e,t){const r=String(t??e?.dataPath??"").trim();if(r)return r;return String(e?.name??"").trim()||null}shouldEvaluateForTrigger(e,t,r){const n=String(e??"change").trim().toLowerCase();if(n==="programmatic"||n==="load")return true;const i=this.normalizeExecutionMode(t);if(i==="onInput")return n==="input";if(i==="onChange")return n==="change";if(n==="blur")return true;if(n==="change"&&!this.isHighFrequencyInput(r))return true;return false}normalizeExecutionMode(e){const t=String(e??"").trim().toLowerCase();if(t==="oninput")return"onInput";if(t==="onchange")return"onChange";return"onBlur"}isHighFrequencyInput(e){const t=String(e?.type??"").trim().toLowerCase();return t==="text"||t==="number"||t==="textarea"}isDataPathMaterialized(e){if(!e||!e.includes("["))return true;const t=/\[(\d+)\]/g;let r=null;while((r=t.exec(e))!==null){const n=e.slice(0,r.index);const i=Number(r[1]);const s=this.dataService.getValue(n);if(!Array.isArray(s)||s.length<=i)return false}return true}static ɵfac=h.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:mt,deps:[],target:h.ɵɵFactoryTarget.Injectable});static ɵprov=h.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:mt,providedIn:"root"})};h.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:$,decorators:[{type:A,args:[{providedIn:"root"}]}],ctorParameters:()=>[]});var _e=class pt{state=E(null,...ngDevMode?[{debugName:"state"}]:[]);resolveFn=null;open(e){this.close(false);const t={isVisible:true,title:String(e?.title??"").trim(),message:String(e?.message??"").trim(),confirmLabel:String(e?.confirmLabel??"").trim(),cancelLabel:String(e?.cancelLabel??"").trim()};this.state.set(t);return new Promise(r=>{this.resolveFn=r})}confirm(){this.close(true)}cancel(){this.close(false)}close(e){const t=this.resolveFn;this.resolveFn=null;this.state.set(null);t?.(e)}static ɵfac=h.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:pt,deps:[],target:h.ɵɵFactoryTarget.Injectable});static ɵprov=h.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:pt,providedIn:"root"})};h.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:_e,decorators:[{type:A,args:[{providedIn:"root"}]}]});function Gt(u){if(!u||typeof u.showPopover!=="function")return;try{if(!u.hasAttribute("popover"))u.setAttribute("popover","manual");if(u.matches(":popover-open"))u.hidePopover();u.showPopover()}catch{}}var le=class gt{styleId="nvb-runtime-toast-style";themeVariableKeys=["--nvb-color-neutral-000","--nvb-color-neutral-300","--nvb-color-neutral-500","--nvb-color-neutral-600","--nvb-color-neutral-700","--nvb-color-primary-500","--nvb-color-primary-700","--nvb-color-success-500","--nvb-color-success-700","--nvb-color-warning-500","--nvb-color-warning-700","--nvb-color-risk-500","--nvb-color-risk-700","--nvb-color-surface-mix-target"];documentRef=g(xe);iconSvgService=g(F);containerMap=new Map;styleHost=null;setStyleHost(e){if(e instanceof HTMLElement){this.styleHost=e;return}if(typeof ShadowRoot!=="undefined"&&e instanceof ShadowRoot){this.styleHost=e.host instanceof HTMLElement?e.host:null;return}this.styleHost=null}show(e){if(!this.documentRef?.body)return;this.ensureStyles();const t=this.resolvePosition(e.position);const r=this.ensureContainer(t);const n=this.createToastNode({...e,position:t});r.appendChild(n);Gt(r);if(typeof requestAnimationFrame==="function")requestAnimationFrame(()=>{n.classList.add("nvb-runtime-toast--visible")});else n.classList.add("nvb-runtime-toast--visible");const i=e.autoHide!==false;const s=Number(e.autoHideMs);const a=Number.isFinite(s)&&s>=0?Math.floor(s):7e3;if(!i)return;setTimeout(()=>{this.removeToastNode(n)},a)}ensureStyles(){if(!this.documentRef?.head)return;if(this.documentRef.getElementById(this.styleId))return;const e=this.documentRef.createElement("style");e.id=this.styleId;e.textContent="\n /* The offsets below are the only insets that may apply: the container is promoted to\n the top layer, and the user-agent styles for a popover would otherwise stretch it\n across the viewport and paint a border and a canvas background over it. */\n .nvb-runtime-toast-container {\n position: fixed;\n inset: auto;\n z-index: 2147483602;\n display: grid;\n gap: 16px;\n width: min(360px, calc(100vw - 32px));\n height: auto;\n max-width: none;\n max-height: none;\n margin: 0;\n border: 0;\n padding: 0;\n color: inherit;\n background: transparent;\n overflow: visible;\n pointer-events: none;\n }\n .nvb-runtime-toast-container--top-left { top: 16px; left: 16px; }\n .nvb-runtime-toast-container--top-center { top: 16px; left: 50%; transform: translateX(-50%); }\n .nvb-runtime-toast-container--top-right { top: 16px; right: 16px; }\n .nvb-runtime-toast-container--bottom-left { bottom: 16px; left: 16px; }\n .nvb-runtime-toast-container--bottom-center { bottom: 16px; left: 50%; transform: translateX(-50%); }\n .nvb-runtime-toast-container--bottom-right { bottom: 16px; right: 16px; }\n .nvb-runtime-toast {\n pointer-events: auto;\n position: relative;\n border-radius: 4px;\n border: 1px solid var(--nvb-color-neutral-300, #d1d5db);\n background: var(--nvb-color-neutral-000, #ffffff);\n color: var(--nvb-color-neutral-700, #1f2937);\n box-shadow: 0 8px 16px rgba(0, 0, 0, 0.14), 0 0 2px rgba(0, 0, 0, 0.12);\n padding: 12px;\n display: grid;\n grid-template-columns: 20px minmax(0, 1fr) 24px;\n gap: 4px 12px;\n align-items: start;\n opacity: 0;\n transform: translateY(8px);\n transition: opacity .18s ease, transform .18s ease;\n overflow: hidden;\n }\n .nvb-runtime-toast--visible {\n opacity: 1;\n transform: translateY(0);\n }\n .nvb-runtime-toast--hidden {\n opacity: 0;\n transform: translateY(8px);\n }\n .nvb-runtime-toast__icon {\n grid-column: 1;\n grid-row: 1 / span 2;\n display: inline-flex;\n width: 20px;\n height: 20px;\n margin-top: 1px;\n align-items: center;\n justify-content: center;\n flex: 0 0 auto;\n }\n .nvb-runtime-toast__icon svg,\n .nvb-runtime-toast__close svg {\n width: 20px;\n height: 20px;\n display: block;\n fill: currentColor;\n }\n .nvb-runtime-toast__content {\n grid-column: 2;\n min-width: 0;\n display: grid;\n gap: 2px;\n }\n .nvb-runtime-toast--no-icon .nvb-runtime-toast__content {\n grid-column: 1 / 3;\n }\n .nvb-runtime-toast__title {\n margin: 0;\n font-size: 14px;\n font-weight: 600;\n line-height: 20px;\n color: var(--nvb-color-neutral-700, #1f2937);\n }\n .nvb-runtime-toast__message {\n margin: 0;\n font-size: 13px;\n line-height: 18px;\n color: var(--nvb-color-neutral-600, #475569);\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n }\n .nvb-runtime-toast__close {\n grid-column: 3;\n grid-row: 1;\n width: 24px;\n height: 24px;\n margin: -2px -2px 0 0;\n border-radius: 4px;\n border: 1px solid transparent;\n background: transparent;\n color: var(--nvb-color-neutral-600, #475569);\n line-height: 1;\n cursor: pointer;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n transition: background-color .16s ease, color .16s ease;\n }\n .nvb-runtime-toast__close:hover {\n background: color-mix(in oklab, var(--nvb-color-neutral-300, #d1d5db) 44%, transparent);\n color: var(--nvb-color-neutral-700, #1f2937);\n }\n .nvb-runtime-toast--info {\n color: var(--nvb-color-primary-700, #1d4ed8);\n }\n .nvb-runtime-toast--success {\n color: var(--nvb-color-success-700, #15803d);\n }\n .nvb-runtime-toast--warning {\n color: var(--nvb-color-warning-700, #b45309);\n }\n .nvb-runtime-toast--error {\n color: var(--nvb-color-risk-700, #b91c1c);\n }\n ";this.documentRef.head.appendChild(e)}ensureContainer(e){const t=this.containerMap.get(e);if(t&&this.documentRef.body.contains(t)){this.applyThemeVariables(t);return t}const r=this.documentRef.createElement("section");r.className=`nvb-runtime-toast-container nvb-runtime-toast-container--${e}`;this.applyThemeVariables(r);this.documentRef.body.appendChild(r);this.containerMap.set(e,r);return r}createToastNode(e){const t=this.resolveVariant(e.variant);const r=this.documentRef.createElement("article");r.className=`nvb-runtime-toast nvb-runtime-toast--${t}`;r.setAttribute("role",t==="info"?"status":"alert");r.setAttribute("aria-live",t==="info"?"polite":"assertive");this.applyThemeVariables(r);if(e.showIcon===false)r.classList.add("nvb-runtime-toast--no-icon");else{const o=this.documentRef.createElement("span");o.className="nvb-runtime-toast__icon";o.innerHTML=this.iconSvgService.getSvg(e.icon?.trim()||this.resolveVariantIcon(t));r.appendChild(o)}const n=this.documentRef.createElement("div");n.className="nvb-runtime-toast__content";const i=this.documentRef.createElement("h4");i.className="nvb-runtime-toast__title";i.textContent=String(e.title??"").trim()||this.resolveDefaultTitle(t);n.appendChild(i);const s=String(e.message??"").trim();if(s){const o=this.documentRef.createElement("p");o.className="nvb-runtime-toast__message";o.textContent=s;n.appendChild(o)}r.appendChild(n);const a=this.documentRef.createElement("button");a.type="button";a.className="nvb-runtime-toast__close";a.setAttribute("aria-label","Dismiss");a.innerHTML=this.iconSvgService.getSvg("close");a.addEventListener("click",()=>this.removeToastNode(r));r.appendChild(a);return r}removeToastNode(e){if(!e?.parentElement)return;e.classList.add("nvb-runtime-toast--hidden");setTimeout(()=>{e.remove()},170)}resolveVariant(e){const t=String(e??"").trim().toLowerCase();if(t==="error"||t==="risk"||t==="danger")return"error";if(t==="warning"||t==="warn")return"warning";if(t==="success"||t==="ok")return"success";if(t==="info"||t==="neutral")return"info";return"info"}resolvePosition(e){const t=String(e??"").trim().toLowerCase();if(t==="top-left"||t==="top-center"||t==="top-right"||t==="bottom-left"||t==="bottom-center"||t==="bottom-right")return t;return"top-right"}resolveDefaultTitle(e){switch(e){case"success":return"Success";case"warning":return"Warning";case"error":return"Error";default:return"Info"}}resolveVariantIcon(e){switch(e){case"success":return"check";case"warning":return"notification_important";case"error":return"error";default:return"info"}}applyThemeVariables(e){const t=this.styleHost;if(!t||!e)return;const r=getComputedStyle(t);this.themeVariableKeys.forEach(n=>{const i=r.getPropertyValue(n).trim();if(!i)return;e.style.setProperty(n,i)})}static ɵfac=h.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:gt,deps:[],target:h.ɵɵFactoryTarget.Injectable});static ɵprov=h.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:gt,providedIn:"root"})};h.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:le,decorators:[{type:A,args:[{providedIn:"root"}]}]});const Ve="__nvbRowContext";function Kr(u,e){if(!u||typeof u!=="object")return;u[Ve]=e}function Yt(u){if(!u||typeof u!=="object")return null;const e=u[Ve];if(!e||typeof e!=="object"||Array.isArray(e))return null;return e}function Xt(u,e){const t=Yt(u);if(!t)return e;const r={...e??{}};const n=t.row??null;q(r,"row",n);q(r,"item",n);q(r,"index",t.index);q(r,"rowIndex",t.index);q(r,"rowKey",t.rowKey);q(r,"parentRow",t.parentRow);q(r,"column",t.column);if(n&&typeof n==="object")Object.entries(n).forEach(([i,s])=>{const a=String(i??"").trim();if(!a||a.startsWith("__")||Jr.has(a))return;q(r,a,s)});return r}const Jr=new Set(["row","item","panel","value","index","rowIndex","rowKey","parentRow","column","data"]);function q(u,e,t){if(t===void 0||t===null)return;const r=u[e];if(r!==void 0&&r!==null)return;u[e]=t}var Q=class ft{onActionRun=new v;dataSourceService=g(O);dataService=g(M);expressionService=g(D);validatorService=g($);confirmDialogService=g(_e);runtimeToastService=g(le);structureService=g(R);uiTranslationService=g(re);markupSecurityService=g(I);injector=g(ne);router=g(jt,{optional:true});debounceTimers=new Map;async runActions(e,t,r="click",n){if(this.isInteractionLocked(e))return;if(!Array.isArray(t)||t.length===0)return;const i=t.filter(s=>{const a=s?.trigger??"click";return a==="always"||a===r});for(const s of i){if(this.shouldDebounceAction(s,r)){this.scheduleDebouncedAction(e,s,r,n);continue}if(!await this.runAction(e,s,n))break}}async runAction(e,t,r){if(this.isInteractionLocked(e))return false;if(!t)return true;const n=Xt(e,r);const i=this.normalizeAction(t);if(!await this.evaluateCondition(e,i.condition,n))return true;if(i.validateForm){if(!await this.validatorService.validateForm()){console.warn("[ElementAction] Action stopped because form is invalid.",{element:e?.name,actionId:i?.id,actionLabel:i?.label,type:i?.type});return false}}if(!await this.ensureActionConfirmed(i,n))return true;const s=String(i.type??"").trim();let a=false;if(s==="navigate")a=await this.executeNavigate(e,i,n);else if(s==="dataSource")a=await this.executeDataSource(e,i,n);else if(s==="sendMessage")a=this.executeSendMessage(e,i,n);else if(s==="setValue")a=await this.executeSetValue(i,n);else if(s==="setOptions")a=await this.executeSetOptions(i,n);else if(s==="reloadElements")a=await this.executeReloadElements(e,i,n);else if(s==="dialog")a=await this.executeDialog(i,n);else if(s==="toast"){this.executeToast(i,n);a=true}else if(s==="validate")a=await this.executeValidate();else if(s==="submit")a=await this.executeSubmit();this.onActionRun.fire({element:e,action:i,actionCode:String(i.actionCode??"").trim(),trigger:i.trigger??"click",succeeded:a,runtimeContext:n});if(!s)return false;if(a&&s!=="toast")this.executePostActionToast(i,n);return a}shouldDebounceAction(e,t){const r=String(t??"").trim();if(r!=="input"&&r!=="change")return false;return this.normalizeDebounceMs(e?.debounceMs)>0}scheduleDebouncedAction(e,t,r,n){const i=this.normalizeAction(t);const s=this.resolveDebounceKey(e,i,r);const a=this.debounceTimers.get(s);if(a)clearTimeout(a);const o=n?{...n}:void 0;const l=setTimeout(()=>{this.debounceTimers.delete(s);this.runAction(e,i,o)},this.normalizeDebounceMs(i.debounceMs));this.debounceTimers.set(s,l)}resolveDebounceKey(e,t,r){return`${String(e?.name??"").trim()||String(e?.dataPath??"").trim()||"element"}:${r}:${String(t?.id??"").trim()||String(t?.actionCode??"").trim()||String(t?.label??"").trim()||String(t?.type??"").trim()||"action"}`}async evaluateCondition(e,t,r){const n=String(t??"").trim();if(!n)return true;try{const i=this.expressionService.applyContextToExpression(this.normalizeConditionExpression(n),e).trim();if(!i)return true;const s=this.dataService.buildRuntimeContext(r);return!!await this.expressionService.runPropertyCondition(s,i)}catch{return false}}normalizeConditionExpression(e){return String(e??"").replace(/\{([^}]+)\}/g,(t,r)=>String(r??"").trim()).trim()}isInteractionLocked(e){if(!e)return false;if(Boolean(e["__pfInteractionLocked"]))return true;return Boolean(e.readOnly)||Boolean(e.disabled)}async executeNavigate(e,t,r){const n=await this.executeBeforeNavigateDataSource(e,t,r);if(!n.succeeded)return false;const i=this.resolveTemplate(String(t.navigateTo??""),r);const s=this.markupSecurityService.sanitizeNavigationUrl(i);if(!s)return false;if(t.openInNewTab){if(typeof window!=="undefined"&&typeof window.open==="function")window.open(s,"_blank","noopener,noreferrer");return true}if(s.startsWith("/")&&this.router){const a=this.buildNavigationStateExtras(t,n.responseData);await this.router.navigateByUrl(s,a).catch(()=>{this.navigateWithWindow(s)});return true}this.navigateWithWindow(s);return true}buildNavigationStateExtras(e,t){if(!e.passResponseAsNavigationState||t===void 0)return;const r=String(e.navigationStateKey??"").trim();return{state:r?{[r]:t}:typeof t==="object"&&t!==null&&!Array.isArray(t)?t:{value:t}}}async executeBeforeNavigateDataSource(e,t,r){const n=this.resolveTemplate(String(t.beforeNavigateDataSourceName??""),r);if(!n)return{succeeded:true};if(r?.["item"]!==void 0)this.dataService.setValue("__action.item",r["item"]);if(r?.["row"]!==void 0)this.dataService.setValue("__action.row",r["row"]);const i={name:n,useFor:"value",params:Array.isArray(t.params)?[...t.params]:[]};try{const s=await P(this.dataSourceService.reloadDataSource$(i,e,r));const a=this.resolveResponseData(s,t.responseDataPath);const o=this.resolveTemplate(String(t.responseTargetPath??""),r);if(o)await this.assignActionResponseValue(e,{...t,responseTargetPath:o},a,r);return{succeeded:true,responseData:a}}catch(s){console.error("[ElementAction] Failed to execute navigate resolver dataSource.",{element:e?.name,actionId:t?.id,actionLabel:t?.label,dataSourceName:n,error:s instanceof Error?s.message:s});return{succeeded:false}}}executeSendMessage(e,t,r){const n=this.resolveTemplate(String(t.dataSourceName??""),r);if(!n){console.warn("[ElementAction] sendMessage action skipped: dataSourceName not specified.",{element:e?.name,actionId:t?.id,actionLabel:t?.label});return false}const i=this.resolveMessagePayload(String(t.messagePayload??""),r);return this.dataSourceService.sendWebsocketMessage(n,i,e,r)}resolveMessagePayload(e,t){const r=String(e??"").trim();if(!r)return"";if(r.startsWith("{")||r.startsWith("["))try{return this.resolvePayloadPlaceholders(JSON.parse(r),t)}catch{}return this.resolveTemplate(r,t)}resolvePayloadPlaceholders(e,t){if(typeof e==="string")return this.resolveTemplate(e,t);if(Array.isArray(e))return e.map(r=>this.resolvePayloadPlaceholders(r,t));if(e&&typeof e==="object"){const r=e;const n={};Object.keys(r).forEach(i=>{n[i]=this.resolvePayloadPlaceholders(r[i],t)});return n}return e}async executeDataSource(e,t,r){const n=this.resolveTemplate(String(t.dataSourceName??""),r);if(!n){console.warn("[ElementAction] dataSource action skipped: dataSourceName not specified.",{element:e?.name,actionId:t?.id,actionLabel:t?.label});return false}if(r?.["item"]!==void 0)this.dataService.setValue("__action.item",r["item"]);if(r?.["row"]!==void 0)this.dataService.setValue("__action.row",r["row"]);const i={name:n,useFor:"value",params:Array.isArray(t.params)?[...t.params]:[]};const s=this.shouldRequestBinaryDownload(t)?{...r??{},__pfDataSourceResponseType:"blob",__pfObserveResponse:true}:r;try{const a=await P(this.dataSourceService.reloadDataSource$(i,e,s));await this.handleActionResponse(e,t,a,r);await this.reloadCurrentElementIfNeeded(e,t,r,n);await this.reloadLinkedDataSources(e,t,r,n);this.queueReloadOnReturnIfNeeded(t);if(t.validateForm===true||String(t.trigger??"").trim().toLowerCase()==="submit")this.dataService.markPristine();return true}catch(a){console.error("[ElementAction] Failed to execute dataSource action.",{element:e?.name,actionId:t?.id,actionLabel:t?.label,dataSourceName:n,error:a instanceof Error?a.message:a});return false}}async executeDialog(e,t){const r=this.resolveTemplate(String(e.dialogName??""),t);const n=this.resolveDialogOpenPath(r);if(!n){console.warn("[ElementAction] dialog action skipped: dialogName not specified.",{actionId:e?.id,actionLabel:e?.label});return false}const i=this.normalizeDialogOperation(e.dialogOperation);const s=Boolean(this.dataService.getValue(n));const a=i==="open"?true:i==="close"?false:!s;await this.dataService.setValue(n,a);return true}async executeSetValue(e,t){const r=this.resolveTemplate(String(e.setValueTargetPath??""),t);if(!r){console.warn("[ElementAction] setValue action skipped: target path not specified.",{actionId:e?.id,actionLabel:e?.label});return false}const n=this.resolveSetValuePayload(e,t);const i=this.resolveActionTargetPaths(r);if(i.length===0)return false;for(const s of i)await this.dataService.setValue(s,n);return true}async executeSetOptions(e,t){const r=this.resolveTemplate(String(e.setOptionsTargetElement??""),t);const n=this.resolveElementByName(r);if(!n){console.warn("[ElementAction] setOptions action skipped: target element not found.",{actionId:e?.id,actionLabel:e?.label,targetElementName:r});return false}const i=this.resolveSetOptionsPayload(e,t);const s=n;if(typeof s.setOptions==="function")s.setOptions(i);else if(Array.isArray(i))s.options=i;else{console.warn("[ElementAction] setOptions action skipped: target cannot consume options.",{actionId:e?.id,actionLabel:e?.label,targetElementName:r});return false}s.dataSourceLoaded=true;s.afterDataSourceLoad?.fire?.();return true}async executeReloadElements(e,t,r){const n=this.parseNameList(t.reloadElementNames);if(n.length===0){console.warn("[ElementAction] reloadElements action skipped: no elements specified.",{element:e?.name,actionId:t?.id,actionLabel:t?.label});return false}let i=0;for(const s of n){const a=this.resolveElementByName(s);if(!a){console.warn("[ElementAction] Element not found for reload.",{sourceElement:e?.name,actionId:t?.id,actionLabel:t?.label,targetElementName:s});continue}const o=this.resolvePrimaryDataSourceName(a);if(!o){console.warn("[ElementAction] Element does not have a primary data source for reload.",{sourceElement:e?.name,actionId:t?.id,actionLabel:t?.label,targetElementName:s});continue}try{await P(this.dataSourceService.reloadDataSource$(o,a,r));i+=1}catch(l){console.warn("[ElementAction] Failed to reload element data source.",{sourceElement:e?.name,actionId:t?.id,actionLabel:t?.label,targetElementName:s,dataSourceName:o,error:l instanceof Error?l.message:l})}}return i>0}async executeValidate(){const e=await this.validatorService.validateForm();const t=this.validatorService.getValidationIssues();this.getApiService().notifyValidationResult(e,t);return e}async executeSubmit(){const e=await this.validatorService.validateForm();const t=this.validatorService.getValidationIssues();const r=this.structureService.buildSubmitPayload();this.getApiService().notifyComplete(e,r,t);if(e)this.dataService.markPristine();return e}getApiService(){return this.injector.get(at)}async handleActionResponse(e,t,r,n){const i=this.normalizeResponseMode(t.responseMode);if(i==="none")return;const s=this.resolveResponseData(r,t.responseDataPath);if(i==="download"){await this.downloadActionResponse(s,t,n);return}if(i==="setValue")await this.assignActionResponseValue(e,t,s,n)}async reloadCurrentElementIfNeeded(e,t,r,n){if(!t.reloadCurrentElementAfterSuccess)return;const i=this.resolvePrimaryDataSourceName(e);if(!i||i===n)return;try{await P(this.dataSourceService.reloadDataSource$(i,e,r))}catch(s){console.warn("[ElementAction] Failed to reload current element data source.",{element:e?.name,actionId:t?.id,actionLabel:t?.label,dataSourceName:i,error:s instanceof Error?s.message:s})}}async reloadLinkedDataSources(e,t,r,n){const i=this.parseLinkedDataSourceNames(t.reloadDataSourceNames).filter(s=>s!==n);for(const s of i)try{const a=this.resolveDataSourceConsumerElements(s,e);for(const o of a)await P(this.dataSourceService.reloadDataSource$(s,o,r))}catch(a){console.warn("[ElementAction] Failed to reload linked dataSource.",{element:e?.name,actionId:t?.id,actionLabel:t?.label,dataSourceName:s,error:a instanceof Error?a.message:a})}}parseLinkedDataSourceNames(e){return this.parseNameList(e)}queueReloadOnReturnIfNeeded(e){const t=this.parseNameList(e.reloadOnReturnElementNames);if(t.length===0)return;this.dataSourceService.queueReturnReloadForElements(t)}parseNameList(e){return xr(e)}resolveResponseData(e,t){const r=String(t??"").trim();if(!r)return e;const n=x(e,r);return n===void 0?e:n}resolveDataSourceConsumerElements(e,t){const r=String(e??"").trim();if(!r)return[t];const n=new Map;const i=new WeakSet;const s=new Set(["dataService","modelService","structureService","parentElement","onDataSourceChanged","onOptionChanged","onValueChanging","onValueChanged"]);const a=l=>{if(!l||typeof l!=="object")return;if(i.has(l))return;i.add(l);const c=l;if(this.elementUsesDataSource(c,r)){const d=String(c["name"]??"").trim()||String(n.size);n.set(d,l)}for(const[d,m]of Object.entries(c)){if(s.has(d))continue;if(Array.isArray(m))m.forEach(a);else if(m&&typeof m==="object")a(m)}};const o=this.structureService.getPreviewStructure()??this.structureService.getStructure();Object.values(o?.elements??{}).forEach(a);return n.size>0?Array.from(n.values()):[t]}elementUsesDataSource(e,t){if([e["tableDataSourceName"],e["dataSourceName"],e["columnSettingsDataSourceName"],e["headerMenuDataSourceName"]].some(n=>String(n??"").trim()===t))return true;const r=e["dataSource"];return String(r?.["name"]??"").trim()===t}resolveElementByName(e){const t=String(e??"").trim();if(!t)return null;return this.structureService.getPreviewElement(t)??this.structureService.getElement(t)??null}resolvePrimaryDataSourceName(e){const t=e&&typeof e==="object"?e:null;if(!t)return"";const r=String(t["tableDataSourceName"]??"").trim();if(r)return r;const n=t["dataSource"];if(n&&typeof n==="object"){const i=String(n["name"]??"").trim();if(i)return i}return String(t["dataSourceName"]??"").trim()}normalizeResponseMode(e){const t=String(e??"none").trim().toLowerCase();if(t==="download")return"download";if(t==="setvalue")return"setValue";return"none"}normalizeSetValueMode(e){const t=String(e??"contextPath").trim().toLowerCase();if(t==="template"||t==="json"||t==="expression")return t;return"contextPath"}normalizeDebounceMs(e){const t=Number(e??0);if(!Number.isFinite(t)||t<=0)return 0;return Math.round(t)}async downloadActionResponse(e,t,r){const n=this.resolveTemplate(String(t.responseFileName??""),r)||"file";const i=this.isBlobHttpResponse(e)?await this.resolveHttpDownloadResponse(e,n):await this.resolveDownloadResource(e,n);if(!i)return;this.triggerLinkDownload(i.url,i.fileName);if(i.revokeOnDispose)setTimeout(()=>URL.revokeObjectURL(i.url),1e3)}async assignActionResponseValue(e,t,r,n){let i=this.resolveTemplate(String(t.responseTargetPath??""),n);if(!i){const a=this.resolveTemplate(String(t.responseTargetElement??""),n);const o=this.resolveElementByName(a);i=String(o?.dataPath??"").trim();if(!i)i=a}if(!i){console.warn("[ElementAction] response setValue skipped: target path not specified.",{element:e?.name,actionId:t?.id,actionLabel:t?.label});return}const s=this.resolveActionTargetPaths(i);for(const a of s)await this.dataService.setValue(a,r)}resolveSetValuePayload(e,t){const r=this.normalizeSetValueMode(e.setValueMode);const n=String(e.setValueValue??"");if(r==="expression"){const i=n.trim();if(!i)return null;const s=this.dataService.buildRuntimeContext(t);const a=this.expressionService.runPropertyConditionSync(s,i);return a===void 0?null:a}if(r==="template")return this.resolveTemplate(n,t);if(r==="json"){const i=this.resolveTemplate(n,t).trim();if(!i)return null;try{return JSON.parse(i)}catch{return i}}return this.resolveContextValue(n,t)}resolveSetOptionsPayload(e,t){return this.resolveSetValuePayload({...e,setValueMode:e.setOptionsMode,setValueValue:e.setOptionsValue},t)}resolveContextValue(e,t){const r=String(e??"").trim().replace(/^\{+/,"").replace(/\}+$/,"").trim();if(!r)return null;const n=this.dataService.buildRuntimeContext(t);const i=x(n,r);return i===void 0?null:i}resolveActionTargetPaths(e){const t=String(e??"").trim();if(!t)return[];const r=new Set;const n=this.getRuntimeVariableDefinitions();const i=t.startsWith("__variables.")?t.slice(12).trim():t;const s=n.find(a=>String(a?.name??"").trim()===i)??null;if(t.startsWith("__variables."))r.add(t);else if(s)r.add(`__variables.${i}`);else r.add(t);if(s&&Boolean(s.includeInDataJson)){const a=String(s.targetPath??"").trim()||i;if(a)r.add(a)}return Array.from(r)}getRuntimeVariableDefinitions(){const e=[this.structureService.getPreviewStructure()?.settings?.["variables"],this.structureService.getStructure()?.settings?.["variables"]];for(const t of e)if(Array.isArray(t))return t.filter(r=>r&&typeof r==="object");return[]}async resolveDownloadResource(e,t){if(e===null||e===void 0)return null;if(e instanceof Blob)return this.createDownloadResource(e,t,true);if(e instanceof ArrayBuffer)return this.createDownloadResource(new Blob([e],{type:"application/octet-stream"}),t,true);if(e instanceof Uint8Array)return this.createDownloadResource(new Blob([e.slice()],{type:"application/octet-stream"}),t,true);if(typeof e==="string"){const r=e.trim();if(!r)return null;if(r.startsWith("http://")||r.startsWith("https://")||r.startsWith("blob:")||r.startsWith("data:"))return{url:r,fileName:t,revokeOnDispose:false};const n=this.parseStructuredResponse(r);if(n!==r)return this.resolveDownloadResource(n,t);const i=this.createBlobFromBase64(r);if(i)return this.createDownloadResource(i,t,true);return this.createDownloadResource(new Blob([r],{type:"text/plain;charset=utf-8"}),t,true)}if(typeof e==="object"){const r=e;const n=String(r["fileName"]??r["name"]??r["filename"]??t).trim()||t;const i=String(r["url"]??r["downloadUrl"]??r["href"]??r["src"]??"").trim();if(i)return{url:i,fileName:n,revokeOnDispose:false};const s=r["content"]??r["data"]??r["base64"]??r["blob"]??r["file"]??r["result"]??null;if(s!==null&&s!==void 0&&s!==e)return this.resolveDownloadResource(s,n)}return null}isBlobHttpResponse(e){return e instanceof qr&&e.body instanceof Blob}async resolveHttpDownloadResponse(e,t){const r=e.body;if(!(r instanceof Blob))return null;const n=String(e.headers.get("content-type")||r.type||"application/octet-stream");const i=e.headers.get("content-disposition");const s=this.parseContentDispositionFileName(i)||t||"file";if(this.shouldUseBlobAsFile(n,i))return this.createDownloadResource(r,s,true);const a=await r.text();const o=this.parseStructuredResponse(a);const l=await this.resolveDownloadResource(o,s);if(l)return l;return this.createDownloadResource(r,s,true)}shouldUseBlobAsFile(e,t){const r=String(e??"").trim().toLowerCase();if(String(t??"").trim().toLowerCase().includes("attachment"))return true;if(!r)return true;if(r.startsWith("image/")||r.includes("pdf")||r.includes("octet-stream")||r.includes("zip")||r.includes("excel")||r.includes("spreadsheet")||r.includes("msword")||r.includes("officedocument"))return true;return!(r.includes("json")||r.startsWith("text/")||r.includes("javascript")||r.includes("xml"))}parseContentDispositionFileName(e){const t=String(e??"").trim();if(!t)return"";const r=t.match(/filename\*\s*=\s*UTF-8''([^;]+)/i);if(r?.[1])try{return decodeURIComponent(r[1].trim().replace(/^"|"$/g,""))}catch{return r[1].trim().replace(/^"|"$/g,"")}const n=t.match(/filename\s*=\s*("?)([^";]+)\1/i);return String(n?.[2]??"").trim()}parseStructuredResponse(e){const t=String(e??"").trim();if(t.startsWith("{")&&t.endsWith("}")||t.startsWith("[")&&t.endsWith("]"))try{return JSON.parse(t)}catch{return e}return e}createBlobFromBase64(e){const t=String(e??"").replace(/\s+/g,"");if(!t||t.length<16||t.length%4!==0)return null;if(!/^[A-Za-z0-9+/]+={0,2}$/.test(t))return null;try{const r=atob(t);const n=new Uint8Array(r.length);for(let i=0;i<r.length;i+=1)n[i]=r.charCodeAt(i);return new Blob([n],{type:"application/octet-stream"})}catch{return null}}createDownloadResource(e,t,r){const n=/html|xml|svg|javascript|ecmascript/i.test(e.type)?new Blob([e],{type:"application/octet-stream"}):e;return{url:URL.createObjectURL(n),fileName:t||"file",revokeOnDispose:r}}triggerLinkDownload(e,t){if(typeof document==="undefined")return;const r=this.markupSecurityService.sanitizeFileUrl(e);if(!r)return;const n=document.createElement("a");n.href=r;n.download=t||"file";n.target="_blank";n.rel="noopener";document.body.appendChild(n);n.click();document.body.removeChild(n)}executePostActionToast(e,t){if(!e?.showToastAfter)return;this.executeToast(e,t)}navigateWithWindow(e){if(typeof window==="undefined")return;if(typeof window.location?.assign==="function")window.location.assign(e)}executeToast(e,t){const r=this.resolveTemplate(String(e.toastTitle??e.label??""),t);const n=this.resolveTemplate(String(e.toastMessage??""),t);const i=this.resolveTemplate(String(e.toastIcon??""),t);const s=Number(e.toastAutoHideMs);this.runtimeToastService.show({title:r,message:n,variant:this.normalizeToastVariant(e.toastVariant),position:this.normalizeToastPosition(e.toastPosition),autoHide:e.toastAutoHide!==false,autoHideMs:Number.isFinite(s)&&s>=0?Math.floor(s):7e3,showIcon:e.toastShowIcon!==false,icon:i})}resolveTemplate(e,t){const r=String(e??"").trim();if(!r)return"";const n=this.dataService.buildRuntimeContext(t);const i=s=>{const a=s.trim();if(!a)return"";const o=x(n,a);if(o===null||o===void 0)return"";if(Array.isArray(o))return o.length?String(o[0]??""):"";return String(o)};return r.replace(/\{\{([^}]+)\}\}/g,(s,a)=>i(a)).replace(/\{([^}]+)\}/g,(s,a)=>i(a))}normalizeToastVariant(e){const t=String(e??"").trim().toLowerCase();if(t==="error"||t==="risk"||t==="danger")return"error";if(t==="warning"||t==="warn")return"warning";if(t==="success"||t==="ok")return"success";if(t==="info"||t==="neutral")return"info";return"info"}normalizeToastPosition(e){const t=String(e??"").trim().toLowerCase();if(t==="top-left"||t==="top-center"||t==="top-right"||t==="bottom-left"||t==="bottom-center"||t==="bottom-right")return t;return"top-right"}normalizeDialogOperation(e){const t=String(e??"").trim().toLowerCase();if(t==="open"||t==="close"||t==="toggle")return t;return"open"}resolveDialogOpenPath(e){const t=String(e??"").trim();if(!t)return"";if(t.startsWith("__dialog.")&&t.endsWith(".open"))return t;const r=t.replace(/^__dialog\./,"").replace(/\.open$/,"").trim();if(!r)return"";const n=this.resolveDialogElementByName(r);const i=String(n?.["openDataPath"]??"").trim();if(i)return i;return`__dialog.${r}.open`}resolveDialogElementByName(e){const t=String(e??"").trim();if(!t)return null;const r=this.structureService.getPreviewStructure()?.elements??this.structureService.getStructure()?.elements??{};return Object.values(r).find(n=>String(n?.["type"]??"").trim()==="dialog"&&String(n?.["name"]??"").trim()===t)??null}async ensureActionConfirmed(e,t){const r=this.coerceBoolean(e?.confirmEnabled);const n=this.coerceBoolean(e?.confirmOnDirty);if(!r&&!n)return true;if(n&&!this.dataService.isDirty())return true;const i=this.resolveTemplate(String(e?.confirmTitle??""),t);const s=this.resolveTemplate(String(e?.confirmMessage??""),t);const a=this.resolveTemplate(String(e?.confirmConfirmLabel??""),t);const o=this.resolveTemplate(String(e?.confirmCancelLabel??""),t);return this.confirmDialogService.open({title:i||(n?this.uiTranslationService.translate("confirm.dirtyTitle","Unsaved changes"):this.uiTranslationService.translate("confirm.title","Confirmation")),message:s||(n?this.uiTranslationService.translate("confirm.dirtyMessage","The form has unsaved changes. Continue?"):this.uiTranslationService.translate("confirm.actionMessage","Are you sure you want to perform this action?")),confirmLabel:a||this.uiTranslationService.translate("confirm.confirm","Continue"),cancelLabel:o||this.uiTranslationService.translate("confirm.cancel","Cancel")})}normalizeAction(e){return{...e,id:String(e?.id??"").trim(),trigger:String(e?.trigger??"click").trim()||"click",debounceMs:this.normalizeDebounceMs(e?.debounceMs),label:String(e?.label??""),actionCode:String(e?.actionCode??"").trim(),icon:String(e?.icon??"").trim(),type:String(e?.type??"").trim(),validateForm:this.coerceBoolean(e?.validateForm),confirmEnabled:this.coerceBoolean(e?.confirmEnabled),confirmOnDirty:this.coerceBoolean(e?.confirmOnDirty),confirmTitle:String(e?.confirmTitle??""),confirmMessage:String(e?.confirmMessage??""),confirmConfirmLabel:String(e?.confirmConfirmLabel??""),confirmCancelLabel:String(e?.confirmCancelLabel??""),condition:String(e?.condition??""),navigateTo:String(e?.navigateTo??""),openInNewTab:this.coerceBoolean(e?.openInNewTab),beforeNavigateDataSourceName:String(e?.beforeNavigateDataSourceName??""),passResponseAsNavigationState:this.coerceBoolean(e?.passResponseAsNavigationState),navigationStateKey:String(e?.navigationStateKey??""),dataSourceName:String(e?.dataSourceName??""),reloadCurrentElementAfterSuccess:this.coerceBoolean(e?.reloadCurrentElementAfterSuccess),reloadOnReturnElementNames:Array.isArray(e?.reloadOnReturnElementNames)?e.reloadOnReturnElementNames:String(e?.reloadOnReturnElementNames??""),responseMode:this.normalizeResponseMode(e?.responseMode),responseDataPath:String(e?.responseDataPath??""),responseTargetElement:String(e?.responseTargetElement??""),responseTargetPath:String(e?.responseTargetPath??""),responseFileName:String(e?.responseFileName??""),setValueTargetPath:String(e?.setValueTargetPath??""),setValueMode:this.normalizeSetValueMode(e?.setValueMode),setValueValue:String(e?.setValueValue??""),setOptionsTargetElement:String(e?.setOptionsTargetElement??""),setOptionsMode:this.normalizeSetValueMode(e?.setOptionsMode),setOptionsValue:String(e?.setOptionsValue??""),dialogName:String(e?.dialogName??""),dialogOperation:this.normalizeDialogOperation(e?.dialogOperation),reloadDataSourceNames:String(e?.reloadDataSourceNames??""),reloadElementNames:Array.isArray(e?.reloadElementNames)?e.reloadElementNames:String(e?.reloadElementNames??""),params:Array.isArray(e?.params)?[...e.params]:[],showToastAfter:this.coerceBoolean(e?.showToastAfter),toastTitle:String(e?.toastTitle??""),toastMessage:String(e?.toastMessage??""),toastVariant:this.normalizeToastVariant(e?.toastVariant),toastPosition:this.normalizeToastPosition(e?.toastPosition),toastAutoHide:e?.toastAutoHide===void 0?true:this.coerceBoolean(e?.toastAutoHide),toastAutoHideMs:Number(e?.toastAutoHideMs??7e3),toastShowIcon:e?.toastShowIcon===void 0?true:this.coerceBoolean(e?.toastShowIcon),toastIcon:String(e?.toastIcon??"")}}coerceBoolean(e){if(typeof e==="string"){const t=e.trim().toLowerCase();if(!t)return false;return t!=="false"&&t!=="0"&&t!=="off"&&t!=="no"}return Boolean(e)}shouldRequestBinaryDownload(e){return this.normalizeResponseMode(e?.responseMode)==="download"}static ɵfac=h.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:ft,deps:[],target:h.ɵɵFactoryTarget.Injectable});static ɵprov=h.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:ft,providedIn:"root"})};h.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:Q,decorators:[{type:A,args:[{providedIn:"root"}]}]});var K=class vt{defaultLocalStorageKey="ngx-view-builder.templates.v1";templateClickAttrName="data-nvb-event-click";structureService=g(R);dataSourceService=g(O);dataService=g(M);expressionService=g(D);uiTranslationService=g(re);iconSvgService=g(F);markupSecurityService=g(I);cssScopeService=g(Ae);elementActionService=g(Q);documentRef=g(xe);dataSourceTemplatesCache=new Map;templateActionDataSourceMap=new Map;getTemplates(e){const t=e??this.resolveCurrentStructure();const r=this.readTemplatesFromStructure(t);const n=this.getStorageConfig(t);if(n.mode==="localStorage"){const s=this.readTemplatesFromLocalStorage(n.localStorageKey);if(r.length>0){if(!this.areTemplateSnapshotsEqual(r,s))this.writeTemplatesToLocalStorage(n.localStorageKey,r);return r}if(s.length>0)return s;return r}const i=this.readTemplatesFromDataSource(n,t);if(i.length>0)return i;return r}getTemplateNames(e){return this.getTemplates(e).map(t=>String(t.name??"").trim()).filter(t=>t.length>0).sort((t,r)=>t.localeCompare(r))}getTemplateByName(e,t){const r=String(e??"").trim();if(!r)return null;return this.getTemplates(t).find(n=>String(n.name??"").trim()===r)??null}ensureStructureHasTemplate(e,t){const r=String(e??"").trim();if(!r)return null;const n=t??this.resolveCurrentStructure();if(!n)return null;const i=this.readTemplatesFromStructure(n);const s=i.find(o=>String(o.name??"").trim()===r)??null;if(s)return s;const a=this.getTemplateByName(r,n);if(!a)return null;this.writeTemplatesToStructure(n,[...i,a]);return a}resolveTemplateContentByName(e,t="",r){const n=this.getTemplateByName(e,r);if(n)return this.composeTemplateMarkup(n);return String(t??"")}extractTemplateFieldSlots(e){const t=new Set;const r=String(e??"");const n=/\b(?:row|item|value)\s*\[\s*(?:(['"])(\d+)\1|(\d+))\s*\]/g;let i=n.exec(r);while(i){const s=String(i[2]??i[3]??"").trim();if(s)t.add(s);i=n.exec(r)}return[...t].sort((s,a)=>{const o=Number(s)-Number(a);return Number.isFinite(o)&&o!==0?o:s.localeCompare(a)})}applyTemplateFieldMap(e,t){const r=this.normalizeTemplateFieldMappings(t);if(r.length===0)return e;const n={...e};["row","item","value"].forEach(i=>{const s=e[i];if(!this.isTemplateFieldSource(s))return;const a=Array.isArray(s)?[...s]:{...s};r.forEach(([o,l])=>{a[o]=this.resolveTemplateFieldPathValue(e,s,l)});n[i]=a});return n}ensureTemplateStore(e){const t=e??this.resolveCurrentStructure();if(!t)return[];if(!t.settings||typeof t.settings!=="object")t.settings={width:"1182",language:"en"};const r=this.getStorageConfig(t);const n=this.readTemplatesFromStructure(t);if(r.mode==="localStorage"){const a=this.readTemplatesFromLocalStorage(r.localStorageKey);const o=n.length>0?n:a;this.writeTemplatesToStructure(t,o);this.writeTemplatesToLocalStorage(r.localStorageKey,o);return o}const i=this.readTemplatesFromDataSource(r,t);const s=i.length>0?i:n;this.writeTemplatesToDataSource(r,t,s);return s}upsertTemplate(e,t){const r=t??this.resolveCurrentStructure();const n=this.ensureTemplateStore(r);const i=this.normalizeTemplate(e);if(!i)return n;const s=n.findIndex(a=>String(a.name??"").trim()===i.name);if(s>=0){n[s]=i;this.persistTemplates(n,r);return n}n.push(i);this.persistTemplates(n,r);return n}replaceTemplates(e,t){const r=(e??[]).map(n=>this.normalizeTemplate(n)).filter(n=>Boolean(n));this.persistTemplates(r,t);return r}removeTemplate(e,t){const r=String(e??"").trim();if(!r)return this.ensureTemplateStore(t);const n=t??this.resolveCurrentStructure();const i=this.ensureTemplateStore(n).filter(s=>String(s.name??"").trim()!==r);this.persistTemplates(i,n);return i}async loadTemplatesFromConfiguredDataSource(e){const t=e??this.resolveCurrentStructure();const r=this.getStorageConfig(t);if(r.mode!=="dataSource"||!r.dataSourceName)return this.getTemplates(t);try{const n=await P(this.dataSourceService.getData$(r.dataSourceName,true));const i=this.extractTemplatesFromUnknown(n,r.dataPath);this.dataSourceTemplatesCache.set(r.dataSourceName,i);return i}catch{return this.getTemplates(t)}}renderTemplate(e,t){return this.renderTemplateWithCss(e,t).html}renderTemplateWithCss(e,t){const r=String(e??"");if(!r.trim())return{html:"",cssText:""};const n=this.prepareTemplateSource(r);const i=this.dataService.buildRuntimeContext(t);const s=this.transformTemplateEventBindings(n.markup);try{const a=this.renderControlFlowBlocks(s,i);return{html:this.sanitizeRenderedMarkup(this.renderTemplateIcons(a)),cssText:n.cssText}}catch{const a=this.renderFallbackTemplate(s,i);return{html:this.sanitizeRenderedMarkup(this.renderTemplateIcons(a)),cssText:n.cssText}}}resolveTemplateCss(e,t=""){const r=this.prepareTemplateSource(String(e??""));if(!r.cssText)return"";const n=String(t??"").trim();if(!n)return r.cssText;return this.cssScopeService.scopeCssText(r.cssText,n)}setTemplateActionMap(e){const t=new Map;if(e&&typeof e==="object")Object.keys(e).forEach(r=>{const n=String(r??"").trim();const i=String(e[r]??"").trim();if(!n||!i)return;t.set(n,i)});this.templateActionDataSourceMap=t}registerTemplateActionDataSource(e,t){const r=String(e??"").trim();const n=String(t??"").trim();if(!r||!n)return;this.templateActionDataSourceMap.set(r,n)}async handleTemplateClickEvent(e,t,r){const n=e.target?.closest?.(`[${this.templateClickAttrName}]`);if(!n)return false;e.preventDefault();e.stopPropagation();if(this.isInteractionLocked(r))return true;const i=String(n.getAttribute(this.templateClickAttrName)??"").trim();if(!i)return true;const s=this.decodeTemplateEventExpression(i);await this.executeTemplateClickExpression(s,t,r);return true}escapeHtml(e){return String(e??"").replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}stringifyValue(e){if(e===null||e===void 0)return"";if(typeof e==="object")try{return JSON.stringify(e)}catch{return""}return String(e)}normalizeTemplateFieldMappings(e){if(!e||typeof e!=="object")return[];return Object.entries(e).map(([t,r])=>[String(t??"").trim(),String(r??"").trim()]).filter(([t,r])=>t.length>0&&r.length>0)}isTemplateFieldSource(e){return Boolean(e)&&typeof e==="object"}resolveTemplateFieldPathValue(e,t,r){const n=String(r??"").trim();if(!n)return;const i=this.resolveTemplateFieldPathCandidates(n);for(const s of i){const a=x(t,s);if(a!==void 0)return a}for(const s of i){const a=x(e,s);if(a!==void 0)return a}}resolveTemplateFieldPathCandidates(e){const t=[e];const r=e.match(/^(?:row|item|value)\s*\.\s*(.+)$/);if(r?.[1])t.push(r[1].trim());const n=e.match(/^(?:row|item|value)\s*\[\s*(['"])(.*?)\1\s*\](.*)$/);if(n?.[2])t.push(`${n[2].trim()}${String(n[3]??"")}`);return[...new Set(t.map(i=>i.trim()).filter(Boolean))]}normalizeTemplate(e){if(!e||typeof e!=="object")return null;const t=e;const r=String(t["name"]??t["code"]??"").trim();const n=String(t["content"]??"");if(!r)return null;const i=String(t["title"]??"").trim();const s=String(t["description"]??"").trim();const a=String(t["css"]??"").trim();const o=String(t["requestBodyJson"]??"").trim();const l=String(t["extraJsonSettings"]??"").trim();const c=Array.isArray(t["tags"])?t["tags"].map(d=>String(d??"").trim()).filter(d=>d.length>0):[];return{name:r,title:i||void 0,description:s||void 0,content:n,css:a||void 0,requestBodyJson:o||void 0,extraJsonSettings:l||void 0,tags:c.length>0?c:void 0}}composeTemplateMarkup(e){const t=String(e?.content??"");const r=String(e?.css??"").trim();if(!r)return t;return`<style>${r}</style>
|
|
2
|
+
${t}`}prepareTemplateSource(e){const t=this.extractStyleBlocks(String(e??""));return{markup:this.sanitizeTemplate(t.template),cssText:this.normalizeExtractedStyles(t.styles)}}getStorageConfig(e){return{mode:String(e?.settings?.templateStorageMode??"localStorage").trim().toLowerCase()==="datasource"?"dataSource":"localStorage",localStorageKey:String(e?.settings?.templateStorageLocalKey??"").trim()||this.defaultLocalStorageKey,dataSourceName:String(e?.settings?.templateStorageDataSourceName??"").trim(),dataPath:String(e?.settings?.templateStorageDataPath??"").trim()}}readTemplatesFromLocalStorage(e){const t=String(e??"").trim()||this.defaultLocalStorageKey;const r=localStorage.getItem(t);if(!r)return[];try{const n=JSON.parse(r);return this.extractTemplatesFromUnknown(n)}catch{return[]}}writeTemplatesToLocalStorage(e,t){const r=String(e??"").trim()||this.defaultLocalStorageKey;localStorage.setItem(r,JSON.stringify(t))}readTemplatesFromDataSource(e,t){const r=String(e.dataSourceName??"").trim();if(!r)return this.readTemplatesFromLocalStorage(this.buildDataSourceFallbackKey("unassigned"));if(this.dataSourceTemplatesCache.has(r))return[...this.dataSourceTemplatesCache.get(r)??[]];const n=this.findDataSource(r,t);if(!n){const s=this.readTemplatesFromLocalStorage(this.buildDataSourceFallbackKey(r));this.dataSourceTemplatesCache.set(r,s);return s}if(String(n.type??"").trim().toLowerCase()==="local"){if(String(n.params?.["localMode"]??"json").trim().toLowerCase()==="datapath"){const l=String(n.params?.["dataPath"]??"").trim();const c=l?this.dataService.getValue(l):void 0;const d=this.extractTemplatesFromUnknown(c,e.dataPath);this.dataSourceTemplatesCache.set(r,d);return d}const s=n.params?.["dataJson"]??n.params?.["data"];let a=s;if(typeof s==="string")try{a=JSON.parse(s)}catch{a=[]}const o=this.extractTemplatesFromUnknown(a,e.dataPath);this.dataSourceTemplatesCache.set(r,o);return o}const i=this.readTemplatesFromLocalStorage(this.buildDataSourceFallbackKey(r));this.dataSourceTemplatesCache.set(r,i);return i}writeTemplatesToDataSource(e,t,r){const n=String(e.dataSourceName??"").trim();if(!n){this.writeTemplatesToLocalStorage(this.buildDataSourceFallbackKey("unassigned"),r);return}this.dataSourceTemplatesCache.set(n,[...r]);const i=this.findDataSource(n,t);if(!i){this.writeTemplatesToLocalStorage(this.buildDataSourceFallbackKey(n),r);return}if(String(i.type??"").trim().toLowerCase()!=="local"){this.writeTemplatesToLocalStorage(this.buildDataSourceFallbackKey(n),r);return}i.params=i.params??{};i.params["localMode"]="json";if(e.dataPath){const s=this.parseJsonSafely(i.params["dataJson"])??{};const a=this.setByPath(s,e.dataPath,r);i.params["dataJson"]=JSON.stringify(a,null,2);return}i.params["dataJson"]=JSON.stringify(r,null,2)}persistTemplates(e,t){const r=t??this.resolveCurrentStructure();this.writeTemplatesToStructure(r,e);const n=this.getStorageConfig(r);if(n.mode==="localStorage"){this.writeTemplatesToLocalStorage(n.localStorageKey,e);return}this.writeTemplatesToDataSource(n,r,e)}readTemplatesFromStructure(e){if(!e||typeof e!=="object")return[];const t=e.settings?.templates;if(!Array.isArray(t))return[];return t.map(r=>this.normalizeTemplate(r)).filter(r=>Boolean(r))}writeTemplatesToStructure(e,t){if(!e||typeof e!=="object")return;if(!e.settings||typeof e.settings!=="object")e.settings={width:"1182",language:"en"};e.settings.templates=(t??[]).map(r=>({...r}))}areTemplateSnapshotsEqual(e,t){return this.serializeTemplateSnapshot(e)===this.serializeTemplateSnapshot(t)}serializeTemplateSnapshot(e){const t=(e??[]).map(r=>({name:String(r?.name??"").trim(),title:String(r?.title??"").trim(),description:String(r?.description??"").trim(),content:String(r?.content??"").trim(),css:String(r?.css??"").trim(),requestBodyJson:String(r?.requestBodyJson??"").trim(),extraJsonSettings:String(r?.extraJsonSettings??"").trim(),tags:Array.isArray(r?.tags)?r.tags.map(n=>String(n??"").trim()).filter(n=>n.length>0):[]})).filter(r=>r.name.length>0&&r.content.length>0).sort((r,n)=>r.name.localeCompare(n.name));return JSON.stringify(t)}extractTemplatesFromUnknown(e,t){const r=t?x(e,t):e;if(!Array.isArray(r))return[];return r.map(n=>this.normalizeTemplate(n)).filter(n=>Boolean(n))}buildDataSourceFallbackKey(e){return`${this.defaultLocalStorageKey}.dataSource.${e}`}findDataSource(e,t){return(t?.dataSources??this.structureService.getStructure()?.dataSources??this.structureService.getPreviewStructure()?.dataSources??[]).find(r=>String(r?.name??"").trim()===e)??null}parseJsonSafely(e){if(e&&typeof e==="object"&&!Array.isArray(e))return{...e};const t=String(e??"").trim();if(!t)return{};try{const r=JSON.parse(t);if(r&&typeof r==="object"&&!Array.isArray(r))return r}catch{return{}}return{}}setByPath(e,t,r){const n=String(t??"").trim();if(!n)return e;const i=n.split(".").filter(o=>o.length>0);if(i.length===0)return e;const s={...e};let a=s;for(let o=0;o<i.length;o++){const l=i[o];if(o===i.length-1){a[l]=r;break}const c=a[l];if(!c||typeof c!=="object"||Array.isArray(c))a[l]={};a=a[l]}return s}sanitizeTemplate(e){return String(e??"").replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi,"").replace(/<style[\s\S]*?>[\s\S]*?<\/style>/gi,"").replace(/<(iframe|object|embed|link|meta|base)\b[\s\S]*?>[\s\S]*?<\/\1>/gi,"").replace(/<(iframe|object|embed|link|meta|base)\b[^>]*\/?>/gi,"").replace(/@else\s+if(?=\s*\()/gi,"@else @if").replace(/\son[a-z0-9_-]+\s*=/gi," data-removed=").replace(/\sstyle\s*=/gi," data-removed-style=").replace(/\ssrcdoc\s*=/gi," data-removed-srcdoc=")}transformTemplateEventBindings(e){return e.replace(/\(\s*click\s*\)\s*=\s*("([^"]*)"|'([^']*)')/gi,(t,r,n,i)=>{const s=String(n??i??"").trim();if(!s)return"";const a=this.encodeTemplateEventExpression(s);return`${this.templateClickAttrName}="${a}"`})}encodeTemplateEventExpression(e){return encodeURIComponent(String(e??"").trim())}decodeTemplateEventExpression(e){try{return decodeURIComponent(String(e??""))}catch{return String(e??"")}}renderControlFlowBlocks(e,t){return this.renderTemplateSegment(e,{...t??{}})}renderTemplateSegment(e,t){let r=0;let n="";let i={...t??{}};while(r<e.length){const s=this.findNextDirectiveStart(e,r);if(s<0){n+=this.renderTextSegment(e.slice(r),i);break}n+=this.renderTextSegment(e.slice(r,s),i);const a=this.parseDirective(e,s,i);if(!a){n+=this.renderTextSegment(e.slice(s,s+1),i);r=s+1;continue}n+=a.output;r=a.endIndex;if(a.scope)i=a.scope}return n}renderTextSegment(e,t){if(!e)return"";const r=this.replaceTranslationTokens(e,t);const n=this.replaceInterpolations(r,t);const i=this.replaceLegacyTokens(n,t);return this.applyConditionalClassBindings(i,t)}findNextDirectiveStart(e,t){let r=e.indexOf("@",t);while(r>=0){if(this.hasDirectivePrefix(e,r,"@if")||this.hasDirectivePrefix(e,r,"@for")||this.hasDirectivePrefix(e,r,"@switch")||this.hasDirectivePrefix(e,r,"@let"))return r;r=e.indexOf("@",r+1)}return-1}hasDirectivePrefix(e,t,r){if(!e.startsWith(r,t))return false;if(t>0&&/[a-zA-Z0-9_]/.test(e[t-1]))return false;return true}parseDirective(e,t,r){if(this.hasDirectivePrefix(e,t,"@let"))return this.parseLetDirective(e,t,r);if(this.hasDirectivePrefix(e,t,"@if")){const n=this.parseIfBlock(e,t);if(!n)return null;const i=this.evaluateCondition(n.condition,r)?n.thenBlock:n.elseBlock??"";return{output:this.renderTemplateSegment(i,{...r}),endIndex:n.endIndex}}if(this.hasDirectivePrefix(e,t,"@for")){const n=this.parseForBlock(e,t);if(!n)return null;const i=this.normalizeIterable(this.evaluateExpression(n.iterableExpression,r));if(i.length===0)return{output:n.emptyBlock?this.renderTemplateSegment(n.emptyBlock,{...r}):"",endIndex:n.endIndex};let s="";const a=i.length;i.forEach((o,l)=>{const c={...r,[n.itemName]:o,$index:l,$count:a,$first:l===0,$last:l===a-1,$even:l%2===0,$odd:l%2!==0};n.letAliases.forEach(d=>{c[d.name]=this.resolveForAliasValue(d.expression,c)});s+=this.renderTemplateSegment(n.body,c)});return{output:s,endIndex:n.endIndex}}if(this.hasDirectivePrefix(e,t,"@switch")){const n=this.parseSwitchBlock(e,t);if(!n)return null;const i=this.evaluateExpression(n.expression,r);const s=n.cases.find(a=>{const o=this.evaluateExpression(a.expression,r);return i===o})?.block??n.defaultBlock??"";return{output:this.renderTemplateSegment(s,{...r}),endIndex:n.endIndex}}return null}parseLetDirective(e,t,r){if(!this.hasDirectivePrefix(e,t,"@let"))return null;let n=this.skipWhitespace(e,t+4);const i=e.slice(n).match(/^([a-zA-Z_$][\w$]*)/);if(!i)return null;const s=String(i[1]??"").trim();if(!s)return null;n+=i[0].length;n=this.skipWhitespace(e,n);if(e[n]!=="=")return null;n+=1;const a=this.findStatementTerminator(e,n);if(a<0)return null;const o=e.slice(n,a).trim();const l=this.evaluateExpression(o,r);return{output:"",endIndex:a+1,scope:{...r,[s]:l}}}parseIfBlock(e,t){if(!e.startsWith("@if",t))return null;const r=this.skipWhitespace(e,t+3);if(e[r]!=="(")return null;const n=this.findMatchingToken(e,r,"(",")");if(n<0)return null;const i=e.slice(r+1,n).trim();let s=this.skipWhitespace(e,n+1);if(e[s]!=="{")return null;const a=this.findMatchingToken(e,s,"{","}");if(a<0)return null;const o=e.slice(s+1,a);s=this.skipWhitespace(e,a+1);if(!e.startsWith("@else",s))return{condition:i,thenBlock:o,endIndex:s};s=this.skipWhitespace(e,s+5);if(e.startsWith("@if",s)){const c=this.parseIfBlock(e,s);if(!c)return{condition:i,thenBlock:o,endIndex:s};return{condition:i,thenBlock:o,elseBlock:e.slice(s,c.endIndex),endIndex:c.endIndex}}if(e[s]!=="{")return{condition:i,thenBlock:o,endIndex:s};const l=this.findMatchingToken(e,s,"{","}");if(l<0)return{condition:i,thenBlock:o,endIndex:s};return{condition:i,thenBlock:o,elseBlock:e.slice(s+1,l),endIndex:l+1}}parseForBlock(e,t){if(!this.hasDirectivePrefix(e,t,"@for"))return null;const r=this.skipWhitespace(e,t+4);if(e[r]!=="(")return null;const n=this.findMatchingToken(e,r,"(",")");if(n<0)return null;const i=e.slice(r+1,n).trim();let s=this.skipWhitespace(e,n+1);if(e[s]!=="{")return null;const a=this.findMatchingToken(e,s,"{","}");if(a<0)return null;const o=e.slice(s+1,a);s=this.skipWhitespace(e,a+1);let l;if(this.hasDirectivePrefix(e,s,"@empty")){s=this.skipWhitespace(e,s+6);if(e[s]==="{"){const S=this.findMatchingToken(e,s,"{","}");if(S>=0){l=e.slice(s+1,S);s=S+1}}}const c=this.splitTopLevelSegments(i,";").map(S=>S.trim()).filter(S=>S.length>0);if(c.length===0)return null;const d=c[0].match(/^([a-zA-Z_$][\w$]*)\s+of\s+([\s\S]+)$/);if(!d)return null;const m=String(d[1]??"").trim();const p=String(d[2]??"").trim();if(!m||!p)return null;const f=[];c.slice(1).forEach(S=>{const w=S.trim();if(!w.toLowerCase().startsWith("let "))return;this.splitTopLevelSegments(w.slice(4),",").map(y=>y.trim()).filter(y=>y.length>0).forEach(y=>{const T=y.match(/^([a-zA-Z_$][\w$]*)\s*=\s*([\s\S]+)$/);if(!T)return;const _=String(T[1]??"").trim();const j=String(T[2]??"").trim();if(!_||!j)return;f.push({name:_,expression:j})})});return{itemName:m,iterableExpression:p,body:o,emptyBlock:l,letAliases:f,endIndex:s}}parseSwitchBlock(e,t){if(!this.hasDirectivePrefix(e,t,"@switch"))return null;const r=this.skipWhitespace(e,t+7);if(e[r]!=="(")return null;const n=this.findMatchingToken(e,r,"(",")");if(n<0)return null;const i=e.slice(r+1,n).trim();let s=this.skipWhitespace(e,n+1);if(e[s]!=="{")return null;const a=this.findMatchingToken(e,s,"{","}");if(a<0)return null;const o=e.slice(s+1,a);const l=[];let c;let d=0;while(d<o.length){d=this.skipWhitespace(o,d);if(this.hasDirectivePrefix(o,d,"@case")){const m=this.skipWhitespace(o,d+5);if(o[m]!=="("){d+=1;continue}const p=this.findMatchingToken(o,m,"(",")");if(p<0){d+=1;continue}const f=o.slice(m+1,p).trim();let S=this.skipWhitespace(o,p+1);if(o[S]!=="{"){d=p+1;continue}const w=this.findMatchingToken(o,S,"{","}");if(w<0){d=S+1;continue}l.push({expression:f,block:o.slice(S+1,w)});d=w+1;continue}if(this.hasDirectivePrefix(o,d,"@default")){let m=this.skipWhitespace(o,d+8);if(o[m]!=="{"){d+=1;continue}const p=this.findMatchingToken(o,m,"{","}");if(p<0){d=m+1;continue}c=o.slice(m+1,p);d=p+1;continue}d+=1}return{expression:i,cases:l,defaultBlock:c,endIndex:a+1}}findStatementTerminator(e,t){let r=null;let n=false;let i=0;let s=0;let a=0;for(let o=t;o<e.length;o++){const l=e[o];if(r){if(n){n=false;continue}if(l==="\\"){n=true;continue}if(l===r)r=null;continue}if(l==="'"||l==='"'||l==="`"){r=l;continue}if(l==="(")i+=1;if(l===")")i-=1;if(l==="{")s+=1;if(l==="}")s-=1;if(l==="[")a+=1;if(l==="]")a-=1;if(l===";"&&i<=0&&s<=0&&a<=0)return o}return-1}splitTopLevelSegments(e,t){const r=[];let n=null;let i=false;let s=0;let a=0;let o=0;let l=0;for(let c=0;c<e.length;c++){const d=e[c];if(n){if(i){i=false;continue}if(d==="\\"){i=true;continue}if(d===n)n=null;continue}if(d==="'"||d==='"'||d==="`"){n=d;continue}if(d==="(")s+=1;if(d===")")s-=1;if(d==="{")a+=1;if(d==="}")a-=1;if(d==="[")o+=1;if(d==="]")o-=1;if(d===t&&s<=0&&a<=0&&o<=0){r.push(e.slice(l,c));l=c+1}}r.push(e.slice(l));return r}normalizeIterable(e){if(Array.isArray(e))return e;if(typeof e==="string")return Array.from(e);if(e&&typeof e==="object"){if(typeof e[Symbol.iterator]==="function")try{return Array.from(e)}catch{return[]}return Object.values(e)}return[]}resolveForAliasValue(e,t){const r=String(e??"").trim();if(!r)return"";if(Object.prototype.hasOwnProperty.call(t,r))return t[r];return this.evaluateExpression(r,t)}replaceInterpolations(e,t){return e.replace(/\{\{([\s\S]*?)\}\}/g,(r,n)=>{const i=this.evaluateExpression(n,t);return this.escapeHtml(this.stringifyValue(i))})}replaceTranslationTokens(e,t){return e.replace(/\[\[\s*([^[\]|]+?)\s*(?:\|\s*([^[\]]+?)\s*)?\]\]/g,(r,n,i)=>{const s=String(n??"").trim();if(!s)return"";const a=this.evaluateExpression(s,t);const o=String(a??s).trim();const l=String(i??"").trim()||void 0;return this.escapeHtml(this.translateTemplateText(o,l))})}replaceLegacyTokens(e,t){return e.replace(/(?<!\{)\{([^{}\n]+)\}(?!\})/g,(r,n)=>{const i=String(n??"").trim();if(!/^[a-zA-Z0-9_.[\]]+$/.test(i))return r;const s=this.evaluateExpression(i,t);return this.escapeHtml(this.stringifyValue(s))})}evaluateCondition(e,t){const r=this.evaluateExpression(e,t);return Boolean(r)}evaluateExpression(e,t){const r=this.parseTranslationCall(e);if(r)return this.translateTemplateText(r.key,r.fallback);const n=this.normalizeExpression(e);if(!n)return"";if(Object.prototype.hasOwnProperty.call(t,n))return t[n];try{return this.expressionService.runPropertyConditionSync(t,n)}catch{return x(t,n,this.dataService.getValue(n))}}extractStyleBlocks(e){const t=[];return{template:String(e??"").replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,r=>{t.push(r);return""}),styles:t}}normalizeExtractedStyles(e){if(!Array.isArray(e)||e.length===0)return"";return e.map(t=>String(t??"").replace(/^<style\b[^>]*>/i,"").replace(/<\/style>\s*$/i,"")).map(t=>this.markupSecurityService.sanitizeCssText(t)).map(t=>t.trim()).filter(t=>t.length>0).join("\n\n")}restoreStyleBlocks(e,t){const r=String(e??"");if(!Array.isArray(t)||t.length===0)return r;const n=t.join("\n");if(!r.trim())return n;return`${n}
|
|
3
|
+
${r}`}renderTemplateIcons(e){const t=String(e??"");if(!t.trim())return t;if(!/<nvb-icon\b/i.test(t))return t;const r=this.documentRef;if(!r||typeof r.createElement!=="function")return t;const n=r.createElement("div");n.innerHTML=this.markupSecurityService.sanitizeHtmlForParsing(t);n.querySelectorAll("nvb-icon").forEach(i=>this.replaceTemplateNvbIconNode(i));return n.innerHTML}replaceTemplateNvbIconNode(e){const t=this.resolveTemplateNvbIconName(e);if(!t||!this.iconSvgService.getSvg(t)){e.remove();return}const r=e.ownerDocument??this.documentRef;if(!r||typeof r.createElement!=="function")return;const n=r.createElement("span");n.className=["nvb-icon-svg",String(e.getAttribute("class")??"").trim()].filter(a=>a.length>0).join(" ");const i=String(e.getAttribute("title")??"").trim();if(i)n.setAttribute("title",i);const s=String(e.getAttribute("aria-label")??e.getAttribute("ariaLabel")??"").trim();if(s){n.setAttribute("role","img");n.setAttribute("aria-label",s)}else n.setAttribute("aria-hidden","true");n.textContent=t;e.replaceWith(n)}sanitizeRenderedMarkup(e){return this.markupSecurityService.sanitizeHtml(e)}resolveTemplateNvbIconName(e){const t=String(e.getAttribute("name")??e.getAttribute("icon")??e.getAttribute("data-icon")??"").trim();if(t)return t;return String(e.textContent??"").trim()||"help"}renderFallbackTemplate(e,t){const r=this.replaceTranslationTokens(e,t);const n=this.replaceInterpolations(r,t);const i=this.replaceLegacyTokens(n,t);return this.applyConditionalClassBindings(i,t)}applyConditionalClassBindings(e,t){if(!e.includes("[class."))return e;return e.replace(/<[^<>]+>/g,r=>this.resolveConditionalClassTag(r,t))}resolveConditionalClassTag(e,t){if(!e.includes("[class.")||e.startsWith("</")||e.startsWith("<!"))return e;const r=Array.from(e.matchAll(/\s\[class\.([A-Za-z0-9_-]+)\]\s*=\s*("([^"]*)"|'([^']*)')/g));if(r.length===0)return e;const n=r.map(s=>({className:String(s[1]??"").trim(),expression:String(s[3]??s[4]??"").trim()})).filter(s=>s.className.length>0&&s.expression.length>0).filter(s=>this.evaluateCondition(s.expression,t)).map(s=>s.className);const i=e.replace(/\s\[class\.[A-Za-z0-9_-]+\]\s*=\s*("([^"]*)"|'([^']*)')/g,"");if(n.length===0)return i;return this.mergeConditionalClasses(i,n)}mergeConditionalClasses(e,t){const r=Array.from(new Set(t.map(s=>String(s??"").trim()).filter(s=>s.length>0)));if(r.length===0)return e;const n=e.match(/\sclass\s*=\s*("([^"]*)"|'([^']*)')/i);if(n){const s=n[2]!==void 0?'"':"'";const a=(n[2]??n[3]??"").split(/\s+/).map(l=>l.trim()).filter(l=>l.length>0);const o=Array.from(new Set([...a,...r]));return e.replace(n[0],` class=${s}${o.join(" ")}${s}`)}const i=e.endsWith("/>")?e.length-2:e.length-1;return`${e.slice(0,i)} class="${r.join(" ")}"${e.slice(i)}`}parseTranslationCall(e){const t=String(e??"").trim().match(/^t(?:r)?\(\s*(['"`])([\s\S]*?)\1(?:\s*,\s*(['"`])([\s\S]*?)\3)?\s*\)$/);if(!t)return null;const r=String(t[2]??"").trim();if(!r)return null;return{key:r,fallback:String(t[4]??"").trim()||void 0}}translateTemplateText(e,t){const r=String(e??"").trim();if(!r)return t??"";const n=this.resolveCurrentStructure();const i=n?.localization;const s=String(n?.settings?.language??i?.defaultLanguage??"en").trim()||"en";const a=i?.texts?.[s];const o=String(a?.[r]??"").trim();if(o)return o;const l=String(i?.defaultLanguage??"").trim();const c=l?i?.texts?.[l]:null;const d=String(c?.[r]??"").trim();if(d)return d;return this.uiTranslationService.translate(r,t??r)}normalizeExpression(e){return String(e??"").trim().replace(/\{([^}]+)\}/g,(t,r)=>String(r??"").trim()).replaceAll("===","==").replaceAll("!==","!=").replaceAll("?.",".")}async executeTemplateClickExpression(e,t,r){if(this.isInteractionLocked(r))return;const n=this.parseTemplateActionCall(e);if(!n)return;const i=this.dataService.buildRuntimeContext(t);const s=n.args.map(c=>this.evaluateExpression(c,i));if(await this.executeTemplateElementAction(n.name,s,i,r))return;const a=this.resolveTemplateDataSourceCall(n.name,s);if(!a)return;const o=this.buildTemplateActionContext(i,a.args,a.actionName);const l=this.templateActionDataSourceMap.get(a.name)??a.name;await this.executeTemplateDataSourceAction(l,a.args,o,r)}parseTemplateActionCall(e){const t=String(e??"").trim().replace(/;$/,"");if(!t)return null;const r=t.match(/^([a-zA-Z_$][\w$]*)(?:\(([\s\S]*)\))?$/);if(!r)return null;const n=String(r[1]??"").trim();if(!n)return null;const i=String(r[2]??"").trim();if(!i)return{name:n,args:[]};return{name:n,args:this.splitTopLevelSegments(i,",").map(s=>s.trim()).filter(s=>s.length>0)}}buildTemplateActionContext(e,t,r){const n={...e,action:r,args:t};t.forEach((i,s)=>{n[`arg${s}`]=i});this.dataService.setValue("__action.name",r);this.dataService.setValue("__action.args",t);t.forEach((i,s)=>{this.dataService.setValue(`__action.arg${s}`,i)});if(Object.prototype.hasOwnProperty.call(n,"item"))this.dataService.setValue("__action.item",n["item"]);if(Object.prototype.hasOwnProperty.call(n,"row"))this.dataService.setValue("__action.row",n["row"]);return n}async executeTemplateElementAction(e,t,r,n){const i=String(e??"").trim();const s=this.isTemplateElementActionHelperName(i);const a=s?t[0]:i;if(!s&&!String(a??"").trim())return false;if(!n)return false;const o=this.findTemplateElementAction(n.events,a);if(!o)return false;const l=s?t.slice(1):t;const c=String(o?.actionCode??o?.label??o?.id??i).trim()||i;const d=this.buildTemplateActionContext(r,l,c);this.dataService.setValue("__action.name",c);this.dataService.setValue("__action.ref",a??"");await this.elementActionService.runAction(n,o,{...d,action:c,templateActionHelper:i,templateActionRef:a??"",templateActionConfig:o});return true}isTemplateElementActionHelperName(e){const t=String(e??"").trim().toLowerCase();return t==="action"||t==="runaction"||t==="eventaction"}isTemplateDataSourceHelperName(e){const t=String(e??"").trim().toLowerCase();return t==="datasource"||t==="runsource"||t==="rundatasource"||t==="loaddatasource"}resolveTemplateDataSourceCall(e,t){const r=String(e??"").trim();if(!r)return null;const n=this.isTemplateElementActionHelperName(r);const i=this.isTemplateDataSourceHelperName(r);if(n||i){const s=String(t[0]??"").trim();if(!s)return null;return{name:s,args:t.slice(1),actionName:s}}return{name:r,args:t,actionName:r}}findTemplateElementAction(e,t){const r=Array.isArray(e)?e:[];if(r.length===0)return null;if(typeof t==="number"&&Number.isFinite(t))return r[Math.max(0,Math.floor(t))]??null;const n=String(t??"").trim();if(!n)return r[0]??null;const i=r.find(l=>String(l?.actionCode??"").trim()===n)??null;if(i)return i;const s=r.find(l=>String(l?.id??"").trim()===n)??null;if(s)return s;const a=r.find(l=>String(l?.label??"").trim()===n)??null;if(a)return a;const o=this.normalizeTemplateActionReference(n);if(!o)return null;return r.find(l=>this.normalizeTemplateActionReference(String(l?.actionCode??""))===o)??r.find(l=>this.normalizeTemplateActionReference(String(l?.id??""))===o)??r.find(l=>this.normalizeTemplateActionReference(String(l?.label??""))===o)??null}normalizeTemplateActionReference(e){return String(e??"").trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().replace(/[\s_]+/g,"-")}async executeTemplateDataSourceAction(e,t,r,n){if(this.isInteractionLocked(n))return;const i=String(e??"").trim();if(!i)return;const s={name:i,useFor:"value",params:t.map((a,o)=>({name:`arg${o}`,value:`arg${o}`}))};try{await P(this.dataSourceService.getData$(s,true,n,r))}catch(a){console.error("[TemplateEngine] Failed to execute template click dataSource.",{dataSourceName:i,error:a instanceof Error?a.message:a})}}isInteractionLocked(e){if(!e)return false;if(Boolean(e["__pfInteractionLocked"]))return true;return Boolean(e.readOnly)||Boolean(e.disabled)}findMatchingToken(e,t,r,n){if(e[t]!==r)return-1;let i=0;let s=null;let a=false;for(let o=t;o<e.length;o++){const l=e[o];if(s){if(a){a=false;continue}if(l==="\\"){a=true;continue}if(l===s)s=null;continue}if(l==="'"||l==='"'||l==="`"){s=l;continue}if(l===r){i+=1;continue}if(l===n){i-=1;if(i===0)return o}}return-1}skipWhitespace(e,t){let r=t;while(r<e.length&&/\s/.test(e[r]))r+=1;return r}resolveCurrentStructure(){return this.structureService.getStructure()??this.structureService.getPreviewStructure()??null}static ɵfac=h.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:vt,deps:[],target:h.ɵɵFactoryTarget.Injectable});static ɵprov=h.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:vt,providedIn:"root"})};h.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:K,decorators:[{type:A,args:[{providedIn:"root"}]}]});const er=new Set(["parentElement","dataService","errors","value","defaultValue","dependsOn"]);var ce=class bt{templateEngineService=g(K);ensureLocalization(e){const t=String(e?.settings?.language??"en").trim()||"en";if(!e)return{defaultLanguage:t,languages:[t],texts:{}};if(!e.localization)e.localization={defaultLanguage:t,languages:[t],texts:{}};const r=e.localization;if(!r.defaultLanguage||!String(r.defaultLanguage).trim())r.defaultLanguage=t;else r.defaultLanguage=String(r.defaultLanguage).trim();const n=Array.isArray(r.languages)?r.languages.map(i=>String(i??"").trim()).filter(i=>i.length>0):[];if(n.length===0)n.push(r.defaultLanguage);if(!n.includes(r.defaultLanguage))n.unshift(r.defaultLanguage);r.languages=Array.from(new Set(n));if(!r.texts||typeof r.texts!=="object")r.texts={};r.languages.forEach(i=>{if(!r.texts[i]||typeof r.texts[i]!=="object")r.texts[i]={}});if(e.settings&&!e.settings.language)e.settings.language=r.defaultLanguage;return r}getTranslationEntries(e){if(!e)return[];const t=[];const r=new Set;this.collectStoredTemplateEntries(e,t,r);this.pushStringEntry(e,"settings.dialogTitle","Dialog title",t,r);this.pushStringEntry(e,"settings.dialogDescription","Dialog description",t,r);this.collectNestedLocalizableEntries(e,"settings","Settings",e.settings,t,r);this.pushStringEntry(e,"header.label","Header label",t,r);this.pushStringEntry(e,"header.description","Header description",t,r);this.collectNestedLocalizableEntries(e,"header","Header",e.header,t,r);Object.keys(e.elements??{}).forEach(n=>{this.collectElementEntries(e,`elements.${n}`,`Element ${n}`,t,r)});this.collectTemplateDictionaryEntries(e,t,r);return t}applyTranslations(e){const t=b(e);const r=this.ensureLocalization(t);const n=String(t?.settings?.language??r.defaultLanguage).trim()||r.defaultLanguage;const i=r.texts?.[n]??{};if(!i||typeof i!=="object")return t;this.getTranslationEntries(t).forEach(s=>{const a=i[s.key];if(typeof a!=="string")return;if(!a.trim().length)return;const o=String(s.structurePath??"").trim();if(!o)return;ie(t,o,a)});return t}collectElementEntries(e,t,r,n,i){const s=x(e,t);if(!s||typeof s!=="object")return;this.pushStringEntry(e,`${t}.label`,`${r} - label`,n,i);this.pushStringEntry(e,`${t}.description`,`${r} - description`,n,i);this.pushStringEntry(e,`${t}.placeholder`,`${r} - placeholder`,n,i);this.pushStringEntry(e,`${t}.labelTooltip`,`${r} - field help tooltip`,n,i);this.pushStringEntry(e,`${t}.text`,`${r} - text`,n,i);if(Boolean(s["useTotals"]))this.pushStringEntryWithFallback(e,`${t}.totalTemplate`,`${r} - total template`,this.resolveTotalTemplateFallback(),n,i);if(String(s["type"]??"").trim()==="pageTitle"){this.pushStringEntry(e,`${t}.title`,`${r} - title`,n,i);this.pushStringEntry(e,`${t}.subtitle`,`${r} - subtitle`,n,i)}if(String(s["type"]??"").trim()==="customHtml")this.pushStringEntry(e,`${t}.htmlTemplate`,`${r} - HTML template`,n,i);if(String(s["type"]??"").trim()==="table"){this.pushStringEntry(e,`${t}.emptyMessage`,`${r} - empty message`,n,i);this.pushStringEntry(e,`${t}.headerMenuPlaceholder`,`${r} - header dropdown placeholder`,n,i);this.pushStringEntryWithFallback(e,`${t}.actionsLabel`,`${r} - actions label`,"Actions",n,i);this.pushStringEntryWithFallback(e,`${t}.prevLabel`,`${r} - prev label`,"Prev",n,i);this.pushStringEntryWithFallback(e,`${t}.nextLabel`,`${r} - next label`,"Next",n,i);this.pushStringEntryWithFallback(e,`${t}.loadingLabel`,`${r} - loading label`,"Loading...",n,i);this.pushStringEntryWithFallback(e,`${t}.selectAllLabel`,`${r} - select all label`,"Select all",n,i);this.pushStringEntryWithFallback(e,`${t}.selectLabel`,`${r} - select label`,"Select",n,i);this.pushStringEntryWithFallback(e,`${t}.selectRowLabel`,`${r} - select row label`,"Select row",n,i);this.pushStringEntryWithFallback(e,`${t}.expandLabel`,`${r} - expand label`,"Expand",n,i);this.pushStringEntryWithFallback(e,`${t}.collapseLabel`,`${r} - collapse label`,"Collapse",n,i);this.pushStringEntry(e,`${t}.expandedTemplate`,`${r} - expanded template`,n,i);this.pushStringEntry(e,`${t}.expandedEmptyMessage`,`${r} - expanded empty message`,n,i)}const a=s["options"];if(Array.isArray(a))a.forEach((y,T)=>{this.pushStringEntry(e,`${t}.options[${T}].label`,`${r} - option ${T+1}`,n,i)});this.collectManualListEntries(e,t,r,s,n,i);const o=s["validators"];if(Array.isArray(o))o.forEach((y,T)=>{this.pushStringEntry(e,`${t}.validators[${T}].message`,`${r} - validator ${T+1}`,n,i)});const l=s["rowActions"];if(Array.isArray(l))this.collectActionEntries(e,`${t}.rowActions`,`${r} - action`,n,i);const c=s["headerActions"];if(Array.isArray(c))this.collectActionEntries(e,`${t}.headerActions`,`${r} - header action`,n,i);const d=s["headerMenuActions"];if(Array.isArray(d))this.collectActionEntries(e,`${t}.headerMenuActions`,`${r} - header dropdown action`,n,i);const m=s["selectionActions"];if(Array.isArray(m))this.collectActionEntries(e,`${t}.selectionActions`,`${r} - selection action`,n,i);const p=s["expandedRowActions"];if(Array.isArray(p))this.collectActionEntries(e,`${t}.expandedRowActions`,`${r} - expanded action`,n,i);const f=s["events"];if(Array.isArray(f))this.collectActionEntries(e,`${t}.events`,`${r} - event action`,n,i);const S=s["columnsConfig"];if(Array.isArray(S))this.collectTableColumnEntries(e,`${t}.columnsConfig`,`${r} - column`,n,i);const w=s["expandedColumnsConfig"];if(Array.isArray(w))this.collectTableColumnEntries(e,`${t}.expandedColumnsConfig`,`${r} - expanded column`,n,i);if(s.template&&typeof s.template==="object")Object.keys(s.template).forEach(y=>{this.collectElementEntries(e,`${t}.template.${y}`,`${r} > ${y}`,n,i)});if(Array.isArray(s.columns))s.columns.forEach((y,T)=>{this.collectElementEntries(e,`${t}.columns[${T}]`,`${r} > column ${T+1}`,n,i)});this.collectNestedLocalizableEntries(e,t,r,s,n,i)}collectManualListEntries(e,t,r,n,i,s){const a=String(n["type"]??"").trim();const o=["label","title","description","content","text"];[{key:"selectButtonOptions",itemLabel:"select button option",fields:["label","badge"]},{key:"tabs",itemLabel:"tab",fields:["label","title","description","content"]},{key:"items",itemLabel:"item",fields:new Set(["accordion","progressFlow","tabsPro"]).has(a)?[...o,"value"]:o},{key:"steps",itemLabel:"step",fields:[...o,"value"]},{key:"panels",itemLabel:"panel",fields:o},{key:"buttons",itemLabel:"button",fields:["label","title","text"]},{key:"choices",itemLabel:"choice",fields:["label","title","text"]}].forEach(l=>{const c=`${t}.${l.key}`;const d=x(e,c);if(!Array.isArray(d))return;d.forEach((m,p)=>{l.fields.forEach(f=>{this.pushStringEntry(e,`${c}[${p}].${f}`,`${r} - ${l.itemLabel} ${p+1} ${f}`,i,s)})})})}collectActionEntries(e,t,r,n,i){const s=x(e,t);if(!Array.isArray(s))return;s.forEach((a,o)=>{this.pushStringEntry(e,`${t}[${o}].label`,`${r} ${o+1} - label`,n,i);this.pushStringEntry(e,`${t}[${o}].confirmTitle`,`${r} ${o+1} - confirm title`,n,i);this.pushStringEntry(e,`${t}[${o}].confirmMessage`,`${r} ${o+1} - confirm message`,n,i);this.pushStringEntry(e,`${t}[${o}].confirmConfirmLabel`,`${r} ${o+1} - confirm button label`,n,i);this.pushStringEntry(e,`${t}[${o}].confirmCancelLabel`,`${r} ${o+1} - cancel button label`,n,i);this.pushStringEntry(e,`${t}[${o}].toastTitle`,`${r} ${o+1} - toast title`,n,i);this.pushStringEntry(e,`${t}[${o}].toastMessage`,`${r} ${o+1} - toast message`,n,i)})}collectTableColumnEntries(e,t,r,n,i){const s=x(e,t);if(!Array.isArray(s))return;s.forEach((a,o)=>{this.pushStringEntry(e,`${t}[${o}].label`,`${r} ${o+1} - label`,n,i);this.pushStringEntry(e,`${t}[${o}].mobileLabel`,`${r} ${o+1} - mobile label`,n,i);this.pushStringEntry(e,`${t}[${o}].template`,`${r} ${o+1} - template`,n,i);const l=`${t}[${o}].statusRules`;const c=x(e,l);if(!Array.isArray(c))return;c.forEach((d,m)=>{this.pushStringEntry(e,`${l}[${m}].label`,`${r} ${o+1} - status rule ${m+1} label`,n,i)})})}collectTemplateDictionaryEntries(e,t,r){this.collectTemplateTokensFromUnknown(e.header,"Header template",t,r);Object.keys(e.elements??{}).forEach(n=>{this.collectTemplateTokensFromUnknown(e.elements?.[n],`Element ${n} template`,t,r)});this.templateEngineService.getTemplates(e).forEach((n,i)=>{const s=String(n?.title??n?.name??"").trim()||`Template ${i+1}`;this.collectTemplateTokensFromUnknown(n,`${s} template`,t,r)})}collectStoredTemplateEntries(e,t,r){(Array.isArray(e.settings?.templates)?e.settings.templates:[]).forEach((n,i)=>{const s=String(n?.title??n?.name??"").trim()||`Template ${i+1}`;this.pushStringEntry(e,`settings.templates[${i}].title`,`${s} - title`,t,r);this.pushStringEntry(e,`settings.templates[${i}].description`,`${s} - description`,t,r);this.pushStringEntry(e,`settings.templates[${i}].content`,`${s} - content`,t,r)})}collectNestedLocalizableEntries(e,t,r,n,i,s,a=new WeakSet){if(n===null||n===void 0)return;if(typeof n==="string")return;if(Array.isArray(n)){n.forEach((o,l)=>{this.collectNestedLocalizableEntries(e,`${t}[${l}]`,`${r} ${l+1}`,o,i,s,a)});return}if(typeof n!=="object")return;if(a.has(n))return;a.add(n);Object.entries(n).forEach(([o,l])=>{if(!o||o==="localization"||o.startsWith("__")||er.has(o))return;const c=`${t}.${o}`;if(typeof l==="string"&&this.isLocalizableFieldName(o))this.pushStringEntry(e,c,`${r} - ${this.humanizeFieldName(o)}`,i,s);if(l&&typeof l==="object")this.collectNestedLocalizableEntries(e,c,`${r} > ${o}`,l,i,s,a)})}collectTemplateTokensFromUnknown(e,t,r,n,i=new WeakSet){if(typeof e==="string"){this.pushTemplateTranslationEntries(e,t,r,n);return}if(Array.isArray(e)){e.forEach((s,a)=>{this.collectTemplateTokensFromUnknown(s,`${t} ${a+1}`,r,n,i)});return}if(!e||typeof e!=="object")return;if(i.has(e))return;i.add(e);Object.entries(e).forEach(([s,a])=>{if(s==="localization"||er.has(s))return;this.collectTemplateTokensFromUnknown(a,`${t} > ${s}`,r,n,i)})}pushTemplateTranslationEntries(e,t,r,n){const i=String(e??"");if(!i.includes("tr(")&&!i.includes("t(")&&!i.includes("[["))return;const s=/\{\{\s*t(?:r)?\(\s*(['"`])([\s\S]*?)\1(?:\s*,\s*(['"`])([\s\S]*?)\3)?\s*\)\s*\}\}/g;let a=null;while((a=s.exec(i))!==null){const c=String(a[2]??"").trim();const d=String(a[4]??"").trim()||c;this.pushDictionaryEntry(c,`${t} - template key`,d,r,n)}const o=/\[\[\s*([^[\]|]+?)\s*(?:\|\s*([^[\]]+?)\s*)?\]\]/g;let l=null;while((l=o.exec(i))!==null){const c=String(l[1]??"").trim();if(!/^[a-zA-Z0-9_.-]+$/.test(c))continue;const d=String(l[2]??"").trim()||c;this.pushDictionaryEntry(c,`${t} - template key`,d,r,n)}}pushDictionaryEntry(e,t,r,n,i){const s=String(e??"").trim();const a=String(r??"").trim();if(!s||i.has(s))return;i.add(s);n.push({key:s,label:`${t} (${s})`,sourceValue:a||s})}isLocalizableFieldName(e){const t=String(e??"").trim();if(!t)return false;if(new Set(["actionText","actionsLabel","alt","caption","collapseLabel","confirmCancelLabel","confirmConfirmLabel","confirmMessage","confirmTitle","content","description","descriptionText","detailLabel","dialogDescription","dialogTitle","emptyMessage","expandLabel","expandedEmptyMessage","expandedTemplate","falseLabel","headerMenuPlaceholder","homeLabel","htmlTemplate","loadingLabel","mobileLabel","nextLabel","placeholder","prevLabel","primaryButtonText","quickSearchPlaceholder","requiredMessage","secondaryButtonText","selectAllLabel","selectLabel","selectRowLabel","subtitle","totalTemplate","template","text","title","toastMessage","toastTitle","triggerText","trueLabel"]).has(t))return true;return/(?:label|title|description|placeholder|message|tooltip|caption|subtitle|content|text)$/i.test(t)}humanizeFieldName(e){const t=String(e??"").trim();if(!t)return"text";return t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").toLowerCase()}resolveTotalTemplateFallback(){return"Total: {total}"}pushStringEntry(e,t,r,n,i){if(!e||i.has(t))return;const s=x(e,t);if(typeof s!=="string"||!s.trim().length)return;i.add(t);n.push({key:t,label:r,sourceValue:s,structurePath:t})}pushStringEntryWithFallback(e,t,r,n,i,s){if(!e||s.has(t))return;const a=x(e,t);if(typeof a==="string"&&a.trim().length){this.pushStringEntry(e,t,r,i,s);return}const o=String(n??"").trim();if(!o)return;s.add(t);i.push({key:t,label:r,sourceValue:o,structurePath:t})}static ɵfac=h.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:bt,deps:[],target:h.ɵɵFactoryTarget.Injectable});static ɵprov=h.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:bt,providedIn:"root"})};h.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:ce,decorators:[{type:A,args:[{providedIn:"root"}]}]});var Me=class{uuid;parentIndex;columns;constructor(u){if(u)Object.assign(this,u);this.uuid=Lt()}};zr([yr()],Me.prototype,"uuid",void 0);var Gr=class{name;status;disabled;readOnly;rows;constructor(u){if(u)Object.assign(this,u)}};var tr=class{elementRef;parentIndex;rows;tabRows;constructor(u){if(u)Object.assign(this,u)}};var De=class{label;description;showTitle;showDescription;showLogo;logo;logoAlign;type;constructor(u){if(u)Object.assign(this,u)}};var Re=class{schemaVersion;settings;header;pages;elements;dataSources;localization;constructor(u){if(u)Object.assign(this,u)}};var Pe=class{width;widthUnit;lazyElementRendering;language;locale;elementSpacing;contentPadding;removeContentPadding;tabletBreakpoint;mobileBreakpoint;theme;status;showToc;pageNavigationMode;allowStepWithoutValidation;pageNavigationPosition;stepperPosition;actionButtonsPosition;showValidateButton;showSubmitButton;showValidationIssuesModal;templates;templateStorageMode;templateStorageLocalKey;templateStorageDataSourceName;templateStorageDataPath;templateActionMap;customCss;customCssUrls;renderMode;dialogWidth;dialogWidthUnit;dialogTitle;dialogDescription;dialogFontSize;dialogMaxWidth;dialogMaxHeight;dialogPadding;dialogShowCloseButton;dialogDraggable;dialogCloseEvents;dialogFooterActions;dialogFooterActionsAlign;variables;constructor(u){if(u)Object.assign(this,u)}};var rr=class{name;title;type=B.Rest;params;constructor(u){if(u)Object.assign(this,u);this.type=Yr(this.type);this.name=String(this.name??"");this.title=String(this.title??"");this.params=this.params&&typeof this.params==="object"?{...this.params}:{}}};function Yr(u){const e=String(u??B.Rest).trim().toLowerCase();if(e===B.Route||e===B.Local||e===B.Websocket)return e;return B.Rest}var qe=class St{registeredFragments=new Map;registerFragments(e){if(!Array.isArray(e)||e.length===0)return;e.forEach(t=>{const r=String(t?.name??"").trim();if(!r||!Array.isArray(t.rows))return;this.registeredFragments.set(r,b(t))})}resolveStructure(e){const t=b(e);const r=this.buildFragmentRegistry(t);const n=t.elements??{};t.pages=this.resolveRows(t.pages??[],r,n,t);if(r.size>0)t.settings={...t.settings??{},fragments:Array.from(r.values()).map(i=>b(i))};t.elements=n;return t}buildFragmentRegistry(e){const t=new Map;this.registeredFragments.forEach((r,n)=>{t.set(n,b(r))});(e.settings?.fragments??[]).forEach(r=>{const n=String(r?.name??"").trim();if(!n||!Array.isArray(r.rows))return;t.set(n,b(r))});return t}resolveRows(e,t,r,n){return e.map((i,s)=>({...i,rows:this.resolveRowCollection(i.rows??[],t,r,`page${s}`,n)}))}resolveRowCollection(e,t,r,n,i){return e.map((s,a)=>({...s,columns:(s.columns??[]).map((o,l)=>this.resolveColumn(o,t,r,`${n}.row${a}.col${l}`,i))}))}resolveColumn(e,t,r,n,i){const s=b(e);if(Array.isArray(s.rows)&&s.rows.length>0)s.rows=this.resolveRowCollection(s.rows,t,r,`${n}.rows`,i);if(s.tabRows&&typeof s.tabRows==="object"){const p={};Object.keys(s.tabRows).forEach(f=>{p[f]=this.resolveRowCollection(s.tabRows?.[f]??[],t,r,`${n}.tab.${f}`,i)});s.tabRows=p}const a=String(s.fragmentRef??"").trim();if(!a)return s;const o=t.get(a);if(!o)return s;const l=s.fragmentBindings??{};const c=this.materializeFragmentElements(o,r,n,l);const d=this.rewriteFragmentRows(o.rows??[],c,l);const m=this.resolveRowCollection(d,t,r,`${n}.fragment.${a}`,i);s.rows=s.fragmentMode==="append"?[...s.rows??[],...m]:m;delete s.fragmentRef;delete s.fragmentBindings;delete s.fragmentMode;return s}materializeFragmentElements(e,t,r,n){const i=e.elements??{};const s={};Object.keys(i).forEach(a=>{const o=i[a];const l=String(a??"").trim();if(!l||!o||typeof o!=="object")return;const c=`${l}__${this.slugify(r)}`;s[l]=c;t[c]=this.applyFragmentBindings(b({...o,name:c}),n)});return s}rewriteFragmentRows(e,t,r){return this.applyFragmentBindings(b(e),r).map(n=>({...n,columns:(n.columns??[]).map(i=>this.rewriteFragmentColumn(i,t))}))}rewriteFragmentColumn(e,t){const r=b(e);const n=String(r.elementRef??"").trim();if(n&&t[n])r.elementRef=t[n];if(Array.isArray(r.rows)&&r.rows.length>0)r.rows=r.rows.map(i=>({...i,columns:(i.columns??[]).map(s=>this.rewriteFragmentColumn(s,t))}));if(r.tabRows&&typeof r.tabRows==="object"){const i={};Object.keys(r.tabRows).forEach(s=>{i[s]=(r.tabRows?.[s]??[]).map(a=>({...a,columns:(a.columns??[]).map(o=>this.rewriteFragmentColumn(o,t))}))});r.tabRows=i}return r}applyFragmentBindings(e,t){if(!t||Object.keys(t).length===0)return e;return this.deepMap(e,r=>{if(typeof r!=="string")return r;return r.replace(/\{\{\s*fragment\.([a-zA-Z0-9_.-]+)\s*\}\}/g,(n,i)=>{return String(t[i]??"")})})}deepMap(e,t){if(Array.isArray(e))return e.map(n=>this.deepMap(n,t));if(!e||typeof e!=="object")return t(e);const r={};Object.keys(e).forEach(n=>{r[n]=this.deepMap(e[n],t)});return r}slugify(e){return String(e??"").trim().replace(/[^a-zA-Z0-9]+/g,"_").replace(/^_+|_+$/g,"").toLowerCase()}static ɵfac=h.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:St,deps:[],target:h.ɵɵFactoryTarget.Injectable});static ɵprov=h.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:St,providedIn:"root"})};h.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:qe,decorators:[{type:A,args:[{providedIn:"root"}]}]});const Xr=1;const en=1;const nr=[];const ke=E(null,...ngDevMode?[{debugName:"lastMigration"}]:[]);const tn=ke.asReadonly();function Ie(u){ke.set(u)}function rn(){ke.set(null)}let ue={};function nn(u){ue={...ue,...u}}function ir(){return ue}function sn(){ue={}}function ze(u){if(!u||typeof u!=="object")return 1;const e=u.schemaVersion;const t=typeof e==="number"?e:Number.parseInt(String(e??""),10);return Number.isFinite(t)&&t>0?t:1}function an(u){return u&&typeof u==="object"&&"structure"in u?u:{structure:u}}function Ne(u,e,t={},r=1){const n=ze(u);const i=t.enabled!==false;const s=m=>({structure:u,fromVersion:n,toVersion:n,migrated:false,unsupported:m,warnings:[],appliedDescriptions:[]});if(!i){if(n!==r)console.warn(`[ngx-view-builder] Structure migrations are disabled and this view declares schema v${n} against a v${r} runtime. Rendering it unchanged.`);return s(false)}if(n>r)return s(true);if(n===r)return s(false);const a=new Map;e.forEach(m=>{const p=a.get(m.from)??[];p.push(m);a.set(m.from,p)});let o=b(u);let l=n;const c=[];const d=[];while(l<r){const m=a.get(l);if(!m?.length){c.push(`No structure migration registered for schema version ${l} -> ${l+1}.`);break}m.forEach(p=>{const f=an(p.migrate(o));o=f.structure??o;if(f.warnings?.length)c.push(...f.warnings);d.push(p.description??`${p.from} -> ${p.from+1}`)});l+=1}o.schemaVersion=l;return{structure:o,fromVersion:n,toVersion:l,migrated:l!==n,unsupported:false,warnings:c,appliedDescriptions:d}}function sr(u,e,t,r=1){const n=Ne(u,e,t,r);if(n.unsupported){const i=`[ngx-view-builder] This view declares schema version ${n.fromVersion}, but the installed runtime supports up to ${r}. Update ngx-view-builder to open it.`;Ie(n);if((t.onUnsupported??"error")==="error"){console.error(i);return{structure:null,result:n}}console.warn(`${i} Rendering as-is.`);return{structure:n.structure,result:n}}n.warnings.forEach(i=>console.warn(`[ngx-view-builder] ${i}`));if(n.migrated){Ie(n);t.onMigrated?.(n)}return{structure:n.structure,result:n}}function J(u){return Boolean(u)&&typeof u==="object"&&!Array.isArray(u)}function on(u){or(u);return u}function ar(u){if(!u||typeof u!=="object")return u;const e=JSON.parse(JSON.stringify(u));return or(e)>0?e:u}function or(u){const e=u.elements??{};const t=[];const r=(i,s,a,o)=>{(i??[]).forEach(l=>{(l?.columns??[]).forEach(c=>{const d=String(c?.elementRef??"").trim();if(!d)return;let m=a[d];if(!m){const w=s.find(y=>y.map!==a&&J(y.map[d]));if(w){m=w.map[d];a[d]=m;delete w.map[d];t.push({from:`${w.path}.${d}`,to:`${o}.${d}`})}}let p=s;let f=a;let S=o;if(m?.["type"]==="objectPanel"){if(!J(m["template"]))m["template"]={};f=m["template"];S=`${o}.${d}.template`;p=[{map:a,path:o},...s]}else if(m?.["type"]==="dynamicPanel"&&J(m["template"])){f=m["template"];S=`${o}.${d}.template`;p=[{map:f,path:S}]}r(c?.rows,p,f,S);Object.values(c?.tabRows??{}).forEach(w=>r(w,p,f,S))})})};(u.pages??[]).forEach(i=>r(i?.rows,[{map:e,path:"elements"}],e,"elements"));const n=u.localization?.texts;if(t.length>0&&J(n))Object.values(n).forEach(i=>{if(!J(i))return;Object.keys(i).forEach(s=>{const a=t.find(o=>s===o.from||s.startsWith(`${o.from}.`));if(a){i[a.to+s.slice(a.from.length)]=i[s];delete i[s]}})});return t.length}var de=class yt{currentVersion=1;get config(){return ir()}get migrations(){return[...nr,...this.config.migrations??[]]}versionOf(e){return ze(e)}needsMigration(e){return this.versionOf(e)!==1}inspect(e){return Ne(e,this.migrations,this.config)}migrate(e){const t=sr(e,this.migrations,this.config).structure;return t?ar(t):t}static ɵfac=h.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:yt,deps:[],target:h.ɵɵFactoryTarget.Injectable});static ɵprov=h.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:yt,providedIn:"root"})};h.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:de,decorators:[{type:A,args:[{providedIn:"root"}]}]});const lr=new Set(["width","widthUnit","language","locale","elementSpacing","contentPadding","removeContentPadding","tabletBreakpoint","mobileBreakpoint","builderPageDisplayMode","renderMode","status","showToc","pageNavigationMode","allowStepWithoutValidation","pageNavigationPosition","stepperPosition","actionButtonsPosition","showValidateButton","showSubmitButton","showValidationIssuesModal","dialogWidth","dialogWidthUnit","dialogTitle","dialogDescription","dialogFontSize","dialogMaxWidth","dialogMaxHeight","dialogPadding","dialogShowCloseButton","dialogDraggable","dialogCloseEvents","dialogFooterActions","dialogFooterActionsAlign"]);function cr(u){const e=u??{};const t=Z(e.language,"en");const r=Be(e.width,e.widthUnit,"1182px");const n=Be(e.dialogWidth,e.dialogWidthUnit,"720px");return{width:r.css,widthUnit:r.unit,language:t,locale:C(e.locale),elementSpacing:C(e.elementSpacing),contentPadding:C(e.contentPadding),removeContentPadding:Boolean(e.removeContentPadding),tabletBreakpoint:C(e.tabletBreakpoint),mobileBreakpoint:C(e.mobileBreakpoint),renderMode:ln(e.renderMode),status:cn(e.status),showToc:Boolean(e.showToc),pageNavigationMode:un(e.pageNavigationMode),allowStepWithoutValidation:Boolean(e.allowStepWithoutValidation),pageNavigationPosition:$e(e.pageNavigationPosition),stepperPosition:$e(e.stepperPosition),actionButtonsPosition:$e(e.actionButtonsPosition),showValidateButton:e.showValidateButton===void 0?true:Boolean(e.showValidateButton),showSubmitButton:e.showSubmitButton===void 0?true:Boolean(e.showSubmitButton),showValidationIssuesModal:e.showValidationIssuesModal===void 0?false:Boolean(e.showValidationIssuesModal),dialogWidth:n.css,dialogWidthUnit:n.unit,dialogTitle:C(e.dialogTitle),dialogDescription:C(e.dialogDescription),dialogFontSize:Z(e.dialogFontSize,"14px"),dialogMaxWidth:Z(e.dialogMaxWidth,"96%"),dialogMaxHeight:Z(e.dialogMaxHeight,"90vh"),dialogPadding:Z(e.dialogPadding,"16px"),dialogShowCloseButton:e.dialogShowCloseButton===void 0?true:Boolean(e.dialogShowCloseButton),dialogDraggable:Boolean(e.dialogDraggable),dialogCloseEvents:Array.isArray(e.dialogCloseEvents)?[...e.dialogCloseEvents]:[],dialogFooterActions:Array.isArray(e.dialogFooterActions)?[...e.dialogFooterActions]:[],dialogFooterActionsAlign:dn(e.dialogFooterActionsAlign)}}function ur(u){const e=u??{};const t=cr(e);const r={};Object.keys(e).forEach(n=>{if(!lr.has(n))r[n]=e[n]});r["width"]=t.width;r["widthUnit"]=t.widthUnit;r["language"]=t.language;if(t.locale)r["locale"]=t.locale;if(t.elementSpacing)r["elementSpacing"]=t.elementSpacing;if(t.contentPadding!=="")r["contentPadding"]=t.contentPadding;if(t.removeContentPadding)r["removeContentPadding"]=true;if(t.tabletBreakpoint)r["tabletBreakpoint"]=t.tabletBreakpoint;if(t.mobileBreakpoint)r["mobileBreakpoint"]=t.mobileBreakpoint;if(t.renderMode!=="page")r["renderMode"]=t.renderMode;if(t.status!=="default")r["status"]=t.status;if(t.showToc)r["showToc"]=true;if(t.pageNavigationMode!=="default")r["pageNavigationMode"]=t.pageNavigationMode;if(t.allowStepWithoutValidation)r["allowStepWithoutValidation"]=true;if(t.pageNavigationPosition!=="top")r["pageNavigationPosition"]=t.pageNavigationPosition;if(t.stepperPosition!=="top")r["stepperPosition"]=t.stepperPosition;if(t.actionButtonsPosition!=="top")r["actionButtonsPosition"]=t.actionButtonsPosition;if(!t.showValidateButton)r["showValidateButton"]=false;if(!t.showSubmitButton)r["showSubmitButton"]=false;if(t.showValidationIssuesModal)r["showValidationIssuesModal"]=true;if(t.renderMode==="dialog"){if(t.dialogWidth!=="720px")r["dialogWidth"]=t.dialogWidth;if(t.dialogWidthUnit!=="px")r["dialogWidthUnit"]=t.dialogWidthUnit;if(t.dialogTitle)r["dialogTitle"]=t.dialogTitle;if(t.dialogDescription)r["dialogDescription"]=t.dialogDescription;if(t.dialogFontSize!=="14px")r["dialogFontSize"]=t.dialogFontSize;if(t.dialogMaxWidth!=="96%")r["dialogMaxWidth"]=t.dialogMaxWidth;if(t.dialogMaxHeight!=="90vh")r["dialogMaxHeight"]=t.dialogMaxHeight;if(t.dialogPadding!=="16px")r["dialogPadding"]=t.dialogPadding;if(!t.dialogShowCloseButton)r["dialogShowCloseButton"]=false;if(t.dialogDraggable)r["dialogDraggable"]=true;if(t.dialogCloseEvents.length>0)r["dialogCloseEvents"]=t.dialogCloseEvents;if(t.dialogFooterActions.length>0)r["dialogFooterActions"]=t.dialogFooterActions;if(t.dialogFooterActionsAlign!=="right")r["dialogFooterActionsAlign"]=t.dialogFooterActionsAlign}return r}function Le(u,e="px"){const t=C(u).toLowerCase();if(t==="%")return"%";if(t==="px")return"px";return e}function Be(u,e,t){const r=Ze(t)??{value:Z(t,"0"),unit:"px"};const n=Le(e,r.unit);const i=C(u);if(!i)return{value:r.value,unit:r.unit,css:Fe(r.value,r.unit)};const s=Ze(i);if(!s)return{value:i,unit:n,css:i};const a=s.unit??n;return{value:s.value,unit:a,css:Fe(s.value,a)}}function Fe(u,e){const t=C(u);if(!t)return"";const r=Ze(t);if(!r)return t;return`${r.value}${r.unit??Le(e)}`}function C(u){return String(u??"").trim()}function Z(u,e){return C(u)||e}function ln(u){const e=C(u).toLowerCase();return e==="dialog"||e==="canvas"?e:"page"}function cn(u){return C(u).toLowerCase()==="readonly"?"readonly":"default"}function un(u){return C(u).toLowerCase()==="stepper"?"stepper":"default"}function $e(u){const e=C(u).toLowerCase();if(e==="bottom"||e==="both"||e==="none")return e;return"top"}function dn(u){const e=C(u).toLowerCase();if(e==="left"||e==="center")return e;return"right"}function Ze(u){const e=C(u).match(/^(-?\d+(?:\.\d+)?)\s*(px|%)?$/i);if(!e)return null;return{value:e[1],unit:e[2]?.toLowerCase()}}var he=class wt{modelService=g(zt);expressionService=g(D);eventService=g(be);structureService=g(R);dataService=g(M);dataSourceService=g(O);validatorService=g($);localizationService=g(ce);fragmentService=g(qe);templateEngineService=g(K);structureMigrationService=g(de);warnedDependencyCycles=new Set;selfReferenceSafeExpressionKeys=new Set(["disableIf","visibleIf","requireIf","readonlyIf"]);resolveIncomingStructure(e){const t=this.structureMigrationService.migrate(e);if(!t)return null;return this.fragmentService.resolveStructure(t)}toModel(e){const t=this.resolveIncomingStructure(e);if(!t)return;const r=this.localizationService.applyTranslations(t);this.structureService.flatModelMap={};const n=this.mapDataSourceModel(r.dataSources);const i=this.mapLayoutModel(r);const s=this.mapToModel(r.elements,r.pages);queueMicrotask(()=>{this.applyInitialData();this.applyDependencies();this.applyExpressions()});const a=new Re({schemaVersion:r.schemaVersion??1,header:r.header?new De(r.header):void 0,pages:i,elements:s,settings:new Pe(r.settings),dataSources:n,localization:r.localization});this.structureService.setPreviewStructure(a)}mapDataSourceModel(e){const t=[];e?.forEach(r=>{t.push(new rr(r))});return t}mapLayoutModel(e){return e.pages.map((t,r)=>new Gr({...t,name:t.name,rows:t.rows.map((n,i)=>this.mapRow(n,i))}))}mapRow(e,t){return new Me({parentIndex:t,columns:(Array.isArray(e?.columns)?e.columns:[]).map((r,n)=>this.mapColumn(r,n))})}mapColumn(e,t){const r=e.tabRows&&typeof e.tabRows==="object"?Object.keys(e.tabRows).reduce((n,i)=>{n[i]=(Array.isArray(e.tabRows[i])?e.tabRows[i]:[]).map((s,a)=>this.mapRow(s,a));return n},{}):void 0;return new tr({elementRef:e.elementRef,parentIndex:t,rows:e.rows?e.rows.map((n,i)=>this.mapRow(n,i)):[],tabRows:r})}getDataSource(e){return this.structureService.structure?.dataSources?.find(t=>t.name===e)}mapToModel(e,t){const r={};Object.keys(e).forEach(n=>{const i=e[n];const s=n;const a=ee(i?.type)?i.value??Se(i?.type):i?.type==="dynamicTable"?i.value??[]:null;const o=this.modelService.createModel(i.type,{...i,dataPath:s,schemaPath:n,dependsOn:[],errors:[],value:a});this.structureService.flatModelMap[s]=o;if(ee(i.type)&&i.template&&typeof i.template==="object")this.convertTemplateToModels(i.template,o,s,s);if(i.type==="dynamicTable"&&i.columns&&Array.isArray(i.columns))this.convertColumnsToModels(i.columns,o,s);r[n]=o});return r}convertTemplateToModels(e,t,r,n){Object.keys(e).forEach(i=>{const s=e[i];const a=s?.name??i;const o=`${vr(r,0,t?.type)}.${a}`;const l=`${r}.template.${i}`;const c=ee(s?.type)?s.value??Se(s?.type):s?.type==="dynamicTable"?s.value??[]:null;const d=this.modelService.createModel(s.type,{...s,dataPath:o,schemaPath:l,dependsOn:[],errors:[],parentElement:t,value:c,isTemplateElement:true,templateElementParentDataPath:n});this.structureService.flatModelMap[o]=d;e[i]=d;if(s.template)this.convertTemplateToModels(s.template,d,o,n??r);if(s.columns)this.convertColumnsToModels(s.columns,d,o,true,n??r)})}convertColumnsToModels(e,t,r,n,i){e.forEach((s,a)=>{const o=s;const l=`${r}[0].${o?.name??`column${a+1}`}`;const c=`${r}.columns[${a}]`;const d=ee(o?.type)?o.value??Se(o?.type):o?.type==="dynamicTable"?o.value??[]:null;const m=this.modelService.createModel(s.type,{...s,dataPath:l,schemaPath:c,index:0,dependsOn:[],errors:[],parentElement:t,value:d,isTemplateElement:n,templateElementParentDataPath:i});this.structureService.flatModelMap[l]=m;e[a]=m;if(o?.template)this.convertTemplateToModels(o.template,m,l,i??r);if(o?.columns)this.convertColumnsToModels(o.columns,m,l,true,i??r)})}applyExpressions(){this.expressionService.evaluateAllExpressionsInDependencyOrder()}applyDependencies(){Object.values(this.structureService.flatModelMap).forEach(e=>{this.expressionService.expressionKeys.forEach(t=>{if(e[t])this.expressionService.extractDependenciesFromExpression(e[t],e).forEach(r=>{const n=this.structureService.flatModelMap[r];this.registerDependency(n,e.dataPath,t)})})})}applyElementDependencies(e){this.expressionService.expressionKeys.forEach(t=>{if(e[t])this.expressionService.extractDependenciesFromExpression(e[t],e).forEach(r=>{const n=this.structureService.flatModelMap[r];this.registerDependency(n,e.dataPath,t)})})}registerDependency(e,t,r){if(!e||!t)return;const n=String(e.dataPath??"").trim();const i=String(t??"").trim();if(!n||!i)return;const s=n===i;const a=s&&!!r&&this.selfReferenceSafeExpressionKeys.has(r);if(s&&!a){this.warnDependencyCycle(n,i,"Skipping self dependency.");return}if(!a&&this.createsDependencyCycle(n,i)){this.warnDependencyCycle(n,i,"Skipping cyclic dependency registration.");return}if(!Array.isArray(e.dependsOn))e.dependsOn=[];if(!e.dependsOn.includes(i))e.dependsOn.push(i)}createsDependencyCycle(e,t){return this.canReachDependent(t,e,new Set)}canReachDependent(e,t,r){const n=String(e??"").trim();const i=String(t??"").trim();if(!n||!i)return false;if(n===i)return true;if(r.has(n))return false;r.add(n);const s=this.structureService.flatModelMap[n];return(Array.isArray(s?.dependsOn)?s.dependsOn:[]).some(a=>this.canReachDependent(String(a??"").trim(),i,r))}warnDependencyCycle(e,t,r){const n=`${e}->${t}:${r}`;if(this.warnedDependencyCycles.has(n))return;this.warnedDependencyCycles.add(n);if(!this.shouldLogExpressionDependencyDiagnostics())return;console.debug(`[NgxViewBuilder][Expression] ${r}`,{sourcePath:e,dependentPath:t})}shouldLogExpressionDependencyDiagnostics(){if(typeof localStorage==="undefined")return false;try{return localStorage.getItem("ngxViewBuilder.debugExpressions")==="true"}catch{return false}}applyInitialData(){const e=this.dataService.getData();Object.values(this.structureService.flatModelMap).forEach(t=>{const r=String(t.dataPath??"").trim();const n=this.hasDataValue(e,r);const i=this.dataService.getValue(r);const s=n&&this.hasMeaningfulInitialDataValue(i);const a=s?i:this.resolveDefaultElementValue(t);t.value=b(a);if(!s&&a!==void 0&&r)this.dataService.setValue(r,b(a));if(t.type==="dynamicPanel"&&t.template&&Array.isArray(a))a.forEach((o,l)=>{const c=`${r}[${l}]`;const d=o&&typeof o==="object"?o:{};Object.keys(t.template).forEach(m=>{const p=t.template[m];const f=`${c}.${m}`;const S=`${t.schemaPath}.template.${m}`;const w=d[m];const y=Object.prototype.hasOwnProperty.call(d,m)&&this.hasMeaningfulInitialDataValue(w)?w:this.resolveDefaultElementValue(p);const T=this.modelService.createModel(p.type,{...p,dataPath:f,schemaPath:S,dependsOn:[],index:l,parentElement:t,value:b(y)});this.structureService.flatModelMap[f]=T})});else if(t.type==="dynamicTable"&&t?.columns&&Array.isArray(a))a.forEach((o,l)=>{const c=`${r}[${l}]`;const d=o&&typeof o==="object"?o:{};t.columns.forEach((m,p)=>{const f=m.name;const S=`${c}.${f}`;const w=`${t.schemaPath}.columns[${p}]`;const y=d[f];const T=Object.prototype.hasOwnProperty.call(d,f)&&this.hasMeaningfulInitialDataValue(y)?y:this.resolveDefaultElementValue(m);const _=this.modelService.createModel(m.type,{...m,dataPath:S,schemaPath:w,dependsOn:[],index:l,parentElement:t,value:b(T)});this.structureService.flatModelMap[S]=_})})});this.eventService.afterPropertyChanged.fire({payload:null})}hasDataValue(e,t){if(!t)return false;if(Ht(e,t))return true;return Object.prototype.hasOwnProperty.call(e,t)}hasMeaningfulInitialDataValue(e){if(e===null||e===void 0)return false;if(typeof e==="string")return e.trim().length>0;return true}resolveDefaultElementValue(e){if(!e||typeof e!=="object")return;if(!Object.prototype.hasOwnProperty.call(e,"defaultValue"))return;const t=b(e["defaultValue"]);if(!this.shouldEvaluateDefaultExpression(t))return t;const r=this.normalizeDefaultExpression(String(t??""));if(!r)return t;const n=this.expressionService.evaluateInlineExpression(r,e);if(n===void 0)return t;return b(n)}shouldEvaluateDefaultExpression(e){if(typeof e!=="string")return false;const t=e.trim();if(!t)return false;if(t.startsWith("="))return true;return t.includes("{")&&t.includes("}")}normalizeDefaultExpression(e){const t=String(e??"").trim();if(!t)return"";if(t.startsWith("="))return t.slice(1).trim();return t}toObject(e){const t=new Set(["source","dataService","onValueChanging","onValueChanged","onDataMutated","onClearValue","afterDataSourceLoad","onDataSourceChanged",Er]);const r=(m,p=new WeakSet)=>{if(m===null||m===void 0)return void 0;if(typeof m==="function")return void 0;if(typeof m==="string")return m.trim().length>0?m:void 0;if(typeof m==="object"){if(p.has(m))return void 0;p.add(m)}if(Array.isArray(m)){const f=m.map(S=>r(S,p)).filter(S=>S!==void 0);return f.length>0?f:void 0}if(typeof m==="object"){const f=X(m);const S={};Object.keys(m).forEach(w=>{const y=m[w];if(f.includes(w)||t.has(w)||w==="listeners"&&Array.isArray(y))return;const T=r(y,p);if(T!==void 0)S[w]=T});return Object.keys(S).length>0?S:void 0}return m};const n=new Map;const i=m=>{const p=String(m??"").trim();if(!p)return null;if(n.has(p))return n.get(p)??null;let f=null;try{const S=this.modelService.createModel(p,{},{skipTypeDefaults:true});const w=new Set(X(S));f={};Object.keys(S).forEach(y=>{if(w.has(y)||t.has(y))return;f[y]=S[y]})}catch{f=null}n.set(p,f);return f};const s=new Set(["name","type"]);const a=new Set(["template","columns"]);const o=m=>{if(!m||typeof m!=="object"||Array.isArray(m))return r(m);const p=String(m.type??"").trim();const f=p?i(p):null;if(!f)return r(m);const S=new WeakSet;const w=X(m);const y={};Object.keys(m).forEach(T=>{const _=m[T];if(w.includes(T)||t.has(T)||T==="listeners"&&Array.isArray(_))return;if(a.has(T)&&_&&typeof _==="object"){if(Array.isArray(_)){const N=_.map(L=>o(L)).filter(L=>L!==void 0);if(N.length>0)y[T]=N}else{const N={};Object.keys(_).forEach(L=>{const It=o(_[L]);if(It!==void 0)N[L]=It});if(Object.keys(N).length>0)y[T]=N}return}const j=r(_,S);if(j===void 0)return;if(!s.has(T)&&T in f&&k(_,f[T]))return;y[T]=j});return Object.keys(y).length>0?y:void 0};const l=m=>{if(!m)return void 0;const p={elementRef:m.elementRef};if(m.rows&&Array.isArray(m.rows)&&m.rows.length>0)p.rows=m.rows.map(c).filter(f=>f!==void 0);if(m.tabRows&&typeof m.tabRows==="object"){const f=Object.keys(m.tabRows).reduce((S,w)=>{const y=(Array.isArray(m.tabRows?.[w])?m.tabRows[w]:[]).map(c).filter(T=>T!==void 0);if(y.length>0)S[w]=y;return S},{});if(Object.keys(f).length>0)p.tabRows=f}return p};const c=m=>{if(!m||!m.columns||!Array.isArray(m.columns))return;const p=m.columns.map(l).filter(f=>f!==void 0);if(p.length===0)return;return{columns:p}};const d={};d.schemaVersion=1;if(e.settings)d.settings=r(ur(e.settings));if(e.header)d.header=r(e.header);if(e.pages&&Array.isArray(e.pages)&&e.pages.length>0)d.pages=e.pages.map(m=>{if(!m||!String(m.name??"").trim())return;const p=Array.isArray(m.rows)?m.rows.map(c).filter(y=>y!==void 0):[];const{rows:f,name:S,...w}=m;return{...r(w)??{},name:m.name,rows:p}}).filter(m=>m!==void 0);if(e.elements){const m={};Object.keys(e.elements).forEach(p=>{const f=o(e.elements[p]);if(f!==void 0)m[p]=f});d.elements=Object.keys(m).length>0?m:void 0}if(e.dataSources&&Array.isArray(e.dataSources)&&e.dataSources.length>0)d.dataSources=r(e.dataSources);if(e.localization)d.localization=r(e.localization);this.prepareTemplatesForExport(d);return d}toJson(e){return JSON.stringify(this.toObject(e),null,2)}prepareTemplatesForExport(e){const t=e["settings"];if(!t||typeof t!=="object")return;const r=this.structureService.getStructure()??this.structureService.getPreviewStructure();const n=this.templateEngineService.getTemplates(r);const i=new Map;n.forEach(c=>{const d=String(c?.name??"").trim();if(!d)return;i.set(d,{...c,name:d,content:String(c?.content??"")})});const s=new Map;const a=new Map;this.collectExportTemplatesFromNode(e["elements"],i,s,a,"elements");const o=Array.from(s.values()).sort((c,d)=>String(c?.name??"").localeCompare(String(d?.name??"")));const l=t;if(o.length===0){delete l["templates"];return}l["templates"]=o}collectExportTemplatesFromNode(e,t,r,n,i){if(!e||typeof e!=="object")return;if(Array.isArray(e)){e.forEach((a,o)=>{this.collectExportTemplatesFromNode(a,t,r,n,`${i}[${o}]`)});return}const s=e;Object.keys(s).forEach(a=>{if(this.isTemplateReferenceKey(a))this.collectExportTemplateReference(s,a,t,r,n,i)});Object.entries(s).forEach(([a,o])=>{if(a==="templates")return;this.collectExportTemplatesFromNode(o,t,r,n,`${i}.${a}`)})}collectExportTemplateReference(e,t,r,n,i,s){const a=String(e[t]??"").trim();if(!a)return;const o=this.resolveTemplateFallbackKey(t);const l=o&&typeof e[o]==="string"?String(e[o]??""):"";const c=l.trim();const d=r.get(a)??null;const m=(d?this.composeTemplateMarkup(d):"").trim();if(c&&c!==m){const p=`${a}::${c}`;const f=i.get(p)??this.buildModifiedTemplateName(a,c,s,n);i.set(p,f);n.set(f,{...d??{content:""},name:f,css:void 0,content:l});e[t]=f;if(o)delete e[o];return}if(d){n.set(a,{...d,name:a,content:String(d.content??"")});if(o)delete e[o];return}if(c){n.set(a,{name:a,css:void 0,content:l});if(o)delete e[o]}}isTemplateReferenceKey(e){const t=String(e??"").trim();return t==="templateName"||t.endsWith("TemplateName")}resolveTemplateFallbackKey(e){const t=String(e??"").trim();if(!t)return null;if(t==="templateName")return"template";if(t.endsWith("TemplateName"))return t.slice(0,-4);return null}composeTemplateMarkup(e){const t=String(e?.content??"");const r=String(e?.css??"").trim();if(!r)return t;return`<style>${r}</style>
|
|
4
|
+
${t}`}buildModifiedTemplateName(e,t,r,n){const i=String(e??"").trim()||"template";const s=String(r??"").replace(/[^a-zA-Z0-9]+/g,"_").replace(/^_+|_+$/g,"").toLowerCase();const a=this.hashText(t);let o=`${i}__${s||"custom"}__${a}`;let l=2;while(n.has(o)){o=`${i}__${s||"custom"}__${a}_${l}`;l+=1}return o}hashText(e){let t=0;const r=String(e??"");for(let n=0;n<r.length;n+=1)t=t*31+r.charCodeAt(n)>>>0;return t.toString(36)}static ɵfac=h.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:wt,deps:[],target:h.ɵɵFactoryTarget.Injectable});static ɵprov=h.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:wt,providedIn:"root"})};h.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:he,decorators:[{type:A,args:[{providedIn:"root"}]}]});var He=class Tt extends he{uiTranslationService=g(re);isDataSourceValueWatcherBound=false;elementDataSourceSubscriptions=new Map;stopPreviewDataSources(){this.clearElementDataSourceSubscriptions()}toModel(e){this.clearElementDataSourceSubscriptions();const t=this.resolveIncomingStructure(e);if(!t)return;const r=this.localizationService.applyTranslations(t);this.structureService.flatModelMap={};const n=this.mapLayoutModel(r);const i=this.mapToModel(r.elements,r.pages);const s=this.mapDataSourceModel(r.dataSources);queueMicrotask(()=>{this.applyInitialData();this.applyDependencies();this.applyDataSources();this.applyExpressions()});const a=new Re({schemaVersion:r.schemaVersion??1,header:r.header?new De(r.header):void 0,pages:n,elements:i,settings:new Pe(r.settings),dataSources:s,localization:r.localization});this.structureService.setPreviewStructure(a)}applyDataSources(){Object.values(this.structureService.flatModelMap).forEach(e=>{this.loadElementDataSource(e)});this.bindDataSourceValueWatcher()}loadDataSourceFor(e){if(e?.dataSource?.name)this.loadElementDataSource(e)}getDataSource(e){return this.structureService.getPreviewStructure()?.dataSources?.find(t=>t.name===e)}loadElementDataSource(e,t=false){const r=this.resolveElementDataSourceSubscriptionKey(e);if(this.shouldSkipAutoElementDataSourceLoading(e)){this.unsubscribeElementDataSource(r);return}if(!e?.dataSource?.name){this.unsubscribeElementDataSource(r);return}if(!this.isDataPathMaterialized(e.dataPath)){this.unsubscribeElementDataSource(r);return}const n=e.dataSource.name;const i=this.getDataSource(n);if(!i){this.unsubscribeElementDataSource(r);return}this.unsubscribeElementDataSource(r);e.dataSource.source=i;const s=this.buildElementDataSourceRuntimeContext(e);const a=this.dataSourceService.getData$(e.dataSource,t,e,s).subscribe({next:o=>{e["onDataSourceChanged"]?.fire({dataSource:i,result:o})},error:o=>{e["onDataSourceChanged"]?.fire({dataSource:i,result:[]});console.error(`[PreviewRendererService] Data source "${n}" failed.`,o)},complete:()=>{this.unsubscribeElementDataSource(r)}});this.elementDataSourceSubscriptions.set(r,a)}bindDataSourceValueWatcher(){if(this.isDataSourceValueWatcherBound)return;this.isDataSourceValueWatcherBound=true;this.dataService.onDataMutated.add(e=>{this.reloadElementsWatching(e.dataPath)});this.uiTranslationService.onLanguageChanged.add(()=>{this.reloadElementsWatching("__language")})}reloadElementsWatching(e){Object.values(this.structureService.flatModelMap).forEach(t=>{if(!this.isElementUsingDataPath(t,e))return;this.loadElementDataSource(t,true)})}isElementUsingDataPath(e,t){if(this.shouldSkipAutoElementDataSourceLoading(e))return false;if(!e?.dataSource?.name)return false;if(!this.isDataPathMaterialized(e.dataPath))return false;if(e.dataSource.refreshOnChange===false)return false;const r=this.resolveConfiguredRefreshPaths(e);if(r.some(c=>this.isPathMatch(c,t)))return true;if(r.length>0)return false;const n=this.getDataSource(e.dataSource.name);const i=String(n?.type??"").toLowerCase();if(!n)return false;if(i==="local"){if(String(n.params?.["localMode"]??"json").toLowerCase()!=="datapath")return false;const c=String(n.params?.["dataPath"]??"").trim();if(!c)return false;const d=c.includes("row.")||c.includes("panel.")?this.expressionService.replacePlaceholder(e,c):c;return this.isPathMatch(d,t)}if(i!=="rest")return false;const s=String(n.params?.["url"]??"");const a=n.params?.["body"]??n.params?.["payload"]??void 0;const o=Array.from(new Set([...this.expressionService.extractDependenciesFromExpression(s,e),...this.extractDependenciesFromUnknown(a,e)]));if(o.length===0)return false;const l=new Map;if(Array.isArray(e.dataSource.params))e.dataSource.params.forEach(c=>{const d=String(c.name??"").trim();const m=String(c.value??"").trim();const p=Boolean(c.isPlainValue);if(d&&m&&!p)l.set(d,this.resolveWatchPath(e,m))});return o.some(c=>{const d=l.get(c)??this.resolveWatchPath(e,c);return this.isPathMatch(d,t)})}isDataPathMaterialized(e){if(!e||!e.includes("["))return true;const t=/\[(\d+)\]/g;let r=null;while((r=t.exec(e))!==null){const n=e.slice(0,r.index);const i=Number(r[1]);const s=this.dataService.getValue(n);if(!Array.isArray(s)||s.length<=i)return false}return true}extractDependenciesFromUnknown(e,t){if(typeof e==="string")return this.expressionService.extractDependenciesFromExpression(e,t);if(Array.isArray(e))return Array.from(new Set(e.flatMap(r=>this.extractDependenciesFromUnknown(r,t))));if(e&&typeof e==="object")return Array.from(new Set(Object.values(e).flatMap(r=>this.extractDependenciesFromUnknown(r,t))));return[]}resolveConfiguredRefreshPaths(e){return(Array.isArray(e?.dataSource?.refreshPaths)?e.dataSource.refreshPaths:[]).map(t=>this.resolveWatchPath(e,t)).filter(t=>t.length>0)}resolveWatchPath(e,t){const r=this.normalizePath(t);if(!r)return"";const n=r.includes("row.")||r.includes("panel.")?this.normalizePath(this.expressionService.replacePlaceholder(e,r)):r;return br(e,n,i=>this.dataService.getValue(i))}buildElementDataSourceRuntimeContext(e){return Tr(e,t=>this.dataService.getValue(t))??void 0}normalizePath(e){const t=String(e??"").trim();if(!t)return"";const r=t.match(/^\{([^}]+)\}$/);if(r)return String(r[1]??"").trim();return t}isPathMatch(e,t){const r=this.normalizePath(e);const n=this.normalizePath(t);if(!r||!n)return false;return n===r||n.startsWith(`${r}.`)||n.startsWith(`${r}[`)||r.startsWith(`${n}.`)||r.startsWith(`${n}[`)}shouldSkipAutoElementDataSourceLoading(e){return String(e?.type??"").trim()===Sr.LIST_GRID}resolveElementDataSourceSubscriptionKey(e){return String(e?.dataPath??e?.name??"").trim()}unsubscribeElementDataSource(e){const t=String(e??"").trim();if(!t)return;this.elementDataSourceSubscriptions.get(t)?.unsubscribe();this.elementDataSourceSubscriptions.delete(t)}clearElementDataSourceSubscriptions(){Array.from(this.elementDataSourceSubscriptions.keys()).forEach(e=>{this.unsubscribeElementDataSource(e)})}static ɵfac=h.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:Tt,deps:null,target:h.ɵɵFactoryTarget.Injectable});static ɵprov=h.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:Tt,providedIn:"root"})};h.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:He,decorators:[{type:A,args:[{providedIn:"root"}]}]});const hn=new Set(["dataService","dataSourceModel","onValueChanging","onValueChanged","onDataMutated","onClearValue","onDataSourceChanged","onRowColumnValueChange","afterDataSourceLoad","source","listeners"]);const mn=["name","type","label","dataPath"];function me(u,e){if(!u||typeof u!=="object")return null;return je(u,Number.isFinite(e?.depth)?Number(e?.depth):1,{includeRuntimeFields:e?.includeRuntimeFields!==false,includeInternalFields:e?.includeInternalFields===true,seen:new WeakSet})}function je(u,e,t){if(t.seen.has(u))return null;t.seen.add(u);const r=t.includeRuntimeFields?new Set:new Set(X(u));const n={};const i=s=>{if(s in n)return;const a=u[s];if(a===void 0||typeof a==="function"||r.has(s)||hn.has(s)||s==="parentElement"||!t.includeInternalFields&&s.startsWith("__"))return;if(typeof a==="string"&&a.length===0)return;if(Array.isArray(a)&&a.length===0)return;n[s]=pn(a,s,e,t)};mn.forEach(i);Object.keys(u).forEach(i);return n}function pn(u,e,t,r){const n=e==="template"||e==="columns"||e==="rowColumn";if(!n||t<=0){if(n)return gn(u);return u}if(Array.isArray(u))return u.map(i=>i&&typeof i==="object"?je(i,t-1,r):i);if(u&&typeof u==="object"){const i={};Object.entries(u).forEach(([s,a])=>{i[s]=a&&typeof a==="object"?je(a,t-1,r):a});return i}return u}function gn(u){return(Array.isArray(u)?u:u&&typeof u==="object"?Object.values(u):[]).map(e=>{const t=e??{};return`${String(t["name"]??"?")}:${String(t["type"]??"?")}`})}var G=class xt{router=g(jt,{optional:true});dataService=g(M);dataSourceService=g(O);structureService=g(R);expressionService=g(D);routeVariables=E(this.createEmptyVariables(),...ngDevMode?[{debugName:"routeVariables"}]:[]);variableMappings=E([],...ngDevMode?[{debugName:"variableMappings"}]:[]);externalVariables=E({},...ngDevMode?[{debugName:"externalVariables"}]:[]);projectedDataPaths=new Set;refreshVersion=0;syncStarted=false;navigationSubscription=null;valueChangedHandler=null;dataMutationHandler=null;liveDataSourceSubscriptions=new Map;liveDataSourceSubscriptionKeys=new Map;startSync(){if(this.syncStarted){this.refresh();return}this.syncStarted=true;this.bindDataValueWatcher();this.bindDataMutationWatcher();this.refresh();if(!this.router)return;this.navigationSubscription=this.router.events.pipe(Pr(e=>e instanceof kr)).subscribe(()=>{this.refresh()})}stopSync(){if(this.valueChangedHandler){this.dataService.onValueChanged.remove(this.valueChangedHandler);this.valueChangedHandler=null}if(this.dataMutationHandler){this.dataService.onDataMutated.remove(this.dataMutationHandler);this.dataMutationHandler=null}this.navigationSubscription?.unsubscribe();this.navigationSubscription=null;this.clearLiveDataSourceSubscriptions();this.refreshVersion+=1;this.syncStarted=false}resetState(){this.refreshVersion+=1;this.routeVariables.set(this.createEmptyVariables());const e=Array.from(this.projectedDataPaths);this.projectedDataPaths=new Set;e.forEach(t=>{this.dataService.deleteValue(t)});this.dataService.deleteValue("__variables");this.dataService.deleteValue("__route");this.dataService.deleteValue("__external")}getRouteVariables(){return this.routeVariables()}getExternalVariables(){return W(this.externalVariables())}setMappings(e,t=true){this.variableMappings.set(this.normalizeMappings(e));if(t)this.refresh()}setExternalVariables(e,t=true){const r=this.normalizeExternalVariables(e);if(t)this.externalVariables.set({...this.externalVariables(),...r});else this.externalVariables.set(r);this.refresh()}clearExternalVariables(){this.externalVariables.set({});this.refresh()}refresh(){this.refreshInternal()}async refreshInternal(){const e=++this.refreshVersion;const t=this.router?.routerState?.snapshot?.root??null;const r=this.buildRouteVariables(t);const n=W(this.externalVariables());this.routeVariables.set(r);this.dataService.setValue("__route",r);this.dataService.setValue("__external",n);if(e!==this.refreshVersion)return;const i=await this.resolveCustomVariables(r,n);if(e!==this.refreshVersion)return;const s={route:r,external:n,...i};await this.dataService.setValue("__variables",s);await this.syncProjectedVariables(i);this.syncLiveDataSourceSubscriptions(r,n,i)}bindDataValueWatcher(){if(this.valueChangedHandler)return;this.valueChangedHandler=e=>{this.handleDataValueChanged(e)};this.dataService.onValueChanged.add(this.valueChangedHandler)}bindDataMutationWatcher(){if(this.dataMutationHandler)return;this.dataMutationHandler=e=>{this.handleDataMutation(e)};this.dataService.onDataMutated.add(this.dataMutationHandler)}handleDataValueChanged(e){if(!this.syncStarted||!this.hasReactiveMappings())return;const t=String(e?.dataPath??"").trim();if(!this.shouldRefreshForDataPath(t))return;this.refresh()}handleDataMutation(e){if(!this.syncStarted||!this.hasReactiveMappings())return;const t=String(e?.trigger??"").trim().toLowerCase();if(!(!t||t==="programmatic"||t==="load")||e?.sender)return;const r=String(e?.dataPath??"").trim();if(!this.shouldRefreshForDataPath(r))return;this.refresh()}shouldRefreshForDataPath(e){const t=this.normalizeWrappedPath(e);if(!t)return false;if(this.isReservedDataPath(t)||this.isProjectedDataPath(t))return false;return this.isPathReferencedByExpressionMappings(t)||this.isPathReferencedByDataSourceMappings(t)}isPathReferencedByExpressionMappings(e){return this.variableMappings().some(t=>{if(this.normalizeSourceType(t,String(t?.source??"").trim(),String(t?.expression??"").trim())!=="expression")return false;const r=String(t?.expression??t?.source??"").trim();const n=this.extractExpressionDependencies(r);if(n.length===0)return false;return n.some(i=>this.isPathMatch(i,e))})}extractExpressionDependencies(e){const t=this.normalizeExpression(e);if(!t)return[];const r=new Set;this.collectExpressionDependenciesFromPattern(t,/\{([^}]+)\}/g,r);this.collectExpressionDependenciesFromPattern(t,/getVal\s*\(\s*["']([^"']+)["']\s*\)/g,r);return Array.from(r)}collectExpressionDependenciesFromPattern(e,t,r){let n=t.exec(e);while(n){const i=this.normalizeExpressionDependencyToken(String(n[1]??""));if(i)r.add(i);n=t.exec(e)}t.lastIndex=0}normalizeExpressionDependencyToken(e){const t=this.normalizeWrappedPath(e);if(!t)return"";const r=t.toLowerCase();if(r==="route"||r.startsWith("route.")||r==="__route"||r.startsWith("__route.")||r==="external"||r.startsWith("external.")||r==="__external"||r.startsWith("__external.")||r==="vars"||r.startsWith("vars.")||r==="variables"||r.startsWith("variables.")||r==="__variables"||r.startsWith("__variables."))return"";return t.replace(/^data\./,"")}isPathMatch(e,t){const r=this.normalizeWrappedPath(e);const n=this.normalizeWrappedPath(t);if(!r||!n)return false;return n===r||n.startsWith(`${r}.`)||n.startsWith(`${r}[`)||r.startsWith(`${n}.`)||r.startsWith(`${n}[`)}hasReactiveMappings(){return this.variableMappings().some(e=>{const t=this.normalizeSourceType(e,String(e?.source??"").trim(),String(e?.expression??"").trim());if(t==="expression")return true;return t==="dataSource"&&Boolean(e?.refreshOnChange)&&this.resolveDataSourceRefreshPaths(e).length>0})}isPathReferencedByDataSourceMappings(e){return this.variableMappings().some(t=>{if(this.normalizeSourceType(t,String(t?.source??"").trim(),String(t?.expression??"").trim())!=="dataSource"||!Boolean(t?.refreshOnChange))return false;const r=this.resolveDataSourceRefreshPaths(t);if(r.length===0)return false;return r.some(n=>this.isPathMatch(n,e))})}isReservedDataPath(e){return e.startsWith("__route")||e.startsWith("__external")||e.startsWith("__variables")}isProjectedDataPath(e){for(const t of this.projectedDataPaths)if(e===t||e.startsWith(`${t}.`)||e.startsWith(`${t}[`))return true;return false}buildRouteVariables(e){if(!e)return this.createEmptyVariables();const t={};const r={};const n={};let i=null;let s=e;while(s){if(s.params&&typeof s.params==="object")Object.assign(t,s.params);if(s.queryParams&&typeof s.queryParams==="object")Object.assign(r,s.queryParams);if(s.data&&typeof s.data==="object")Object.assign(n,s.data);if(i===null&&typeof s.fragment==="string")i=s.fragment;s=s.firstChild??null}const a=t["id"]??r["id"];return{url:String(this.router?.url??""),id:a,params:t,queryParams:r,data:n,fragment:i,state:this.readNavigationState()}}createEmptyVariables(){return{url:String(this.router?.url??""),id:void 0,params:{},queryParams:{},data:{},fragment:null,state:{}}}readNavigationState(){if(typeof window==="undefined"||!window.history)return{};const e=window.history.state;if(typeof e!=="object"||e===null||Array.isArray(e))return{};const{navigationId:t,...r}=e;return r}normalizeMappings(e){if(!Array.isArray(e))return[];return e.map(t=>{const r=String(t?.name??"").trim();if(!r)return null;const n=String(t?.title??"").trim();const i=String(t?.source??"").trim();const s=String(t?.expression??"").trim();const a=this.normalizeSourceType(t,i,s);const o={name:r,title:n,sourceType:a,includeInDataJson:Boolean(t?.includeInDataJson),targetPath:String(t?.targetPath??"").trim(),refreshOnChange:Boolean(t?.refreshOnChange),refreshPaths:this.normalizeRefreshPaths(t?.refreshPaths)};if(a==="route")o.source=i||"route.id";else if(a==="external")o.source=i||"external";else if(a==="expression")o.expression=s||i;else if(a==="constant")o.constantValue=b(t?.constantValue);else if(a==="dataSource")o.source=i||this.resolveDefaultDataSourceSource(r);if(t?.fallbackValue!==void 0)o.fallbackValue=b(t.fallbackValue);return o}).filter(t=>t!==null)}normalizeSourceType(e,t,r){const n=String(e?.sourceType??"").trim().toLowerCase();if(n==="route"||n==="external"||n==="constant"||n==="expression"||n==="manual"||n==="datasource")return n==="datasource"?"dataSource":n;if(r.length>0)return"expression";if(e?.constantValue!==void 0)return"constant";const i=t.toLowerCase();if(i==="external"||i.startsWith("external.")||i.startsWith("__external."))return"external";if(i==="datasource"||i.startsWith("datasource.")||i.startsWith("__datasource."))return"dataSource";return"route"}resolveDataSourceRefreshPaths(e){return this.normalizeRefreshPaths(e?.refreshPaths)}normalizeRefreshPaths(e){if(!Array.isArray(e))return[];const t=new Set;e.forEach(r=>{const n=this.normalizeRefreshPath(r);if(!n)return;t.add(n)});return Array.from(t)}normalizeRefreshPath(e){const t=this.normalizeWrappedPath(String(e??""));if(!t)return"";const r=t.toLowerCase();if(r==="route"||r.startsWith("route.")||r==="__route"||r.startsWith("__route.")||r==="external"||r.startsWith("external.")||r==="__external"||r.startsWith("__external.")||r==="vars"||r.startsWith("vars.")||r==="variables"||r.startsWith("variables.")||r==="__variables"||r.startsWith("__variables."))return"";if(r==="data")return"";if(r.startsWith("data."))return t.slice(5);if(r.startsWith("data["))return t.slice(4);return t}async resolveCustomVariables(e,t){const r=this.variableMappings();const n=new Set;r.forEach(o=>{const l=String(o?.name??"").trim();if(!l)return;n.add(l)});const i=this.getExistingCustomVariables(n);const s=[];for(const o of r){const l=String(o?.name??"").trim();if(!l)continue;const c=this.normalizeSourceType(o,String(o?.source??"").trim(),String(o?.expression??"").trim());if(c==="expression"||c==="dataSource"){s.push(o);continue}const d=await this.resolveMappingValue(o,e,t,i);i[l]=this.resolveFallbackValue(d,o?.fallbackValue)}const a=Math.max(s.length,1);for(let o=0;o<a;o+=1){let l=false;for(const c of s){const d=String(c?.name??"").trim();if(!d)continue;const m=await this.resolveMappingValue(c,e,t,i);const p=this.resolveFallbackValue(m,c?.fallbackValue);if(!k(i[d],p))l=true;i[d]=p}if(!l)break}return i}getExistingCustomVariables(e){const t=this.dataService.getValue("__variables");if(!t||typeof t!=="object"||Array.isArray(t))return{};return Object.entries(t).reduce((r,[n,i])=>{const s=String(n??"").trim();if(!s||!e.has(s)||s==="route"||s==="external")return r;if(s.startsWith("__"))return r;r[s]=b(i);return r},{})}async resolveMappingValue(e,t,r,n){const i=String(e?.name??"").trim();const s=this.normalizeSourceType(e,String(e?.source??"").trim(),String(e?.expression??"").trim());if(s==="constant")return b(e?.constantValue);if(s==="manual")return b(this.dataService.getValue(`__variables.${i}`));if(s==="expression")return await this.resolveExpressionValue(String(e?.expression??"").trim(),t,r,n);if(s==="external")return this.resolveExternalValue(r,String(e?.source??"").trim());if(s==="dataSource"){if(!this.isRuntimeVariableDataSourceExecutionAllowed())return b(this.dataService.getValue(`__variables.${i}`));if(this.isLiveDataSourceSource(String(e?.source??"").trim()))return b(this.dataService.getValue(`__variables.${i}`));return await this.resolveDataSourceValue(String(e?.source??"").trim(),t,r,n)}return this.resolveRouteValue(t,String(e?.source??"").trim())}async resolveDataSourceValue(e,t,r,n){const i=this.normalizeDataSourceName(e);if(!i)return;const s=this.buildExpressionContext(t,r,n);try{return await P(this.dataSourceService.getData$(i,false,void 0,s))}catch{return}}isRuntimeVariableDataSourceExecutionAllowed(){return te.allowRuntimeVariableDataSources()}isLiveDataSourceSource(e){const t=this.normalizeDataSourceName(e);if(!t)return false;const r=this.dataSourceService.getSource(t);return String(r?.type??"").trim().toLowerCase()==="websocket"}normalizeDataSourceName(e){const t=this.normalizeWrappedPath(e);if(!t)return"";if(/^__?datasource$/i.test(t))return"";return t.replace(/^__?datasource\./i,"").trim()}resolveDefaultDataSourceSource(e){const t=String(e??"").trim();if(!t)return"";return this.getAvailableDataSourceNames().includes(t)?t:""}getAvailableDataSourceNames(){const e=this.structureService.getPreviewStructure()?.dataSources;const t=this.structureService.getStructure()?.dataSources;const r=Array.isArray(e)?e:Array.isArray(t)?t:[];const n=new Set;r.forEach(i=>{const s=String(i?.name??"").trim();if(s)n.add(s)});return Array.from(n)}resolveRouteValue(e,t){const r=this.normalizeWrappedPath(t);if(!r)return;const n=r.toLowerCase();if(n==="id"||n==="route.id"||n==="__route.id")return e.id;if(n==="url"||n==="route.url"||n==="__route.url")return e.url;if(n==="fragment"||n==="route.fragment"||n==="__route.fragment")return e.fragment;if(n==="route"||n==="__route")return e;const i=r.replace(/^__route\./,"").replace(/^route\./,"");const s=x(e,i);if(s!==void 0)return s;if(!i.includes(".")&&i!=="params"&&i!=="queryParams"&&i!=="data"&&i!=="url"&&i!=="fragment")return e.params?.[i]}resolveExternalValue(e,t){const r=this.normalizeWrappedPath(t);if(!r)return e;const n=r.toLowerCase();if(n==="external"||n==="__external")return e;const i=r.replace(/^__external\./,"").replace(/^external\./,"");const s=x(e,i);if(s!==void 0)return s;if(Object.prototype.hasOwnProperty.call(e,i))return e[i]}syncLiveDataSourceSubscriptions(e,t,r){const n=new Set;for(const i of this.variableMappings()){const s=String(i?.name??"").trim();const a=this.normalizeSourceType(i,String(i?.source??"").trim(),String(i?.expression??"").trim());if(!s||a!=="dataSource")continue;const o=this.normalizeDataSourceName(String(i?.source??"").trim());if(!o||!this.isLiveDataSourceSource(o))continue;n.add(s);const l={...r};delete l[s];const c=this.buildExpressionContext(e,t,l);const d=JSON.stringify({sourceName:o,runtimeContext:c});if(this.liveDataSourceSubscriptionKeys.get(s)===d&&this.liveDataSourceSubscriptions.has(s))continue;this.unsubscribeLiveDataSource(s);const m=this.dataSourceService.getDataStream$(o,false,void 0,c).subscribe({next:p=>{this.applyLiveDataSourceVariableValue(i,p)},error:()=>{this.unsubscribeLiveDataSource(s);this.applyLiveDataSourceVariableValue(i,void 0)},complete:()=>{this.unsubscribeLiveDataSource(s)}});this.liveDataSourceSubscriptions.set(s,m);this.liveDataSourceSubscriptionKeys.set(s,d)}Array.from(this.liveDataSourceSubscriptions.keys()).forEach(i=>{if(n.has(i))return;this.unsubscribeLiveDataSource(i)})}async applyLiveDataSourceVariableValue(e,t){const r=String(e?.name??"").trim();if(!r)return;const n=this.resolveFallbackValue(t,e?.fallbackValue);const i=b(this.dataService.getValue(`__variables.${r}`));if(k(i,n))return;const s=this.dataService.getValue("__variables");const a=s&&typeof s==="object"&&!Array.isArray(s)?W(s):{};if(n===void 0)delete a[r];else a[r]=b(n);await this.dataService.setValue("__variables",a);await this.syncProjectedVariableValue(e,n)}async syncProjectedVariableValue(e,t){if(!Boolean(e?.includeInDataJson))return;const r=String(e?.name??"").trim();if(!r)return;const n=this.resolveTargetPath(e,r);if(!n)return;if(t===void 0){await this.dataService.deleteValue(n);return}await this.dataService.setValue(n,b(t))}clearLiveDataSourceSubscriptions(){Array.from(this.liveDataSourceSubscriptions.keys()).forEach(e=>{this.unsubscribeLiveDataSource(e)})}unsubscribeLiveDataSource(e){this.liveDataSourceSubscriptions.get(e)?.unsubscribe();this.liveDataSourceSubscriptions.delete(e);this.liveDataSourceSubscriptionKeys.delete(e)}async resolveExpressionValue(e,t,r,n){const i=this.normalizeExpression(e);if(!i)return;const s=this.buildExpressionContext(t,r,n);const a=this.resolveExpressionPlaceholders(i);try{const o=await this.expressionService.runPropertyCondition(s,a);if(typeof o==="number"&&!Number.isFinite(o))return;return o}catch{return}}buildExpressionContext(e,t,r){const n=W(this.dataService.getData());const i={route:e,external:t,...r};const s=Object.entries(r).reduce((a,[o,l])=>{const c=String(o??"").trim();if(!c||c==="route"||c==="external"||c.startsWith("__"))return a;if(Object.prototype.hasOwnProperty.call(n,c))return a;a[c]=l;return a},{});return{...n,...s,data:n,route:e,__route:e,external:t,__external:t,vars:r,variables:r,__variables:i}}resolveExpressionPlaceholders(e){return e.replace(/\{([^}]+)\}/g,(t,r)=>this.normalizeExpressionToken(r))}normalizeExpressionToken(e){const t=this.normalizeWrappedPath(e);if(!t)return"";if(t==="__route")return"route";if(t.startsWith("__route."))return`route.${t.slice(8)}`;if(t==="__external")return"external";if(t.startsWith("__external."))return`external.${t.slice(11)}`;if(t==="__variables")return"vars";if(t.startsWith("__variables."))return`vars.${t.slice(12)}`;return`getVal(${JSON.stringify(t)})`}resolveFallbackValue(e,t){if(this.hasMeaningfulValue(e))return e;return b(t)}async syncProjectedVariables(e){const t=new Set;for(const r of this.variableMappings()){if(!Boolean(r?.includeInDataJson))continue;const n=String(r?.name??"").trim();if(!n)continue;const i=this.resolveTargetPath(r,n);if(!i)continue;t.add(i);const s=b(e[n]);if(s===void 0)await this.dataService.deleteValue(i);else await this.dataService.setValue(i,s)}for(const r of this.projectedDataPaths){if(t.has(r))continue;await this.dataService.deleteValue(r)}this.projectedDataPaths=t}resolveTargetPath(e,t){return String(e?.targetPath??"").trim()||t}normalizeExpression(e){return String(e??"").trim()}normalizeWrappedPath(e){return String(e??"").trim().replace(/^\{/,"").replace(/\}$/,"").trim()}hasMeaningfulValue(e){if(e===void 0||e===null)return false;if(typeof e==="string")return e.trim().length>0;return true}normalizeExternalVariables(e){if(!e||typeof e!=="object"||Array.isArray(e))return{};return W(e)}static ɵfac=h.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:xt,deps:[],target:h.ɵɵFactoryTarget.Injectable});static ɵprov=h.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:xt,providedIn:"root"})};h.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:G,decorators:[{type:A,args:[{providedIn:"root"}]}]});const fn={"--nvb-font-family-base":"'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif","--nvb-color-primary-050":"oklch(98.04% 0.0104 251.42)","--nvb-color-primary-100":"oklch(95.63% 0.0247 251.98)","--nvb-color-primary-200":"oklch(91.21% 0.0518 252.79)","--nvb-color-primary-300":"oklch(84.55% 0.0888 253.67)","--nvb-color-primary-400":"oklch(75.39% 0.1293 254.94)","--nvb-color-primary-500":"oklch(64.21% 0.1552 256.62)","--nvb-color-primary-600":"oklch(56.71% 0.1412 257.44)","--nvb-color-primary-700":"oklch(48.29% 0.1191 258.32)","--nvb-color-primary-800":"oklch(40.54% 0.0992 258.96)","--nvb-color-primary-900":"oklch(31.48% 0.0762 259.64)","--nvb-color-primary-950":"oklch(24.86% 0.0581 260.47)","--nvb-color-neutral-000":"oklch(100.00% 0.0001 89.88)","--nvb-color-neutral-050":"oklch(98.38% 0.0035 247.86)","--nvb-color-neutral-100":"oklch(96.76% 0.0070 247.90)","--nvb-color-neutral-200":"oklch(92.58% 0.0132 255.03)","--nvb-color-neutral-300":"oklch(86.94% 0.0199 253.37)","--nvb-color-neutral-400":"oklch(71.00% 0.0348 256.79)","--nvb-color-neutral-500":"oklch(55.64% 0.0398 256.82)","--nvb-color-neutral-600":"oklch(45.05% 0.0371 256.83)","--nvb-color-neutral-700":"oklch(37.52% 0.0394 256.85)","--nvb-color-neutral-800":"oklch(27.53% 0.0364 259.70)","--nvb-color-neutral-900":"oklch(20.64% 0.0388 265.55)","--nvb-color-neutral-950":"oklch(12.92% 0.0415 265.15)","--nvb-color-risk-050":"oklch(96.78% 0.0142 17.40)","--nvb-color-risk-100":"oklch(93.44% 0.0314 17.73)","--nvb-color-risk-200":"oklch(88.03% 0.0615 18.39)","--nvb-color-risk-300":"oklch(80.98% 0.1025 19.54)","--nvb-color-risk-400":"oklch(71.23% 0.1656 22.18)","--nvb-color-risk-500":"oklch(63.56% 0.2082 25.38)","--nvb-color-risk-600":"oklch(57.86% 0.2137 27.17)","--nvb-color-risk-700":"oklch(50.79% 0.1918 27.56)","--nvb-color-risk-800":"oklch(44.10% 0.1603 26.89)","--nvb-color-risk-900":"oklch(39.96% 0.1348 25.77)","--nvb-color-risk-950":"oklch(25.26% 0.0866 26.00)","--nvb-color-caution-050":"oklch(98.66% 0.0218 95.28)","--nvb-color-caution-100":"oklch(96.22% 0.0569 95.61)","--nvb-color-caution-200":"oklch(92.57% 0.1141 95.75)","--nvb-color-caution-300":"oklch(88.13% 0.1526 91.77)","--nvb-color-caution-400":"oklch(83.34% 0.1641 83.87)","--nvb-color-caution-500":"oklch(76.97% 0.1645 70.61)","--nvb-color-caution-600":"oklch(66.88% 0.1588 57.96)","--nvb-color-caution-700":"oklch(55.42% 0.1447 49.16)","--nvb-color-caution-800":"oklch(47.06% 0.1236 46.53)","--nvb-color-caution-900":"oklch(40.96% 0.1037 46.31)","--nvb-color-caution-950":"oklch(27.80% 0.0739 45.80)","--nvb-color-warning-050":"oklch(98.66% 0.0218 95.28)","--nvb-color-warning-100":"oklch(96.22% 0.0569 95.61)","--nvb-color-warning-200":"oklch(92.57% 0.1141 95.75)","--nvb-color-warning-300":"oklch(88.13% 0.1526 91.77)","--nvb-color-warning-400":"oklch(83.34% 0.1641 83.87)","--nvb-color-warning-500":"oklch(76.97% 0.1645 70.61)","--nvb-color-warning-600":"oklch(66.88% 0.1588 57.96)","--nvb-color-warning-700":"oklch(55.42% 0.1447 49.16)","--nvb-color-warning-800":"oklch(47.06% 0.1236 46.53)","--nvb-color-warning-900":"oklch(40.96% 0.1037 46.31)","--nvb-color-warning-950":"oklch(27.80% 0.0739 45.80)","--nvb-color-success-050":"oklch(98.36% 0.0162 155.55)","--nvb-color-success-100":"oklch(96.46% 0.0405 157.07)","--nvb-color-success-200":"oklch(92.46% 0.0811 155.98)","--nvb-color-success-300":"oklch(87.12% 0.1370 154.59)","--nvb-color-success-400":"oklch(79.99% 0.1816 151.78)","--nvb-color-success-500":"oklch(72.05% 0.1920 149.49)","--nvb-color-success-600":"oklch(62.30% 0.1688 149.18)","--nvb-color-success-700":"oklch(52.48% 0.1373 149.83)","--nvb-color-success-800":"oklch(44.61% 0.1073 151.49)","--nvb-color-success-900":"oklch(38.98% 0.0885 152.69)","--nvb-color-success-950":"oklch(26.61% 0.0625 153.04)","--nvb-color-info-050":"oklch(97.67% 0.0127 236.62)","--nvb-color-info-100":"oklch(95.35% 0.0240 236.81)","--nvb-color-info-200":"oklch(89.99% 0.0556 231.68)","--nvb-color-info-300":"oklch(82.95% 0.1004 229.56)","--nvb-color-info-400":"oklch(75.84% 0.1373 231.60)","--nvb-color-info-500":"oklch(67.76% 0.1481 238.10)","--nvb-color-info-600":"oklch(58.63% 0.1366 241.18)","--nvb-color-info-700":"oklch(49.96% 0.1179 242.21)","--nvb-color-info-800":"oklch(43.80% 0.0988 240.83)","--nvb-color-info-900":"oklch(39.20% 0.0844 240.76)","--nvb-color-info-950":"oklch(29.47% 0.0635 243.15)","--nvb-color-text-000":"oklch(100.00% 0.0001 89.88)","--nvb-color-text-050":"oklch(98.38% 0.0035 247.86)","--nvb-color-text-100":"oklch(96.76% 0.0070 247.90)","--nvb-color-text-200":"oklch(92.58% 0.0132 255.03)","--nvb-color-text-300":"oklch(86.94% 0.0199 253.37)","--nvb-color-text-400":"oklch(71.00% 0.0348 256.79)","--nvb-color-text-500":"oklch(55.64% 0.0398 256.82)","--nvb-color-text-600":"oklch(45.05% 0.0371 256.83)","--nvb-color-text-700":"oklch(37.52% 0.0394 256.85)","--nvb-color-text-800":"oklch(27.53% 0.0364 259.70)","--nvb-color-text-900":"oklch(20.64% 0.0388 265.55)","--nvb-color-text-950":"oklch(12.92% 0.0415 265.15)","--nvb-radius-sm":"4px","--nvb-radius-md":"6px","--nvb-radius-lg":"8px","--nvb-radius-xl":"12px","--nvb-radius-full":"999px","--nvb-space-0":"2px","--nvb-space-1":"4px","--nvb-space-2":"6px","--nvb-space-3":"8px","--nvb-space-4":"10px","--nvb-space-5":"12px","--nvb-space-6":"16px","--nvb-space-7":"20px","--nvb-space-8":"24px","--nvb-space-9":"32px","--nvb-text-caption2":"10px","--nvb-text-caption1":"12px","--nvb-text-body1":"14px","--nvb-text-subtitle2":"16px","--nvb-text-subtitle1":"20px","--nvb-text-title3":"24px","--nvb-text-title2":"28px","--nvb-text-sm":"12px","--nvb-text-base":"14px","--nvb-text-md":"14px","--nvb-text-lg":"16px","--nvb-color-surface-mix-target":"var(--nvb-color-neutral-000)"};const vn={"--nvb-font-family-base":"'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif","--nvb-color-primary-050":"oklch(24.86% 0.0581 260.47)","--nvb-color-primary-100":"oklch(31.48% 0.0762 259.64)","--nvb-color-primary-200":"oklch(40.54% 0.0992 258.96)","--nvb-color-primary-300":"oklch(48.29% 0.1191 258.32)","--nvb-color-primary-400":"oklch(56.71% 0.1412 257.44)","--nvb-color-primary-500":"oklch(64.21% 0.1552 256.62)","--nvb-color-primary-600":"oklch(75.39% 0.1293 254.94)","--nvb-color-primary-700":"oklch(84.55% 0.0888 253.67)","--nvb-color-primary-800":"oklch(91.21% 0.0518 252.79)","--nvb-color-primary-900":"oklch(95.63% 0.0247 251.98)","--nvb-color-primary-950":"oklch(98.04% 0.0104 251.42)","--nvb-color-neutral-000":"oklch(19.00% 0.0060 286.00)","--nvb-color-neutral-050":"oklch(23.00% 0.0070 286.00)","--nvb-color-neutral-100":"oklch(27.00% 0.0080 286.00)","--nvb-color-neutral-200":"oklch(38.00% 0.0090 286.00)","--nvb-color-neutral-300":"oklch(49.50% 0.0100 286.00)","--nvb-color-neutral-400":"oklch(58.00% 0.0100 286.00)","--nvb-color-neutral-500":"oklch(65.00% 0.0090 286.00)","--nvb-color-neutral-600":"oklch(74.00% 0.0070 286.00)","--nvb-color-neutral-700":"oklch(82.00% 0.0050 286.00)","--nvb-color-neutral-800":"oklch(88.00% 0.0040 286.00)","--nvb-color-neutral-900":"oklch(93.00% 0.0030 286.00)","--nvb-color-neutral-950":"oklch(97.00% 0.0020 286.00)","--nvb-color-risk-050":"oklch(25.26% 0.0866 26.00)","--nvb-color-risk-100":"oklch(39.96% 0.1348 25.77)","--nvb-color-risk-200":"oklch(44.10% 0.1603 26.89)","--nvb-color-risk-300":"oklch(50.79% 0.1918 27.56)","--nvb-color-risk-400":"oklch(57.86% 0.2137 27.17)","--nvb-color-risk-500":"oklch(63.56% 0.2082 25.38)","--nvb-color-risk-600":"oklch(71.23% 0.1656 22.18)","--nvb-color-risk-700":"oklch(80.98% 0.1025 19.54)","--nvb-color-risk-800":"oklch(88.03% 0.0615 18.39)","--nvb-color-risk-900":"oklch(93.44% 0.0314 17.73)","--nvb-color-risk-950":"oklch(96.78% 0.0142 17.40)","--nvb-color-caution-050":"oklch(27.80% 0.0739 45.80)","--nvb-color-caution-100":"oklch(40.96% 0.1037 46.31)","--nvb-color-caution-200":"oklch(47.06% 0.1236 46.53)","--nvb-color-caution-300":"oklch(55.42% 0.1447 49.16)","--nvb-color-caution-400":"oklch(66.88% 0.1588 57.96)","--nvb-color-caution-500":"oklch(76.97% 0.1645 70.61)","--nvb-color-caution-600":"oklch(83.34% 0.1641 83.87)","--nvb-color-caution-700":"oklch(88.13% 0.1526 91.77)","--nvb-color-caution-800":"oklch(92.57% 0.1141 95.75)","--nvb-color-caution-900":"oklch(96.22% 0.0569 95.61)","--nvb-color-caution-950":"oklch(98.66% 0.0218 95.28)","--nvb-color-warning-050":"oklch(27.80% 0.0739 45.80)","--nvb-color-warning-100":"oklch(40.96% 0.1037 46.31)","--nvb-color-warning-200":"oklch(47.06% 0.1236 46.53)","--nvb-color-warning-300":"oklch(55.42% 0.1447 49.16)","--nvb-color-warning-400":"oklch(66.88% 0.1588 57.96)","--nvb-color-warning-500":"oklch(76.97% 0.1645 70.61)","--nvb-color-warning-600":"oklch(83.34% 0.1641 83.87)","--nvb-color-warning-700":"oklch(88.13% 0.1526 91.77)","--nvb-color-warning-800":"oklch(92.57% 0.1141 95.75)","--nvb-color-warning-900":"oklch(96.22% 0.0569 95.61)","--nvb-color-warning-950":"oklch(98.66% 0.0218 95.28)","--nvb-color-success-050":"oklch(26.61% 0.0625 153.04)","--nvb-color-success-100":"oklch(38.98% 0.0885 152.69)","--nvb-color-success-200":"oklch(44.61% 0.1073 151.49)","--nvb-color-success-300":"oklch(52.48% 0.1373 149.83)","--nvb-color-success-400":"oklch(62.30% 0.1688 149.18)","--nvb-color-success-500":"oklch(72.05% 0.1920 149.49)","--nvb-color-success-600":"oklch(79.99% 0.1816 151.78)","--nvb-color-success-700":"oklch(87.12% 0.1370 154.59)","--nvb-color-success-800":"oklch(92.46% 0.0811 155.98)","--nvb-color-success-900":"oklch(96.46% 0.0405 157.07)","--nvb-color-success-950":"oklch(98.36% 0.0162 155.55)","--nvb-color-info-050":"oklch(29.47% 0.0635 243.15)","--nvb-color-info-100":"oklch(39.20% 0.0844 240.76)","--nvb-color-info-200":"oklch(43.80% 0.0988 240.83)","--nvb-color-info-300":"oklch(49.96% 0.1179 242.21)","--nvb-color-info-400":"oklch(58.63% 0.1366 241.18)","--nvb-color-info-500":"oklch(67.76% 0.1481 238.10)","--nvb-color-info-600":"oklch(75.84% 0.1373 231.60)","--nvb-color-info-700":"oklch(82.95% 0.1004 229.56)","--nvb-color-info-800":"oklch(89.99% 0.0556 231.68)","--nvb-color-info-900":"oklch(95.35% 0.0240 236.81)","--nvb-color-info-950":"oklch(97.67% 0.0127 236.62)","--nvb-color-text-000":"oklch(19.00% 0.0060 286.00)","--nvb-color-text-050":"oklch(23.00% 0.0070 286.00)","--nvb-color-text-100":"oklch(27.00% 0.0080 286.00)","--nvb-color-text-200":"oklch(38.00% 0.0090 286.00)","--nvb-color-text-300":"oklch(49.50% 0.0100 286.00)","--nvb-color-text-400":"oklch(58.00% 0.0100 286.00)","--nvb-color-text-500":"oklch(65.00% 0.0090 286.00)","--nvb-color-text-600":"oklch(74.00% 0.0070 286.00)","--nvb-color-text-700":"oklch(82.00% 0.0050 286.00)","--nvb-color-text-800":"oklch(88.00% 0.0040 286.00)","--nvb-color-text-900":"oklch(93.00% 0.0030 286.00)","--nvb-color-text-950":"oklch(97.00% 0.0020 286.00)","--nvb-radius-sm":"4px","--nvb-radius-md":"6px","--nvb-radius-lg":"8px","--nvb-radius-xl":"12px","--nvb-radius-full":"999px","--nvb-space-0":"2px","--nvb-space-1":"4px","--nvb-space-2":"6px","--nvb-space-3":"8px","--nvb-space-4":"10px","--nvb-space-5":"12px","--nvb-space-6":"16px","--nvb-space-7":"20px","--nvb-space-8":"24px","--nvb-space-9":"32px","--nvb-text-caption2":"10px","--nvb-text-caption1":"12px","--nvb-text-body1":"14px","--nvb-text-subtitle2":"16px","--nvb-text-subtitle1":"20px","--nvb-text-title3":"24px","--nvb-text-title2":"28px","--nvb-text-sm":"12px","--nvb-text-base":"14px","--nvb-text-md":"14px","--nvb-text-lg":"16px","--nvb-color-surface-mix-target":"var(--nvb-color-neutral-050)"};function dr(u){return u==="dark"?vn:fn}var Oe=class Et{components=new Map;registerComponent(e,t){const r=String(e??"").trim();if(!r||!t)return;this.components.set(r,t)}getComponent(e){return this.components.get(String(e??"").trim())??null}static ɵfac=h.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:Et,deps:[],target:h.ɵɵFactoryTarget.Injectable});static ɵprov=h.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:Et,providedIn:"root"})};h.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:Oe,decorators:[{type:A,args:[{providedIn:"root"}]}]});const hr=[{type:"text",label:"Text input",order:100},{type:"textarea",label:"Textarea",order:200},{type:"number",label:"Number",order:300},{type:"numberStepper",label:"Number stepper",order:400},{type:"phoneInput",label:"Phone input",order:500},{type:"select",label:"Select",order:600},{type:"multiSelect",label:"Multi select",order:700},{type:"selectButton",label:"Select button",order:800},{type:"radio",label:"Radio",order:900},{type:"checkbox",label:"Checkbox group",order:1e3},{type:"singleCheckbox",label:"Single checkbox",order:1100},{type:"toggleSwitch",label:"Toggle switch",order:1200},{type:"slider",label:"Slider",order:1300},{type:"datepicker",label:"Date picker",order:1400},{type:"dateRange",label:"Date range",order:1500},{type:"timePicker",label:"Time picker",order:1600},{type:"button",label:"Button",order:1700},{type:"badge",label:"Badge",order:1800},{type:"image",label:"Image",order:1900},{type:"progressBar",label:"Progress bar",order:2e3},{type:"fileUpload",label:"File upload",order:2100},{type:"customHtml",label:"Custom HTML",order:2200},{type:"richTextViewer",label:"HTML viewer",order:2300}];var We=class At{registeredTypes=new Map;onRegistryChanged=new v;register(e){if(!this.registerInternal(e))return;this.onRegistryChanged.fire(void 0)}registerMany(e){if(!Array.isArray(e)||e.length===0)return;let t=false;e.forEach(r=>{t=this.registerInternal(r)||t});if(t)this.onRegistryChanged.fire(void 0)}remove(e){const t=String(e??"").trim();if(!t||!this.registeredTypes.delete(t))return;this.onRegistryChanged.fire(void 0)}reset(){if(this.registeredTypes.size===0)return;this.registeredTypes.clear();this.onRegistryChanged.fire(void 0)}getTypes(){const e=new Map;hr.forEach(t=>{e.set(t.type,{...t})});this.registeredTypes.forEach((t,r)=>{const n=e.get(r);e.set(r,{...t,order:t.order??n?.order??1e4})});return Array.from(e.values()).sort((t,r)=>{const n=(t.order??0)-(r.order??0);return n!==0?n:t.label.localeCompare(r.label)})}supports(e){const t=String(e??"").trim();if(!t)return false;return this.getTypes().some(r=>r.type===t)}registerInternal(e){const t=this.normalizeEntry(e);if(!t)return false;const r=this.registeredTypes.get(t.type);if(r&&r.label===t.label&&(r.order??null)===(t.order??null))return false;this.registeredTypes.set(t.type,t);return true}normalizeEntry(e){if(typeof e==="string"){const n=e.trim();return n?{type:n,label:n}:null}const t=String(e?.type??"").trim();if(!t)return null;const r=Number(e?.order);return{type:t,label:String(e?.label??"").trim()||t,order:Number.isFinite(r)?r:void 0}}static ɵfac=h.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:At,deps:[],target:h.ɵɵFactoryTarget.Injectable});static ɵprov=h.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:At,providedIn:"root"})};h.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:We,decorators:[{type:A,args:[{providedIn:"root"}]}]});var Ue=class Ct{extensionTabs=E([],...ngDevMode?[{debugName:"extensionTabs"}]:[]);get tabs(){return this.extensionTabs.asReadonly()}registerTabs(e){if(!Array.isArray(e)||e.length===0)return;const t=new Map(this.extensionTabs().map(r=>[String(r.id??"").trim(),r]));e.forEach(r=>{const n=String(r?.id??"").trim();if(!n||!r?.component)return;t.set(n,{...r,id:n,label:String(r.label??n).trim()||n})});this.extensionTabs.set(Array.from(t.values()).sort((r,n)=>(r.order??Number.MAX_SAFE_INTEGER)-(n.order??Number.MAX_SAFE_INTEGER)))}getTab(e){const t=String(e??"").trim();if(!t)return null;return this.extensionTabs().find(r=>r.id===t)??null}static ɵfac=h.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:Ct,deps:[],target:h.ɵɵFactoryTarget.Injectable});static ɵprov=h.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:Ct,providedIn:"root"})};h.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:Ue,decorators:[{type:A,args:[{providedIn:"root"}]}]});var Y=class _t{dataService=g(M);elementActionService=g(Q);eventService=g(be);expressionService=g(D);runtimeVariablesService=g(G);structureService=g(R);injector=g(ne);async executeActions(e,t){const r=Array.isArray(e)?e:[];for(const n of r)await this.executeAction(n,t)}async executeAction(e,t){if(!e)return true;const r=String(e.type??"").trim();const n=this.resolveElement(String(e.targetElement??t?.["targetElement"]??""));const i=this.dataService.buildRuntimeContext({...t??{},targetElement:n?.name??null,targetElementDataPath:n?.dataPath??null});const s=String(e.condition??"").trim();if(s)try{if(!!!this.expressionService.runPropertyConditionSync(i,s))return true}catch{return false}if(r==="navigate"||r==="dataSource"||r==="toast"||r==="dialog")return await this.elementActionService.runAction(n,e,i);switch(r){case"setValue":return await this.executeSetValue(e,i);case"setElementProperty":return this.executeSetElementProperty(e,i);case"refreshRuntimeVariables":this.runtimeVariablesService.refresh();return true;case"transitionProcess":return await this.getProcessService().transition(String(e.processTransitionId??"").trim(),i);case"setProcessState":return await this.getProcessService().setCurrentState(String(e.processState??"").trim(),i);default:return false}}async executeSetValue(e,t){const r=String(e.dataPath??"").trim();const n=this.resolveElement(String(e.targetElement??"").trim());const i=r||String(n?.dataPath??"").trim();if(!i)return false;const s=this.resolveActionValue(e,t,n);await this.dataService.setValue(i,s,{trigger:"programmatic"});return true}executeSetElementProperty(e,t){const r=String(e.propertyKey??"").trim();const n=this.resolveElement(String(e.targetElement??"").trim());if(!r||!n)return false;const i=n[r];const s=this.resolveActionValue(e,t,n);this.structureService.onElementChanging.fire({schemaPath:String(n.schemaPath??n.dataPath??n.name??""),key:r,newValue:s,oldValue:i,sender:n});n[r]=s;this.structureService.onElementChanged.fire({schemaPath:String(n.schemaPath??n.dataPath??n.name??""),key:r,newValue:s,sender:n});this.eventService.afterPropertyChanged.fire({payload:null});return true}resolveActionValue(e,t,r){const n=String(e.valueExpression??"").trim();if(n)try{return this.expressionService.runPropertyConditionSync(t,n)}catch{return this.expressionService.evaluateInlineExpression(n,r)}return e.value}resolveElement(e){const t=String(e??"").trim();if(!t)return null;const r=this.structureService.flatModelMap??{};const n=r[t];if(n&&typeof n==="object")return n;return Object.values(r).find(i=>{if(!i||typeof i!=="object")return false;const s=i;return String(s.name??"").trim()===t||String(s.dataPath??"").trim()===t||String(s.schemaPath??"").trim()===t})??null}getProcessService(){return this.injector.get(pe)}static ɵfac=h.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:_t,deps:[],target:h.ɵɵFactoryTarget.Injectable});static ɵprov=h.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:_t,providedIn:"root"})};h.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:Y,decorators:[{type:A,args:[{providedIn:"root"}]}]});var pe=class Vt{dataService=g(M);expressionService=g(D);runtimeVariablesService=g(G);structureService=g(R);injector=g(ne);registeredProcess=null;registerProcess(e){this.registeredProcess=e?b(e):null;this.ensureInitialized()}getCurrentStateId(){const e=this.getActiveProcess();if(!e)return null;const t=this.getProcessDataPath(e);const r=String(this.dataService.getValue(t)??"").trim();if(r){this.publishProcessContext(e,r);return r}const n=String(e.initialState??"").trim()||String(e.states?.[0]?.id??"").trim();if(!n)return null;this.setCurrentState(n);return n}getCurrentState(){const e=this.getActiveProcess();const t=this.getCurrentStateId();if(!e||!t)return null;return e.states?.find(r=>String(r?.id??"").trim()===t)??null}getAvailableTransitions(){const e=this.getActiveProcess();const t=this.getCurrentStateId();if(!e||!t)return[];return this.getAvailableTransitionsForState(e,t)}ensureInitialized(){const e=this.getActiveProcess();if(!e){this.runtimeVariablesService.setExternalVariables({process:null},true);return}const t=this.getCurrentStateId();if(!t)return;this.publishProcessContext(e,t)}async setCurrentState(e,t){const r=this.getActiveProcess();const n=String(e??"").trim();if(!r||!n)return false;const i=this.resolveState(r,n);if(!i)return false;await this.dataService.setValue(this.getProcessDataPath(r),n,{trigger:"programmatic"});this.publishProcessContext(r,n);if(i.readonly===true)this.runtimeVariablesService.setExternalVariables({processReadonly:true},true);else this.runtimeVariablesService.setExternalVariables({processReadonly:false},true);if(t)this.runtimeVariablesService.setExternalVariables({processContext:b(t)},true);return true}async transition(e,t){const r=this.getActiveProcess();const n=String(e??"").trim();const i=this.getCurrentStateId();if(!r||!n||!i)return false;const s=(r.transitions??[]).find(c=>String(c?.id??"").trim()===n);if(!s||!this.isTransitionAllowedFromState(s,i))return false;const a=this.buildRuntimeContext(r,i,{...t??{},transition:s});const o=String(s.condition??"").trim();if(o)try{if(!!!this.expressionService.runPropertyConditionSync(a,o))return false}catch{return false}if(!await this.setCurrentState(s.to,{...t??{},transition:s}))return false;const l=Array.isArray(s.actions)?s.actions:[];if(l.length>0)await this.getActionExecutor().executeActions(l,{...t??{},process:r,processState:s.to,processTransition:s});return true}getActiveProcess(){const e=(this.structureService.getStructure()??this.structureService.getPreviewStructure()??null)?.settings?.process;return b(e??this.registeredProcess??null)}getProcessDataPath(e){return String(e.dataPath??"__process.currentState").trim()||"__process.currentState"}resolveState(e,t){return e.states?.find(r=>String(r?.id??"").trim()===t)??null}isTransitionAllowedFromState(e,t){const r=Array.isArray(e.from)?e.from.map(n=>String(n??"").trim()).filter(Boolean):[];if(r.length===0)return true;return r.includes(t)}publishProcessContext(e,t){const r=this.resolveState(e,t);this.runtimeVariablesService.setExternalVariables({process:{id:e.id,title:e.title??"",currentState:t,state:r,availableTransitions:this.getAvailableTransitionsForState(e,t).map(n=>({id:n.id,label:n.label??n.id,to:n.to}))}},true)}getAvailableTransitionsForState(e,t){return(e.transitions??[]).filter(r=>this.isTransitionAllowedFromState(r,t))}buildRuntimeContext(e,t,r){const n={process:{id:e.id,title:e.title??"",currentState:t,state:this.resolveState(e,t)},...r??{}};return this.dataService.buildRuntimeContext(n)}getActionExecutor(){return this.injector.get(Y)}static ɵfac=h.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:Vt,deps:[],target:h.ɵɵFactoryTarget.Injectable});static ɵprov=h.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:Vt,providedIn:"root"})};h.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:pe,decorators:[{type:A,args:[{providedIn:"root"}]}]});var Qe=class Mt{dataService=g(M);expressionService=g(D);actionExecutor=g(Y);structureService=g(R);registeredRules=new Map;isEvaluating=false;onRuleEvaluating=new v;onRuleEvaluated=new v;constructor(){this.dataService.onDataMutated.add(e=>{this.evaluate("change",{dataPath:e.dataPath,newValue:e.newValue,oldValue:e.oldValue,sender:e.sender,trigger:e.trigger})})}registerRules(e){if(!Array.isArray(e))return;e.forEach(t=>{const r=String(t?.id??"").trim();if(!r)return;this.registeredRules.set(r,b(t))})}async evaluate(e="manual",t){if(this.isEvaluating)return;this.isEvaluating=true;try{const r=this.getActiveRules().filter(n=>{if(n.enabled===false)return false;const i=n.runMode??"always";if(i==="always")return true;if(i!==e)return false;if(e==="change"&&Array.isArray(n.watchPaths)&&n.watchPaths.length>0){const s=String(t?.["dataPath"]??"").trim();return n.watchPaths.some(a=>String(a??"").trim()===s)}return true});for(const n of r){const i=Date.now();const s=Array.isArray(n.actions)?n.actions.length:0;const a=Array.isArray(n.otherwiseActions)?n.otherwiseActions.length:0;const o={runMode:e,ruleId:String(n.id??"").trim(),ruleTitle:String(n.title??"").trim()||void 0,rule:b(n),startedAt:i,actionCount:s,otherwiseActionCount:a,runtimeContext:t?{...t}:null};this.onRuleEvaluating.fire(o);const l={...t??{},rule:n,ruleRunMode:e};let c=true;let d=false;const m=String(n.condition??"").trim();if(m)try{c=!!this.expressionService.runPropertyConditionSync(this.dataService.buildRuntimeContext(l),m)}catch{c=false;d=true}if(c){await this.actionExecutor.executeActions(n.actions,l);const p=Date.now();this.onRuleEvaluated.fire({...o,finishedAt:p,durationMs:p-i,executedBranch:"actions",reason:"completed"})}else if(Array.isArray(n.otherwiseActions)&&n.otherwiseActions.length>0){await this.actionExecutor.executeActions(n.otherwiseActions,l);const p=Date.now();this.onRuleEvaluated.fire({...o,finishedAt:p,durationMs:p-i,executedBranch:"otherwise",reason:"conditionFalse"})}else if(d){const p=Date.now();this.onRuleEvaluated.fire({...o,finishedAt:p,durationMs:p-i,executedBranch:"skipped",reason:"conditionError"})}else if(m){const p=Date.now();this.onRuleEvaluated.fire({...o,finishedAt:p,durationMs:p-i,executedBranch:"skipped",reason:"conditionFalse"})}}}finally{this.isEvaluating=false}}getActiveRules(){const e=new Map;this.registeredRules.forEach((r,n)=>{e.set(n,b(r))});const t=this.structureService.getStructure()??this.structureService.getPreviewStructure()??null;(Array.isArray(t?.settings?.rules)?t.settings.rules:[]).forEach(r=>{const n=String(r?.id??"").trim();if(!n)return;e.set(n,b(r))});return Array.from(e.values())}static ɵfac=h.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:Mt,deps:[],target:h.ɵɵFactoryTarget.Injectable});static ɵprov=h.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:Mt,providedIn:"root"})};h.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:Qe,decorators:[{type:A,args:[{providedIn:"root"}]}],ctorParameters:()=>[]});var Ke=class Dt{dataService=g(M);expressionService=g(D);actionExecutor=g(Y);structureService=g(R);registeredTriggers=new Map;onTriggerHandling=new v;onTriggerHandled=new v;constructor(){this.dataService.onValueChanged.add(e=>{this.handleEvent("valueChanged",{dataPath:e.dataPath,newValue:e.newValue,oldValue:e.oldValue,sender:e.sender,trigger:e.trigger})})}registerTriggers(e){if(!Array.isArray(e))return;e.forEach(t=>{const r=String(t?.id??"").trim();if(!r||!t?.event)return;this.registeredTriggers.set(r,b(t))})}async handleEvent(e,t){const r=this.getActiveTriggers().filter(n=>{if(n.enabled===false)return false;if(n.event!==e)return false;if(e==="valueChanged"&&Array.isArray(n.watchPaths)&&n.watchPaths.length>0){const i=String(t?.["dataPath"]??"").trim();return n.watchPaths.some(s=>String(s??"").trim()===i)}return true});for(const n of r){const i=Date.now();const s={eventName:e,triggerId:String(n.id??"").trim(),triggerTitle:String(n.title??"").trim()||void 0,trigger:b(n),startedAt:i,actionCount:Array.isArray(n.actions)?n.actions.length:0,runtimeContext:t?{...t}:null};this.onTriggerHandling.fire(s);const a=String(n.condition??"").trim();const o={eventName:e,trigger:n,...t??{}};if(a)try{if(!!!this.expressionService.runPropertyConditionSync(this.dataService.buildRuntimeContext(o),a)){const c=Date.now();this.onTriggerHandled.fire({...s,finishedAt:c,durationMs:c-i,executed:false,reason:"conditionFalse"});continue}}catch{const c=Date.now();this.onTriggerHandled.fire({...s,finishedAt:c,durationMs:c-i,executed:false,reason:"conditionError"});continue}await this.actionExecutor.executeActions(n.actions,{...o});const l=Date.now();this.onTriggerHandled.fire({...s,finishedAt:l,durationMs:l-i,executed:true,reason:"completed"})}}getActiveTriggers(){const e=new Map;this.registeredTriggers.forEach((r,n)=>{e.set(n,b(r))});const t=this.structureService.getStructure()??this.structureService.getPreviewStructure()??null;(Array.isArray(t?.settings?.triggers)?t.settings.triggers:[]).forEach(r=>{const n=String(r?.id??"").trim();if(!n)return;e.set(n,b(r))});return Array.from(e.values())}static ɵfac=h.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:Dt,deps:[],target:h.ɵɵFactoryTarget.Injectable});static ɵprov=h.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:Dt,providedIn:"root"})};h.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:Ke,decorators:[{type:A,args:[{providedIn:"root"}]}],ctorParameters:()=>[]});const bn=["builderTabs","elementProperties","globalProperties","elements","elementGroups","expressionFunctions","triggers","rules","process","fragments","runtimeVariables","runtimeVariableContext","uiDictionaries","svgIcons"];const mr="templates";var Je=class Rt{registeredFeaturePacks=E([],...ngDevMode?[{debugName:"registeredFeaturePacks"}]:[]);get featurePacks(){return this.registeredFeaturePacks.asReadonly()}registerFeaturePacks(e){if(!Array.isArray(e)||e.length===0)return;const t=new Map(this.registeredFeaturePacks().map(r=>[r.id,r]));e.forEach(r=>{const n=String(r?.id??"").trim();if(!n)return;const i=String(r?.title??"").trim()||n;t.set(n,{id:n,title:i,capabilities:this.resolveCapabilities(r)})});this.registeredFeaturePacks.set(Array.from(t.values()))}hasFeaturePack(e){const t=String(e??"").trim();if(!t)return false;return this.registeredFeaturePacks().some(r=>r.id===t)}hasCapability(e){const t=String(e??"").trim();if(!t)return false;return this.registeredFeaturePacks().some(r=>r.capabilities.includes(t))}resolveCapabilities(e){const t=new Set;(Array.isArray(e?.capabilities)?e.capabilities:[]).forEach(r=>{const n=String(r??"").trim();if(n)t.add(n)});bn.forEach(r=>{if(this.hasContribution(e?.[r]))t.add(r)});if(this.hasTemplatesBuilderTab(e?.["builderTabs"]))t.add(mr);return Array.from(t).sort((r,n)=>r.localeCompare(n))}hasTemplatesBuilderTab(e){if(!Array.isArray(e))return false;return e.some(t=>{if(!t||typeof t!=="object")return false;return String(t["id"]??"").trim().toLowerCase()===mr})}hasContribution(e){if(Array.isArray(e))return e.length>0;if(e&&typeof e==="object")return Object.keys(e).length>0;return Boolean(e)}static ɵfac=h.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:Rt,deps:[],target:h.ɵɵFactoryTarget.Injectable});static ɵprov=h.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:Rt,providedIn:"root"})};h.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:Je,decorators:[{type:A,args:[{providedIn:"root"}]}]});var Ge;(function(u){u["CloseButton"]="close-button";u["Api"]="api"})(Ge||(Ge={}));var Ye;(function(u){u["BeforeRender"]="beforeRender";u["Render"]="render";u["AfterRender"]="afterRender"})(Ye||(Ye={}));var Xe;(function(u){u["ConditionFalse"]="conditionFalse";u["ConditionError"]="conditionError";u["Completed"]="completed"})(Xe||(Xe={}));var et;(function(u){u["Actions"]="actions";u["Otherwise"]="otherwise";u["Skipped"]="skipped"})(et||(et={}));var tt;(function(u){u["Header"]="header";u["Api"]="api"})(tt||(tt={}));var rt;(function(u){u["Host"]="host";u["LocalStorage"]="localStorage";u["DataSource"]="dataSource";u["User"]="user"})(rt||(rt={}));const nt="customElements";const Sn="Custom elements";const it=new Set(["name","type","dataPath","schemaPath","parentElement","parentName","parentPath","parentType","uuid","value"]);const st=new Set(["dynamicTable","dynamicPanel"]);var at=class ve{destroyRef=g(_r);dataService=g(M);dataSourceService=g(O);rendererService=g(he);injector=g(ne);structureRenderer(){return this.builderAdapter?this.rendererService:this.injector.get(He)}structureMigrationService=g(de);expressionService=g(D);structureService=g(R);validatorService=g($);modelService=g(zt);elementDefaultsService=g(Cr);uiTranslationService=g(re);localizationService=g(ce);eventService=g(be);templateEngineService=g(K);iconSvgService=g(F);runtimeVariablesService=g(G);runtimeToastService=g(le);applicationLocaleService=g(Ar);runtimeComponentRegistry=g(Oe);tableCellElementRegistry=g(We);builderTabRegistry=g(Ue);fragmentService=g(qe);processService=g(pe);rulesEngine=g(Qe);triggerEngine=g(Ke);featurePackRegistry=g(Je);currentCssVariables={};currentCustomCss="";currentCustomCssUrls=[];currentThemeMode=null;currentCustomTheme=null;currentDataSourceTypeSettings={};currentAiAssistantConfig={};renderRoot=null;sourceStructureSnapshot=null;lastStructureChangeSnapshot=null;structureChangeScheduled=false;builderAdapter=null;customElementGroups=new Map;customElementDefinitions=new Map;customElementProperties=new Map;globalElementProperties={};tableSettingsStore=new Map;tableFiltersStore=new Map;tableSavedFiltersStore=new Map;pendingElementPropertyChanges=new Map;projectLayers=[...g(wr,{optional:true})??[]];parentNgxViewBuilderApi=g(ve,{optional:true,skipSelf:true});scopedChildApis=[];onValueChanging=new v;onValueChanged=new v;onStructureChanged=new v;onLanguageChanged=new v;onTabChanged=new v;onTabChangeRequested=new v;onCssVariablesChanged=new v;onCustomCssChanged=new v;onCustomCssUrlsChanged=new v;onThemeModeChanged=new v;onCustomThemeChanged=new v;onDataSourceLoading=new v;onDataSourceLoaded=new v;onDataSourceLoadFailed=new v;onDataSourceReloaded=new v;onDataSourceTypeSettingsChanged=new v;onAiAssistantConfigChanged=new v;onCurrentPageChanged=new v;onDialogClosed=new v;onValidated=new v;onValidating=new v;onComplete=new v;onSaveRequested=new v;onBeforeRender=new v;onRender=new v;onAfterRender=new v;onElementRender=new v;onElementAfterRender=new v;onSidebarTemplateSaved=new v;onSidebarGroupSaved=new v;onSidebarGroupDeleted=new v;onSidebarGroupsLoaded=new v;onTemplateSaved=new v;onTemplateDeleted=new v;onTemplatesLoaded=new v;onElementValueChanging=new v;onElementValueChanged=new v;onElementPropertyChanging=new v;onElementPropertyChanged=new v;onDynamicTableRowAdded=new v;onDynamicTableRowRemoved=new v;onDynamicPanelItemAdded=new v;onDynamicPanelItemRemoved=new v;onFileUploadFilesAdded=new v;onFileUploadFileRemoved=new v;onElementTabChanged=new v;onAccordionItemToggled=new v;onTriggerHandling=new v;onTriggerHandled=new v;onRuleEvaluating=new v;onRuleEvaluated=new v;onTableSettingsChanged=new v;onTableSettingsApplied=new v;onTableSettingsSaveRequested=new v;onTableSettingsRequested=new v;onTableFiltersChanged=new v;onTableFiltersApplied=new v;onTableSavedFiltersChanged=new v;onTableSavedFiltersRequested=new v;onTableSavedFilterSaveRequested=new v;onElementDefaultsChanged=new v;constructor(){this.parentNgxViewBuilderApi?.registerScopedChildApi(this);this.destroyRef.onDestroy(()=>{this.parentNgxViewBuilderApi?.unregisterScopedChildApi(this)});this.dataService.onValueChanging.add(e=>{const t=this.resolveMutationEventElement(e.sender,e.dataPath);const r=this.isElementModel(e.sender)?e.sender:t;this.onValueChanging.fire(e);this.parentNgxViewBuilderApi?.onValueChanging.fire(e);const n={elementDataPath:e.dataPath,newValue:e.newValue,oldValue:e.oldValue,sender:r,trigger:e.trigger,element:t,host:t,api:this.createElementApi(e.dataPath,r??t)};this.onElementValueChanging.fire(n);this.parentNgxViewBuilderApi?.onElementValueChanging.fire(n)});this.dataService.onValueChanged.add(e=>{const t=this.resolveMutationEventElement(e.sender,e.dataPath);const r=this.isElementModel(e.sender)?e.sender:t;this.onValueChanged.fire(e);this.parentNgxViewBuilderApi?.onValueChanged.fire(e);const n={elementDataPath:e.dataPath,newValue:e.newValue,oldValue:e.oldValue,sender:r,trigger:e.trigger,element:t,host:t,api:this.createElementApi(e.dataPath,r??t)};this.onElementValueChanged.fire(n);this.parentNgxViewBuilderApi?.onElementValueChanged.fire(n)});this.structureService.onElementChanging.add(e=>{const t=String(e.key??"").trim();const r=this.createElementLookupResult(e.sender);this.pendingElementPropertyChanges.set(this.getElementPropertyChangeCacheKey(e.sender,t),e.oldValue);this.onElementPropertyChanging.fire({propertyKey:t,newValue:e.newValue,oldValue:e.oldValue,elementName:r.elementName||void 0,elementDataPath:r.elementDataPath||void 0,elementSchemaPath:r.elementSchemaPath||void 0,elementType:r.elementType||void 0,elementId:r.elementId,elementTestId:r.elementTestId,element:r.element,host:r.host,elementDom:r.elementDom,dom:r.dom})});this.structureService.onElementChanged.add(e=>{const t=String(e.key??"").trim();const r=this.createElementLookupResult(e.sender);const n=this.getElementPropertyChangeCacheKey(e.sender,t);const i=this.pendingElementPropertyChanges.get(n);this.pendingElementPropertyChanges.delete(n);this.onElementPropertyChanged.fire({propertyKey:t,newValue:e.newValue,oldValue:i,elementName:r.elementName||void 0,elementDataPath:r.elementDataPath||void 0,elementSchemaPath:r.elementSchemaPath||void 0,elementType:r.elementType||void 0,elementId:r.elementId,elementTestId:r.elementTestId,element:r.element,host:r.host,elementDom:r.elementDom,dom:r.dom})});this.dataSourceService.onDataSourceLoading.add(e=>{this.onDataSourceLoading.fire(e)});this.dataSourceService.onDataSourceLoaded.add(e=>{this.onDataSourceLoaded.fire(e)});this.dataSourceService.onDataSourceLoadFailed.add(e=>{this.onDataSourceLoadFailed.fire(e)});this.dataSourceService.onDataSourceReloaded.add(e=>{this.onDataSourceReloaded.fire(e)});this.triggerEngine.onTriggerHandling.add(e=>{this.onTriggerHandling.fire(e)});this.triggerEngine.onTriggerHandled.add(e=>{this.onTriggerHandled.fire(e)});this.rulesEngine.onRuleEvaluating.add(e=>{this.onRuleEvaluating.fire(e)});this.rulesEngine.onRuleEvaluated.add(e=>{this.onRuleEvaluated.fire(e)});this.uiTranslationService.onLanguageChanged.add(e=>{this.onLanguageChanged.fire({language:e.language})});this.eventService.afterPropertyChanged.add(()=>{this.notifyStructureChanged()});this.eventService.onDrop.add(()=>{this.notifyStructureChanged()});this.eventService.onSidebarTemplateSaved.add(e=>{const t=this.normalizeSidebarLibraryItem(e?.payload);if(!t)return;this.onSidebarTemplateSaved.fire({item:t,timestamp:Date.now()});this.onSidebarGroupSaved.fire({group:t,timestamp:Date.now()})});this.eventService.onSidebarGroupDeleted.add(e=>{const t=String(e?.payload?.code??"").trim();if(!t)return;this.onSidebarGroupDeleted.fire({code:t,timestamp:Date.now()})});this.initializeProjectLayers()}attachBuilderAdapter(e){this.builderAdapter=e??null;if(!this.builderAdapter)return;this.builderAdapter.initializeDefaults();this.customElementGroups.forEach(t=>{this.builderAdapter?.registerElementGroup(t)});this.customElementDefinitions.forEach(t=>{this.applyCustomElementToBuilder(t)});this.customElementProperties.forEach((t,r)=>{this.builderAdapter?.registerElementProperties(r,t,true)});if(Object.keys(this.globalElementProperties).length>0)this.builderAdapter.registerGlobalProperties(this.globalElementProperties,true)}isBuilderAttached(){return Boolean(this.builderAdapter)}getBuilderAdapter(){return this.builderAdapter}getTableHeaderCenterExtensions(){const e=[];this.customElementDefinitions.forEach(t=>{if(t.allowInTableHeader)e.push(t)});return e}registerTableCellElementType(e){this.tableCellElementRegistry.register(e)}registerTableCellElementTypes(e){this.tableCellElementRegistry.registerMany(e)}removeTableCellElementType(e){this.tableCellElementRegistry.remove(e)}getTableCellElementTypes(){return this.tableCellElementRegistry.getTypes()}getLanguage(){return String(this.uiTranslationService.getLanguage()??"").trim()}setLanguage(e){const t=String(e??"").trim();if(!t)return;const r=this.uiTranslationService.getLanguage();if(r!==t)this.uiTranslationService.setLanguage(t);const n=this.getMutableStructureSource();let i=r!==t;if(!n?.settings)return;if(n.settings.language!==t){n.settings.language=t;i=true}const s=this.localizationService.ensureLocalization(n);if(!s.languages.includes(t)){s.languages.push(t);i=true}if(!i)return;if(this.shouldRebuildFromStructureSource()){this.setStructure(n);return}this.notifyStructureChanged()}resolveHostLanguage(e){const t=e??{};const r=this.normalizeSupportedLanguages(t.supportedLanguages);const n=this.normalizeLocaleCode(t.fallbackLanguage)||this.normalizeLocaleCode(this.uiTranslationService.getLanguage())||"en";const i=this.toLanguageCode(n)||"en";const s=this.resolveLanguageCandidates(t);const a=s[0]??n;if(r.length===0)return{language:this.toLanguageCode(a)||i,locale:a};return{language:Array.from(new Set([a,...s].map(o=>this.toLanguageCode(o)).filter(o=>Boolean(o)))).find(o=>r.includes(o))??(r.includes(i)?i:r[0]),locale:a}}applyHostLanguage(e){const t=this.resolveHostLanguage(e);this.setLanguage(t.language);if(e?.applyLocale!==false)this.setApplicationLocale(t.locale);return t}startLanguageSync(e){const t=[];const r=e??{};let n="";const i=()=>{const s=this.resolveHostLanguage(r);const a=`${s.language}|${s.locale}|${r.applyLocale!==false}`;if(a===n)return s.language;n=a;this.setLanguage(s.language);if(r.applyLocale!==false)this.setApplicationLocale(s.locale);if(typeof r.onResolved==="function")r.onResolved(s);return s.language};i();if(r.watchSystemLanguage!==false&&typeof window!=="undefined"&&typeof window.addEventListener==="function"){const s=()=>{i()};window.addEventListener("languagechange",s);t.push(()=>{window.removeEventListener("languagechange",s)})}if(r.watchDocumentLanguage!==false&&typeof MutationObserver!=="undefined"&&typeof document!=="undefined"&&Boolean(document.documentElement)){const s=new MutationObserver(a=>{if(a.some(o=>o.type==="attributes"&&o.attributeName==="lang"))i()});s.observe(document.documentElement,{attributes:true,attributeFilter:["lang"]});t.push(()=>{s.disconnect()})}return{refresh:i,stop:()=>{t.splice(0).forEach(s=>{s()})}}}setUiDictionaries(e,t=true){this.uiTranslationService.setDictionaries(e,t)}translateUi(e,t){return this.uiTranslationService.translate(e,t)}setPropertyHints(e){this.uiTranslationService.setPropertyHints(e)}setPropertyTypeHints(e){this.uiTranslationService.setPropertyTypeHints(e)}setCssVariables(e){if(!e||typeof e!=="object")return;const t={};Object.keys(e).forEach(i=>{const s=e[i];if(s===void 0||s===null)return;t[i.startsWith("--")?i:`--${i}`]=String(s)});const r=Object.keys(this.currentCssVariables);const n=Object.keys(t);if(r.length===n.length&&n.every(i=>this.currentCssVariables[i]===t[i]))return;this.currentCssVariables={...t};this.onCssVariablesChanged.fire({cssVariables:t})}getCssVariables(){return{...this.currentCssVariables}}setCustomCss(e){const t=String(e??"");if(this.currentCustomCss===t)return;this.currentCustomCss=t;this.onCustomCssChanged.fire({cssText:t})}getCustomCss(){return this.currentCustomCss}setCustomCssUrls(e){const t=Array.from(new Set((e??[]).map(r=>String(r??"").trim()).filter(r=>r.length>0)));if(t.length===this.currentCustomCssUrls.length&&t.every((r,n)=>this.currentCustomCssUrls[n]===r))return;this.currentCustomCssUrls=[...t];this.onCustomCssUrlsChanged.fire({urls:[...t]})}getCustomCssUrls(){return[...this.currentCustomCssUrls]}setThemeMode(e){const t=e==="light"?"light":"dark";if(this.currentThemeMode===t)return;this.currentThemeMode=t;this.onThemeModeChanged.fire({theme:t})}getThemeMode(){return this.currentThemeMode}setCustomTheme(e){const t=this.normalizeCustomThemeDefinition(e);if(JSON.stringify(this.currentCustomTheme??null)===JSON.stringify(t))return;this.currentCustomTheme=t;this.onCustomThemeChanged.fire({theme:t});if(this.currentThemeMode)this.setCssVariables(this.resolveThemeModeVariables(this.currentThemeMode))}getCustomTheme(){if(!this.currentCustomTheme)return null;return{mergeWithDefaults:this.currentCustomTheme.mergeWithDefaults!==false,shared:{...this.currentCustomTheme.shared??{}},light:{...this.currentCustomTheme.light??{}},dark:{...this.currentCustomTheme.dark??{}}}}setDataSourceTypeSettings(e){const t=this.normalizeDataSourceTypeSettings(e);if(JSON.stringify(this.currentDataSourceTypeSettings)===JSON.stringify(t))return;this.currentDataSourceTypeSettings=t;this.onDataSourceTypeSettingsChanged.fire({settings:this.getDataSourceTypeSettings()})}getDataSourceTypeSettings(){return{enableWebsocket:Boolean(this.currentDataSourceTypeSettings.enableWebsocket)}}setWebsocketAuthorizer(e){this.dataSourceService.setWebsocketAuthorizer(e)}setDefaultDataSources(e,t=false){if(!Array.isArray(e)||e.length===0)return;let r=false;const n=i=>{if(!i)return;const s=Array.isArray(i.dataSources)?[...i.dataSources]:[];const a=new Map(s.map(o=>[String(o?.name??"").trim(),o]));e.forEach(o=>{const l=String(o?.name??"").trim();if(!l||!t&&a.has(l))return;const c={...o,name:l,title:String(o?.title??l).trim()||l,params:{...o?.params??{}}};a.set(l,c);r=true});i.dataSources=Array.from(a.values())};n(this.structureService.getStructure());n(this.structureService.getPreviewStructure());if(r)this.notifyStructureChanged()}setAiAssistantConfig(e){const t=this.normalizeAiAssistantConfig(e);if(JSON.stringify(this.currentAiAssistantConfig)===JSON.stringify(t))return;this.currentAiAssistantConfig=t;this.onAiAssistantConfigChanged.fire({config:this.getAiAssistantConfig()})}getAiAssistantConfig(){return this.normalizeAiAssistantConfig(this.currentAiAssistantConfig)}setContentTranslations(e,t=true){const r=this.getMutableStructureSource();if(!r)return;const n=this.localizationService.ensureLocalization(r);const i=n.texts??{};if(!t){n.texts=this.normalizeTranslations(e);if(this.shouldRebuildFromStructureSource()){this.setStructure(r);return}this.notifyStructureChanged();return}const s=this.normalizeTranslations(e);const a={};Object.keys(i).forEach(o=>{a[o]={...i[o]??{}}});Object.keys(s).forEach(o=>{a[o]={...a[o]??{},...s[o]??{}};if(!n.languages.includes(o))n.languages.push(o)});n.texts=a;if(this.shouldRebuildFromStructureSource()){this.setStructure(r);return}this.notifyStructureChanged()}requestTabChange(e){this.onTabChangeRequested.fire({tab:e})}notifyTabChanged(e){this.onTabChanged.fire({tab:e})}notifyCurrentPageChanged(e,t){this.onCurrentPageChanged.fire({pageIndex:e,pageName:t,currentPageIndex:e,currentPageName:t});this.triggerEngine.handleEvent("pageChanged",{pageIndex:e,pageName:t,currentPageIndex:e,currentPageName:t})}notifyDialogClosed(e,t,r,n="close-button"){this.onDialogClosed.fire({pageIndex:e,pageName:t,currentPageIndex:e,currentPageName:t,dialogTitle:r??null,reason:n,timestamp:Date.now()});this.triggerEngine.handleEvent("dialogClosed",{pageIndex:e,pageName:t,currentPageIndex:e,currentPageName:t,dialogTitle:r??null,reason:n})}notifyValidationResult(e,t){const r={isValid:e,issues:t??[]};this.onValidated.fire(r);this.onValidating.fire(r);this.triggerEngine.handleEvent("validated",r)}showToast(e){this.runtimeToastService.show(e??{})}async validateData(e,t,r){const n=this.parseStructureInput(e);if(!n)return this.createValidationResult(false,[this.createInputValidationIssue("formJson is invalid or incomplete.")],r);const i=this.parseDataInput(t);if(i===null)return this.createValidationResult(false,[this.createInputValidationIssue("dataJson is invalid. Must be a JSON object.")],r);try{this.rendererService.toModel(n);this.dataService.setData(i);this.rendererService.applyInitialData();this.rendererService.applyDependencies();await this.preloadValidationOptionDataSources();await this.evaluateExpressionsForValidation();await this.validatorService.evaluateAllValidators();const s=this.collectValidationIssues(r);return this.createValidationResult(s.length===0,s,r)}catch(s){const a=s instanceof Error?s.message:"Failed to execute validation.";return this.createValidationResult(false,[this.createInputValidationIssue(a)],r)}}notifyComplete(e,t,r){this.onComplete.fire({isValid:e,data:t??{},issues:r??[]});this.triggerEngine.handleEvent("completed",{isValid:e,data:t??{},issues:r??[]})}notifySaveRequested(e="api"){this.notifyStructureChanged();this.onSaveRequested.fire({source:e,timestamp:Date.now()});this.triggerEngine.handleEvent("saveRequested",{source:e,timestamp:Date.now()})}registerRenderRoot(e){this.renderRoot=e;this.runtimeToastService.setStyleHost(e)}getRenderRoot(){return this.renderRoot}notifyBeforeRender(e){this.onBeforeRender.fire({tab:e,root:this.renderRoot,phase:"beforeRender"});this.triggerEngine.handleEvent("beforeLoad",{tab:e,root:this.renderRoot,phase:"beforeRender"})}notifyRender(e){this.onRender.fire({tab:e,root:this.renderRoot,phase:"render"});this.emitElementRenderLifecycle(e,"render");this.processService.ensureInitialized();this.rulesEngine.evaluate("init",{tab:e,root:this.renderRoot,phase:"render"});this.triggerEngine.handleEvent("onLoad",{tab:e,root:this.renderRoot,phase:"render"})}notifyAfterRender(e){this.onAfterRender.fire({tab:e,root:this.renderRoot,phase:"afterRender"});this.emitElementRenderLifecycle(e,"afterRender");this.triggerEngine.handleEvent("afterLoad",{tab:e,root:this.renderRoot,phase:"afterRender"})}notifyDynamicTableRowAdded(e){this.onDynamicTableRowAdded.fire({...e,timestamp:Date.now()})}notifyDynamicTableRowRemoved(e){this.onDynamicTableRowRemoved.fire({...e,timestamp:Date.now()})}notifyDynamicPanelItemAdded(e){this.onDynamicPanelItemAdded.fire({...e,timestamp:Date.now()})}notifyDynamicPanelItemRemoved(e){this.onDynamicPanelItemRemoved.fire({...e,timestamp:Date.now()})}notifyFileUploadFilesAdded(e){this.onFileUploadFilesAdded.fire({...e,timestamp:Date.now()})}notifyFileUploadFileRemoved(e){this.onFileUploadFileRemoved.fire({...e,timestamp:Date.now()})}notifyElementTabChanged(e){this.onElementTabChanged.fire({...e,timestamp:Date.now()})}notifyAccordionItemToggled(e){this.onAccordionItemToggled.fire({...e,timestamp:Date.now()})}setStructure(e){const t=this.structureMigrationService.migrate(e);if(!t)return;this.captureStructureSource(t);const r=this.ensureRuntimeVariableDefinitions(t);this.builderAdapter?.syncStructure(t);this.structureRenderer().toModel(t);this.runtimeVariablesService.setMappings(r.definitions);this.processService.ensureInitialized();this.rulesEngine.evaluate("init",{structure:t});this.notifyStructureChanged()}getStructure(){const e=this.getStructureSourceValue();if(e)return e;const t=this.getCurrentStructureModel();if(!t)return null;return this.rendererService.toObject(t)}getStructureModel(){return this.getCurrentStructureModel()??null}updateStructure(e){const t=this.getMutableStructureSource();if(!t||typeof e!=="function")return false;e(t);if(this.shouldRebuildFromStructureSource()){this.setStructure(t);return true}this.notifyStructureChanged();return true}getSettings(){const e=this.getStructure();if(!e?.settings)return null;return{...e.settings}}getSetting(e){const t=this.getMutableStructureSource();if(!t?.settings)return;const r=String(e??"").trim();if(!r)return;return x(t.settings,r)}setSetting(e,t){const r=this.getStructureModel();const n=String(e??"").trim();if(!r||!n)return false;const i=this.ensureStructureSettingsModel(r);const s=x(i,n);if(k(s,t))return true;ie(i,n,t);if(this.shouldRebuildFromStructureSource()){this.setStructure(r);return true}this.notifyStructureChanged();return true}patchSettings(e){const t=this.getMutableStructureSource();if(!t||!e||typeof e!=="object")return false;const r=this.ensureStructureSettingsModel(t);let n=false;Object.entries(e).forEach(([i,s])=>{const a=String(i??"").trim();if(!a)return;const o=x(r,a);if(k(o,s))return;ie(r,a,s);n=true});if(!n)return true;if(this.shouldRebuildFromStructureSource()){this.setStructure(t);return true}this.notifyStructureChanged();return true}replaceSettings(e){const t=this.getMutableStructureSource();if(!t||!e)return false;t.settings={...e};if(this.shouldRebuildFromStructureSource()){this.setStructure(t);return true}this.notifyStructureChanged();return true}updateSettings(e){const t=this.getMutableStructureSource();if(!t||typeof e!=="function")return false;e(this.ensureStructureSettingsModel(t));if(this.shouldRebuildFromStructureSource()){this.setStructure(t);return true}this.notifyStructureChanged();return true}setData(e){const t=this.resolveScopedChildApi();if(t){t.setData(e);return}this.dataService.setData(e)}getData(){const e=this.resolveScopedChildApi();if(e)return e.getData();return this.dataService.getData()}setTableSettings(e,t,r){const n=this.resolveScopedChildApi();if(n){n.setTableSettings(e,t,r);return}const i=String(e??"").trim();const s=String(r?.elementName??i).trim();const a=String(r?.tableName??i).trim();const o=this.normalizeTableSettings(t);if(!i&&!s&&!a)return;if(i)this.tableSettingsStore.set(i,o);if(s)this.tableSettingsStore.set(s,o);if(a)this.tableSettingsStore.set(a,o);const l={tableName:a,elementName:s,settings:this.cloneTableSettings(o),source:r?.source??"host"};this.onTableSettingsChanged.fire(l);this.parentNgxViewBuilderApi?.onTableSettingsChanged.fire({...l,settings:this.cloneTableSettings(l.settings)});const c={tableName:a,elementName:s,settings:this.cloneTableSettings(o),source:r?.source??"host"};this.onTableSettingsApplied.fire(c);this.parentNgxViewBuilderApi?.onTableSettingsApplied.fire({...c,settings:this.cloneTableSettings(c.settings)})}getTableSettings(e){const t=this.resolveScopedChildApi();if(t)return t.getTableSettings(e);const r=String(e??"").trim();if(!r)return null;const n=this.tableSettingsStore.get(r);return n?this.cloneTableSettings(n):null}requestTableSettings(e,t,r){const n={tableName:String(e??"").trim(),elementName:String(t??"").trim(),currentSettings:this.cloneTableSettings(r)};this.onTableSettingsRequested.fire(n);this.parentNgxViewBuilderApi?.onTableSettingsRequested.fire({...n,currentSettings:this.cloneTableSettings(n.currentSettings)})}setTableFilters(e,t,r){const n=this.resolveScopedChildApi();if(n){n.setTableFilters(e,t,r);return}const i=String(e??"").trim();const s=String(r?.elementName??i).trim();const a=String(r?.tableName??i).trim();const o=this.cloneTableFilters(t);const l=this.normalizeTableSavedFilter(r?.savedFilter??null);if(!i&&!s&&!a)return;if(i)this.tableFiltersStore.set(i,o);if(s)this.tableFiltersStore.set(s,o);if(a)this.tableFiltersStore.set(a,o);const c={tableName:a,elementName:s,filters:this.cloneTableFilters(o),source:r?.source??"host",savedFilter:l?this.cloneTableSavedFilter(l):null};this.onTableFiltersChanged.fire(c);this.parentNgxViewBuilderApi?.onTableFiltersChanged.fire({...c,filters:this.cloneTableFilters(c.filters),savedFilter:c.savedFilter?this.cloneTableSavedFilter(c.savedFilter):null});const d={tableName:a,elementName:s,filters:this.cloneTableFilters(o),source:r?.source??"host",savedFilter:l?this.cloneTableSavedFilter(l):null};this.onTableFiltersApplied.fire(d);this.parentNgxViewBuilderApi?.onTableFiltersApplied.fire({...d,filters:this.cloneTableFilters(d.filters),savedFilter:d.savedFilter?this.cloneTableSavedFilter(d.savedFilter):null})}getTableFilters(e){const t=this.resolveScopedChildApi();if(t)return t.getTableFilters(e);const r=String(e??"").trim();if(!r)return null;const n=this.tableFiltersStore.get(r);return n?this.cloneTableFilters(n):null}setTableSavedFilters(e,t,r){const n=this.resolveScopedChildApi();if(n){n.setTableSavedFilters(e,t,r);return}const i=String(e??"").trim();const s=String(r?.elementName??i).trim();const a=String(r?.tableName??i).trim();const o=this.normalizeTableSavedFilters(t);if(!i&&!s&&!a)return;if(i)this.tableSavedFiltersStore.set(i,o);if(s)this.tableSavedFiltersStore.set(s,o);if(a)this.tableSavedFiltersStore.set(a,o);const l={tableName:a,elementName:s,filters:this.cloneTableSavedFilters(o),source:r?.source??"host"};this.onTableSavedFiltersChanged.fire(l);this.parentNgxViewBuilderApi?.onTableSavedFiltersChanged.fire({...l,filters:this.cloneTableSavedFilters(l.filters)})}getTableSavedFilters(e){const t=this.resolveScopedChildApi();if(t)return t.getTableSavedFilters(e);const r=String(e??"").trim();if(!r)return null;const n=this.tableSavedFiltersStore.get(r);return n?this.cloneTableSavedFilters(n):null}requestTableSavedFilters(e,t,r){const n={tableName:String(e??"").trim(),elementName:String(t??"").trim(),currentFilters:this.cloneTableSavedFilters(r)};this.onTableSavedFiltersRequested.fire(n);this.parentNgxViewBuilderApi?.onTableSavedFiltersRequested.fire({...n,currentFilters:this.cloneTableSavedFilters(n.currentFilters)})}requestTableSavedFilterSave(e,t,r,n){const i=this.normalizeTableSavedFilter(r);if(!i)return;const s={tableName:String(e??"").trim(),elementName:String(t??"").trim(),filter:this.cloneTableSavedFilter(i),currentFilters:this.cloneTableSavedFilters(n)};this.onTableSavedFilterSaveRequested.fire(s);this.parentNgxViewBuilderApi?.onTableSavedFilterSaveRequested.fire({...s,filter:this.cloneTableSavedFilter(s.filter),currentFilters:this.cloneTableSavedFilters(s.currentFilters)})}requestTableSettingsSave(e,t,r){const n={tableName:String(e??"").trim(),elementName:String(t??"").trim(),settings:this.cloneTableSettings(r)};this.onTableSettingsSaveRequested.fire(n);this.parentNgxViewBuilderApi?.onTableSettingsSaveRequested.fire({...n,settings:this.cloneTableSettings(n.settings)})}markPristine(){this.dataService.markPristine()}isDirty(){return this.dataService.isDirty()}registerScopedChildApi(e){if(this.scopedChildApis.includes(e))return;this.scopedChildApis=[...this.scopedChildApis,e]}unregisterScopedChildApi(e){this.scopedChildApis=this.scopedChildApis.filter(t=>t!==e)}resolveScopedChildApi(){if(this.parentNgxViewBuilderApi)return null;return this.scopedChildApis.at(-1)??null}async reloadDataSource(e,t,r){const n=this.resolveElementModel(e);const i=n&&typeof n==="object"?n:null;let s=String(t??"").trim();if(!s&&i){s=String(i["tableDataSourceName"]??"").trim();if(!s){const o=i["dataSource"];if(o&&typeof o==="object")s=String(o["name"]??"").trim()}if(!s)s=String(i["dataSourceName"]??"").trim()}if(!s)s=i?"":String(e??"").trim();if(!s)return null;const a=this.isElementModel(n)?n:void 0;try{return await P(this.dataSourceService.reloadDataSource$(s,a,r))}catch{return null}}async reloadElementDataSource(e,t){return this.reloadDataSource(e,void 0,t)}async reloadElementsByDataSource(e,t){const r=String(e??"").trim();if(!r)return[];const n=this.resolveDataSourceConsumerElements(r);if(n.length===0){const s=await this.reloadDataSource(r,void 0,t);return s===null?[]:[s]}const i=[];for(const s of n){const a=await this.reloadDataSource(s.name,r,t);if(a!==null)i.push(a)}return i}resolveDataSourceConsumerElements(e){const t=new Map;const r=new WeakSet;const n=new Set(["dataService","modelService","structureService","parentElement","onDataSourceChanged","onOptionChanged","onValueChanging","onValueChanged"]);const i=a=>{if(!a||typeof a!=="object"||r.has(a))return;r.add(a);const o=a;if(this.elementUsesDataSource(o,e)&&this.isElementModel(a)){const l=String(o["name"]??"").trim();if(l)t.set(l,a)}Object.entries(o).forEach(([l,c])=>{if(n.has(l))return;if(Array.isArray(c))c.forEach(i);else if(c&&typeof c==="object")i(c)})};const s=this.structureService.getPreviewStructure()??this.structureService.getStructure();Object.values(s?.elements??{}).forEach(i);return Array.from(t.values())}elementUsesDataSource(e,t){if([e["tableDataSourceName"],e["dataSourceName"],e["columnSettingsDataSourceName"],e["headerMenuDataSourceName"]].some(n=>String(n??"").trim()===t))return true;const r=e["dataSource"];return String(r?.["name"]??"").trim()===t}setRuntimeVariableDefinitions(e,t=true){const r=this.getCurrentStructureModel();if(!r)return;if(!r.settings)r.settings={width:"1182",language:"en"};const n=this.getRuntimeVariableDataSourceNames(r);const i=this.normalizeRuntimeVariableDefinitions(e,n);if(t)r.settings["variables"]=i;else{const a=Array.isArray(r.settings["variables"])?r.settings["variables"]:[];r.settings["variables"]=this.normalizeRuntimeVariableDefinitions([...a,...i],n)}const s=this.normalizeRuntimeVariableDefinitions(Array.isArray(r.settings["variables"])?r.settings["variables"]:[],n);r.settings["variables"]=s;this.runtimeVariablesService.setMappings(s);this.notifyStructureChanged()}getRuntimeVariableDefinitions(){const e=this.getCurrentStructureModel();const t=Array.isArray(e?.settings?.["variables"])?e?.settings?.["variables"]:[];return this.normalizeRuntimeVariableDefinitions(t,this.getRuntimeVariableDataSourceNames(e))}setRuntimeVariableContext(e,t=true){this.runtimeVariablesService.setExternalVariables(e,t)}getRuntimeVariableContext(){return this.runtimeVariablesService.getExternalVariables()}clearRuntimeVariableContext(){this.runtimeVariablesService.clearExternalVariables()}configureRuntimeVariables(e){if(!e||typeof e!=="object")return;if(Array.isArray(e.mappings))this.setRuntimeVariableDefinitions(e.mappings,true);if(e.external&&typeof e.external==="object")this.setRuntimeVariableContext(e.external,e.mergeExternal!==false)}async setValue(e,t){const r=this.resolveScopedChildApi();if(r){await r.setValue(e,t);return}const n=this.dataService.getValue(e);this.dataService.onValueChanging.fire({sender:null,dataPath:e,newValue:t,oldValue:n,trigger:"programmatic"});await Promise.resolve()}setElementValue(e,t){return this.setValue(e,t)}getElementValue(e){const t=this.resolveScopedChildApi();if(t)return t.getElementValue(e);return this.dataService.getValue(e)}setElementErrors(e,t){const r=this.resolveScopedChildApi();if(r)return r.setElementErrors(e,t);const n=this.resolveElementModel(e);if(!this.isElementModel(n))return false;this.validatorService.setExternalElementErrors(n,t);return true}clearElementErrors(e){const t=this.resolveScopedChildApi();if(t)return t.clearElementErrors(e);const r=this.resolveElementModel(e);if(!this.isElementModel(r))return false;this.validatorService.clearExternalElementErrors(r);return true}getElementErrors(e){const t=this.resolveScopedChildApi();if(t)return t.getElementErrors(e);const r=this.resolveElementModel(e);if(!this.isElementModel(r))return[];return Array.isArray(r.errors)?[...r.errors]:[]}setElementsData(e){this.setData(e)}setApplicationLocale(e){if(!this.applicationLocaleService.setLocale(e))return;this.lastStructureChangeSnapshot=null;this.notifyStructureChanged()}getApplicationLocale(){return this.applicationLocaleService.getLocale()}setLocale(e){const t=this.normalizeLocaleCode(e);const r=this.getMutableStructureSource();if(!r?.settings)return;if(String(r.settings.locale??"")===t)return;if(t)r.settings.locale=t;else delete r.settings.locale;if(this.shouldRebuildFromStructureSource()){this.setStructure(r);return}this.notifyStructureChanged()}setTheme(e){if(typeof e==="string"){this.setThemeMode(e);this.setCssVariables(this.resolveThemeModeVariables(e));return}this.setCssVariables(e)}normalizeCustomThemeDefinition(e){if(!e||typeof e!=="object")return null;const t=this.normalizeCssVariablesMap(e.shared);const r=this.normalizeCssVariablesMap(e.light);const n=this.normalizeCssVariablesMap(e.dark);if(Object.keys(t).length===0&&Object.keys(r).length===0&&Object.keys(n).length===0)return null;return{mergeWithDefaults:e.mergeWithDefaults!==false,shared:t,light:r,dark:n}}normalizeCssVariablesMap(e){if(!e||typeof e!=="object")return{};const t={};Object.keys(e).forEach(r=>{const n=e[r];if(n===void 0||n===null)return;t[r.startsWith("--")?r:`--${r}`]=String(n)});return t}resolveThemeModeVariables(e){const t=dr(e);const r=this.currentCustomTheme;if(!r)return t;const n={...r.shared??{}};const i=e==="dark"?{...r.dark??{}}:{...r.light??{}};if(Object.keys(n).length===0&&Object.keys(i).length===0)return t;if(r.mergeWithDefaults===false)return{...n,...i};return{...t,...n,...i}}registerElementGroup(e){const t=String(e?.code??"").trim();const r=String(e?.label??"").trim();if(!t||!r)return;const n={code:t,label:r,icon:String(e?.icon??"extension").trim()||"extension",order:e?.order};this.customElementGroups.set(t,n);this.builderAdapter?.registerElementGroup(n)}registerCustomElements(e){if(!Array.isArray(e)||e.length===0)return;e.forEach(t=>{this.registerCustomElement(t)})}registerCustomElement(e){const t=String(e?.type??"").trim();const r=String(e?.label??"").trim();if(!t||!r)return;const n=String(e?.groupCode??nt).trim();if(!(this.customElementGroups.get(n)??this.builderAdapter?.getElementGroupByCode(n)))this.registerElementGroup({code:n,label:n===nt?Sn:this.toHumanReadableLabel(n),icon:"extension"});const i=e.component??this.runtimeComponentRegistry.getComponent(t)??this.builderAdapter?.getElementComponent(t)??null;if(!i){console.warn(`[NgxViewBuilderApi] Custom element "${t}" has no Angular component.`);return}const s=String(e?.icon??"extension").trim()||"extension";const a={...e,type:t,label:r,icon:s,groupCode:n,component:i,aliases:Array.from(new Set((e?.aliases??[]).map(l=>String(l??"").trim()).filter(l=>l.length>0&&l!==t)))};this.customElementDefinitions.set(t,a);this.runtimeComponentRegistry.registerComponent(t,i);if(a.allowInTableCell)this.tableCellElementRegistry.register({type:t,label:a.label,order:a.order});const o=e?.properties&&typeof e.properties==="object"?this.normalizePropertyMap(e.properties):null;if(o)this.customElementProperties.set(t,o);(a.aliases??[]).forEach(l=>{const c=String(l??"").trim();if(c){this.runtimeComponentRegistry.registerComponent(c,i);if(o)this.customElementProperties.set(c,o)}});this.applyCustomElementToBuilder(a)}applyCustomElementToBuilder(e){if(!this.builderAdapter||!e.component)return;this.builderAdapter.registerElement({type:e.type,label:e.label,icon:String(e.icon??"extension").trim()||"extension",groupCode:String(e.groupCode??nt).trim(),order:e.order,component:e.component});this.builderAdapter.registerComponent(e.type,e.component);if(e.model)this.builderAdapter.registerModel(e.type,e.model);const t=this.customElementProperties.get(e.type);if(t)this.builderAdapter.registerElementProperties(e.type,t,true);(e.aliases??[]).forEach(r=>{const n=String(r??"").trim();if(!n)return;this.builderAdapter?.registerComponent(n,e.component);if(e.model)this.builderAdapter?.registerModel(n,e.model);const i=this.customElementProperties.get(n);if(i)this.builderAdapter?.registerElementProperties(n,i,true)})}registerElementProperties(e,t,r=true){const n=String(e??"").trim();if(!n)return;const i=this.normalizePropertyMap(t);const s={...r?this.customElementProperties.get(n)??{}:{},...i};this.customElementProperties.set(n,s);this.builderAdapter?.registerElementProperties(n,i,r)}registerElementPropertiesMap(e,t=true){if(!e||typeof e!=="object")return;Object.keys(e).forEach(r=>{this.registerElementProperties(r,e[r]??{},t)})}registerGlobalElementProperties(e,t=true){const r=this.normalizePropertyMap(e);this.globalElementProperties=t?{...this.globalElementProperties,...r}:r;this.builderAdapter?.registerGlobalProperties(r,t)}registerExpressionFunctions(e){this.expressionService.registerCustomFunctions(e??[])}registerExpressionFunction(e){if(!e)return;this.expressionService.registerCustomFunctions([e])}registerValidatorTypes(e){this.validatorService.registerValidatorTypes(e??[])}registerValidatorType(e){if(!e)return;this.validatorService.registerValidatorType(e)}getRegisteredValidatorTypes(){return this.validatorService.getRegisteredValidatorTypes()}clearRegisteredValidatorTypes(){this.validatorService.clearRegisteredValidatorTypes()}registerSvgIcon(e,t,r=true){return this.iconSvgService.registerSvgIcon(e,t,r)}registerSvgIcons(e,t=true){return this.iconSvgService.registerSvgIcons(e,t)}clearRegisteredSvgIcons(){this.iconSvgService.clearRegisteredSvgIcons()}async registerSvgIconDirectory(e){const t=await this.iconSvgService.registerSvgIconDirectory(e);return{loaded:[...t.loaded??[]],failed:[...t.failed??[]]}}async registerSvgIconDirectories(e){if(!Array.isArray(e)||e.length===0)return[];return await Promise.all(e.map(t=>this.registerSvgIconDirectory(t)))}registerExtensions(e){if(!e||typeof e!=="object")return;const t=this.normalizeExtensionsConfig(e);this.registerConfiguredSvgIcons(t);this.registerConfiguredDictionaries(t);this.registerConfiguredElementGroups(t);this.registerConfiguredCustomElements(t);this.registerConfiguredGlobalProperties(t);this.registerConfiguredElementProperties(t);this.registerConfiguredExpressionFunctions(t);this.registerConfiguredValidatorTypes(t);this.registerConfiguredRuntimeVariables(t);this.registerConfiguredBuilderTabs(t);this.registerConfiguredFeaturePacks(t);this.registerConfiguredTriggers(t);this.registerConfiguredRules(t);this.registerConfiguredProcess(t);this.registerConfiguredFragments(t)}async registerExtensionsAsync(e){if(!e||typeof e!=="object")return;const t=this.normalizeExtensionsConfig(e);await this.registerConfiguredSvgIconsAsync(t);this.registerConfiguredDictionaries(t);this.registerConfiguredElementGroups(t);this.registerConfiguredCustomElements(t);this.registerConfiguredGlobalProperties(t);this.registerConfiguredElementProperties(t);this.registerConfiguredExpressionFunctions(t);this.registerConfiguredValidatorTypes(t);this.registerConfiguredRuntimeVariables(t);this.registerConfiguredBuilderTabs(t);this.registerConfiguredFeaturePacks(t);this.registerConfiguredTriggers(t);this.registerConfiguredRules(t);this.registerConfiguredProcess(t);this.registerConfiguredFragments(t)}registerConfiguredSvgIcons(e){if(e.svgIcons&&typeof e.svgIcons==="object")this.registerSvgIcons(e.svgIcons);if(e.svgIconDirectory)this.registerSvgIconDirectory(e.svgIconDirectory);if(Array.isArray(e.svgIconDirectories)&&e.svgIconDirectories.length>0)this.registerSvgIconDirectories(e.svgIconDirectories)}async registerConfiguredSvgIconsAsync(e){if(e.svgIcons&&typeof e.svgIcons==="object")this.registerSvgIcons(e.svgIcons);const t=[];if(e.svgIconDirectory)t.push(this.registerSvgIconDirectory(e.svgIconDirectory));if(Array.isArray(e.svgIconDirectories)&&e.svgIconDirectories.length>0)t.push(this.registerSvgIconDirectories(e.svgIconDirectories));if(t.length>0)await Promise.all(t)}registerConfiguredDictionaries(e){if(e.uiDictionaries)this.setUiDictionaries(e.uiDictionaries)}registerConfiguredElementGroups(e){if(!Array.isArray(e.elementGroups)||e.elementGroups.length===0)return;e.elementGroups.forEach(t=>{this.registerElementGroup(t)})}registerConfiguredCustomElements(e){if(Array.isArray(e.elements)&&e.elements.length>0)this.registerCustomElements(e.elements)}registerConfiguredGlobalProperties(e){if(!e.globalProperties||typeof e.globalProperties!=="object")return;this.registerGlobalElementProperties(this.normalizePropertyMap(e.globalProperties))}registerConfiguredElementProperties(e){if(!e.elementProperties||typeof e.elementProperties!=="object")return;const t={};Object.keys(e.elementProperties).forEach(r=>{const n=String(r??"").trim();if(!n)return;t[n]=this.normalizePropertyMap(e.elementProperties?.[r]??{})});this.registerElementPropertiesMap(t)}registerConfiguredExpressionFunctions(e){if(Array.isArray(e.expressionFunctions)&&e.expressionFunctions.length>0)this.registerExpressionFunctions(e.expressionFunctions)}registerConfiguredValidatorTypes(e){if(Array.isArray(e.validatorTypes)&&e.validatorTypes.length>0)this.registerValidatorTypes(e.validatorTypes)}registerConfiguredRuntimeVariables(e){if(Array.isArray(e.runtimeVariables))this.setRuntimeVariableDefinitions(e.runtimeVariables,true);if(e.runtimeVariableContext&&typeof e.runtimeVariableContext==="object")this.setRuntimeVariableContext(e.runtimeVariableContext,true)}registerConfiguredBuilderTabs(e){if(!Array.isArray(e.builderTabs)||e.builderTabs.length===0)return;this.builderTabRegistry.registerTabs(e.builderTabs)}registerConfiguredFeaturePacks(e){if(!Array.isArray(e.featurePacks)||e.featurePacks.length===0)return;this.featurePackRegistry.registerFeaturePacks(e.featurePacks)}registerConfiguredTriggers(e){if(!Array.isArray(e.triggers)||e.triggers.length===0)return;this.triggerEngine.registerTriggers(e.triggers)}registerConfiguredRules(e){if(!Array.isArray(e.rules)||e.rules.length===0)return;this.rulesEngine.registerRules(e.rules)}registerConfiguredProcess(e){if(!e.process||typeof e.process!=="object")return;this.processService.registerProcess(e.process)}registerConfiguredFragments(e){if(!Array.isArray(e.fragments)||e.fragments.length===0)return;this.fragmentService.registerFragments(e.fragments)}normalizeExtensionsConfig(e){const t={...e};const r=Array.isArray(e.featurePacks)?e.featurePacks:[];if(r.length===0)return t;const n={...t,elementGroups:[...t.elementGroups??[]],elements:[...t.elements??[]],builderTabs:[...t.builderTabs??[]],triggers:[...t.triggers??[]],rules:[...t.rules??[]],fragments:[...t.fragments??[]],expressionFunctions:[...t.expressionFunctions??[]],validatorTypes:[...t.validatorTypes??[]],runtimeVariables:[...t.runtimeVariables??[]],uiDictionaries:{...t.uiDictionaries??{}},svgIcons:{...t.svgIcons??{}}};r.forEach(i=>{if(!i||typeof i!=="object")return;n.elementGroups?.push(...i.elementGroups??[]);n.elements?.push(...i.elements??[]);n.builderTabs?.push(...i.builderTabs??[]);n.triggers?.push(...i.triggers??[]);n.rules?.push(...i.rules??[]);n.fragments?.push(...i.fragments??[]);n.expressionFunctions?.push(...i.expressionFunctions??[]);n.validatorTypes?.push(...i.validatorTypes??[]);n.runtimeVariables?.push(...i.runtimeVariables??[]);if(i.globalProperties&&typeof i.globalProperties==="object")n.globalProperties={...n.globalProperties??{},...i.globalProperties};if(i.elementProperties&&typeof i.elementProperties==="object")n.elementProperties={...n.elementProperties??{},...i.elementProperties};if(i.runtimeVariableContext&&typeof i.runtimeVariableContext==="object")n.runtimeVariableContext={...n.runtimeVariableContext??{},...i.runtimeVariableContext};if(i.process)n.process=this.cloneUnknown(i.process);if(i.uiDictionaries&&typeof i.uiDictionaries==="object")n.uiDictionaries={...n.uiDictionaries??{},...i.uiDictionaries};if(i.svgIcons&&typeof i.svgIcons==="object")n.svgIcons={...n.svgIcons??{},...i.svgIcons}});return n}setTemplateActionMap(e){this.templateEngineService.setTemplateActionMap(e)}registerTemplateActionDataSource(e,t){this.templateEngineService.registerTemplateActionDataSource(e,t)}getTemplates(){return this.templateEngineService.getTemplates(this.getStructure()??{})}setTemplates(e,t=true){this.loadTemplates(e,t)}loadTemplates(e,t=true){const r=this.getStructure();if(!r)return;const n=this.normalizeApiTemplates(e??[]);const i=t?n:this.mergeTemplatesByName(this.readStructureTemplates(r),n);this.writeStructureTemplates(r,i);this.setStructure(r);this.onTemplatesLoaded.fire({templates:i.map(s=>this.toApiTemplate(s)),replace:t,timestamp:Date.now()})}upsertTemplate(e){this.saveTemplate(e)}saveTemplate(e,t){const r=this.getStructure();if(!r)return;const n=this.normalizeApiTemplate(e);if(!n)return;const i=String(t??"").trim();const s=this.readStructureTemplates(r).filter(o=>{if(i&&o.name===i)return false;return o.name!==n.name});const a=this.sortTemplatesByName([...s,n]);this.writeStructureTemplates(r,a);this.setStructure(r);this.onTemplateSaved.fire({template:this.toApiTemplate(n),previousCode:i||void 0,timestamp:Date.now()})}removeTemplate(e){this.deleteTemplate(e)}deleteTemplate(e){const t=this.getStructure();if(!t)return;const r=String(e??"").trim();if(!r)return;const n=this.readStructureTemplates(t).filter(i=>i.name!==r);this.writeStructureTemplates(t,n);this.setStructure(t);this.onTemplateDeleted.fire({code:r,timestamp:Date.now()})}setSidebarTemplates(e,t=true){this.loadSidebarGroups(e,t)}loadSidebarGroups(e,t=true){const r=(e??[]).map(n=>this.normalizeSidebarLibraryItem(n)).filter(n=>n!==null);this.eventService.onSidebarGroupsSetRequested.fire({payload:{templates:r,replace:t}});this.onSidebarGroupsLoaded.fire({groups:r,replace:t,timestamp:Date.now()})}setSidebarGroups(e,t=true){this.loadSidebarGroups(e,t)}saveSidebarGroup(e,t){const r=this.normalizeSidebarLibraryItem(e);if(!r)return;const n=String(t??"").trim();if(n&&n!==String(r.id??"").trim())this.eventService.onSidebarGroupDeleteRequested.fire({payload:{code:n}});this.eventService.onSidebarGroupsSetRequested.fire({payload:{templates:[r],replace:false}});this.onSidebarGroupSaved.fire({group:r,previousCode:n||void 0,timestamp:Date.now()})}upsertSidebarGroup(e){this.saveSidebarGroup(e)}deleteSidebarGroup(e){const t=String(e??"").trim();if(!t)return;this.eventService.onSidebarGroupDeleteRequested.fire({payload:{code:t}})}removeSidebarGroup(e){this.deleteSidebarGroup(e)}normalizeApiTemplates(e){return(e??[]).map(t=>this.normalizeApiTemplate(t)).filter(t=>t!==null)}normalizeApiTemplate(e){if(!e||typeof e!=="object")return null;const t=e;const r=String(t["code"]??t["name"]??"").trim();if(!r)return null;const n=String(t["title"]??"").trim();const i=String(t["description"]??"").trim();const s=String(t["css"]??"").trim();const a=String(t["requestBodyJson"]??"").trim();const o=String(t["extraJsonSettings"]??"").trim();const l=Array.isArray(t["tags"])?t["tags"].map(d=>String(d??"").trim()).filter(d=>d.length>0):[];const c={...t,name:r,title:n||void 0,description:i||void 0,content:String(t["content"]??""),css:s||void 0,requestBodyJson:a||void 0,extraJsonSettings:o||void 0,tags:l.length>0?l:void 0};delete c["code"];return c}readStructureTemplates(e){const t=e?.settings?.templates;if(!Array.isArray(t))return[];return this.normalizeApiTemplates(t)}writeStructureTemplates(e,t){if(!e||typeof e!=="object")return;if(!e.settings||typeof e.settings!=="object")e.settings={width:"1182",language:"en"};e.settings.templates=this.sortTemplatesByName(t).map(r=>({...r}))}mergeTemplatesByName(e,t){const r=new Map;e.forEach(n=>{r.set(n.name,n)});t.forEach(n=>{r.set(n.name,n)});return this.sortTemplatesByName(Array.from(r.values()))}sortTemplatesByName(e){return[...e??[]].sort((t,r)=>String(t.name??"").localeCompare(String(r.name??"")))}toApiTemplate(e){const t=String(e?.name??"").trim();return{...e,code:t,name:t,content:String(e?.content??"")}}setUiTranslations(e,t=true){this.setUiDictionaries(e,t)}switchToTab(e){this.requestTabChange(e)}normalizeTableSettings(e){if(!Array.isArray(e))return[];return e.map((t,r)=>{const n=String(t?.key??"").trim();if(!n)return null;const i=Number(t?.order??r);return{key:n,label:String(t?.label??"").trim(),visible:t?.visible!==false,order:Number.isFinite(i)?i:r,width:String(t?.width??"").trim()}}).filter(t=>Boolean(t)).sort((t,r)=>t.order-r.order).map((t,r)=>({...t,order:r}))}cloneTableSettings(e){return this.normalizeTableSettings(e??[])}cloneTableFilters(e){if(!Array.isArray(e))return[];return e.map(t=>this.cloneUnknown(t))}normalizeTableSavedFilter(e){return this.normalizeTableSavedFilters(e?[e]:[])[0]??null}normalizeTableSavedFilters(e){if(!Array.isArray(e))return[];return e.map((t,r)=>{const n=String(t?.id??"").trim()||`saved-filter-${r+1}`;const i=String(t?.name??"").trim();if(!i)return null;return{id:n,name:i,description:String(t?.description??"").trim(),code:String(t?.code??"").trim(),filters:Array.isArray(t?.filters)?[...t.filters]:[]}}).filter(t=>Boolean(t))}cloneTableSavedFilters(e){return this.normalizeTableSavedFilters(e).map(t=>({...t,filters:Array.isArray(t.filters)?[...t.filters]:[]}))}cloneTableSavedFilter(e){const t=this.normalizeTableSavedFilter(e);if(!t)return null;return{...t,filters:Array.isArray(t.filters)?[...t.filters]:[]}}notifyStructureChanged(){if(this.structureChangeScheduled)return;this.structureChangeScheduled=true;setTimeout(()=>{this.structureChangeScheduled=false;this.emitStructureChanged()},0)}emitStructureChanged(){const e=this.getStructureSourceValue();if(e){const s=this.ensureRuntimeVariableDefinitions(e);if(s.changed)this.runtimeVariablesService.setMappings(s.definitions,false);const a=JSON.stringify(e);if(a===this.lastStructureChangeSnapshot)return;this.lastStructureChangeSnapshot=a;this.processService.ensureInitialized();this.onStructureChanged.fire({structure:this.cloneUnknown(e)});return}const t=this.getCurrentStructureModel();if(!t)return;const r=this.ensureRuntimeVariableDefinitions(t);if(r.changed)this.runtimeVariablesService.setMappings(r.definitions,false);const n=this.rendererService.toJson(t);if(n===this.lastStructureChangeSnapshot)return;this.lastStructureChangeSnapshot=n;const i=this.rendererService.toObject(t);this.processService.ensureInitialized();this.onStructureChanged.fire({structure:i})}getElement(e){return this.resolveElementModel(e)}getElementModel(e){return this.resolveElementLookup(e)?.element??null}getElementByDataPath(e){return this.resolveElementByDataPath(e)}getElementBySchemaPath(e){return this.resolveElementBySchemaPath(e)}getElementLookup(e){return this.resolveElementLookup(e)}getRenderedElements(){const e=this.collectRenderedDomEntries();if(e.length>0)return e.map(t=>this.createElementLookupResult(t.element,t.dom,{elementName:t.elementName,elementDataPath:t.elementDataPath}));return this.collectRenderableElements().map(t=>this.createElementLookupResult(t))}getElementName(e){return this.resolveElementLookup(e)?.elementName||null}getElementDataPath(e){return this.resolveElementLookup(e)?.elementDataPath||null}getElementSchemaPath(e){return this.resolveElementLookup(e)?.elementSchemaPath||null}getElementType(e){return this.resolveElementLookup(e)?.elementType||null}getElementId(e){return this.resolveElementLookup(e)?.elementId??null}getElementTestId(e){return this.resolveElementLookup(e)?.elementTestId??null}getElementProperty(e,t){const r=this.resolveScopedChildApi();if(r)return r.getElementProperty(e,t);const n=this.getElementModel(e);const i=String(t??"").trim();if(!n||!i)return;return x(n,i)}setElementProperty(e,t,r){const n=this.resolveScopedChildApi();if(n)return n.setElementProperty(e,t,r);const i=this.getElementModel(e);const s=String(t??"").trim();if(!i||!s)return false;if(!this.applyElementPropertyMutation(i,s,r))return true;this.flushElementPropertyChanges(i,[s]);this.notifyStructureChanged();return true}setElementProperties(e,t){const r=this.resolveScopedChildApi();if(r)return r.setElementProperties(e,t);const n=this.getElementModel(e);if(!n||!t||typeof t!=="object")return false;let i=false;const s=[];Object.entries(t).forEach(([a,o])=>{const l=String(a??"").trim();if(!l)return;if(this.applyElementPropertyMutation(n,l,o)){i=true;s.push(l)}});if(!i)return true;this.flushElementPropertyChanges(n,s);this.notifyStructureChanged();return true}updateElement(e,t){const r=this.resolveScopedChildApi();if(r)return r.updateElement(e,t);const n=this.getElementModel(e);if(!n||typeof t!=="function")return false;t(n);this.notifyStructureChanged();return true}refreshElement(e){const t=this.resolveScopedChildApi();if(t)return t.refreshElement(e);if(!this.getElementModel(e))return false;this.notifyStructureChanged();return true}element(e){const t=this.resolveScopedChildApi();if(t)return t.element(e);return this.createElementApi(e,null)}getElementApi(e){return this.element(e)}describeElement(e,t){const r=this.resolveScopedChildApi();if(r)return r.describeElement(e,t);return me(this.getElementModel(e),t)}clearValue(e,t){const r=this.resolveScopedChildApi();if(r)return r.clearValue(e,t);const n=String(e??"").trim();if(!n)return false;const i=this.resolveElementByDataPath(n);return this.clearValueInternal(n,i,t)}clearValues(e,t){if(!Array.isArray(e))return 0;return e.reduce((r,n)=>this.clearValue(n,t)?r+1:r,0)}clearElementValue(e,t){const r=this.resolveScopedChildApi();if(r)return r.clearElementValue(e,t);const n=this.getElementModel(e);const i=String(n?.dataPath??"").trim()||String(e??"").trim();if(!i)return false;return this.clearValueInternal(i,n,t)}async resetElementValue(e){const t=this.resolveScopedChildApi();if(t)return t.resetElementValue(e);const r=this.getElementModel(e);const n=String(r?.dataPath??"").trim()||String(e??"").trim();if(!n)return false;const i=r?.defaultValue;if(i===void 0||i===null||i==="")return this.clearValueInternal(n,r);await this.setValue(n,b(i));return true}clearData(){const e=this.resolveScopedChildApi();if(e)return e.clearData();this.dataService.setData({});return true}removeElementProperty(e,t){const r=this.resolveScopedChildApi();if(r)return r.removeElementProperty(e,t);const n=this.getElementModel(e);const i=String(t??"").trim();if(!n||!i)return false;if(this.applyElementPropertyRemoval(n,i)){this.flushElementPropertyChanges(n,[i]);this.notifyStructureChanged()}return true}removeElementProperties(e,t){const r=this.resolveScopedChildApi();if(r)return r.removeElementProperties(e,t);const n=this.getElementModel(e);if(!n||!Array.isArray(t))return false;let i=false;const s=[];t.forEach(a=>{const o=String(a??"").trim();if(!o)return;if(this.applyElementPropertyRemoval(n,o)){i=true;s.push(o)}});if(i){this.flushElementPropertyChanges(n,s);this.notifyStructureChanged()}return true}resetElementProperty(e,t){const r=this.resolveScopedChildApi();if(r)return r.resetElementProperty(e,t);const n=this.getElementModel(e);const i=String(t??"").trim();if(!n||!i)return false;if(this.applyElementPropertyReset(n,i)){this.flushElementPropertyChanges(n,[i]);this.notifyStructureChanged()}return true}resetElementProperties(e,t){const r=this.resolveScopedChildApi();if(r)return r.resetElementProperties(e,t);const n=this.getElementModel(e);if(!n)return false;const i=Array.isArray(t)&&t.length>0?t:Object.keys(this.modelService.getBuiltInDefaults(String(n.type??"").trim())).filter(o=>!it.has(o));let s=false;const a=[];i.forEach(o=>{const l=String(o??"").trim();if(!l||it.has(l))return;if(this.applyElementPropertyReset(n,l)){s=true;a.push(l)}});if(s){this.flushElementPropertyChanges(n,a);this.notifyStructureChanged()}return true}defaults(e,t){if(e!==void 0&&e!==null)this.setElementDefaults(e,t);return this.elementDefaultsService.getAll()}setElementDefaults(e,t){const r=this.elementDefaultsService.set(e,t?.merge!==false);if(r.length===0)return false;if(t?.applyToExisting!==false)this.applyElementDefaultsToStructures(r);this.emitElementDefaultsChanged(r);return true}setElementTypeDefaults(e,t,r){const n=String(e??"").trim();if(!n)return false;return this.setElementDefaults({[n]:t},r)}setElementTypeDefault(e,t,r,n){const i=String(t??"").trim();if(!i)return false;return this.setElementTypeDefaults(e,{[i]:r},n)}getElementDefaults(e){const t=String(e??"").trim();if(!t)return this.elementDefaultsService.getAll();return this.elementDefaultsService.getForType(t)??{}}getElementTypeBuiltInDefaults(e){return b(this.modelService.getBuiltInDefaults(e))}clearElementDefaults(e){const t=this.elementDefaultsService.clear(e);if(t.length===0)return false;this.emitElementDefaultsChanged(t);return true}applyElementDefaultsToStructures(e){this.applyElementDefaultsToExistingElements(e);this.scopedChildApis.forEach(t=>{t.applyElementDefaultsToExistingElements(e)})}emitElementDefaultsChanged(e){const t={defaults:this.elementDefaultsService.getAll(),changedTypes:[...e]};this.onElementDefaultsChanged.fire(t);this.parentNgxViewBuilderApi?.onElementDefaultsChanged.fire(t)}clearValueInternal(e,t,r){const n=String(e??"").trim();if(!n)return false;const i=this.dataService.getValue(n);if(t)t.value=null;this.dataService.onClearValue.fire({dataPath:n,sender:null,oldValue:i,trigger:"programmatic"});if(t&&r?.clearErrors!==false)this.validatorService.clearExternalElementErrors(t);return true}applyElementPropertyRemoval(e,t){const r=String(t??"").trim();if(!r)return false;const n=e;const i=x(n,r);if(i===void 0&&!Ht(n,r))return false;this.structureService.onElementChanging.fire({schemaPath:String(e.schemaPath??e.dataPath??e.name??""),key:r,newValue:void 0,oldValue:i,sender:e});Rr(n,r);this.structureService.onElementChanged.fire({schemaPath:String(e.schemaPath??e.dataPath??e.name??""),key:r,newValue:void 0,sender:e});return true}applyElementPropertyReset(e,t){const r=String(t??"").trim();if(!r)return false;const n=this.modelService.getBuiltInDefaults(String(e.type??"").trim())[r];if(n===void 0)return this.applyElementPropertyRemoval(e,r);return this.applyElementPropertyMutation(e,r,b(n))}applyElementDefaultsToExistingElements(e){const t=new Set(e.map(s=>String(s??"").trim()));if(t.size===0)return;const r=t.has("*");let n=false;const i=new Map;this.forEachElementModelDeep(s=>{const a=String(s?.type??"").trim();if(!a||!r&&!t.has(a))return;const o=this.elementDefaultsService.getForType(a);if(!o)return;const l=this.modelService.getBuiltInDefaults(a);Object.entries(o).forEach(([c,d])=>{if(it.has(c))return;const m=x(s,c);if(!(m===void 0||k(m,l[c])))return;if(this.applyElementPropertyMutation(s,c,b(d))){n=true;i.set(s,[...i.get(s)??[],c])}})});i.forEach((s,a)=>{this.flushElementPropertyChanges(a,s)});if(n)this.notifyStructureChanged()}forEachElementModelDeep(e){const t=new WeakSet;const r=s=>{if(!s||typeof s!=="object"||t.has(s))return;t.add(s);if(Array.isArray(s)){s.forEach(o=>r(o));return}if(this.isElementModel(s))e(s);const a=s;r(a["columns"]);r(a["template"]);if(a["template"]&&typeof a["template"]==="object")Object.values(a["template"]).forEach(o=>r(o))};Object.values(this.structureService.flatModelMap??{}).forEach(s=>r(s));Object.values(this.getBuilderFlatModelMap()).forEach(s=>r(s));const n=this.structureService.getPreviewStructure()?.elements;if(n&&typeof n==="object")Object.values(n).forEach(s=>r(s));const i=this.structureService.getStructure()?.elements;if(i&&typeof i==="object")Object.values(i).forEach(s=>r(s))}isRepeaterElement(e){return st.has(String(e?.type??"").trim())}resolveRepeaterPath(e){return String(e?.dataPath??e?.name??"").trim()}getRepeaterRows(e){const t=this.resolveRepeaterPath(e);const r=t?this.dataService.getValue(t):void 0;if(Array.isArray(r))return r;return Array.isArray(e?.value)?e.value:[]}resolveRepeaterColumns(e){if(Array.isArray(e?.columns))return e.columns;const t=e?.template;if(t&&typeof t==="object")return Object.values(t);return[]}resolveRepeaterColumn(e,t){const r=String(t??"").trim();if(!r)return null;return this.resolveRepeaterColumns(e).find(n=>String(n?.name??"").trim()===r)??null}buildTemplateInstanceMatcher(e,t){const r=String(e??"").trim();const n=t.map(a=>String(a??"").trim()).filter(a=>a.length>0);if(!r||n.length!==t.length)return null;const i=a=>a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");const s=n.reduce((a,o)=>`${a}\\[(\\d+)\\]\\.${i(o)}`,i(r));return new RegExp(`^${s}$`)}collectTemplateInstanceModels(e,t){const r=this.buildTemplateInstanceMatcher(this.resolveRepeaterPath(e),t);if(!r)return[];const n=this.structureService.flatModelMap??{};return Object.keys(n).filter(i=>r.test(i)).sort((i,s)=>this.compareDataPathIndexes(i,s)).map(i=>n[i]).filter(i=>this.isElementModel(i))}compareDataPathIndexes(e,t){const r=this.extractDataPathIndexes(e);const n=this.extractDataPathIndexes(t);const i=Math.max(r.length,n.length);for(let s=0;s<i;s+=1){const a=(r[s]??-1)-(n[s]??-1);if(a!==0)return a}return e.localeCompare(t)}extractDataPathIndexes(e){return Array.from(String(e??"").matchAll(/\[(\d+)\]/g)).map(t=>Number(t[1]))}buildRowPath(e){const t=String(e??"").trim();if(!t)return[];const r=[];let n="";t.split(".").forEach(i=>{const s=/^([^[\]]+)((?:\[\d+\])*)$/.exec(i);if(!s){n=n?`${n}.${i}`:i;return}const a=s[1];n=n?`${n}.${a}`:a;Array.from(s[2].matchAll(/\[(\d+)\]/g)).forEach(o=>{n=`${n}[${o[1]}]`;r.push({name:a,index:Number(o[1]),dataPath:n})})});return r}buildRepeaterRowSeed(e,t){const r={};this.resolveRepeaterColumns(e).forEach(n=>{const i=String(n?.name??"").trim();if(!i)return;if(st.has(String(n?.type??"").trim())){r[i]=[];return}const s=n?.defaultValue;r[i]=s===void 0||s===null||s===""?void 0:b(s)});if(t&&typeof t==="object")Object.entries(t).forEach(([n,i])=>{r[n]=i});return r}async writeRepeaterRows(e,t){const r=this.resolveRepeaterPath(e);if(!r)return false;await this.setValue(r,t);e.value=t;this.rendererService.applyDependencies();this.rendererService.applyExpressions();this.validatorService.evaluateAllValidators();return true}notifyRepeaterRowChange(e,t,r,n,i){const s={elementName:String(e?.name??""),elementDataPath:this.resolveRepeaterPath(e),elementType:String(e?.type??""),element:e,rowIndex:r,row:n,rows:i,total:i.length};const a=String(e?.type??"").trim()==="dynamicPanel";if(t){if(a)this.notifyDynamicPanelItemAdded(s);else this.notifyDynamicTableRowAdded(s);return}if(a)this.notifyDynamicPanelItemRemoved(s);else this.notifyDynamicTableRowRemoved(s)}createRepeaterApi(e){const t=this;const r=()=>t.getRepeaterRows(e());const n=()=>r().map(s=>({...s??{}}));const i=async(s,a)=>{const o=e();if(!o)return-1;const l=n();const c=Number.isFinite(s)?Math.max(0,Math.min(Math.floor(s),l.length)):l.length;const d=t.buildRepeaterRowSeed(o,a);l.splice(c,0,d);if(!await t.writeRepeaterRows(o,l))return-1;t.notifyRepeaterRowChange(o,true,c,d,l);return c};return{get supported(){return t.isRepeaterElement(e())},count(){return r().length},get(){return n()},async set(s){const a=e();if(!a)return false;const o=Array.isArray(s)?s.filter(l=>l&&typeof l==="object").map(l=>({...l})):[];return t.writeRepeaterRows(a,o)},add(s){return i(Number.POSITIVE_INFINITY,s)},insert(s,a){return i(s,a)},async remove(s){const a=e();if(!a)return false;const o=n();const l=Math.floor(Number(s));if(!Number.isFinite(l)||l<0||l>=o.length)return false;const[c]=o.splice(l,1);if(!await t.writeRepeaterRows(a,o))return false;t.notifyRepeaterRowChange(a,false,l,c??null,o);return true},async move(s,a){const o=e();if(!o)return false;const l=n();const c=Math.floor(Number(s));const d=Math.floor(Number(a));if(!Number.isFinite(c)||!Number.isFinite(d)||c<0||d<0||c>=l.length||d>=l.length||c===d)return false;const[m]=l.splice(c,1);l.splice(d,0,m);return t.writeRepeaterRows(o,l)},async clear(){const s=e();if(!s)return false;return t.writeRepeaterRows(s,[])},at(s){return t.createRepeaterRowApi(e,s)},all(){return r().map((s,a)=>t.createRepeaterRowApi(e,a))}}}createRepeaterRowApi(e,t){const r=this;const n=Math.floor(Number(t));const i=()=>{const a=r.getRepeaterRows(e());if(n<0||n>=a.length)return null;return a[n]??null};const s=async(a,o)=>{const l=e();if(!l||!a||typeof a!=="object")return false;const c=r.getRepeaterRows(l).map(d=>({...d??{}}));if(n<0||n>=c.length)return false;c[n]=o?{...c[n],...a}:{...a};return r.writeRepeaterRows(l,c)};return{get index(){return n},get(){const a=i();return a?{...a}:null},set(a){return s(a,false)},patch(a){return s(a,true)},remove(){return r.createRepeaterApi(e).remove(n)},cell(a){return r.createRepeaterCellApi(e,n,a)}}}createRepeaterCellApi(e,t,r){const n=this.resolveRepeaterPath(e());const i=String(r??"").trim();const s=n?`${n}[${t}].${i}`:"";return this.createElementApi(s,null)}createElementColumnApi(e,t){const r=this;const n=t.map(l=>String(l??"").trim()).filter(l=>l.length>0);const i=n.at(-1)??"";const s=()=>n.reduce((l,c)=>l?r.resolveRepeaterColumn(l,c):null,e());const a=()=>r.collectTemplateInstanceModels(e(),n);const o=(l,c)=>{const d=s();if(!d)return false;const m=[];if(c(d))m.push(d);a().forEach(p=>{if(p===d)return;if(c(p))m.push(p)});if(m.length===0)return true;m.forEach(p=>r.flushElementPropertyChanges(p,l));r.notifyStructureChanged();return true};return{get name(){return i},get exists(){return Boolean(s())},get model(){return s()},get templatePath(){return[...n]},column(l){return r.createElementColumnApi(e,[...n,l])},getProperty(l){const c=s();const d=String(l??"").trim();if(!c||!d)return;return x(c,d)},setProperty(l,c){const d=String(l??"").trim();if(!d)return false;return o([d],m=>r.applyElementPropertyMutation(m,d,b(c)))},setProperties(l){if(!l||typeof l!=="object")return false;return o(Object.keys(l),c=>{let d=false;Object.entries(l).forEach(([m,p])=>{const f=String(m??"").trim();if(!f)return;if(r.applyElementPropertyMutation(c,f,b(p)))d=true});return d})},removeProperty(l){const c=String(l??"").trim();if(!c)return false;return o([c],d=>r.applyElementPropertyRemoval(d,c))},resetProperty(l){const c=String(l??"").trim();if(!c)return false;return o([c],d=>r.applyElementPropertyReset(d,c))},setOptions(l){const c=s();if(!c)return false;r.applyElementOptions(c,l);r.flushElementPropertyChanges(c,["options"]);a().forEach(d=>{if(d===c)return;r.applyElementOptions(d,l);r.flushElementPropertyChanges(d,["options"])});r.notifyStructureChanged();return true},setRequired(l=true){return this.setProperty("required",Boolean(l))},setDisabled(l=true){return this.setProperty("disabled",Boolean(l))},setReadOnly(l=true){return this.setProperty("readOnly",Boolean(l))},setHidden(l=true){return this.setProperty("hidden",Boolean(l))},setLabel(l){return this.setProperty("label",l)},cells(){return a().map(l=>r.createElementApi(l.dataPath??null,l))},instances(){return this.cells()},describe(l){return me(s(),l)}}}applyElementOptions(e,t){if(!e)return false;const r=e;if(typeof r.setOptions==="function")r.setOptions(b(t));else if(Array.isArray(t))r["options"]=b(t);else return false;r.dataSourceLoaded=true;r.afterDataSourceLoad?.fire?.();return true}subscribeToElementValueEvent(e,t,r,n,i){if(typeof n!=="function")return()=>void 0;const s=i?.includeChildren!==false;return e.add(a=>{const o=this.resolveSubscriptionTargetPath(t(),r());if(!this.matchesElementSubscription(a,t(),o,s))return;n(this.createElementValueEventPayload(a,o))})}resolveSubscriptionTargetPath(e,t){const r=String(e?.dataPath??"").trim();if(r)return r;return String(t??"").trim()}matchesElementSubscription(e,t,r,n){const i=String(e?.elementDataPath??"").trim();if(r&&i){if(i===r)return true;if(n&&(i.startsWith(`${r}[`)||i.startsWith(`${r}.`)))return true;return false}const s=String(t?.name??r??"").trim();if(!s)return false;const a=String(e?.element?.name??e?.sender?.name??"").trim();return Boolean(a)&&a===s}createElementValueEventPayload(e,t){const r=e?.element??e?.sender??null;const n=String(e?.elementDataPath??"").trim();return{name:String(r?.name??"").trim()||null,dataPath:n,value:e?.newValue,oldValue:e?.oldValue,trigger:e?.trigger,rowIndex:this.extractRowIndex(n,t,r),indexPath:this.extractDataPathIndexes(n),rowPath:this.buildRowPath(n),element:r,api:e?.api??this.createElementApi(n,r)}}extractRowIndex(e,t,r){if(t&&e.startsWith(`${t}[`)){const n=Number(e.slice(t.length+1).split("]")[0]);if(Number.isFinite(n))return n}return Number.isFinite(r?.index)?Number(r?.index):null}createElementApi(e,t){const r=this;const n=()=>String(t?.dataPath??"").trim()||String(t?.name??"").trim()||String(e??"").trim();const i=()=>t??r.getElementModel(n())??null;const s=(o,l)=>{const c=i();const d=String(o??"").trim();if(!c||!d)return r.setElementProperty(n(),o,l);if(r.applyElementPropertyMutation(c,d,l)){r.flushElementPropertyChanges(c,[d]);r.notifyStructureChanged()}return true};const a=o=>{const l=i();if(!l||!o||typeof o!=="object")return r.setElementProperties(n(),o);let c=false;const d=[];Object.entries(o).forEach(([m,p])=>{const f=String(m??"").trim();if(!f)return;if(r.applyElementPropertyMutation(l,f,p)){c=true;d.push(f)}});if(c){r.flushElementPropertyChanges(l,d);r.notifyStructureChanged()}return true};return{get name(){return String(i()?.name??"").trim()||null},get dataPath(){return String(i()?.dataPath??e??"").trim()},get model(){return i()},get exists(){return Boolean(i())},get type(){return String(i()?.type??"").trim()||null},get rows(){return r.createRepeaterApi(i)},getProperty(o){const l=i();const c=String(o??"").trim();if(!l||!c)return r.getElementProperty(n(),o);return x(l,c)},setProperty(o,l){return s(o,l)},setProperties(o){return a(o)},setLabel(o){return s("label",o)},update(o){const l=i();if(!l)return r.updateElement(n(),o);if(typeof o!=="function")return false;o(l);r.notifyStructureChanged();return true},refresh(){if(!i())return r.refreshElement(n());r.notifyStructureChanged();return true},getValue(){return r.getElementValue(n())},setValue(o){return r.setElementValue(n(),o)},setErrors(o){const l=i();if(!l)return r.setElementErrors(n(),o);r.validatorService.setExternalElementErrors(l,o);return true},clearErrors(){const o=i();if(!o)return r.clearElementErrors(n());r.validatorService.clearExternalElementErrors(o);return true},getErrors(){const o=i();if(!o)return r.getElementErrors(n());return Array.isArray(o.errors)?[...o.errors]:[]},removeProperty(o){const l=i();const c=String(o??"").trim();if(!l||!c)return r.removeElementProperty(n(),o);if(r.applyElementPropertyRemoval(l,c)){r.flushElementPropertyChanges(l,[c]);r.notifyStructureChanged()}return true},removeProperties(o){const l=i();if(!l||!Array.isArray(o))return r.removeElementProperties(n(),o);let c=false;const d=[];o.forEach(m=>{const p=String(m??"").trim();if(!p)return;if(r.applyElementPropertyRemoval(l,p)){c=true;d.push(p)}});if(c){r.flushElementPropertyChanges(l,d);r.notifyStructureChanged()}return true},resetProperty(o){const l=i();const c=String(o??"").trim();if(!l||!c)return r.resetElementProperty(n(),o);if(r.applyElementPropertyReset(l,c)){r.flushElementPropertyChanges(l,[c]);r.notifyStructureChanged()}return true},resetProperties(o){return r.resetElementProperties(n(),o)},setRequired(o=true){return s("required",Boolean(o))},setDisabled(o=true){return s("disabled",Boolean(o))},setReadOnly(o=true){return s("readOnly",Boolean(o))},setHidden(o=true){return s("hidden",Boolean(o))},setOptions(o){const l=i();if(!l)return false;if(!r.applyElementOptions(l,o))return false;r.flushElementPropertyChanges(l,["options"]);r.notifyStructureChanged();return true},clearValue(o){const l=i();const c=String(l?.dataPath??"").trim()||n();if(!c)return false;return r.clearValueInternal(c,l,o)},reset(){return r.resetElementValue(n())},onValueChanged(o,l){return r.subscribeToElementValueEvent(r.onElementValueChanged,i,n,o,l)},onValueChanging(o,l){return r.subscribeToElementValueEvent(r.onElementValueChanging,i,n,o,l)},onPropertyChanged(o){if(typeof o!=="function")return()=>void 0;return r.onElementPropertyChanged.add(l=>{const c=i();const d=String(c?.name??"").trim()||n();const m=String(c?.dataPath??"").trim();const p=String(l?.elementName??"").trim();const f=String(l?.elementDataPath??"").trim();if(!(m?f===m:Boolean(p)&&p===d))return;o({name:p||null,dataPath:f,propertyKey:String(l?.propertyKey??""),value:l?.newValue,oldValue:l?.oldValue,element:l?.element??null})})},column(o){return r.createElementColumnApi(i,[o])},cell(o,l){return r.createRepeaterCellApi(i,o,l)},describe(o){return me(i(),o)}}}getElementDom(e){return this.resolveElementLookup(e)?.elementDom??null}getElementDomById(e){const t=this.renderRoot;const r=String(e??"").trim();if(!t||!r)return null;return t.querySelector(`[id="${this.escapeSelector(r)}"]`)}getElementDomByTestId(e){const t=this.renderRoot;const r=String(e??"").trim();if(!t||!r)return null;return t.querySelector(`[data-testid="${this.escapeSelector(r)}"]`)}queryRenderDom(e){const t=this.renderRoot;const r=String(e??"").trim();if(!t||!r)return null;return t.querySelector(r)}queryRenderDomAll(e){const t=this.renderRoot;const r=String(e??"").trim();if(!t||!r)return[];return Array.from(t.querySelectorAll(r))}ensureStructureSettingsModel(e){if(!e.settings)e.settings={width:"1182",language:this.uiTranslationService.getLanguage()||"en"};return e.settings}applyElementPropertyMutation(e,t,r){const n=String(t??"").trim();if(!n)return false;const i=e;const s=x(i,n);if(k(s,r))return false;this.structureService.onElementChanging.fire({schemaPath:String(e.schemaPath??e.dataPath??e.name??""),key:n,newValue:r,oldValue:s,sender:e});ie(i,n,r);this.structureService.onElementChanged.fire({schemaPath:String(e.schemaPath??e.dataPath??e.name??""),key:n,newValue:r,sender:e});return true}flushElementPropertyChanges(e,t){if(!e||t.length===0)return;const r=String(e.dataPath??e.name??e.schemaPath??"").trim();if(this.isRepeaterRowInstanceModel(e))this.structureService.refreshRowElementReference(e);t.forEach(n=>{const i=String(n??"").trim();if(!i)return;this.eventService.afterPropertyChanged.fire({payload:{elementNameOrPath:r,propertyKey:i,value:x(e,i)}})})}isRepeaterRowInstanceModel(e){const t=String(e?.parentElement?.dataPath??"").trim();const r=String(e?.dataPath??"").trim();if(!t||!r)return false;return st.has(String(e?.parentElement?.type??"").trim())&&r.startsWith(`${t}[`)}getElementPropertyChangeCacheKey(e,t){return`${String(e?.schemaPath??"").trim()||String(e?.dataPath??"").trim()||String(e?.name??"").trim()}::${String(t??"").trim()}`}resolveElementLookup(e){const t=String(e??"").trim();if(!t)return null;const r=this.resolveElementModel(t);if(this.isElementModel(r))return this.createElementLookupResult(r);const n=this.getElementDomById(t)??this.getElementDomByTestId(t);if(!n)return null;const i=this.resolveElementFromDom(n);return this.createElementLookupResult(i,n)}resolveElementFromDom(e){if(!e)return null;const t=String(e.getAttribute("data-nvb-data-path")??"").trim();if(t){const i=this.resolveElementByDataPath(t);if(i)return i}const r=String(e.getAttribute("data-nvb-element-name")??"").trim();if(!r)return null;const n=this.resolveElementModel(r);return this.isElementModel(n)?n:null}createElementLookupResult(e,t,r){const n=e??null;const i=t??(n?this.resolveElementDomByModel(n):null)??null;const s=String(r?.elementName??"").trim()||String(n?.name??"").trim();const a=String(r?.elementDataPath??"").trim()||String(n?.dataPath??"").trim();const o=String(n?.schemaPath??"").trim();const l=String(n?.type??"").trim();const c=String(i?.id??"").trim()||null;const d=String(i?.getAttribute("data-testid")??"").trim()||(s?`nvb-element-${s}`:null);return{key:a||o||s,elementName:s,elementDataPath:a,elementSchemaPath:o,elementType:l,elementId:c,elementTestId:d,element:n,host:n,elementDom:i,dom:i}}parseStructureInput(e){if(!e)return null;if(typeof e==="string")try{const t=JSON.parse(e);return t&&typeof t==="object"?this.structureMigrationService.migrate(t):null}catch{return null}if(typeof e!=="object")return null;return this.structureMigrationService.migrate(e)}parseDataInput(e){if(e===null||e===void 0)return{};if(typeof e==="string")try{const t=JSON.parse(e);if(!t||typeof t!=="object"||Array.isArray(t))return null;return{...t}}catch{return null}if(typeof e!=="object"||Array.isArray(e))return null;return{...e}}async evaluateExpressionsForValidation(){const e=Object.values(this.structureService.flatModelMap??{});for(const t of e)await this.expressionService.evaluateStartingElement(t)}async preloadValidationOptionDataSources(){const e=Object.values(this.structureService.flatModelMap??{}).filter(t=>this.shouldLoadValidationOptionDataSource(t)).map(async t=>{const r=this.resolveOptionDataSourceRef(t);if(!r)return;const n=this.dataSourceService.getSource(String(r.name??""));if(!n)return;r.source=n;try{const i=await P(this.dataSourceService.getData$(r,true,t,void 0,true));this.emitValidationDataSourceChanged(t,n,i)}catch(i){this.emitValidationDataSourceChanged(t,n,[]);console.error(`[NgxViewBuilderApiService] Validation data source "${r.name}" failed.`,i)}});await Promise.all(e)}shouldLoadValidationOptionDataSource(e){if(!e)return false;const t=String(e.type??"").trim().toLowerCase();if(t!=="select"&&t!=="multiselect"&&t!=="radio"&&t!=="checkbox")return false;if(!this.isDataPathMaterialized(e.dataPath))return false;return this.resolveOptionDataSourceRef(e)!==null}resolveOptionDataSourceRef(e){const t=e["dataSource"];if(!t||typeof t!=="object"||Array.isArray(t))return null;const r=t;const n=String(r.name??"").trim();const i=String(r.useFor??"").trim().toLowerCase();if(!n||i!=="option")return null;return r}emitValidationDataSourceChanged(e,t,r){const n=e["onDataSourceChanged"];if(!n||typeof n.fire!=="function")return;n.fire({dataSource:t,result:r})}isDataPathMaterialized(e){if(!e||!e.includes("["))return true;const t=/\[(\d+)\]/g;let r=null;while((r=t.exec(e))!==null){const n=e.slice(0,r.index);const i=Number(r[1]);const s=this.dataService.getValue(n);if(!Array.isArray(s)||s.length<=i)return false}return true}collectValidationIssues(e){const t=Boolean(e?.includeHidden);const r=Boolean(e?.includeDisabled);return Object.values(this.structureService.flatModelMap??{}).filter(n=>{const i=n;if(!i)return false;if(!t&&Boolean(i.hidden))return false;if(!r&&(Boolean(i.disabled)||Boolean(i["__pfInteractionLocked"])))return false;return Array.isArray(i.errors)&&i.errors.length>0}).map(n=>{const i=n;return{elementName:String(i.name??""),dataPath:String(i.dataPath??""),errors:[...i.errors??[]]}})}createValidationResult(e,t,r){const n={isValid:e,issues:t??[]};if(r?.emitValidationEvent!==false)this.notifyValidationResult(n.isValid,n.issues);return n}createInputValidationIssue(e){return{elementName:"$input",dataPath:"",errors:[String(e??"Invalid validation data.")]}}normalizeSidebarLibraryItem(e){if(!e||typeof e!=="object"||Array.isArray(e))return null;const t=e;const r=t["element"];if(!r||typeof r!=="object"||Array.isArray(r))return null;const n=this.cloneUnknown(r);const i=String(n?.["name"]??"").trim();const s=String(t["type"]??"").trim();const a=String(n?.["type"]??"").trim();const o=s||a;if(!o)return null;const l=String(t["label"]??"").trim();const c=String(n?.["label"]??"").trim();const d=l||c||i||this.toHumanReadableLabel(o);const m=String(t["icon"]??"").trim()||this.builderAdapter?.getElementIcon(o,"widgets")||"widgets";const p=String(t["iconSvg"]??"").trim()||this.builderAdapter?.getElementIconSvg(o,"widgets")||"";const f=String(t["id"]??"").trim()||this.createSidebarLibraryItemId();const S=String(t["createdAt"]??"").trim()||new Date().toISOString();const w=t["segmentRows"];const y=t["segmentTabRows"];const T=t["segmentElements"];return{id:f,label:d,type:o,icon:m,iconSvg:p,element:n,segmentRows:Array.isArray(w)?this.cloneUnknown(w):void 0,segmentTabRows:y&&typeof y==="object"&&!Array.isArray(y)?this.cloneUnknown(y):void 0,segmentElements:T&&typeof T==="object"&&!Array.isArray(T)?this.cloneUnknown(T):void 0,createdAt:S}}createSidebarLibraryItemId(){return Lt()}normalizeRuntimeVariableDefinitions(e,t){if(!Array.isArray(e))return[];return e.map(r=>{const n=String(r?.name??"").trim();if(!n)return null;const i=String(r?.sourceType??"").trim().toLowerCase();const s=i==="route"||i==="external"||i==="constant"||i==="expression"?i:i==="datasource"?"dataSource":void 0;const a={name:n,title:String(r?.title??"").trim(),sourceType:s,source:String(r?.source??"").trim(),expression:String(r?.expression??"").trim(),constantValue:r?.constantValue===void 0?void 0:this.cloneUnknown(r.constantValue),fallbackValue:r?.fallbackValue===void 0?void 0:this.cloneUnknown(r.fallbackValue),includeInDataJson:Boolean(r?.includeInDataJson),targetPath:String(r?.targetPath??"").trim(),refreshOnChange:Boolean(r?.refreshOnChange),refreshPaths:Array.isArray(r?.refreshPaths)?Array.from(new Set(r.refreshPaths.map(o=>String(o??"").trim()).filter(o=>Boolean(o)))):[]};if(a.sourceType==="dataSource"&&!a.source)a.source=this.resolveDefaultRuntimeVariableDataSource(n,t);return a}).filter(r=>r!==null)}ensureRuntimeVariableDefinitions(e){if(!e?.settings)return{definitions:[],changed:false};const t=Array.isArray(e.settings["variables"])?e.settings["variables"]:[];const r=this.normalizeRuntimeVariableDefinitions(t,this.getRuntimeVariableDataSourceNames(e));const n=JSON.stringify(t??[])!==JSON.stringify(r??[]);if(n)e.settings["variables"]=r;return{definitions:r,changed:n}}getRuntimeVariableDataSourceNames(e){const t=Array.isArray(e?.dataSources)?e.dataSources:[];const r=new Set;t.forEach(n=>{const i=String(n?.name??"").trim();if(i)r.add(i)});return Array.from(r)}resolveDefaultRuntimeVariableDataSource(e,t){const r=String(e??"").trim();const n=Array.isArray(t)?t:[];if(n.length===0)return"";if(r&&n.includes(r))return r;return n[0]??""}normalizePropertyMap(e){const t={};if(!e||typeof e!=="object")return t;Object.keys(e).forEach(r=>{const n=String(r??"").trim();if(!n)return;const i=e[r];if(!i)return;t[n]=i instanceof Ee?i:new Ee(i)});return t}normalizeDataSourceTypeSettings(e){return{enableWebsocket:Boolean(e?.enableWebsocket)}}normalizeAiAssistantConfig(e){const t=String(e?.backendUrl??"").trim();if(!t)return{};return{backendUrl:t}}cloneUnknown(e){return b(e)}toHumanReadableLabel(e){return String(e??"").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[_\-]+/g," ").trim().replace(/^./,t=>t.toUpperCase())}normalizeTranslations(e){const t={};if(!e||typeof e!=="object")return t;Object.keys(e).forEach(r=>{const n=e[r];if(!n||typeof n!=="object")return;t[r]={};Object.keys(n).forEach(i=>{t[r][i]=String(n[i]??"")})});return t}initializeProjectLayers(){this.projectLayers.filter(e=>this.isProjectLayer(e)).sort((e,t)=>{const r=Number(e.order??0);const n=Number(t.order??0);if(r!==n)return r-n;return String(e.id??"").localeCompare(String(t.id??""))}).forEach(e=>{const t={api:this,layer:e};this.registerProjectLayerExtensions(e);this.bindProjectLayerHandlers(e,t);if(typeof e.setup==="function")Promise.resolve(e.setup(t))})}registerProjectLayerExtensions(e){const t=e.extensions;if(!t)return;const r=typeof t==="function"?t():t;Promise.resolve(r).then(n=>{this.registerExtensionsAsync(n)})}bindProjectLayerHandlers(e,t){if(typeof e.onValueChanging==="function")this.onValueChanging.add(r=>{e.onValueChanging?.(r,t)});if(typeof e.onValueChanged==="function")this.onValueChanged.add(r=>{e.onValueChanged?.(r,t)});if(typeof e.onElementValueChanging==="function")this.onElementValueChanging.add(r=>{e.onElementValueChanging?.(r,t)});if(typeof e.onElementValueChanged==="function")this.onElementValueChanged.add(r=>{e.onElementValueChanged?.(r,t)});if(typeof e.onElementPropertyChanging==="function")this.onElementPropertyChanging.add(r=>{e.onElementPropertyChanging?.(r,t)});if(typeof e.onElementPropertyChanged==="function")this.onElementPropertyChanged.add(r=>{e.onElementPropertyChanged?.(r,t)});if(typeof e.onDataSourceLoading==="function")this.onDataSourceLoading.add(r=>{e.onDataSourceLoading?.(r,t)});if(typeof e.onDataSourceLoaded==="function")this.onDataSourceLoaded.add(r=>{e.onDataSourceLoaded?.(r,t)});if(typeof e.onDataSourceLoadFailed==="function")this.onDataSourceLoadFailed.add(r=>{e.onDataSourceLoadFailed?.(r,t)});if(typeof e.onDataSourceReloaded==="function")this.onDataSourceReloaded.add(r=>{e.onDataSourceReloaded?.(r,t)});if(typeof e.onStructureChanged==="function")this.onStructureChanged.add(r=>{e.onStructureChanged?.(r,t)});if(typeof e.onLanguageChanged==="function")this.onLanguageChanged.add(r=>{e.onLanguageChanged?.(r,t)});if(typeof e.onTabChanged==="function")this.onTabChanged.add(r=>{e.onTabChanged?.(r,t)});if(typeof e.onTabChangeRequested==="function")this.onTabChangeRequested.add(r=>{e.onTabChangeRequested?.(r,t)});if(typeof e.onValidated==="function")this.onValidated.add(r=>{e.onValidated?.(r,t)});if(typeof e.onValidating==="function")this.onValidating.add(r=>{e.onValidating?.(r,t)});if(typeof e.onComplete==="function")this.onComplete.add(r=>{e.onComplete?.(r,t)});if(typeof e.onSaveRequested==="function")this.onSaveRequested.add(r=>{e.onSaveRequested?.(r,t)});if(typeof e.onBeforeRender==="function")this.onBeforeRender.add(r=>{e.onBeforeRender?.(r,t)});if(typeof e.onRender==="function")this.onRender.add(r=>{e.onRender?.(r,t)});if(typeof e.onAfterRender==="function")this.onAfterRender.add(r=>{e.onAfterRender?.(r,t)});if(typeof e.onElementRender==="function")this.onElementRender.add(r=>{e.onElementRender?.(r,t)});if(typeof e.onElementAfterRender==="function")this.onElementAfterRender.add(r=>{e.onElementAfterRender?.(r,t)});if(typeof e.onTriggerHandling==="function")this.onTriggerHandling.add(r=>{e.onTriggerHandling?.(r,t)});if(typeof e.onTriggerHandled==="function")this.onTriggerHandled.add(r=>{e.onTriggerHandled?.(r,t)});if(typeof e.onRuleEvaluating==="function")this.onRuleEvaluating.add(r=>{e.onRuleEvaluating?.(r,t)});if(typeof e.onRuleEvaluated==="function")this.onRuleEvaluated.add(r=>{e.onRuleEvaluated?.(r,t)});if(typeof e.onCurrentPageChanged==="function")this.onCurrentPageChanged.add(r=>{e.onCurrentPageChanged?.(r,t)});if(typeof e.onDialogClosed==="function")this.onDialogClosed.add(r=>{e.onDialogClosed?.(r,t)})}isProjectLayer(e){if(!e||typeof e!=="object")return false;return String(e["id"]??"").trim().length>0}emitElementRenderLifecycle(e,t){const r=this.collectRenderedDomEntries();if(r.length>0){const s=r.length;r.forEach((a,o)=>{const l=this.createElementLookupResult(a.element,a.dom,{elementName:a.elementName,elementDataPath:a.elementDataPath});const c={tab:e,root:this.renderRoot,phase:t,elementName:l.elementName||void 0,elementDataPath:l.elementDataPath||void 0,elementSchemaPath:l.elementSchemaPath||void 0,elementType:l.elementType||void 0,elementId:l.elementId,elementTestId:l.elementTestId,element:l.element,host:l.host,elementDom:l.elementDom,dom:l.dom,index:o,total:s};if(t==="render"){this.onRender.fire(c);this.onElementRender.fire(c);return}this.onAfterRender.fire(c);this.onElementAfterRender.fire(c)});return}const n=this.collectRenderableElements();const i=n.length;n.forEach((s,a)=>{const o=this.createElementLookupResult(s);const l={tab:e,root:this.renderRoot,phase:t,elementName:o.elementName||void 0,elementDataPath:o.elementDataPath||void 0,elementSchemaPath:o.elementSchemaPath||void 0,elementType:o.elementType||void 0,elementId:o.elementId,elementTestId:o.elementTestId,element:o.element,host:o.host,elementDom:o.elementDom,dom:o.dom,index:a,total:i};if(t==="render"){this.onRender.fire(l);this.onElementRender.fire(l);return}this.onAfterRender.fire(l);this.onElementAfterRender.fire(l)})}collectRenderedDomEntries(){const e=this.renderRoot;if(!e)return[];const t=Array.from(e.querySelectorAll("[data-nvb-element-name]"));if(t.length===0)return[];const r=new Set;const n=[];t.forEach((i,s)=>{const a=String(i.getAttribute("data-nvb-element-name")??"").trim();const o=String(i.getAttribute("data-nvb-data-path")??"").trim();if(!a&&!o)return;const l=`${a}|${o}|${s}`;if(r.has(l))return;r.add(l);const c=this.resolveElementModel(a);const d=this.resolveMutationEventElement(void 0,o)??(this.isElementModel(c)?c:null);n.push({element:d,dom:i,elementName:a||String(d?.name??"").trim()||`element-${s+1}`,elementDataPath:o||String(d?.dataPath??"").trim()})});return n}collectRenderableElements(){const e=[...Object.values(this.structureService.flatModelMap??{}),...Object.values(this.getBuilderFlatModelMap())];const t=new Set;const r=[];e.forEach(n=>{if(!this.isElementModel(n))return;const i=String(n.name??"").trim();const s=`${i}|${String(n.dataPath??"").trim()}|${String(n.schemaPath??"").trim()}`;if(!i||t.has(s))return;t.add(s);r.push(n)});return r.sort((n,i)=>`${String(n.schemaPath??"")}|${String(n.dataPath??"")}|${String(n.name??"")}`.localeCompare(`${String(i.schemaPath??"")}|${String(i.dataPath??"")}|${String(i.name??"")}`))}resolveElementDomByModel(e){const t=this.renderRoot;if(!t)return null;const r=String(e?.name??"").trim();const n=String(e?.dataPath??"").trim();const i=[];if(r){i.push(`[data-nvb-element-name="${this.escapeSelector(r)}"]`);i.push(`[data-testid="nvb-element-${this.escapeSelector(r)}"]`);i.push(`[id="${this.escapeSelector(r)}"]`)}if(n)i.push(`[data-nvb-data-path="${this.escapeSelector(n)}"]`);for(const s of i){const a=t.querySelector(s);if(a)return a}return null}resolveMutationEventElement(e,t){if(this.isElementModel(e))return e;const r=String(t??"").trim();if(!r)return null;const n=this.resolveElementModel(r);if(this.isElementModel(n))return n;return this.resolveElementByDataPath(r)}resolveElementByDataPath(e){const t=String(e??"").trim();if(!t)return null;const r=this.normalizeDataPathForLookup(t);const n=this.getBuilderFlatModelMap();const i=[this.structureService.flatModelMap?.[t],n[t],this.structureService.flatModelMap?.[r],n[r]];for(const a of i)if(this.isElementModel(a))return a;const s=[...Object.values(this.structureService.flatModelMap??{}),...Object.values(n)];for(const a of s){if(!this.isElementModel(a))continue;const o=String(a.dataPath??"").trim();if(!o)continue;if(o===t||this.normalizeDataPathForLookup(o)===r)return a}return null}resolveElementBySchemaPath(e){const t=String(e??"").trim();if(!t)return null;const r=[...Object.values(this.structureService.flatModelMap??{}),...Object.values(this.getBuilderFlatModelMap())];for(const n of r){if(!this.isElementModel(n))continue;if(String(n.schemaPath??"").trim()===t)return n}return null}normalizeDataPathForLookup(e){return String(e??"").trim().replace(/\[\d+\]/g,"[0]")}isElementModel(e){if(!e||typeof e!=="object")return false;const t=e;const r=String(t["name"]??"").trim();const n=String(t["type"]??"").trim();return Boolean(r&&n)}resolveElementModel(e){const t=String(e??"").trim();if(!t)return null;const r=this.structureService.flatModelMap?.[t];if(r)return r;const n=this.getBuilderFlatModelMap()[t];if(n)return n;const i=this.structureService.getPreviewStructure()?.elements?.[t];if(i)return i;const s=this.structureService.getStructure()?.elements?.[t];if(s)return s;const a=this.getBuilderStructureModel();const o=this.getStructureElement(a,t);if(o)return o;const l=this.resolveElementByDataPath(t);if(l)return l;const c=this.resolveElementBySchemaPath(t);if(c)return c;return null}getBuilderStructureModel(){return this.builderAdapter?.getStructureModel()??null}getBuilderFlatModelMap(){return this.builderAdapter?.getFlatModelMap()??{}}getStructureSourceValue(){if(this.getBuilderStructureModel())return null;return this.sourceStructureSnapshot?this.cloneUnknown(this.sourceStructureSnapshot):null}getMutableStructureSource(){if(this.getBuilderStructureModel())return this.getCurrentStructureModel();if(this.sourceStructureSnapshot)return this.cloneUnknown(this.sourceStructureSnapshot);const e=this.getCurrentStructureModel();if(!e)return null;return this.rendererService.toObject(e)}shouldRebuildFromStructureSource(){return!this.getBuilderStructureModel()&&Boolean(this.sourceStructureSnapshot)}captureStructureSource(e){this.sourceStructureSnapshot=e?this.cloneUnknown(e):null}clearCapturedStructureSource(){this.sourceStructureSnapshot=null}getCurrentStructureModel(){return this.getBuilderStructureModel()??this.structureService.getPreviewStructure()??this.structureService.getStructure()??null}getStructureElement(e,t){if(!e||typeof e!=="object")return null;const r=e.elements;if(!r||typeof r!=="object")return null;return r[t]??null}escapeSelector(e){return e.replace(/["\\]/g,"\\$&")}resolveLanguageCandidates(e){const t=[];const r=n=>{const i=this.normalizeLocaleCode(n);if(!i||t.includes(i))return;t.push(i)};if(typeof e.hostLanguageResolver==="function")try{r(e.hostLanguageResolver())}catch{}r(e.hostLanguageCode);if(typeof document!=="undefined")r(document.documentElement?.lang);if(typeof navigator!=="undefined"){(navigator.languages??[]).forEach(n=>{r(n)});r(navigator.language)}return t}normalizeSupportedLanguages(e){if(!Array.isArray(e))return[];return Array.from(new Set(e.map(t=>this.toLanguageCode(t)).filter(t=>Boolean(t))))}normalizeLocaleCode(e){const t=String(e??"").trim().replace(/_/g,"-");if(!t)return"";const r=t.split("-").map(s=>s.trim()).filter(s=>Boolean(s));if(r.length===0)return"";const[n,...i]=r;return[n.toLowerCase(),...i.map(s=>{if(s.length===2)return s.toUpperCase();return s})].join("-")}toLanguageCode(e){const t=this.normalizeLocaleCode(e);if(!t)return"";return t.split("-")[0].toLowerCase()}static ɵfac=h.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:ve,deps:[],target:h.ɵɵFactoryTarget.Injectable});static ɵprov=h.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:ve,providedIn:"root"})};h.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:at,decorators:[{type:A,args:[{providedIn:"root"}]}],ctorParameters:()=>[]});var ot=class Pt{name=V("",...ngDevMode?[{debugName:"name"}]:[]);svg=V(null,...ngDevMode?[{debugName:"svg"}]:[]);ariaLabel=V(null,...ngDevMode?[{debugName:"ariaLabel"}]:[]);contentRef=Dr("contentRef",...ngDevMode?[{debugName:"contentRef"}]:[]);iconSvgService=g(F);markupSecurityService=g(I);safeSvg=U(()=>{this.iconSvgService.iconSetVersion();const e=String(this.svg()??"").trim();return e?this.markupSecurityService.sanitizeSvg(e):this.iconSvgService.getSvg(this.name())},...ngDevMode?[{debugName:"safeSvg"}]:[]);constructor(){Mr(()=>{const e=this.contentRef()?.nativeElement;if(!e)return;const t=this.safeSvg();if(e.innerHTML!==t)e.innerHTML=t})}static ɵfac=h.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:Pt,deps:[],target:h.ɵɵFactoryTarget.Component});static ɵcmp=h.ɵɵngDeclareComponent({minVersion:"17.2.0",version:"22.2.1",type:Pt,isStandalone:true,selector:"nvb-icon",inputs:{name:{classPropertyName:"name",publicName:"name",isSignal:true,isRequired:false,transformFunction:null},svg:{classPropertyName:"svg",publicName:"svg",isSignal:true,isRequired:false,transformFunction:null},ariaLabel:{classPropertyName:"ariaLabel",publicName:"ariaLabel",isSignal:true,isRequired:false,transformFunction:null}},host:{properties:{"attr.data-icon":"name()","attr.aria-label":"ariaLabel()","attr.role":'ariaLabel() ? "img" : null',"attr.aria-hidden":'ariaLabel() ? null : "true"'},classAttribute:"nvb-icon-svg"},viewQueries:[{propertyName:"contentRef",first:true,predicate:["contentRef"],descendants:true,isSignal:true}],ngImport:h,template:'<span #contentRef class="nvb-icon-svg__content"></span>\n',styles:[".nvb-icon-svg{display:inline-flex;align-items:center;justify-content:center;width:1em;height:1em;overflow:hidden;line-height:1;vertical-align:middle;color:currentColor;flex-shrink:0}.nvb-icon-svg__content{display:inline-flex;width:100%;height:100%}.nvb-icon-svg svg{width:100%;height:100%;display:block;fill:currentColor;max-width:100%;max-height:100%}\n"],changeDetection:h.ChangeDetectionStrategy.Eager,encapsulation:h.ViewEncapsulation.None})};h.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:ot,decorators:[{type:we,args:[{selector:"nvb-icon",imports:[],encapsulation:Vr.None,changeDetection:ye.Eager,host:{class:"nvb-icon-svg","[attr.data-icon]":"name()","[attr.aria-label]":"ariaLabel()","[attr.role]":'ariaLabel() ? "img" : null',"[attr.aria-hidden]":'ariaLabel() ? null : "true"'},template:'<span #contentRef class="nvb-icon-svg__content"></span>\n',styles:[".nvb-icon-svg{display:inline-flex;align-items:center;justify-content:center;width:1em;height:1em;overflow:hidden;line-height:1;vertical-align:middle;color:currentColor;flex-shrink:0}.nvb-icon-svg__content{display:inline-flex;width:100%;height:100%}.nvb-icon-svg svg{width:100%;height:100%;display:block;fill:currentColor;max-width:100%;max-height:100%}\n"]}]}],ctorParameters:()=>[],propDecorators:{name:[{type:h.Input,args:[{isSignal:true,alias:"name",required:false}]}],svg:[{type:h.Input,args:[{isSignal:true,alias:"svg",required:false}]}],ariaLabel:[{type:h.Input,args:[{isSignal:true,alias:"ariaLabel",required:false}]}],contentRef:[{type:h.ViewChild,args:["contentRef",{isSignal:true}]}]}});function lt(u){if(typeof window==="undefined")return ct(0,0,0,0);const e=ct(0,0,window.innerWidth??0,window.innerHeight??0);const t=u?yn(u):null;if(!t)return e;const r=t.getBoundingClientRect();const n=window.getComputedStyle(t);return ct(r.left+ge(n.borderLeftWidth),r.top+ge(n.borderTopWidth),r.right-ge(n.borderRightWidth),r.bottom-ge(n.borderBottomWidth))}function ct(u,e,t,r){return{left:u,top:e,right:t,bottom:r,width:Math.max(0,t-u),height:Math.max(0,r-e)}}function yn(u){let e=pr(u);while(e){if(wn(e))return e;e=pr(e)}return null}function pr(u){const e=u.parentElement;if(e)return e;const t=u.getRootNode?.()?.host;return t instanceof HTMLElement?t:null}function wn(u){const e=window.getComputedStyle(u);if(z(e.transform)||z(e.perspective)||z(e.filter)||z(e.backdropFilter)||z(e.translate)||z(e.rotate)||z(e.scale))return true;if(/\b(paint|layout|strict|content)\b/.test(e.contain??""))return true;return/\b(transform|translate|rotate|scale|perspective|filter|backdrop-filter|contain)\b/.test(e.willChange??"")}function z(u){const e=String(u??"").trim();return e.length>0&&e!=="none"}function ge(u){const e=Number.parseFloat(String(u??""));return Number.isFinite(e)?e:0}function H(u){return String(u??"").trim().replace(/[^A-Za-z0-9_]+/g,"-").replace(/^-+|-+$/g,"")}function Tn(u,e,t){const r=U(()=>{const n=u();return H(n?.dataPath)||H(n?.name)||t},...ngDevMode?[{debugName:"instance"}]:[]);return(n,...i)=>{const s=i.map(a=>H(a)).filter(a=>a.length>0);return[`${e}-${n}`,r(),...s].join("-")}}var fe=class qt{text=V(...ngDevMode?[void 0,{debugName:"text"}]:[]);metaText=V("",...ngDevMode?[{debugName:"metaText"}]:[]);top=V(null,...ngDevMode?[{debugName:"top"}]:[]);left=V(null,...ngDevMode?[{debugName:"left"}]:[]);interactive=V(false,...ngDevMode?[{debugName:"interactive"}]:[]);mouseEntered=Zt();mouseLeft=Zt();get hostTop(){return this.top()}get hostLeft(){return this.left()}get hostInteractiveClass(){return this.interactive()}onMouseEnter(){if(this.interactive())this.mouseEntered.emit()}onMouseLeave(){if(this.interactive())this.mouseLeft.emit()}static ɵfac=h.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:qt,deps:[],target:h.ɵɵFactoryTarget.Component});static ɵcmp=h.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"22.2.1",type:qt,isStandalone:true,selector:"app-tooltip",inputs:{text:{classPropertyName:"text",publicName:"text",isSignal:true,isRequired:false,transformFunction:null},metaText:{classPropertyName:"metaText",publicName:"metaText",isSignal:true,isRequired:false,transformFunction:null},top:{classPropertyName:"top",publicName:"top",isSignal:true,isRequired:false,transformFunction:null},left:{classPropertyName:"left",publicName:"left",isSignal:true,isRequired:false,transformFunction:null},interactive:{classPropertyName:"interactive",publicName:"interactive",isSignal:true,isRequired:false,transformFunction:null}},outputs:{mouseEntered:"mouseEntered",mouseLeft:"mouseLeft"},host:{listeners:{"mouseenter":"onMouseEnter()","mouseleave":"onMouseLeave()"},properties:{"style.top.px":"this.hostTop","style.left.px":"this.hostLeft","class.nvb-tooltip--interactive":"this.hostInteractiveClass"}},ngImport:h,template:'<div class="nvb-tooltip__content">\n <div>{{ text() }}</div>\n @if (metaText()) {\n <div class="nvb-tooltip__meta">{{ metaText() }}</div>\n }\n</div>\n<div class="nvb-tooltip__arrow" aria-hidden="true"></div>\n',styles:[":host{position:fixed;transform:translate(-50%,calc(-100% - 8px));z-index:2147483647;pointer-events:none;width:max-content;min-width:min(240px,100vw - 24px);max-width:min(420px,100vw - 24px)}:host.nvb-tooltip--interactive{pointer-events:auto}.nvb-tooltip__content{padding:8px 10px;border-radius:var(--nvb-radius-md);border:1px solid var(--nvb-color-neutral-700);background:var(--nvb-color-neutral-800);color:var(--nvb-color-neutral-050);font-size:12px;line-height:1.45;text-align:left;white-space:pre-line;overflow-wrap:anywhere;-webkit-user-select:text;user-select:text;cursor:text;box-shadow:0 8px 20px #0f172a59}.nvb-tooltip__meta{margin-top:6px;font-size:10px;line-height:1.35;color:var(--nvb-color-neutral-300)}.nvb-tooltip__arrow{position:absolute;width:10px;height:10px;left:50%;bottom:-5px;transform:translate(-50%) rotate(45deg);border-right:1px solid var(--nvb-color-neutral-700);border-bottom:1px solid var(--nvb-color-neutral-700);background:var(--nvb-color-neutral-800)}\n"],changeDetection:h.ChangeDetectionStrategy.Eager})};h.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:fe,decorators:[{type:we,args:[{selector:"app-tooltip",imports:[],changeDetection:ye.Eager,template:'<div class="nvb-tooltip__content">\n <div>{{ text() }}</div>\n @if (metaText()) {\n <div class="nvb-tooltip__meta">{{ metaText() }}</div>\n }\n</div>\n<div class="nvb-tooltip__arrow" aria-hidden="true"></div>\n',styles:[":host{position:fixed;transform:translate(-50%,calc(-100% - 8px));z-index:2147483647;pointer-events:none;width:max-content;min-width:min(240px,100vw - 24px);max-width:min(420px,100vw - 24px)}:host.nvb-tooltip--interactive{pointer-events:auto}.nvb-tooltip__content{padding:8px 10px;border-radius:var(--nvb-radius-md);border:1px solid var(--nvb-color-neutral-700);background:var(--nvb-color-neutral-800);color:var(--nvb-color-neutral-050);font-size:12px;line-height:1.45;text-align:left;white-space:pre-line;overflow-wrap:anywhere;-webkit-user-select:text;user-select:text;cursor:text;box-shadow:0 8px 20px #0f172a59}.nvb-tooltip__meta{margin-top:6px;font-size:10px;line-height:1.35;color:var(--nvb-color-neutral-300)}.nvb-tooltip__arrow{position:absolute;width:10px;height:10px;left:50%;bottom:-5px;transform:translate(-50%) rotate(45deg);border-right:1px solid var(--nvb-color-neutral-700);border-bottom:1px solid var(--nvb-color-neutral-700);background:var(--nvb-color-neutral-800)}\n"]}]}],propDecorators:{text:[{type:h.Input,args:[{isSignal:true,alias:"text",required:false}]}],metaText:[{type:h.Input,args:[{isSignal:true,alias:"metaText",required:false}]}],top:[{type:h.Input,args:[{isSignal:true,alias:"top",required:false}]}],left:[{type:h.Input,args:[{isSignal:true,alias:"left",required:false}]}],interactive:[{type:h.Input,args:[{isSignal:true,alias:"interactive",required:false}]}],mouseEntered:[{type:h.Output,args:["mouseEntered"]}],mouseLeft:[{type:h.Output,args:["mouseLeft"]}],hostTop:[{type:Te,args:["style.top.px"]}],hostLeft:[{type:Te,args:["style.left.px"]}],hostInteractiveClass:[{type:Te,args:["class.nvb-tooltip--interactive"]}],onMouseEnter:[{type:Ft,args:["mouseenter"]}],onMouseLeave:[{type:Ft,args:["mouseleave"]}]}});var gr=class kt{model=V(null,...ngDevMode?[{debugName:"model"}]:[]);controlIdInput=V(void 0,...ngDevMode?[{debugName:"controlIdInput"}]:[]);labelForInput=V(void 0,...ngDevMode?[{debugName:"labelForInput"}]:[]);groupRole=V(null,...ngDevMode?[{debugName:"groupRole"}]:[]);showTextWrapperInput=V(true,...ngDevMode?[{debugName:"showTextWrapperInput"}]:[]);required=E(false,...ngDevMode?[{debugName:"required"}]:[]);isRowColumn=E(false,...ngDevMode?[{debugName:"isRowColumn"}]:[]);labelHidden=E(false,...ngDevMode?[{debugName:"labelHidden"}]:[]);isReady=E(true,...ngDevMode?[{debugName:"isReady"}]:[]);labelTooltipVisible=E(false,...ngDevMode?[{debugName:"labelTooltipVisible"}]:[]);labelTooltipTop=E(null,...ngDevMode?[{debugName:"labelTooltipTop"}]:[]);labelTooltipLeft=E(null,...ngDevMode?[{debugName:"labelTooltipLeft"}]:[]);columnErrorVisible=E(false,...ngDevMode?[{debugName:"columnErrorVisible"}]:[]);columnErrorTop=E(null,...ngDevMode?[{debugName:"columnErrorTop"}]:[]);columnErrorLeft=E(null,...ngDevMode?[{debugName:"columnErrorLeft"}]:[]);columnErrorPlacement=E("below",...ngDevMode?[{debugName:"columnErrorPlacement"}]:[]);columnErrorFrameId=null;elementActionService=g(Q);validatorService=g($);isEditor=E(te.isEditor(),...ngDevMode?[{debugName:"isEditor"}]:[]);elementHoverTitle=U(()=>{if(!this.isEditor())return null;return String(this.model()?.name??"").trim()||null},...ngDevMode?[{debugName:"elementHoverTitle"}]:[]);testId=U(()=>H(this.model()?.dataPath)||H(this.model()?.name)||null,...ngDevMode?[{debugName:"testId"}]:[]);baseId=U(()=>{const e=String(this.controlIdInput()??"").trim();if(e)return e;const t=String(this.model()?.name??"").trim();if(t)return this.slugify(t);const r=String(this.model()?.label??"").trim();if(r)return`nvb-field-${this.slugify(r)}`;return null},...ngDevMode?[{debugName:"baseId"}]:[]);ngOnInit(){this.isEditor.set(te.isEditor());if(this.model()?.parentElement&&this.model()?.parentElement.type==="dynamicTable")this.isRowColumn.set(true);this.labelHidden.set(this.isRowColumn()||Boolean(this.model()?.["__nvbHideLabel"]));this.runLoadLifecycle()}async runLoadLifecycle(){if(te.isEditor())return;const e=this.model();if(!e)return;const t=e.events??[];if(!Array.isArray(t)||t.length===0)return;const r=this.createRuntimeContext(e);if(t.some(n=>n?.trigger==="beforeLoad")){this.isReady.set(false);await this.elementActionService.runActions(e,t,"beforeLoad",r)}this.isReady.set(true);await this.elementActionService.runActions(e,t,"onLoad",r);queueMicrotask(()=>{this.elementActionService.runActions(e,t,"afterLoad",r)})}createRuntimeContext(e){const t=e.value;const r=String(e.name??"").trim();const n={value:t,item:null,row:null};if(r)n[r]=t;return n}hasLabelTooltip(){return String(this.model()?.["labelTooltip"]??"").trim().length>0}setLabelTooltipVisible(e,t){if(!this.hasLabelTooltip()){this.labelTooltipVisible.set(false);return}if(e&&t){const r=t.currentTarget;if(r){const n=r.getBoundingClientRect();const i=lt(r);this.labelTooltipTop.set(Math.round(n.top-i.top));this.labelTooltipLeft.set(Math.round(n.left+n.width/2-i.left))}}this.labelTooltipVisible.set(e)}setColumnErrorVisible(e,t){this.cancelColumnErrorFrame();if(!e){this.columnErrorVisible.set(false);return}const r=t?.currentTarget;if(!r){this.columnErrorVisible.set(false);return}this.positionColumnError(r);this.columnErrorVisible.set(true);if(typeof requestAnimationFrame!=="function")return;this.columnErrorFrameId=requestAnimationFrame(()=>{this.columnErrorFrameId=null;if(!this.columnErrorVisible()||!r.isConnected)return;this.positionColumnError(r)})}positionColumnError(e){const t=e.getBoundingClientRect();const r=e.parentElement?.querySelector(".nvb-field__column-error-dialog")??null;const n=lt(r??e);const i=r?.offsetHeight??0;const s=5;const a=(typeof window==="undefined"?0:window.innerHeight??0)-t.bottom-s;const o=t.top-s;const l=i>0&&a<i&&o>=i?"above":"below";this.columnErrorPlacement.set(l);this.columnErrorLeft.set(Math.round(t.left+t.width/2-n.left));this.columnErrorTop.set(Math.round((l==="above"?t.top-s:t.bottom+s)-n.top))}cancelColumnErrorFrame(){if(this.columnErrorFrameId!==null&&typeof cancelAnimationFrame==="function")cancelAnimationFrame(this.columnErrorFrameId);this.columnErrorFrameId=null}shouldShowErrors(){this.validatorService.getValidationRenderVersion();if(!Array.isArray(this.model()?.errors)||this.model().errors.length===0)return false;return this.validatorService.isElementValidationVisible(this.model())}hasLabelText(){return String(this.model()?.label??"").trim().length>0}hasDescription(){return String(this.model()?.description??"").trim().length>0}showLabelRow(){if(this.labelHidden())return false;return this.hasLabelText()||this.hasLabelTooltip()}showTextWrapper(){if(this.showTextWrapperInput()===false)return false;if(this.isRowColumn())return false;return this.showLabelRow()||this.hasDescription()}controlId(){return this.baseId()}labelFor(){const e=this.labelForInput();if(e===null)return null;const t=String(e??"").trim();if(t)return t;return this.controlId()}labelId(){return this.partId("label")}descriptionId(){return this.hasDescription()?this.partId("description"):null}errorId(){return this.shouldShowErrors()?this.partId("error"):null}partId(e){const t=this.baseId();const r=String(e??"").trim();if(!t||!r)return null;return`${t}-${r}`}describedByIds(...e){const t=[this.descriptionId(),this.errorId(),...e].map(r=>String(r??"").trim()).filter(Boolean);if(t.length===0)return null;return t.join(" ")}isInvalid(){return this.shouldShowErrors()}slugify(e){return`nvb-field-${String(e??"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+/,"").replace(/-+$/,"").slice(0,64)}`}static ɵfac=h.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:kt,deps:[],target:h.ɵɵFactoryTarget.Component});static ɵcmp=h.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"22.2.1",type:kt,isStandalone:true,selector:"element-wrapper",inputs:{model:{classPropertyName:"model",publicName:"model",isSignal:true,isRequired:false,transformFunction:null},controlIdInput:{classPropertyName:"controlIdInput",publicName:"controlIdInput",isSignal:true,isRequired:false,transformFunction:null},labelForInput:{classPropertyName:"labelForInput",publicName:"labelForInput",isSignal:true,isRequired:false,transformFunction:null},groupRole:{classPropertyName:"groupRole",publicName:"groupRole",isSignal:true,isRequired:false,transformFunction:null},showTextWrapperInput:{classPropertyName:"showTextWrapperInput",publicName:"showTextWrapperInput",isSignal:true,isRequired:false,transformFunction:null}},exportAs:["elementWrapper"],ngImport:h,template:"<div\n class=\"nvb-field\"\n [class.nvb-field--has-errors]=\"shouldShowErrors()\"\n [class.nvb-field--disabled]=\"model()?.disabled\"\n [class.nvb-field--fit-content]=\"model()?.fitContent && !isRowColumn()\"\n [class.nvb-field--row-column]=\"isRowColumn()\"\n [attr.role]=\"groupRole()\"\n [attr.aria-labelledby]=\"groupRole() ? labelId() : null\"\n [attr.aria-describedby]=\"groupRole() ? describedByIds() : null\"\n [attr.data-nvb-element-name]=\"model()?.name || null\"\n [attr.data-nvb-data-path]=\"model()?.dataPath || null\"\n [attr.data-nvb-element-type]=\"model()?.type || null\"\n [attr.data-testid]=\"testId() ? 'nvb-element-' + testId() : null\"\n [attr.aria-disabled]=\"model()?.disabled ? 'true' : null\"\n [attr.aria-readonly]=\"model()?.readOnly ? 'true' : null\"\n [attr.title]=\"elementHoverTitle()\"\n>\n @if (showTextWrapper()) {\n <div class=\"nvb-field__text-warpper\">\n @if (showLabelRow()) {\n <label\n [id]=\"labelId()\"\n [for]=\"labelFor()\"\n class=\"nvb-field__label\"\n [attr.data-testid]=\"testId() ? 'nvb-label-' + testId() : null\"\n >\n @if (hasLabelText()) {\n <span class=\"nvb-field__label-text\">{{\n $safeNavigationMigration(model()?.label) | dynamicText: model()\n }}</span>\n }\n @if (hasLabelTooltip()) {\n <button\n type=\"button\"\n class=\"nvb-field__label-tooltip-trigger\"\n [attr.data-testid]=\"\n testId() ? 'nvb-label-tooltip-trigger-' + testId() : null\n \"\n [attr.aria-label]=\"\n model()?.name\n ? ('preview.fieldHelp' | uiT: 'Field help') + ': ' + model()?.name\n : ('preview.fieldHelp' | uiT: 'Field help')\n \"\n [attr.aria-expanded]=\"labelTooltipVisible()\"\n (mouseenter)=\"setLabelTooltipVisible(true, $event)\"\n (mouseleave)=\"setLabelTooltipVisible(false)\"\n (focus)=\"setLabelTooltipVisible(true, $event)\"\n (blur)=\"setLabelTooltipVisible(false)\"\n >\n <span class=\"nvb-field__label-tooltip-mark\" aria-hidden=\"true\">?</span>\n @if (labelTooltipVisible() && hasLabelTooltip()) {\n <app-tooltip\n [text]=\"\n $safeNavigationMigration(model()?.['labelTooltip']) | dynamicText: model()\n \"\n [top]=\"labelTooltipTop()\"\n [left]=\"labelTooltipLeft()\"\n />\n }\n </button>\n }\n @if (model()?.required) {\n <span class=\"nvb-field__required\">*</span>\n }\n </label>\n }\n @if (hasDescription()) {\n <span\n [id]=\"descriptionId()\"\n class=\"nvb-field__description\"\n [attr.data-testid]=\"testId() ? 'nvb-description-' + testId() : null\"\n >\n {{ $safeNavigationMigration(model()?.description) | dynamicText: model() }}\n </span>\n }\n </div>\n }\n\n @if (isReady()) {\n <div\n class=\"nvb-field__content\"\n [class.nvb-field__content--disabled]=\"model()?.disabled\"\n [attr.data-testid]=\"testId() ? 'nvb-content-' + testId() : null\"\n >\n <ng-content></ng-content>\n\n @if (shouldShowErrors()) {\n @if (isRowColumn()) {\n <div\n #errorTrigger\n [id]=\"errorId()\"\n class=\"nvb-field__column-error\"\n tabindex=\"0\"\n [attr.data-testid]=\"testId() ? 'nvb-errors-' + testId() : null\"\n aria-live=\"polite\"\n [attr.aria-label]=\"model()?.name ? 'Errors for ' + model()?.name : 'Errors'\"\n (mouseenter)=\"setColumnErrorVisible(true, $event)\"\n (mouseleave)=\"setColumnErrorVisible(false)\"\n (focus)=\"setColumnErrorVisible(true, $event)\"\n (blur)=\"setColumnErrorVisible(false)\"\n >\n <span class=\"material-symbols-outlined nvb-field__column-error-icon\">error</span>\n </div>\n\n <!--\n A sibling of the icon, not a child of it: the icon is stacked above\n the input with `z-index` and centred with a transform, and both of\n those make it a stacking context that would cap the bubble's own\n z-index and pin its fixed position to the icon's 20px box.\n -->\n <div\n class=\"nvb-field__column-error-dialog\"\n [class.nvb-field__column-error-dialog--visible]=\"columnErrorVisible()\"\n [class.nvb-field__column-error-dialog--above]=\"columnErrorPlacement() === 'above'\"\n [style.top.px]=\"columnErrorTop()\"\n [style.left.px]=\"columnErrorLeft()\"\n >\n <ul>\n @for (error of model()?.errors; track $index) {\n <li>• {{ error }}</li>\n }\n </ul>\n </div>\n } @else {\n <div\n [id]=\"errorId()\"\n class=\"nvb-field__errors\"\n [attr.data-testid]=\"testId() ? 'nvb-errors-' + testId() : null\"\n aria-live=\"polite\"\n >\n @for (error of model()?.errors; track $index) {\n <small class=\"nvb-field__error-item\">{{ error }}</small>\n }\n </div>\n }\n }\n </div>\n } @else {\n <div class=\"nvb-field__content nvb-field__content--loading\"></div>\n }\n</div>\n",styles:['.nvb-field{--nvb-disabled-surface: color-mix( in oklab, var(--nvb-color-neutral-100) 88%, var(--nvb-color-neutral-000) );--nvb-disabled-border: color-mix(in oklab, var(--nvb-color-neutral-300) 86%, var(--nvb-color-neutral-000));--nvb-disabled-text: var(--nvb-color-neutral-500);display:flex;flex-direction:column;gap:var(--nvb-space-1)}.nvb-field__label{font-size:14px;line-height:18px;color:var(--nvb-color-neutral-800);position:relative;display:inline-flex;align-items:center;gap:var(--nvb-space-2);width:fit-content;font-weight:600}.nvb-field__label-text{display:inline}.nvb-field__label-tooltip-trigger{position:relative;border:1px solid var(--nvb-color-neutral-200);background:var(--nvb-color-neutral-100);color:var(--nvb-color-neutral-500);padding:0;display:inline-flex;align-items:center;justify-content:center;cursor:help;width:14px;height:14px;border-radius:var(--nvb-radius-sm);transition:background-color .16s ease,border-color .16s ease,color .16s ease}.nvb-field__label-tooltip-trigger:hover,.nvb-field__label-tooltip-trigger:focus-visible{color:var(--nvb-color-neutral-700);outline:none;border-color:var(--nvb-color-neutral-300);background-color:var(--nvb-color-neutral-150, var(--nvb-color-neutral-100))}.nvb-field__label-tooltip-mark{display:inline-flex;align-items:center;justify-content:center;font-size:10px;font-weight:600;line-height:1}.nvb-field__text-warpper{display:flex;flex-direction:column;gap:2px}.nvb-field__description{font-size:12px;color:var(--nvb-color-neutral-500);line-height:16px;max-width:72ch}.nvb-field__required{color:var(--nvb-color-risk-600)}.nvb-field__error{color:var(--nvb-color-risk-600);font-size:12px;line-height:16px}.nvb-field--has-errors .nvb-field__label-text{color:var(--nvb-color-risk-700)}.nvb-field--has-errors ::ng-deep .nvb-control__text-input,.nvb-field--has-errors ::ng-deep .nvb-control__column-input,.nvb-field--has-errors ::ng-deep .nvb-control__attribute-input,.nvb-field--has-errors ::ng-deep .nvb-phone__number,.nvb-field--has-errors ::ng-deep textarea.nvb-control__text-input,.nvb-field--has-errors ::ng-deep textarea.nvb-control__column-input,.nvb-field--has-errors ::ng-deep .nvb-input-wrapper.nvb-control__text-input,.nvb-field--has-errors ::ng-deep .nvb-input-wrapper.nvb-control__column-input,.nvb-field--has-errors ::ng-deep .nvb-datepicker__trigger{border-color:var(--nvb-color-risk-500);box-shadow:0 0 0 1px var(--nvb-color-neutral-000),0 0 0 3px color-mix(in oklch,var(--nvb-color-risk-500) 28%,transparent)}.nvb-field--disabled .nvb-field__label,.nvb-field--disabled .nvb-field__description{color:var(--nvb-color-neutral-500)}.nvb-field--disabled .nvb-field__label-tooltip-trigger{background:color-mix(in oklab,var(--nvb-color-neutral-100) 82%,var(--nvb-color-neutral-000));border-color:var(--nvb-color-neutral-200);color:var(--nvb-color-neutral-500)}.nvb-field__content{position:relative;min-width:0}.nvb-field--fit-content{width:fit-content;max-width:100%;align-self:flex-start}.nvb-field--fit-content .nvb-field__content{width:fit-content;max-width:100%}.nvb-field--fit-content .nvb-field__content>*{max-width:100%}.nvb-field--row-column{gap:0;min-height:100%;height:100%}.nvb-field--row-column .nvb-field__text-warpper{display:none}.nvb-field--row-column .nvb-field__content{min-height:inherit;height:100%;display:flex;align-items:stretch;justify-content:stretch}.nvb-field--row-column .nvb-field__content>*{flex:1 1 auto;min-width:0}.nvb-field--row-column ::ng-deep .nvb-control__text-input,.nvb-field--row-column ::ng-deep .nvb-control__column-input,.nvb-field--row-column ::ng-deep .nvb-control__attribute-input,.nvb-field--row-column ::ng-deep .nvb-phone__number,.nvb-field--row-column ::ng-deep textarea.nvb-control__text-input,.nvb-field--row-column ::ng-deep textarea.nvb-control__column-input,.nvb-field--row-column ::ng-deep .nvb-input-wrapper.nvb-control__column-input,.nvb-field--row-column ::ng-deep .nvb-select__trigger,.nvb-field--row-column ::ng-deep .nvb-datepicker__trigger,.nvb-field--row-column ::ng-deep .nvb-datepicker-range__trigger,.nvb-field--row-column ::ng-deep .nvb-datepicker-range__field{width:100%;min-height:100%;height:100%;border-radius:0}.nvb-field--row-column ::ng-deep .nvb-control__text-input,.nvb-field--row-column ::ng-deep .nvb-control__column-input,.nvb-field--row-column ::ng-deep .nvb-control__attribute-input,.nvb-field--row-column ::ng-deep .nvb-phone__number,.nvb-field--row-column ::ng-deep textarea.nvb-control__text-input,.nvb-field--row-column ::ng-deep textarea.nvb-control__column-input,.nvb-field--row-column ::ng-deep .nvb-input-wrapper.nvb-control__column-input,.nvb-field--row-column ::ng-deep .nvb-select__trigger,.nvb-field--row-column ::ng-deep .nvb-datepicker__trigger,.nvb-field--row-column ::ng-deep .nvb-datepicker-range__trigger,.nvb-field--row-column ::ng-deep .nvb-datepicker-range__field{border-color:transparent;box-shadow:none}.nvb-field__content--disabled{pointer-events:none}.nvb-field__content--disabled ::ng-deep .nvb-control__text-input,.nvb-field__content--disabled ::ng-deep .nvb-control__column-input,.nvb-field__content--disabled ::ng-deep .nvb-control__attribute-input,.nvb-field__content--disabled ::ng-deep .nvb-select__trigger,.nvb-field__content--disabled ::ng-deep .nvb-phone__number,.nvb-field__content--disabled ::ng-deep .nvb-datepicker__trigger,.nvb-field__content--disabled ::ng-deep .nvb-datepicker-range__trigger,.nvb-field__content--disabled ::ng-deep .nvb-datepicker-range__field,.nvb-field__content--disabled ::ng-deep .nvb-table-frame,.nvb-field__content--disabled ::ng-deep .nvb-table-toolbar,.nvb-field__content--disabled ::ng-deep .nvb-table-paginator,.nvb-field__content--disabled ::ng-deep table[data-testid=dynamic-table-root],.nvb-field__content--disabled ::ng-deep table[data-testid=dynamic-table-root] td,.nvb-field__content--disabled ::ng-deep table[data-testid=dynamic-table-root] thead td,.nvb-field__content--disabled ::ng-deep table[data-testid=dynamic-table-root] tfoot td{background:var(--nvb-disabled-surface)!important;border-color:var(--nvb-disabled-border)!important;color:var(--nvb-disabled-text)!important;box-shadow:none!important}.nvb-field__content--disabled ::ng-deep .nvb-control__text-input::placeholder,.nvb-field__content--disabled ::ng-deep .nvb-control__column-input::placeholder,.nvb-field__content--disabled ::ng-deep .nvb-phone__number::placeholder{color:var(--nvb-disabled-text)!important}.nvb-field__content--disabled ::ng-deep .nvb-select__trigger,.nvb-field__content--disabled ::ng-deep .nvb-table-toolbar__button,.nvb-field__content--disabled ::ng-deep .nvb-table-export__action,.nvb-field__content--disabled ::ng-deep .nvb-table-paginator__nav,.nvb-field__content--disabled ::ng-deep .nvb-table-paginator__page{color:var(--nvb-disabled-text)!important}.nvb-field__content--disabled ::ng-deep .nvb-table th,.nvb-field__content--disabled ::ng-deep .nvb-table td,.nvb-field__content--disabled ::ng-deep .nvb-nested-table th,.nvb-field__content--disabled ::ng-deep .nvb-nested-table td{background:var(--nvb-disabled-surface)!important;border-color:var(--nvb-disabled-border)!important;color:var(--nvb-disabled-text)!important}.nvb-field__content--disabled ::ng-deep .nvb-select-value,.nvb-field__content--disabled ::ng-deep .nvb-table-toolbar__button span,.nvb-field__content--disabled ::ng-deep .nvb-table-export__action span,.nvb-field__content--disabled ::ng-deep .nvb-table-paginator__nav span,.nvb-field__content--disabled ::ng-deep .nvb-phone__country{color:inherit!important}.nvb-field__content--disabled ::ng-deep input[type=checkbox],.nvb-field__content--disabled ::ng-deep input[type=radio]{accent-color:color-mix(in oklab,var(--nvb-color-neutral-400) 88%,white)}.nvb-field--row-column .nvb-field__content--disabled ::ng-deep .nvb-control__text-input,.nvb-field--row-column .nvb-field__content--disabled ::ng-deep .nvb-control__column-input,.nvb-field--row-column .nvb-field__content--disabled ::ng-deep .nvb-control__attribute-input,.nvb-field--row-column .nvb-field__content--disabled ::ng-deep .nvb-phone__number,.nvb-field--row-column .nvb-field__content--disabled ::ng-deep textarea.nvb-control__text-input,.nvb-field--row-column .nvb-field__content--disabled ::ng-deep textarea.nvb-control__column-input,.nvb-field--row-column .nvb-field__content--disabled ::ng-deep .nvb-input-wrapper.nvb-control__column-input,.nvb-field--row-column .nvb-field__content--disabled ::ng-deep .nvb-select__trigger,.nvb-field--row-column .nvb-field__content--disabled ::ng-deep .nvb-datepicker__trigger,.nvb-field--row-column .nvb-field__content--disabled ::ng-deep .nvb-datepicker-range__trigger,.nvb-field--row-column .nvb-field__content--disabled ::ng-deep .nvb-datepicker-range__field{width:100%;min-height:100%;height:100%;background:var(--nvb-disabled-surface)!important;border-color:transparent!important;color:var(--nvb-disabled-text)!important}.nvb-field__content--loading{min-height:36px}.nvb-field__column-error{position:absolute;right:5px;top:50%;transform:translateY(-50%);width:20px;height:20px;display:flex;justify-content:center;align-items:center;background-color:var(--nvb-color-risk-050);border-radius:var(--nvb-radius-md);z-index:5;cursor:pointer}.nvb-field__column-error:hover,.nvb-field__column-error:focus-visible{background-color:var(--nvb-color-risk-100)}.nvb-field__column-error:hover .nvb-field__column-error-icon,.nvb-field__column-error:focus-visible .nvb-field__column-error-icon{color:var(--nvb-color-risk-700)}.nvb-field__column-error-dialog{position:fixed;transform:translate(-50%);padding:5px;min-width:180px;max-width:300px;background-color:var(--nvb-color-risk-050);border:1px solid var(--nvb-color-risk-200);border-radius:var(--nvb-radius-md);font-size:12px;color:var(--nvb-color-risk-700);white-space:normal;z-index:2147483646;box-shadow:0 8px 24px #0f172a1f;pointer-events:none;opacity:0;visibility:hidden;transition:opacity .2s ease,visibility .2s ease}.nvb-field__column-error-dialog--visible{opacity:1;visibility:visible;pointer-events:auto}.nvb-field__column-error-dialog--above{transform:translate(-50%,-100%)}.nvb-field__column-error-dialog--above:before{top:auto;bottom:-6px;border-bottom:0;border-top:6px solid var(--nvb-color-risk-200)}.nvb-field__column-error-dialog--above:after{top:auto;bottom:-5px;border-bottom:0;border-top:6px solid var(--nvb-color-risk-050)}.nvb-field__column-error-dialog:before{content:"";position:absolute;top:-6px;left:50%;transform:translate(-50%);width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid var(--nvb-color-risk-200);z-index:1}.nvb-field__column-error-dialog:after{content:"";position:absolute;top:-5px;left:50%;transform:translate(-50%);width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid var(--nvb-color-risk-050);z-index:2}.nvb-field__column-error-dialog table,.nvb-field__column-error-dialog li{margin:0}.nvb-field__column-error-icon{color:var(--nvb-color-risk-600);font-size:16px}.nvb-field__errors{margin-top:6px;display:flex;flex-direction:column;gap:4px}.nvb-field__error-item{margin:0;color:var(--nvb-color-risk-700);font-size:12px;line-height:1.45}\n'],dependencies:[{kind:"component",type:fe,selector:"app-tooltip",inputs:["text","metaText","top","left","interactive"],outputs:["mouseEntered","mouseLeft"]},{kind:"pipe",type:Bt,name:"dynamicText"},{kind:"pipe",type:Nt,name:"uiT"}],changeDetection:h.ChangeDetectionStrategy.Eager})};h.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.2.1",ngImport:h,type:gr,decorators:[{type:we,args:[{selector:"element-wrapper",exportAs:"elementWrapper",imports:[Bt,fe,Nt,ot],changeDetection:ye.Eager,template:"<div\n class=\"nvb-field\"\n [class.nvb-field--has-errors]=\"shouldShowErrors()\"\n [class.nvb-field--disabled]=\"model()?.disabled\"\n [class.nvb-field--fit-content]=\"model()?.fitContent && !isRowColumn()\"\n [class.nvb-field--row-column]=\"isRowColumn()\"\n [attr.role]=\"groupRole()\"\n [attr.aria-labelledby]=\"groupRole() ? labelId() : null\"\n [attr.aria-describedby]=\"groupRole() ? describedByIds() : null\"\n [attr.data-nvb-element-name]=\"model()?.name || null\"\n [attr.data-nvb-data-path]=\"model()?.dataPath || null\"\n [attr.data-nvb-element-type]=\"model()?.type || null\"\n [attr.data-testid]=\"testId() ? 'nvb-element-' + testId() : null\"\n [attr.aria-disabled]=\"model()?.disabled ? 'true' : null\"\n [attr.aria-readonly]=\"model()?.readOnly ? 'true' : null\"\n [attr.title]=\"elementHoverTitle()\"\n>\n @if (showTextWrapper()) {\n <div class=\"nvb-field__text-warpper\">\n @if (showLabelRow()) {\n <label\n [id]=\"labelId()\"\n [for]=\"labelFor()\"\n class=\"nvb-field__label\"\n [attr.data-testid]=\"testId() ? 'nvb-label-' + testId() : null\"\n >\n @if (hasLabelText()) {\n <span class=\"nvb-field__label-text\">{{\n $safeNavigationMigration(model()?.label) | dynamicText: model()\n }}</span>\n }\n @if (hasLabelTooltip()) {\n <button\n type=\"button\"\n class=\"nvb-field__label-tooltip-trigger\"\n [attr.data-testid]=\"\n testId() ? 'nvb-label-tooltip-trigger-' + testId() : null\n \"\n [attr.aria-label]=\"\n model()?.name\n ? ('preview.fieldHelp' | uiT: 'Field help') + ': ' + model()?.name\n : ('preview.fieldHelp' | uiT: 'Field help')\n \"\n [attr.aria-expanded]=\"labelTooltipVisible()\"\n (mouseenter)=\"setLabelTooltipVisible(true, $event)\"\n (mouseleave)=\"setLabelTooltipVisible(false)\"\n (focus)=\"setLabelTooltipVisible(true, $event)\"\n (blur)=\"setLabelTooltipVisible(false)\"\n >\n <span class=\"nvb-field__label-tooltip-mark\" aria-hidden=\"true\">?</span>\n @if (labelTooltipVisible() && hasLabelTooltip()) {\n <app-tooltip\n [text]=\"\n $safeNavigationMigration(model()?.['labelTooltip']) | dynamicText: model()\n \"\n [top]=\"labelTooltipTop()\"\n [left]=\"labelTooltipLeft()\"\n />\n }\n </button>\n }\n @if (model()?.required) {\n <span class=\"nvb-field__required\">*</span>\n }\n </label>\n }\n @if (hasDescription()) {\n <span\n [id]=\"descriptionId()\"\n class=\"nvb-field__description\"\n [attr.data-testid]=\"testId() ? 'nvb-description-' + testId() : null\"\n >\n {{ $safeNavigationMigration(model()?.description) | dynamicText: model() }}\n </span>\n }\n </div>\n }\n\n @if (isReady()) {\n <div\n class=\"nvb-field__content\"\n [class.nvb-field__content--disabled]=\"model()?.disabled\"\n [attr.data-testid]=\"testId() ? 'nvb-content-' + testId() : null\"\n >\n <ng-content></ng-content>\n\n @if (shouldShowErrors()) {\n @if (isRowColumn()) {\n <div\n #errorTrigger\n [id]=\"errorId()\"\n class=\"nvb-field__column-error\"\n tabindex=\"0\"\n [attr.data-testid]=\"testId() ? 'nvb-errors-' + testId() : null\"\n aria-live=\"polite\"\n [attr.aria-label]=\"model()?.name ? 'Errors for ' + model()?.name : 'Errors'\"\n (mouseenter)=\"setColumnErrorVisible(true, $event)\"\n (mouseleave)=\"setColumnErrorVisible(false)\"\n (focus)=\"setColumnErrorVisible(true, $event)\"\n (blur)=\"setColumnErrorVisible(false)\"\n >\n <span class=\"material-symbols-outlined nvb-field__column-error-icon\">error</span>\n </div>\n\n <!--\n A sibling of the icon, not a child of it: the icon is stacked above\n the input with `z-index` and centred with a transform, and both of\n those make it a stacking context that would cap the bubble's own\n z-index and pin its fixed position to the icon's 20px box.\n -->\n <div\n class=\"nvb-field__column-error-dialog\"\n [class.nvb-field__column-error-dialog--visible]=\"columnErrorVisible()\"\n [class.nvb-field__column-error-dialog--above]=\"columnErrorPlacement() === 'above'\"\n [style.top.px]=\"columnErrorTop()\"\n [style.left.px]=\"columnErrorLeft()\"\n >\n <ul>\n @for (error of model()?.errors; track $index) {\n <li>• {{ error }}</li>\n }\n </ul>\n </div>\n } @else {\n <div\n [id]=\"errorId()\"\n class=\"nvb-field__errors\"\n [attr.data-testid]=\"testId() ? 'nvb-errors-' + testId() : null\"\n aria-live=\"polite\"\n >\n @for (error of model()?.errors; track $index) {\n <small class=\"nvb-field__error-item\">{{ error }}</small>\n }\n </div>\n }\n }\n </div>\n } @else {\n <div class=\"nvb-field__content nvb-field__content--loading\"></div>\n }\n</div>\n",styles:['.nvb-field{--nvb-disabled-surface: color-mix( in oklab, var(--nvb-color-neutral-100) 88%, var(--nvb-color-neutral-000) );--nvb-disabled-border: color-mix(in oklab, var(--nvb-color-neutral-300) 86%, var(--nvb-color-neutral-000));--nvb-disabled-text: var(--nvb-color-neutral-500);display:flex;flex-direction:column;gap:var(--nvb-space-1)}.nvb-field__label{font-size:14px;line-height:18px;color:var(--nvb-color-neutral-800);position:relative;display:inline-flex;align-items:center;gap:var(--nvb-space-2);width:fit-content;font-weight:600}.nvb-field__label-text{display:inline}.nvb-field__label-tooltip-trigger{position:relative;border:1px solid var(--nvb-color-neutral-200);background:var(--nvb-color-neutral-100);color:var(--nvb-color-neutral-500);padding:0;display:inline-flex;align-items:center;justify-content:center;cursor:help;width:14px;height:14px;border-radius:var(--nvb-radius-sm);transition:background-color .16s ease,border-color .16s ease,color .16s ease}.nvb-field__label-tooltip-trigger:hover,.nvb-field__label-tooltip-trigger:focus-visible{color:var(--nvb-color-neutral-700);outline:none;border-color:var(--nvb-color-neutral-300);background-color:var(--nvb-color-neutral-150, var(--nvb-color-neutral-100))}.nvb-field__label-tooltip-mark{display:inline-flex;align-items:center;justify-content:center;font-size:10px;font-weight:600;line-height:1}.nvb-field__text-warpper{display:flex;flex-direction:column;gap:2px}.nvb-field__description{font-size:12px;color:var(--nvb-color-neutral-500);line-height:16px;max-width:72ch}.nvb-field__required{color:var(--nvb-color-risk-600)}.nvb-field__error{color:var(--nvb-color-risk-600);font-size:12px;line-height:16px}.nvb-field--has-errors .nvb-field__label-text{color:var(--nvb-color-risk-700)}.nvb-field--has-errors ::ng-deep .nvb-control__text-input,.nvb-field--has-errors ::ng-deep .nvb-control__column-input,.nvb-field--has-errors ::ng-deep .nvb-control__attribute-input,.nvb-field--has-errors ::ng-deep .nvb-phone__number,.nvb-field--has-errors ::ng-deep textarea.nvb-control__text-input,.nvb-field--has-errors ::ng-deep textarea.nvb-control__column-input,.nvb-field--has-errors ::ng-deep .nvb-input-wrapper.nvb-control__text-input,.nvb-field--has-errors ::ng-deep .nvb-input-wrapper.nvb-control__column-input,.nvb-field--has-errors ::ng-deep .nvb-datepicker__trigger{border-color:var(--nvb-color-risk-500);box-shadow:0 0 0 1px var(--nvb-color-neutral-000),0 0 0 3px color-mix(in oklch,var(--nvb-color-risk-500) 28%,transparent)}.nvb-field--disabled .nvb-field__label,.nvb-field--disabled .nvb-field__description{color:var(--nvb-color-neutral-500)}.nvb-field--disabled .nvb-field__label-tooltip-trigger{background:color-mix(in oklab,var(--nvb-color-neutral-100) 82%,var(--nvb-color-neutral-000));border-color:var(--nvb-color-neutral-200);color:var(--nvb-color-neutral-500)}.nvb-field__content{position:relative;min-width:0}.nvb-field--fit-content{width:fit-content;max-width:100%;align-self:flex-start}.nvb-field--fit-content .nvb-field__content{width:fit-content;max-width:100%}.nvb-field--fit-content .nvb-field__content>*{max-width:100%}.nvb-field--row-column{gap:0;min-height:100%;height:100%}.nvb-field--row-column .nvb-field__text-warpper{display:none}.nvb-field--row-column .nvb-field__content{min-height:inherit;height:100%;display:flex;align-items:stretch;justify-content:stretch}.nvb-field--row-column .nvb-field__content>*{flex:1 1 auto;min-width:0}.nvb-field--row-column ::ng-deep .nvb-control__text-input,.nvb-field--row-column ::ng-deep .nvb-control__column-input,.nvb-field--row-column ::ng-deep .nvb-control__attribute-input,.nvb-field--row-column ::ng-deep .nvb-phone__number,.nvb-field--row-column ::ng-deep textarea.nvb-control__text-input,.nvb-field--row-column ::ng-deep textarea.nvb-control__column-input,.nvb-field--row-column ::ng-deep .nvb-input-wrapper.nvb-control__column-input,.nvb-field--row-column ::ng-deep .nvb-select__trigger,.nvb-field--row-column ::ng-deep .nvb-datepicker__trigger,.nvb-field--row-column ::ng-deep .nvb-datepicker-range__trigger,.nvb-field--row-column ::ng-deep .nvb-datepicker-range__field{width:100%;min-height:100%;height:100%;border-radius:0}.nvb-field--row-column ::ng-deep .nvb-control__text-input,.nvb-field--row-column ::ng-deep .nvb-control__column-input,.nvb-field--row-column ::ng-deep .nvb-control__attribute-input,.nvb-field--row-column ::ng-deep .nvb-phone__number,.nvb-field--row-column ::ng-deep textarea.nvb-control__text-input,.nvb-field--row-column ::ng-deep textarea.nvb-control__column-input,.nvb-field--row-column ::ng-deep .nvb-input-wrapper.nvb-control__column-input,.nvb-field--row-column ::ng-deep .nvb-select__trigger,.nvb-field--row-column ::ng-deep .nvb-datepicker__trigger,.nvb-field--row-column ::ng-deep .nvb-datepicker-range__trigger,.nvb-field--row-column ::ng-deep .nvb-datepicker-range__field{border-color:transparent;box-shadow:none}.nvb-field__content--disabled{pointer-events:none}.nvb-field__content--disabled ::ng-deep .nvb-control__text-input,.nvb-field__content--disabled ::ng-deep .nvb-control__column-input,.nvb-field__content--disabled ::ng-deep .nvb-control__attribute-input,.nvb-field__content--disabled ::ng-deep .nvb-select__trigger,.nvb-field__content--disabled ::ng-deep .nvb-phone__number,.nvb-field__content--disabled ::ng-deep .nvb-datepicker__trigger,.nvb-field__content--disabled ::ng-deep .nvb-datepicker-range__trigger,.nvb-field__content--disabled ::ng-deep .nvb-datepicker-range__field,.nvb-field__content--disabled ::ng-deep .nvb-table-frame,.nvb-field__content--disabled ::ng-deep .nvb-table-toolbar,.nvb-field__content--disabled ::ng-deep .nvb-table-paginator,.nvb-field__content--disabled ::ng-deep table[data-testid=dynamic-table-root],.nvb-field__content--disabled ::ng-deep table[data-testid=dynamic-table-root] td,.nvb-field__content--disabled ::ng-deep table[data-testid=dynamic-table-root] thead td,.nvb-field__content--disabled ::ng-deep table[data-testid=dynamic-table-root] tfoot td{background:var(--nvb-disabled-surface)!important;border-color:var(--nvb-disabled-border)!important;color:var(--nvb-disabled-text)!important;box-shadow:none!important}.nvb-field__content--disabled ::ng-deep .nvb-control__text-input::placeholder,.nvb-field__content--disabled ::ng-deep .nvb-control__column-input::placeholder,.nvb-field__content--disabled ::ng-deep .nvb-phone__number::placeholder{color:var(--nvb-disabled-text)!important}.nvb-field__content--disabled ::ng-deep .nvb-select__trigger,.nvb-field__content--disabled ::ng-deep .nvb-table-toolbar__button,.nvb-field__content--disabled ::ng-deep .nvb-table-export__action,.nvb-field__content--disabled ::ng-deep .nvb-table-paginator__nav,.nvb-field__content--disabled ::ng-deep .nvb-table-paginator__page{color:var(--nvb-disabled-text)!important}.nvb-field__content--disabled ::ng-deep .nvb-table th,.nvb-field__content--disabled ::ng-deep .nvb-table td,.nvb-field__content--disabled ::ng-deep .nvb-nested-table th,.nvb-field__content--disabled ::ng-deep .nvb-nested-table td{background:var(--nvb-disabled-surface)!important;border-color:var(--nvb-disabled-border)!important;color:var(--nvb-disabled-text)!important}.nvb-field__content--disabled ::ng-deep .nvb-select-value,.nvb-field__content--disabled ::ng-deep .nvb-table-toolbar__button span,.nvb-field__content--disabled ::ng-deep .nvb-table-export__action span,.nvb-field__content--disabled ::ng-deep .nvb-table-paginator__nav span,.nvb-field__content--disabled ::ng-deep .nvb-phone__country{color:inherit!important}.nvb-field__content--disabled ::ng-deep input[type=checkbox],.nvb-field__content--disabled ::ng-deep input[type=radio]{accent-color:color-mix(in oklab,var(--nvb-color-neutral-400) 88%,white)}.nvb-field--row-column .nvb-field__content--disabled ::ng-deep .nvb-control__text-input,.nvb-field--row-column .nvb-field__content--disabled ::ng-deep .nvb-control__column-input,.nvb-field--row-column .nvb-field__content--disabled ::ng-deep .nvb-control__attribute-input,.nvb-field--row-column .nvb-field__content--disabled ::ng-deep .nvb-phone__number,.nvb-field--row-column .nvb-field__content--disabled ::ng-deep textarea.nvb-control__text-input,.nvb-field--row-column .nvb-field__content--disabled ::ng-deep textarea.nvb-control__column-input,.nvb-field--row-column .nvb-field__content--disabled ::ng-deep .nvb-input-wrapper.nvb-control__column-input,.nvb-field--row-column .nvb-field__content--disabled ::ng-deep .nvb-select__trigger,.nvb-field--row-column .nvb-field__content--disabled ::ng-deep .nvb-datepicker__trigger,.nvb-field--row-column .nvb-field__content--disabled ::ng-deep .nvb-datepicker-range__trigger,.nvb-field--row-column .nvb-field__content--disabled ::ng-deep .nvb-datepicker-range__field{width:100%;min-height:100%;height:100%;background:var(--nvb-disabled-surface)!important;border-color:transparent!important;color:var(--nvb-disabled-text)!important}.nvb-field__content--loading{min-height:36px}.nvb-field__column-error{position:absolute;right:5px;top:50%;transform:translateY(-50%);width:20px;height:20px;display:flex;justify-content:center;align-items:center;background-color:var(--nvb-color-risk-050);border-radius:var(--nvb-radius-md);z-index:5;cursor:pointer}.nvb-field__column-error:hover,.nvb-field__column-error:focus-visible{background-color:var(--nvb-color-risk-100)}.nvb-field__column-error:hover .nvb-field__column-error-icon,.nvb-field__column-error:focus-visible .nvb-field__column-error-icon{color:var(--nvb-color-risk-700)}.nvb-field__column-error-dialog{position:fixed;transform:translate(-50%);padding:5px;min-width:180px;max-width:300px;background-color:var(--nvb-color-risk-050);border:1px solid var(--nvb-color-risk-200);border-radius:var(--nvb-radius-md);font-size:12px;color:var(--nvb-color-risk-700);white-space:normal;z-index:2147483646;box-shadow:0 8px 24px #0f172a1f;pointer-events:none;opacity:0;visibility:hidden;transition:opacity .2s ease,visibility .2s ease}.nvb-field__column-error-dialog--visible{opacity:1;visibility:visible;pointer-events:auto}.nvb-field__column-error-dialog--above{transform:translate(-50%,-100%)}.nvb-field__column-error-dialog--above:before{top:auto;bottom:-6px;border-bottom:0;border-top:6px solid var(--nvb-color-risk-200)}.nvb-field__column-error-dialog--above:after{top:auto;bottom:-5px;border-bottom:0;border-top:6px solid var(--nvb-color-risk-050)}.nvb-field__column-error-dialog:before{content:"";position:absolute;top:-6px;left:50%;transform:translate(-50%);width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid var(--nvb-color-risk-200);z-index:1}.nvb-field__column-error-dialog:after{content:"";position:absolute;top:-5px;left:50%;transform:translate(-50%);width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid var(--nvb-color-risk-050);z-index:2}.nvb-field__column-error-dialog table,.nvb-field__column-error-dialog li{margin:0}.nvb-field__column-error-icon{color:var(--nvb-color-risk-600);font-size:16px}.nvb-field__errors{margin-top:6px;display:flex;flex-direction:column;gap:4px}.nvb-field__error-item{margin:0;color:var(--nvb-color-risk-700);font-size:12px;line-height:1.45}\n']}]}],propDecorators:{model:[{type:h.Input,args:[{isSignal:true,alias:"model",required:false}]}],controlIdInput:[{type:h.Input,args:[{isSignal:true,alias:"controlIdInput",required:false}]}],labelForInput:[{type:h.Input,args:[{isSignal:true,alias:"labelForInput",required:false}]}],groupRole:[{type:h.Input,args:[{isSignal:true,alias:"groupRole",required:false}]}],showTextWrapperInput:[{type:h.Input,args:[{isSignal:true,alias:"showTextWrapperInput",required:false}]}]}});export{tr as $,Le as A,Ne as B,dr as C,he as D,He as E,on as F,Ie as G,sn as H,ar as I,en as J,nr as K,sr as L,Be as M,cr as N,lr as O,de as P,De as Q,nn as R,Oe as S,me as T,rn as U,ze as V,tn as W,Pe as X,rr as Y,Re as Z,pe as _,lt as a,Xt as at,hr as b,Ge as c,le as ct,et as d,$ as dt,Me as et,tt as f,Ut as ft,Qe as g,Ee as gt,Ke as h,I as ht,H as i,Ve as it,ur as j,Fe as k,Xe as l,Gt as lt,Je as m,F as mt,fe as n,K as nt,ot as o,Yt as ot,rt as p,Ae as pt,Xr as q,Tn as r,Q as rt,at as s,Kr as st,gr as t,ce as tt,Ye as u,_e as ut,Y as v,G as w,We as x,Ue as y,ir as z};
|