udp-stencil-component-library 26.9.0-beta.2 → 26.9.0-beta.21
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/dist/cjs/{SearchBuilder-CyR7DyPc.js → SearchBuilder-Ca9_ur9o.js} +1 -1
- package/dist/cjs/add-map-feature-popup_4.cjs.entry.js +8 -8
- package/dist/cjs/address-search_6.cjs.entry.js +19 -19
- package/dist/cjs/advanced-search_12.cjs.entry.js +20 -20
- package/dist/cjs/{ag-grid-base_65.cjs.entry.js → ag-grid-base_66.cjs.entry.js} +458 -183
- package/dist/cjs/ambient-template-grid.cjs.entry.js +20 -20
- package/dist/cjs/api-method-instance-grid.cjs.entry.js +11 -10
- package/dist/cjs/{apiMethodInstance-D65NIw8S.js → apiMethodInstance-DTeNcmNq.js} +3 -32
- package/dist/cjs/{apiUtils-0pkNuvqf.js → apiUtils-tzjwn5aw.js} +29 -28
- package/dist/cjs/app-bar.cjs.entry.js +1 -1
- package/dist/cjs/{catalog-store-B_YMkXRh.js → catalog-store-CzG8hINB.js} +1 -1
- package/dist/cjs/chart-container_3.cjs.entry.js +2 -2
- package/dist/cjs/check-box.cjs.entry.js +2 -2
- package/dist/cjs/chip-section.cjs.entry.js +2 -2
- package/dist/cjs/{codecs-ClSB_OaD.js → codecs-Dyka7kpz.js} +407 -7
- package/dist/cjs/{configService-N6ke1_s4.js → configService-DbfLqId2.js} +2 -6
- package/dist/cjs/{configureUdpColumnMods-BT7UbQPh.js → configureUdpColumnMods-Cqxn_OaF.js} +23 -7
- package/dist/cjs/convertBackendTypeToAgGridType-CZEQIj7A.js +33 -0
- package/dist/cjs/{createAzureMapsProviders-b1fKbjhG.js → createAzureMapsProviders-CURScysk.js} +14 -0
- package/dist/cjs/custom-button.cjs.entry.js +1 -1
- package/dist/cjs/date-time-renderer_9.cjs.entry.js +21 -21
- package/dist/cjs/domain-table-snapshot-DXs9ceFE.js +339 -0
- package/dist/cjs/extraFields-CNvT2Qyf.js +109 -0
- package/dist/cjs/extraFieldsHelper-Clk9u_FW.js +211 -0
- package/dist/cjs/feature-details-card_2.cjs.entry.js +5 -5
- package/dist/cjs/file-upload_2.cjs.entry.js +7 -7
- package/dist/cjs/filter-conditions_7.cjs.entry.js +7 -7
- package/dist/cjs/{fluent-icons-DLY_DCOh.js → fluent-icons-Cs6J6uVm.js} +20 -0
- package/dist/cjs/form-metadata-display_2.cjs.entry.js +3 -3
- package/dist/cjs/getCurrentApiCatalogId-D7xHCEzs.js +7 -0
- package/dist/cjs/icon-grid.cjs.entry.js +2 -2
- package/dist/cjs/image-upload_8.cjs.entry.js +7 -7
- package/dist/cjs/index-CZB9dMeB.js +12 -8
- package/dist/cjs/index.cjs.js +26 -23
- package/dist/cjs/{load-icons-BAAH3v1o.js → load-icons-JeRXx4O7.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/logical-search-indicator.cjs.entry.js +1 -1
- package/dist/cjs/lookupHelper-DACjrAcP.js +694 -0
- package/dist/cjs/map-component_2.cjs.entry.js +2 -2
- package/dist/cjs/primary-action-header_2.cjs.entry.js +4 -4
- package/dist/cjs/question-configs-renderer_4.cjs.entry.js +15 -15
- package/dist/cjs/resource-timeline-calendar.cjs.entry.js +1 -1
- package/dist/cjs/resource-timeline-primary-bar.cjs.entry.js +3 -3
- package/dist/cjs/rich-text-schema-Dhani4hA.js +58 -0
- package/dist/cjs/search-method-grid.cjs.entry.js +121 -264
- package/dist/cjs/server-side-grid.cjs.entry.js +85 -3
- package/dist/cjs/side-sheet-container.cjs.entry.js +1 -1
- package/dist/cjs/simple-card.cjs.entry.js +1 -1
- package/dist/cjs/status-chip_2.cjs.entry.js +2 -2
- package/dist/cjs/{status-renderer-9CQ-hhq8.js → status-renderer-be4boc5r.js} +83 -55
- package/dist/cjs/stencil-chip.cjs.entry.js +2 -2
- package/dist/cjs/stencil-library.cjs.js +1 -1
- package/dist/cjs/stencil-toggle.cjs.entry.js +4 -4
- package/dist/cjs/text-field_2.cjs.entry.js +7 -7
- package/dist/cjs/udp-adornment.cjs.entry.js +1 -1
- package/dist/cjs/udp-advanced-search-builder.cjs.entry.js +102 -5
- package/dist/cjs/udp-advanced-search-field-picker_3.cjs.entry.js +3 -3
- package/dist/cjs/udp-ag-area-chart.cjs.entry.js +2 -2
- package/dist/cjs/udp-ag-bar-chart_4.cjs.entry.js +5 -5
- package/dist/cjs/udp-ag-bubble-chart.cjs.entry.js +2 -2
- package/dist/cjs/udp-ag-combo-chart.cjs.entry.js +2 -2
- package/dist/cjs/udp-ag-donut-chart.cjs.entry.js +2 -2
- package/dist/cjs/udp-ag-line-chart.cjs.entry.js +2 -2
- package/dist/cjs/udp-ag-pie-chart.cjs.entry.js +2 -2
- package/dist/cjs/udp-ag-scatter-chart.cjs.entry.js +2 -2
- package/dist/cjs/udp-attachment-item_2.cjs.entry.js +1 -1
- package/dist/cjs/udp-attachment-list.cjs.entry.js +1 -1
- package/dist/cjs/udp-bar-chart.cjs.entry.js +1 -1
- package/dist/cjs/udp-calendar-base.cjs.entry.js +1 -1
- package/dist/cjs/udp-calendar-day.cjs.entry.js +1 -1
- package/dist/cjs/udp-calendar-month.cjs.entry.js +1 -1
- package/dist/cjs/udp-calendar-week.cjs.entry.js +1 -1
- package/dist/cjs/udp-calendar-year.cjs.entry.js +1 -1
- package/dist/cjs/udp-card-action-area.cjs.entry.js +1 -1
- package/dist/cjs/udp-card_6.cjs.entry.js +7 -7
- package/dist/cjs/udp-charts-example.cjs.entry.js +1 -1
- package/dist/cjs/udp-container-query-grid-item.cjs.entry.js +1 -1
- package/dist/cjs/udp-container-query-grid.cjs.entry.js +1 -1
- package/dist/cjs/udp-container-query.cjs.entry.js +2 -2
- package/dist/cjs/udp-container.cjs.entry.js +2 -2
- package/dist/cjs/{udp-detail-list_9.cjs.entry.js → udp-detail-list_10.cjs.entry.js} +606 -73
- package/dist/cjs/{udp-drive-utils-DM1l6XMm.js → udp-drive-utils-BuTLI35n.js} +1 -1
- package/dist/cjs/udp-dynamic-container-with-menu.cjs.entry.js +1 -1
- package/dist/cjs/udp-dynamic-form.cjs.entry.js +1 -1
- package/dist/cjs/udp-fluent-icon-picker.cjs.entry.js +2 -2
- package/dist/cjs/udp-fluent-inline-edit_5.cjs.entry.js +494 -45
- package/dist/cjs/udp-fluent-link.cjs.entry.js +1 -1
- package/dist/cjs/udp-fluent-list-item_2.cjs.entry.js +3 -3
- package/dist/cjs/{udp-form-api-utils-zMPk_IT1.js → udp-form-api-utils-ZY88igvH.js} +1 -1
- package/dist/cjs/udp-forms-builder-style-override.cjs.entry.js +1 -1
- package/dist/cjs/udp-forms-builder.cjs.entry.js +1 -1
- package/dist/cjs/udp-forms-follow-up-list-card.cjs.entry.js +2 -2
- package/dist/cjs/udp-forms-list-card.cjs.entry.js +4 -4
- package/dist/cjs/udp-forms-list.cjs.entry.js +3 -3
- package/dist/cjs/udp-forms-renderer.cjs.entry.js +4 -4
- package/dist/cjs/udp-import-sheet.cjs.entry.js +244 -0
- package/dist/cjs/udp-kpi-card.cjs.entry.js +1 -1
- package/dist/cjs/udp-kpi-cards.cjs.entry.js +2 -2
- package/dist/cjs/udp-map.cjs.entry.js +3 -3
- package/dist/cjs/udp-menu.cjs.entry.js +1 -1
- package/dist/cjs/udp-page.cjs.entry.js +1 -1
- package/dist/cjs/udp-question-form-builder.cjs.entry.js +35 -258
- package/dist/cjs/udp-rich-text-field.cjs.entry.js +28 -53
- package/dist/cjs/udp-rich-text.cjs.entry.js +61 -0
- package/dist/cjs/udp-sankey-chart.cjs.entry.js +1 -1
- package/dist/cjs/udp-sidebar-layout.cjs.entry.js +3 -3
- package/dist/cjs/udp-skeleton-loading.cjs.entry.js +1 -1
- package/dist/cjs/udp-split-screen.cjs.entry.js +1 -1
- package/dist/cjs/udp-stepper-actions.cjs.entry.js +1 -1
- package/dist/cjs/udp-stepper-content.cjs.entry.js +2 -2
- package/dist/cjs/udp-stepper-demo.cjs.entry.js +1 -1
- package/dist/cjs/udp-stepper-nav.cjs.entry.js +1 -1
- package/dist/cjs/udp-tab.cjs.entry.js +1 -1
- package/dist/cjs/udp-timeline-connector.cjs.entry.js +1 -1
- package/dist/cjs/udp-timeline-dot.cjs.entry.js +1 -1
- package/dist/cjs/udp-timeline-item.cjs.entry.js +2 -2
- package/dist/cjs/udp-timeline-separator.cjs.entry.js +1 -1
- package/dist/cjs/udp-timeline.cjs.entry.js +1 -1
- package/dist/cjs/udp-vertical-timeline-connector.cjs.entry.js +1 -1
- package/dist/cjs/udp-vertical-timeline-dot.cjs.entry.js +1 -1
- package/dist/cjs/udp-vertical-timeline-item.cjs.entry.js +2 -2
- package/dist/cjs/udp-vertical-timeline-separator.cjs.entry.js +1 -1
- package/dist/cjs/udp-vertical-timeline.cjs.entry.js +1 -1
- package/dist/cjs/udp-xy-chart.cjs.entry.js +1 -1
- package/dist/cjs/udp-xy-multi-series-chart.cjs.entry.js +1 -1
- package/dist/cjs/valueFormatters-CUoOypK3.js +17 -0
- package/dist/collection/__mocks__/jest-setup.js +3 -0
- package/dist/collection/collection-manifest.json +3 -0
- package/dist/collection/components/advanced-search/advanced-search-grouped.js +2 -2
- package/dist/collection/components/advanced-search/advanced-search.js +2 -2
- package/dist/collection/components/advanced-search/filter-conditions/filter-conditions.js +1 -1
- package/dist/collection/components/advanced-search/ui/logical-search-indicator/logical-search-indicator.js +1 -1
- package/dist/collection/components/advanced-search-builder/field-picker/field-picker.js +1 -1
- package/dist/collection/components/advanced-search-builder/field-picker-tree/field-picker-tree.js +2 -2
- package/dist/collection/components/advanced-search-builder/udp-advanced-search-builder.js +125 -2
- package/dist/collection/components/attachment-list/udp-attachment-list.js +1 -1
- package/dist/collection/components/buttons/icon-button/function-button/udp-function-button.js +1 -1
- package/dist/collection/components/buttons/icon-button/primary-button/custom-button.js +1 -1
- package/dist/collection/components/buttons/icon-button/radio-button/udp-radio-button.js +1 -1
- package/dist/collection/components/buttons/udp-button/udp-button.js +1 -1
- package/dist/collection/components/calendar/udp-calendar-base.js +1 -1
- package/dist/collection/components/calendar/udp-calendar-day.js +1 -1
- package/dist/collection/components/calendar/udp-calendar-month.js +1 -1
- package/dist/collection/components/calendar/udp-calendar-week.js +1 -1
- package/dist/collection/components/calendar/udp-calendar-year.js +1 -1
- package/dist/collection/components/charts/chart-kpi/chart-kpi.js +1 -1
- package/dist/collection/components/charts/udp-ag-area-chart/udp-ag-area-chart.js +2 -2
- package/dist/collection/components/charts/udp-ag-bar-chart/udp-ag-bar-chart.js +2 -2
- package/dist/collection/components/charts/udp-ag-bubble-chart/udp-ag-bubble-chart.js +2 -2
- package/dist/collection/components/charts/udp-ag-combo-chart/udp-ag-combo-chart.js +2 -2
- package/dist/collection/components/charts/udp-ag-donut-chart/udp-ag-donut-chart.js +2 -2
- package/dist/collection/components/charts/udp-ag-line-chart/udp-ag-line-chart.js +2 -2
- package/dist/collection/components/charts/udp-ag-pie-chart/udp-ag-pie-chart.js +2 -2
- package/dist/collection/components/charts/udp-ag-scatter-chart/udp-ag-scatter-chart.js +2 -2
- package/dist/collection/components/charts/udp-bar-chart/udp-bar-chart.js +1 -1
- package/dist/collection/components/charts/udp-charts-example.js +1 -1
- package/dist/collection/components/charts/udp-distribution-chart/udp-distribution-chart.js +1 -1
- package/dist/collection/components/charts/udp-donut-chart/udp-donut-chart.js +1 -1
- package/dist/collection/components/charts/udp-line-chart/udp-line-chart.js +1 -1
- package/dist/collection/components/charts/udp-sankey-chart/udp-sankey-chart.js +1 -1
- package/dist/collection/components/charts/udp-xy-chart/udp-xy-chart.js +1 -1
- package/dist/collection/components/charts/udp-xy-multi-series-chart/udp-xy-multi-series-chart.js +1 -1
- package/dist/collection/components/data-display/adornment/udp-adornment/udp-adornment.js +1 -1
- package/dist/collection/components/data-display/badge/udp-badge.js +1 -1
- package/dist/collection/components/data-display/cards/udp-ambient-card/udp-ambient-card.js +1 -1
- package/dist/collection/components/data-display/cards/udp-card/udp-card-action-area/udp-card-action-area.js +1 -1
- package/dist/collection/components/data-display/cards/udp-card/udp-card-actions/udp-card-actions.js +1 -1
- package/dist/collection/components/data-display/cards/udp-card/udp-card-content/udp-card-content.js +1 -1
- package/dist/collection/components/data-display/cards/udp-card/udp-card-header/udp-card-header.js +1 -1
- package/dist/collection/components/data-display/cards/udp-card/udp-card-media/udp-card-media.js +1 -1
- package/dist/collection/components/data-display/cards/udp-card/udp-card.js +3 -3
- package/dist/collection/components/data-display/chips/stencil-chip/status-chip/status-chip.js +1 -1
- package/dist/collection/components/data-display/chips/stencil-chip/stencil-chip.js +2 -2
- package/dist/collection/components/data-display/chips/udp-chip.js +1 -1
- package/dist/collection/components/data-display/detail-list-item/udp-detail-list-item.js +1 -1
- package/dist/collection/components/data-display/divider/udp-divider.js +1 -1
- package/dist/collection/components/data-display/empty-state-display/udp-empty-state-display.js +1 -1
- package/dist/collection/components/data-display/headers/udp-column-header.js +1 -1
- package/dist/collection/components/data-display/headers/udp-page-header/udp-page-header.js +1 -1
- package/dist/collection/components/data-display/hint-panel/hint-panel.js +1 -1
- package/dist/collection/components/data-display/kpi/kpi-list.js +1 -1
- package/dist/collection/components/data-display/kpi/udp-kpi-card.js +1 -1
- package/dist/collection/components/data-display/kpi/udp-kpi-cards.js +2 -2
- package/dist/collection/components/data-display/list-item/list-item.js +2 -2
- package/dist/collection/components/data-display/pop-over/udp-pop-over.js +1 -1
- package/dist/collection/components/data-display/pop-over-grid-action-header/udp-pop-over-grid-action-header.js +1 -1
- package/dist/collection/components/data-display/primary-action-header/primary-action-header.js +2 -2
- package/dist/collection/components/data-display/simple-card/simple-card.js +1 -1
- package/dist/collection/components/data-display/tool-tip/udp-ambient-tool-tip.js +2 -2
- package/dist/collection/components/data-display/tree/tree-list-item/search-item/search-list-item.js +1 -1
- package/dist/collection/components/data-display/udp-avatar/udp-avatar.js +1 -1
- package/dist/collection/components/dialogs/udp-dialog.js +1 -1
- package/dist/collection/components/drawers/udp-side-sheet/udp-side-sheet.js +9 -9
- package/dist/collection/components/export/udp-export-sheet/udp-export-sheet.css +0 -1
- package/dist/collection/components/export/udp-export-sheet/udp-export-sheet.js +10 -5
- package/dist/collection/components/feedback/udp-notification/alerts/upd-alert-banner.js +1 -1
- package/dist/collection/components/feedback/udp-notification/udp-notification.js +2 -2
- package/dist/collection/components/fluent-ui/autocomplete/udp-autocomplete.js +8 -8
- package/dist/collection/components/fluent-ui/avatar/udp-fluent-avatar.js +1 -1
- package/dist/collection/components/fluent-ui/badge/udp-fluent-badge.js +1 -1
- package/dist/collection/components/fluent-ui/button/udp-fluent-button.css +10 -0
- package/dist/collection/components/fluent-ui/button/udp-fluent-button.js +26 -1
- package/dist/collection/components/fluent-ui/card/udp-fluent-card.js +3 -3
- package/dist/collection/components/fluent-ui/checkbox/udp-fluent-checkbox.js +1 -1
- package/dist/collection/components/fluent-ui/compound-button/udp-compound-button.js +1 -1
- package/dist/collection/components/fluent-ui/counter-badge/udp-fluent-counter-badge.js +1 -1
- package/dist/collection/components/fluent-ui/date-time-input/udp-date-time-input.js +1 -1
- package/dist/collection/components/fluent-ui/dialog/udp-fluent-dialog.js +1 -1
- package/dist/collection/components/fluent-ui/divider/udp-fluent-divider.js +1 -1
- package/dist/collection/components/fluent-ui/domain-table-input/domain-table-snapshot.js +78 -0
- package/dist/collection/components/fluent-ui/domain-table-input/udp-fluent-domain-table-input.css +67 -0
- package/dist/collection/components/fluent-ui/domain-table-input/udp-fluent-domain-table-input.js +871 -0
- package/dist/collection/components/fluent-ui/domain-table-input/udp-fluent-domain-table-input.types.js +1 -0
- package/dist/collection/components/fluent-ui/drawer/udp-fluent-drawer.css +4 -0
- package/dist/collection/components/fluent-ui/drawer/udp-fluent-drawer.js +26 -1
- package/dist/collection/components/fluent-ui/dropdown/udp-fluent-dropdown.js +28 -10
- package/dist/collection/components/fluent-ui/empty-state/udp-empty-state.js +1 -1
- package/dist/collection/components/fluent-ui/file-input/udp-fluent-file-input.js +4 -4
- package/dist/collection/components/fluent-ui/icon/icon-grid/icon-grid.js +1 -1
- package/dist/collection/components/fluent-ui/icon/udp-fluent-icon.js +1 -1
- package/dist/collection/components/fluent-ui/icon-picker/udp-fluent-icon-picker.js +2 -2
- package/dist/collection/components/fluent-ui/image/udp-fluent-image.js +1 -1
- package/dist/collection/components/fluent-ui/inline-edit/udp-fluent-inline-edit.js +2 -2
- package/dist/collection/components/fluent-ui/link/udp-fluent-link.js +1 -1
- package/dist/collection/components/fluent-ui/list/udp-list.js +1 -1
- package/dist/collection/components/fluent-ui/list-input/udp-fluent-list-input.js +1 -1
- package/dist/collection/components/fluent-ui/list-item/udp-list-item.js +2 -2
- package/dist/collection/components/fluent-ui/location-input/udp-fluent-location-input.js +3 -3
- package/dist/collection/components/fluent-ui/menu/udp-fluent-menu.js +2 -2
- package/dist/collection/components/fluent-ui/message-bar/udp-message-bar.js +1 -1
- package/dist/collection/components/fluent-ui/number-input/udp-fluent-number-input.js +1 -1
- package/dist/collection/components/fluent-ui/popover/udp-popover.js +4 -4
- package/dist/collection/components/fluent-ui/progress-bar/udp-progress-bar.js +1 -1
- package/dist/collection/components/fluent-ui/radio-group/udp-fluent-radio-group.js +21 -8
- package/dist/collection/components/fluent-ui/rich-text/udp-rich-text.css +9 -0
- package/dist/collection/components/fluent-ui/rich-text/udp-rich-text.js +81 -0
- package/dist/collection/components/fluent-ui/rich-text-field/rich-text-content.css +97 -0
- package/dist/collection/components/fluent-ui/rich-text-field/rich-text-schema.js +39 -0
- package/dist/collection/components/fluent-ui/rich-text-field/udp-rich-text-field.css +1 -92
- package/dist/collection/components/fluent-ui/rich-text-field/udp-rich-text-field.js +12 -39
- package/dist/collection/components/fluent-ui/search-input/udp-search-input.css +6 -0
- package/dist/collection/components/fluent-ui/search-input/udp-search-input.js +3 -3
- package/dist/collection/components/fluent-ui/signature-input/udp-fluent-signature-input.js +4 -4
- package/dist/collection/components/fluent-ui/slider/udp-slider.js +1 -1
- package/dist/collection/components/fluent-ui/spinner/udp-spinner.js +1 -1
- package/dist/collection/components/fluent-ui/swatch-picker/udp-swatch-picker.js +1 -1
- package/dist/collection/components/fluent-ui/switch/udp-fluent-switch.js +1 -1
- package/dist/collection/components/fluent-ui/table-input/table-aggregates.js +57 -0
- package/dist/collection/components/fluent-ui/table-input/udp-fluent-table-input.js +12 -56
- package/dist/collection/components/fluent-ui/tablist/udp-fluent-tablist.js +13 -2
- package/dist/collection/components/fluent-ui/text/udp-text.js +1 -1
- package/dist/collection/components/fluent-ui/text-input/udp-fluent-text-input.js +2 -2
- package/dist/collection/components/fluent-ui/textarea/udp-textarea.js +2 -2
- package/dist/collection/components/fluent-ui/time-input/udp-time-input.js +7 -2
- package/dist/collection/components/fluent-ui/toggle-button/udp-fluent-toggle-button.js +1 -1
- package/dist/collection/components/fluent-ui/tooltip/udp-tooltip.js +2 -2
- package/dist/collection/components/fluent-ui/tree/udp-tree.js +1 -1
- package/dist/collection/components/forms/dynamic-form/udp-dynamic-form.js +1 -1
- package/dist/collection/components/forms/edit-view-form/edit-view-form.js +2 -2
- package/dist/collection/components/forms/form/stencil-form.js +1 -1
- package/dist/collection/components/forms/save-view-form/save-view-form.js +2 -2
- package/dist/collection/components/forms/udp-forms/udp-forms-builder/forms-question-item/udp-forms-builder-question-item.js +2 -2
- package/dist/collection/components/forms/udp-forms/udp-forms-builder/udp-forms-builder-item/file-upload-renderer/file-upload-renderer.js +4 -4
- package/dist/collection/components/forms/udp-forms/udp-forms-builder/udp-forms-builder-item/form-metadata-display-renderer/form-metadata-display-renderer.js +3 -3
- package/dist/collection/components/forms/udp-forms/udp-forms-builder/udp-forms-builder-item/list-option-renderer/list-options-renderer.js +3 -3
- package/dist/collection/components/forms/udp-forms/udp-forms-builder/udp-forms-builder-item/location-renderer/location-renderer.js +6 -6
- package/dist/collection/components/forms/udp-forms/udp-forms-builder/udp-forms-builder-item/question-configs-renderer/question-configs-renderer.js +7 -7
- package/dist/collection/components/forms/udp-forms/udp-forms-builder/udp-forms-builder-item/section-configs-renderer/section-configs-renderer.js +4 -4
- package/dist/collection/components/forms/udp-forms/udp-forms-builder/udp-forms-builder-item/signature-renderer/signature-renderer.js +1 -1
- package/dist/collection/components/forms/udp-forms/udp-forms-builder/udp-forms-builder-item/table-columns-renderer/table-columns-renderer.js +2 -2
- package/dist/collection/components/forms/udp-forms/udp-forms-builder/udp-forms-builder-item/text-input-renderer/text-input-renderer.js +2 -2
- package/dist/collection/components/forms/udp-forms/udp-forms-builder/udp-forms-builder-menu/udp-forms-builder-menu.js +2 -2
- package/dist/collection/components/forms/udp-forms/udp-forms-builder/udp-forms-builder-style-override/udp-forms-builder-style-override.js +1 -1
- package/dist/collection/components/forms/udp-forms/udp-forms-list/udp-forms-list-card/udp-forms-list-card.js +4 -4
- package/dist/collection/components/forms/udp-forms/udp-forms-list/udp-forms-list.js +1 -1
- package/dist/collection/components/forms/udp-forms/udp-forms-renderer/udp-forms-renderer-follow-up-list-card/udp-forms-follow-up-list-card.js +2 -2
- package/dist/collection/components/forms/udp-forms/udp-forms-renderer/udp-forms-renderer.js +1 -1
- package/dist/collection/components/forms/udp-forms/udp-question/table-input/table-input.js +1 -1
- package/dist/collection/components/forms/udp-question-form/__forms-harness__/fixtures/table-domain.fixtures.js +200 -0
- package/dist/collection/components/forms/udp-question-form/builder/components/configure-question-drawer.js +7 -1
- package/dist/collection/components/forms/udp-question-form/builder/components/questionConfig/typeSpecific/DomainTableConfig.js +309 -0
- package/dist/collection/components/forms/udp-question-form/builder/components/questionConfig/typeSpecific/TableConfig.js +32 -1
- package/dist/collection/components/forms/udp-question-form/builder/components/questionConfig/udp-question-config-fluent.css +50 -0
- package/dist/collection/components/forms/udp-question-form/builder/components/questionConfig/udp-question-config-fluent.js +33 -3
- package/dist/collection/components/forms/udp-question-form/builder/udp-question-form-builder.js +7 -1
- package/dist/collection/components/forms/udp-question-form/builder/utils/builder-api.js +85 -0
- package/dist/collection/components/forms/udp-question-form/core/field-properties-schemas/per-type/table.js +9 -1
- package/dist/collection/components/forms/udp-question-form/core/field-properties.js +6 -1
- package/dist/collection/components/forms/udp-question-form/core/validation/intrinsic.js +52 -3
- package/dist/collection/components/forms/udp-question-form/renderer/runtime/codecs.js +10 -4
- package/dist/collection/components/forms/udp-question-form/renderer/runtime/domain-table-snapshot.js +50 -0
- package/dist/collection/components/forms/udp-question-form/renderer/runtime/index.js +1 -0
- package/dist/collection/components/forms/udp-question-form/renderer/udp-question-form-renderer.js +62 -16
- package/dist/collection/components/forms/udp-question-form/renderer/ui/adapters/udp-question-tally-adapter.js +1 -1
- package/dist/collection/components/forms/udp-question-form/renderer/ui/form-shell.js +2 -1
- package/dist/collection/components/forms/udp-question-form/renderer/ui/question-renderer.js +7 -3
- package/dist/collection/components/forms/udp-question-form/renderer/ui/question-view-renderer.js +17 -11
- package/dist/collection/components/forms/udp-question-form/version-drawer/udp-form-version-drawer.js +1 -1
- package/dist/collection/components/grid/ambient-template-grid/ambient-template-grid.js +16 -16
- package/dist/collection/components/grid/grid-primary-bar/grid-primary-bar.js +2 -2
- package/dist/collection/components/grid/hotlists/udp-hotlist-form/udp-hotlist-form.js +1 -1
- package/dist/collection/components/grid/new-grid/ag-grid-base.css +7 -0
- package/dist/collection/components/grid/new-grid/ag-grid-base.js +13 -4
- package/dist/collection/components/grid/new-grid/api-method-instance-grid.js +27 -3
- package/dist/collection/components/grid/new-grid/client-side-grid.js +2 -2
- package/dist/collection/components/grid/new-grid/datasources/searchMethodDatasource.js +20 -6
- package/dist/collection/components/grid/new-grid/gridFunctions/advancedSearch.js +3 -2
- package/dist/collection/components/grid/new-grid/gridFunctions/savedViews.js +7 -5
- package/dist/collection/components/grid/new-grid/gridFunctions/udpExport.js +12 -1
- package/dist/collection/components/grid/new-grid/helperFunctions/buildSearchObject.js +17 -16
- package/dist/collection/components/grid/new-grid/helperFunctions/configureUdpColumnMods.js +23 -7
- package/dist/collection/components/grid/new-grid/helperFunctions/domainRowsHelper.js +177 -0
- package/dist/collection/components/grid/new-grid/helperFunctions/extraFieldsHelper.js +203 -0
- package/dist/collection/components/grid/new-grid/helperFunctions/lookupHelper.js +256 -16
- package/dist/collection/components/grid/new-grid/search-method-grid.js +124 -11
- package/dist/collection/components/grid/new-grid/server-side-grid.js +107 -4
- package/dist/collection/components/grid/renderers/actions-renderer.js +83 -55
- package/dist/collection/components/grid/renderers/input-renderer.js +66 -0
- package/dist/collection/components/grid/resource-timeline-calendar/resource-timeline-calendar.js +1 -1
- package/dist/collection/components/grid/resource-timeline-calendar/resource-timeline-primary-bar.js +3 -3
- package/dist/collection/components/import/udp-import-sheet/udp-import-sheet.css +38 -0
- package/dist/collection/components/import/udp-import-sheet/udp-import-sheet.js +425 -0
- package/dist/collection/components/inputs/address-search/address-search.js +3 -3
- package/dist/collection/components/inputs/checkbox/check-box.js +2 -2
- package/dist/collection/components/inputs/date-range-selector/udp-date-range-selector.js +2 -2
- package/dist/collection/components/inputs/date-selector/udp-date-selector.js +3 -3
- package/dist/collection/components/inputs/date-time-selector/udp-datetime-selector.js +3 -3
- package/dist/collection/components/inputs/file-upload/file-upload.js +4 -4
- package/dist/collection/components/inputs/form metadata display/form-metadata-display.js +1 -1
- package/dist/collection/components/inputs/image-upload/image-upload.js +1 -1
- package/dist/collection/components/inputs/numeric-field/numeric-field.js +3 -3
- package/dist/collection/components/inputs/signature-input/signature-input.js +2 -2
- package/dist/collection/components/inputs/tally/tally.js +2 -2
- package/dist/collection/components/inputs/text-area/text-area.js +3 -3
- package/dist/collection/components/inputs/text-field/text-field.js +3 -3
- package/dist/collection/components/inputs/time-selector/udp-time-selector.js +3 -3
- package/dist/collection/components/inputs/toggle/stencil-toggle.js +4 -4
- package/dist/collection/components/inputs/udp-selector/udp-selector.js +4 -4
- package/dist/collection/components/layout/primary-action-header/udp-primary-action-header.js +1 -1
- package/dist/collection/components/layout/udp-container/udp-container.js +2 -2
- package/dist/collection/components/layout/udp-container-query/udp-container-query.js +2 -2
- package/dist/collection/components/layout/udp-container-query-grid/udp-container-query-grid.js +1 -1
- package/dist/collection/components/layout/udp-container-query-grid-item/udp-container-query-grid-item.js +1 -1
- package/dist/collection/components/layout/udp-page/udp-page.js +1 -1
- package/dist/collection/components/layout/udp-sidebar-layout/udp-sidebar-layout.js +3 -3
- package/dist/collection/components/layout/udp-split-screen/udp-split-screen.js +1 -1
- package/dist/collection/components/layout/udp-vertical-spacer.js +1 -1
- package/dist/collection/components/loaders/udp-grid-loader/udp-grid-loader.js +2 -2
- package/dist/collection/components/loaders/udp-linear-loader/udp-linear-loader.js +1 -1
- package/dist/collection/components/loaders/udp-skeleton-loading.js +1 -1
- package/dist/collection/components/map/udp-map/map-component.js +1 -1
- package/dist/collection/components/map/udp-map/popups/add-map-feature-popup.js +3 -3
- package/dist/collection/components/map/udp-map/popups/feature-details-card/feature-details-card.js +4 -4
- package/dist/collection/components/map/udp-map/popups/feature-details-popup.js +1 -1
- package/dist/collection/components/map/udp-map/popups/select-layer-popup.js +2 -2
- package/dist/collection/components/map/udp-map/popups/split-line-popup.js +1 -1
- package/dist/collection/components/map/udp-map/toolbar/map-toolbar.js +2 -2
- package/dist/collection/components/map/udp-map/udp-map-toolbar.js +1 -1
- package/dist/collection/components/map/udp-map/udp-map.js +3 -3
- package/dist/collection/components/menu/menu-item/udp-menu-item.js +1 -1
- package/dist/collection/components/menu/udp-menu.js +1 -1
- package/dist/collection/components/new-form/field/udp-field.js +1 -1
- package/dist/collection/components/new-form/form/udp-form-component.js +2 -2
- package/dist/collection/components/stepper/udp-stepper-actions/udp-stepper-actions.js +1 -1
- package/dist/collection/components/stepper/udp-stepper-content/udp-stepper-content.js +2 -2
- package/dist/collection/components/stepper/udp-stepper-demo.js +1 -1
- package/dist/collection/components/stepper/udp-stepper-nav/udp-stepper-nav.js +1 -1
- package/dist/collection/components/tabs/tab/tabs/udp-tabs.js +2 -2
- package/dist/collection/components/tabs/tab/udp-tab.js +1 -1
- package/dist/collection/components/tabs/udp-tab-panel/udp-tab-panel.js +1 -2
- package/dist/collection/components/timeline/udp-timeline-connector.js +1 -1
- package/dist/collection/components/timeline/udp-timeline-dot.js +1 -1
- package/dist/collection/components/timeline/udp-timeline-item.js +2 -2
- package/dist/collection/components/timeline/udp-timeline-separator.js +1 -1
- package/dist/collection/components/timeline/udp-timeline.js +1 -1
- package/dist/collection/components/toolbars/app-bar/app-bar.js +1 -1
- package/dist/collection/components/util/ghost-render/ghost-render.js +1 -1
- package/dist/collection/components/util/lazy-loader/udp-lazy-loader.js +1 -1
- package/dist/collection/components/vertical-timeline/udp-vertical-timeline-connector.js +1 -1
- package/dist/collection/components/vertical-timeline/udp-vertical-timeline-dot.js +1 -1
- package/dist/collection/components/vertical-timeline/udp-vertical-timeline-item.js +2 -2
- package/dist/collection/components/vertical-timeline/udp-vertical-timeline-separator.js +1 -1
- package/dist/collection/components/vertical-timeline/udp-vertical-timeline.js +1 -1
- package/dist/collection/deprecated/components/side-sheet/side-sheet-container.js +1 -1
- package/dist/collection/deprecated/components/side-sheet/side-sheet.js +1 -1
- package/dist/collection/icons/fluent-icons.js +16 -0
- package/dist/collection/index.js +2 -0
- package/dist/collection/store/execution-store.js +6 -5
- package/dist/collection/test-pages/test-components-page.js +28 -28
- package/dist/collection/test-pages/test-form.js +4 -4
- package/dist/collection/udp-utilities/api-config/configService.js +0 -4
- package/dist/collection/udp-utilities/extra-fields/extraFields.js +94 -0
- package/dist/collection/udp-utilities/extra-fields/index.js +1 -0
- package/dist/collection/udp-utilities/layout/udp-dynamic-container-with-menu/chip-section/chip-section.js +2 -2
- package/dist/collection/udp-utilities/layout/udp-dynamic-container-with-menu/udp-dynamic-container-with-menu.js +1 -1
- package/dist/components/add-map-feature-popup2.js +1 -1
- package/dist/components/address-search2.js +1 -1
- package/dist/components/advanced-search-grouped2.js +1 -1
- package/dist/components/advanced-search2.js +1 -1
- package/dist/components/ag-grid-base2.js +1 -1
- package/dist/components/ambient-template-grid.js +1 -1
- package/dist/components/api-method-instance-grid.js +1 -1
- package/dist/components/apiMethodInstance.js +1 -1
- package/dist/components/apiUtils.js +1 -1
- package/dist/components/app-bar.js +1 -1
- package/dist/components/chart-kpi2.js +1 -1
- package/dist/components/check-box.js +1 -1
- package/dist/components/chip-section.js +1 -1
- package/dist/components/client-side-grid2.js +1 -1
- package/dist/components/configService.js +1 -1
- package/dist/components/configureUdpColumnMods.js +1 -1
- package/dist/components/convertBackendTypeToAgGridType.js +1 -0
- package/dist/components/custom-button2.js +1 -1
- package/dist/components/edit-view-form.js +1 -1
- package/dist/components/extraFields.js +1 -0
- package/dist/components/feature-details-card2.js +1 -1
- package/dist/components/feature-details-popup2.js +1 -1
- package/dist/components/field-picker-tree.js +1 -1
- package/dist/components/field-picker.js +1 -1
- package/dist/components/file-upload-renderer2.js +1 -1
- package/dist/components/file-upload2.js +1 -1
- package/dist/components/filter-conditions2.js +1 -1
- package/dist/components/fluent-icons.js +1 -1
- package/dist/components/form-metadata-display-renderer2.js +1 -1
- package/dist/components/form-metadata-display2.js +1 -1
- package/dist/components/getCachedAzureMapsProviders.js +1 -1
- package/dist/components/ghost-render2.js +1 -1
- package/dist/components/grid-primary-bar2.js +1 -1
- package/dist/components/hint-panel2.js +1 -1
- package/dist/components/icon-grid2.js +1 -1
- package/dist/components/image-upload2.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/kpi-list2.js +1 -1
- package/dist/components/list-item.js +1 -1
- package/dist/components/list-options-renderer2.js +1 -1
- package/dist/components/location-renderer2.js +1 -1
- package/dist/components/logical-search-indicator.js +1 -1
- package/dist/components/lookup.js +1 -0
- package/dist/components/map-component2.js +1 -1
- package/dist/components/map-toolbar2.js +1 -1
- package/dist/components/numeric-field2.js +1 -1
- package/dist/components/primary-action-header2.js +1 -1
- package/dist/components/question-configs-renderer2.js +1 -1
- package/dist/components/resource-timeline-calendar.js +1 -1
- package/dist/components/resource-timeline-primary-bar2.js +1 -1
- package/dist/components/rich-text-schema.js +1 -0
- package/dist/components/save-view-form.js +1 -1
- package/dist/components/search-list-item2.js +1 -1
- package/dist/components/search-method-grid2.js +1 -1
- package/dist/components/section-configs-renderer2.js +1 -1
- package/dist/components/select-layer-popup2.js +1 -1
- package/dist/components/server-side-grid2.js +1 -1
- package/dist/components/side-sheet-container2.js +1 -1
- package/dist/components/side-sheet2.js +1 -1
- package/dist/components/signature-input2.js +1 -1
- package/dist/components/signature-renderer2.js +1 -1
- package/dist/components/simple-card.js +1 -1
- package/dist/components/split-line-popup2.js +1 -1
- package/dist/components/status-chip2.js +1 -1
- package/dist/components/status-renderer.js +1 -1
- package/dist/components/stencil-chip2.js +1 -1
- package/dist/components/stencil-form2.js +1 -1
- package/dist/components/stencil-toggle2.js +1 -1
- package/dist/components/table-aggregates.js +1 -0
- package/dist/components/table-columns-renderer2.js +1 -1
- package/dist/components/table-input2.js +1 -1
- package/dist/components/tally.js +1 -1
- package/dist/components/test-components-page.js +1 -1
- package/dist/components/test-form2.js +1 -1
- package/dist/components/text-area2.js +1 -1
- package/dist/components/text-field2.js +1 -1
- package/dist/components/text-input-renderer2.js +1 -1
- package/dist/components/types.js +1 -1
- package/dist/components/udp-adornment2.js +1 -1
- package/dist/components/udp-advanced-search-builder.js +1 -1
- package/dist/components/udp-ag-area-chart.js +1 -1
- package/dist/components/udp-ag-bar-chart2.js +1 -1
- package/dist/components/udp-ag-bubble-chart.js +1 -1
- package/dist/components/udp-ag-combo-chart.js +1 -1
- package/dist/components/udp-ag-donut-chart.js +1 -1
- package/dist/components/udp-ag-line-chart.js +1 -1
- package/dist/components/udp-ag-pie-chart.js +1 -1
- package/dist/components/udp-ag-scatter-chart.js +1 -1
- package/dist/components/udp-ambient-card2.js +1 -1
- package/dist/components/udp-ambient-tool-tip2.js +1 -1
- package/dist/components/udp-attachment-list.js +1 -1
- package/dist/components/udp-autocomplete2.js +1 -1
- package/dist/components/udp-avatar2.js +1 -1
- package/dist/components/udp-badge2.js +1 -1
- package/dist/components/udp-bar-chart.js +1 -1
- package/dist/components/udp-button2.js +1 -1
- package/dist/components/udp-calendar-base2.js +1 -1
- package/dist/components/udp-calendar-day.js +1 -1
- package/dist/components/udp-calendar-month.js +1 -1
- package/dist/components/udp-calendar-week.js +1 -1
- package/dist/components/udp-calendar-year.js +1 -1
- package/dist/components/udp-card-action-area.js +1 -1
- package/dist/components/udp-card-actions2.js +1 -1
- package/dist/components/udp-card-content2.js +1 -1
- package/dist/components/udp-card-header2.js +1 -1
- package/dist/components/udp-card-media2.js +1 -1
- package/dist/components/udp-card2.js +1 -1
- package/dist/components/udp-charts-example.js +1 -1
- package/dist/components/udp-chip2.js +1 -1
- package/dist/components/udp-column-header2.js +1 -1
- package/dist/components/udp-compound-button2.js +1 -1
- package/dist/components/udp-container-query-grid-item.js +1 -1
- package/dist/components/udp-container-query-grid2.js +1 -1
- package/dist/components/udp-container-query2.js +1 -1
- package/dist/components/udp-container2.js +1 -1
- package/dist/components/udp-date-range-selector2.js +1 -1
- package/dist/components/udp-date-selector2.js +1 -1
- package/dist/components/udp-date-time-input2.js +1 -1
- package/dist/components/udp-datetime-selector2.js +1 -1
- package/dist/components/udp-detail-list-item2.js +1 -1
- package/dist/components/udp-dialog2.js +1 -1
- package/dist/components/udp-distribution-chart2.js +1 -1
- package/dist/components/udp-divider2.js +1 -1
- package/dist/components/udp-donut-chart2.js +1 -1
- package/dist/components/udp-dynamic-container-with-menu2.js +1 -1
- package/dist/components/udp-dynamic-form.js +1 -1
- package/dist/components/udp-empty-state-display2.js +1 -1
- package/dist/components/udp-empty-state2.js +1 -1
- package/dist/components/udp-export-sheet2.js +1 -1
- package/dist/components/udp-field2.js +1 -1
- package/dist/components/udp-fluent-avatar2.js +1 -1
- package/dist/components/udp-fluent-badge2.js +1 -1
- package/dist/components/udp-fluent-button2.js +1 -1
- package/dist/components/udp-fluent-card2.js +1 -1
- package/dist/components/udp-fluent-checkbox2.js +1 -1
- package/dist/components/udp-fluent-counter-badge2.js +1 -1
- package/dist/components/udp-fluent-dialog2.js +1 -1
- package/dist/components/udp-fluent-divider2.js +1 -1
- package/dist/components/udp-fluent-domain-table-input.d.ts +11 -0
- package/dist/components/udp-fluent-domain-table-input.js +2 -0
- package/dist/components/udp-fluent-domain-table-input2.js +1 -0
- package/dist/components/udp-fluent-drawer2.js +1 -1
- package/dist/components/udp-fluent-dropdown2.js +1 -1
- package/dist/components/udp-fluent-file-input2.js +1 -1
- package/dist/components/udp-fluent-icon-picker.js +1 -1
- package/dist/components/udp-fluent-icon2.js +1 -1
- package/dist/components/udp-fluent-image2.js +1 -1
- package/dist/components/udp-fluent-inline-edit2.js +1 -1
- package/dist/components/udp-fluent-link.js +1 -1
- package/dist/components/udp-fluent-list-input2.js +1 -1
- package/dist/components/udp-fluent-location-input2.js +1 -1
- package/dist/components/udp-fluent-menu2.js +1 -1
- package/dist/components/udp-fluent-number-input.js +1 -1
- package/dist/components/udp-fluent-number-input2.js +1 -0
- package/dist/components/udp-fluent-radio-group2.js +1 -1
- package/dist/components/udp-fluent-signature-input2.js +1 -1
- package/dist/components/udp-fluent-switch2.js +1 -1
- package/dist/components/udp-fluent-table-input2.js +1 -1
- package/dist/components/udp-fluent-tablist2.js +1 -1
- package/dist/components/udp-fluent-text-input2.js +1 -1
- package/dist/components/udp-fluent-toggle-button2.js +1 -1
- package/dist/components/udp-form-component2.js +1 -1
- package/dist/components/udp-form-version-drawer2.js +1 -1
- package/dist/components/udp-forms-builder-menu2.js +1 -1
- package/dist/components/udp-forms-builder-question-item2.js +1 -1
- package/dist/components/udp-forms-builder-style-override.js +1 -1
- package/dist/components/udp-forms-follow-up-list-card.js +1 -1
- package/dist/components/udp-forms-list-card2.js +1 -1
- package/dist/components/udp-forms-list.js +1 -1
- package/dist/components/udp-forms-renderer.js +1 -1
- package/dist/components/udp-forms-ui2.js +1 -1
- package/dist/components/udp-function-button2.js +1 -1
- package/dist/components/udp-grid-loader2.js +1 -1
- package/dist/components/udp-hotlist-form2.js +1 -1
- package/dist/components/udp-import-sheet.d.ts +11 -0
- package/dist/components/udp-import-sheet.js +2 -0
- package/dist/components/udp-kpi-card2.js +1 -1
- package/dist/components/udp-kpi-cards.js +1 -1
- package/dist/components/udp-lazy-loader2.js +1 -1
- package/dist/components/udp-line-chart2.js +1 -1
- package/dist/components/udp-linear-loader2.js +1 -1
- package/dist/components/udp-list-item2.js +1 -1
- package/dist/components/udp-list2.js +1 -1
- package/dist/components/udp-map-toolbar2.js +1 -1
- package/dist/components/udp-map.js +1 -1
- package/dist/components/udp-menu-item2.js +1 -1
- package/dist/components/udp-menu.js +1 -1
- package/dist/components/udp-message-bar2.js +1 -1
- package/dist/components/udp-notification2.js +1 -1
- package/dist/components/udp-page-header2.js +1 -1
- package/dist/components/udp-page.js +1 -1
- package/dist/components/udp-pop-over-grid-action-header2.js +1 -1
- package/dist/components/udp-pop-over2.js +1 -1
- package/dist/components/udp-popover2.js +1 -1
- package/dist/components/udp-primary-action-header2.js +1 -1
- package/dist/components/udp-progress-bar2.js +1 -1
- package/dist/components/udp-question-config-fluent2.js +1 -1
- package/dist/components/udp-question-form-builder.js +1 -1
- package/dist/components/udp-question-form-renderer2.js +1 -1
- package/dist/components/udp-question-tally-adapter2.js +1 -1
- package/dist/components/udp-question2.js +1 -1
- package/dist/components/udp-radio-button2.js +1 -1
- package/dist/components/udp-rich-text-field.js +1 -1
- package/dist/components/udp-rich-text.d.ts +11 -0
- package/dist/components/udp-rich-text.js +2 -0
- package/dist/components/udp-sankey-chart.js +1 -1
- package/dist/components/udp-search-input2.js +1 -1
- package/dist/components/udp-selector2.js +1 -1
- package/dist/components/udp-side-sheet2.js +1 -1
- package/dist/components/udp-sidebar-layout2.js +1 -1
- package/dist/components/udp-skeleton-loading2.js +1 -1
- package/dist/components/udp-slider2.js +1 -1
- package/dist/components/udp-spinner2.js +1 -1
- package/dist/components/udp-split-screen.js +1 -1
- package/dist/components/udp-stepper-actions.js +1 -1
- package/dist/components/udp-stepper-content.js +1 -1
- package/dist/components/udp-stepper-demo.js +1 -1
- package/dist/components/udp-stepper-nav.js +1 -1
- package/dist/components/udp-swatch-picker2.js +1 -1
- package/dist/components/udp-tab-panel2.js +1 -1
- package/dist/components/udp-tab.js +1 -1
- package/dist/components/udp-tabs2.js +1 -1
- package/dist/components/udp-text2.js +1 -1
- package/dist/components/udp-textarea2.js +1 -1
- package/dist/components/udp-time-input2.js +1 -1
- package/dist/components/udp-time-selector2.js +1 -1
- package/dist/components/udp-timeline-connector.js +1 -1
- package/dist/components/udp-timeline-dot.js +1 -1
- package/dist/components/udp-timeline-item.js +1 -1
- package/dist/components/udp-timeline-separator.js +1 -1
- package/dist/components/udp-timeline.js +1 -1
- package/dist/components/udp-tooltip2.js +1 -1
- package/dist/components/udp-tree2.js +1 -1
- package/dist/components/udp-vertical-spacer2.js +1 -1
- package/dist/components/udp-vertical-timeline-connector.js +1 -1
- package/dist/components/udp-vertical-timeline-dot.js +1 -1
- package/dist/components/udp-vertical-timeline-item.js +1 -1
- package/dist/components/udp-vertical-timeline-separator.js +1 -1
- package/dist/components/udp-vertical-timeline.js +1 -1
- package/dist/components/udp-xy-chart2.js +1 -1
- package/dist/components/udp-xy-multi-series-chart.js +1 -1
- package/dist/components/upd-alert-banner2.js +1 -1
- package/dist/docs.json +1805 -112
- package/dist/esm/{SearchBuilder-BmqrJvtz.js → SearchBuilder-BxLXFEeR.js} +1 -1
- package/dist/esm/add-map-feature-popup_4.entry.js +8 -8
- package/dist/esm/address-search_6.entry.js +19 -19
- package/dist/esm/advanced-search_12.entry.js +20 -20
- package/dist/esm/{ag-grid-base_65.entry.js → ag-grid-base_66.entry.js} +450 -176
- package/dist/esm/ambient-template-grid.entry.js +20 -20
- package/dist/esm/api-method-instance-grid.entry.js +10 -9
- package/dist/esm/{apiMethodInstance-BunReWfq.js → apiMethodInstance-qaGbXDNr.js} +2 -31
- package/dist/esm/{apiUtils-Cq-WuEqc.js → apiUtils-CXqsYwOQ.js} +29 -28
- package/dist/esm/app-bar.entry.js +1 -1
- package/dist/esm/{catalog-store-CLsDGUEl.js → catalog-store-BOpo_zaC.js} +1 -1
- package/dist/esm/chart-container_3.entry.js +2 -2
- package/dist/esm/check-box.entry.js +2 -2
- package/dist/esm/chip-section.entry.js +2 -2
- package/dist/esm/{codecs-CI_fHfY1.js → codecs-BWyrM561.js} +400 -9
- package/dist/esm/{configService-D_9j963S.js → configService-CehZzjhw.js} +0 -4
- package/dist/esm/{configureUdpColumnMods-UWccWlH6.js → configureUdpColumnMods-bMO0_--H.js} +23 -7
- package/dist/esm/convertBackendTypeToAgGridType-B8xfl_wR.js +31 -0
- package/dist/esm/{createAzureMapsProviders-CLLCmr8f.js → createAzureMapsProviders-CtQryp1H.js} +13 -1
- package/dist/esm/custom-button.entry.js +1 -1
- package/dist/esm/date-time-renderer_9.entry.js +21 -21
- package/dist/esm/domain-table-snapshot-H3o5mjFB.js +331 -0
- package/dist/esm/extraFields-Cnpy_Bm7.js +97 -0
- package/dist/esm/extraFieldsHelper-CaBMA4HJ.js +205 -0
- package/dist/esm/feature-details-card_2.entry.js +5 -5
- package/dist/esm/file-upload_2.entry.js +7 -7
- package/dist/esm/filter-conditions_7.entry.js +7 -7
- package/dist/esm/{fluent-icons-pWFJyrRm.js → fluent-icons-wRyOZqj2.js} +20 -0
- package/dist/esm/form-metadata-display_2.entry.js +3 -3
- package/dist/esm/getCurrentApiCatalogId-DeurXd9l.js +5 -0
- package/dist/esm/icon-grid.entry.js +2 -2
- package/dist/esm/image-upload_8.entry.js +7 -7
- package/dist/esm/index-15aY63VA.js +12 -8
- package/dist/esm/index.js +13 -22
- package/dist/esm/{load-icons-BHSNRRRA.js → load-icons-D2ZhiHp6.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/logical-search-indicator.entry.js +1 -1
- package/dist/esm/lookupHelper-D3LSjaES.js +682 -0
- package/dist/esm/map-component_2.entry.js +2 -2
- package/dist/esm/primary-action-header_2.entry.js +4 -4
- package/dist/esm/question-configs-renderer_4.entry.js +15 -15
- package/dist/esm/resource-timeline-calendar.entry.js +1 -1
- package/dist/esm/resource-timeline-primary-bar.entry.js +3 -3
- package/dist/esm/rich-text-schema-DCUYo610.js +42 -0
- package/dist/esm/search-method-grid.entry.js +120 -263
- package/dist/esm/server-side-grid.entry.js +85 -3
- package/dist/esm/side-sheet-container.entry.js +1 -1
- package/dist/esm/simple-card.entry.js +1 -1
- package/dist/esm/status-chip_2.entry.js +2 -2
- package/dist/esm/{status-renderer-BoY7sar9.js → status-renderer-Evo0rTNU.js} +83 -55
- package/dist/esm/stencil-chip.entry.js +2 -2
- package/dist/esm/stencil-library.js +1 -1
- package/dist/esm/stencil-toggle.entry.js +4 -4
- package/dist/esm/text-field_2.entry.js +7 -7
- package/dist/esm/{types-C9Z-dgvN.js → types-NqFGtWPW.js} +1 -1
- package/dist/esm/udp-adornment.entry.js +1 -1
- package/dist/esm/udp-advanced-search-builder.entry.js +102 -5
- package/dist/esm/udp-advanced-search-field-picker_3.entry.js +3 -3
- package/dist/esm/udp-ag-area-chart.entry.js +2 -2
- package/dist/esm/udp-ag-bar-chart_4.entry.js +5 -5
- package/dist/esm/udp-ag-bubble-chart.entry.js +2 -2
- package/dist/esm/udp-ag-combo-chart.entry.js +2 -2
- package/dist/esm/udp-ag-donut-chart.entry.js +2 -2
- package/dist/esm/udp-ag-line-chart.entry.js +2 -2
- package/dist/esm/udp-ag-pie-chart.entry.js +2 -2
- package/dist/esm/udp-ag-scatter-chart.entry.js +2 -2
- package/dist/esm/udp-attachment-item_2.entry.js +1 -1
- package/dist/esm/udp-attachment-list.entry.js +1 -1
- package/dist/esm/udp-bar-chart.entry.js +1 -1
- package/dist/esm/udp-calendar-base.entry.js +1 -1
- package/dist/esm/udp-calendar-day.entry.js +1 -1
- package/dist/esm/udp-calendar-month.entry.js +1 -1
- package/dist/esm/udp-calendar-week.entry.js +1 -1
- package/dist/esm/udp-calendar-year.entry.js +1 -1
- package/dist/esm/udp-card-action-area.entry.js +1 -1
- package/dist/esm/udp-card_6.entry.js +7 -7
- package/dist/esm/udp-charts-example.entry.js +1 -1
- package/dist/esm/udp-container-query-grid-item.entry.js +1 -1
- package/dist/esm/udp-container-query-grid.entry.js +1 -1
- package/dist/esm/udp-container-query.entry.js +2 -2
- package/dist/esm/udp-container.entry.js +2 -2
- package/dist/esm/{udp-detail-list_9.entry.js → udp-detail-list_10.entry.js} +606 -74
- package/dist/esm/{udp-drive-utils-DCivw3gq.js → udp-drive-utils-BVTuKAND.js} +1 -1
- package/dist/esm/udp-dynamic-container-with-menu.entry.js +1 -1
- package/dist/esm/udp-dynamic-form.entry.js +1 -1
- package/dist/esm/udp-fluent-icon-picker.entry.js +2 -2
- package/dist/esm/udp-fluent-inline-edit_5.entry.js +491 -42
- package/dist/esm/udp-fluent-link.entry.js +1 -1
- package/dist/esm/udp-fluent-list-item_2.entry.js +3 -3
- package/dist/esm/{udp-form-api-utils-HJ_eUZkX.js → udp-form-api-utils-Bq7Txu0h.js} +1 -1
- package/dist/esm/udp-forms-builder-style-override.entry.js +1 -1
- package/dist/esm/udp-forms-builder.entry.js +1 -1
- package/dist/esm/udp-forms-follow-up-list-card.entry.js +2 -2
- package/dist/esm/udp-forms-list-card.entry.js +4 -4
- package/dist/esm/udp-forms-list.entry.js +3 -3
- package/dist/esm/udp-forms-renderer.entry.js +4 -4
- package/dist/esm/udp-import-sheet.entry.js +242 -0
- package/dist/esm/udp-kpi-card.entry.js +1 -1
- package/dist/esm/udp-kpi-cards.entry.js +2 -2
- package/dist/esm/udp-map.entry.js +3 -3
- package/dist/esm/udp-menu.entry.js +1 -1
- package/dist/esm/udp-page.entry.js +1 -1
- package/dist/esm/udp-question-form-builder.entry.js +28 -251
- package/dist/esm/udp-rich-text-field.entry.js +28 -39
- package/dist/esm/udp-rich-text.entry.js +59 -0
- package/dist/esm/udp-sankey-chart.entry.js +1 -1
- package/dist/esm/udp-sidebar-layout.entry.js +3 -3
- package/dist/esm/udp-skeleton-loading.entry.js +1 -1
- package/dist/esm/udp-split-screen.entry.js +1 -1
- package/dist/esm/udp-stepper-actions.entry.js +1 -1
- package/dist/esm/udp-stepper-content.entry.js +2 -2
- package/dist/esm/udp-stepper-demo.entry.js +1 -1
- package/dist/esm/udp-stepper-nav.entry.js +1 -1
- package/dist/esm/udp-tab.entry.js +1 -1
- package/dist/esm/udp-timeline-connector.entry.js +1 -1
- package/dist/esm/udp-timeline-dot.entry.js +1 -1
- package/dist/esm/udp-timeline-item.entry.js +2 -2
- package/dist/esm/udp-timeline-separator.entry.js +1 -1
- package/dist/esm/udp-timeline.entry.js +1 -1
- package/dist/esm/udp-vertical-timeline-connector.entry.js +1 -1
- package/dist/esm/udp-vertical-timeline-dot.entry.js +1 -1
- package/dist/esm/udp-vertical-timeline-item.entry.js +2 -2
- package/dist/esm/udp-vertical-timeline-separator.entry.js +1 -1
- package/dist/esm/udp-vertical-timeline.entry.js +1 -1
- package/dist/esm/udp-xy-chart.entry.js +1 -1
- package/dist/esm/udp-xy-multi-series-chart.entry.js +1 -1
- package/dist/esm/valueFormatters-BbY_Q8IE.js +15 -0
- package/dist/stencil-library/{SearchBuilder-BmqrJvtz.js → SearchBuilder-BxLXFEeR.js} +1 -1
- package/dist/stencil-library/add-map-feature-popup_4.entry.js +1 -1
- package/dist/stencil-library/address-search_6.entry.js +1 -1
- package/dist/stencil-library/advanced-search_12.entry.js +1 -1
- package/dist/stencil-library/ag-grid-base_66.entry.js +1 -0
- package/dist/stencil-library/ambient-template-grid.entry.js +1 -1
- package/dist/stencil-library/api-method-instance-grid.entry.js +1 -1
- package/dist/stencil-library/apiMethodInstance-qaGbXDNr.js +1 -0
- package/dist/stencil-library/apiUtils-CXqsYwOQ.js +1 -0
- package/dist/stencil-library/app-bar.entry.js +1 -1
- package/dist/stencil-library/{catalog-store-CLsDGUEl.js → catalog-store-BOpo_zaC.js} +1 -1
- package/dist/stencil-library/chart-container_3.entry.js +1 -1
- package/dist/stencil-library/check-box.entry.js +1 -1
- package/dist/stencil-library/chip-section.entry.js +1 -1
- package/dist/stencil-library/codecs-BWyrM561.js +1 -0
- package/dist/stencil-library/configService-CehZzjhw.js +1 -0
- package/dist/stencil-library/configureUdpColumnMods-bMO0_--H.js +1 -0
- package/dist/stencil-library/convertBackendTypeToAgGridType-B8xfl_wR.js +1 -0
- package/dist/stencil-library/createAzureMapsProviders-CtQryp1H.js +1 -0
- package/dist/stencil-library/custom-button.entry.js +1 -1
- package/dist/stencil-library/date-time-renderer_9.entry.js +1 -1
- package/dist/stencil-library/domain-table-snapshot-H3o5mjFB.js +1 -0
- package/dist/stencil-library/extraFields-Cnpy_Bm7.js +1 -0
- package/dist/stencil-library/extraFieldsHelper-CaBMA4HJ.js +1 -0
- package/dist/stencil-library/feature-details-card_2.entry.js +1 -1
- package/dist/stencil-library/file-upload_2.entry.js +1 -1
- package/dist/stencil-library/filter-conditions_7.entry.js +1 -1
- package/dist/stencil-library/fluent-icons-wRyOZqj2.js +1 -0
- package/dist/stencil-library/form-metadata-display_2.entry.js +1 -1
- package/dist/stencil-library/getCurrentApiCatalogId-DeurXd9l.js +1 -0
- package/dist/stencil-library/icon-grid.entry.js +1 -1
- package/dist/stencil-library/image-upload_8.entry.js +1 -1
- package/dist/stencil-library/index.esm.js +1 -1
- package/dist/stencil-library/load-icons-D2ZhiHp6.js +1 -0
- package/dist/stencil-library/logical-search-indicator.entry.js +1 -1
- package/dist/stencil-library/lookupHelper-D3LSjaES.js +1 -0
- package/dist/stencil-library/map-component_2.entry.js +1 -1
- package/dist/stencil-library/primary-action-header_2.entry.js +1 -1
- package/dist/stencil-library/question-configs-renderer_4.entry.js +1 -1
- package/dist/stencil-library/resource-timeline-calendar.entry.js +1 -1
- package/dist/stencil-library/resource-timeline-primary-bar.entry.js +1 -1
- package/dist/stencil-library/rich-text-schema-DCUYo610.js +1 -0
- package/dist/stencil-library/search-method-grid.entry.js +1 -1
- package/dist/stencil-library/server-side-grid.entry.js +1 -1
- package/dist/stencil-library/side-sheet-container.entry.js +1 -1
- package/dist/stencil-library/simple-card.entry.js +1 -1
- package/dist/stencil-library/status-chip_2.entry.js +1 -1
- package/dist/stencil-library/status-renderer-Evo0rTNU.js +1 -0
- package/dist/stencil-library/stencil-chip.entry.js +1 -1
- package/dist/stencil-library/stencil-library.esm.js +1 -1
- package/dist/stencil-library/stencil-toggle.entry.js +1 -1
- package/dist/stencil-library/text-field_2.entry.js +1 -1
- package/dist/stencil-library/{types-C9Z-dgvN.js → types-NqFGtWPW.js} +1 -1
- package/dist/stencil-library/udp-adornment.entry.js +1 -1
- package/dist/stencil-library/udp-advanced-search-builder.entry.js +1 -1
- package/dist/stencil-library/udp-advanced-search-field-picker_3.entry.js +1 -1
- package/dist/stencil-library/udp-ag-area-chart.entry.js +1 -1
- package/dist/stencil-library/udp-ag-bar-chart_4.entry.js +1 -1
- package/dist/stencil-library/udp-ag-bubble-chart.entry.js +1 -1
- package/dist/stencil-library/udp-ag-combo-chart.entry.js +1 -1
- package/dist/stencil-library/udp-ag-donut-chart.entry.js +1 -1
- package/dist/stencil-library/udp-ag-line-chart.entry.js +1 -1
- package/dist/stencil-library/udp-ag-pie-chart.entry.js +1 -1
- package/dist/stencil-library/udp-ag-scatter-chart.entry.js +1 -1
- package/dist/stencil-library/udp-attachment-item_2.entry.js +1 -1
- package/dist/stencil-library/udp-attachment-list.entry.js +1 -1
- package/dist/stencil-library/udp-bar-chart.entry.js +1 -1
- package/dist/stencil-library/udp-calendar-base.entry.js +1 -1
- package/dist/stencil-library/udp-calendar-day.entry.js +1 -1
- package/dist/stencil-library/udp-calendar-month.entry.js +1 -1
- package/dist/stencil-library/udp-calendar-week.entry.js +1 -1
- package/dist/stencil-library/udp-calendar-year.entry.js +1 -1
- package/dist/stencil-library/udp-card-action-area.entry.js +1 -1
- package/dist/stencil-library/udp-card_6.entry.js +1 -1
- package/dist/stencil-library/udp-charts-example.entry.js +1 -1
- package/dist/stencil-library/udp-container-query-grid-item.entry.js +1 -1
- package/dist/stencil-library/udp-container-query-grid.entry.js +1 -1
- package/dist/stencil-library/udp-container-query.entry.js +1 -1
- package/dist/stencil-library/udp-container.entry.js +1 -1
- package/dist/stencil-library/udp-detail-list_10.entry.js +1 -0
- package/dist/stencil-library/{udp-drive-utils-DCivw3gq.js → udp-drive-utils-BVTuKAND.js} +1 -1
- package/dist/stencil-library/udp-dynamic-container-with-menu.entry.js +1 -1
- package/dist/stencil-library/udp-dynamic-form.entry.js +1 -1
- package/dist/stencil-library/udp-fluent-icon-picker.entry.js +1 -1
- package/dist/stencil-library/udp-fluent-inline-edit_5.entry.js +1 -1
- package/dist/stencil-library/udp-fluent-link.entry.js +1 -1
- package/dist/stencil-library/udp-fluent-list-item_2.entry.js +1 -1
- package/dist/stencil-library/{udp-form-api-utils-HJ_eUZkX.js → udp-form-api-utils-Bq7Txu0h.js} +1 -1
- package/dist/stencil-library/udp-forms-builder-style-override.entry.js +1 -1
- package/dist/stencil-library/udp-forms-builder.entry.js +1 -1
- package/dist/stencil-library/udp-forms-follow-up-list-card.entry.js +1 -1
- package/dist/stencil-library/udp-forms-list-card.entry.js +1 -1
- package/dist/stencil-library/udp-forms-list.entry.js +1 -1
- package/dist/stencil-library/udp-forms-renderer.entry.js +1 -1
- package/dist/stencil-library/udp-import-sheet.entry.js +1 -0
- package/dist/stencil-library/udp-kpi-card.entry.js +1 -1
- package/dist/stencil-library/udp-kpi-cards.entry.js +1 -1
- package/dist/stencil-library/udp-map.entry.js +1 -1
- package/dist/stencil-library/udp-menu.entry.js +1 -1
- package/dist/stencil-library/udp-page.entry.js +1 -1
- package/dist/stencil-library/udp-question-form-builder.entry.js +1 -1
- package/dist/stencil-library/udp-rich-text-field.entry.js +1 -1
- package/dist/stencil-library/udp-rich-text.entry.js +1 -0
- package/dist/stencil-library/udp-sankey-chart.entry.js +1 -1
- package/dist/stencil-library/udp-sidebar-layout.entry.js +1 -1
- package/dist/stencil-library/udp-skeleton-loading.entry.js +1 -1
- package/dist/stencil-library/udp-split-screen.entry.js +1 -1
- package/dist/stencil-library/udp-stepper-actions.entry.js +1 -1
- package/dist/stencil-library/udp-stepper-content.entry.js +1 -1
- package/dist/stencil-library/udp-stepper-demo.entry.js +1 -1
- package/dist/stencil-library/udp-stepper-nav.entry.js +1 -1
- package/dist/stencil-library/udp-tab.entry.js +1 -1
- package/dist/stencil-library/udp-timeline-connector.entry.js +1 -1
- package/dist/stencil-library/udp-timeline-dot.entry.js +1 -1
- package/dist/stencil-library/udp-timeline-item.entry.js +1 -1
- package/dist/stencil-library/udp-timeline-separator.entry.js +1 -1
- package/dist/stencil-library/udp-timeline.entry.js +1 -1
- package/dist/stencil-library/udp-vertical-timeline-connector.entry.js +1 -1
- package/dist/stencil-library/udp-vertical-timeline-dot.entry.js +1 -1
- package/dist/stencil-library/udp-vertical-timeline-item.entry.js +1 -1
- package/dist/stencil-library/udp-vertical-timeline-separator.entry.js +1 -1
- package/dist/stencil-library/udp-vertical-timeline.entry.js +1 -1
- package/dist/stencil-library/udp-xy-chart.entry.js +1 -1
- package/dist/stencil-library/udp-xy-multi-series-chart.entry.js +1 -1
- package/dist/stencil-library/valueFormatters-BbY_Q8IE.js +1 -0
- package/dist/types/components/advanced-search-builder/udp-advanced-search-builder.d.ts +25 -0
- package/dist/types/components/fluent-ui/button/udp-fluent-button.d.ts +5 -0
- package/dist/types/components/fluent-ui/domain-table-input/domain-table-snapshot.d.ts +32 -0
- package/dist/types/components/fluent-ui/domain-table-input/udp-fluent-domain-table-input.d.ts +137 -0
- package/dist/types/components/fluent-ui/domain-table-input/udp-fluent-domain-table-input.types.d.ts +46 -0
- package/dist/types/components/fluent-ui/drawer/udp-fluent-drawer.d.ts +5 -0
- package/dist/types/components/fluent-ui/dropdown/udp-fluent-dropdown.d.ts +12 -1
- package/dist/types/components/fluent-ui/radio-group/udp-fluent-radio-group.d.ts +6 -0
- package/dist/types/components/fluent-ui/rich-text/udp-rich-text.d.ts +19 -0
- package/dist/types/components/fluent-ui/rich-text-field/rich-text-schema.d.ts +6 -0
- package/dist/types/components/fluent-ui/table-input/table-aggregates.d.ts +16 -0
- package/dist/types/components/fluent-ui/table-input/udp-fluent-table-input.d.ts +0 -8
- package/dist/types/components/fluent-ui/tablist/udp-fluent-tablist.d.ts +3 -0
- package/dist/types/components/forms/udp-question-form/__forms-harness__/fixtures/table-domain.fixtures.d.ts +22 -0
- package/dist/types/components/forms/udp-question-form/builder/components/configure-question-drawer.d.ts +2 -1
- package/dist/types/components/forms/udp-question-form/builder/components/questionConfig/typeSpecific/DomainTableConfig.d.ts +2 -0
- package/dist/types/components/forms/udp-question-form/builder/components/questionConfig/types.d.ts +17 -0
- package/dist/types/components/forms/udp-question-form/builder/components/questionConfig/udp-question-config-fluent.d.ts +9 -0
- package/dist/types/components/forms/udp-question-form/builder/udp-question-form-builder.d.ts +1 -0
- package/dist/types/components/forms/udp-question-form/builder/utils/builder-api.d.ts +37 -0
- package/dist/types/components/forms/udp-question-form/core/field-properties-schemas/per-type/table.d.ts +5 -0
- package/dist/types/components/forms/udp-question-form/core/field-properties.d.ts +31 -1
- package/dist/types/components/forms/udp-question-form/core/validation/intrinsic.d.ts +15 -3
- package/dist/types/components/forms/udp-question-form/renderer/runtime/codecs.d.ts +12 -1
- package/dist/types/components/forms/udp-question-form/renderer/runtime/domain-table-snapshot.d.ts +20 -0
- package/dist/types/components/forms/udp-question-form/renderer/runtime/index.d.ts +1 -0
- package/dist/types/components/forms/udp-question-form/renderer/udp-question-form-renderer.d.ts +9 -0
- package/dist/types/components/forms/udp-question-form/renderer/ui/form-shell.d.ts +3 -0
- package/dist/types/components/forms/udp-question-form/renderer/ui/question-renderer.d.ts +7 -0
- package/dist/types/components/grid/new-grid/ag-grid-base.d.ts +3 -1
- package/dist/types/components/grid/new-grid/api-method-instance-grid.d.ts +9 -1
- package/dist/types/components/grid/new-grid/client-side-grid.d.ts +3 -1
- package/dist/types/components/grid/new-grid/datasources/searchMethodDatasource.d.ts +3 -0
- package/dist/types/components/grid/new-grid/gridFunctions/advancedSearch.d.ts +6 -3
- package/dist/types/components/grid/new-grid/gridFunctions/savedViews.d.ts +1 -0
- package/dist/types/components/grid/new-grid/gridFunctions/udpExport.d.ts +6 -0
- package/dist/types/components/grid/new-grid/helperFunctions/buildSearchObject.d.ts +13 -3
- package/dist/types/components/grid/new-grid/helperFunctions/domainRowsHelper.d.ts +60 -0
- package/dist/types/components/grid/new-grid/helperFunctions/extraFieldsHelper.d.ts +49 -0
- package/dist/types/components/grid/new-grid/helperFunctions/lookupHelper.d.ts +57 -0
- package/dist/types/components/grid/new-grid/helperFunctions/savedViewsHelpers.d.ts +2 -0
- package/dist/types/components/grid/new-grid/search-method-grid.d.ts +35 -1
- package/dist/types/components/grid/new-grid/server-side-grid.d.ts +27 -1
- package/dist/types/components/grid/renderers/actions-renderer.d.ts +15 -0
- package/dist/types/components/grid/renderers/input-renderer.d.ts +36 -0
- package/dist/types/components/import/udp-import-sheet/udp-import-sheet.d.ts +85 -0
- package/dist/types/components.d.ts +411 -12
- package/dist/types/icons/fluent-icons.d.ts +1 -1
- package/dist/types/index.d.ts +3 -0
- package/dist/types/store/execution-store.d.ts +4 -5
- package/dist/types/udp-utilities/api-config/configService.d.ts +0 -2
- package/dist/types/udp-utilities/extra-fields/extraFields.d.ts +105 -0
- package/dist/types/udp-utilities/extra-fields/index.d.ts +1 -0
- package/dist/types/udp-utilities/search/searchObject.d.ts +2 -0
- package/package.json +3 -3
- package/dist/cjs/lookupHelper-ClpMWN_g.js +0 -101
- package/dist/cjs/searchObjectHelper-DYpPEIzz.js +0 -110
- package/dist/cjs/slot-index-Dzl7Zum5.js +0 -77
- package/dist/cjs/udp-fluent-number-input.cjs.entry.js +0 -146
- package/dist/esm/lookupHelper-CSo9DNLr.js +0 -96
- package/dist/esm/searchObjectHelper-BjA6OHxg.js +0 -107
- package/dist/esm/slot-index-aYrr8BJl.js +0 -74
- package/dist/esm/udp-fluent-number-input.entry.js +0 -144
- package/dist/stencil-library/ag-grid-base_65.entry.js +0 -1
- package/dist/stencil-library/apiMethodInstance-BunReWfq.js +0 -1
- package/dist/stencil-library/apiUtils-Cq-WuEqc.js +0 -1
- package/dist/stencil-library/codecs-CI_fHfY1.js +0 -1
- package/dist/stencil-library/configService-D_9j963S.js +0 -1
- package/dist/stencil-library/configureUdpColumnMods-UWccWlH6.js +0 -1
- package/dist/stencil-library/createAzureMapsProviders-CLLCmr8f.js +0 -1
- package/dist/stencil-library/fluent-icons-pWFJyrRm.js +0 -1
- package/dist/stencil-library/load-icons-BHSNRRRA.js +0 -1
- package/dist/stencil-library/lookupHelper-CSo9DNLr.js +0 -1
- package/dist/stencil-library/searchObjectHelper-BjA6OHxg.js +0 -1
- package/dist/stencil-library/slot-index-aYrr8BJl.js +0 -1
- package/dist/stencil-library/status-renderer-BoY7sar9.js +0 -1
- package/dist/stencil-library/udp-detail-list_9.entry.js +0 -1
- package/dist/stencil-library/udp-fluent-number-input.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,c as t,h as i,H as n,a as o}from"./index-15aY63VA.js";import{i as l,F as r,a as s}from"./types-C9Z-dgvN.js";import{i as a,j as d,b as u,k as c,l as p,m as f,n as m,a as h,d as v,o as b,e as g,q as y,r as x,S as w,s as S,t as _,p as k,c as q,u as O}from"./codecs-CI_fHfY1.js";import F from"sortablejs";import{C}from"./configService-D_9j963S.js";import{c as I}from"./createAzureMapsProviders-CLLCmr8f.js";import{d as D}from"./udp-drive-utils-DCivw3gq.js";import{f as j}from"./form-registry-BhFl_bdX.js";import{v4 as N}from"uuid";import{m as P}from"./makeApiCall-B-daVutk.js";import{g as V,s as $}from"./slot-index-aYrr8BJl.js";import"./tenantUtils-Basdb1b1.js";import"axios";function L(e){const t=e.fieldProperties;return Array.isArray(t.items)?t.items:Array.isArray(e.lookupItems)?e.lookupItems:[]}function A(e,t,i){var n,o;if(l(e.fieldTypeId))return[];const r=[],s=a(t);for(const o of d(e.fieldTypeId)){if(s&&!o.runOnEmpty)continue;const l=o.check(t,e,i);l&&r.push({ruleType:o.ruleType,message:l.message,severity:null!==(n=l.severity)&&void 0!==n?n:"error"})}for(const n of u(e.fieldTypeId)){const l=n.readParams(e);if(null===l)continue;if(s&&!n.runOnEmpty)continue;const a=n.check(t,l,e,i);a&&r.push({ruleType:n.ruleType,message:a.message,severity:null!==(o=a.severity)&&void 0!==o?o:"error"})}return r}const U=class{constructor(i){e(this,i),this.valueChanged=t(this,"valueChanged",7),this.inputBlur=t(this,"inputBlur",7),this.inputFocus=t(this,"inputFocus",7),this.value="",this.readonly=!1,this.fitContent=!1,this.typedValue=null,this.handleInput=e=>{const t=e.target;this.fitContent&&(this.typedValue=t.value),this.valueChanged.emit(t.value)}}onValueChanged(){this.typedValue=null}async focusInput(){var e;null===(e=this.inputEl)||void 0===e||e.focus()}render(){var e,t;const o=null!==(e=this.typedValue)&&void 0!==e?e:this.value,l=!o;return i(n,{key:"d5d5cd92044c8e4bf88ff7a1b56722d2b8790ff1"},this.fitContent&&i("span",{key:"7c3de2948a367e05fc5548c162ac4ed9fbb4c4c4",class:{"inline-edit-box":!0,"inline-edit-mirror":!0,"is-placeholder":l},"aria-hidden":"true"},`${l?null!==(t=this.placeholder)&&void 0!==t?t:"":o} `),i("input",{key:"b88c9f97c5f00e07266be124d2ba7c7604157e8c",ref:e=>this.inputEl=e,class:"inline-edit-box inline-edit-input",type:"text",size:this.fitContent?1:void 0,value:this.value,placeholder:this.placeholder,readOnly:this.readonly,maxlength:this.maxLength,"aria-label":this.ariaLabel,onInput:this.handleInput,onBlur:()=>this.inputBlur.emit(),onFocus:()=>this.inputFocus.emit()}))}static get delegatesFocus(){return!0}get el(){return o(this)}static get watchers(){return{value:[{onValueChanged:0}]}}};U.style=":host{display:block;width:100%}.inline-edit-box{font:inherit;color:inherit;background:transparent;border:1px solid transparent;border-radius:var(--borderRadiusMedium);padding:2px var(--spacingHorizontalXS);margin:0}.inline-edit-input{width:100%;outline:none;cursor:text;transition:background-color 0.15s ease, border-color 0.15s ease}.inline-edit-input::placeholder{color:var(--colorNeutralForeground3);font-style:italic}.inline-edit-input:hover:not(:read-only){background-color:var(--colorNeutralBackground1Hover)}.inline-edit-input:focus:not(:read-only){background-color:var(--colorNeutralBackground1Hover);border-color:var(--colorNeutralStroke2)}.inline-edit-input:read-only{cursor:default}:host([fit-content]){display:inline-grid;width:auto;overflow:hidden}:host([fit-content]) .inline-edit-box{grid-area:1 / 1;box-sizing:border-box}:host([fit-content]) .inline-edit-input{min-width:2ch}.inline-edit-mirror{visibility:hidden;white-space:pre;min-width:0;pointer-events:none}.inline-edit-mirror.is-placeholder{font-style:italic}";const T=class{constructor(t){e(this,t),this.open=!1,this.versions=[],this.currentVersion=1}handleItemAction(e){var t,i,n;if(!this.open)return;const o=Number(null===(t=e.detail)||void 0===t?void 0:t.value);Number.isInteger(o)&&(null===(i=this.onVersionSelect)||void 0===i||i.call(this,o),null===(n=this.onDrawerClose)||void 0===n||n.call(this))}render(){return i(n,{key:"f87b47b31940d937892e7adbaf0146aa053bfa82"},i("udp-fluent-drawer",{key:"efc35cd2eab6647e69aa4710b74981a2aa194239",open:this.open,drawerTitle:"Versions",onDrawerClose:this.onDrawerClose,size:"small"},i("udp-list",{key:"13a20d18eeeff7e1be07141182e2b3dc059547d8",interactive:!0,selectionMode:"none",showDivider:!0},[...this.versions].sort(((e,t)=>t-e)).map((e=>i("udp-fluent-list-item",{key:e,value:e,label:`Version ${e}`},e===this.currentVersion&&i("udp-fluent-badge",{slot:"end",appearance:"tint",color:"informative",shape:"rounded",size:"small"},"Current")))))))}};function z({name:e,label:t,description:n,disabled:o}){return i("udp-field",{name:e},i("udp-fluent-switch",{label:t,labelPosition:"after",hint:n,disabled:o}))}function B(e){return i("udp-flexbox",{display:"flex",direction:"column",gap:"none"},i("udp-field",{name:"fieldProperties.paragraphText"},i("udp-textarea",{label:"Paragraph Text",disabled:e.isViewOnly,placeholder:"Enter the paragraph text here",resize:"vertical"})))}function E(e,t){var i,n,o;const l=null!==(n=null===(i=e.formValues)||void 0===i?void 0:i.fieldProperties)&&void 0!==n?n:null;return null!==(o=null==l?void 0:l[t])&&void 0!==o?o:e.fieldProperties[t]}function R(e,t=""){if("string"==typeof e)return e;if(e&&"object"==typeof e){const i=e.value;return null==i?t:String(i)}return t}function M(e,t){return i=>{i&&(i.__onSortEnd=(i,n)=>{t||e(i,n)},i.__sortableInit||(i.__sortableInit=!0,new F(i,{handle:".option-drag-handle",animation:150,ghostClass:"sortable-ghost",onEnd:e=>{var t;const{oldIndex:n,newIndex:o}=e;void 0!==n&&void 0!==o&&n!==o&&(e.to.insertBefore(e.item,n<o?e.to.children[n]:e.to.children[n+1]),null===(t=i.__onSortEnd)||void 0===t||t.call(i,n,o))}})))}}function H(e){var t,n,o;const{items:l,lookupId:r}=function(e){const t=E(e,"items"),i=E(e,"lookupId");return{items:Array.isArray(t)?t:[],lookupId:"string"==typeof i?i:""}}(e),s=null!==(t=e.lookupOptions)&&void 0!==t?t:[],a=0===l.length,d=!a,u=l[l.length-1],p=l.length>0&&!(null===(n=null==u?void 0:u.display)||void 0===n?void 0:n.trim())&&!(null===(o=null==u?void 0:u.value)||void 0===o?void 0:o.trim()),f=c(p?l.slice(0,-1):l),m=t=>{var i,n;null===(n=null===(i=e.getForm)||void 0===i?void 0:i.call(e))||void 0===n||n.change("fieldProperties.items",t)},h=t=>{var i,n;null===(n=null===(i=e.getForm)||void 0===i?void 0:i.call(e))||void 0===n||n.change("fieldProperties.lookupId",t)},v=(e,t,i)=>{var n,o;const r=l.slice(),s=null!==(n=r[e])&&void 0!==n?n:{};if("display"===t){const t=!(null===(o=s.value)||void 0===o?void 0:o.trim())||s.value===s.display;r[e]=Object.assign(Object.assign({},s),{display:i,value:t?i:s.value})}else r[e]=Object.assign(Object.assign({},s),{value:i});m(r)},b=()=>{m([...l,{display:"",value:""}])},g=(t,i)=>{var n,o;if("Enter"!==t.key||e.isViewOnly)return;if(i!==l.length-1||!(null===(o=null===(n=l[i])||void 0===n?void 0:n.display)||void 0===o?void 0:o.trim()))return;t.preventDefault(),b();const r=t.currentTarget.closest(".options-grid--choice");requestAnimationFrame((()=>{var e;const t=null==r?void 0:r.querySelectorAll(".option-row"),i=null==t?void 0:t[t.length-1];null===(e=null==i?void 0:i.querySelector("udp-fluent-text-input"))||void 0===e||e.focus()}))},y=M(((e,t)=>{if(e===t)return;const i=l.slice(),[n]=i.splice(e,1);i.splice(t,0,n),m(i)}),e.isViewOnly);return i("udp-flexbox",{display:"flex",direction:"column",gap:"none"},s.length>=1&&i("udp-fluent-switch",{label:"Use Lookup Options",labelPosition:"after",disabled:e.isViewOnly,checked:a,onValueChanged:()=>{e.isViewOnly||(a?(m([{display:"",value:""}]),h("")):(m([]),h("")))}}),a&&i("udp-fluent-dropdown",{label:"Lookup Source",placeholder:"Select a lookup",options:s,value:r,disabled:e.isViewOnly,required:!0,onValueChanged:t=>{e.isViewOnly||h(R(t.detail))}}),d&&i("div",{class:"options-grid options-grid--choice"},i("div",{class:"options-grid-header"},i("span",{class:"options-drag-handle-spacer","aria-hidden":"true"}),i("span",{class:"options-grid-header-label"},"Display Text"),i("span",{class:"options-grid-header-label"},"Option Value"),i("span",null)),i("div",{ref:y},l.map(((t,n)=>i("div",{key:n,class:"option-row"},i("span",{class:"option-drag-handle","aria-label":"Drag to reorder"},i("udp-fluent-icon",{name:"drag",size:"sm"})),i("udp-fluent-text-input",{value:t.display||"",disabled:e.isViewOnly,placeholder:"Display text",autocomplete:"off",includeErrorPadding:!1,onKeyDown:e=>g(e,n),onValueChanged:t=>{e.isViewOnly||v(n,"display",t.detail)}}),i("udp-fluent-text-input",{value:t.value||"",disabled:e.isViewOnly,placeholder:"Value",autocomplete:"off",includeErrorPadding:!1,onKeyDown:e=>g(e,n),onValueChanged:t=>{e.isViewOnly||v(n,"value",t.detail)}}),i("div",{class:"option-row-actions"},i("udp-fluent-icon-button",{iconName:"delete",appearance:"subtle",size:"small",ariaLabel:"Remove option",disabled:e.isViewOnly||l.length<=1,onClick:()=>(e=>{m(l.filter(((t,i)=>i!==e)))})(n)})))))),!e.isViewOnly&&i("div",{class:"options-add-row"},i("udp-fluent-button",{appearance:"subtle",startIconName:"add",onClick:()=>b()},"Add Option")),f&&i("udp-text",{variant:"caption1",block:!0,style:{color:"var(--colorPaletteRedForeground1)"}},f)))}function X(e){return i("udp-flexbox",{display:"flex",direction:"column",gap:"none"},i("udp-field",{name:"fieldProperties.allowMultiple"},i("udp-fluent-switch",{label:"Allow Multiple Items",labelPosition:"after",disabled:e.isViewOnly})),i("udp-field",{name:"fieldProperties.displayUploadTime"},i("udp-fluent-switch",{label:"Display Upload Time",labelPosition:"after",disabled:e.isViewOnly})),i("udp-field",{name:"fieldProperties.hideDragAndDrop"},i("udp-fluent-switch",{label:"Hide Drag And Drop",labelPosition:"after",disabled:e.isViewOnly})),i("udp-field",{name:"fieldProperties.hideButton"},i("udp-fluent-switch",{label:"Hide Button",labelPosition:"after",disabled:e.isViewOnly})))}function Q(e){return i("udp-flexbox",{display:"flex",direction:"column",gap:"md"},i("udp-field",{name:"fieldProperties.includeLocation"},i("udp-fluent-switch",{label:"Include Location",labelPosition:"after",disabled:e.isViewOnly})))}function K(e){return i("udp-flexbox",{display:"flex",direction:"column",gap:"none"},i("udp-field",{name:"fieldProperties.displayOwnerFullName"},i("udp-fluent-switch",{label:"Show Form Responder Full Name",labelPosition:"after",disabled:e.isViewOnly})),i("udp-field",{name:"fieldProperties.displayOwnerEmail"},i("udp-fluent-switch",{label:"Show Form Responder Email",labelPosition:"after",disabled:e.isViewOnly})),i("udp-field",{name:"fieldProperties.displaySubmissionDate"},i("udp-fluent-switch",{label:"Show Submission Date",labelPosition:"after",disabled:e.isViewOnly})))}let G;function Y(){var e;const t=null!==(e=C.config.AZURE_MAP_SUBSCRIPTION_KEY)&&void 0!==e?e:"";return G&&G.key===t||(G={key:t,providers:I(t)}),G.providers}function W(e){const t=!!e.fieldProperties.showMap,n=Y();return i("udp-flexbox",{display:"flex",direction:"column",gap:"md"},i("udp-field",{name:"fieldProperties.defaultLocation"},i("udp-fluent-location-input",{label:"Default Location",disabled:e.isViewOnly,showMap:!1,searchAddresses:null==n?void 0:n.searchAddresses,reverseGeocode:null==n?void 0:n.reverseGeocode})),i("udp-field",{name:"fieldProperties.showMap"},i("udp-fluent-switch",{label:"Show Map",labelPosition:"after",disabled:e.isViewOnly,onValueChanged:t=>{var i;if(!e.isViewOnly&&!t.detail){const t=null===(i=e.getForm)||void 0===i?void 0:i.call(e);null==t||t.change("fieldProperties.hideAddressSearch",!1)}}})),t&&i("udp-flexbox",{display:"flex",direction:"column",gap:"md"},i("udp-field",{name:"fieldProperties.hideAddressSearch"},i("udp-fluent-switch",{label:"Hide Address Search Bar",labelPosition:"after",disabled:e.isViewOnly})),i("udp-field",{name:"fieldProperties.mapZoom"},i("udp-fluent-text-input",{label:"Map Zoom",type:"number",disabled:e.isViewOnly})),i("udp-field",{name:"fieldProperties.projection"},i("udp-fluent-text-input",{label:"Projection",disabled:e.isViewOnly,placeholder:"Enter map projection here"})),i("udp-field",{name:"fieldProperties.projectionDefs"},i("udp-fluent-text-input",{label:"Projection Definition",disabled:e.isViewOnly,placeholder:"Enter map projection definition here"}))))}const Z=[{value:"text",label:"Text"},{value:"number",label:"Number"}],J=[{value:"sum",label:"Sum"},{value:"avg",label:"Average"},{value:"min",label:"Min"},{value:"max",label:"Max"}],ee=[{value:"0",label:"0"},{value:"1",label:"1"},{value:"2",label:"2"},{value:"3",label:"3"}];function te(e){const t=function(e){const t=E(e,"columns");return Array.isArray(t)?t:[]}(e),n=t=>{var i,n;null===(n=null===(i=e.getForm)||void 0===i?void 0:i.call(e))||void 0===n||n.change("fieldProperties.columns",m(t))},o=(e,i,o)=>{var l;const r=t.slice(),s=null!==(l=r[e])&&void 0!==l?l:p();r[e]=Object.assign(Object.assign({},s),{[i]:o}),n(r)},l=(e,i)=>{var o;const l=t.slice(),r=null!==(o=l[e])&&void 0!==o?o:p();if(i){const t=Object.assign(Object.assign({},r),{aggregate:i});if("number"===(null==r?void 0:r.type)){const e=Number(r.aggregateDecimalPlaces);t.aggregateDecimalPlaces=Number.isInteger(e)&&e>=0?e:1}l[e]=t}else{const t=function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(i[n[o]]=e[n[o]])}return i}(r,["aggregate","aggregateDecimalPlaces"]);l[e]=t}n(l)},r=M(((e,i)=>{if(e<0||i<0||e>=t.length||i>=t.length||e===i)return;const o=t.slice(),[l]=o.splice(e,1);o.splice(i,0,l),n(o)}),e.isViewOnly);return i("div",null,i("div",{class:"options-grid"},i("div",{class:"options-grid-header"},i("span",{class:"options-drag-handle-spacer","aria-hidden":"true"}),i("span",{class:"options-grid-header-label"},"Column Name"),i("span",{class:"options-grid-header-label"},"Type"),i("span",null)),i("div",{ref:r},t.map(((r,s)=>{const a="number"===(null==r?void 0:r.type)?"number":"text",d=!!(null==r?void 0:r.required),u="number"===a,c=u&&!!(null==r?void 0:r.aggregate),m=(null==r?void 0:r.aggregate)||"sum",h=Number.isInteger(Number(null==r?void 0:r.aggregateDecimalPlaces))?String(Math.min(3,Math.max(0,Number(r.aggregateDecimalPlaces)))):"1";return i("div",{class:"table-col-card"},i("div",{class:"table-col-main-row"},e.isViewOnly?i("span",{class:"options-drag-handle-spacer","aria-hidden":"true"}):i("span",{class:"option-drag-handle","aria-label":"Drag to reorder"},i("udp-fluent-icon",{name:"drag",size:"sm"})),i("udp-fluent-text-input",{value:(null==r?void 0:r.name)||"",disabled:e.isViewOnly,placeholder:"Column name",autocomplete:"off",includeErrorPadding:!1,onValueChanged:t=>{e.isViewOnly||o(s,"name",t.detail)}}),i("udp-fluent-dropdown",{value:a,options:Z,optionLabel:"label",optionValue:"value",disabled:e.isViewOnly,includeErrorPadding:!1,onValueChanged:i=>{e.isViewOnly||((e,i)=>{var o;const l="number"===i?"number":"text",r=t.slice(),s=null!==(o=r[e])&&void 0!==o?o:p(),a=Object.assign(Object.assign({},s),{type:l});f(l)||(delete a.aggregate,delete a.aggregateDecimalPlaces),r[e]=a,n(r)})(s,R(i.detail,"text"))}}),i("div",{class:"option-row-actions"},i("udp-fluent-icon-button",{iconName:"delete",appearance:"subtle",size:"small",ariaLabel:"Remove column",disabled:e.isViewOnly||t.length<=1,onClick:()=>{e.isViewOnly||(e=>{n(t.filter(((t,i)=>i!==e)))})(s)}}))),i("div",{class:"table-col-secondary"},i("udp-fluent-switch",{label:"Required",labelPosition:"after",disabled:e.isViewOnly,checked:d,onValueChanged:()=>{e.isViewOnly||o(s,"required",!d)}}),u&&i("udp-fluent-switch",{label:"Display Aggregate",labelPosition:"after",disabled:e.isViewOnly,checked:c,onValueChanged:()=>{e.isViewOnly||l(s,c?"":m)}})),u&&c&&i("udp-container-query-grid",{columns:{0:1,360:2},gaps:{0:"sm"},class:"table-col-secondary"},i("udp-container-query-grid-item",null,i("udp-fluent-dropdown",{label:"Aggregate Function",value:m,options:J,optionLabel:"label",optionValue:"value",disabled:e.isViewOnly,required:!0,onValueChanged:t=>{e.isViewOnly||l(s,R(t.detail,"sum"))}})),i("udp-container-query-grid-item",null,i("udp-fluent-dropdown",{label:"Decimal Places",value:h,options:ee,optionLabel:"label",optionValue:"value",disabled:e.isViewOnly,required:!0,onValueChanged:t=>{e.isViewOnly||o(s,"aggregateDecimalPlaces",R(t.detail,"1"))}}))))}))),!e.isViewOnly&&i("div",{class:"options-add-row"},i("udp-fluent-button",{appearance:"subtle",startIconName:"add",onClick:()=>(()=>{const e=t.length+1;n([...t,Object.assign(Object.assign({},p()),{name:`Column ${e}`})])})()},"Add Column"))))}function ie(e){const t=function(e){const t=E(e,"tallyMode");return"include"===t||"exclude"===t?t:"all"}(e),n=function(e){var t,i,n;const o=[],l=null!==(t=e.sections)&&void 0!==t?t:[];for(const t of l)for(const l of null!==(i=t.questions)&&void 0!==i?i:[])l.fieldTypeId===s.YesNo&&l.id!==e.currentQuestionId&&o.push({value:l.id,label:(null===(n=l.questionText)||void 0===n?void 0:n.trim())||"(untitled question)"});return o}(e),o=n.length>0;return i("udp-flexbox",{display:"flex",direction:"column",gap:"md"},i("udp-field",{name:"fieldProperties.tallyMode"},i("udp-fluent-radio-group",{label:"Which Yes/No questions feed this tally?",orientation:"vertical",items:[{value:"all",label:"All Yes/No questions"},{value:"include",label:"Only the selected Yes/No questions"},{value:"exclude",label:"All except the selected Yes/No questions"}],disabled:e.isViewOnly,onValueChanged:t=>{var i;if(e.isViewOnly)return;const n=null===(i=e.getForm)||void 0===i?void 0:i.call(e);if(!n)return;const o=t.detail;"all"===o?(n.change("fieldProperties.includeFields",[]),n.change("fieldProperties.excludeFields",[])):"include"===o?n.change("fieldProperties.excludeFields",[]):"exclude"===o&&n.change("fieldProperties.includeFields",[])}})),!o&&i("udp-text",{variant:"caption1"},"No other Yes/No questions exist in this form yet."),o&&"include"===t&&i("udp-field",{name:"fieldProperties.includeFields"},i("udp-fluent-dropdown",{label:"Include these Yes/No questions",multiple:!0,clearable:!0,options:n,optionLabel:"label",optionValue:"value",disabled:e.isViewOnly,placeholder:"Select questions to include..."})),o&&"exclude"===t&&i("udp-field",{name:"fieldProperties.excludeFields"},i("udp-fluent-dropdown",{label:"Exclude these Yes/No questions",multiple:!0,clearable:!0,options:n,optionLabel:"label",optionValue:"value",disabled:e.isViewOnly,placeholder:"Select questions to exclude..."})))}function ne(e){var t;const i=null===(t=e.getForm)||void 0===t?void 0:t.call(e);return i?(e,t)=>i.change(e,t):null}function oe(e){const{question:t,ctx:n}=e,o=u(t.fieldTypeId).filter((e=>"required"!==e.ruleType));if(0===o.length)return i("udp-text",{variant:"caption1",color:"muted"},"No validation rules available for this field type.");const l=function(e,t){var i;const n=null!==(i=t.formValues)&&void 0!==i?i:{},o="boolean"==typeof n.required?n.required:e.required,l=n.fieldProperties&&"object"==typeof n.fieldProperties?n.fieldProperties:e.fieldProperties;return Object.assign(Object.assign({},e),{required:o,fieldProperties:l})}(t,n),r=e=>null!==e.readParams(l),s=o.filter(r),a=o.filter((e=>!r(e)));return i("udp-flexbox",{display:"flex",direction:"column",gap:"md"},s.map((e=>function(e,t){return i("udp-fluent-card",{key:e.ruleType,appearance:"outline",label:e.builder.label,subtitle:e.builder.description},!t.isViewOnly&&i("udp-fluent-icon-button",{slot:"header-action",iconName:"dismiss",appearance:"subtle",ariaLabel:`Remove ${e.builder.label} rule`,onClick:()=>{if(t.isViewOnly)return;const i=ne(t);i&&e.builder.disable(i)}}),e.builder.params.length>0&&i("udp-flexbox",{display:"flex",direction:"column",gap:"sm"},e.builder.params.map((e=>function(e,t){const n={disabled:t,label:e.label};switch(e.type){case"number":return i("udp-field",{name:e.formPath},i("udp-fluent-text-input",Object.assign({},n,{type:"number",hint:e.helperText})));case"date":return i("udp-field",{name:e.formPath},i("udp-date-input",Object.assign({},n)));case"time":return i("udp-field",{name:e.formPath},i("udp-time-input",Object.assign({},n)));case"datetime":return i("udp-field",{name:e.formPath},i("udp-date-time-input",Object.assign({},n)));default:return i("udp-field",{name:e.formPath},i("udp-fluent-text-input",Object.assign({},n,{hint:e.helperText})))}}(e,t.isViewOnly)))))}(e,n))),function(e,t){if(t.isViewOnly||0===e.length)return null;const n=e.map((e=>({id:e.ruleType,text:e.builder.label,onClick:()=>{const i=ne(t);i&&e.builder.enable(i)}})));return i("udp-fluent-menu",{appearance:"subtle",label:"Add validation rule",startIconName:"add",size:"small",items:n})}(a,n))}const le=class{constructor(t){e(this,t),this.followUpFormOptions=[],this.isFollowUpFormConfigOn=!1,this.isCommentingConfigOn=!1,this.form=null,this.unsubscribeFormValues=null,this.formValues={},this.getForm=()=>this.form}componentDidLoad(){this.el.dispatchEvent(new CustomEvent("fetchFormInstance",{bubbles:!0,composed:!0,detail:e=>{this.form=e,this.unsubscribeFormValues=e.subscribe((e=>{var t;this.formValues=null!==(t=e.values)&&void 0!==t?t:{}}),{values:!0})}}))}disconnectedCallback(){this.unsubscribeFormValues&&(this.unsubscribeFormValues(),this.unsubscribeFormValues=null),this.form=null}get question(){var e,t,i;return null===(i=null===(t=null===(e=this.sections)||void 0===e?void 0:e[this.sIndex])||void 0===t?void 0:t.questions)||void 0===i?void 0:i[this.qIndex]}buildTypeSpecificContext(){var e;const t=this.question;return{fieldProperties:null!==(e=t.fieldProperties)&&void 0!==e?e:{},formValues:this.formValues,getForm:this.getForm,isViewOnly:this.isViewOnly,lookupOptions:this.lookupOptions,sections:this.sections,currentQuestionId:t.id}}render(){const e=this.question;if(!e)return null;const t=h(e.fieldTypeId),n={question:e,isViewOnly:this.isViewOnly,formType:this.formType,isFollowUpFormConfigOn:this.isFollowUpFormConfigOn,isCommentingConfigOn:this.isCommentingConfigOn,isQuestionTextRequired:!(null==t?void 0:t.questionTextOptional),formValues:this.formValues,followUpFormOptions:this.followUpFormOptions},o=this.buildTypeSpecificContext(),l=function(e,t){switch(e){case s.Paragraph:return{label:"Paragraph Text",content:B(t)};case s.Checkbox:case s.RadioButton:case s.DropdownSingleSelect:case s.DropdownMultipleSelect:case s.ListMultiSelect:return{label:"List Options",content:H(t)};case s.FileUpload:case s.ImageUpload:return{label:"Upload options",content:X(t)};case s.Signature:return{label:"Signature options",content:Q(t)};case s.FormMetadataDisplay:return{label:"Display options",content:K(t)};case s.Location:return{label:"Location",content:W(t)};case s.Table:return{label:"Table Columns",content:te(t)};case s.Tally:return{label:"Tally source",content:ie(t)};default:return null}}(e.fieldTypeId,o);return i("div",{class:"config-drawer"},i("udp-flexbox",{display:"flex",direction:"column",gap:"md"},function(e){const{isViewOnly:t,isQuestionTextRequired:n}=e;return i("udp-flexbox",{direction:"column",gap:"md"},i("udp-field",{name:"questionText"},i("udp-textarea",{label:"Question",disabled:t,required:n})),i("udp-field",{name:"helperText"},i("udp-textarea",{label:"Description",disabled:t})))}(n),l&&i("udp-accordion",{expandmode:"multi",appearance:"contained",items:[{id:"type-specific",label:l.label,expanded:!0,block:!0}]},i("udp-flexbox",{slot:"type-specific-content",direction:"column",gap:"md"},l.content)),function(e){var t,n,o;const{question:l,isViewOnly:s,formType:a,isFollowUpFormConfigOn:d,isCommentingConfigOn:u,formValues:c,followUpFormOptions:p=[]}=e,f=null!==(t=l.fieldProperties)&&void 0!==t?t:{},m=null!==(n=null==c?void 0:c.fieldProperties)&&void 0!==n?n:null,h=!0===(null!==(o=null==m?void 0:m.allowFollowUpForms)&&void 0!==o?o:f.allowFollowUpForms),v=a===r.Standard&&d&&h;return i("udp-accordion",{expandmode:"multi",appearance:"contained",items:[{id:"field-behavior",label:"Field Behavior",expanded:!0,block:!0}]},i("udp-flexbox",{slot:"field-behavior-content",direction:"column",gap:"md"},!(!0===f.ignoreRequiredConfig)&&z({name:"required",label:"Required",description:"End users must answer this question before submitting.",disabled:s}),z({name:"fieldProperties.readOnly",label:"Read Only",description:"Show the value but don't allow end users to edit it.",disabled:s}),u&&z({name:"fieldProperties.allowComments",label:"Allow Comments",description:"Let reviewers attach comments to this answer.",disabled:s}),a===r.Standard&&d&&z({name:"fieldProperties.allowFollowUpForms",label:"Allow Follow Up Forms",description:"Let end users launch another form linked to this question.",disabled:s}),v&&p.length>0&&i("udp-field",{name:"fieldProperties.followUpFormIds"},i("udp-fluent-dropdown",{label:"Limit to specific follow-up forms (optional)",hint:"Leave empty to allow any follow-up form.",multiple:!0,clearable:!0,disabled:s,options:p,optionLabel:"label",optionValue:"value",valueAs:"value",placeholder:"Any follow-up form"})),v&&0===p.length&&i("udp-text",{variant:"caption1"},'No follow-up form templates exist yet. Save another form with "Use as follow-up form template" enabled to populate this list.')))}(n),i("udp-accordion",{expandmode:"multi",appearance:"contained",items:[{id:"validation",label:"Validation",expanded:!1,block:!0}]},i("udp-flexbox",{slot:"validation-content",direction:"column",gap:"md"},oe({question:e,ctx:o}))),function(e){const{isViewOnly:t}=e;return i("udp-accordion",{expandmode:"multi",appearance:"contained",items:[{id:"advanced",label:"Advanced",expanded:!1,block:!0}]},i("udp-flexbox",{slot:"advanced-content",direction:"column",gap:"sm"},i("udp-field",{name:"referenceCode"},i("udp-fluent-text-input",{label:"Reference Code",disabled:t,placeholder:"Enter an optional reference code",maxLength:32}))))}(n)))}get el(){return o(this)}};function re(e,t){var i,n,o,l,r,s,a,d,u,c,p,f,m,h,v;const b=V(t),g={},y=null!==(n=null===(i=e.data)||void 0===i?void 0:i.submissionResponseData)&&void 0!==n?n:{};for(const[e,t]of Object.entries(y)){const i={};for(const[n,o]of Object.entries(t)){let t=b.byExact(e,n);if(!t){const i=$(e);i!==e&&(t=b.byExact(i,n))}i[n]=se(o,null==t?void 0:t.fieldTypeId)}g[e]=i}const x={metadata:de(null!==(l=null===(o=e.data)||void 0===o?void 0:o.submissionMetadata)&&void 0!==l?l:null),responses:g,templateOverrides:ue(null!==(s=null===(r=e.data)||void 0===r?void 0:r.formTemplateOverrides)&&void 0!==s?s:null)};return{id:e.id,formId:e.formId,formVersion:e.formVersion,status:e.status,unityUserId:null!==(a=e.unityUserId)&&void 0!==a?a:null,userDisplayName:null!==(d=e.userDisplayName)&&void 0!==d?d:null,userEmail:null!==(u=e.userEmail)&&void 0!==u?u:null,initialCreatedOn:e.initialCreatedOn,lastModifiedOn:e.lastModifiedOn,submittedOn:null!==(c=e.submittedOn)&&void 0!==c?c:null,dueDate:null!==(p=e.dueDate)&&void 0!==p?p:null,generic1:null!==(f=e.generic1)&&void 0!==f?f:null,generic2:null!==(m=e.generic2)&&void 0!==m?m:null,generic3:null!==(h=e.generic3)&&void 0!==h?h:null,data:x,wireResponseData:null!==(v=y)&&void 0!==v?v:{}}}function se(e,t){var i,n;const o=function(e){var t,i,n,o,l;return null==e?null:{signature:null!==(t=e.signature)&&void 0!==t?t:null,location:null!==(i=e.location)&&void 0!==i?i:null,image:null!==(n=e.image)&&void 0!==n?n:null,file:null!==(o=e.file)&&void 0!==o?o:null,followUpFormSubmissionId:null!==(l=e.followUpFormSubmissionId)&&void 0!==l?l:null}}(null!==(i=e.metadata)&&void 0!==i?i:null),l=null==t?null:v(t,e.value);return{value:null==t?null:b(t,l,o),comments:(null!==(n=e.comments)&&void 0!==n?n:[]).map(ae),metadata:o}}function ae(e){var t,i,n,o;return{commentId:e.commentId,userDisplayName:null!==(t=e.userDisplayName)&&void 0!==t?t:null,userId:e.userId,timestamp:e.timestamp,editedTimestamp:null!==(i=e.editedTimestamp)&&void 0!==i?i:null,isDeleted:null!==(n=e.isDeleted)&&void 0!==n?n:null,value:null!==(o=e.value)&&void 0!==o?o:null}}function de(e){return null==e?null:e.parentSubmission?{parentSubmission:{submissionId:e.parentSubmission.submissionId,formId:e.parentSubmission.formId,formVersion:e.parentSubmission.formVersion}}:{}}function ue(e){var t,i;return null==e?null:{formName:null!==(t=e.formName)&&void 0!==t?t:null,formDescription:null!==(i=e.formDescription)&&void 0!==i?i:null}}function ce(e){const{loadedForm:t,submission:i,urlContext:n}=e,o=[];for(const e of t.sections){const t=me(e.name,i,n);for(let i=1;i<=t;i++)o.push(pe(e,i))}return o}function pe(e,t){const i=1===t,n=N();return{schemaSection:e,instanceId:n,suffix:t,isOriginal:i,slotName:i?e.name:`${e.name}_${t}`,questions:e.questions.map((e=>({schemaQuestion:e,fieldKey:fe(e.id,n,i)})))}}function fe(e,t,i){return i?e:`${e}__${t}`}function me(e,t,i){var n;let o=1;if(null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.responses)for(const i of Object.keys(t.data.responses)){const t=ve(i,e);null!=t&&t>o&&(o=t)}if(i){const t=he.length;for(const n of Object.keys(i)){const i=n.toLowerCase();if(!i.startsWith(he))continue;const l=i.slice(t),r=l.indexOf(".");if(r<=0)continue;const s=ve(l.slice(0,r),e.toLowerCase());null!=s&&s>o&&(o=s)}}return o}le.style=":host{display:block;width:100%}.options-grid{display:flex;flex-direction:column;gap:var(--spacingVerticalS)}.options-drag-handle-spacer{width:24px;min-width:24px}.option-drag-handle{display:flex;align-items:center;justify-content:center;width:24px;min-width:24px;color:var(--colorNeutralForeground3);cursor:grab;user-select:none;-webkit-user-select:none}.option-drag-handle:active{cursor:grabbing}.sortable-ghost{opacity:0.4;border:2px dashed var(--colorBrandStroke1) !important;background-color:var(--colorBrandBackground2) !important}.sortable-chosen{background-color:var(--colorNeutralBackground1Hover)}.sortable-drag{opacity:0.9;box-shadow:var(--shadow16);cursor:grabbing !important}.options-grid-header{display:grid;grid-template-columns:24px 1fr 1fr 32px;gap:var(--spacingHorizontalS);align-items:center}.options-grid-header-label{font-size:var(--fontSizeBase200);font-weight:var(--fontWeightSemibold);color:var(--colorNeutralForeground2)}.option-row{display:grid;grid-template-columns:24px 1fr 1fr 32px;gap:var(--spacingHorizontalS);align-items:center;padding:var(--spacingVerticalXS) var(--spacingHorizontalS) var(--spacingVerticalS) 0;background-color:var(--colorNeutralBackground2);border-radius:var(--borderRadiusMedium);margin-bottom:var(--spacingVerticalXS)}.options-grid--choice .options-grid-header,.options-grid--choice .option-row{grid-template-columns:24px 2fr 1fr 32px}.option-row-actions{display:flex;justify-content:center;min-width:32px}.options-add-row{margin-top:4px;padding:2px 0 0 0}.table-col-card{background-color:var(--colorNeutralBackground2);border-radius:var(--borderRadiusMedium);padding:var(--spacingVerticalXS) var(--spacingHorizontalS) var(--spacingVerticalS) 0;margin-bottom:var(--spacingVerticalXS)}.table-col-main-row{display:grid;grid-template-columns:24px 1fr 1fr 32px;gap:var(--spacingHorizontalS);align-items:center}.table-col-secondary{display:flex;flex-wrap:wrap;gap:var(--spacingHorizontalS);align-items:center;padding-top:var(--spacingVerticalXS);padding-left:calc(24px + var(--spacingHorizontalXS))}@container (max-width: 400px){.options-grid-header{display:none}.option-row{grid-template-columns:24px 1fr 1fr;gap:var(--spacingHorizontalS) 2px;padding:2px 0}.option-row-actions{grid-column:2 / -1;justify-content:flex-end}}";const he="seed_";function ve(e,t){if(e===t)return 1;const i=`${t}_`;if(!e.startsWith(i))return null;const n=e.slice(i.length),o=Number(n);return!Number.isInteger(o)||o<2?null:o}function be(e,t,i){const n=t.toLowerCase(),o=i.toLowerCase();for(const t of e)if(t.slotName.toLowerCase()===n)for(const e of t.questions)if(e.schemaQuestion.name.toLowerCase()===o)return{section:t,question:e};return null}function ge(e){if(e.fieldTypeId===s.Location){const t=e.fieldProperties;if(t.defaultLocation)return v(s.Location,t.defaultLocation)}return null}function ye(e,t){var i,n,o,l;const r={},s=null!==(n=null===(i=null==t?void 0:t.data)||void 0===i?void 0:i.responses)&&void 0!==n?n:{};for(const t of e){const e=null!==(o=s[t.slotName])&&void 0!==o?o:null;for(const i of t.questions){const t=null===(l=null==e?void 0:e[i.schemaQuestion.name])||void 0===l?void 0:l.value;r[i.fieldKey]=void 0!==t?t:ge(i.schemaQuestion)}}return r}function xe(e,t=[]){const i=new FormData;i.append("FormId",String(e.FormId)),i.append("FormVersion",String(e.FormVersion)),i.append("Status",String(e.Status)),i.append("InitialCreatedOn",e.InitialCreatedOn),i.append("LastModifiedOn",e.LastModifiedOn),e.Id&&i.append("Id",String(e.Id)),e.submittedOn&&i.append("submittedOn",e.submittedOn),e.generic1&&i.append("generic1",e.generic1),e.generic2&&i.append("generic2",e.generic2),e.generic3&&i.append("generic3",e.generic3),i.append("Data",JSON.stringify(e.Data));for(const e of t)i.append("FormFiles",e);return i}async function we(e){var t,i;if(e.isPublicMode){if(!e.tenantId)throw new Error("submitSubmission: public mode requires a tenantId.");if(e.status!==w.Submitted)throw new Error("submitSubmission: public mode is single-shot — only `SubmissionStatus.Submitted` is allowed.")}const n=null!==(t=e.dynamicSections)&&void 0!==t?t:ce({loadedForm:e.loadedForm,submission:e.current}),o=xe(function(e){var t,i,n,o,l,r,a;const{loadedForm:d,values:u,current:c,status:p,generic:f,commentsByQuestionId:m}=e,h=null!==(t=e.dynamicSections)&&void 0!==t?t:ce({loadedForm:d,submission:c}),v=(new Date).toISOString(),b=function(e,t,i,n){var o,l,r,a;const d={},u=null!==(o=null==i?void 0:i.wireResponseData)&&void 0!==o?o:{};for(const i of e){const e={},o=u[i.slotName];for(const d of i.questions){const i=d.schemaQuestion,u=null==o?void 0:o[i.name],c=x(i.fieldTypeId),p=t[d.fieldKey];let f;f=i.fieldTypeId===s.Paragraph?null!==(l=i.fieldProperties.paragraphText)&&void 0!==l?l:"string"==typeof(null==u?void 0:u.value)?u.value:"":c?g(i.fieldTypeId,p):null!==(r=null==u?void 0:u.value)&&void 0!==r?r:"";const m=c?y(i.fieldTypeId,p,null==u?void 0:u.metadata):null==u?void 0:u.metadata,h={value:null!=f?f:"",comments:n&&d.fieldKey in n?n[d.fieldKey]:null!==(a=null==u?void 0:u.comments)&&void 0!==a?a:[]};null!=m&&(h.metadata=m),e[i.name]=h}d[i.slotName]=e}return d}(h,u,c,m),w={FormId:d.form.id,FormVersion:d.form.version,Status:p,InitialCreatedOn:null!==(i=null==c?void 0:c.initialCreatedOn)&&void 0!==i?i:v,LastModifiedOn:v,Data:{submissionResponseData:b,submissionMetadata:null!==(n=null==c?void 0:c.data.metadata)&&void 0!==n?n:null,formTemplateOverrides:void 0!==e.templateOverrides?e.templateOverrides:null!==(o=null==c?void 0:c.data.templateOverrides)&&void 0!==o?o:null}};(null==c?void 0:c.id)&&(w.Id=c.id),(null==c?void 0:c.submittedOn)&&(w.submittedOn=c.submittedOn);const S=null!==(l=null==f?void 0:f.generic1)&&void 0!==l?l:null==c?void 0:c.generic1,_=null!==(r=null==f?void 0:f.generic2)&&void 0!==r?r:null==c?void 0:c.generic2,k=null!==(a=null==f?void 0:f.generic3)&&void 0!==a?a:null==c?void 0:c.generic3;return S&&(w.generic1=S),_&&(w.generic2=_),k&&(w.generic3=k),w}({loadedForm:e.loadedForm,dynamicSections:n,values:e.values,current:e.current,status:e.status,generic:e.generic,templateOverrides:e.templateOverrides,commentsByQuestionId:e.commentsByQuestionId}),e.dynamicSections?S(n.flatMap((t=>t.questions.map((t=>({fieldTypeId:t.schemaQuestion.fieldTypeId,value:e.values[t.fieldKey]})))))):_(e.loadedForm,e.values)),{method:l,url:r}=function(e){var t,i;const n=`${C.productV1ApiUrl}/UdpFormSubmission`;return e.isPublicMode?{method:"POST",url:`${n}/public?tenantId=${encodeURIComponent(String(null!==(t=e.tenantId)&&void 0!==t?t:""))}`}:(null===(i=e.current)||void 0===i?void 0:i.id)?{method:"PUT",url:`${n}/private`}:{method:"POST",url:`${n}/private`}}(e),a=await P(l,r,o,!0);if(""===a||null==a){if(!(null===(i=e.current)||void 0===i?void 0:i.id))throw new Error("Submit returned no body but there is no submission id to refetch.");return await async function(e,t){const i=`${C.productV1ApiUrl}/UdpFormSubmission/${e}/Full`;return re(await P("GET",i),t)}(e.current.id,e.loadedForm)}return re(a,e.loadedForm)}function Se(e,t){var i,n,o,l,r,s;const a={},d={},u={},c=null!==(i=null==t?void 0:t.wireResponseData)&&void 0!==i?i:{},p=null!==(o=null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.responses)&&void 0!==o?o:{};for(const t of e){const e=p[t.slotName],i=c[t.slotName];for(const n of t.questions){const t=n.fieldKey,o=n.schemaQuestion.name;a[t]=(null!==(r=null===(l=null==e?void 0:e[o])||void 0===l?void 0:l.comments)&&void 0!==r?r:[]).map((e=>Object.assign({},e)));const c=null==i?void 0:i[o],p=(c&&Array.isArray(c.draftComments)?c.draftComments:[]).find((e=>e&&"string"==typeof e.value));d[t]=null!==(s=null==p?void 0:p.value)&&void 0!==s?s:null,u[t]=null}}return{byQuestionId:a,draftByQuestionId:d,editingCommentIdByQuestionId:u}}function _e(e){return(null!=e?e:[]).filter((e=>!0!==e.isDeleted))}function ke(e,t,i,n=null){return Object.assign(Object.assign({},e),{draftByQuestionId:Object.assign(Object.assign({},e.draftByQuestionId),{[t]:i}),editingCommentIdByQuestionId:Object.assign(Object.assign({},e.editingCommentIdByQuestionId),{[t]:null==i?null:n})})}function qe(e,t,i,n){var o;const l=(null!==(o=e.byQuestionId[t])&&void 0!==o?o:[]).map((e=>e.commentId===i?Object.assign(Object.assign({},e),n):e));return Object.assign(Object.assign({},e),{byQuestionId:Object.assign(Object.assign({},e.byQuestionId),{[t]:l})})}function Oe(e,t){const i=Array.isArray(e)?e:ce({loadedForm:e,submission:null});for(const e of i)for(const i of e.questions)if(i.fieldKey===t)return{sectionKey:e.slotName,questionKey:i.schemaQuestion.name,question:i.schemaQuestion};return null}function Fe(e){const t=e.fieldProperties;return!0===(null==t?void 0:t.allowComments)}const Ce=new WeakMap;function Ie(e){return`${C.productV1ApiUrl}/UdpFormSubmission/${e.submissionId}/comments`}function De(e){const t=e.fieldProperties;return!0===(null==t?void 0:t.allowFollowUpForms)}function je(e,t,i,n){var o,l;const r=Object.assign({},e),s=Object.assign({},null!==(o=r[t])&&void 0!==o?o:{}),a=null!==(l=s[i])&&void 0!==l?l:{value:null},d=null!=a.metadata&&"object"==typeof a.metadata?a.metadata:{};return s[i]=Object.assign(Object.assign({},a),{metadata:Object.assign(Object.assign({},d),n)}),r[t]=s,r}function Ne(e){const{currentPathname:t,parentFormId:i,childFormId:n,childSubmissionId:o}=e;let l=t;return t.includes(String(i))?l=t.replace(String(i),String(n)):console.warn("[udp-question-form] follow-up URL: parent form id not found in path; the new tab may load the wrong form. Path:",t),`${l}?udpf_submissionId=${encodeURIComponent(String(o))}`}function Pe(e,t){let i=0,n=0;for(const o of e)for(const e of o.questions)l(e.schemaQuestion.fieldTypeId)||(n+=1,a(t[e.fieldKey])||(i+=1));return{answered:i,total:n}}const Ve=["#264f78","#0078d4","#107c10","#bf4080","#8764b8","#ca5010","#005b70","#d83b01"];function $e(e){const t=(null!=e?e:"").trim();if(0===t.length)return"#707070";let i=0;for(let e=0;e<t.length;e++)i=31*i+t.charCodeAt(e)|0;return Ve[Math.abs(i)%Ve.length]}function Le(e,t){return i=>{var n;const o=null!==(n=i.detail)&&void 0!==n?n:"";t(e,o)}}function Ae(e){const{question:t,fieldKey:n,comments:o,draft:l,currentUserId:r,isReadOnly:s,hideHeader:a,onOpenDraft:d,onChangeDraft:u,onSaveDraft:c,onCancelDraft:p,onEdit:f,onDelete:m}=e,h=_e(o),v=null!==l,b=v&&null!=l&&l.trim().length>0;return i("section",{class:"comment-thread","data-question-thread":n},!a&&i("header",{class:"comment-thread__header"},i("udp-text",{variant:"caption1Strong",class:"comment-thread__label"},t.questionText||"Untitled question")),0===h.length&&!v&&i("udp-text",{variant:"caption2",class:"comment-thread__empty"},"No comments yet."),i("div",{class:"comment-thread__items"},h.map((e=>function(e){var t,n,o;const{comment:l,currentUserId:r,onEdit:s,onDelete:a}=e,d=null!=r&&l.userId===r,u=l.editedTimestamp&&l.timestamp&&l.editedTimestamp!==l.timestamp,c=null!==(t=l.userDisplayName)&&void 0!==t?t:"Unknown user",p=null!==(n=l.userId)&&void 0!==n?n:c;return i("div",{class:"comment-item",key:l.commentId},i("span",{class:"comment-item__avatar",style:{backgroundColor:$e(p)},"aria-hidden":"true"},function(e){const t=(null!=e?e:"").trim();return 0===t.length?"?":t[0].toUpperCase()}(c)),i("div",{class:"comment-item__header"},i("udp-text",{variant:"caption1Strong"},c),i("udp-text",{variant:"caption2",class:"comment-item__timestamp"},function(e){if(!e)return"";try{return new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch(t){return e}}(l.timestamp),u?" · edited":""),d&&i("div",{class:"comment-item__actions"},i("udp-fluent-icon-button",{appearance:"transparent",size:"small",iconName:"edit",ariaLabel:"Edit comment",onClick:()=>s(l.commentId)}),i("udp-fluent-icon-button",{appearance:"transparent",size:"small",iconName:"delete",ariaLabel:"Delete comment",onClick:()=>a(l.commentId)}))),i("udp-text",{variant:"body2",class:"comment-item__body"},null!==(o=l.value)&&void 0!==o?o:""))}({comment:e,currentUserId:r,onEdit:e=>f(n,e),onDelete:e=>m(n,e)})))),v&&i("div",{class:"comment-thread__draft",onKeyDown:e=>{"Escape"===e.key&&(e.stopPropagation(),p(n))}},i("udp-textarea",{placeholder:"Add a comment",value:null!=l?l:"",autoResize:!0,required:!1,disabled:s,onValueChanged:Le(n,u)}),i("div",{class:"comment-thread__draft-actions"},i("udp-fluent-button",{appearance:"transparent",size:"small",onClick:()=>p(n)},"Cancel"),i("udp-fluent-button",{appearance:"primary",size:"small",disabled:!b,onClick:()=>c(n)},"Save"))),!v&&!s&&i("udp-fluent-button",{class:"comment-thread__compose-placeholder",appearance:"subtle",size:"small",startIconName:"add",onClick:e=>{e.stopPropagation(),d(n)}},"Add a comment"))}const Ue=e=>D({driveFileId:e.driveFileId,name:e.name,extension:e.extension});function Te(e,t){var i;if(null==t||""===t)return"";const n=e.find((e=>e.value===t));return null!==(i=null==n?void 0:n.display)&&void 0!==i?i:String(t)}function ze(e,t){const i=e.map((e=>({display:e.display||String(e.value),selected:t.includes(e.value)})));for(const n of t)"string"==typeof n&&""!==n&&(e.some((e=>e.value===n))||i.push({display:n,selected:!0}));return i}function Be(e,t){return i("div",{class:"question-view__options",role:"list"},e.map((e=>i("div",{class:{"question-view__option":!0,"question-view__option--selected":e.selected},role:"listitem"},i("udp-fluent-icon",{class:"question-view__option-mark",name:"single"===t?"radio-button":e.selected?"checkbox-checked":"checkbox-unchecked",variant:e.selected?"filled":"regular",size:"sm"}),i("udp-text",{variant:"body1"},e.display)))))}function Ee(e){if("string"!=typeof e||""===e)return"";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function Re(e){return i("udp-text",{variant:"body1"},""===e?"—":e)}function Me(e){var t;const i=null!==(t=e.maxDate)&&void 0!==t?t:void 0;if(!0!==e.noFutureDate)return i;const n=(new Date).toISOString().slice(0,10);return i&&i<n?i:n}function He(e){if(e)return e.length>5?e.slice(0,5):e}const Xe=[{label:"Yes",value:"true"},{label:"No",value:"false"},{label:"Not Applicable",value:"na"}];function Qe(e,t){return!0===t.formReadOnly||!0===e.readOnly}function Ke(e,t){return Qe(e,t)||!0===t.previewMode}function Ge(e,t,n,o){return null==o?null:i("div",Object.assign({key:t},function(e,t,i){return{"data-question-id":e.id,"data-field-key":t,class:i.highlightedQuestionId===e.id?"question-card question-card--highlighted":"question-card"}}(e,t,n)),function(e,t,n){const o=function(e,t,n){if(!n.commentsAdapter)return null;if(!Fe(e))return null;const o=n.commentsAdapter.getCount(t),l=o>0;return i("udp-fluent-button",{appearance:"transparent",size:"small",startIconName:"comment","aria-label":`Comments on ${e.questionText||"this question"}${l?` (${o})`:""}`,onClick:e=>{var i;e.stopPropagation(),null===(i=n.commentsAdapter)||void 0===i||i.onToggle(t)}},l?`Comments (${o})`:"Add comment")}(e,t,n),l=function(e,t,n){if(!n.followUpFormsAdapter)return null;if(!De(e))return null;const o=null!=n.followUpFormsAdapter.getStampedChildId(t);return i("div",{class:"question-card__follow-up-toggle"},i("udp-fluent-icon-button",{iconName:"link",iconVariant:o?"filled":"regular",size:"small",appearance:"transparent",ariaLabel:o?`Linked follow-up form for ${e.questionText||"this question"}`:`Link a follow-up form to ${e.questionText||"this question"}`,onClick:e=>{var i;e.stopPropagation(),null===(i=n.followUpFormsAdapter)||void 0===i||i.onLaunch(t)}}))}(e,t,n);return o||l?i("div",{class:"question-card__toggles"},l,o):null}(e,t,n),o,function(e,t,n){var o,l,r;const s=n.comments;if(!s)return null;if(!Fe(e))return null;if(!(null===(o=n.commentsAdapter)||void 0===o?void 0:o.isExpanded(t)))return null;const a=null!==(l=s.state.byQuestionId[t])&&void 0!==l?l:[],d=null!==(r=s.state.draftByQuestionId[t])&&void 0!==r?r:null;return i("div",{class:"question-card__inline-comments"},Ae({question:e,fieldKey:t,comments:a,draft:d,currentUserId:s.currentUserId,isReadOnly:!0===n.formReadOnly||!0===n.previewMode,hideHeader:!0,onOpenDraft:s.handlers.onOpenDraft,onChangeDraft:s.handlers.onChangeDraft,onSaveDraft:s.handlers.onSaveDraft,onCancelDraft:s.handlers.onCancelDraft,onEdit:s.handlers.onEdit,onDelete:s.handlers.onDelete}))}(e,t,n))}function Ye(e){var t,n,o,l,r,a,d,u,c,p,f,m,h,v,b,g,y,x,w,S,_,k,q,O,F,C,I,D,j,N;const{question:P,context:V}=e,$=null!==(t=e.fieldKey)&&void 0!==t?t:P.id,A=$;if(!0===V.formReadOnly)return function(e){var t,n,o,l,r,a,d,u,c,p,f,m,h,v,b,g;const{question:y,context:x,fieldKey:w,value:S}=e,_=null!==(t=y.questionText)&&void 0!==t?t:"",k=y.required&&_?`${_} *`:_,q=function(e,t,n){var o,l,r;const s=n.comments;if(!s)return null;if(!Fe(e))return null;const a=null!==(o=s.state.byQuestionId[t])&&void 0!==o?o:[],d=null!==(l=s.state.draftByQuestionId[t])&&void 0!==l?l:null,u=null!==(r=n.commentsAdapter)&&void 0!==r?r:null,c=_e(a).length,p=u?i("udp-fluent-button",{class:"question-view__comment-toggle",appearance:"transparent",size:"small",startIconName:"comment","aria-label":`Comments on ${e.questionText||"this question"}${c>0?` (${c})`:""}`,onClick:e=>{e.stopPropagation(),u.onToggle(t)}},c>0?`Comments (${c})`:"Add comment"):null,f=u?u.isExpanded(t):c>0||null!=d;return p||f?i("div",{class:"question-view__inline-comments"},p,f&&Ae({question:e,fieldKey:t,comments:a,draft:d,currentUserId:s.currentUserId,isReadOnly:!0===n.previewMode,hideHeader:!0,onOpenDraft:s.handlers.onOpenDraft,onChangeDraft:s.handlers.onChangeDraft,onSaveDraft:s.handlers.onSaveDraft,onCancelDraft:s.handlers.onCancelDraft,onEdit:s.handlers.onEdit,onDelete:s.handlers.onDelete})):null}(y,w,x);let O;switch(y.fieldTypeId){case s.Hidden:return null;case s.Paragraph:{const e=y.fieldProperties;O=e.paragraphText?i("udp-text",{variant:"body1"},e.paragraphText):null;break}case s.FormMetadataDisplay:{const e=y.fieldProperties,t=x.submission,s=x.currentUser,d=null!==(o=null!==(n=null==t?void 0:t.userDisplayName)&&void 0!==n?n:null==s?void 0:s.displayName)&&void 0!==o?o:"",u=null!==(r=null!==(l=null==t?void 0:t.userEmail)&&void 0!==l?l:null==s?void 0:s.email)&&void 0!==r?r:"",c=null!==(a=null==t?void 0:t.submittedOn)&&void 0!==a?a:null;O=i("form-metadata-display",{userDisplayName:d,userEmail:u,submittedOn:c,displayOwnerFullName:!0===e.displayOwnerFullName,displayOwnerEmail:!0===e.displayOwnerEmail,displaySubmissionDate:!0===e.displaySubmissionDate});break}case s.Tally:{const e=y.fieldProperties;O=i("udp-question-tally-adapter",{loadedForm:x.loadedForm,questionId:y.id,label:k||"Response Tally",tallyMode:null!==(d=e.tallyMode)&&void 0!==d?d:"all",includeFields:null!==(u=e.includeFields)&&void 0!==u?u:[],excludeFields:null!==(c=e.excludeFields)&&void 0!==c?c:[]});break}case s.SingleLineText:case s.MultiLineText:case s.Number:O=Re(null==S||""===S?"":String(S));break;case s.YesNo:O=Be([{display:"Yes",selected:"true"===S||!0===S},{display:"No",selected:"false"===S||!1===S},{display:"Not Applicable",selected:"na"===S}],"single");break;case s.RadioButton:case s.DropdownSingleSelect:{const e=L(y),t=null==S||""===S?[]:[S];O=0===e.length?Re(Te(e,S)):Be(ze(e,t),"single");break}case s.Checkbox:case s.DropdownMultipleSelect:case s.ListMultiSelect:{const e=L(y),t=Array.isArray(S)?S:[];O=0===e.length?Re(t.map((t=>Te(e,t))).filter(Boolean).join(", ")):Be(ze(e,t),"multi");break}case s.DateSelector:O=Re(function(e){if("string"!=typeof e||""===e)return"";const t=new Date(10===e.length?`${e}T00:00:00`:e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}(S));break;case s.TimeSelector:O=Re(function(e){if("string"!=typeof e||""===e)return"";const[t,i]=e.split(":"),n=Number(t),o=Number(i);if(!Number.isFinite(n)||!Number.isFinite(o))return e;const l=new Date;return l.setHours(n,o,0,0),l.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}(S));break;case s.DateTimeSelector:O=Re(Ee(S));break;case s.Location:{const e=y.fieldProperties,t=null!=S?S:null,n=Y(),o="string"==typeof e.mapZoom?Number(e.mapZoom):e.mapZoom,l=null!=t&&"number"==typeof t.latitude&&"number"==typeof t.longitude&&!!(null==n?void 0:n.tileUrlTemplate),r=null!==(f=null===(p=null==t?void 0:t.address)||void 0===p?void 0:p.freeformAddress)&&void 0!==f?f:"";O=i("div",{class:"question-view__location"},Re(r),l&&i("udp-fluent-location-input",{value:S,readonly:!0,disabled:!0,showMap:!0,hideAddressSearch:!0,defaultZoom:Number.isFinite(o)?o:void 0,tileUrlTemplate:null==n?void 0:n.tileUrlTemplate,searchAddresses:null==n?void 0:n.searchAddresses,reverseGeocode:null==n?void 0:n.reverseGeocode}));break}case s.FileUpload:O=i("udp-fluent-file-input",{view:"list",value:S,readonly:!0,hideDragAndDrop:!0,hideButton:!0,loadStoredFile:Ue});break;case s.ImageUpload:O=i("udp-fluent-file-input",{view:"gallery",accept:"image/*",value:S,readonly:!0,hideDragAndDrop:!0,hideButton:!0,loadStoredFile:Ue});break;case s.Signature:{const e=null!=S?S:null,t=null!==(m=null==e?void 0:e.fullName)&&void 0!==m?m:"",n=Ee(null!==(v=null===(h=null==e?void 0:e.metadata)||void 0===h?void 0:h.timestamp)&&void 0!==v?v:""),o=null===(b=x.signaturePreviewUrls)||void 0===b?void 0:b[w];O=o?i("div",{class:"question-view__signature"},i("udp-fluent-image",{bordered:!0,fit:"contain"},i("img",{class:"question-view__signature-img",src:o,alt:t?`Signature of ${t}`:"Signature"})),(t||n)&&i("div",{class:"question-view__signature-meta"},t&&i("udp-text",{variant:"body1"},t),n&&i("udp-text",{variant:"caption1"},"Signed ",n))):Re(t);break}case s.Table:{const e=(null!==(g=y.fieldProperties.columns)&&void 0!==g?g:[]).filter((e=>"string"==typeof e.id&&e.id.length>0&&"string"==typeof e.name)).map((e=>({id:e.id,name:e.name,type:"number"===e.type?"number":"text",required:!0===e.required,aggregate:e.aggregate,aggregateDecimalPlaces:e.aggregateDecimalPlaces})));O=i("udp-fluent-table-input",{value:S,readonly:!0,disabled:!0,columns:e});break}default:O=Re(null==S?"":String(S))}return i("udp-detail-list-item",{label:k,emptyState:"hide"},O,q)}({question:P,context:V,fieldKey:$,value:null===(n=V.values)||void 0===n?void 0:n[$]});switch(P.fieldTypeId){case s.Hidden:return null;case s.Paragraph:{const e=P.fieldProperties;return Ge(P,$,V,i("udp-flexbox",{display:"flex",direction:"column",gap:"xs"},P.questionText&&i("udp-text",{variant:"body1Strong"},P.questionText),e.paragraphText&&i("udp-text",{variant:"body1"},e.paragraphText)))}case s.SingleLineText:return Ge(P,$,V,i("udp-field",{name:A},i("udp-fluent-text-input",{label:P.questionText,hint:null!==(o=P.helperText)&&void 0!==o?o:void 0,required:P.required,disabled:Qe(P.fieldProperties,V)})));case s.MultiLineText:return Ge(P,$,V,i("udp-field",{name:A},i("udp-textarea",{label:P.questionText,hint:null!==(l=P.helperText)&&void 0!==l?l:void 0,required:P.required,disabled:Qe(P.fieldProperties,V),autoResize:!0})));case s.Number:return Ge(P,$,V,i("udp-field",{name:A},i("udp-fluent-text-input",{label:P.questionText,hint:null!==(r=P.helperText)&&void 0!==r?r:void 0,required:P.required,type:"number",disabled:Qe(P.fieldProperties,V)})));case s.YesNo:return Ge(P,$,V,i("udp-field",{name:A},i("udp-fluent-radio-group",{label:P.questionText,hint:null!==(a=P.helperText)&&void 0!==a?a:void 0,items:Xe,disabled:Qe(P.fieldProperties,V)})));case s.Checkbox:{const e=P.fieldProperties;return Ge(P,$,V,i("udp-field",{name:A},i("udp-fluent-list-input",{label:P.questionText,hint:null!==(d=P.helperText)&&void 0!==d?d:void 0,required:P.required,options:L(P),disabled:Qe(e,V)})))}case s.RadioButton:{const e=P.fieldProperties,t=L(P).map((e=>({label:e.display,value:e.value})));return Ge(P,$,V,i("udp-field",{name:A},i("udp-fluent-radio-group",{label:P.questionText,hint:null!==(u=P.helperText)&&void 0!==u?u:void 0,items:t,disabled:Qe(e,V)})))}case s.DropdownSingleSelect:{const e=P.fieldProperties;return Ge(P,$,V,i("udp-field",{name:A},i("udp-fluent-dropdown",{label:P.questionText,hint:null!==(c=P.helperText)&&void 0!==c?c:void 0,required:P.required,options:L(P),optionLabel:"display",optionValue:"value",valueAs:"value",disabled:Qe(e,V)})))}case s.DropdownMultipleSelect:{const e=P.fieldProperties;return Ge(P,$,V,i("udp-field",{name:A},i("udp-fluent-dropdown",{label:P.questionText,hint:null!==(p=P.helperText)&&void 0!==p?p:void 0,required:P.required,options:L(P),optionLabel:"display",optionValue:"value",multiple:!0,valueAs:"value",disabled:Qe(e,V)})))}case s.ListMultiSelect:{const e=P.fieldProperties;return Ge(P,$,V,i("udp-field",{name:A},i("udp-fluent-list-input",{label:P.questionText,hint:null!==(f=P.helperText)&&void 0!==f?f:void 0,required:P.required,options:L(P),disabled:Qe(e,V)})))}case s.DateSelector:{const e=P.fieldProperties;return Ge(P,$,V,i("udp-field",{name:A},i("udp-date-input",{label:P.questionText,hint:null!==(m=P.helperText)&&void 0!==m?m:void 0,required:P.required,minDate:null!==(h=e.minDate)&&void 0!==h?h:void 0,maxDate:Me(e),disabled:Qe(e,V)})))}case s.TimeSelector:{const e=P.fieldProperties;return Ge(P,$,V,i("udp-field",{name:A},i("udp-time-input",{label:P.questionText,hint:null!==(v=P.helperText)&&void 0!==v?v:void 0,required:P.required,min:He(e.minTime),max:He(e.maxTime),disabled:Qe(e,V)})))}case s.DateTimeSelector:{const e=P.fieldProperties;return Ge(P,$,V,i("udp-field",{name:A},i("udp-date-time-input",{label:P.questionText,hint:null!==(b=P.helperText)&&void 0!==b?b:void 0,required:P.required,minDate:null!==(g=e.minDateTime)&&void 0!==g?g:void 0,maxDate:Me({maxDate:e.maxDateTime,noFutureDate:e.noFutureDate}),disabled:Qe(e,V)})))}case s.FormMetadataDisplay:{const e=P.fieldProperties,t=V.submission,n=V.currentUser,o=null!==(x=null!==(y=null==t?void 0:t.userDisplayName)&&void 0!==y?y:null==n?void 0:n.displayName)&&void 0!==x?x:"",l=null!==(S=null!==(w=null==t?void 0:t.userEmail)&&void 0!==w?w:null==n?void 0:n.email)&&void 0!==S?S:"",r=null!==(_=null==t?void 0:t.submittedOn)&&void 0!==_?_:null;return Ge(P,$,V,i("udp-flexbox",{display:"flex",direction:"column",gap:"xs"},P.questionText&&i("udp-text",{variant:"body1Strong"},P.questionText),i("form-metadata-display",{userDisplayName:o,userEmail:l,submittedOn:r,displayOwnerFullName:!0===e.displayOwnerFullName,displayOwnerEmail:!0===e.displayOwnerEmail,displaySubmissionDate:!0===e.displaySubmissionDate})))}case s.Tally:{const e=P.fieldProperties;return Ge(P,$,V,i("udp-question-tally-adapter",{loadedForm:V.loadedForm,questionId:P.id,label:P.questionText||"Response Tally",tallyMode:null!==(k=e.tallyMode)&&void 0!==k?k:"all",includeFields:null!==(q=e.includeFields)&&void 0!==q?q:[],excludeFields:null!==(O=e.excludeFields)&&void 0!==O?O:[]}))}case s.Location:{const e=P.fieldProperties,t=Y(),n="string"==typeof e.mapZoom?Number(e.mapZoom):e.mapZoom;return Ge(P,$,V,i("udp-field",{name:A},i("udp-fluent-location-input",{label:P.questionText,hint:null!==(F=P.helperText)&&void 0!==F?F:void 0,required:P.required,disabled:Qe(e,V),showMap:!0===e.showMap,hideAddressSearch:!0===e.hideAddressSearch,defaultZoom:Number.isFinite(n)?n:void 0,tileUrlTemplate:null==t?void 0:t.tileUrlTemplate,searchAddresses:null==t?void 0:t.searchAddresses,reverseGeocode:null==t?void 0:t.reverseGeocode})))}case s.FileUpload:{const e=P.fieldProperties;return Ge(P,$,V,i("udp-field",{name:A},i("udp-fluent-file-input",{view:"list",label:P.questionText,hint:null!==(C=P.helperText)&&void 0!==C?C:void 0,required:P.required,disabled:Ke(e,V),hideDragAndDrop:!0===e.hideDragAndDrop,hideButton:!0===e.hideButton,displayUploadTime:!0===e.displayUploadTime,maxFiles:!0===e.allowMultiple?void 0:1})))}case s.ImageUpload:{const e=P.fieldProperties;return Ge(P,$,V,i("udp-field",{name:A},i("udp-fluent-file-input",{view:"gallery",accept:"image/*",label:P.questionText,hint:null!==(I=P.helperText)&&void 0!==I?I:void 0,required:P.required,disabled:Ke(e,V),hideDragAndDrop:!0===e.hideDragAndDrop,hideButton:!0===e.hideButton,displayUploadTime:!0===e.displayUploadTime,maxFiles:!0===e.allowMultiple?void 0:1})))}case s.Signature:{const e=P.fieldProperties;return Ge(P,$,V,i("udp-field",{name:A},i("udp-fluent-signature-input",{label:P.questionText,hint:null!==(D=P.helperText)&&void 0!==D?D:void 0,required:P.required,disabled:Ke(e,V),includeLocation:!0===e.includeLocation})))}case s.Table:{const e=P.fieldProperties,t=(null!==(j=e.columns)&&void 0!==j?j:[]).filter((e=>"string"==typeof e.id&&e.id.length>0&&"string"==typeof e.name)).map((e=>({id:e.id,name:e.name,type:"number"===e.type?"number":"text",required:!0===e.required,aggregate:e.aggregate,aggregateDecimalPlaces:e.aggregateDecimalPlaces})));return Ge(P,$,V,i("udp-field",{name:A},i("udp-fluent-table-input",{label:P.questionText,hint:null!==(N=P.helperText)&&void 0!==N?N:void 0,required:P.required,disabled:Qe(e,V),columns:t})))}default:return function(e,t,n){return Ge(e,t,n,i("udp-flexbox",{display:"flex",direction:"column",gap:"xs"},i("udp-text",{variant:"body1Strong"},e.questionText),i("udp-text",{variant:"caption1",color:"muted"},"FieldType ",e.fieldTypeId," not yet supported in pass 1",e.helperText?` — ${e.helperText}`:"")))}(P,$,V)}}function We(e){const{isOpen:t,options:n,selectedFormId:o,isLoading:l,isLaunching:r,onSelect:s,onLaunch:a,onClose:d}=e,u=()=>{r||d()};return i("udp-fluent-dialog",{open:t,dialogTitle:"Link a follow-up form",maxHeight:"60vh",onDialogClose:u},function(e,t,n){return n?i("udp-text",{variant:"body1"},"Loading follow-up forms…"):0===e.length?i("udp-text",{variant:"body1"},"No follow-up forms are available for this question."):i("udp-list",{selectionMode:"single",showDivider:!0,selectedItems:t?[t]:[],onListSelectionChange:e=>{e.stopPropagation();const t=e.detail.selectedItems[0];"string"==typeof t&&s(t)}},e.map((e=>i("udp-fluent-list-item",{key:e.value,value:e.value,label:e.label}))))}(n,o,l),i("udp-fluent-button",{slot:"action",appearance:"secondary",disabled:r,onClick:u},"Cancel"),i("udp-fluent-button",{slot:"action",appearance:"primary",disabled:!o||r||l,onClick:()=>a()},r?"Creating…":"Create"))}const Ze="udp-question-form-renderer-form";const Je=class{constructor(i){e(this,i),this.submitted=t(this,"submitted",7),this.tenantId=null,this.isPublicMode=!1,this.history=null,this.urlContext={},this.autoSaveDelay=2e3,this.previewMode=!1,this.highlightedQuestionId=null,this.readOnly=!1,this.resolvedForm=null,this.submission=null,this.initialValues={},this.signaturePreviewUrls={},this.isLoading=!0,this.dynamicSections=[],this.publicModeError=null,this.loadError=null,this.currentUser=null,this.templateOverrides=null,this.commentsState={byQuestionId:{},draftByQuestionId:{},editingCommentIdByQuestionId:{}},this.expandedCommentPanels={},this.followUpPickerOpen=!1,this.followUpPickerQuestionId=null,this.followUpPickerSelectedFormId=null,this.followUpFormsList=[],this.followUpFormsListLoaded=!1,this.followUpFormsListLoading=!1,this.followUpLaunching=!1,this.hostResizeObserver=null,this.hostBoundsUpdateListener=null,this.submitInFlight=!1,this.pendingResave=!1,this.prevSubmitFailed=!1,this.formApi=null,this.autosaveTimer=null,this.lastSavedValues=null,this.formComponentEl=null,this.autosaveStatus="idle",this.lastSavedAt=null,this.progress={answered:0,total:0},this.handleFormComponentRef=e=>{this.formComponentEl=e},this.runAutosave=async()=>{if(this.autosaveTimer=null,!this.formApi)return;if(this.submitInFlight)return void(this.pendingResave=!0);const e=this.formApi.getState().values;await this.submitToBackend(e,w.InProgress,{rebuildComments:!1,showErrorSnackbar:!1})},this.handleSubmitClick=()=>{this.clearAutosaveTimer()},this.handleSubmit=async e=>{var t;this.clearAutosaveTimer(),this.previewMode?this.notifyPreviewNotSaved("Preview only — submission not saved."):(await this.flushOpenDrafts(),await this.submitToBackend(e,w.Submitted,{rebuildComments:!0,showErrorSnackbar:!0})&&(null===(t=this.submission)||void 0===t?void 0:t.id)&&this.submitted.emit(this.submission.id))},this.handleAddSection=e=>{if(!this.resolvedForm||!this.formApi)return;if(this.isReadOnly||this.previewMode)return;let t;try{t=function(e,t){var i;const n=e.filter((e=>e.schemaSection.id===t));if(0===n.length)throw new Error(`duplicateSection: no instances found for schema section ${t}`);const o=n[0].schemaSection;if(!0!==(null===(i=o.sectionProperties)||void 0===i?void 0:i.isRepeatable))throw new Error(`duplicateSection: schema section ${t} is not marked repeatable`);const l=pe(o,Math.max(...n.map((e=>e.suffix)))+1),r=e.lastIndexOf(n[n.length-1]);return{next:[...e.slice(0,r+1),l,...e.slice(r+1)],newInstance:l}}(this.dynamicSections,e)}catch(e){return void console.warn("[udp-question-form-renderer] duplicateSection refused:",e)}const i=ye([t.newInstance],null),n=this.formApi;n.batch((()=>{for(const[e,t]of Object.entries(i))n.change(e,t)})),this.dynamicSections=t.next},this.handleDeleteSection=e=>{if(!this.resolvedForm||!this.formApi)return;if(this.isReadOnly||this.previewMode)return;const t=this.dynamicSections.find((t=>t.instanceId===e));if(!t||t.isOriginal)return;const i=t.questions.map((e=>e.fieldKey)),n=this.formApi;n.batch((()=>{for(const e of i)n.change(e,void 0)}));try{this.dynamicSections=function(e,t){const i=e.findIndex((e=>e.instanceId===t));if(i<0)return e;const n=e[i];if(n.isOriginal)throw new Error("deleteSection: refusing to delete the original copy of a section (legacy invariant).");const o=n.schemaSection.id,l=e.filter(((e,t)=>t!==i));let r=2;return l.map((e=>{if(e.schemaSection.id!==o||e.isOriginal)return e;const t=r++;return t===e.suffix?e:Object.assign(Object.assign({},e),{suffix:t,slotName:`${e.schemaSection.name}_${t}`})}))}(this.dynamicSections,e)}catch(e){return void console.warn("[udp-question-form-renderer] deleteSection refused:",e)}this.commentsState=function(e,t){if(0===t.length)return e;const i=new Set(t),n=e=>{const t={};for(const n of Object.keys(e))i.has(n)||(t[n]=e[n]);return t};return{byQuestionId:n(e.byQuestionId),draftByQuestionId:n(e.draftByQuestionId),editingCommentIdByQuestionId:n(e.editingCommentIdByQuestionId)}}(this.commentsState,i)},this.toggleQuestionComments=e=>{var t;const i=!0===this.expandedCommentPanels[e];if(this.expandedCommentPanels=Object.assign(Object.assign({},this.expandedCommentPanels),{[e]:!i}),!i){_e(null!==(t=this.commentsState.byQuestionId[e])&&void 0!==t?t:[]).length>0||null!=this.commentsState.draftByQuestionId[e]||(this.commentsState=ke(this.commentsState,e,""))}},this.isCommentsPanelExpanded=e=>!0===this.expandedCommentPanels[e],this.openDraft=e=>{this.commentsState=ke(this.commentsState,e,"")},this.changeDraft=(e,t)=>{var i;const n=null!==(i=this.commentsState.editingCommentIdByQuestionId[e])&&void 0!==i?i:null;this.commentsState=ke(this.commentsState,e,t,n)},this.cancelDraft=e=>{this.commentsState=ke(this.commentsState,e,null)},this.saveDraft=async e=>{var t,i,n,o;if(this.previewMode)return null;const l=this.commentsState.draftByQuestionId[e];if(null==l||0===l.trim().length)return null;if(!this.resolvedForm)return null;const r=null!==(t=this.commentsState.editingCommentIdByQuestionId[e])&&void 0!==t?t:null,s=null===(i=this.submission)||void 0===i?void 0:i.id,a={submissionId:s,isPublicMode:this.isPublicMode},d=Oe(this.dynamicSections,e);if(r){const t=(null!==(n=this.commentsState.byQuestionId[e])&&void 0!==n?n:[]).find((e=>e.commentId===r));if(!t)return this.saveDraftAsNew(e,l);const i=Object.assign(Object.assign({},t),{value:l,editedTimestamp:(new Date).toISOString(),isDeleted:!1}),u=t;if(this.commentsState=qe(this.commentsState,e,r,i),this.commentsState=ke(this.commentsState,e,null),!s||!d)return i;try{return await async function(e,t,i){if(e.isPublicMode)throw new Error("Comment updates are not supported in public mode.");const n=`${Ie(e)}/${t}`;await P("PUT",n,i,!0)}(a,r,{sectionKey:d.sectionKey,questionKey:d.questionKey,value:l}),i}catch(t){return console.error("[udp-question-form-renderer] putComment failed:",t),this.commentsState=qe(this.commentsState,e,r,u),null===(o=this.enqueueSnackbar)||void 0===o||o.call(this,"Failed to update comment.",{variant:"error"}),null}}return this.saveDraftAsNew(e,l)},this.editComment=(e,t)=>{var i,n;const o=(null!==(i=this.commentsState.byQuestionId[e])&&void 0!==i?i:[]).find((e=>e.commentId===t));o&&(this.commentsState=ke(this.commentsState,e,null!==(n=o.value)&&void 0!==n?n:"",t))},this.deleteComment=async(e,t)=>{var i,n,o;if(this.previewMode)return;if(!(null!==(i=this.commentsState.byQuestionId[e])&&void 0!==i?i:[]).find((e=>e.commentId===t)))return;this.commentsState=function(e,t,i){return qe(e,t,i,{isDeleted:!0,value:"",editedTimestamp:(new Date).toISOString()})}(this.commentsState,e,t);const l=null===(n=this.submission)||void 0===n?void 0:n.id;if(l)try{await async function(e,t){if(e.isPublicMode)throw new Error("Comment deletion is not supported in public mode.");const i=`${Ie(e)}/${t}`;await P("DELETE",i,null,!0)}({submissionId:l,isPublicMode:this.isPublicMode},t)}catch(i){console.error("[udp-question-form-renderer] deleteComment failed:",i),this.commentsState=qe(this.commentsState,e,t,{isDeleted:!1}),null===(o=this.enqueueSnackbar)||void 0===o||o.call(this,"Failed to delete comment.",{variant:"error"})}},this.getCommentCount=e=>_e(this.commentsState.byQuestionId[e]).length,this.getFollowUpStampedChildId=e=>{var t,i,n,o;if(!this.resolvedForm||!this.submission)return null;const l=Oe(this.dynamicSections,e);if(!l)return null;const r=null===(t=this.submission.data.responses[l.sectionKey])||void 0===t?void 0:t[l.questionKey];return null!==(o=null!==(n=null===(i=null==r?void 0:r.metadata)||void 0===i?void 0:i.followUpFormSubmissionId)&&void 0!==n?n:null)&&void 0!==o?o:null},this.handleLaunchFollowUpForm=async e=>{if(this.isPublicMode)return;if(this.previewMode)return void this.notifyPreviewNotSaved("Preview only — this action is not saved.");const t=this.getFollowUpStampedChildId(e);if(t)await this.openStampedFollowUp(t);else if(this.followUpPickerQuestionId=e,this.followUpPickerSelectedFormId=null,this.followUpPickerOpen=!0,!this.followUpFormsListLoaded&&!this.followUpFormsListLoading){this.followUpFormsListLoading=!0;try{this.followUpFormsList=await q(),this.followUpFormsListLoaded=!0}finally{this.followUpFormsListLoading=!1}}},this.handleFollowUpSelect=e=>{this.followUpPickerSelectedFormId=e},this.handleFollowUpClose=()=>{this.followUpLaunching||(this.followUpPickerOpen=!1,this.followUpPickerQuestionId=null,this.followUpPickerSelectedFormId=null)},this.handleFollowUpLaunch=async()=>{var e,t,i,n,o,l,r;if(!this.resolvedForm)return;const s=this.followUpPickerQuestionId,a=this.followUpPickerSelectedFormId;if(s&&a&&!this.followUpLaunching){this.followUpLaunching=!0;try{if(!(null===(e=this.submission)||void 0===e?void 0:e.id)&&(await this.runAutosave(),!(null===(t=this.submission)||void 0===t?void 0:t.id)))return void(null===(i=this.enqueueSnackbar)||void 0===i||i.call(this,"Could not save the form before launching the follow-up. Try again.",{variant:"error"}));const r=this.submission,d=await this.fetchLatestFormVersion(a);if(null==d)return void(null===(n=this.enqueueSnackbar)||void 0===n||n.call(this,"Could not load the selected follow-up form.",{variant:"error"}));const u=await async function(e){const t=`${C.productV1ApiUrl}/UdpForm/${e.childFormId}/describe?formVersion=${e.childFormVersion}`,i=await P("GET",t),n=k(i),o=(new Date).toISOString(),l={};for(const e of n.sections){l[e.name]={};for(const t of e.questions)l[e.name][t.name]={value:"",comments:[]}}const r=xe({FormId:e.childFormId,FormVersion:e.childFormVersion,Status:w.InProgress,InitialCreatedOn:o,LastModifiedOn:o,Data:{submissionResponseData:l,submissionMetadata:{parentSubmission:{submissionId:e.parentSubmissionId,formId:e.parentFormId,formVersion:e.parentFormVersion}},formTemplateOverrides:null}}),s=`${C.productV1ApiUrl}/UdpFormSubmission/private`;return re(await P("POST",s,r,!0),n)}({childFormId:a,childFormVersion:d,parentSubmissionId:r.id,parentFormId:r.formId,parentFormVersion:r.formVersion}),c=null!==(l=null===(o=this.formApi)||void 0===o?void 0:o.getState().values)&&void 0!==l?l:{},p=await async function(e){const{loadedForm:t,parent:i,dynamicSections:n,values:o,questionId:l,childSubmissionId:r}=e,s=Oe(n||t,l);if(!s)throw new Error(`stampFollowUpOnParent: question ${l} not in schema.`);return we({loadedForm:t,dynamicSections:n,current:Object.assign(Object.assign({},i),{wireResponseData:je(i.wireResponseData,s.sectionKey,s.questionKey,{followUpFormSubmissionId:r})}),values:o,status:i.status,isPublicMode:!1})}({loadedForm:this.resolvedForm,dynamicSections:this.dynamicSections,parent:r,values:c,questionId:s,childSubmissionId:u.id});if(this.submission=p,"undefined"!=typeof window){const e=Ne({currentPathname:window.location.pathname,parentFormId:r.formId,childFormId:a,childSubmissionId:u.id});window.open(e,"_blank")}this.followUpPickerOpen=!1,this.followUpPickerQuestionId=null,this.followUpPickerSelectedFormId=null}catch(e){console.error("[udp-question-form-renderer] follow-up launch failed:",e),null===(r=this.enqueueSnackbar)||void 0===r||r.call(this,"Could not launch follow-up form.",{variant:"error"})}finally{this.followUpLaunching=!1}}}}async componentWillLoad(){var e;if(this.loadedForm&&(this.resolvedForm=this.loadedForm),this.isPublicMode&&!this.previewMode&&!this.tenantId)return this.publicModeError="Public forms require a tenantId.",void(this.isLoading=!1);const t=this.submissionId&&!this.previewMode&&!this.isPublicMode,i=!!t&&!this.formId&&!this.loadedForm;let n=null;i&&(n=await this.fetchAndLogSubmissionRaw(),(null==n?void 0:n.formId)&&(this.formId=n.formId,this.formVersion=null!==(e=n.formVersion)&&void 0!==e?e:null));const o=!this.loadedForm&&!!this.formId,[l,r]=await Promise.all([o?this.fetchAndLogDescribe():Promise.resolve(null),t&&!i?this.fetchAndLogSubmissionRaw():Promise.resolve(n)]);try{if(l&&(this.resolvedForm=l),r&&this.resolvedForm?this.submission=this.parseAndLogSubmission(r,this.resolvedForm):r&&!this.resolvedForm&&console.warn("[udp-question-form-renderer] cannot parse submission without form schema"),this.isPublicMode&&!this.previewMode&&this.resolvedForm&&!0===this.resolvedForm.form.isPrivate)return this.publicModeError="This form is not available publicly.",this.resolvedForm=null,void(this.isLoading=!1);if(this.resolvedForm){this.dynamicSections=ce({loadedForm:this.resolvedForm,submission:this.submission,urlContext:this.previewMode?null:this.urlContext});const e=ye(this.dynamicSections,this.submission);this.initialValues=this.previewMode?e:function(e,t,i,n){var o;if(n.hasExistingSubmission)return t;if(!i)return t;const l=function(e){const t=[];for(const i of Object.keys(e)){const n=i.toLowerCase();if(!n.startsWith("seed_"))continue;const o=n.slice(5),l=o.indexOf(".");if(l<=0||l===o.length-1)continue;const r=o.slice(0,l),s=o.slice(l+1),a=e[i];"string"==typeof a&&t.push({sectionSlot:r,questionSlot:s,rawValue:a})}return t}(i);if(0===l.length)return t;const r=null!==(o=n.dynamicSections)&&void 0!==o?o:ce({loadedForm:e,submission:null,urlContext:i}),s=Object.assign({},t);for(const{sectionSlot:e,questionSlot:t,rawValue:i}of l){const n=be(r,e,t);if(!n)continue;if(!a(s[n.question.fieldKey]))continue;const o=v(n.question.schemaQuestion.fieldTypeId,i);null!=o&&(s[n.question.fieldKey]=o)}return s}(this.resolvedForm,e,this.urlContext,{hasExistingSubmission:null!=this.submission&&this.submission.status!==w.Created,dynamicSections:this.dynamicSections}),this.lastSavedValues=this.initialValues,this.commentsState=Se(this.dynamicSections,this.submission);const t={};for(const e of Object.keys(this.commentsState.byQuestionId))_e(this.commentsState.byQuestionId[e]).length>0&&(t[e]=!0);this.expandedCommentPanels=t,this.progress=Pe(this.dynamicSections,this.initialValues)}this.currentUser=this.resolveCurrentUser(),this.templateOverrides=this.resolveTemplateOverrides()}catch(e){console.error("[udp-question-form-renderer] failed to initialize form:",e),this.loadError="Could not load this form. Please refresh and try again.",this.resolvedForm=null,this.submission=null,this.dynamicSections=[]}this.isLoading=!1,this.loadSignaturePreviews()}async loadSignaturePreviews(){var e,t,i;if(!this.isReadOnly)return;const n={};for(const o of this.dynamicSections)for(const l of o.questions){if(l.schemaQuestion.fieldTypeId!==s.Signature)continue;const o=this.initialValues[l.fieldKey],r=O(null!==(e=null==o?void 0:o.file)&&void 0!==e?e:null);if(r)try{const e=await D({driveFileId:r,name:null!==(i=null===(t=null==o?void 0:o.file)||void 0===t?void 0:t.name)&&void 0!==i?i:"signature.png",extension:"png"});e&&e.size>0&&(n[l.fieldKey]=URL.createObjectURL(e))}catch(e){}}Object.keys(n).length>0&&(this.revokeSignaturePreviews(),this.signaturePreviewUrls=n)}revokeSignaturePreviews(){for(const e of Object.values(this.signaturePreviewUrls))URL.revokeObjectURL(e)}urlContextValue(e){const t=this.urlContext;if(!t||"object"!=typeof t)return null;const i=e.toLowerCase();for(const e of Object.keys(t))if(e.toLowerCase()===i){const i=t[e];if(null==i)return null;if("string"!=typeof i&&"number"!=typeof i&&"boolean"!=typeof i)return null;const n=String(i).trim();return n.length>0?n:null}return null}resolveTemplateOverrides(){var e,t,i,n;const o=null!==(t=null===(e=this.submission)||void 0===e?void 0:e.data.templateOverrides)&&void 0!==t?t:null;if(o&&(o.formName||o.formDescription))return{formName:null!==(i=o.formName)&&void 0!==i?i:null,formDescription:null!==(n=o.formDescription)&&void 0!==n?n:null};if(this.previewMode)return null;const l=this.urlContextValue("override_formname"),r=this.urlContextValue("override_formdescription");return l||r?this.submission&&this.submission.status!==w.Created?null:{formName:l,formDescription:r}:null}resolveGenericContext(){const e=this.urlContextValue("generic1"),t=this.urlContextValue("generic2"),i=this.urlContextValue("generic3");if(e||t||i)return{generic1:e,generic2:t,generic3:i}}resolveCurrentUser(){var e,t,i,n;if("function"!=typeof this.getUserCallback)return null;try{const o=this.getUserCallback();return o?{id:null!==(e=o.id)&&void 0!==e?e:null,displayName:null!==(i=null!==(t=o.displayName)&&void 0!==t?t:o.name)&&void 0!==i?i:null,email:null!==(n=o.email)&&void 0!==n?n:null}:null}catch(e){return null}}handleLoadedFormChange(e){e&&(this.resolvedForm=e,this.dynamicSections=ce({loadedForm:e,submission:this.submission,urlContext:this.previewMode?null:this.urlContext}),this.initialValues=ye(this.dynamicSections,this.submission),this.commentsState=Se(this.dynamicSections,this.submission),this.progress=Pe(this.dynamicSections,this.initialValues))}handleHighlightedQuestionIdChange(){this.scrollHighlightedIntoView()}handleGetUserCallbackChange(){this.currentUser=this.resolveCurrentUser()}componentDidLoad(){this.highlightedQuestionId&&this.scrollHighlightedIntoView(),this.installHostBoundsTracker()}installHostBoundsTracker(){if(!this.el)return;const e=()=>{const e=this.el.getBoundingClientRect();this.el.style.setProperty("--udpqf-host-left",`${e.left}px`),this.el.style.setProperty("--udpqf-host-width",`${e.width}px`)};e(),"undefined"!=typeof ResizeObserver&&(this.hostResizeObserver=new ResizeObserver(e),this.hostResizeObserver.observe(this.el)),this.hostBoundsUpdateListener=e,window.addEventListener("resize",this.hostBoundsUpdateListener),window.addEventListener("scroll",this.hostBoundsUpdateListener,{passive:!0,capture:!0})}teardownHostBoundsTracker(){this.hostResizeObserver&&(this.hostResizeObserver.disconnect(),this.hostResizeObserver=null),this.hostBoundsUpdateListener&&(window.removeEventListener("resize",this.hostBoundsUpdateListener),window.removeEventListener("scroll",this.hostBoundsUpdateListener,{capture:!0}),this.hostBoundsUpdateListener=null)}scrollHighlightedIntoView(){const e=this.highlightedQuestionId;e&&requestAnimationFrame((()=>{var t;const i=null===(t=this.el)||void 0===t?void 0:t.shadowRoot;if(!i)return;const n=i.querySelector(`[data-question-id="${e}"]`);null==n||n.scrollIntoView({block:"nearest",behavior:"smooth"})}))}buildDescribeUrl(){const e=C.productV1ApiUrl,t=new URLSearchParams;if(null!=this.formVersion&&t.set("formVersion",String(this.formVersion)),this.isPublicMode){this.tenantId&&t.set("tenantId",String(this.tenantId));const i=t.toString();return`${e}/UdpForm/${this.formId}/describe/public${i?`?${i}`:""}`}const i=t.toString();return`${e}/UdpForm/${this.formId}/describe${i?`?${i}`:""}`}async fetchAndLogDescribe(){const e=this.buildDescribeUrl();try{const t=await P("GET",e);return k(t)}catch(e){return console.error("[udp-question-form-renderer] /describe failed:",e),null}}async fetchAndLogSubmissionRaw(){const e=`${C.productV1ApiUrl}/UdpFormSubmission/${this.submissionId}/Full`;try{return await P("GET",e)}catch(e){return console.error("[udp-question-form-renderer] /UdpFormSubmission failed:",e),null}}parseAndLogSubmission(e,t){return re(e,t)}handleFormReady(e){this.isFromRendererForm(e)&&(this.formApi=e.detail)}isFromRendererForm(e){var t,i;return(null!==(i=null===(t=e.composedPath)||void 0===t?void 0:t.call(e)[0])&&void 0!==i?i:e.target)===this.formComponentEl}get isReadOnly(){var e;return!(!this.readOnly&&(null===(e=this.submission)||void 0===e?void 0:e.status)!==w.Submitted)||this.isViewedByNonOwner}get isViewedByNonOwner(){var e,t,i,n;if(this.isPublicMode)return!1;const o=null!==(t=null===(e=this.submission)||void 0===e?void 0:e.unityUserId)&&void 0!==t?t:null,l=null!==(n=null===(i=this.currentUser)||void 0===i?void 0:i.id)&&void 0!==n?n:null;return null!=o&&null!=l&&String(o).toLowerCase()!==String(l).toLowerCase()}clearAutosaveTimer(){null!=this.autosaveTimer&&(clearTimeout(this.autosaveTimer),this.autosaveTimer=null)}async submitToBackend(e,t,i){var n,o,l,r;if(!this.resolvedForm||this.submitInFlight)return!1;if(this.previewMode||this.isReadOnly)return!1;this.submitInFlight=!0,this.autosaveStatus="saving";const s=!(null===(n=this.submission)||void 0===n?void 0:n.id);let a=!1;try{const n=await we({loadedForm:this.resolvedForm,dynamicSections:this.dynamicSections,current:this.submission,values:e,status:t,isPublicMode:this.isPublicMode,tenantId:this.tenantId,generic:this.resolveGenericContext(),templateOverrides:null!==(o=this.templateOverrides)&&void 0!==o?o:void 0,commentsByQuestionId:this.commentsState.byQuestionId});return this.submission=n,this.lastSavedValues=e,i.rebuildComments&&(this.commentsState=Se(this.dynamicSections,n)),t===w.Submitted&&(this.initialValues=ye(this.dynamicSections,n),this.loadSignaturePreviews()),s&&n.id&&(null===(l=this.el)||void 0===l?void 0:l.isConnected)&&function(e,t){if("undefined"==typeof window)return;const i=`${window.location.pathname}?udpf_submissionId=${e}${window.location.hash}`;if(t){if(function(e){return"object"==typeof e&&null!==e&&"replace"in e&&"function"==typeof e.replace}(t))return void t.replace(i);if(function(e){return"object"==typeof e&&null!==e&&"push"in e&&"function"==typeof e.push}(t))return void t.push(i);if("function"==typeof t){try{t(i,{replace:!0})}catch(e){console.debug("[udp-question-form] history(url, opts) threw; retrying with (url) only.",e);try{t(i)}catch(e){console.warn("[udp-question-form] host history callable rejected both signatures; using native window.history.replaceState as a fallback.",e)}}return}}window.history.replaceState({},"",i)}(n.id,this.history),this.lastSavedAt=new Date,this.autosaveStatus="saved",a=!0,!0}catch(e){return console.error("[udp-question-form-renderer] submit failed:",e),this.autosaveStatus="error",i.showErrorSnackbar&&(null===(r=this.enqueueSnackbar)||void 0===r||r.call(this,"There was an error submitting this form.",{variant:"error"})),!1}finally{this.submitInFlight=!1;const e=this.pendingResave;this.pendingResave=!1,(a||e)&&this.resaveIfStale()}}resaveIfStale(){this.formApi&&null!=this.lastSavedValues&&(et(this.formApi.getState().values,this.lastSavedValues)||this.runAutosave())}getValidator(){if(this.resolvedForm&&0!==this.dynamicSections.length)return this.cachedValidatorFor!==this.dynamicSections&&(this.cachedValidator=function(e){const t=Array.isArray(e)?e:ce({loadedForm:e,submission:null});return e=>{const i=function(e={}){return Object.assign({now:()=>new Date,resolveLookupOptions:()=>null,allValues:{}},e)}({allValues:e});return function(e,t){const i=[],n=[],o={};for(const l of e){const e=A(l.question,l.value,t);for(const t of e){const e={fieldKey:l.fieldKey,questionId:l.question.id,sectionName:l.sectionName,questionName:l.question.name,questionText:l.question.questionText,ruleType:t.ruleType,message:t.message,severity:t.severity};"warning"===t.severity?n.push(e):(i.push(e),null==o[l.fieldKey]&&(o[l.fieldKey]=t.message))}}return{ok:0===i.length,errors:i,warnings:n,errorsByFieldKey:o}}(function(e,t){const i=[];for(const n of e)for(const e of n.questions)i.push({fieldKey:e.fieldKey,sectionName:n.slotName,question:e.schemaQuestion,value:t[e.fieldKey]});return i}(t,e),i).errorsByFieldKey}}(this.dynamicSections),this.cachedValidatorFor=this.dynamicSections),this.cachedValidator}notifyPreviewNotSaved(e){var t;null===(t=this.enqueueSnackbar)||void 0===t||t.call(this,e,{variant:"info"})}handleFormStateUpdated(e){var t,i;if(!this.isFromRendererForm(e))return;const n=e.detail;if(n.submitFailed&&!this.prevSubmitFailed){const e=Object.keys(null!==(t=n.errors)&&void 0!==t?t:{}).length;null===(i=this.enqueueSnackbar)||void 0===i||i.call(this,`Please fix ${e} issue${1===e?"":"s"} before submitting.`,{variant:"error"}),this.scrollToFirstError(n.errors)}this.prevSubmitFailed=n.submitFailed,this.progress=Pe(this.dynamicSections,n.values),this.maybeScheduleAutosave(n)}scrollToFirstError(e){if(!e||0===Object.keys(e).length)return;const t=function(e,t){for(const i of e)for(const e of i.questions)if(t[e.fieldKey])return e.fieldKey;return null}(this.dynamicSections,e);t&&requestAnimationFrame((()=>{var e;const i=null===(e=this.el)||void 0===e?void 0:e.shadowRoot;if(!i)return;const n=i.querySelector(`[data-field-key="${t}"]`);n&&(n.scrollIntoView({block:"center",behavior:"smooth"}),function(e){const t=e.querySelector("udp-field"),i=null==t?void 0:t.firstElementChild;if(i&&"function"==typeof i.focus)return void i.focus({preventScroll:!0});const n=e.querySelector('input, textarea, select, [tabindex]:not([tabindex="-1"])');null==n||n.focus({preventScroll:!0})}(n))}))}maybeScheduleAutosave(e){if(this.previewMode||this.isReadOnly)return;if(this.isPublicMode)return;if(e.submitting)return;if(null==this.lastSavedValues)return;if(et(e.values,this.lastSavedValues))return void this.clearAutosaveTimer();if(!this.resolvedForm||!this.formApi)return;const t=Math.max(0,this.autoSaveDelay);this.clearAutosaveTimer(),this.autosaveTimer=setTimeout((()=>{this.runAutosave()}),t)}disconnectedCallback(){queueMicrotask((()=>{var e;if(null===(e=this.el)||void 0===e?void 0:e.isConnected)return;const t=null!=this.autosaveTimer;this.clearAutosaveTimer(),t&&this.runAutosave(),this.teardownHostBoundsTracker(),this.revokeSignaturePreviews()}))}async saveDraftAsNew(e,t){var i,n,o,l,r,s,a;if(this.previewMode)return null;if(!this.resolvedForm)return null;const d=function(e,t){var i,n;const o=(new Date).toISOString();return{commentId:N(),userDisplayName:null!==(i=t.displayName)&&void 0!==i?i:null,userId:null!==(n=t.id)&&void 0!==n?n:null,timestamp:o,editedTimestamp:o,isDeleted:!1,value:null!=e?e:""}}(t,{id:null!==(n=null===(i=this.currentUser)||void 0===i?void 0:i.id)&&void 0!==n?n:null,displayName:null!==(l=null===(o=this.currentUser)||void 0===o?void 0:o.displayName)&&void 0!==l?l:null});this.commentsState=function(e,t,i){var n;const o=null!==(n=e.byQuestionId[t])&&void 0!==n?n:[];return Object.assign(Object.assign({},e),{byQuestionId:Object.assign(Object.assign({},e.byQuestionId),{[t]:[...o,i]}),draftByQuestionId:Object.assign(Object.assign({},e.draftByQuestionId),{[t]:null}),editingCommentIdByQuestionId:Object.assign(Object.assign({},e.editingCommentIdByQuestionId),{[t]:null})})}(this.commentsState,e,d);const u=null===(r=this.submission)||void 0===r?void 0:r.id;if(!u)return d;const c=Oe(this.dynamicSections,e);if(!c)return d;try{return await async function(e,t){const i=function(e,t){if(!t.isPublicMode||!t.tenantId)return e;const[i,n=""]=e.split("?",2),o=new URLSearchParams(n);return o.set("tenantId",String(t.tenantId)),`${i}?${o.toString()}`}(`${Ie(e)}/${e.isPublicMode?"public":"private"}`,e);await P("POST",i,t,!0)}({submissionId:u,isPublicMode:this.isPublicMode,tenantId:this.tenantId},{sectionKey:c.sectionKey,questionKey:c.questionKey,value:null!==(s=d.value)&&void 0!==s?s:"",commentId:d.commentId}),d}catch(t){return console.error("[udp-question-form-renderer] postComment failed:",t),this.commentsState=qe(this.commentsState,e,d.commentId,{isDeleted:!0}),null===(a=this.enqueueSnackbar)||void 0===a||a.call(this,"Failed to save comment.",{variant:"error"}),null}}async flushOpenDrafts(){const e=Object.entries(this.commentsState.draftByQuestionId);for(const[t,i]of e)null!=i&&(0!==i.trim().length?await this.saveDraft(t):this.commentsState=ke(this.commentsState,t,null))}getFollowUpOptionsForQuestion(e){if(!e||!this.resolvedForm)return this.followUpFormsList;const t=Oe(this.dynamicSections,e);if(!t)return this.followUpFormsList;const i=function(e){const t=e.fieldProperties;return Array.isArray(null==t?void 0:t.followUpFormIds)?t.followUpFormIds.map((e=>{if("string"==typeof e)return e;if(e&&"object"==typeof e){if("string"==typeof e.value)return e.value;if("string"==typeof e.id)return e.id}return""})).filter((e=>e.length>0)):[]}(t.question);if(0===i.length)return this.followUpFormsList;const n=new Set(i.map(String));return this.followUpFormsList.filter((e=>n.has(e.value)))}async openStampedFollowUp(e){var t,i;try{const i=`${C.productV1ApiUrl}/UdpFormSubmission/${e}/Full`,n=await P("GET",i);if(!(null==n?void 0:n.formId))return void(null===(t=this.enqueueSnackbar)||void 0===t||t.call(this,"Could not open the linked follow-up form.",{variant:"error"}));if("undefined"!=typeof window&&this.submission){const t=Ne({currentPathname:window.location.pathname,parentFormId:this.submission.formId,childFormId:n.formId,childSubmissionId:e});window.open(t,"_blank")}}catch(e){console.error("[udp-question-form-renderer] open follow-up failed:",e),null===(i=this.enqueueSnackbar)||void 0===i||i.call(this,"Could not open the linked follow-up form.",{variant:"error"})}}async fetchLatestFormVersion(e){var t;try{const i=`${C.productV1ApiUrl}/UdpForm/${e}/describe`,n=await P("GET",i);return null!==(t=null==n?void 0:n.version)&&void 0!==t?t:null}catch(e){return null}}render(){var e;if(this.isLoading)return i(n,null,i("udp-container",{"max-width":"md"},i("udp-text",{variant:"body1"},"Loading form…")));if(this.publicModeError)return i(n,null,i("udp-container",{"max-width":"md"},i("udp-text",{variant:"body1"},this.publicModeError)));if(this.loadError)return i(n,null,i("udp-container",{"max-width":"md"},i("udp-text",{variant:"body1"},this.loadError)));if(!this.resolvedForm)return i(n,null,i("udp-container",{"max-width":"md"},i("udp-text",{variant:"body1"},"No form to render. Pass ",i("code",null,"udpf_formId")," and ",i("code",null,"udpf_formVersion")," ","in the URL.")));const t=!this.isPublicMode&&function(e){for(const t of e.sections)for(const e of t.questions)if(De(e))return!0;return!1}(this.resolvedForm)?{adapter:{onLaunch:this.handleLaunchFollowUpForm,getStampedChildId:this.getFollowUpStampedChildId},dialog:{isOpen:this.followUpPickerOpen,options:this.getFollowUpOptionsForQuestion(this.followUpPickerQuestionId),selectedFormId:this.followUpPickerSelectedFormId,isLoading:this.followUpFormsListLoading,isLaunching:this.followUpLaunching,onSelect:this.handleFollowUpSelect,onLaunch:()=>{this.handleFollowUpLaunch()},onClose:this.handleFollowUpClose}}:null,o=function(e){const t=Ce.get(e);if(t)return t;const i=[];for(const t of e.sections)for(const e of t.questions)Fe(e)&&i.push({section:t,question:e});return Ce.set(e,i),i}(this.resolvedForm).length>0?{state:this.commentsState,adapter:{getCount:this.getCommentCount,isExpanded:this.isCommentsPanelExpanded,onToggle:this.toggleQuestionComments},handlers:{onOpenDraft:this.openDraft,onChangeDraft:this.changeDraft,onSaveDraft:e=>{this.saveDraft(e)},onCancelDraft:this.cancelDraft,onEdit:this.editComment,onDelete:(e,t)=>{this.deleteComment(e,t)}}}:null;return i(n,null,function(e){var t,n,o,l,r,s,a;const{loadedForm:d,templateOverrides:u,initialValues:c,onSubmit:p,validate:f,onFormComponentRef:m,submission:h,currentUser:v,highlightedQuestionId:b,formReadOnly:g,previewMode:y,signaturePreviewUrls:x,autosaveStatus:S="idle",lastSavedAt:_=null,progress:k,onSubmitClick:q,comments:O,followUpForms:F,onAddSection:C,onDeleteSection:I}=e,D=null!==(t=e.dynamicSections)&&void 0!==t?t:ce({loadedForm:d,submission:h}),N={loadedForm:d,submission:h,currentUser:v,highlightedQuestionId:null!=b?b:null,formReadOnly:!0===g,previewMode:!0===y,values:!0===g?c:void 0,signaturePreviewUrls:x,commentsAdapter:null!==(n=null==O?void 0:O.adapter)&&void 0!==n?n:null,comments:O?{state:O.state,currentUserId:null!==(o=null==v?void 0:v.id)&&void 0!==o?o:null,handlers:O.handlers}:null,followUpFormsAdapter:null!==(l=null==F?void 0:F.adapter)&&void 0!==l?l:null},P=(null!==(r=null==u?void 0:u.formName)&&void 0!==r?r:"").trim()||d.form.name,V=(null!==(s=null==u?void 0:u.formDescription)&&void 0!==s?s:"").trim()||d.form.description,$=d.form.styleOverrides,L={};(null===(a=null==$?void 0:$.background)||void 0===a?void 0:a.backgroundColor)&&(L.backgroundColor=$.background.backgroundColor);const A={};return(null==$?void 0:$.headerBackgroundColor)&&(A.backgroundColor=$.headerBackgroundColor),i("div",{class:"renderer-layout",style:L},i("div",{class:"renderer-layout__form"},i("udp-form-component",{ref:m,formId:Ze,initialValues:c,submitHandler:p,validate:f,deriveFieldValidators:!1,errorDisplay:"submitFailed"},i("udp-flexbox",{display:"flex",direction:"column",wrap:"nowrap",gap:"lg"},P&&i("udp-fluent-card",{appearance:"filled",class:"form-title-card",style:A},i("udp-flexbox",{display:"flex",direction:"column",gap:"sm",class:"form-title-card__content"},i("udp-text",{variant:"title2"},P),V&&i("udp-text",{variant:"body1"},V))),D.map(((e,t)=>{const n=D[t+1];return function(e){var t,n;const{section:o,context:l,isLastInGroup:r,onAddSection:s,onDeleteSection:a}=e,d=o.schemaSection,u=!0===(null===(t=d.sectionProperties)||void 0===t?void 0:t.isRepeatable),c=u&&!0===r&&null!=s&&!0!==l.formReadOnly&&!0!==l.previewMode,p=u&&!o.isOriginal&&null!=a&&!0!==l.formReadOnly&&!0!==l.previewMode;return i("udp-fluent-card",{key:o.instanceId,appearance:"filled"},i("udp-flexbox",{slot:"header",display:"flex",direction:"row",align:"center",gap:"sm"},i("udp-flexbox",{display:"flex",direction:"column",gap:"xs",grow:"1"},d.title&&i("udp-flexbox",{display:"flex",direction:"row",gap:"xs",align:"center"},i("udp-text",{variant:"subtitle1"},d.title),!o.isOriginal&&i("udp-fluent-badge",{appearance:"outline",color:"subtle",size:"small"},"Copy ",o.suffix)),d.sectionText&&i("udp-text",{variant:"body2"},d.sectionText)),p&&i("udp-tooltip",{content:"Delete this copy",positioning:"below"},i("udp-fluent-icon-button",{iconName:"delete",size:"small",appearance:"subtle",ariaLabel:`Delete copy ${o.suffix} of ${null!==(n=d.title)&&void 0!==n?n:"section"}`,onClick:()=>null==a?void 0:a(o.instanceId)}))),!0===l.formReadOnly?i("udp-detail-list",{layout:"stack",dividers:"row",density:"default"},o.questions.map((e=>Ye({question:e.schemaQuestion,context:l,fieldKey:e.fieldKey})))):i("udp-flexbox",{display:"flex",direction:"column",wrap:"nowrap",gap:"md"},o.questions.map((e=>Ye({question:e.schemaQuestion,context:l,fieldKey:e.fieldKey})))),c&&i("udp-flexbox",{slot:"footer",display:"flex",direction:"row",justify:"flex-start"},i("udp-fluent-button",{appearance:"subtle",startIconName:"add",onClick:()=>null==s?void 0:s(d.id)},"Repeat Section")))}({section:e,context:N,isLastInGroup:!n||n.schemaSection.id!==e.schemaSection.id,onAddSection:C,onDeleteSection:I})})))),!g&&function(e){var t,n;const{progress:o,autosaveStatus:l,lastSavedAt:r,onSubmitClick:s}=e,a=null!==(t=null==o?void 0:o.answered)&&void 0!==t?t:0,d=null!==(n=null==o?void 0:o.total)&&void 0!==n?n:0,u=d>0?d:1,c=d>0&&a===d?"success":"info";return i("div",{class:"form-footer"},i("div",{class:"form-footer__inner"},i("div",{class:"form-footer__progress"},i("udp-text",{variant:"caption1",class:"form-footer__progress-label"},a," of ",d," answered"),i("udp-progress-bar",{class:"form-footer__progress-bar",thickness:"medium",shape:"rounded",validationState:c,value:a,min:0,max:u})),i("div",{class:"form-footer__actions"},function(e,t){return"saving"===e?i("udp-text",{variant:"caption1"},"Saving…"):"error"===e?i("udp-text",{variant:"caption1"},"Save failed — will retry on next change."):"saved"===e&&t?i("udp-text",{variant:"caption1"},"Saved at ",(n=t,`${String(n.getHours()).padStart(2,"0")}:${String(n.getMinutes()).padStart(2,"0")}`)):i("span",null);var n}(l,r),i("udp-fluent-button",{appearance:"primary",onClick:s},"Submit"))))}({progress:k,autosaveStatus:S,lastSavedAt:_,onSubmitClick:()=>{var e;null==q||q(),null===(e=j.get(Ze))||void 0===e||e.requestSubmit()}}),g&&i("div",{class:"form-footer form-footer--read-only"},i("div",{class:"form-footer__inner"},function(e){return i("udp-text",{variant:"caption1"},(null==e?void 0:e.status)===w.Submitted?"Submitted — read-only.":"Read-only.")}(h)))),F&&We({isOpen:F.dialog.isOpen,options:F.dialog.options,selectedFormId:F.dialog.selectedFormId,isLoading:F.dialog.isLoading,isLaunching:F.dialog.isLaunching,onSelect:F.dialog.onSelect,onLaunch:F.dialog.onLaunch,onClose:F.dialog.onClose}))}({loadedForm:this.resolvedForm,templateOverrides:this.templateOverrides,dynamicSections:this.dynamicSections,initialValues:this.initialValues,onSubmit:this.handleSubmit,validate:this.getValidator(),onFormComponentRef:this.handleFormComponentRef,submission:this.submission,currentUser:this.currentUser,highlightedQuestionId:null!==(e=this.highlightedQuestionId)&&void 0!==e?e:null,formReadOnly:this.isReadOnly,previewMode:this.previewMode,signaturePreviewUrls:this.signaturePreviewUrls,autosaveStatus:this.autosaveStatus,lastSavedAt:this.lastSavedAt,progress:this.progress,onSubmitClick:this.handleSubmitClick,comments:o,followUpForms:t,onAddSection:this.handleAddSection,onDeleteSection:this.handleDeleteSection}))}get el(){return o(this)}static get watchers(){return{loadedForm:[{handleLoadedFormChange:0}],highlightedQuestionId:[{handleHighlightedQuestionIdChange:0}],getUserCallback:[{handleGetUserCallbackChange:0}]}}};function et(e,t){if(Object.is(e,t))return!0;if(null==e||null==t)return!1;if(Array.isArray(e)||Array.isArray(t))return Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every(((e,i)=>et(e,t[i])));const i=e=>"object"==typeof e&&e.constructor===Object;if(!i(e)||!i(t))return!1;const n=Object.keys(e),o=Object.keys(t);return n.length===o.length&&n.every((i=>Object.prototype.hasOwnProperty.call(t,i)&&et(e[i],t[i])))}Je.style=":host{display:block;padding:var(--spacingVerticalM) var(--spacingHorizontalL, 16px);padding-bottom:96px}.renderer-layout__form udp-form-component{display:block}.renderer-layout{width:100%;max-width:720px;margin:0 auto}.renderer-layout__form{width:100%}.form-title-card{border-left:4px solid var(--colorBrandStroke1, #2899f5)}.form-title-card__content{padding-block:var(--spacingVerticalS, 8px)}.question-card{position:relative;transition:background-color 160ms ease-out, box-shadow 160ms ease-out;border-radius:var(--borderRadiusMedium, 4px)}.question-card--highlighted{background-color:var(--colorBrandBackground2, rgba(38, 79, 120, 0.08));box-shadow:inset 3px 0 0 0 var(--colorBrandStroke1, #2899f5);animation:udpqf-highlight-pulse 800ms ease-out 1}.question-card__toggles{position:absolute;top:0;right:0;display:inline-flex;align-items:center;gap:var(--spacingHorizontalXS, 4px);z-index:1}.question-card__follow-up-toggle{display:inline-flex;align-items:center;gap:var(--spacingHorizontalXXS, 2px)}.question-card__inline-comments{margin-top:var(--spacingVerticalS, 8px);padding:var(--spacingVerticalS, 8px) var(--spacingHorizontalM, 12px);background-color:var(--colorNeutralBackground2, #fafafa);border-left:2px solid var(--colorNeutralStroke2, #e0e0e0);border-radius:0 var(--borderRadiusMedium, 4px) var(--borderRadiusMedium, 4px) 0}.question-card__inline-comments .comment-thread{cursor:default;padding:0;gap:var(--spacingVerticalXS, 4px)}.question-card__inline-comments .comment-thread:hover,.question-card__inline-comments .comment-thread--focused{background-color:transparent}udp-detail-list-item:has(.question-view__comment-toggle){position:relative}.question-view__comment-toggle{position:absolute;top:0;right:0;z-index:1}@media print{.question-card__toggles,.question-view__comment-toggle,.comment-thread__compose-placeholder,.comment-thread__draft,.comment-item__actions{display:none !important}}@keyframes udpqf-highlight-pulse{0%{background-color:var(--colorBrandBackground2Hover, rgba(38, 79, 120, 0.16))}100%{background-color:var(--colorBrandBackground2, rgba(38, 79, 120, 0.08))}}@media (prefers-reduced-motion: reduce){.question-card,.question-card--highlighted{animation:none;transition:none}}.comment-thread{position:relative;display:flex;flex-direction:column;gap:var(--spacingVerticalXS, 4px);padding:var(--spacingVerticalS, 8px) var(--spacingHorizontalS, 10px);border-radius:var(--borderRadiusSmall, 2px);cursor:pointer;transition:background-color 120ms ease-out}.comment-thread:hover{background-color:var(--colorNeutralBackground1Hover, rgba(0, 0, 0, 0.02))}.comment-thread--focused{background-color:var(--colorBrandBackground2, rgba(38, 79, 120, 0.06))}.comment-thread__header{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--spacingVerticalXXS, 2px)}.comment-thread__label{color:var(--colorNeutralForeground3, #707070);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.comment-thread__empty{color:var(--colorNeutralForeground3, #707070);font-style:italic}.comment-thread__items{display:flex;flex-direction:column}.comment-thread__draft{display:flex;flex-direction:column;gap:var(--spacingVerticalXXS, 2px)}.comment-thread__draft-actions{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;gap:var(--spacingHorizontalXXS, 2px)}.comment-thread__compose-placeholder{align-self:flex-start;margin-top:var(--spacingVerticalXS, 4px)}.comment-item{display:grid;grid-template-columns:24px 1fr;column-gap:var(--spacingHorizontalS, 8px);row-gap:var(--spacingVerticalXXS, 2px);padding:var(--spacingVerticalXS, 4px) 0}.comment-item+.comment-item{padding-top:var(--spacingVerticalS, 8px);margin-top:var(--spacingVerticalXS, 4px);border-top:1px solid var(--colorNeutralStroke3, #f0f0f0)}.comment-item__avatar{grid-column:1;grid-row:1;align-self:start;width:24px;height:24px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;color:var(--colorNeutralForegroundOnBrand, #fff);font-size:var(--fontSizeBase100, 10px);font-weight:var(--fontWeightSemibold, 600);line-height:1;user-select:none}.comment-item__actions{margin-left:auto;display:flex;flex-direction:row;gap:var(--spacingHorizontalXXS, 2px);opacity:0;transition:opacity 120ms ease-out}.comment-item__header{grid-column:2;display:flex;flex-direction:row;align-items:center;gap:var(--spacingHorizontalXS, 4px);min-height:24px}.comment-item__timestamp{color:var(--colorNeutralForeground3, #707070)}.comment-item__body{grid-column:2;white-space:pre-wrap;word-break:break-word}.comment-item:hover .comment-item__actions,.comment-item:focus-within .comment-item__actions{opacity:1}@media (hover: none){.comment-item__actions{opacity:1}}.form-footer{position:fixed;bottom:0;left:var(--udpqf-host-left, 0);width:var(--udpqf-host-width, 100%);z-index:2;background-color:var(--colorNeutralBackground1, #ffffff);border-top:1px solid transparent;box-shadow:var(--shadow4, 0 2px 4px rgba(0, 0, 0, 0.14), 0 0 2px rgba(0, 0, 0, 0.12))}.form-footer__inner{display:flex;flex-direction:row;align-items:center;gap:var(--spacingHorizontalM, 12px);width:100%;max-width:720px;margin:0 auto;padding:var(--spacingVerticalS, 8px) var(--spacingHorizontalL, 16px);box-sizing:border-box}.form-footer--read-only .form-footer__inner{justify-content:center}.form-footer__progress{display:flex;flex-direction:column;gap:var(--spacingVerticalXXS, 2px);flex:1 1 auto;min-width:0}.form-footer__progress-label{color:var(--colorNeutralForeground2, #424242)}.form-footer__progress-bar{display:block;width:100%}.form-footer__actions{display:flex;flex-direction:row;align-items:center;gap:var(--spacingHorizontalM, 12px);flex:0 0 auto}@media print{.form-footer{display:none !important}}.question-view__options{display:flex;flex-direction:column;gap:var(--spacingVerticalXXS, 2px)}.question-view__option{display:flex;flex-direction:row;align-items:center;gap:var(--spacingHorizontalS, 8px);color:var(--colorNeutralForeground3, #616161)}.question-view__option--selected{color:var(--colorNeutralForeground1, #242424);font-weight:var(--fontWeightSemibold, 600)}.question-view__option-mark{flex:0 0 auto;color:var(--colorNeutralForeground4, #707070)}.question-view__option--selected .question-view__option-mark{color:var(--colorCompoundBrandForeground1, #0f6cbd)}.question-view__location{display:flex;flex-direction:column;gap:var(--spacingVerticalS, 8px)}.question-view__signature{display:flex;flex-direction:column;gap:var(--spacingVerticalS, 8px)}.question-view__signature-img{display:block;max-width:360px;max-height:160px;object-fit:contain}.question-view__signature-meta{display:flex;flex-direction:column;gap:0}";const tt=class{constructor(t){e(this,t),this.unit="md"}render(){return i("div",{key:"ac06dc0ae0db1c9da9fa43500e4ccb299206659d",style:{height:"none"===this.unit?"0":`var(--spacingVertical${{none:"None",xxs:"XXS",xs:"XS",sm:"S",md:"M",lg:"L",xl:"XL",xxl:"XXL",xxxl:"XXXL"}[this.unit]})`,display:"block"}})}};export{U as udp_fluent_inline_edit,T as udp_form_version_drawer,le as udp_question_config_fluent,Je as udp_question_form_renderer,tt as udp_vertical_spacer}
|
|
1
|
+
import{r as e,c as t,h as i,H as n,a as o}from"./index-15aY63VA.js";import{n as l,o as r,b as a,p as s,q as d,r as u,t as c,u as p,a as m,d as f,w as h,e as v,x as b,y as g,S as y,z as x,A as w,B as S,C as k,k as _,D as q}from"./codecs-BWyrM561.js";import{i as O,a as C,F}from"./types-NqFGtWPW.js";import I from"sortablejs";import{C as j}from"./configService-CehZzjhw.js";import{c as D,L as P}from"./createAzureMapsProviders-CtQryp1H.js";import{d as N}from"./udp-drive-utils-BVTuKAND.js";import{f as V}from"./form-registry-BhFl_bdX.js";import{v4 as L}from"uuid";import{g as A,s as $,i as T,a as U,b as B}from"./domain-table-snapshot-H3o5mjFB.js";import{m as z}from"./makeApiCall-B-daVutk.js";import"./tenantUtils-Basdb1b1.js";import"./apiUtils-CXqsYwOQ.js";import"lodash-es/isEqual";import"./getCurrentApiCatalogId-DeurXd9l.js";import"./convertBackendTypeToAgGridType-B8xfl_wR.js";import"axios";import"./SearchBuilder-BxLXFEeR.js";import"./searchObject-DpUZkcYC.js";import"./lookupHelper-D3LSjaES.js";function E(e){const t=e.fieldProperties;return Array.isArray(t.items)?t.items:Array.isArray(e.lookupItems)?e.lookupItems:[]}function R(e,t,i){var n,o;if(O(e.fieldTypeId))return[];const s=[],d=l(t);for(const o of r(e.fieldTypeId)){if(d&&!o.runOnEmpty)continue;const l=o.check(t,e,i);l&&s.push({ruleType:o.ruleType,message:l.message,severity:null!==(n=l.severity)&&void 0!==n?n:"error"})}for(const n of a(e.fieldTypeId)){const l=n.readParams(e);if(null===l)continue;if(d&&!n.runOnEmpty)continue;const r=n.check(t,l,e,i);r&&s.push({ruleType:n.ruleType,message:r.message,severity:null!==(o=r.severity)&&void 0!==o?o:"error"})}return s}const M=class{constructor(i){e(this,i),this.valueChanged=t(this,"valueChanged",7),this.inputBlur=t(this,"inputBlur",7),this.inputFocus=t(this,"inputFocus",7),this.value="",this.readonly=!1,this.fitContent=!1,this.typedValue=null,this.handleInput=e=>{const t=e.target;this.fitContent&&(this.typedValue=t.value),this.valueChanged.emit(t.value)}}onValueChanged(){this.typedValue=null}async focusInput(){var e;null===(e=this.inputEl)||void 0===e||e.focus()}render(){var e,t;const o=null!==(e=this.typedValue)&&void 0!==e?e:this.value,l=!o;return i(n,{key:"d5a6015651f3a72d0f7257b2fc3019c1ffefcba3"},this.fitContent&&i("span",{key:"2d29e60a256cc9e5ae8ebe2868f43247a7915190",class:{"inline-edit-box":!0,"inline-edit-mirror":!0,"is-placeholder":l},"aria-hidden":"true"},`${l?null!==(t=this.placeholder)&&void 0!==t?t:"":o} `),i("input",{key:"5f50c146170985f90bbb6d8c208fd170852dd878",ref:e=>this.inputEl=e,class:"inline-edit-box inline-edit-input",type:"text",size:this.fitContent?1:void 0,value:this.value,placeholder:this.placeholder,readOnly:this.readonly,maxlength:this.maxLength,"aria-label":this.ariaLabel,onInput:this.handleInput,onBlur:()=>this.inputBlur.emit(),onFocus:()=>this.inputFocus.emit()}))}static get delegatesFocus(){return!0}get el(){return o(this)}static get watchers(){return{value:[{onValueChanged:0}]}}};M.style=":host{display:block;width:100%}.inline-edit-box{font:inherit;color:inherit;background:transparent;border:1px solid transparent;border-radius:var(--borderRadiusMedium);padding:2px var(--spacingHorizontalXS);margin:0}.inline-edit-input{width:100%;outline:none;cursor:text;transition:background-color 0.15s ease, border-color 0.15s ease}.inline-edit-input::placeholder{color:var(--colorNeutralForeground3);font-style:italic}.inline-edit-input:hover:not(:read-only){background-color:var(--colorNeutralBackground1Hover)}.inline-edit-input:focus:not(:read-only){background-color:var(--colorNeutralBackground1Hover);border-color:var(--colorNeutralStroke2)}.inline-edit-input:read-only{cursor:default}:host([fit-content]){display:inline-grid;width:auto;overflow:hidden}:host([fit-content]) .inline-edit-box{grid-area:1 / 1;box-sizing:border-box}:host([fit-content]) .inline-edit-input{min-width:2ch}.inline-edit-mirror{visibility:hidden;white-space:pre;min-width:0;pointer-events:none}.inline-edit-mirror.is-placeholder{font-style:italic}";const H=class{constructor(t){e(this,t),this.open=!1,this.versions=[],this.currentVersion=1}handleItemAction(e){var t,i,n;if(!this.open)return;const o=Number(null===(t=e.detail)||void 0===t?void 0:t.value);Number.isInteger(o)&&(null===(i=this.onVersionSelect)||void 0===i||i.call(this,o),null===(n=this.onDrawerClose)||void 0===n||n.call(this))}render(){return i(n,{key:"cfcba8aba885b0fa2e5c59d7c509f24859c20920"},i("udp-fluent-drawer",{key:"4d0ccc5933be10f666a6ea994e2e23497cf08776",open:this.open,drawerTitle:"Versions",onDrawerClose:this.onDrawerClose,size:"small"},i("udp-list",{key:"df8f6cef5089248abbe80546e6b0facbb287c85a",interactive:!0,selectionMode:"none",showDivider:!0},[...this.versions].sort(((e,t)=>t-e)).map((e=>i("udp-fluent-list-item",{key:e,value:e,label:`Version ${e}`},e===this.currentVersion&&i("udp-fluent-badge",{slot:"end",appearance:"tint",color:"informative",shape:"rounded",size:"small"},"Current")))))))}};function X({name:e,label:t,description:n,disabled:o}){return i("udp-field",{name:e},i("udp-fluent-switch",{label:t,labelPosition:"after",hint:n,disabled:o}))}function Q(e){return i("udp-flexbox",{display:"flex",direction:"column",gap:"none"},i("udp-field",{name:"fieldProperties.paragraphText"},i("udp-textarea",{label:"Paragraph Text",disabled:e.isViewOnly,placeholder:"Enter the paragraph text here",resize:"vertical"})))}function K(e,t){var i,n,o;const l=null!==(n=null===(i=e.formValues)||void 0===i?void 0:i.fieldProperties)&&void 0!==n?n:null;return null!==(o=null==l?void 0:l[t])&&void 0!==o?o:e.fieldProperties[t]}function G(e,t=""){if("string"==typeof e)return e;if(e&&"object"==typeof e){const i=e.value;return null==i?t:String(i)}return t}function Y(e,t){return i=>{i&&(i.__onSortEnd=(i,n)=>{t||e(i,n)},i.__sortableInit||(i.__sortableInit=!0,new I(i,{handle:".option-drag-handle",animation:150,ghostClass:"sortable-ghost",onEnd:e=>{var t;const{oldIndex:n,newIndex:o}=e;void 0!==n&&void 0!==o&&n!==o&&(e.to.insertBefore(e.item,n<o?e.to.children[n]:e.to.children[n+1]),null===(t=i.__onSortEnd)||void 0===t||t.call(i,n,o))}})))}}function W(e){var t,n,o;const{items:l,lookupId:r}=function(e){const t=K(e,"items"),i=K(e,"lookupId");return{items:Array.isArray(t)?t:[],lookupId:"string"==typeof i?i:""}}(e),a=null!==(t=e.lookupOptions)&&void 0!==t?t:[],d=0===l.length,u=!d,c=l[l.length-1],p=l.length>0&&!(null===(n=null==c?void 0:c.display)||void 0===n?void 0:n.trim())&&!(null===(o=null==c?void 0:c.value)||void 0===o?void 0:o.trim()),m=s(p?l.slice(0,-1):l),f=t=>{var i,n;null===(n=null===(i=e.getForm)||void 0===i?void 0:i.call(e))||void 0===n||n.change("fieldProperties.items",t)},h=t=>{var i,n;null===(n=null===(i=e.getForm)||void 0===i?void 0:i.call(e))||void 0===n||n.change("fieldProperties.lookupId",t)},v=(e,t,i)=>{var n,o;const r=l.slice(),a=null!==(n=r[e])&&void 0!==n?n:{};if("display"===t){const t=!(null===(o=a.value)||void 0===o?void 0:o.trim())||a.value===a.display;r[e]=Object.assign(Object.assign({},a),{display:i,value:t?i:a.value})}else r[e]=Object.assign(Object.assign({},a),{value:i});f(r)},b=()=>{f([...l,{display:"",value:""}])},g=(t,i)=>{var n,o;if("Enter"!==t.key||e.isViewOnly)return;if(i!==l.length-1||!(null===(o=null===(n=l[i])||void 0===n?void 0:n.display)||void 0===o?void 0:o.trim()))return;t.preventDefault(),b();const r=t.currentTarget.closest(".options-grid--choice");requestAnimationFrame((()=>{var e;const t=null==r?void 0:r.querySelectorAll(".option-row"),i=null==t?void 0:t[t.length-1];null===(e=null==i?void 0:i.querySelector("udp-fluent-text-input"))||void 0===e||e.focus()}))},y=Y(((e,t)=>{if(e===t)return;const i=l.slice(),[n]=i.splice(e,1);i.splice(t,0,n),f(i)}),e.isViewOnly);return i("udp-flexbox",{display:"flex",direction:"column",gap:"none"},a.length>=1&&i("udp-fluent-switch",{label:"Use Lookup Options",labelPosition:"after",disabled:e.isViewOnly,checked:d,onValueChanged:()=>{e.isViewOnly||(d?(f([{display:"",value:""}]),h("")):(f([]),h("")))}}),d&&i("udp-fluent-dropdown",{label:"Lookup Source",placeholder:"Select a lookup",options:a,value:r,disabled:e.isViewOnly,required:!0,onValueChanged:t=>{e.isViewOnly||h(G(t.detail))}}),u&&i("div",{class:"options-grid options-grid--choice"},i("div",{class:"options-grid-header"},i("span",{class:"options-drag-handle-spacer","aria-hidden":"true"}),i("span",{class:"options-grid-header-label"},"Display Text"),i("span",{class:"options-grid-header-label"},"Option Value"),i("span",null)),i("div",{ref:y},l.map(((t,n)=>i("div",{key:n,class:"option-row"},i("span",{class:"option-drag-handle","aria-label":"Drag to reorder"},i("udp-fluent-icon",{name:"drag",size:"sm"})),i("udp-fluent-text-input",{value:t.display||"",disabled:e.isViewOnly,placeholder:"Display text",autocomplete:"off",includeErrorPadding:!1,onKeyDown:e=>g(e,n),onValueChanged:t=>{e.isViewOnly||v(n,"display",t.detail)}}),i("udp-fluent-text-input",{value:t.value||"",disabled:e.isViewOnly,placeholder:"Value",autocomplete:"off",includeErrorPadding:!1,onKeyDown:e=>g(e,n),onValueChanged:t=>{e.isViewOnly||v(n,"value",t.detail)}}),i("div",{class:"option-row-actions"},i("udp-fluent-icon-button",{iconName:"delete",appearance:"subtle",size:"small",ariaLabel:"Remove option",disabled:e.isViewOnly||l.length<=1,onClick:()=>(e=>{f(l.filter(((t,i)=>i!==e)))})(n)})))))),!e.isViewOnly&&i("div",{class:"options-add-row"},i("udp-fluent-button",{appearance:"subtle",startIconName:"add",onClick:()=>b()},"Add Option")),m&&i("udp-text",{variant:"caption1",block:!0,style:{color:"var(--colorPaletteRedForeground1)"}},m)))}function Z(e){return i("udp-flexbox",{display:"flex",direction:"column",gap:"none"},i("udp-field",{name:"fieldProperties.allowMultiple"},i("udp-fluent-switch",{label:"Allow Multiple Items",labelPosition:"after",disabled:e.isViewOnly})),i("udp-field",{name:"fieldProperties.displayUploadTime"},i("udp-fluent-switch",{label:"Display Upload Time",labelPosition:"after",disabled:e.isViewOnly})),i("udp-field",{name:"fieldProperties.hideDragAndDrop"},i("udp-fluent-switch",{label:"Hide Drag And Drop",labelPosition:"after",disabled:e.isViewOnly})),i("udp-field",{name:"fieldProperties.hideButton"},i("udp-fluent-switch",{label:"Hide Button",labelPosition:"after",disabled:e.isViewOnly})))}function J(e){return i("udp-flexbox",{display:"flex",direction:"column",gap:"md"},i("udp-field",{name:"fieldProperties.includeLocation"},i("udp-fluent-switch",{label:"Include Location",labelPosition:"after",disabled:e.isViewOnly})))}function ee(e){return i("udp-flexbox",{display:"flex",direction:"column",gap:"none"},i("udp-field",{name:"fieldProperties.displayOwnerFullName"},i("udp-fluent-switch",{label:"Show Form Responder Full Name",labelPosition:"after",disabled:e.isViewOnly})),i("udp-field",{name:"fieldProperties.displayOwnerEmail"},i("udp-fluent-switch",{label:"Show Form Responder Email",labelPosition:"after",disabled:e.isViewOnly})),i("udp-field",{name:"fieldProperties.displaySubmissionDate"},i("udp-fluent-switch",{label:"Show Submission Date",labelPosition:"after",disabled:e.isViewOnly})))}let te;function ie(){var e;const t=null!==(e=j.config.AZURE_MAP_SUBSCRIPTION_KEY)&&void 0!==e?e:"";return te&&te.key===t||(te={key:t,providers:D(t)}),te.providers}function ne(e){const t=!!e.fieldProperties.showMap,n=ie();return i("udp-flexbox",{display:"flex",direction:"column",gap:"md"},i("udp-field",{name:"fieldProperties.defaultLocation"},i("udp-fluent-location-input",{label:"Default Location",disabled:e.isViewOnly,showMap:!1,searchAddresses:null==n?void 0:n.searchAddresses,reverseGeocode:null==n?void 0:n.reverseGeocode})),i("udp-field",{name:"fieldProperties.showMap"},i("udp-fluent-switch",{label:"Show Map",labelPosition:"after",disabled:e.isViewOnly,onValueChanged:t=>{var i;if(!e.isViewOnly&&!t.detail){const t=null===(i=e.getForm)||void 0===i?void 0:i.call(e);null==t||t.change("fieldProperties.hideAddressSearch",!1)}}})),t&&i("udp-flexbox",{display:"flex",direction:"column",gap:"md"},i("udp-field",{name:"fieldProperties.hideAddressSearch"},i("udp-fluent-switch",{label:"Hide Address Search Bar",labelPosition:"after",disabled:e.isViewOnly})),i("udp-field",{name:"fieldProperties.mapZoom"},i("udp-fluent-text-input",{label:"Map Zoom",type:"number",disabled:e.isViewOnly})),i("udp-field",{name:"fieldProperties.projection"},i("udp-fluent-text-input",{label:"Projection",disabled:e.isViewOnly,placeholder:"Enter map projection here"})),i("udp-field",{name:"fieldProperties.projectionDefs"},i("udp-fluent-text-input",{label:"Projection Definition",disabled:e.isViewOnly,placeholder:"Enter map projection definition here"}))))}const oe=[{value:"text",label:"Text"},{value:"number",label:"Number"},{value:"boolean",label:"Boolean"},{value:"date",label:"Date"},{value:"datetime",label:"Date time"}],le=[{value:"sum",label:"Sum"},{value:"avg",label:"Average"},{value:"min",label:"Min"},{value:"max",label:"Max"}],re=[{value:"0",label:"0"},{value:"1",label:"1"},{value:"2",label:"2"},{value:"3",label:"3"}];const ae=[{value:"text",label:"Text"},{value:"number",label:"Number"}],se=[{value:"sum",label:"Sum"},{value:"avg",label:"Average"},{value:"min",label:"Min"},{value:"max",label:"Max"}],de=[{value:"0",label:"0"},{value:"1",label:"1"},{value:"2",label:"2"},{value:"3",label:"3"}];function ue(e){const t=function(e){const t=K(e,"columns");return Array.isArray(t)?t:[]}(e),n=t=>{var i,n;null===(n=null===(i=e.getForm)||void 0===i?void 0:i.call(e))||void 0===n||n.change("fieldProperties.columns",d(t))},o=(e,i,o)=>{var l;const r=t.slice(),a=null!==(l=r[e])&&void 0!==l?l:u();r[e]=Object.assign(Object.assign({},a),{[i]:o}),n(r)},l=(e,i)=>{var o;const l=t.slice(),r=null!==(o=l[e])&&void 0!==o?o:u();if(i){const t=Object.assign(Object.assign({},r),{aggregate:i});if("number"===(null==r?void 0:r.type)){const e=Number(r.aggregateDecimalPlaces);t.aggregateDecimalPlaces=Number.isInteger(e)&&e>=0?e:1}l[e]=t}else{const t=function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(i[n[o]]=e[n[o]])}return i}(r,["aggregate","aggregateDecimalPlaces"]);l[e]=t}n(l)},r=Y(((e,i)=>{if(e<0||i<0||e>=t.length||i>=t.length||e===i)return;const o=t.slice(),[l]=o.splice(e,1);o.splice(i,0,l),n(o)}),e.isViewOnly);return i("div",null,i("div",{class:"options-grid"},i("div",{class:"options-grid-header"},i("span",{class:"options-drag-handle-spacer","aria-hidden":"true"}),i("span",{class:"options-grid-header-label"},"Column Name"),i("span",{class:"options-grid-header-label"},"Type"),i("span",null)),i("div",{ref:r},t.map(((r,a)=>{const s="number"===(null==r?void 0:r.type)?"number":"text",d=!!(null==r?void 0:r.required),p="number"===s,m=p&&!!(null==r?void 0:r.aggregate),f=(null==r?void 0:r.aggregate)||"sum",h=Number.isInteger(Number(null==r?void 0:r.aggregateDecimalPlaces))?String(Math.min(3,Math.max(0,Number(r.aggregateDecimalPlaces)))):"1";return i("div",{class:"table-col-card"},i("div",{class:"table-col-main-row"},e.isViewOnly?i("span",{class:"options-drag-handle-spacer","aria-hidden":"true"}):i("span",{class:"option-drag-handle","aria-label":"Drag to reorder"},i("udp-fluent-icon",{name:"drag",size:"sm"})),i("udp-fluent-text-input",{value:(null==r?void 0:r.name)||"",disabled:e.isViewOnly,placeholder:"Column name",autocomplete:"off",includeErrorPadding:!1,onValueChanged:t=>{e.isViewOnly||o(a,"name",t.detail)}}),i("udp-fluent-dropdown",{value:s,options:ae,optionLabel:"label",optionValue:"value",disabled:e.isViewOnly,includeErrorPadding:!1,onValueChanged:i=>{e.isViewOnly||((e,i)=>{var o;const l="number"===i?"number":"text",r=t.slice(),a=null!==(o=r[e])&&void 0!==o?o:u(),s=Object.assign(Object.assign({},a),{type:l});c(l)||(delete s.aggregate,delete s.aggregateDecimalPlaces),r[e]=s,n(r)})(a,G(i.detail,"text"))}}),i("div",{class:"option-row-actions"},i("udp-fluent-icon-button",{iconName:"delete",appearance:"subtle",size:"small",ariaLabel:"Remove column",disabled:e.isViewOnly||t.length<=1,onClick:()=>{e.isViewOnly||(e=>{n(t.filter(((t,i)=>i!==e)))})(a)}}))),i("div",{class:"table-col-secondary"},i("udp-fluent-switch",{label:"Required",labelPosition:"after",disabled:e.isViewOnly,checked:d,onValueChanged:()=>{e.isViewOnly||o(a,"required",!d)}}),p&&i("udp-fluent-switch",{label:"Display Aggregate",labelPosition:"after",disabled:e.isViewOnly,checked:m,onValueChanged:()=>{e.isViewOnly||l(a,m?"":f)}})),p&&m&&i("udp-container-query-grid",{columns:{0:1,360:2},gaps:{0:"sm"},class:"table-col-secondary"},i("udp-container-query-grid-item",null,i("udp-fluent-dropdown",{label:"Aggregate Function",value:f,options:se,optionLabel:"label",optionValue:"value",disabled:e.isViewOnly,required:!0,onValueChanged:t=>{e.isViewOnly||l(a,G(t.detail,"sum"))}})),i("udp-container-query-grid-item",null,i("udp-fluent-dropdown",{label:"Decimal Places",value:h,options:de,optionLabel:"label",optionValue:"value",disabled:e.isViewOnly,required:!0,onValueChanged:t=>{e.isViewOnly||o(a,"aggregateDecimalPlaces",G(t.detail,"1"))}}))))}))),!e.isViewOnly&&i("div",{class:"options-add-row"},i("udp-fluent-button",{appearance:"subtle",startIconName:"add",onClick:()=>(()=>{const e=t.length+1;n([...t,Object.assign(Object.assign({},u()),{name:`Column ${e}`})])})()},"Add Column"))))}const ce=[{value:"custom",label:"Simple Table"},{value:"domain",label:"Advanced Table"}];function pe(e){const t="domain"===K(e,"dataSource")?"domain":"custom";return i("udp-flexbox",{display:"flex",direction:"column",gap:"md"},i("udp-fluent-radio-group",{label:"Table Type",items:ce,value:t,disabled:e.isViewOnly,includeErrorPadding:!1,onValueChanged:i=>{var n;if(e.isViewOnly)return;const o=null===(n=e.getForm)||void 0===n?void 0:n.call(e),l="domain"===i.detail?"domain":"custom";o&&l!==t&&("domain"===l?(o.change("fieldProperties.dataSource","domain"),o.change("fieldProperties.domainLookupId",""),o.change("fieldProperties.columns",[])):(o.change("fieldProperties.dataSource",""),o.change("fieldProperties.domainLookupId",""),o.change("fieldProperties.allowAddRows",void 0),o.change("fieldProperties.columns",d([u()]))))}}),"domain"===t?function(e){var t,n,o,l,r,a,s,d;const{domainLookupId:u,columns:c}=function(e){const t=K(e,"domainLookupId"),i=K(e,"columns");return{domainLookupId:"string"==typeof t?t:"",columns:Array.isArray(i)?i:[]}}(e),p=null!==(t=e.lookupOptions)&&void 0!==t?t:[],m=p.filter((e=>e.typeId===P.Domain)),f=p.filter((e=>e.typeId===P.Domain||e.typeId===P.Lookup)),h=null===(n=e.domainSchemaByLookupId)||void 0===n?void 0:n[u],v=!!(null===(o=e.domainSchemaLoading)||void 0===o?void 0:o[u]);!u||h||v||null===(l=e.fetchDomainSchema)||void 0===l||l.call(e,u);const b=t=>{var i,n;null===(n=null===(i=e.getForm)||void 0===i?void 0:i.call(e))||void 0===n||n.change("fieldProperties.columns",t)};if(h&&!e.isViewOnly){const e=new Map(h.map((e=>[e.key.toLowerCase(),e.type]))),t=c.map((t=>{const i=e.get(t.key.toLowerCase());return i&&"text"===t.type&&"text"!==i&&"lookup"!==i?Object.assign(Object.assign({},t),{type:i}):t}));t.some(((e,t)=>e!==c[t]))&&b(t)}const g=e=>c.find((t=>t.key===e)),y=(e,t)=>{var i,n,o,l;const r=g(e.key);return r&&!t?r:Object.assign({key:e.key,displayName:null==r?void 0:r.displayName,type:r&&"text"!==r.type?r.type:e.type,lookupId:null!==(i=null==r?void 0:r.lookupId)&&void 0!==i?i:e.lookupId,isKey:e.isKey,custom:null==r?void 0:r.custom,show:null!==(n=null==r?void 0:r.show)&&void 0!==n&&n,editable:null!==(o=null==r?void 0:r.editable)&&void 0!==o&&o,required:null!==(l=null==r?void 0:r.required)&&void 0!==l&&l,locked:null==r?void 0:r.locked,aggregate:null==r?void 0:r.aggregate,aggregateDecimalPlaces:null==r?void 0:r.aggregateDecimalPlaces},t)},x=null===(a=null===(r=m.find((e=>e.value===u)))||void 0===r?void 0:r.valueName)||void 0===a?void 0:a.toLowerCase();if(h&&x&&!e.isViewOnly&&!c.some((e=>!e.custom))){const e=h.find((e=>e.key.toLowerCase()===x&&!e.isKey));e&&b([y(e,{show:!0}),...c])}const w=new Map((null!=h?h:[]).map((e=>[e.key,e]))),S=[...c.map((e=>{var t;return e.custom?{key:e.key,displayName:null!==(t=e.displayName)&&void 0!==t?t:"",type:e.type,lookupId:e.lookupId}:w.get(e.key)})).filter((e=>!!e)),...(null!=h?h:[]).filter((e=>!g(e.key)))],k=c.filter((e=>!e.custom&&!w.has(e.key))),_=(e,t,i)=>{b([...e.map((e=>e.key===t?y(e,i):y(e))),...k])},q=(e,t)=>{_(S,e.key,t)},O=e=>new Set([...(null!=h?h:[]).map((e=>e.key)),...c.map((e=>e.key))].filter((t=>t!==e)).map((e=>e.toLowerCase()))),C=(e,t)=>e?e.startsWith("_")?'Column names can\'t start with "_".':e.includes(".")?'Column names can\'t contain ".".':O(t).has(e.toLowerCase())?"A column with this name already exists.":null:"Column name is required.",F=null!==(d=null===(s=e.formValues)||void 0===s?void 0:s.columnNameDrafts)&&void 0!==d?d:{},I=(t,i)=>{var n,o;const l=Object.assign({},F);void 0===i?delete l[t]:l[t]=i,null===(o=null===(n=e.getForm)||void 0===n?void 0:n.call(e))||void 0===o||o.change("columnNameDrafts",l)},j=Y(((e,t)=>{if(e===t||t<0||t>=S.length)return;const i=S.slice(),[n]=i.splice(e,1);i.splice(t,0,n),_(i)}),e.isViewOnly);return i("udp-flexbox",{display:"flex",direction:"column",gap:"md"},i("udp-field",{name:"fieldProperties.allowAddRows"},i("udp-fluent-switch",{label:"Allow Adding Rows",labelPosition:"after",hint:"Let users add their own rows and type in every visible column.",disabled:e.isViewOnly})),i("udp-fluent-dropdown",{label:"Lookup",placeholder:"Select a lookup",options:m,value:u,disabled:e.isViewOnly,required:!0,onValueChanged:t=>{e.isViewOnly||(t=>{var i,n,o,l,r;null===(n=null===(i=e.getForm)||void 0===i?void 0:i.call(e))||void 0===n||n.change("fieldProperties.domainLookupId",t),null===(l=null===(o=e.getForm)||void 0===o?void 0:o.call(e))||void 0===l||l.change("fieldProperties.columns",c.filter((e=>e.custom))),t&&(null===(r=e.fetchDomainSchema)||void 0===r||r.call(e,t))})(G(t.detail))}}),u&&v&&i("udp-flexbox",{display:"flex",direction:"row",gap:"sm",align:"center"},i("udp-spinner",{size:"tiny"}),i("udp-text",{variant:"caption1"},"Loading domain columns…")),u&&!v&&h&&0===S.length&&i("udp-text",{variant:"caption1"},"This domain has no describable columns."),u&&!v&&S.length>0&&i("udp-flexbox",{display:"flex",direction:"column",gap:"xs"},i("div",{class:"domain-table-col-row"},i("span",{class:"options-drag-handle-spacer","aria-hidden":"true"}),i("span",{class:"options-grid-header-label"},"Column Name"),i("span",{class:"options-grid-header-label"},"Visible"),i("span",{class:"options-grid-header-label"},"Editable"),i("span",{class:"options-grid-header-label"},"Locked"),i("span",{class:"options-grid-header-label"},"Display Name"),i("span",{class:"options-grid-header-label"},"Value Lookup"),i("span",{"aria-hidden":"true"})),i("div",{ref:j},S.map((t=>{var n,o,l,r,a;const s=g(t.key),d=!!t.isKey,u=!!(null==s?void 0:s.custom),c=!!(null==s?void 0:s.show),p=!!(null==s?void 0:s.editable),m=!!(null==s?void 0:s.required),h=d||!!(null==s?void 0:s.locked),v=null!==(n=null==s?void 0:s.type)&&void 0!==n?n:t.type,b=!d&&"number"===v,y=b&&!!(null==s?void 0:s.aggregate),x=(null==s?void 0:s.aggregate)||"sum",w=Number.isInteger(Number(null==s?void 0:s.aggregateDecimalPlaces))?String(Math.min(3,Math.max(0,Number(null==s?void 0:s.aggregateDecimalPlaces)))):"1";return i("div",{class:"table-col-card"},i("div",{class:"domain-table-col-row"},e.isViewOnly?i("span",{class:"options-drag-handle-spacer","aria-hidden":"true"}):i("span",{class:"option-drag-handle","aria-label":"Drag to reorder"},i("udp-fluent-icon",{name:"drag",size:"sm"})),u?i("udp-fluent-text-input",{"aria-label":"Column name",value:null!==(o=F[t.key])&&void 0!==o?o:t.key,error:t.key in F&&null!==(l=C(F[t.key].trim(),t.key))&&void 0!==l?l:void 0,disabled:e.isViewOnly,autocomplete:"off",includeErrorPadding:!1,onValueChanged:i=>{if(e.isViewOnly)return;const n=i.detail.trim();C(n,t.key)?I(t.key,i.detail):(t.key in F&&I(t.key),n!==t.key&&q(t,{key:n}))}}):i("udp-text",{variant:"body1",truncate:!0,title:t.key},t.key),i("udp-fluent-checkbox",{"aria-label":`${t.key} visible`,includeErrorPadding:!1,disabled:e.isViewOnly||u,checked:c,onValueChanged:()=>{e.isViewOnly||q(t,c?{show:!1,editable:!1,required:!1}:{show:!0})}}),i("udp-fluent-checkbox",{"aria-label":`${t.key} editable`,includeErrorPadding:!1,disabled:e.isViewOnly||!c||d||u,checked:p,onValueChanged:()=>{e.isViewOnly||q(t,{editable:!p})}}),i("udp-fluent-checkbox",{"aria-label":`${t.key} locked`,includeErrorPadding:!1,disabled:e.isViewOnly||!c||d,checked:h,onValueChanged:()=>{e.isViewOnly||q(t,{locked:!h})}}),i("udp-fluent-text-input",{value:null!==(r=null==s?void 0:s.displayName)&&void 0!==r?r:"",disabled:e.isViewOnly||!c,placeholder:t.key,autocomplete:"off",includeErrorPadding:!1,onValueChanged:i=>{e.isViewOnly||q(t,{displayName:i.detail.trim()||void 0})}}),i("udp-fluent-dropdown",{"aria-label":`${t.key} value lookup`,options:f,valueAs:"value",value:null!==(a=null==s?void 0:s.lookupId)&&void 0!==a?a:"",placeholder:"None",clearable:!0,includeErrorPadding:!1,disabled:e.isViewOnly||!c,onValueChanged:i=>{if(e.isViewOnly)return;const n=G(i.detail);q(t,n?{type:"lookup",lookupId:n,aggregate:void 0,aggregateDecimalPlaces:void 0}:{type:"lookup"===t.type?"text":t.type,lookupId:void 0})}}),u?i("udp-fluent-icon-button",{iconName:"delete",appearance:"subtle",size:"small",ariaLabel:"Remove column",disabled:e.isViewOnly,onClick:()=>{var i;e.isViewOnly||((i=t.key)in F&&I(i),_(S.filter((e=>e.key!==i))))}}):i("span",{"aria-hidden":"true"})),c&&(p||b)&&i("div",{class:"table-col-secondary domain-table-col-settings"},p&&u&&"lookup"!==v&&i("udp-fluent-dropdown",{class:"domain-table-col-type",label:"Type",value:v,options:oe,optionLabel:"label",optionValue:"value",disabled:e.isViewOnly,includeErrorPadding:!1,onValueChanged:i=>{if(e.isViewOnly)return;const n=G(i.detail,"text"),o=oe.some((e=>e.value===n))?n:"text";q(t,"number"===o?{type:o}:{type:o,aggregate:void 0,aggregateDecimalPlaces:void 0})}}),p&&i("udp-fluent-switch",{label:"Required",labelPosition:"after",includeErrorPadding:!1,disabled:e.isViewOnly,checked:m,onValueChanged:()=>{e.isViewOnly||q(t,{required:!m})}}),b&&i("udp-fluent-switch",{label:"Display Aggregate",labelPosition:"after",includeErrorPadding:!1,disabled:e.isViewOnly,checked:y,onValueChanged:()=>{e.isViewOnly||q(t,y?{aggregate:void 0,aggregateDecimalPlaces:void 0}:{aggregate:"sum",aggregateDecimalPlaces:1})}})),c&&b&&y&&i("udp-container-query-grid",{columns:{0:1,360:2},gaps:{0:"sm"},class:"table-col-secondary"},i("udp-container-query-grid-item",null,i("udp-fluent-dropdown",{label:"Aggregate Function",value:x,options:le,optionLabel:"label",optionValue:"value",disabled:e.isViewOnly,required:!0,onValueChanged:i=>{e.isViewOnly||q(t,{aggregate:G(i.detail,"sum")})}})),i("udp-container-query-grid-item",null,i("udp-fluent-dropdown",{label:"Decimal Places",value:w,options:re,optionLabel:"label",optionValue:"value",disabled:e.isViewOnly,required:!0,onValueChanged:i=>{e.isViewOnly||q(t,{aggregateDecimalPlaces:Number(G(i.detail,"1"))})}}))))})))),u&&!v&&!e.isViewOnly&&i("div",{class:"options-add-row"},i("udp-fluent-button",{appearance:"subtle",startIconName:"add",onClick:()=>(()=>{const e=(e=>{let t=1;for(;e.has(`customcolumn${t}`);)t++;return t})(O());b([...S.map((e=>y(e))),{key:`customColumn${e}`,displayName:`Column ${e}`,type:"text",custom:!0,show:!0,editable:!0,required:!1},...k])})()},"Add Column")))}(e):ue(e))}function me(e){const t=function(e){const t=K(e,"tallyMode");return"include"===t||"exclude"===t?t:"all"}(e),n=function(e){var t,i,n;const o=[],l=null!==(t=e.sections)&&void 0!==t?t:[];for(const t of l)for(const l of null!==(i=t.questions)&&void 0!==i?i:[])l.fieldTypeId===F.YesNo&&l.id!==e.currentQuestionId&&o.push({value:l.id,label:(null===(n=l.questionText)||void 0===n?void 0:n.trim())||"(untitled question)"});return o}(e),o=n.length>0;return i("udp-flexbox",{display:"flex",direction:"column",gap:"md"},i("udp-field",{name:"fieldProperties.tallyMode"},i("udp-fluent-radio-group",{label:"Which Yes/No questions feed this tally?",orientation:"vertical",items:[{value:"all",label:"All Yes/No questions"},{value:"include",label:"Only the selected Yes/No questions"},{value:"exclude",label:"All except the selected Yes/No questions"}],disabled:e.isViewOnly,onValueChanged:t=>{var i;if(e.isViewOnly)return;const n=null===(i=e.getForm)||void 0===i?void 0:i.call(e);if(!n)return;const o=t.detail;"all"===o?(n.change("fieldProperties.includeFields",[]),n.change("fieldProperties.excludeFields",[])):"include"===o?n.change("fieldProperties.excludeFields",[]):"exclude"===o&&n.change("fieldProperties.includeFields",[])}})),!o&&i("udp-text",{variant:"caption1"},"No other Yes/No questions exist in this form yet."),o&&"include"===t&&i("udp-field",{name:"fieldProperties.includeFields"},i("udp-fluent-dropdown",{label:"Include these Yes/No questions",multiple:!0,clearable:!0,options:n,optionLabel:"label",optionValue:"value",disabled:e.isViewOnly,placeholder:"Select questions to include..."})),o&&"exclude"===t&&i("udp-field",{name:"fieldProperties.excludeFields"},i("udp-fluent-dropdown",{label:"Exclude these Yes/No questions",multiple:!0,clearable:!0,options:n,optionLabel:"label",optionValue:"value",disabled:e.isViewOnly,placeholder:"Select questions to exclude..."})))}function fe(e){var t;const i=null===(t=e.getForm)||void 0===t?void 0:t.call(e);return i?(e,t)=>i.change(e,t):null}function he(e){const{question:t,ctx:n}=e,o=a(t.fieldTypeId).filter((e=>"required"!==e.ruleType));if(0===o.length)return i("udp-text",{variant:"caption1",color:"muted"},"No validation rules available for this field type.");const l=function(e,t){var i;const n=null!==(i=t.formValues)&&void 0!==i?i:{},o="boolean"==typeof n.required?n.required:e.required,l=n.fieldProperties&&"object"==typeof n.fieldProperties?n.fieldProperties:e.fieldProperties;return Object.assign(Object.assign({},e),{required:o,fieldProperties:l})}(t,n),r=e=>null!==e.readParams(l),s=o.filter(r),d=o.filter((e=>!r(e)));return i("udp-flexbox",{display:"flex",direction:"column",gap:"md"},s.map((e=>function(e,t){return i("udp-fluent-card",{key:e.ruleType,appearance:"outline",label:e.builder.label,subtitle:e.builder.description},!t.isViewOnly&&i("udp-fluent-icon-button",{slot:"header-action",iconName:"dismiss",appearance:"subtle",ariaLabel:`Remove ${e.builder.label} rule`,onClick:()=>{if(t.isViewOnly)return;const i=fe(t);i&&e.builder.disable(i)}}),e.builder.params.length>0&&i("udp-flexbox",{display:"flex",direction:"column",gap:"sm"},e.builder.params.map((e=>function(e,t){const n={disabled:t,label:e.label};switch(e.type){case"number":return i("udp-field",{name:e.formPath},i("udp-fluent-text-input",Object.assign({},n,{type:"number",hint:e.helperText})));case"date":return i("udp-field",{name:e.formPath},i("udp-date-input",Object.assign({},n)));case"time":return i("udp-field",{name:e.formPath},i("udp-time-input",Object.assign({},n)));case"datetime":return i("udp-field",{name:e.formPath},i("udp-date-time-input",Object.assign({},n)));default:return i("udp-field",{name:e.formPath},i("udp-fluent-text-input",Object.assign({},n,{hint:e.helperText})))}}(e,t.isViewOnly)))))}(e,n))),function(e,t){if(t.isViewOnly||0===e.length)return null;const n=e.map((e=>({id:e.ruleType,text:e.builder.label,onClick:()=>{const i=fe(t);i&&e.builder.enable(i)}})));return i("udp-fluent-menu",{appearance:"subtle",label:"Add validation rule",startIconName:"add",size:"small",items:n})}(d,n))}const ve=class{constructor(t){e(this,t),this.followUpFormOptions=[],this.isFollowUpFormConfigOn=!1,this.isCommentingConfigOn=!1,this.form=null,this.unsubscribeFormValues=null,this.formValues={},this.domainSchemaCache={},this.domainSchemaLoading={},this.fetchDomainSchema=e=>{var t;if(this.domainSchemaCache[e]||this.domainSchemaLoading[e])return;const i=null===(t=this.lookupOptions)||void 0===t?void 0:t.find((t=>t.value===e));i&&(this.domainSchemaLoading=Object.assign(Object.assign({},this.domainSchemaLoading),{[e]:!0}),p(e,i.domainName).catch((()=>[])).then((t=>{this.domainSchemaCache=Object.assign(Object.assign({},this.domainSchemaCache),{[e]:t}),this.domainSchemaLoading=Object.assign(Object.assign({},this.domainSchemaLoading),{[e]:!1})})))},this.getForm=()=>this.form}componentDidLoad(){this.el.dispatchEvent(new CustomEvent("fetchFormInstance",{bubbles:!0,composed:!0,detail:e=>{this.form=e,this.unsubscribeFormValues=e.subscribe((e=>{var t;this.formValues=null!==(t=e.values)&&void 0!==t?t:{}}),{values:!0})}}))}disconnectedCallback(){this.unsubscribeFormValues&&(this.unsubscribeFormValues(),this.unsubscribeFormValues=null),this.form=null}get question(){var e,t,i;return null===(i=null===(t=null===(e=this.sections)||void 0===e?void 0:e[this.sIndex])||void 0===t?void 0:t.questions)||void 0===i?void 0:i[this.qIndex]}buildTypeSpecificContext(){var e;const t=this.question;return{fieldProperties:null!==(e=t.fieldProperties)&&void 0!==e?e:{},formValues:this.formValues,getForm:this.getForm,isViewOnly:this.isViewOnly,lookupOptions:this.lookupOptions,sections:this.sections,currentQuestionId:t.id,domainSchemaByLookupId:this.domainSchemaCache,domainSchemaLoading:this.domainSchemaLoading,fetchDomainSchema:this.fetchDomainSchema}}render(){const e=this.question;if(!e)return null;const t=m(e.fieldTypeId),n={question:e,isViewOnly:this.isViewOnly,formType:this.formType,isFollowUpFormConfigOn:this.isFollowUpFormConfigOn,isCommentingConfigOn:this.isCommentingConfigOn,isQuestionTextRequired:!(null==t?void 0:t.questionTextOptional),formValues:this.formValues,followUpFormOptions:this.followUpFormOptions},o=this.buildTypeSpecificContext(),l=function(e,t){switch(e){case F.Paragraph:return{label:"Paragraph Text",content:Q(t)};case F.Checkbox:case F.RadioButton:case F.DropdownSingleSelect:case F.DropdownMultipleSelect:case F.ListMultiSelect:return{label:"List Options",content:W(t)};case F.FileUpload:case F.ImageUpload:return{label:"Upload options",content:Z(t)};case F.Signature:return{label:"Signature options",content:J(t)};case F.FormMetadataDisplay:return{label:"Display options",content:ee(t)};case F.Location:return{label:"Location",content:ne(t)};case F.Table:return{label:"Table Columns",content:pe(t)};case F.Tally:return{label:"Tally source",content:me(t)};default:return null}}(e.fieldTypeId,o);return i("div",{class:"config-drawer"},i("udp-flexbox",{display:"flex",direction:"column",gap:"md"},function(e){const{isViewOnly:t,isQuestionTextRequired:n}=e;return i("udp-flexbox",{direction:"column",gap:"md"},i("udp-field",{name:"questionText"},i("udp-textarea",{label:"Question",disabled:t,required:n})),i("udp-field",{name:"helperText"},i("udp-textarea",{label:"Description",disabled:t})))}(n),l&&i("udp-accordion",{expandmode:"multi",appearance:"contained",items:[{id:"type-specific",label:l.label,expanded:!0,block:!0}]},i("udp-flexbox",{slot:"type-specific-content",direction:"column",gap:"md"},l.content)),function(e){var t,n,o;const{question:l,isViewOnly:r,formType:a,isFollowUpFormConfigOn:s,isCommentingConfigOn:d,formValues:u,followUpFormOptions:c=[]}=e,p=null!==(t=l.fieldProperties)&&void 0!==t?t:{},m=null!==(n=null==u?void 0:u.fieldProperties)&&void 0!==n?n:null,f=!0===(null!==(o=null==m?void 0:m.allowFollowUpForms)&&void 0!==o?o:p.allowFollowUpForms),h=a===C.Standard&&s&&f;return i("udp-accordion",{expandmode:"multi",appearance:"contained",items:[{id:"field-behavior",label:"Field Behavior",expanded:!0,block:!0}]},i("udp-flexbox",{slot:"field-behavior-content",direction:"column",gap:"md"},!(!0===p.ignoreRequiredConfig)&&X({name:"required",label:"Required",description:"End users must answer this question before submitting.",disabled:r}),X({name:"fieldProperties.readOnly",label:"Read Only",description:"Show the value but don't allow end users to edit it.",disabled:r}),d&&X({name:"fieldProperties.allowComments",label:"Allow Comments",description:"Let reviewers attach comments to this answer.",disabled:r}),a===C.Standard&&s&&X({name:"fieldProperties.allowFollowUpForms",label:"Allow Follow Up Forms",description:"Let end users launch another form linked to this question.",disabled:r}),h&&c.length>0&&i("udp-field",{name:"fieldProperties.followUpFormIds"},i("udp-fluent-dropdown",{label:"Limit to specific follow-up forms (optional)",hint:"Leave empty to allow any follow-up form.",multiple:!0,clearable:!0,disabled:r,options:c,optionLabel:"label",optionValue:"value",valueAs:"value",placeholder:"Any follow-up form"})),h&&0===c.length&&i("udp-text",{variant:"caption1"},'No follow-up form templates exist yet. Save another form with "Use as follow-up form template" enabled to populate this list.')))}(n),i("udp-accordion",{expandmode:"multi",appearance:"contained",items:[{id:"validation",label:"Validation",expanded:!1,block:!0}]},i("udp-flexbox",{slot:"validation-content",direction:"column",gap:"md"},he({question:e,ctx:o}))),function(e){const{isViewOnly:t}=e;return i("udp-accordion",{expandmode:"multi",appearance:"contained",items:[{id:"advanced",label:"Advanced",expanded:!1,block:!0}]},i("udp-flexbox",{slot:"advanced-content",direction:"column",gap:"sm"},i("udp-field",{name:"referenceCode"},i("udp-fluent-text-input",{label:"Reference Code",disabled:t,placeholder:"Enter an optional reference code",maxLength:32}))))}(n)))}get el(){return o(this)}};function be(e,t){var i,n,o,l,r,a,s,d,u,c,p,m,f,h,v;const b=A(t),g={},y=null!==(n=null===(i=e.data)||void 0===i?void 0:i.submissionResponseData)&&void 0!==n?n:{};for(const[e,t]of Object.entries(y)){const i={};for(const[n,o]of Object.entries(t)){let t=b.byExact(e,n);if(!t){const i=$(e);i!==e&&(t=b.byExact(i,n))}i[n]=ge(o,null==t?void 0:t.fieldTypeId)}g[e]=i}const x={metadata:xe(null!==(l=null===(o=e.data)||void 0===o?void 0:o.submissionMetadata)&&void 0!==l?l:null),responses:g,templateOverrides:we(null!==(a=null===(r=e.data)||void 0===r?void 0:r.formTemplateOverrides)&&void 0!==a?a:null)};return{id:e.id,formId:e.formId,formVersion:e.formVersion,status:e.status,unityUserId:null!==(s=e.unityUserId)&&void 0!==s?s:null,userDisplayName:null!==(d=e.userDisplayName)&&void 0!==d?d:null,userEmail:null!==(u=e.userEmail)&&void 0!==u?u:null,initialCreatedOn:e.initialCreatedOn,lastModifiedOn:e.lastModifiedOn,submittedOn:null!==(c=e.submittedOn)&&void 0!==c?c:null,dueDate:null!==(p=e.dueDate)&&void 0!==p?p:null,generic1:null!==(m=e.generic1)&&void 0!==m?m:null,generic2:null!==(f=e.generic2)&&void 0!==f?f:null,generic3:null!==(h=e.generic3)&&void 0!==h?h:null,data:x,wireResponseData:null!==(v=y)&&void 0!==v?v:{}}}function ge(e,t){var i,n;const o=function(e){var t,i,n,o,l;return null==e?null:{signature:null!==(t=e.signature)&&void 0!==t?t:null,location:null!==(i=e.location)&&void 0!==i?i:null,image:null!==(n=e.image)&&void 0!==n?n:null,file:null!==(o=e.file)&&void 0!==o?o:null,followUpFormSubmissionId:null!==(l=e.followUpFormSubmissionId)&&void 0!==l?l:null}}(null!==(i=e.metadata)&&void 0!==i?i:null),l=null==t?null:f(t,e.value);return{value:null==t?null:h(t,l,o),comments:(null!==(n=e.comments)&&void 0!==n?n:[]).map(ye),metadata:o}}function ye(e){var t,i,n,o;return{commentId:e.commentId,userDisplayName:null!==(t=e.userDisplayName)&&void 0!==t?t:null,userId:e.userId,timestamp:e.timestamp,editedTimestamp:null!==(i=e.editedTimestamp)&&void 0!==i?i:null,isDeleted:null!==(n=e.isDeleted)&&void 0!==n?n:null,value:null!==(o=e.value)&&void 0!==o?o:null}}function xe(e){return null==e?null:e.parentSubmission?{parentSubmission:{submissionId:e.parentSubmission.submissionId,formId:e.parentSubmission.formId,formVersion:e.parentSubmission.formVersion}}:{}}function we(e){var t,i;return null==e?null:{formName:null!==(t=e.formName)&&void 0!==t?t:null,formDescription:null!==(i=e.formDescription)&&void 0!==i?i:null}}function Se(e){const{loadedForm:t,submission:i,urlContext:n}=e,o=[];for(const e of t.sections){const t=qe(e.name,i,n);for(let i=1;i<=t;i++)o.push(ke(e,i))}return o}function ke(e,t){const i=1===t,n=L();return{schemaSection:e,instanceId:n,suffix:t,isOriginal:i,slotName:i?e.name:`${e.name}_${t}`,questions:e.questions.map((e=>({schemaQuestion:e,fieldKey:_e(e.id,n,i)})))}}function _e(e,t,i){return i?e:`${e}__${t}`}function qe(e,t,i){var n;let o=1;if(null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.responses)for(const i of Object.keys(t.data.responses)){const t=Ce(i,e);null!=t&&t>o&&(o=t)}if(i){const t=Oe.length;for(const n of Object.keys(i)){const i=n.toLowerCase();if(!i.startsWith(Oe))continue;const l=i.slice(t),r=l.indexOf(".");if(r<=0)continue;const a=Ce(l.slice(0,r),e.toLowerCase());null!=a&&a>o&&(o=a)}}return o}ve.style=":host{display:block;width:100%}.options-grid{display:flex;flex-direction:column;gap:var(--spacingVerticalS)}.options-drag-handle-spacer{width:24px;min-width:24px}.option-drag-handle{display:flex;align-items:center;justify-content:center;width:24px;min-width:24px;color:var(--colorNeutralForeground3);cursor:grab;user-select:none;-webkit-user-select:none}.option-drag-handle:active{cursor:grabbing}.sortable-ghost{opacity:0.4;border:2px dashed var(--colorBrandStroke1) !important;background-color:var(--colorBrandBackground2) !important}.sortable-chosen{background-color:var(--colorNeutralBackground1Hover)}.sortable-drag{opacity:0.9;box-shadow:var(--shadow16);cursor:grabbing !important}.options-grid-header{display:grid;grid-template-columns:24px 1fr 1fr 32px;gap:var(--spacingHorizontalS);align-items:center}.options-grid-header-label{font-size:var(--fontSizeBase200);font-weight:var(--fontWeightSemibold);color:var(--colorNeutralForeground2)}.option-row{display:grid;grid-template-columns:24px 1fr 1fr 32px;gap:var(--spacingHorizontalS);align-items:center;padding:var(--spacingVerticalXS) var(--spacingHorizontalS) var(--spacingVerticalS) 0;background-color:var(--colorNeutralBackground2);border-radius:var(--borderRadiusMedium);margin-bottom:var(--spacingVerticalXS)}.options-grid--choice .options-grid-header,.options-grid--choice .option-row{grid-template-columns:24px 2fr 1fr 32px}.option-row-actions{display:flex;justify-content:center;min-width:32px}.options-add-row{margin-top:4px;padding:2px 0 0 0}.table-col-card{background-color:var(--colorNeutralBackground2);border-radius:var(--borderRadiusMedium);padding:var(--spacingVerticalXS) var(--spacingHorizontalS) var(--spacingVerticalS) 0;margin-bottom:var(--spacingVerticalXS)}.table-col-main-row{display:grid;grid-template-columns:24px 1fr 1fr 32px;gap:var(--spacingHorizontalS);align-items:center}.domain-table-col-row{display:grid;grid-template-columns:24px minmax(0, 1fr) 56px 56px 56px minmax(0, 1.2fr) minmax(0, 1.2fr) 32px;gap:var(--spacingHorizontalS);align-items:center}.domain-table-col-row:has(>udp-fluent-text-input.has-error){align-items:start}.domain-table-col-row:has(>udp-fluent-text-input.has-error)>:not(udp-fluent-text-input):not(udp-fluent-dropdown){display:flex;align-items:center;min-height:32px}.domain-table-col-row>:nth-child(3),.domain-table-col-row>:nth-child(4),.domain-table-col-row>:nth-child(5){justify-self:center;text-align:center}.table-col-secondary{box-sizing:border-box;display:flex;flex-wrap:wrap;gap:var(--spacingHorizontalS);align-items:center;padding-top:var(--spacingVerticalXS);padding-left:calc(24px + var(--spacingHorizontalXS))}.domain-table-col-type{flex:0 0 auto;width:120px}.domain-table-col-settings{align-items:flex-end}.domain-table-col-settings udp-fluent-switch{margin-bottom:var(--spacingVerticalXS, 4px)}@container (max-width: 400px){.options-grid-header{display:none}.option-row{grid-template-columns:24px 1fr 1fr;gap:var(--spacingHorizontalS) 2px;padding:2px 0}.option-row-actions{grid-column:2 / -1;justify-content:flex-end}}";const Oe="seed_";function Ce(e,t){if(e===t)return 1;const i=`${t}_`;if(!e.startsWith(i))return null;const n=e.slice(i.length),o=Number(n);return!Number.isInteger(o)||o<2?null:o}function Fe(e,t,i){const n=t.toLowerCase(),o=i.toLowerCase();for(const t of e)if(t.slotName.toLowerCase()===n)for(const e of t.questions)if(e.schemaQuestion.name.toLowerCase()===o)return{section:t,question:e};return null}function Ie(e){if(e.fieldTypeId===F.Location){const t=e.fieldProperties;if(t.defaultLocation)return f(F.Location,t.defaultLocation)}return null}function je(e,t){var i,n,o,l;const r={},a=null!==(n=null===(i=null==t?void 0:t.data)||void 0===i?void 0:i.responses)&&void 0!==n?n:{};for(const t of e){const e=null!==(o=a[t.slotName])&&void 0!==o?o:null;for(const i of t.questions){const t=null===(l=null==e?void 0:e[i.schemaQuestion.name])||void 0===l?void 0:l.value;r[i.fieldKey]=void 0!==t?t:Ie(i.schemaQuestion)}}return r}function De(e,t=[]){const i=new FormData;i.append("FormId",String(e.FormId)),i.append("FormVersion",String(e.FormVersion)),i.append("Status",String(e.Status)),i.append("InitialCreatedOn",e.InitialCreatedOn),i.append("LastModifiedOn",e.LastModifiedOn),e.Id&&i.append("Id",String(e.Id)),e.submittedOn&&i.append("submittedOn",e.submittedOn),e.generic1&&i.append("generic1",e.generic1),e.generic2&&i.append("generic2",e.generic2),e.generic3&&i.append("generic3",e.generic3),i.append("Data",JSON.stringify(e.Data));for(const e of t)i.append("FormFiles",e);return i}async function Pe(e){var t,i;if(e.isPublicMode){if(!e.tenantId)throw new Error("submitSubmission: public mode requires a tenantId.");if(e.status!==y.Submitted)throw new Error("submitSubmission: public mode is single-shot — only `SubmissionStatus.Submitted` is allowed.")}const n=null!==(t=e.dynamicSections)&&void 0!==t?t:Se({loadedForm:e.loadedForm,submission:e.current}),o=De(function(e){var t,i,n,o,l,r,a;const{loadedForm:s,values:d,current:u,status:c,generic:p,commentsByQuestionId:m}=e,f=null!==(t=e.dynamicSections)&&void 0!==t?t:Se({loadedForm:s,submission:u}),h=(new Date).toISOString(),y=function(e,t,i,n){var o,l,r,a;const s={},d=null!==(o=null==i?void 0:i.wireResponseData)&&void 0!==o?o:{};for(const i of e){const e={},o=d[i.slotName];for(const s of i.questions){const i=s.schemaQuestion,d=null==o?void 0:o[i.name],u=g(i.fieldTypeId),c=t[s.fieldKey];let p;p=i.fieldTypeId===F.Paragraph?null!==(l=i.fieldProperties.paragraphText)&&void 0!==l?l:"string"==typeof(null==d?void 0:d.value)?d.value:"":u?v(i.fieldTypeId,c):null!==(r=null==d?void 0:d.value)&&void 0!==r?r:"";const m=u?b(i.fieldTypeId,c,null==d?void 0:d.metadata):null==d?void 0:d.metadata,f={value:null!=p?p:"",comments:n&&s.fieldKey in n?n[s.fieldKey]:null!==(a=null==d?void 0:d.comments)&&void 0!==a?a:[]};null!=m&&(f.metadata=m),e[i.name]=f}s[i.slotName]=e}return s}(f,d,u,m),x={FormId:s.form.id,FormVersion:s.form.version,Status:c,InitialCreatedOn:null!==(i=null==u?void 0:u.initialCreatedOn)&&void 0!==i?i:h,LastModifiedOn:h,Data:{submissionResponseData:y,submissionMetadata:null!==(n=null==u?void 0:u.data.metadata)&&void 0!==n?n:null,formTemplateOverrides:void 0!==e.templateOverrides?e.templateOverrides:null!==(o=null==u?void 0:u.data.templateOverrides)&&void 0!==o?o:null}};(null==u?void 0:u.id)&&(x.Id=u.id),(null==u?void 0:u.submittedOn)&&(x.submittedOn=u.submittedOn);const w=null!==(l=null==p?void 0:p.generic1)&&void 0!==l?l:null==u?void 0:u.generic1,S=null!==(r=null==p?void 0:p.generic2)&&void 0!==r?r:null==u?void 0:u.generic2,k=null!==(a=null==p?void 0:p.generic3)&&void 0!==a?a:null==u?void 0:u.generic3;return w&&(x.generic1=w),S&&(x.generic2=S),k&&(x.generic3=k),x}({loadedForm:e.loadedForm,dynamicSections:n,values:e.values,current:e.current,status:e.status,generic:e.generic,templateOverrides:e.templateOverrides,commentsByQuestionId:e.commentsByQuestionId}),e.dynamicSections?x(n.flatMap((t=>t.questions.map((t=>({fieldTypeId:t.schemaQuestion.fieldTypeId,value:e.values[t.fieldKey]})))))):w(e.loadedForm,e.values)),{method:l,url:r}=function(e){var t,i;const n=`${j.productV1ApiUrl}/UdpFormSubmission`;return e.isPublicMode?{method:"POST",url:`${n}/public?tenantId=${encodeURIComponent(String(null!==(t=e.tenantId)&&void 0!==t?t:""))}`}:(null===(i=e.current)||void 0===i?void 0:i.id)?{method:"PUT",url:`${n}/private`}:{method:"POST",url:`${n}/private`}}(e),a=await z(l,r,o,!0);if(""===a||null==a){if(!(null===(i=e.current)||void 0===i?void 0:i.id))throw new Error("Submit returned no body but there is no submission id to refetch.");return await async function(e,t){const i=`${j.productV1ApiUrl}/UdpFormSubmission/${e}/Full`;return be(await z("GET",i),t)}(e.current.id,e.loadedForm)}return be(a,e.loadedForm)}function Ne(e,t){var i,n,o,l,r,a;const s={},d={},u={},c=null!==(i=null==t?void 0:t.wireResponseData)&&void 0!==i?i:{},p=null!==(o=null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.responses)&&void 0!==o?o:{};for(const t of e){const e=p[t.slotName],i=c[t.slotName];for(const n of t.questions){const t=n.fieldKey,o=n.schemaQuestion.name;s[t]=(null!==(r=null===(l=null==e?void 0:e[o])||void 0===l?void 0:l.comments)&&void 0!==r?r:[]).map((e=>Object.assign({},e)));const c=null==i?void 0:i[o],p=(c&&Array.isArray(c.draftComments)?c.draftComments:[]).find((e=>e&&"string"==typeof e.value));d[t]=null!==(a=null==p?void 0:p.value)&&void 0!==a?a:null,u[t]=null}}return{byQuestionId:s,draftByQuestionId:d,editingCommentIdByQuestionId:u}}function Ve(e){return(null!=e?e:[]).filter((e=>!0!==e.isDeleted))}function Le(e,t,i,n=null){return Object.assign(Object.assign({},e),{draftByQuestionId:Object.assign(Object.assign({},e.draftByQuestionId),{[t]:i}),editingCommentIdByQuestionId:Object.assign(Object.assign({},e.editingCommentIdByQuestionId),{[t]:null==i?null:n})})}function Ae(e,t,i,n){var o;const l=(null!==(o=e.byQuestionId[t])&&void 0!==o?o:[]).map((e=>e.commentId===i?Object.assign(Object.assign({},e),n):e));return Object.assign(Object.assign({},e),{byQuestionId:Object.assign(Object.assign({},e.byQuestionId),{[t]:l})})}function $e(e,t){const i=Array.isArray(e)?e:Se({loadedForm:e,submission:null});for(const e of i)for(const i of e.questions)if(i.fieldKey===t)return{sectionKey:e.slotName,questionKey:i.schemaQuestion.name,question:i.schemaQuestion};return null}function Te(e){const t=e.fieldProperties;return!0===(null==t?void 0:t.allowComments)}const Ue=new WeakMap;function Be(e){return`${j.productV1ApiUrl}/UdpFormSubmission/${e.submissionId}/comments`}function ze(e){const t=e.fieldProperties;return!0===(null==t?void 0:t.allowFollowUpForms)}function Ee(e,t,i,n){var o,l;const r=Object.assign({},e),a=Object.assign({},null!==(o=r[t])&&void 0!==o?o:{}),s=null!==(l=a[i])&&void 0!==l?l:{value:null},d=null!=s.metadata&&"object"==typeof s.metadata?s.metadata:{};return a[i]=Object.assign(Object.assign({},s),{metadata:Object.assign(Object.assign({},d),n)}),r[t]=a,r}function Re(e){const{currentPathname:t,parentFormId:i,childFormId:n,childSubmissionId:o}=e;let l=t;return t.includes(String(i))?l=t.replace(String(i),String(n)):console.warn("[udp-question-form] follow-up URL: parent form id not found in path; the new tab may load the wrong form. Path:",t),`${l}?udpf_submissionId=${encodeURIComponent(String(o))}`}function Me(e,t){let i=0,n=0;for(const o of e)for(const e of o.questions)O(e.schemaQuestion.fieldTypeId)||(n+=1,l(t[e.fieldKey])||(i+=1));return{answered:i,total:n}}function He(e){return(null!=e?e:[]).filter((e=>!0===e.show)).map((e=>({key:e.key,displayName:e.displayName||e.key,isKey:e.isKey,type:e.type,lookupId:e.lookupId,editable:!0===e.editable&&!e.isKey,required:!0===e.required&&!e.isKey,locked:!0===e.isKey||!0===e.locked,aggregate:e.isKey?void 0:e.aggregate,aggregateDecimalPlaces:e.isKey?void 0:e.aggregateDecimalPlaces,custom:e.custom})))}const Xe=["#264f78","#0078d4","#107c10","#bf4080","#8764b8","#ca5010","#005b70","#d83b01"];function Qe(e){const t=(null!=e?e:"").trim();if(0===t.length)return"#707070";let i=0;for(let e=0;e<t.length;e++)i=31*i+t.charCodeAt(e)|0;return Xe[Math.abs(i)%Xe.length]}function Ke(e,t){return i=>{var n;const o=null!==(n=i.detail)&&void 0!==n?n:"";t(e,o)}}function Ge(e){const{question:t,fieldKey:n,comments:o,draft:l,currentUserId:r,isReadOnly:a,hideHeader:s,onOpenDraft:d,onChangeDraft:u,onSaveDraft:c,onCancelDraft:p,onEdit:m,onDelete:f}=e,h=Ve(o),v=null!==l,b=v&&null!=l&&l.trim().length>0;return i("section",{class:"comment-thread","data-question-thread":n},!s&&i("header",{class:"comment-thread__header"},i("udp-text",{variant:"caption1Strong",class:"comment-thread__label"},t.questionText||"Untitled question")),0===h.length&&!v&&i("udp-text",{variant:"caption2",class:"comment-thread__empty"},"No comments yet."),i("div",{class:"comment-thread__items"},h.map((e=>function(e){var t,n,o;const{comment:l,currentUserId:r,onEdit:a,onDelete:s}=e,d=null!=r&&l.userId===r,u=l.editedTimestamp&&l.timestamp&&l.editedTimestamp!==l.timestamp,c=null!==(t=l.userDisplayName)&&void 0!==t?t:"Unknown user",p=null!==(n=l.userId)&&void 0!==n?n:c;return i("div",{class:"comment-item",key:l.commentId},i("span",{class:"comment-item__avatar",style:{backgroundColor:Qe(p)},"aria-hidden":"true"},function(e){const t=(null!=e?e:"").trim();return 0===t.length?"?":t[0].toUpperCase()}(c)),i("div",{class:"comment-item__header"},i("udp-text",{variant:"caption1Strong"},c),i("udp-text",{variant:"caption2",class:"comment-item__timestamp"},function(e){if(!e)return"";try{return new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch(t){return e}}(l.timestamp),u?" · edited":""),d&&i("div",{class:"comment-item__actions"},i("udp-fluent-icon-button",{appearance:"transparent",size:"small",iconName:"edit",ariaLabel:"Edit comment",onClick:()=>a(l.commentId)}),i("udp-fluent-icon-button",{appearance:"transparent",size:"small",iconName:"delete",ariaLabel:"Delete comment",onClick:()=>s(l.commentId)}))),i("udp-text",{variant:"body2",class:"comment-item__body"},null!==(o=l.value)&&void 0!==o?o:""))}({comment:e,currentUserId:r,onEdit:e=>m(n,e),onDelete:e=>f(n,e)})))),v&&i("div",{class:"comment-thread__draft",onKeyDown:e=>{"Escape"===e.key&&(e.stopPropagation(),p(n))}},i("udp-textarea",{placeholder:"Add a comment",value:null!=l?l:"",autoResize:!0,required:!1,disabled:a,onValueChanged:Ke(n,u)}),i("div",{class:"comment-thread__draft-actions"},i("udp-fluent-button",{appearance:"transparent",size:"small",onClick:()=>p(n)},"Cancel"),i("udp-fluent-button",{appearance:"primary",size:"small",disabled:!b,onClick:()=>c(n)},"Save"))),!v&&!a&&i("udp-fluent-button",{class:"comment-thread__compose-placeholder",appearance:"subtle",size:"small",startIconName:"add",onClick:e=>{e.stopPropagation(),d(n)}},"Add a comment"))}const Ye=e=>N({driveFileId:e.driveFileId,name:e.name,extension:e.extension});function We(e,t){var i;if(null==t||""===t)return"";const n=e.find((e=>e.value===t));return null!==(i=null==n?void 0:n.display)&&void 0!==i?i:String(t)}function Ze(e,t){const i=e.map((e=>({display:e.display||String(e.value),selected:t.includes(e.value)})));for(const n of t)"string"==typeof n&&""!==n&&(e.some((e=>e.value===n))||i.push({display:n,selected:!0}));return i}function Je(e,t){return i("div",{class:"question-view__options",role:"list"},e.map((e=>i("div",{class:{"question-view__option":!0,"question-view__option--selected":e.selected},role:"listitem"},i("udp-fluent-icon",{class:"question-view__option-mark",name:"single"===t?"radio-button":e.selected?"checkbox-checked":"checkbox-unchecked",variant:e.selected?"filled":"regular",size:"sm"}),i("udp-text",{variant:"body1"},e.display)))))}function et(e){if("string"!=typeof e||""===e)return"";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function tt(e){return i("udp-text",{variant:"body1"},""===e?"—":e)}function it(e){var t;const i=null!==(t=e.maxDate)&&void 0!==t?t:void 0;if(!0!==e.noFutureDate)return i;const n=(new Date).toISOString().slice(0,10);return i&&i<n?i:n}function nt(e){if(e)return e.length>5?e.slice(0,5):e}const ot=[{label:"Yes",value:"true"},{label:"No",value:"false"},{label:"Not Applicable",value:"na"}];function lt(e,t){return!0===t.formReadOnly||!0===e.readOnly}function rt(e,t){return lt(e,t)||!0===t.previewMode}function at(e,t,n,o){return null==o?null:i("div",Object.assign({key:t},function(e,t,i){return{"data-question-id":e.id,"data-field-key":t,class:i.highlightedQuestionId===e.id?"question-card question-card--highlighted":"question-card"}}(e,t,n)),function(e,t,n){const o=function(e,t,n){if(!n.commentsAdapter)return null;if(!Te(e))return null;const o=n.commentsAdapter.getCount(t),l=o>0;return i("udp-fluent-button",{appearance:"transparent",size:"small",startIconName:"comment","aria-label":`Comments on ${e.questionText||"this question"}${l?` (${o})`:""}`,onClick:e=>{var i;e.stopPropagation(),null===(i=n.commentsAdapter)||void 0===i||i.onToggle(t)}},l?`Comments (${o})`:"Add comment")}(e,t,n),l=function(e,t,n){if(!n.followUpFormsAdapter)return null;if(!ze(e))return null;const o=null!=n.followUpFormsAdapter.getStampedChildId(t);return i("div",{class:"question-card__follow-up-toggle"},i("udp-fluent-icon-button",{iconName:"link",iconVariant:o?"filled":"regular",size:"small",appearance:"transparent",ariaLabel:o?`Linked follow-up form for ${e.questionText||"this question"}`:`Link a follow-up form to ${e.questionText||"this question"}`,onClick:e=>{var i;e.stopPropagation(),null===(i=n.followUpFormsAdapter)||void 0===i||i.onLaunch(t)}}))}(e,t,n);return o||l?i("div",{class:"question-card__toggles"},l,o):null}(e,t,n),o,function(e,t,n){var o,l,r;const a=n.comments;if(!a)return null;if(!Te(e))return null;if(!(null===(o=n.commentsAdapter)||void 0===o?void 0:o.isExpanded(t)))return null;const s=null!==(l=a.state.byQuestionId[t])&&void 0!==l?l:[],d=null!==(r=a.state.draftByQuestionId[t])&&void 0!==r?r:null;return i("div",{class:"question-card__inline-comments"},Ge({question:e,fieldKey:t,comments:s,draft:d,currentUserId:a.currentUserId,isReadOnly:!0===n.formReadOnly||!0===n.previewMode,hideHeader:!0,onOpenDraft:a.handlers.onOpenDraft,onChangeDraft:a.handlers.onChangeDraft,onSaveDraft:a.handlers.onSaveDraft,onCancelDraft:a.handlers.onCancelDraft,onEdit:a.handlers.onEdit,onDelete:a.handlers.onDelete}))}(e,t,n))}function st(e){var t,n,o,l,r,a,s,d,u,c,p,m,f,h,v,b,g,y,x,w,S,k,_,q,O,C,I,j,D,P,N,V;const{question:L,context:A}=e,$=null!==(t=e.fieldKey)&&void 0!==t?t:L.id,T=$;if(!0===A.formReadOnly)return function(e){var t,n,o,l,r,a,s,d,u,c,p,m,f,h,v,b;const{question:g,context:y,fieldKey:x,value:w}=e,S=null!==(t=g.questionText)&&void 0!==t?t:"",k=g.required&&S?`${S} *`:S,_=function(e,t,n){var o,l,r;const a=n.comments;if(!a)return null;if(!Te(e))return null;const s=null!==(o=a.state.byQuestionId[t])&&void 0!==o?o:[],d=null!==(l=a.state.draftByQuestionId[t])&&void 0!==l?l:null,u=null!==(r=n.commentsAdapter)&&void 0!==r?r:null,c=Ve(s).length,p=u?i("udp-fluent-button",{class:"question-view__comment-toggle",appearance:"transparent",size:"small",startIconName:"comment","aria-label":`Comments on ${e.questionText||"this question"}${c>0?` (${c})`:""}`,onClick:e=>{e.stopPropagation(),u.onToggle(t)}},c>0?`Comments (${c})`:"Add comment"):null,m=u?u.isExpanded(t):c>0||null!=d;return p||m?i("div",{class:"question-view__inline-comments"},p,m&&Ge({question:e,fieldKey:t,comments:s,draft:d,currentUserId:a.currentUserId,isReadOnly:!0===n.previewMode,hideHeader:!0,onOpenDraft:a.handlers.onOpenDraft,onChangeDraft:a.handlers.onChangeDraft,onSaveDraft:a.handlers.onSaveDraft,onCancelDraft:a.handlers.onCancelDraft,onEdit:a.handlers.onEdit,onDelete:a.handlers.onDelete})):null}(g,x,y);let q;switch(g.fieldTypeId){case F.Hidden:return null;case F.Paragraph:{const e=g.fieldProperties;q=e.paragraphText?i("udp-text",{variant:"body1"},e.paragraphText):null;break}case F.FormMetadataDisplay:{const e=g.fieldProperties,t=y.submission,s=y.currentUser,d=null!==(o=null!==(n=null==t?void 0:t.userDisplayName)&&void 0!==n?n:null==s?void 0:s.displayName)&&void 0!==o?o:"",u=null!==(r=null!==(l=null==t?void 0:t.userEmail)&&void 0!==l?l:null==s?void 0:s.email)&&void 0!==r?r:"",c=null!==(a=null==t?void 0:t.submittedOn)&&void 0!==a?a:null;q=i("form-metadata-display",{userDisplayName:d,userEmail:u,submittedOn:c,displayOwnerFullName:!0===e.displayOwnerFullName,displayOwnerEmail:!0===e.displayOwnerEmail,displaySubmissionDate:!0===e.displaySubmissionDate});break}case F.Tally:{const e=g.fieldProperties;q=i("udp-question-tally-adapter",{loadedForm:y.loadedForm,questionId:g.id,label:k||"Response Tally",tallyMode:null!==(s=e.tallyMode)&&void 0!==s?s:"all",includeFields:null!==(d=e.includeFields)&&void 0!==d?d:[],excludeFields:null!==(u=e.excludeFields)&&void 0!==u?u:[]});break}case F.SingleLineText:case F.MultiLineText:case F.Number:q=tt(null==w||""===w?"":String(w));break;case F.YesNo:q=Je([{display:"Yes",selected:"true"===w||!0===w},{display:"No",selected:"false"===w||!1===w},{display:"Not Applicable",selected:"na"===w}],"single");break;case F.RadioButton:case F.DropdownSingleSelect:{const e=E(g),t=null==w||""===w?[]:[w];q=0===e.length?tt(We(e,w)):Je(Ze(e,t),"single");break}case F.Checkbox:case F.DropdownMultipleSelect:case F.ListMultiSelect:{const e=E(g),t=Array.isArray(w)?w:[];q=0===e.length?tt(t.map((t=>We(e,t))).filter(Boolean).join(", ")):Je(Ze(e,t),"multi");break}case F.DateSelector:q=tt(function(e){if("string"!=typeof e||""===e)return"";const t=new Date(10===e.length?`${e}T00:00:00`:e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}(w));break;case F.TimeSelector:q=tt(function(e){if("string"!=typeof e||""===e)return"";const[t,i]=e.split(":"),n=Number(t),o=Number(i);if(!Number.isFinite(n)||!Number.isFinite(o))return e;const l=new Date;return l.setHours(n,o,0,0),l.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}(w));break;case F.DateTimeSelector:q=tt(et(w));break;case F.Location:{const e=g.fieldProperties,t=null!=w?w:null,n=ie(),o="string"==typeof e.mapZoom?Number(e.mapZoom):e.mapZoom,l=null!=t&&"number"==typeof t.latitude&&"number"==typeof t.longitude&&!!(null==n?void 0:n.tileUrlTemplate),r=null!==(p=null===(c=null==t?void 0:t.address)||void 0===c?void 0:c.freeformAddress)&&void 0!==p?p:"";q=i("div",{class:"question-view__location"},tt(r),l&&i("udp-fluent-location-input",{value:w,readonly:!0,disabled:!0,showMap:!0,hideAddressSearch:!0,defaultZoom:Number.isFinite(o)?o:void 0,tileUrlTemplate:null==n?void 0:n.tileUrlTemplate,searchAddresses:null==n?void 0:n.searchAddresses,reverseGeocode:null==n?void 0:n.reverseGeocode}));break}case F.FileUpload:q=i("udp-fluent-file-input",{view:"list",value:w,readonly:!0,hideDragAndDrop:!0,hideButton:!0,loadStoredFile:Ye});break;case F.ImageUpload:q=i("udp-fluent-file-input",{view:"gallery",accept:"image/*",value:w,readonly:!0,hideDragAndDrop:!0,hideButton:!0,loadStoredFile:Ye});break;case F.Signature:{const e=null!=w?w:null,t=null!==(m=null==e?void 0:e.fullName)&&void 0!==m?m:"",n=et(null!==(h=null===(f=null==e?void 0:e.metadata)||void 0===f?void 0:f.timestamp)&&void 0!==h?h:""),o=null===(v=y.signaturePreviewUrls)||void 0===v?void 0:v[x];q=o?i("div",{class:"question-view__signature"},i("udp-fluent-image",{bordered:!0,fit:"contain"},i("img",{class:"question-view__signature-img",src:o,alt:t?`Signature of ${t}`:"Signature"})),(t||n)&&i("div",{class:"question-view__signature-meta"},t&&i("udp-text",{variant:"body1"},t),n&&i("udp-text",{variant:"caption1"},"Signed ",n))):tt(t);break}case F.Table:{const e=g.fieldProperties;if("domain"===e.dataSource)q=i("udp-fluent-domain-table-input",{value:w,readonly:!0,disabled:!0,columns:He(e.columns)});else{const t=(null!==(b=e.columns)&&void 0!==b?b:[]).filter((e=>"string"==typeof e.id&&e.id.length>0&&"string"==typeof e.name)).map((e=>({id:e.id,name:e.name,type:"number"===e.type?"number":"text",required:!0===e.required,aggregate:e.aggregate,aggregateDecimalPlaces:e.aggregateDecimalPlaces})));q=i("udp-fluent-table-input",{value:w,readonly:!0,disabled:!0,columns:t})}break}default:q=tt(null==w?"":String(w))}return i("udp-detail-list-item",{label:k,emptyState:"hide"},q,_)}({question:L,context:A,fieldKey:$,value:null===(n=A.values)||void 0===n?void 0:n[$]});switch(L.fieldTypeId){case F.Hidden:return null;case F.Paragraph:{const e=L.fieldProperties;return at(L,$,A,i("udp-flexbox",{display:"flex",direction:"column",gap:"xs"},L.questionText&&i("udp-text",{variant:"body1Strong"},L.questionText),e.paragraphText&&i("udp-text",{variant:"body1"},e.paragraphText)))}case F.SingleLineText:return at(L,$,A,i("udp-field",{name:T},i("udp-fluent-text-input",{label:L.questionText,hint:null!==(o=L.helperText)&&void 0!==o?o:void 0,required:L.required,disabled:lt(L.fieldProperties,A)})));case F.MultiLineText:return at(L,$,A,i("udp-field",{name:T},i("udp-textarea",{label:L.questionText,hint:null!==(l=L.helperText)&&void 0!==l?l:void 0,required:L.required,disabled:lt(L.fieldProperties,A),autoResize:!0})));case F.Number:return at(L,$,A,i("udp-field",{name:T},i("udp-fluent-text-input",{label:L.questionText,hint:null!==(r=L.helperText)&&void 0!==r?r:void 0,required:L.required,type:"number",disabled:lt(L.fieldProperties,A)})));case F.YesNo:return at(L,$,A,i("udp-field",{name:T},i("udp-fluent-radio-group",{label:L.questionText,hint:null!==(a=L.helperText)&&void 0!==a?a:void 0,items:ot,disabled:lt(L.fieldProperties,A)})));case F.Checkbox:{const e=L.fieldProperties;return at(L,$,A,i("udp-field",{name:T},i("udp-fluent-list-input",{label:L.questionText,hint:null!==(s=L.helperText)&&void 0!==s?s:void 0,required:L.required,options:E(L),disabled:lt(e,A)})))}case F.RadioButton:{const e=L.fieldProperties,t=E(L).map((e=>({label:e.display,value:e.value})));return at(L,$,A,i("udp-field",{name:T},i("udp-fluent-radio-group",{label:L.questionText,hint:null!==(d=L.helperText)&&void 0!==d?d:void 0,items:t,disabled:lt(e,A)})))}case F.DropdownSingleSelect:{const e=L.fieldProperties;return at(L,$,A,i("udp-field",{name:T},i("udp-fluent-dropdown",{label:L.questionText,hint:null!==(u=L.helperText)&&void 0!==u?u:void 0,required:L.required,options:E(L),optionLabel:"display",optionValue:"value",valueAs:"value",disabled:lt(e,A)})))}case F.DropdownMultipleSelect:{const e=L.fieldProperties;return at(L,$,A,i("udp-field",{name:T},i("udp-fluent-dropdown",{label:L.questionText,hint:null!==(c=L.helperText)&&void 0!==c?c:void 0,required:L.required,options:E(L),optionLabel:"display",optionValue:"value",multiple:!0,valueAs:"value",disabled:lt(e,A)})))}case F.ListMultiSelect:{const e=L.fieldProperties;return at(L,$,A,i("udp-field",{name:T},i("udp-fluent-list-input",{label:L.questionText,hint:null!==(p=L.helperText)&&void 0!==p?p:void 0,required:L.required,options:E(L),disabled:lt(e,A)})))}case F.DateSelector:{const e=L.fieldProperties;return at(L,$,A,i("udp-field",{name:T},i("udp-date-input",{label:L.questionText,hint:null!==(m=L.helperText)&&void 0!==m?m:void 0,required:L.required,minDate:null!==(f=e.minDate)&&void 0!==f?f:void 0,maxDate:it(e),disabled:lt(e,A)})))}case F.TimeSelector:{const e=L.fieldProperties;return at(L,$,A,i("udp-field",{name:T},i("udp-time-input",{label:L.questionText,hint:null!==(h=L.helperText)&&void 0!==h?h:void 0,required:L.required,min:nt(e.minTime),max:nt(e.maxTime),disabled:lt(e,A)})))}case F.DateTimeSelector:{const e=L.fieldProperties;return at(L,$,A,i("udp-field",{name:T},i("udp-date-time-input",{label:L.questionText,hint:null!==(v=L.helperText)&&void 0!==v?v:void 0,required:L.required,minDate:null!==(b=e.minDateTime)&&void 0!==b?b:void 0,maxDate:it({maxDate:e.maxDateTime,noFutureDate:e.noFutureDate}),disabled:lt(e,A)})))}case F.FormMetadataDisplay:{const e=L.fieldProperties,t=A.submission,n=A.currentUser,o=null!==(y=null!==(g=null==t?void 0:t.userDisplayName)&&void 0!==g?g:null==n?void 0:n.displayName)&&void 0!==y?y:"",l=null!==(w=null!==(x=null==t?void 0:t.userEmail)&&void 0!==x?x:null==n?void 0:n.email)&&void 0!==w?w:"",r=null!==(S=null==t?void 0:t.submittedOn)&&void 0!==S?S:null;return at(L,$,A,i("udp-flexbox",{display:"flex",direction:"column",gap:"xs"},L.questionText&&i("udp-text",{variant:"body1Strong"},L.questionText),i("form-metadata-display",{userDisplayName:o,userEmail:l,submittedOn:r,displayOwnerFullName:!0===e.displayOwnerFullName,displayOwnerEmail:!0===e.displayOwnerEmail,displaySubmissionDate:!0===e.displaySubmissionDate})))}case F.Tally:{const e=L.fieldProperties;return at(L,$,A,i("udp-question-tally-adapter",{loadedForm:A.loadedForm,questionId:L.id,label:L.questionText||"Response Tally",tallyMode:null!==(k=e.tallyMode)&&void 0!==k?k:"all",includeFields:null!==(_=e.includeFields)&&void 0!==_?_:[],excludeFields:null!==(q=e.excludeFields)&&void 0!==q?q:[]}))}case F.Location:{const e=L.fieldProperties,t=ie(),n="string"==typeof e.mapZoom?Number(e.mapZoom):e.mapZoom;return at(L,$,A,i("udp-field",{name:T},i("udp-fluent-location-input",{label:L.questionText,hint:null!==(O=L.helperText)&&void 0!==O?O:void 0,required:L.required,disabled:lt(e,A),showMap:!0===e.showMap,hideAddressSearch:!0===e.hideAddressSearch,defaultZoom:Number.isFinite(n)?n:void 0,tileUrlTemplate:null==t?void 0:t.tileUrlTemplate,searchAddresses:null==t?void 0:t.searchAddresses,reverseGeocode:null==t?void 0:t.reverseGeocode})))}case F.FileUpload:{const e=L.fieldProperties;return at(L,$,A,i("udp-field",{name:T},i("udp-fluent-file-input",{view:"list",label:L.questionText,hint:null!==(C=L.helperText)&&void 0!==C?C:void 0,required:L.required,disabled:rt(e,A),hideDragAndDrop:!0===e.hideDragAndDrop,hideButton:!0===e.hideButton,displayUploadTime:!0===e.displayUploadTime,maxFiles:!0===e.allowMultiple?void 0:1})))}case F.ImageUpload:{const e=L.fieldProperties;return at(L,$,A,i("udp-field",{name:T},i("udp-fluent-file-input",{view:"gallery",accept:"image/*",label:L.questionText,hint:null!==(I=L.helperText)&&void 0!==I?I:void 0,required:L.required,disabled:rt(e,A),hideDragAndDrop:!0===e.hideDragAndDrop,hideButton:!0===e.hideButton,displayUploadTime:!0===e.displayUploadTime,maxFiles:!0===e.allowMultiple?void 0:1})))}case F.Signature:{const e=L.fieldProperties;return at(L,$,A,i("udp-field",{name:T},i("udp-fluent-signature-input",{label:L.questionText,hint:null!==(j=L.helperText)&&void 0!==j?j:void 0,required:L.required,disabled:rt(e,A),includeLocation:!0===e.includeLocation})))}case F.Table:{const e=L.fieldProperties;if("domain"===e.dataSource)return at(L,$,A,i("udp-field",{name:T},i("udp-fluent-domain-table-input",{label:L.questionText,hint:null!==(D=L.helperText)&&void 0!==D?D:void 0,required:L.required,disabled:lt(e,A),columns:He(e.columns),domainLookupId:e.domainLookupId,filters:null!==(P=A.domainFilters)&&void 0!==P?P:[],allowAddRows:!0===e.allowAddRows})));const t=(null!==(N=e.columns)&&void 0!==N?N:[]).filter((e=>"string"==typeof e.id&&e.id.length>0&&"string"==typeof e.name)).map((e=>({id:e.id,name:e.name,type:"number"===e.type?"number":"text",required:!0===e.required,aggregate:e.aggregate,aggregateDecimalPlaces:e.aggregateDecimalPlaces})));return at(L,$,A,i("udp-field",{name:T},i("udp-fluent-table-input",{label:L.questionText,hint:null!==(V=L.helperText)&&void 0!==V?V:void 0,required:L.required,disabled:lt(e,A),columns:t})))}default:return function(e,t,n){return at(e,t,n,i("udp-flexbox",{display:"flex",direction:"column",gap:"xs"},i("udp-text",{variant:"body1Strong"},e.questionText),i("udp-text",{variant:"caption1",color:"muted"},"FieldType ",e.fieldTypeId," not yet supported in pass 1",e.helperText?` — ${e.helperText}`:"")))}(L,$,A)}}function dt(e){const{isOpen:t,options:n,selectedFormId:o,isLoading:l,isLaunching:r,onSelect:a,onLaunch:s,onClose:d}=e,u=()=>{r||d()};return i("udp-fluent-dialog",{open:t,dialogTitle:"Link a follow-up form",maxHeight:"60vh",onDialogClose:u},function(e,t,n){return n?i("udp-text",{variant:"body1"},"Loading follow-up forms…"):0===e.length?i("udp-text",{variant:"body1"},"No follow-up forms are available for this question."):i("udp-list",{selectionMode:"single",showDivider:!0,selectedItems:t?[t]:[],onListSelectionChange:e=>{e.stopPropagation();const t=e.detail.selectedItems[0];"string"==typeof t&&a(t)}},e.map((e=>i("udp-fluent-list-item",{key:e.value,value:e.value,label:e.label}))))}(n,o,l),i("udp-fluent-button",{slot:"action",appearance:"secondary",disabled:r,onClick:u},"Cancel"),i("udp-fluent-button",{slot:"action",appearance:"primary",disabled:!o||r||l,onClick:()=>s()},r?"Creating…":"Create"))}const ut="udp-question-form-renderer-form";const ct=class{constructor(i){e(this,i),this.submitted=t(this,"submitted",7),this.tenantId=null,this.isPublicMode=!1,this.history=null,this.urlContext={},this.domainTableFilters=null,this.autoSaveDelay=2e3,this.previewMode=!1,this.highlightedQuestionId=null,this.readOnly=!1,this.resolvedForm=null,this.submission=null,this.initialValues={},this.signaturePreviewUrls={},this.isLoading=!0,this.dynamicSections=[],this.publicModeError=null,this.loadError=null,this.currentUser=null,this.templateOverrides=null,this.commentsState={byQuestionId:{},draftByQuestionId:{},editingCommentIdByQuestionId:{}},this.expandedCommentPanels={},this.followUpPickerOpen=!1,this.followUpPickerQuestionId=null,this.followUpPickerSelectedFormId=null,this.followUpFormsList=[],this.followUpFormsListLoaded=!1,this.followUpFormsListLoading=!1,this.followUpLaunching=!1,this.hostResizeObserver=null,this.hostBoundsUpdateListener=null,this.submitInFlight=!1,this.pendingResave=!1,this.prevSubmitFailed=!1,this.formApi=null,this.autosaveTimer=null,this.lastSavedValues=null,this.formComponentEl=null,this.autosaveStatus="idle",this.lastSavedAt=null,this.progress={answered:0,total:0},this.handleFormComponentRef=e=>{this.formComponentEl=e},this.runAutosave=async()=>{if(this.autosaveTimer=null,!this.formApi)return;if(this.submitInFlight)return void(this.pendingResave=!0);const e=this.formApi.getState().values;await this.submitToBackend(e,y.InProgress,{rebuildComments:!1,showErrorSnackbar:!1})},this.handleSubmitClick=()=>{this.clearAutosaveTimer()},this.handleSubmit=async e=>{var t;this.clearAutosaveTimer(),this.previewMode?this.notifyPreviewNotSaved("Preview only — submission not saved."):(await this.flushOpenDrafts(),await this.submitToBackend(e,y.Submitted,{rebuildComments:!0,showErrorSnackbar:!0})&&(null===(t=this.submission)||void 0===t?void 0:t.id)&&this.submitted.emit(this.submission.id))},this.handleAddSection=e=>{if(!this.resolvedForm||!this.formApi)return;if(this.isReadOnly||this.previewMode)return;let t;try{t=function(e,t){var i;const n=e.filter((e=>e.schemaSection.id===t));if(0===n.length)throw new Error(`duplicateSection: no instances found for schema section ${t}`);const o=n[0].schemaSection;if(!0!==(null===(i=o.sectionProperties)||void 0===i?void 0:i.isRepeatable))throw new Error(`duplicateSection: schema section ${t} is not marked repeatable`);const l=ke(o,Math.max(...n.map((e=>e.suffix)))+1),r=e.lastIndexOf(n[n.length-1]);return{next:[...e.slice(0,r+1),l,...e.slice(r+1)],newInstance:l}}(this.dynamicSections,e)}catch(e){return void console.warn("[udp-question-form-renderer] duplicateSection refused:",e)}const i=je([t.newInstance],null),n=this.formApi;n.batch((()=>{for(const[e,t]of Object.entries(i))n.change(e,t)})),this.dynamicSections=t.next},this.handleDeleteSection=e=>{if(!this.resolvedForm||!this.formApi)return;if(this.isReadOnly||this.previewMode)return;const t=this.dynamicSections.find((t=>t.instanceId===e));if(!t||t.isOriginal)return;const i=t.questions.map((e=>e.fieldKey)),n=this.formApi;n.batch((()=>{for(const e of i)n.change(e,void 0)}));try{this.dynamicSections=function(e,t){const i=e.findIndex((e=>e.instanceId===t));if(i<0)return e;const n=e[i];if(n.isOriginal)throw new Error("deleteSection: refusing to delete the original copy of a section (legacy invariant).");const o=n.schemaSection.id,l=e.filter(((e,t)=>t!==i));let r=2;return l.map((e=>{if(e.schemaSection.id!==o||e.isOriginal)return e;const t=r++;return t===e.suffix?e:Object.assign(Object.assign({},e),{suffix:t,slotName:`${e.schemaSection.name}_${t}`})}))}(this.dynamicSections,e)}catch(e){return void console.warn("[udp-question-form-renderer] deleteSection refused:",e)}this.commentsState=function(e,t){if(0===t.length)return e;const i=new Set(t),n=e=>{const t={};for(const n of Object.keys(e))i.has(n)||(t[n]=e[n]);return t};return{byQuestionId:n(e.byQuestionId),draftByQuestionId:n(e.draftByQuestionId),editingCommentIdByQuestionId:n(e.editingCommentIdByQuestionId)}}(this.commentsState,i)},this.toggleQuestionComments=e=>{var t;const i=!0===this.expandedCommentPanels[e];if(this.expandedCommentPanels=Object.assign(Object.assign({},this.expandedCommentPanels),{[e]:!i}),!i){Ve(null!==(t=this.commentsState.byQuestionId[e])&&void 0!==t?t:[]).length>0||null!=this.commentsState.draftByQuestionId[e]||(this.commentsState=Le(this.commentsState,e,""))}},this.isCommentsPanelExpanded=e=>!0===this.expandedCommentPanels[e],this.openDraft=e=>{this.commentsState=Le(this.commentsState,e,"")},this.changeDraft=(e,t)=>{var i;const n=null!==(i=this.commentsState.editingCommentIdByQuestionId[e])&&void 0!==i?i:null;this.commentsState=Le(this.commentsState,e,t,n)},this.cancelDraft=e=>{this.commentsState=Le(this.commentsState,e,null)},this.saveDraft=async e=>{var t,i,n,o;if(this.previewMode)return null;const l=this.commentsState.draftByQuestionId[e];if(null==l||0===l.trim().length)return null;if(!this.resolvedForm)return null;const r=null!==(t=this.commentsState.editingCommentIdByQuestionId[e])&&void 0!==t?t:null,a=null===(i=this.submission)||void 0===i?void 0:i.id,s={submissionId:a,isPublicMode:this.isPublicMode},d=$e(this.dynamicSections,e);if(r){const t=(null!==(n=this.commentsState.byQuestionId[e])&&void 0!==n?n:[]).find((e=>e.commentId===r));if(!t)return this.saveDraftAsNew(e,l);const i=Object.assign(Object.assign({},t),{value:l,editedTimestamp:(new Date).toISOString(),isDeleted:!1}),u=t;if(this.commentsState=Ae(this.commentsState,e,r,i),this.commentsState=Le(this.commentsState,e,null),!a||!d)return i;try{return await async function(e,t,i){if(e.isPublicMode)throw new Error("Comment updates are not supported in public mode.");const n=`${Be(e)}/${t}`;await z("PUT",n,i,!0)}(s,r,{sectionKey:d.sectionKey,questionKey:d.questionKey,value:l}),i}catch(t){return console.error("[udp-question-form-renderer] putComment failed:",t),this.commentsState=Ae(this.commentsState,e,r,u),null===(o=this.enqueueSnackbar)||void 0===o||o.call(this,"Failed to update comment.",{variant:"error"}),null}}return this.saveDraftAsNew(e,l)},this.editComment=(e,t)=>{var i,n;const o=(null!==(i=this.commentsState.byQuestionId[e])&&void 0!==i?i:[]).find((e=>e.commentId===t));o&&(this.commentsState=Le(this.commentsState,e,null!==(n=o.value)&&void 0!==n?n:"",t))},this.deleteComment=async(e,t)=>{var i,n,o;if(this.previewMode)return;if(!(null!==(i=this.commentsState.byQuestionId[e])&&void 0!==i?i:[]).find((e=>e.commentId===t)))return;this.commentsState=function(e,t,i){return Ae(e,t,i,{isDeleted:!0,value:"",editedTimestamp:(new Date).toISOString()})}(this.commentsState,e,t);const l=null===(n=this.submission)||void 0===n?void 0:n.id;if(l)try{await async function(e,t){if(e.isPublicMode)throw new Error("Comment deletion is not supported in public mode.");const i=`${Be(e)}/${t}`;await z("DELETE",i,null,!0)}({submissionId:l,isPublicMode:this.isPublicMode},t)}catch(i){console.error("[udp-question-form-renderer] deleteComment failed:",i),this.commentsState=Ae(this.commentsState,e,t,{isDeleted:!1}),null===(o=this.enqueueSnackbar)||void 0===o||o.call(this,"Failed to delete comment.",{variant:"error"})}},this.getCommentCount=e=>Ve(this.commentsState.byQuestionId[e]).length,this.getFollowUpStampedChildId=e=>{var t,i,n,o;if(!this.resolvedForm||!this.submission)return null;const l=$e(this.dynamicSections,e);if(!l)return null;const r=null===(t=this.submission.data.responses[l.sectionKey])||void 0===t?void 0:t[l.questionKey];return null!==(o=null!==(n=null===(i=null==r?void 0:r.metadata)||void 0===i?void 0:i.followUpFormSubmissionId)&&void 0!==n?n:null)&&void 0!==o?o:null},this.handleLaunchFollowUpForm=async e=>{if(this.isPublicMode)return;if(this.previewMode)return void this.notifyPreviewNotSaved("Preview only — this action is not saved.");const t=this.getFollowUpStampedChildId(e);if(t)await this.openStampedFollowUp(t);else if(this.followUpPickerQuestionId=e,this.followUpPickerSelectedFormId=null,this.followUpPickerOpen=!0,!this.followUpFormsListLoaded&&!this.followUpFormsListLoading){this.followUpFormsListLoading=!0;try{this.followUpFormsList=await _(),this.followUpFormsListLoaded=!0}finally{this.followUpFormsListLoading=!1}}},this.handleFollowUpSelect=e=>{this.followUpPickerSelectedFormId=e},this.handleFollowUpClose=()=>{this.followUpLaunching||(this.followUpPickerOpen=!1,this.followUpPickerQuestionId=null,this.followUpPickerSelectedFormId=null)},this.handleFollowUpLaunch=async()=>{var e,t,i,n,o,l,r;if(!this.resolvedForm)return;const a=this.followUpPickerQuestionId,s=this.followUpPickerSelectedFormId;if(a&&s&&!this.followUpLaunching){this.followUpLaunching=!0;try{if(!(null===(e=this.submission)||void 0===e?void 0:e.id)&&(await this.runAutosave(),!(null===(t=this.submission)||void 0===t?void 0:t.id)))return void(null===(i=this.enqueueSnackbar)||void 0===i||i.call(this,"Could not save the form before launching the follow-up. Try again.",{variant:"error"}));const r=this.submission,d=await this.fetchLatestFormVersion(s);if(null==d)return void(null===(n=this.enqueueSnackbar)||void 0===n||n.call(this,"Could not load the selected follow-up form.",{variant:"error"}));const u=await async function(e){const t=`${j.productV1ApiUrl}/UdpForm/${e.childFormId}/describe?formVersion=${e.childFormVersion}`,i=await z("GET",t),n=S(i),o=(new Date).toISOString(),l={};for(const e of n.sections){l[e.name]={};for(const t of e.questions)l[e.name][t.name]={value:"",comments:[]}}const r=De({FormId:e.childFormId,FormVersion:e.childFormVersion,Status:y.InProgress,InitialCreatedOn:o,LastModifiedOn:o,Data:{submissionResponseData:l,submissionMetadata:{parentSubmission:{submissionId:e.parentSubmissionId,formId:e.parentFormId,formVersion:e.parentFormVersion}},formTemplateOverrides:null}}),a=`${j.productV1ApiUrl}/UdpFormSubmission/private`;return be(await z("POST",a,r,!0),n)}({childFormId:s,childFormVersion:d,parentSubmissionId:r.id,parentFormId:r.formId,parentFormVersion:r.formVersion}),c=null!==(l=null===(o=this.formApi)||void 0===o?void 0:o.getState().values)&&void 0!==l?l:{},p=await async function(e){const{loadedForm:t,parent:i,dynamicSections:n,values:o,questionId:l,childSubmissionId:r}=e,a=$e(n||t,l);if(!a)throw new Error(`stampFollowUpOnParent: question ${l} not in schema.`);return Pe({loadedForm:t,dynamicSections:n,current:Object.assign(Object.assign({},i),{wireResponseData:Ee(i.wireResponseData,a.sectionKey,a.questionKey,{followUpFormSubmissionId:r})}),values:o,status:i.status,isPublicMode:!1})}({loadedForm:this.resolvedForm,dynamicSections:this.dynamicSections,parent:r,values:c,questionId:a,childSubmissionId:u.id});if(this.submission=p,"undefined"!=typeof window){const e=Re({currentPathname:window.location.pathname,parentFormId:r.formId,childFormId:s,childSubmissionId:u.id});window.open(e,"_blank")}this.followUpPickerOpen=!1,this.followUpPickerQuestionId=null,this.followUpPickerSelectedFormId=null}catch(e){console.error("[udp-question-form-renderer] follow-up launch failed:",e),null===(r=this.enqueueSnackbar)||void 0===r||r.call(this,"Could not launch follow-up form.",{variant:"error"})}finally{this.followUpLaunching=!1}}}}async componentWillLoad(){var e;if(this.loadedForm&&(this.resolvedForm=this.loadedForm),this.isPublicMode&&!this.previewMode&&!this.tenantId)return this.publicModeError="Public forms require a tenantId.",void(this.isLoading=!1);const t=this.submissionId&&!this.previewMode&&!this.isPublicMode,i=!(!t||this.loadedForm||this.formId&&null!=this.formVersion);let n=null;i&&(n=await this.fetchAndLogSubmissionRaw(),(null==n?void 0:n.formId)&&(this.formId=n.formId,this.formVersion=null!==(e=n.formVersion)&&void 0!==e?e:null));const o=!this.loadedForm&&!!this.formId,[r,a]=await Promise.all([o?this.fetchAndLogDescribe():Promise.resolve(null),t&&!i?this.fetchAndLogSubmissionRaw():Promise.resolve(n)]);try{if(r&&(this.resolvedForm=r),a&&this.resolvedForm?this.submission=this.parseAndLogSubmission(a,this.resolvedForm):a&&!this.resolvedForm&&console.warn("[udp-question-form-renderer] cannot parse submission without form schema"),this.isPublicMode&&!this.previewMode&&this.resolvedForm&&!0===this.resolvedForm.form.isPrivate)return this.publicModeError="This form is not available publicly.",this.resolvedForm=null,void(this.isLoading=!1);if(this.resolvedForm){this.dynamicSections=Se({loadedForm:this.resolvedForm,submission:this.submission,urlContext:this.previewMode?null:this.urlContext});const e=je(this.dynamicSections,this.submission);this.initialValues=this.previewMode?e:function(e,t,i,n){var o;if(n.hasExistingSubmission)return t;if(!i)return t;const r=function(e){const t=[];for(const i of Object.keys(e)){const n=i.toLowerCase();if(!n.startsWith("seed_"))continue;const o=n.slice(5),l=o.indexOf(".");if(l<=0||l===o.length-1)continue;const r=o.slice(0,l),a=o.slice(l+1),s=e[i];"string"==typeof s&&t.push({sectionSlot:r,questionSlot:a,rawValue:s})}return t}(i);if(0===r.length)return t;const a=null!==(o=n.dynamicSections)&&void 0!==o?o:Se({loadedForm:e,submission:null,urlContext:i}),s=Object.assign({},t);for(const{sectionSlot:e,questionSlot:t,rawValue:i}of r){const n=Fe(a,e,t);if(!n)continue;if(!l(s[n.question.fieldKey]))continue;const o=f(n.question.schemaQuestion.fieldTypeId,i);null!=o&&(s[n.question.fieldKey]=o)}return s}(this.resolvedForm,e,this.urlContext,{hasExistingSubmission:null!=this.submission&&this.submission.status!==y.Created,dynamicSections:this.dynamicSections}),this.lastSavedValues=this.initialValues,this.commentsState=Ne(this.dynamicSections,this.submission);const t={};for(const e of Object.keys(this.commentsState.byQuestionId))Ve(this.commentsState.byQuestionId[e]).length>0&&(t[e]=!0);this.expandedCommentPanels=t,this.progress=Me(this.dynamicSections,this.initialValues)}this.currentUser=this.resolveCurrentUser(),this.templateOverrides=this.resolveTemplateOverrides()}catch(e){console.error("[udp-question-form-renderer] failed to initialize form:",e),this.loadError="Could not load this form. Please refresh and try again.",this.resolvedForm=null,this.submission=null,this.dynamicSections=[]}!this.resolvedForm||this.previewMode||this.isReadOnly||(this.initialValues=await async function(e,t,i){const n=e.flatMap((e=>e.questions.filter((e=>k(e.schemaQuestion.fieldTypeId,e.schemaQuestion.fieldProperties))))),o=Object.assign({},t);return await Promise.all(n.map((async({schemaQuestion:e,fieldKey:t})=>{const n=o[t];if(T(n))return;const l=e.fieldProperties;if(!(null==l?void 0:l.domainLookupId))return;const r=await U(l.domainLookupId,i);r&&0!==r.length&&(o[t]=B(r,n,He(l.columns)))}))),o}(this.dynamicSections,this.initialValues,this.domainFilters),this.lastSavedValues=this.initialValues,this.progress=Me(this.dynamicSections,this.initialValues)),this.isLoading=!1,this.loadSignaturePreviews()}async loadSignaturePreviews(){var e,t,i;if(!this.isReadOnly)return;const n={};for(const o of this.dynamicSections)for(const l of o.questions){if(l.schemaQuestion.fieldTypeId!==F.Signature)continue;const o=this.initialValues[l.fieldKey],r=q(null!==(e=null==o?void 0:o.file)&&void 0!==e?e:null);if(r)try{const e=await N({driveFileId:r,name:null!==(i=null===(t=null==o?void 0:o.file)||void 0===t?void 0:t.name)&&void 0!==i?i:"signature.png",extension:"png"});e&&e.size>0&&(n[l.fieldKey]=URL.createObjectURL(e))}catch(e){}}Object.keys(n).length>0&&(this.revokeSignaturePreviews(),this.signaturePreviewUrls=n)}revokeSignaturePreviews(){for(const e of Object.values(this.signaturePreviewUrls))URL.revokeObjectURL(e)}get domainFilters(){var e;return this.previewMode?[]:null!==(e=this.domainTableFilters)&&void 0!==e?e:[]}urlContextValue(e){const t=this.urlContext;if(!t||"object"!=typeof t)return null;const i=e.toLowerCase();for(const e of Object.keys(t))if(e.toLowerCase()===i){const i=t[e];if(null==i)return null;if("string"!=typeof i&&"number"!=typeof i&&"boolean"!=typeof i)return null;const n=String(i).trim();return n.length>0?n:null}return null}resolveTemplateOverrides(){var e,t,i,n;const o=null!==(t=null===(e=this.submission)||void 0===e?void 0:e.data.templateOverrides)&&void 0!==t?t:null;if(o&&(o.formName||o.formDescription))return{formName:null!==(i=o.formName)&&void 0!==i?i:null,formDescription:null!==(n=o.formDescription)&&void 0!==n?n:null};if(this.previewMode)return null;const l=this.urlContextValue("override_formname"),r=this.urlContextValue("override_formdescription");return l||r?this.submission&&this.submission.status!==y.Created?null:{formName:l,formDescription:r}:null}resolveGenericContext(){const e=this.urlContextValue("generic1"),t=this.urlContextValue("generic2"),i=this.urlContextValue("generic3");if(e||t||i)return{generic1:e,generic2:t,generic3:i}}resolveCurrentUser(){var e,t,i,n;if("function"!=typeof this.getUserCallback)return null;try{const o=this.getUserCallback();return o?{id:null!==(e=o.id)&&void 0!==e?e:null,displayName:null!==(i=null!==(t=o.displayName)&&void 0!==t?t:o.name)&&void 0!==i?i:null,email:null!==(n=o.email)&&void 0!==n?n:null}:null}catch(e){return null}}handleLoadedFormChange(e){e&&(this.resolvedForm=e,this.dynamicSections=Se({loadedForm:e,submission:this.submission,urlContext:this.previewMode?null:this.urlContext}),this.initialValues=je(this.dynamicSections,this.submission),this.commentsState=Ne(this.dynamicSections,this.submission),this.progress=Me(this.dynamicSections,this.initialValues))}handleHighlightedQuestionIdChange(){this.scrollHighlightedIntoView()}handleGetUserCallbackChange(){this.currentUser=this.resolveCurrentUser()}componentDidLoad(){this.highlightedQuestionId&&this.scrollHighlightedIntoView(),this.installHostBoundsTracker()}installHostBoundsTracker(){if(!this.el)return;const e=()=>{const e=this.el.getBoundingClientRect();this.el.style.setProperty("--udpqf-host-left",`${e.left}px`),this.el.style.setProperty("--udpqf-host-width",`${e.width}px`)};e(),"undefined"!=typeof ResizeObserver&&(this.hostResizeObserver=new ResizeObserver(e),this.hostResizeObserver.observe(this.el)),this.hostBoundsUpdateListener=e,window.addEventListener("resize",this.hostBoundsUpdateListener),window.addEventListener("scroll",this.hostBoundsUpdateListener,{passive:!0,capture:!0})}teardownHostBoundsTracker(){this.hostResizeObserver&&(this.hostResizeObserver.disconnect(),this.hostResizeObserver=null),this.hostBoundsUpdateListener&&(window.removeEventListener("resize",this.hostBoundsUpdateListener),window.removeEventListener("scroll",this.hostBoundsUpdateListener,{capture:!0}),this.hostBoundsUpdateListener=null)}scrollHighlightedIntoView(){const e=this.highlightedQuestionId;e&&requestAnimationFrame((()=>{var t;const i=null===(t=this.el)||void 0===t?void 0:t.shadowRoot;if(!i)return;const n=i.querySelector(`[data-question-id="${e}"]`);null==n||n.scrollIntoView({block:"nearest",behavior:"smooth"})}))}buildDescribeUrl(){const e=j.productV1ApiUrl,t=new URLSearchParams;if(null!=this.formVersion&&t.set("formVersion",String(this.formVersion)),this.isPublicMode){this.tenantId&&t.set("tenantId",String(this.tenantId));const i=t.toString();return`${e}/UdpForm/${this.formId}/describe/public${i?`?${i}`:""}`}const i=t.toString();return`${e}/UdpForm/${this.formId}/describe${i?`?${i}`:""}`}async fetchAndLogDescribe(){const e=this.buildDescribeUrl();try{const t=await z("GET",e);return S(t)}catch(e){return console.error("[udp-question-form-renderer] /describe failed:",e),null}}async fetchAndLogSubmissionRaw(){const e=`${j.productV1ApiUrl}/UdpFormSubmission/${this.submissionId}/Full`;try{return await z("GET",e)}catch(e){return console.error("[udp-question-form-renderer] /UdpFormSubmission failed:",e),null}}parseAndLogSubmission(e,t){return be(e,t)}handleFormReady(e){this.isFromRendererForm(e)&&(this.formApi=e.detail)}isFromRendererForm(e){var t,i;return(null!==(i=null===(t=e.composedPath)||void 0===t?void 0:t.call(e)[0])&&void 0!==i?i:e.target)===this.formComponentEl}get isReadOnly(){var e;return!(!this.readOnly&&(null===(e=this.submission)||void 0===e?void 0:e.status)!==y.Submitted)||this.isViewedByNonOwner}get isViewedByNonOwner(){var e,t,i,n;if(this.isPublicMode)return!1;const o=null!==(t=null===(e=this.submission)||void 0===e?void 0:e.unityUserId)&&void 0!==t?t:null,l=null!==(n=null===(i=this.currentUser)||void 0===i?void 0:i.id)&&void 0!==n?n:null;return null!=o&&null!=l&&String(o).toLowerCase()!==String(l).toLowerCase()}clearAutosaveTimer(){null!=this.autosaveTimer&&(clearTimeout(this.autosaveTimer),this.autosaveTimer=null)}async submitToBackend(e,t,i){var n,o,l,r;if(!this.resolvedForm||this.submitInFlight)return!1;if(this.previewMode||this.isReadOnly)return!1;this.submitInFlight=!0,this.autosaveStatus="saving";const a=!(null===(n=this.submission)||void 0===n?void 0:n.id);let s=!1;try{const n=await Pe({loadedForm:this.resolvedForm,dynamicSections:this.dynamicSections,current:this.submission,values:e,status:t,isPublicMode:this.isPublicMode,tenantId:this.tenantId,generic:this.resolveGenericContext(),templateOverrides:null!==(o=this.templateOverrides)&&void 0!==o?o:void 0,commentsByQuestionId:this.commentsState.byQuestionId});return this.submission=n,this.lastSavedValues=e,i.rebuildComments&&(this.commentsState=Ne(this.dynamicSections,n)),t===y.Submitted&&(this.initialValues=je(this.dynamicSections,n),this.loadSignaturePreviews()),a&&n.id&&(null===(l=this.el)||void 0===l?void 0:l.isConnected)&&function(e,t){if("undefined"==typeof window)return;const i=`${window.location.pathname}?udpf_submissionId=${e}${window.location.hash}`;if(t){if(function(e){return"object"==typeof e&&null!==e&&"replace"in e&&"function"==typeof e.replace}(t))return void t.replace(i);if(function(e){return"object"==typeof e&&null!==e&&"push"in e&&"function"==typeof e.push}(t))return void t.push(i);if("function"==typeof t){try{t(i,{replace:!0})}catch(e){console.debug("[udp-question-form] history(url, opts) threw; retrying with (url) only.",e);try{t(i)}catch(e){console.warn("[udp-question-form] host history callable rejected both signatures; using native window.history.replaceState as a fallback.",e)}}return}}window.history.replaceState({},"",i)}(n.id,this.history),this.lastSavedAt=new Date,this.autosaveStatus="saved",s=!0,!0}catch(e){return console.error("[udp-question-form-renderer] submit failed:",e),this.autosaveStatus="error",i.showErrorSnackbar&&(null===(r=this.enqueueSnackbar)||void 0===r||r.call(this,"There was an error submitting this form.",{variant:"error"})),!1}finally{this.submitInFlight=!1;const e=this.pendingResave;this.pendingResave=!1,(s||e)&&this.resaveIfStale()}}resaveIfStale(){this.formApi&&null!=this.lastSavedValues&&(pt(this.formApi.getState().values,this.lastSavedValues)||this.runAutosave())}getValidator(){if(this.resolvedForm&&0!==this.dynamicSections.length)return this.cachedValidatorFor!==this.dynamicSections&&(this.cachedValidator=function(e){const t=Array.isArray(e)?e:Se({loadedForm:e,submission:null});return e=>{const i=function(e={}){return Object.assign({now:()=>new Date,resolveLookupOptions:()=>null,allValues:{}},e)}({allValues:e});return function(e,t){const i=[],n=[],o={};for(const l of e){const e=R(l.question,l.value,t);for(const t of e){const e={fieldKey:l.fieldKey,questionId:l.question.id,sectionName:l.sectionName,questionName:l.question.name,questionText:l.question.questionText,ruleType:t.ruleType,message:t.message,severity:t.severity};"warning"===t.severity?n.push(e):(i.push(e),null==o[l.fieldKey]&&(o[l.fieldKey]=t.message))}}return{ok:0===i.length,errors:i,warnings:n,errorsByFieldKey:o}}(function(e,t){const i=[];for(const n of e)for(const e of n.questions)i.push({fieldKey:e.fieldKey,sectionName:n.slotName,question:e.schemaQuestion,value:t[e.fieldKey]});return i}(t,e),i).errorsByFieldKey}}(this.dynamicSections),this.cachedValidatorFor=this.dynamicSections),this.cachedValidator}notifyPreviewNotSaved(e){var t;null===(t=this.enqueueSnackbar)||void 0===t||t.call(this,e,{variant:"info"})}handleFormStateUpdated(e){var t,i;if(!this.isFromRendererForm(e))return;const n=e.detail;if(n.submitFailed&&!this.prevSubmitFailed){const e=Object.keys(null!==(t=n.errors)&&void 0!==t?t:{}).length;null===(i=this.enqueueSnackbar)||void 0===i||i.call(this,`Please fix ${e} issue${1===e?"":"s"} before submitting.`,{variant:"error"}),this.scrollToFirstError(n.errors)}this.prevSubmitFailed=n.submitFailed,this.progress=Me(this.dynamicSections,n.values),this.maybeScheduleAutosave(n)}scrollToFirstError(e){if(!e||0===Object.keys(e).length)return;const t=function(e,t){for(const i of e)for(const e of i.questions)if(t[e.fieldKey])return e.fieldKey;return null}(this.dynamicSections,e);t&&requestAnimationFrame((()=>{var e;const i=null===(e=this.el)||void 0===e?void 0:e.shadowRoot;if(!i)return;const n=i.querySelector(`[data-field-key="${t}"]`);n&&(n.scrollIntoView({block:"center",behavior:"smooth"}),function(e){const t=e.querySelector("udp-field"),i=null==t?void 0:t.firstElementChild;if(i&&"function"==typeof i.focus)return void i.focus({preventScroll:!0});const n=e.querySelector('input, textarea, select, [tabindex]:not([tabindex="-1"])');null==n||n.focus({preventScroll:!0})}(n))}))}maybeScheduleAutosave(e){if(this.previewMode||this.isReadOnly)return;if(this.isPublicMode)return;if(e.submitting)return;if(null==this.lastSavedValues)return;if(pt(e.values,this.lastSavedValues))return void this.clearAutosaveTimer();if(!this.resolvedForm||!this.formApi)return;const t=Math.max(0,this.autoSaveDelay);this.clearAutosaveTimer(),this.autosaveTimer=setTimeout((()=>{this.runAutosave()}),t)}disconnectedCallback(){queueMicrotask((()=>{var e;if(null===(e=this.el)||void 0===e?void 0:e.isConnected)return;const t=null!=this.autosaveTimer;this.clearAutosaveTimer(),t&&this.runAutosave(),this.teardownHostBoundsTracker(),this.revokeSignaturePreviews()}))}async saveDraftAsNew(e,t){var i,n,o,l,r,a,s;if(this.previewMode)return null;if(!this.resolvedForm)return null;const d=function(e,t){var i,n;const o=(new Date).toISOString();return{commentId:L(),userDisplayName:null!==(i=t.displayName)&&void 0!==i?i:null,userId:null!==(n=t.id)&&void 0!==n?n:null,timestamp:o,editedTimestamp:o,isDeleted:!1,value:null!=e?e:""}}(t,{id:null!==(n=null===(i=this.currentUser)||void 0===i?void 0:i.id)&&void 0!==n?n:null,displayName:null!==(l=null===(o=this.currentUser)||void 0===o?void 0:o.displayName)&&void 0!==l?l:null});this.commentsState=function(e,t,i){var n;const o=null!==(n=e.byQuestionId[t])&&void 0!==n?n:[];return Object.assign(Object.assign({},e),{byQuestionId:Object.assign(Object.assign({},e.byQuestionId),{[t]:[...o,i]}),draftByQuestionId:Object.assign(Object.assign({},e.draftByQuestionId),{[t]:null}),editingCommentIdByQuestionId:Object.assign(Object.assign({},e.editingCommentIdByQuestionId),{[t]:null})})}(this.commentsState,e,d);const u=null===(r=this.submission)||void 0===r?void 0:r.id;if(!u)return d;const c=$e(this.dynamicSections,e);if(!c)return d;try{return await async function(e,t){const i=function(e,t){if(!t.isPublicMode||!t.tenantId)return e;const[i,n=""]=e.split("?",2),o=new URLSearchParams(n);return o.set("tenantId",String(t.tenantId)),`${i}?${o.toString()}`}(`${Be(e)}/${e.isPublicMode?"public":"private"}`,e);await z("POST",i,t,!0)}({submissionId:u,isPublicMode:this.isPublicMode,tenantId:this.tenantId},{sectionKey:c.sectionKey,questionKey:c.questionKey,value:null!==(a=d.value)&&void 0!==a?a:"",commentId:d.commentId}),d}catch(t){return console.error("[udp-question-form-renderer] postComment failed:",t),this.commentsState=Ae(this.commentsState,e,d.commentId,{isDeleted:!0}),null===(s=this.enqueueSnackbar)||void 0===s||s.call(this,"Failed to save comment.",{variant:"error"}),null}}async flushOpenDrafts(){const e=Object.entries(this.commentsState.draftByQuestionId);for(const[t,i]of e)null!=i&&(0!==i.trim().length?await this.saveDraft(t):this.commentsState=Le(this.commentsState,t,null))}getFollowUpOptionsForQuestion(e){if(!e||!this.resolvedForm)return this.followUpFormsList;const t=$e(this.dynamicSections,e);if(!t)return this.followUpFormsList;const i=function(e){const t=e.fieldProperties;return Array.isArray(null==t?void 0:t.followUpFormIds)?t.followUpFormIds.map((e=>{if("string"==typeof e)return e;if(e&&"object"==typeof e){if("string"==typeof e.value)return e.value;if("string"==typeof e.id)return e.id}return""})).filter((e=>e.length>0)):[]}(t.question);if(0===i.length)return this.followUpFormsList;const n=new Set(i.map(String));return this.followUpFormsList.filter((e=>n.has(e.value)))}async openStampedFollowUp(e){var t,i;try{const i=`${j.productV1ApiUrl}/UdpFormSubmission/${e}/Full`,n=await z("GET",i);if(!(null==n?void 0:n.formId))return void(null===(t=this.enqueueSnackbar)||void 0===t||t.call(this,"Could not open the linked follow-up form.",{variant:"error"}));if("undefined"!=typeof window&&this.submission){const t=Re({currentPathname:window.location.pathname,parentFormId:this.submission.formId,childFormId:n.formId,childSubmissionId:e});window.open(t,"_blank")}}catch(e){console.error("[udp-question-form-renderer] open follow-up failed:",e),null===(i=this.enqueueSnackbar)||void 0===i||i.call(this,"Could not open the linked follow-up form.",{variant:"error"})}}async fetchLatestFormVersion(e){var t;try{const i=`${j.productV1ApiUrl}/UdpForm/${e}/describe`,n=await z("GET",i);return null!==(t=null==n?void 0:n.version)&&void 0!==t?t:null}catch(e){return null}}render(){var e;if(this.isLoading)return i(n,null,i("udp-container",{"max-width":"md"},i("udp-text",{variant:"body1"},"Loading form…")));if(this.publicModeError)return i(n,null,i("udp-container",{"max-width":"md"},i("udp-text",{variant:"body1"},this.publicModeError)));if(this.loadError)return i(n,null,i("udp-container",{"max-width":"md"},i("udp-text",{variant:"body1"},this.loadError)));if(!this.resolvedForm)return i(n,null,i("udp-container",{"max-width":"md"},i("udp-text",{variant:"body1"},"No form to render. Pass ",i("code",null,"udpf_formId")," and ",i("code",null,"udpf_formVersion")," ","in the URL.")));const t=!this.isPublicMode&&function(e){for(const t of e.sections)for(const e of t.questions)if(ze(e))return!0;return!1}(this.resolvedForm)?{adapter:{onLaunch:this.handleLaunchFollowUpForm,getStampedChildId:this.getFollowUpStampedChildId},dialog:{isOpen:this.followUpPickerOpen,options:this.getFollowUpOptionsForQuestion(this.followUpPickerQuestionId),selectedFormId:this.followUpPickerSelectedFormId,isLoading:this.followUpFormsListLoading,isLaunching:this.followUpLaunching,onSelect:this.handleFollowUpSelect,onLaunch:()=>{this.handleFollowUpLaunch()},onClose:this.handleFollowUpClose}}:null,o=function(e){const t=Ue.get(e);if(t)return t;const i=[];for(const t of e.sections)for(const e of t.questions)Te(e)&&i.push({section:t,question:e});return Ue.set(e,i),i}(this.resolvedForm).length>0?{state:this.commentsState,adapter:{getCount:this.getCommentCount,isExpanded:this.isCommentsPanelExpanded,onToggle:this.toggleQuestionComments},handlers:{onOpenDraft:this.openDraft,onChangeDraft:this.changeDraft,onSaveDraft:e=>{this.saveDraft(e)},onCancelDraft:this.cancelDraft,onEdit:this.editComment,onDelete:(e,t)=>{this.deleteComment(e,t)}}}:null;return i(n,null,function(e){var t,n,o,l,r,a,s;const{loadedForm:d,templateOverrides:u,initialValues:c,onSubmit:p,validate:m,onFormComponentRef:f,submission:h,currentUser:v,highlightedQuestionId:b,formReadOnly:g,previewMode:x,signaturePreviewUrls:w,autosaveStatus:S="idle",lastSavedAt:k=null,progress:_,onSubmitClick:q,comments:O,followUpForms:C,onAddSection:F,onDeleteSection:I,domainFilters:j}=e,D=null!==(t=e.dynamicSections)&&void 0!==t?t:Se({loadedForm:d,submission:h}),P={loadedForm:d,submission:h,currentUser:v,highlightedQuestionId:null!=b?b:null,formReadOnly:!0===g,previewMode:!0===x,values:!0===g?c:void 0,signaturePreviewUrls:w,commentsAdapter:null!==(n=null==O?void 0:O.adapter)&&void 0!==n?n:null,comments:O?{state:O.state,currentUserId:null!==(o=null==v?void 0:v.id)&&void 0!==o?o:null,handlers:O.handlers}:null,followUpFormsAdapter:null!==(l=null==C?void 0:C.adapter)&&void 0!==l?l:null,domainFilters:j},N=(null!==(r=null==u?void 0:u.formName)&&void 0!==r?r:"").trim()||d.form.name,L=(null!==(a=null==u?void 0:u.formDescription)&&void 0!==a?a:"").trim()||d.form.description,A=d.form.styleOverrides,$={};(null===(s=null==A?void 0:A.background)||void 0===s?void 0:s.backgroundColor)&&($.backgroundColor=A.background.backgroundColor);const T={};return(null==A?void 0:A.headerBackgroundColor)&&(T.backgroundColor=A.headerBackgroundColor),i("div",{class:"renderer-layout",style:$},i("div",{class:"renderer-layout__form"},i("udp-form-component",{ref:f,formId:ut,initialValues:c,submitHandler:p,validate:m,deriveFieldValidators:!1,errorDisplay:"submitFailed"},i("udp-flexbox",{display:"flex",direction:"column",wrap:"nowrap",gap:"lg"},N&&i("udp-fluent-card",{appearance:"filled",class:"form-title-card",style:T},i("udp-flexbox",{display:"flex",direction:"column",gap:"sm",class:"form-title-card__content"},i("udp-text",{variant:"title2"},N),L&&i("udp-text",{variant:"body1"},L))),D.map(((e,t)=>{const n=D[t+1];return function(e){var t,n;const{section:o,context:l,isLastInGroup:r,onAddSection:a,onDeleteSection:s}=e,d=o.schemaSection,u=!0===(null===(t=d.sectionProperties)||void 0===t?void 0:t.isRepeatable),c=u&&!0===r&&null!=a&&!0!==l.formReadOnly&&!0!==l.previewMode,p=u&&!o.isOriginal&&null!=s&&!0!==l.formReadOnly&&!0!==l.previewMode;return i("udp-fluent-card",{key:o.instanceId,appearance:"filled"},i("udp-flexbox",{slot:"header",display:"flex",direction:"row",align:"center",gap:"sm"},i("udp-flexbox",{display:"flex",direction:"column",gap:"xs",grow:"1"},d.title&&i("udp-flexbox",{display:"flex",direction:"row",gap:"xs",align:"center"},i("udp-text",{variant:"subtitle1"},d.title),!o.isOriginal&&i("udp-fluent-badge",{appearance:"outline",color:"subtle",size:"small"},"Copy ",o.suffix)),d.sectionText&&i("udp-text",{variant:"body2"},d.sectionText)),p&&i("udp-tooltip",{content:"Delete this copy",positioning:"below"},i("udp-fluent-icon-button",{iconName:"delete",size:"small",appearance:"subtle",ariaLabel:`Delete copy ${o.suffix} of ${null!==(n=d.title)&&void 0!==n?n:"section"}`,onClick:()=>null==s?void 0:s(o.instanceId)}))),!0===l.formReadOnly?i("udp-detail-list",{layout:"stack",dividers:"row",density:"default"},o.questions.map((e=>st({question:e.schemaQuestion,context:l,fieldKey:e.fieldKey})))):i("udp-flexbox",{display:"flex",direction:"column",wrap:"nowrap",gap:"md"},o.questions.map((e=>st({question:e.schemaQuestion,context:l,fieldKey:e.fieldKey})))),c&&i("udp-flexbox",{slot:"footer",display:"flex",direction:"row",justify:"flex-start"},i("udp-fluent-button",{appearance:"subtle",startIconName:"add",onClick:()=>null==a?void 0:a(d.id)},"Repeat Section")))}({section:e,context:P,isLastInGroup:!n||n.schemaSection.id!==e.schemaSection.id,onAddSection:F,onDeleteSection:I})})))),!g&&function(e){var t,n;const{progress:o,autosaveStatus:l,lastSavedAt:r,onSubmitClick:a}=e,s=null!==(t=null==o?void 0:o.answered)&&void 0!==t?t:0,d=null!==(n=null==o?void 0:o.total)&&void 0!==n?n:0,u=d>0?d:1,c=d>0&&s===d?"success":"info";return i("div",{class:"form-footer"},i("div",{class:"form-footer__inner"},i("div",{class:"form-footer__progress"},i("udp-text",{variant:"caption1",class:"form-footer__progress-label"},s," of ",d," answered"),i("udp-progress-bar",{class:"form-footer__progress-bar",thickness:"medium",shape:"rounded",validationState:c,value:s,min:0,max:u})),i("div",{class:"form-footer__actions"},function(e,t){return"saving"===e?i("udp-text",{variant:"caption1"},"Saving…"):"error"===e?i("udp-text",{variant:"caption1"},"Save failed — will retry on next change."):"saved"===e&&t?i("udp-text",{variant:"caption1"},"Saved at ",(n=t,`${String(n.getHours()).padStart(2,"0")}:${String(n.getMinutes()).padStart(2,"0")}`)):i("span",null);var n}(l,r),i("udp-fluent-button",{appearance:"primary",onClick:a},"Submit"))))}({progress:_,autosaveStatus:S,lastSavedAt:k,onSubmitClick:()=>{var e;null==q||q(),null===(e=V.get(ut))||void 0===e||e.requestSubmit()}}),g&&i("div",{class:"form-footer form-footer--read-only"},i("div",{class:"form-footer__inner"},function(e){return i("udp-text",{variant:"caption1"},(null==e?void 0:e.status)===y.Submitted?"Submitted — read-only.":"Read-only.")}(h)))),C&&dt({isOpen:C.dialog.isOpen,options:C.dialog.options,selectedFormId:C.dialog.selectedFormId,isLoading:C.dialog.isLoading,isLaunching:C.dialog.isLaunching,onSelect:C.dialog.onSelect,onLaunch:C.dialog.onLaunch,onClose:C.dialog.onClose}))}({loadedForm:this.resolvedForm,templateOverrides:this.templateOverrides,dynamicSections:this.dynamicSections,initialValues:this.initialValues,onSubmit:this.handleSubmit,validate:this.getValidator(),onFormComponentRef:this.handleFormComponentRef,submission:this.submission,currentUser:this.currentUser,highlightedQuestionId:null!==(e=this.highlightedQuestionId)&&void 0!==e?e:null,formReadOnly:this.isReadOnly,previewMode:this.previewMode,signaturePreviewUrls:this.signaturePreviewUrls,autosaveStatus:this.autosaveStatus,lastSavedAt:this.lastSavedAt,progress:this.progress,onSubmitClick:this.handleSubmitClick,comments:o,followUpForms:t,onAddSection:this.handleAddSection,onDeleteSection:this.handleDeleteSection,domainFilters:this.domainFilters}))}get el(){return o(this)}static get watchers(){return{loadedForm:[{handleLoadedFormChange:0}],highlightedQuestionId:[{handleHighlightedQuestionIdChange:0}],getUserCallback:[{handleGetUserCallbackChange:0}]}}};function pt(e,t){if(Object.is(e,t))return!0;if(null==e||null==t)return!1;if(Array.isArray(e)||Array.isArray(t))return Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every(((e,i)=>pt(e,t[i])));const i=e=>"object"==typeof e&&e.constructor===Object;if(!i(e)||!i(t))return!1;const n=Object.keys(e),o=Object.keys(t);return n.length===o.length&&n.every((i=>Object.prototype.hasOwnProperty.call(t,i)&&pt(e[i],t[i])))}ct.style=":host{display:block;padding:var(--spacingVerticalM) var(--spacingHorizontalL, 16px);padding-bottom:96px}.renderer-layout__form udp-form-component{display:block}.renderer-layout{width:100%;max-width:720px;margin:0 auto}.renderer-layout__form{width:100%}.form-title-card{border-left:4px solid var(--colorBrandStroke1, #2899f5)}.form-title-card__content{padding-block:var(--spacingVerticalS, 8px)}.question-card{position:relative;transition:background-color 160ms ease-out, box-shadow 160ms ease-out;border-radius:var(--borderRadiusMedium, 4px)}.question-card--highlighted{background-color:var(--colorBrandBackground2, rgba(38, 79, 120, 0.08));box-shadow:inset 3px 0 0 0 var(--colorBrandStroke1, #2899f5);animation:udpqf-highlight-pulse 800ms ease-out 1}.question-card__toggles{position:absolute;top:0;right:0;display:inline-flex;align-items:center;gap:var(--spacingHorizontalXS, 4px);z-index:1}.question-card__follow-up-toggle{display:inline-flex;align-items:center;gap:var(--spacingHorizontalXXS, 2px)}.question-card__inline-comments{margin-top:var(--spacingVerticalS, 8px);padding:var(--spacingVerticalS, 8px) var(--spacingHorizontalM, 12px);background-color:var(--colorNeutralBackground2, #fafafa);border-left:2px solid var(--colorNeutralStroke2, #e0e0e0);border-radius:0 var(--borderRadiusMedium, 4px) var(--borderRadiusMedium, 4px) 0}.question-card__inline-comments .comment-thread{cursor:default;padding:0;gap:var(--spacingVerticalXS, 4px)}.question-card__inline-comments .comment-thread:hover,.question-card__inline-comments .comment-thread--focused{background-color:transparent}udp-detail-list-item:has(.question-view__comment-toggle){position:relative}.question-view__comment-toggle{position:absolute;top:0;right:0;z-index:1}@media print{.question-card__toggles,.question-view__comment-toggle,.comment-thread__compose-placeholder,.comment-thread__draft,.comment-item__actions{display:none !important}}@keyframes udpqf-highlight-pulse{0%{background-color:var(--colorBrandBackground2Hover, rgba(38, 79, 120, 0.16))}100%{background-color:var(--colorBrandBackground2, rgba(38, 79, 120, 0.08))}}@media (prefers-reduced-motion: reduce){.question-card,.question-card--highlighted{animation:none;transition:none}}.comment-thread{position:relative;display:flex;flex-direction:column;gap:var(--spacingVerticalXS, 4px);padding:var(--spacingVerticalS, 8px) var(--spacingHorizontalS, 10px);border-radius:var(--borderRadiusSmall, 2px);cursor:pointer;transition:background-color 120ms ease-out}.comment-thread:hover{background-color:var(--colorNeutralBackground1Hover, rgba(0, 0, 0, 0.02))}.comment-thread--focused{background-color:var(--colorBrandBackground2, rgba(38, 79, 120, 0.06))}.comment-thread__header{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--spacingVerticalXXS, 2px)}.comment-thread__label{color:var(--colorNeutralForeground3, #707070);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.comment-thread__empty{color:var(--colorNeutralForeground3, #707070);font-style:italic}.comment-thread__items{display:flex;flex-direction:column}.comment-thread__draft{display:flex;flex-direction:column;gap:var(--spacingVerticalXXS, 2px)}.comment-thread__draft-actions{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;gap:var(--spacingHorizontalXXS, 2px)}.comment-thread__compose-placeholder{align-self:flex-start;margin-top:var(--spacingVerticalXS, 4px)}.comment-item{display:grid;grid-template-columns:24px 1fr;column-gap:var(--spacingHorizontalS, 8px);row-gap:var(--spacingVerticalXXS, 2px);padding:var(--spacingVerticalXS, 4px) 0}.comment-item+.comment-item{padding-top:var(--spacingVerticalS, 8px);margin-top:var(--spacingVerticalXS, 4px);border-top:1px solid var(--colorNeutralStroke3, #f0f0f0)}.comment-item__avatar{grid-column:1;grid-row:1;align-self:start;width:24px;height:24px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;color:var(--colorNeutralForegroundOnBrand, #fff);font-size:var(--fontSizeBase100, 10px);font-weight:var(--fontWeightSemibold, 600);line-height:1;user-select:none}.comment-item__actions{margin-left:auto;display:flex;flex-direction:row;gap:var(--spacingHorizontalXXS, 2px);opacity:0;transition:opacity 120ms ease-out}.comment-item__header{grid-column:2;display:flex;flex-direction:row;align-items:center;gap:var(--spacingHorizontalXS, 4px);min-height:24px}.comment-item__timestamp{color:var(--colorNeutralForeground3, #707070)}.comment-item__body{grid-column:2;white-space:pre-wrap;word-break:break-word}.comment-item:hover .comment-item__actions,.comment-item:focus-within .comment-item__actions{opacity:1}@media (hover: none){.comment-item__actions{opacity:1}}.form-footer{position:fixed;bottom:0;left:var(--udpqf-host-left, 0);width:var(--udpqf-host-width, 100%);z-index:2;background-color:var(--colorNeutralBackground1, #ffffff);border-top:1px solid transparent;box-shadow:var(--shadow4, 0 2px 4px rgba(0, 0, 0, 0.14), 0 0 2px rgba(0, 0, 0, 0.12))}.form-footer__inner{display:flex;flex-direction:row;align-items:center;gap:var(--spacingHorizontalM, 12px);width:100%;max-width:720px;margin:0 auto;padding:var(--spacingVerticalS, 8px) var(--spacingHorizontalL, 16px);box-sizing:border-box}.form-footer--read-only .form-footer__inner{justify-content:center}.form-footer__progress{display:flex;flex-direction:column;gap:var(--spacingVerticalXXS, 2px);flex:1 1 auto;min-width:0}.form-footer__progress-label{color:var(--colorNeutralForeground2, #424242)}.form-footer__progress-bar{display:block;width:100%}.form-footer__actions{display:flex;flex-direction:row;align-items:center;gap:var(--spacingHorizontalM, 12px);flex:0 0 auto}@media print{.form-footer{display:none !important}}.question-view__options{display:flex;flex-direction:column;gap:var(--spacingVerticalXXS, 2px)}.question-view__option{display:flex;flex-direction:row;align-items:center;gap:var(--spacingHorizontalS, 8px);color:var(--colorNeutralForeground3, #616161)}.question-view__option--selected{color:var(--colorNeutralForeground1, #242424);font-weight:var(--fontWeightSemibold, 600)}.question-view__option-mark{flex:0 0 auto;color:var(--colorNeutralForeground4, #707070)}.question-view__option--selected .question-view__option-mark{color:var(--colorCompoundBrandForeground1, #0f6cbd)}.question-view__location{display:flex;flex-direction:column;gap:var(--spacingVerticalS, 8px)}.question-view__signature{display:flex;flex-direction:column;gap:var(--spacingVerticalS, 8px)}.question-view__signature-img{display:block;max-width:360px;max-height:160px;object-fit:contain}.question-view__signature-meta{display:flex;flex-direction:column;gap:0}";const mt=class{constructor(t){e(this,t),this.unit="md"}render(){return i("div",{key:"552fb7775d47571afa2e50cfa96d6e7584b37225",style:{height:"none"===this.unit?"0":`var(--spacingVertical${{none:"None",xxs:"XXS",xs:"XS",sm:"S",md:"M",lg:"L",xl:"XL",xxl:"XXL",xxxl:"XXXL"}[this.unit]})`,display:"block"}})}};export{M as udp_fluent_inline_edit,H as udp_form_version_drawer,ve as udp_question_config_fluent,ct as udp_question_form_renderer,mt as udp_vertical_spacer}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,h as t,H as
|
|
1
|
+
import{r as e,h as t,H as s}from"./index-15aY63VA.js";import"@fluentui/web-components/link.js";const a=class{constructor(t){e(this,t),this.inline=!1}render(){return t(s,{key:"08e8b830253b77621e637f04dcfca8d8b1e1f5dc"},t("fluent-link",{key:"31fdf862e1206da449d671883e580b52cee84e9a",inline:this.inline,href:this.href,target:this.target,download:this.download,hreflang:this.hreflang,ping:this.ping,referrerpolicy:this.referrerpolicy,rel:this.rel,type:this.type},t("slot",{key:"58baae847da87f533feb06d605937ce74ab00615",name:"start",slot:"start"}),t("slot",{key:"2477ea3e39d115cc887a30d3ca0b580079d638f9"}),t("slot",{key:"7ca8d088cc2dcb2e3ea3ed90c6281a051305637b",name:"end",slot:"end"})))}};export{a as udp_fluent_link}
|