@arsedizioni/ars-utils 22.7.5 → 22.7.7
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/fesm2022/arsedizioni-ars-utils-clipper.common.mjs +18 -15
- package/fesm2022/arsedizioni-ars-utils-clipper.common.mjs.map +1 -1
- package/fesm2022/{arsedizioni-ars-utils-clipper.ui-document.component-BKjGXtXa.mjs → arsedizioni-ars-utils-clipper.ui-document.component-vI7C4i2r.mjs} +29 -14
- package/fesm2022/arsedizioni-ars-utils-clipper.ui-document.component-vI7C4i2r.mjs.map +1 -0
- package/fesm2022/arsedizioni-ars-utils-clipper.ui-document.component-xjm4mdUv.mjs +1593 -0
- package/fesm2022/arsedizioni-ars-utils-clipper.ui-document.component-xjm4mdUv.mjs.map +1 -0
- package/fesm2022/arsedizioni-ars-utils-clipper.ui-references.component-CBuJnNIf.mjs +806 -0
- package/fesm2022/arsedizioni-ars-utils-clipper.ui-references.component-CBuJnNIf.mjs.map +1 -0
- package/fesm2022/{arsedizioni-ars-utils-clipper.ui-references.component-CEA_wJTS.mjs → arsedizioni-ars-utils-clipper.ui-references.component-DYojmfsw.mjs} +4 -4
- package/fesm2022/{arsedizioni-ars-utils-clipper.ui-references.component-CEA_wJTS.mjs.map → arsedizioni-ars-utils-clipper.ui-references.component-DYojmfsw.mjs.map} +1 -1
- package/fesm2022/arsedizioni-ars-utils-clipper.ui.mjs +359 -77
- package/fesm2022/arsedizioni-ars-utils-clipper.ui.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-core.date.mjs +6 -6
- package/fesm2022/arsedizioni-ars-utils-core.markdown.mjs +3 -3
- package/fesm2022/arsedizioni-ars-utils-core.mjs +48 -48
- package/fesm2022/arsedizioni-ars-utils-core.validators.mjs +42 -42
- package/fesm2022/arsedizioni-ars-utils-evolution.common.mjs +15 -15
- package/fesm2022/arsedizioni-ars-utils-support.common.mjs +9 -9
- package/fesm2022/arsedizioni-ars-utils-ui.controls.date.mjs +6 -6
- package/fesm2022/arsedizioni-ars-utils-ui.controls.mjs +9 -9
- package/fesm2022/arsedizioni-ars-utils-ui.controls.tree.mjs +3 -3
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.auth.mjs +18 -18
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.mjs +12 -12
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.prompt.mjs +9 -9
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.select.mjs +15 -15
- package/fesm2022/arsedizioni-ars-utils-ui.files.mjs +12 -12
- package/fesm2022/arsedizioni-ars-utils-ui.filters.mjs +3 -3
- package/fesm2022/arsedizioni-ars-utils-ui.help.mjs +9 -9
- package/fesm2022/arsedizioni-ars-utils-ui.mjs +61 -61
- package/fesm2022/arsedizioni-ars-utils-ui.navigation.mjs +3 -3
- package/fesm2022/arsedizioni-ars-utils-ui.notifications.mjs +6 -6
- package/fesm2022/arsedizioni-ars-utils-ui.oauth.mjs +6 -6
- package/fesm2022/arsedizioni-ars-utils-ui.paginator.mjs +3 -3
- package/fesm2022/arsedizioni-ars-utils-ui.shell.mjs +9 -9
- package/fesm2022/arsedizioni-ars-utils-ui.tinymce.mjs +9 -9
- package/package.json +1 -1
- package/types/arsedizioni-ars-utils-clipper.common.d.ts +34 -0
- package/types/arsedizioni-ars-utils-clipper.common.d.ts.map +1 -0
- package/types/arsedizioni-ars-utils-clipper.ui.d.ts +108 -3
- package/types/arsedizioni-ars-utils-clipper.ui.d.ts.map +1 -0
- package/types/arsedizioni-ars-utils-core.d.ts.map +1 -0
- package/types/arsedizioni-ars-utils-core.date.d.ts.map +1 -0
- package/types/arsedizioni-ars-utils-core.markdown.d.ts.map +1 -0
- package/types/arsedizioni-ars-utils-core.validators.d.ts.map +1 -0
- package/types/arsedizioni-ars-utils-evolution.common.d.ts.map +1 -0
- package/types/arsedizioni-ars-utils-support.common.d.ts.map +1 -0
- package/types/arsedizioni-ars-utils-ui.controls.d.ts +1 -1
- package/types/arsedizioni-ars-utils-ui.controls.d.ts.map +1 -0
- package/types/arsedizioni-ars-utils-ui.controls.date.d.ts.map +1 -0
- package/types/arsedizioni-ars-utils-ui.controls.tree.d.ts.map +1 -0
- package/types/arsedizioni-ars-utils-ui.d.ts.map +1 -0
- package/types/arsedizioni-ars-utils-ui.dialogs.auth.d.ts.map +1 -0
- package/types/arsedizioni-ars-utils-ui.dialogs.d.ts.map +1 -0
- package/types/arsedizioni-ars-utils-ui.dialogs.prompt.d.ts.map +1 -0
- package/types/arsedizioni-ars-utils-ui.dialogs.select.d.ts.map +1 -0
- package/types/arsedizioni-ars-utils-ui.files.d.ts.map +1 -0
- package/types/arsedizioni-ars-utils-ui.filters.d.ts.map +1 -0
- package/types/arsedizioni-ars-utils-ui.help.d.ts.map +1 -0
- package/types/arsedizioni-ars-utils-ui.navigation.d.ts +1 -1
- package/types/arsedizioni-ars-utils-ui.navigation.d.ts.map +1 -0
- package/types/arsedizioni-ars-utils-ui.notifications.d.ts.map +1 -0
- package/types/arsedizioni-ars-utils-ui.oauth.d.ts.map +1 -0
- package/types/arsedizioni-ars-utils-ui.paginator.d.ts.map +1 -0
- package/types/arsedizioni-ars-utils-ui.shell.d.ts.map +1 -0
- package/types/arsedizioni-ars-utils-ui.tinymce.d.ts.map +1 -0
- package/types/arsedizioni-ars-utils.d.ts.map +1 -0
- package/fesm2022/arsedizioni-ars-utils-clipper.ui-document.component-BKjGXtXa.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arsedizioni-ars-utils-clipper.ui.mjs","names":[],"sources":["../../../projects/ars-utils/clipper.ui/document-menu/document-menu.component.ts","../../../projects/ars-utils/clipper.ui/document-menu/document-menu.component.html","../../../projects/ars-utils/clipper.ui/search-facets/search-facets.component.ts","../../../projects/ars-utils/clipper.ui/search-facets/search-facets.component.html","../../../projects/ars-utils/clipper.ui/document-manager/document-manager.ts","../../../projects/ars-utils/clipper.ui/documents.ts","../../../projects/ars-utils/clipper.ui/search-result-manager/search-result-manager.ts","../../../projects/ars-utils/clipper.ui/search-free-text-help/search-free-text-help.component.ts","../../../projects/ars-utils/clipper.ui/search-free-text-help/search-free-text-help.component.html","../../../projects/ars-utils/clipper.ui/search-free-text-query-builder/search-free-text-query-builder.component.ts","../../../projects/ars-utils/clipper.ui/search-free-text-query-builder/search-free-text-query-builder.component.html","../../../projects/ars-utils/clipper.ui/search-result-item/search-result-item.component.ts","../../../projects/ars-utils/clipper.ui/search-result-item/search-result-item.component.html","../../../projects/ars-utils/clipper.ui/browser/browser.component.ts","../../../projects/ars-utils/clipper.ui/browser/browser.component.html","../../../projects/ars-utils/clipper.ui/browser/browser-dialog/browser-dialog.component.ts","../../../projects/ars-utils/clipper.ui/browser/browser-dialog/browser-dialog.component.html","../../../projects/ars-utils/clipper.ui/document-index/document-index.component.ts","../../../projects/ars-utils/clipper.ui/document-index/document-index.component.html","../../../projects/ars-utils/clipper.ui/search-calendar/search-calendar.component.ts","../../../projects/ars-utils/clipper.ui/search-calendar/search-calendar.component.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component, Renderer2, computed, inject, input, viewChild } from '@angular/core';\nimport { toObservable, toSignal } from '@angular/core/rxjs-interop';\nimport { EMPTY, switchMap } from 'rxjs';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { MatDividerModule } from '@angular/material/divider';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatMenuModule, MatMenuTrigger } from '@angular/material/menu';\nimport { FlexLayoutModule } from '@arsedizioni/ars-utils/ui';\nimport { ClipperDocumentInfo, ClipperModel, ClipperService, ClipperUtils } from '@arsedizioni/ars-utils/clipper.common';\n\n@Component({\n selector: 'clipper-document-menu',\n templateUrl: './document-menu.component.html',\n styleUrls: ['./document-menu.component.scss'],\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [FlexLayoutModule, MatMenuModule, MatIconModule, MatDividerModule, MatTooltipModule]\n})\nexport class ClipperDocumentMenuComponent {\n\n private readonly rsMenuTrigger = viewChild<MatMenuTrigger>('rsMenuTrigger');\n private readonly aiAssistantMenuTrigger = viewChild<MatMenuTrigger>('aiAssistantMenuTrigger');\n private readonly linksMenuTrigger = viewChild<MatMenuTrigger>('linksMenuTrigger');\n private readonly allMenuTriggers = [\n this.linksMenuTrigger,\n this.rsMenuTrigger,\n this.aiAssistantMenuTrigger,\n ];\n\n private readonly renderer2 = inject(Renderer2);\n private readonly clipperService = inject(ClipperService);\n\n readonly useSelections = input<boolean>(false);\n readonly selectionSource = input<'bag' | 'selection' | 'none' | undefined>('selection');\n\n /**\n * Computed signal that returns the current effective document selection.\n * Re-evaluates when any input signal or the underlying selection model changes.\n */\n protected readonly selection = computed((): ClipperDocumentInfo[] => {\n this.selectionTick(); // track external SelectionModel changes\n if (this.useSelections()) {\n switch (this.selectionSource()) {\n case 'bag': return this.parent()?.clipperService.bag() ?? [];\n case 'selection': return this.parent()?.selection?.all ?? [];\n }\n }\n return [];\n });\n\n readonly parent = input.required<any>();\n /**\n * Emits whenever the parent's SelectionModel changes (relevant only for the 'selection'\n * source; the 'bag' source is already a signal). `toObservable`+`switchMap` re-binds\n * cleanly if `parent` ever changes and removes the manual subscription/afterNextRender.\n */\n private readonly selectionTick = toSignal(\n toObservable(this.parent).pipe(\n switchMap(p => this.selectionSource() === 'selection' ? (p?.selection?.changed ?? EMPTY) : EMPTY),\n ),\n { initialValue: null },\n );\n readonly item = input<ClipperDocumentInfo>();\n readonly isReference = input<boolean>(false);\n readonly isReadable = input<boolean>(true);\n readonly isReadableModel = input<ClipperModel | undefined>(undefined);\n readonly isLawInForce = input<boolean>(false);\n readonly canPrint = input<boolean>(false);\n readonly canFind = input<boolean>(false);\n readonly canUseAIAssistant = input<boolean>(false);\n\n protected readonly canUseAIEditor: boolean = this.clipperService.user?.hasAIEditor ?? false;\n\n readonly canUseRS = input<boolean>(true);\n readonly canOpenDocument = input<boolean>(true);\n\n /** `true` when the current selection source is 'selection' and at least one item is selected. */\n protected readonly canDeselectAll = computed(() =>\n this.selectionSource() === 'selection' && this.selection().length > 0\n );\n /** `true` when operating in bag-management mode. */\n protected readonly canManageBag = computed(() => this.selectionSource() === 'bag');\n /** `true` when opening a document is allowed and exactly one item is selected. */\n protected readonly canOpen = computed(() => this.canOpenDocument() && this.hasSingleSelection());\n /** `true` when at least one item can be sent by email. */\n protected readonly canSendByEmail = computed(() => this.getMultipleSelection().length > 0);\n /** `true` when all selected items are deadline/alert documents and can travel as an ICS file. */\n protected readonly canExportCalendar = computed(() =>\n this.getMultipleSelection().every(\n n => n.model === ClipperModel.Scadenze || n.model === ClipperModel.Segnalazioni\n ) && !this.isReference()\n );\n /** `true` when the selection contains non-Coordinamento items that can be added to working documents. */\n protected readonly canAddToWorkingDocuments = computed(() => {\n if (this.selectionSource() === 'bag') return false;\n const items = this.getMultipleSelection();\n return items.length > 0 && items.every(n => n.model !== ClipperModel.Coordinamento);\n });\n /** `true` when a single non-Coordinamento document is selected and can be saved as PDF. */\n protected readonly canSaveAsPdf = computed(() => {\n const item = this.getSingleSelection();\n return item !== undefined && item.model !== ClipperModel.Coordinamento;\n });\n /** `true` when the selection contains at least one unread document that supports the read state. */\n protected readonly canSetAsRead = computed(() => {\n const items = this.getMultipleSelection();\n return this.isReadable() && (\n items.length > 1 ||\n (items.length === 1 && items[0].isRead !== true &&\n ClipperUtils.isClipperModelReadable(this.isReadableModel() ?? items[0].model))\n );\n });\n /** `true` when the selection contains at least one already-read document that supports the read state. */\n protected readonly canSetAsUnread = computed(() => {\n const items = this.getMultipleSelection();\n return this.isReadable() && (\n items.length > 1 ||\n (items.length === 1 && items[0].isRead === true &&\n ClipperUtils.isClipperModelReadable(this.isReadableModel() ?? items[0].model))\n );\n });\n /** `true` when the Clipper service supports RS and all selected items are RS-enabled. */\n protected readonly canAccessRS = computed(() => {\n const items = this.getMultipleSelection();\n return this.clipperService.supportsRS() && this.canUseRS() && this.parent()?.RS_enabled(items) === true;\n });\n\n /**\n * Returns a single selected document: the bound item if present, or the sole item in the selection list.\n * @returns The selected document, or `undefined` when zero or more than one item is selected.\n */\n protected getSingleSelection(): ClipperDocumentInfo | undefined {\n if (this.item()) {\n return this.item();\n } else if (this.selection().length === 1) {\n return this.selection()[0];\n }\n return undefined;\n }\n\n /**\n * Returns the full effective selection as an array.\n * If a bound item is present it is returned wrapped in a single-element array;\n * otherwise the full selection list is returned.\n * @returns An array of selected documents, or an empty array when nothing is selected.\n */\n protected getMultipleSelection(): ClipperDocumentInfo[] {\n const item = this.item();\n if (item) return [item];\n return this.selection().length > 0 ? this.selection() : [];\n }\n\n /**\n * Returns whether exactly one document is available for single-item operations.\n * @returns `true` if the bound item has a non-empty document ID, or if exactly one item is selected.\n */\n protected hasSingleSelection(): boolean {\n return (this.item()?.documentId?.length ?? 0) > 0 || this.selection().length === 1;\n }\n\n /**\n * Closes all open sub-menu panels, then optionally opens the given trigger's menu.\n * @param trigger - The menu trigger to open after closing others; omit to only close.\n */\n protected showSubMenu(trigger?: MatMenuTrigger): void {\n this.allMenuTriggers.forEach(menuTrigger => {\n const menu = menuTrigger();\n if (menu?.menuOpen) {\n menu.closeMenu();\n this.resetSubMenu(menu);\n }\n });\n trigger?.openMenu();\n }\n\n /**\n * Removes the CDK focus classes from the given trigger element to reset its visual state.\n * @param trigger - The menu trigger whose focus styles to clear.\n */\n protected resetSubMenu(trigger: MatMenuTrigger): void {\n this.renderer2.removeClass(trigger['_element'].nativeElement, 'cdk-focused');\n this.renderer2.removeClass(trigger['_element'].nativeElement, 'cdk-program-focused');\n }\n\n /**\n * Returns the read state of the current item or selection.\n * @returns `0` if unread, `1` if read, `2` if mixed or unknown.\n */\n protected isRead(): number {\n if (this.item()) return this.item()?.isRead === true ? 1 : 0;\n if (this.parent()?.hasAnySelection()) return 2;\n const firstSelection = this.parent()?.getSingleSelection();\n if (firstSelection) {\n return firstSelection.isRead === true ? 1 : 0;\n }\n return 0;\n }\n\n /**\n * Delegates a read/unread state change to the parent component.\n * @param value - `true` to mark as read, `false` to mark as unread.\n */\n protected setRead(value: boolean): void {\n this.parent()?.setRead(value, this.item());\n }\n\n /**\n * Opens the given document, optionally in a new browser window.\n * @param item - The document to open; no-op when `undefined`.\n * @param newWindow - When `true`, opens the document in a new window.\n */\n protected open(item: ClipperDocumentInfo | undefined, newWindow: boolean = false): void {\n if (item?.documentId) {\n this.parent()?.open(item.documentId, undefined, undefined, newWindow);\n }\n }\n\n /**\n * Opens the references panel for the given document in the specified mode.\n * @param item - The document whose references to display; no-op when `undefined`.\n * @param mode - The reference query mode (e.g. 1 = referenced by, 2 = references, 4 = case law).\n */\n protected openReferences(item: ClipperDocumentInfo | undefined, mode: number): void {\n if (item?.documentId) {\n this.parent()?.openReferences(item.documentId, mode);\n }\n }\n}\n","@if (canDeselectAll()) {\r\n<button mat-menu-item (click)=\"parent().selection?.clear()\" [attr.aria-label]=\"'Deseleziona tutti'\"\r\n (mouseenter)=\"showSubMenu()\">\r\n <mat-icon>clear</mat-icon>Deseleziona tutti\r\n</button>\r\n} @else if (canManageBag()) {\r\n<button mat-menu-item (click)=\"parent().openBag()\" [attr.aria-label]=\"'Gestisci documenti di lavoro'\"\r\n (mouseenter)=\"showSubMenu()\">\r\n <mat-icon>work_outline</mat-icon>Gestisci documenti di lavoro\r\n</button>\r\n}\r\n@if (canOpen()) {\r\n<button mat-menu-item [attr.aria-label]=\"'Apri documento'\" (mouseenter)=\"showSubMenu()\"\r\n (click)=\"open(getSingleSelection())\">\r\n <mat-icon></mat-icon>Apri\r\n</button>\r\n<button mat-menu-item [attr.aria-label]=\"'Apri documento in una nuova finestra'\" (mouseenter)=\"showSubMenu()\"\r\n (click)=\"open(getSingleSelection(), true)\">\r\n <mat-icon>open_in_new</mat-icon>Apri in una nuova finestra...\r\n</button>\r\n}\r\n@if (canAddToWorkingDocuments()) {\r\n<button mat-menu-item [attr.aria-label]=\"'Aggiungi ai documenti di lavoro'\"\r\n (click)=\"parent().addItemsToBag(getMultipleSelection())\" (mouseenter)=\"showSubMenu()\">\r\n <mat-icon>work_outline</mat-icon>Aggiungi ai documenti di lavoro\r\n</button>\r\n}\r\n@if(canPrint()) {\r\n<button mat-menu-item (click)=\"parent().print()\" [attr.aria-label]=\"'Stampa documento'\" (mouseenter)=\"showSubMenu()\">\r\n <div fxLayout=\"row\" fxLayoutGap=\"20px\" fxLayoutAlign=\"start center\" fxFill>\r\n <div fxFlex=\"*\" fxLayout=\"row\" fxFill fxLayoutAlign=\"start center\">\r\n <mat-icon>print</mat-icon>\r\n <div>Stampa</div>\r\n </div>\r\n <div class=\"accent small bold\">CTRL+P</div>\r\n </div>\r\n</button>\r\n}\r\n@if(canFind()) {\r\n<button mat-menu-item (click)=\"parent().find()\" [attr.aria-label]=\"'Trova nel documento'\" (mouseenter)=\"showSubMenu()\">\r\n <div fxLayout=\"row\" fxLayoutGap=\"20px\" fxLayoutAlign=\"start center\" fxFill>\r\n <div fxFlex=\"*\" fxLayout=\"row\" fxFill fxLayoutAlign=\"start center\">\r\n <mat-icon>find_in_page</mat-icon>\r\n <div>Trova nel documento</div>\r\n </div>\r\n <div class=\"accent small bold\">CTRL+F</div>\r\n </div>\r\n</button>\r\n}\r\n@if (canSendByEmail()) {\r\n<button mat-menu-item (click)=\"parent().sendItemsTo(getMultipleSelection())\"\r\n [attr.aria-label]=\"'Invia documento per email'\" (mouseenter)=\"showSubMenu()\">\r\n <mat-icon>send</mat-icon>Invia per email\r\n</button>\r\n}\r\n@if (canSaveAsPdf()) {\r\n<button mat-menu-item (click)=\"parent().exportPdf(getSingleSelection())\" (mouseenter)=\"showSubMenu()\"\r\n [attr.aria-label]=\"'Salva documento in pdf'\">\r\n <mat-icon>save_alt</mat-icon>Salva in pdf\r\n</button>\r\n}\r\n@if(canOpen()) {\r\n<button mat-menu-item [attr.aria-label]=\"'Genera un link permanente da utilizzare esternamente'\"\r\n (click)=\"parent().showLink(getSingleSelection())\" (mouseenter)=\"showSubMenu()\">\r\n <mat-icon>link</mat-icon>Link\r\n</button>\r\n<button mat-menu-item [attr.aria-label]=\"'Copia metadati negli appunti'\"\r\n (click)=\"parent().copyMetadataToClipboard(getSingleSelection())\" (mouseenter)=\"showSubMenu()\">\r\n <mat-icon>content_copy</mat-icon>Copia metadati\r\n</button>\r\n}\r\n@if (!isReference() && canOpen()) {\r\n<button mat-menu-item [matMenuTriggerFor]=\"linksMenu\" #linksMenuTrigger=\"matMenuTrigger\"\r\n (mouseenter)=\"showSubMenu(linksMenuTrigger)\" (mouseleave)=\"resetSubMenu(linksMenuTrigger)\">\r\n <mat-icon>compare_arrows</mat-icon>Collegamenti\r\n</button>\r\n<mat-menu #linksMenu=\"matMenu\">\r\n @if (!isReference() && canOpen()) {\r\n <button mat-menu-item [attr.aria-label]=\"'Mostra i documenti richiamati da questo'\"\r\n (click)=\"openReferences(getSingleSelection(), 1)\">\r\n Documenti richiamati\r\n </button>\r\n }\r\n @if (!isReference() && canOpen()) {\r\n <button mat-menu-item [attr.aria-label]=\"'Mostra i documenti che richiamano questo'\"\r\n (click)=\"openReferences(getSingleSelection(), 2)\">\r\n Documenti che richiamano\r\n </button>\r\n }\r\n @if (!isReference() && isLawInForce() && canOpen()) {\r\n <button mat-menu-item [attr.aria-label]=\"'Mostra giurisprudenza'\" (click)=\"openReferences(getSingleSelection(), 4)\">\r\n Juris\r\n </button>\r\n }\r\n @if (!isReference() && isLawInForce() && canOpen()) {\r\n <button mat-menu-item [attr.aria-label]=\"'Mostra modifiche normative'\"\r\n (click)=\"openReferences(getSingleSelection(), 3)\">\r\n Modifiche\r\n </button>\r\n }\r\n</mat-menu>\r\n}\r\n@if (canExportCalendar()) {\r\n@if(useSelections()) {\r\n<button mat-menu-item [attr.aria-label]=\"'Importa in Oultook (iCalandar)'\" (click)=\"parent().exportResults(2)\">\r\n <mat-icon>mail_outline</mat-icon>Importa in Outlook (iCalendar)\r\n</button>\r\n} @else if (item()) {\r\n<button mat-menu-item [attr.aria-label]=\"'Importa in Oultook (iCalandar)'\"\r\n (click)=\"parent().exportItems([item().documentId], null, 2)\">\r\n <mat-icon>mail_outline</mat-icon>Importa in Outlook (iCalendar)\r\n</button>\r\n}\r\n}\r\n@if (canSetAsUnread()) {\r\n<button mat-menu-item [attr.aria-label]=\"'Segna come da leggere'\" (click)=\"setRead(false)\" (mouseenter)=\"showSubMenu()\">\r\n <mat-icon>outlined_flag</mat-icon>Segna come da leggere\r\n</button>\r\n}\r\n@if (canSetAsRead()) {\r\n<button mat-menu-item [attr.aria-label]=\"'Segna come già letto'\" (click)=\"setRead(true)\" (mouseenter)=\"showSubMenu()\">\r\n <mat-icon>flag</mat-icon>Segna come già letto\r\n</button>\r\n}\r\n\r\n\r\n@if (isLawInForce() && canOpen()) {\r\n<button mat-menu-item [attr.aria-label]=\"'Mostra report'\" (click)=\"parent().report(getSingleSelection())\"\r\n (mouseenter)=\"showSubMenu()\">\r\n <mat-icon>assignment</mat-icon>Report\r\n</button>\r\n}\r\n\r\n@if (canUseAIAssistant() && hasSingleSelection()) {\r\n<mat-divider></mat-divider>\r\n<button mat-menu-item matTooltip=\"Assistente IA\" [attr.aria-label]=\"'Assistente IA'\"\r\n [matMenuTriggerFor]=\"aiAssistantMenu\" #aiAssistantMenuTrigger=\"matMenuTrigger\"\r\n (mouseenter)=\"showSubMenu(aiAssistantMenuTrigger)\" (mouseleave)=\"resetSubMenu(aiAssistantMenuTrigger)\">\r\n <mat-icon>borg</mat-icon>\r\n Assistente IA\r\n</button>\r\n<mat-menu #aiAssistantMenu=\"matMenu\">\r\n <button mat-menu-item [attr.aria-label]=\"'Mi riguarda?'\" (click)=\"parent().AI_concernMe(getSingleSelection())\">\r\n Mi riguarda?\r\n </button>\r\n <button mat-menu-item [attr.aria-label]=\"'Di che si tratta?'\" (click)=\"parent().AI_explain(getSingleSelection())\">\r\n Di che si tratta?\r\n </button>\r\n @if (canUseAIEditor) {\r\n <button mat-menu-item [attr.aria-label]=\"'Genera commento tecnico'\"\r\n (click)=\"parent().AI_comment(getSingleSelection())\">\r\n Genera commento tecnico\r\n </button>\r\n <button mat-menu-item [attr.aria-label]=\"'Genera news'\" (click)=\"parent().AI_news(getSingleSelection())\">\r\n Genera news\r\n </button>\r\n }\r\n</mat-menu>\r\n}\r\n\r\n@if (canAccessRS()) {\r\n<mat-divider></mat-divider>\r\n<button mat-menu-item matTooltip=\"Registro & Scadenzario\" [attr.aria-label]=\"'Opzioni di Registro & Scadenzario'\"\r\n [matMenuTriggerFor]=\"rsMenu\" #rsMenuTrigger=\"matMenuTrigger\" (mouseenter)=\"showSubMenu(rsMenuTrigger)\"\r\n (mouseleave)=\"resetSubMenu(rsMenuTrigger)\">\r\n <mat-icon>alarm_on</mat-icon>\r\n Registro e scadenzario\r\n</button>\r\n<mat-menu #rsMenu=\"matMenu\">\r\n <button mat-menu-item [attr.aria-label]=\"'Nuova legge'\" (click)=\"parent().RS_newLaw(getMultipleSelection())\">\r\n Nuova legge\r\n </button>\r\n @if (hasSingleSelection()) {\r\n <button mat-menu-item [attr.aria-label]=\"'Nuova attività'\" (click)=\"parent().RS_newActivity(getSingleSelection())\">\r\n Nuova attività\r\n </button>\r\n }\r\n @if (hasSingleSelection()) {\r\n <button mat-menu-item [attr.aria-label]=\"'Report utilizzo norma'\"\r\n (click)=\"parent().RS_usageReport(getSingleSelection())\">\r\n Report utilizzo norma\r\n </button>\r\n }\r\n</mat-menu>\r\n}","import { ChangeDetectionStrategy, ChangeDetectorRef, Component, inject, input, output } from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatChipsModule } from '@angular/material/chips';\nimport { MatDividerModule } from '@angular/material/divider';\nimport { MatExpansionModule } from '@angular/material/expansion';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { ClipperFacet, ClipperSearchFacet, ClipperSearchFacetGroup, ClipperSearchFacetsSnapshot } from '@arsedizioni/ars-utils/clipper.common';\nimport { FlexLayoutModule } from '@arsedizioni/ars-utils/ui';\n\n\n@Component({\n selector: 'clipper-search-facets',\n templateUrl: './search-facets.component.html',\n styleUrls: ['./search-facets.component.scss'],\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [FlexLayoutModule, MatButtonModule, MatTooltipModule, MatChipsModule, MatIconModule, \n MatDividerModule, MatExpansionModule]\n})\nexport class ClipperSearchFacetsComponent {\n readonly changed = output<ClipperSearchFacetsSnapshot>();\n private readonly changeDetector = inject(ChangeDetectorRef);\n\n protected snapshot: ClipperSearchFacetsSnapshot = new ClipperSearchFacetsSnapshot();\n\n /**\n * Returns whether the current snapshot contains at least one available or applied facet group.\n */\n public hasFacets(): boolean { return this.snapshot.hasFacets; }\n\n readonly handleTooManyResults = input<boolean>(false);\n\n /**\n * Pushes a new set of facet groups into the snapshot and refreshes the view.\n * @param values - The raw facet data returned by the search engine, grouped by type.\n * @param interval - Optional display label for the year-range interval (YEAR facet type).\n */\n update(values?: ClipperSearchFacet[][], interval?: string): void {\n this.snapshot.interval = interval;\n if (values) {\n this.snapshot.groups = [];\n values.forEach(n => {\n const name = n[0].typeName;\n const index = n[0].type;\n const i = this.snapshot.usedGroups.findIndex(n => n.index === index);\n const j = this.snapshot.groups.findIndex(n => n.index === index);\n if (i === -1 && j === -1) {\n this.snapshot.groups.push({\n name: name,\n selectedValue: null,\n selectedValueDescription: null,\n values: n,\n index: index,\n }); \n }\n });\n }\n this.snapshot.hasFacets = this.snapshot.groups.length > 0 || this.snapshot.usedGroups.length > 0; \n this.snapshot.hasMoreFacets = this.snapshot.hasFacets && this.snapshot.groups.length > this.snapshot.usedGroups.length; \n this.changeDetector.markForCheck();\n }\n\n\n\n /**\n * Applies the given facet item as an active filter and emits a `changed` event.\n * @param group - The facet group that owns the selected item.\n * @param item - The facet item chosen by the user.\n */\n protected use(group: ClipperSearchFacetGroup, item: ClipperSearchFacet): void {\n group.selectedValue = item.value;\n group.selectedValueDescription = item.title;\n const j = this.snapshot.groups.findIndex(n => n.index === group.index);\n if (j !== -1) {\n this.snapshot.groups.splice(j, 1);\n // Insert into usedGroups in ascending index order without mutating while iterating.\n const insertAt = this.snapshot.usedGroups.findIndex(n => n.index > group.index);\n if (insertAt !== -1) {\n this.snapshot.usedGroups.splice(insertAt, 0, group);\n } else {\n this.snapshot.usedGroups.push(group);\n }\n }\n this.apply();\n }\n\n /**\n * Removes an active facet filter from the selection and optionally emits a `changed` event.\n * @param group - The applied facet group to dismiss.\n * @param apply - When `true` (default), emits the `changed` event to trigger a new search.\n */\n protected dismiss(group: ClipperSearchFacetGroup, apply: boolean = true): void {\n group.selectedValue = undefined;\n group.selectedValueDescription = undefined;\n const i = this.snapshot.usedGroups.findIndex(n => n.index === group.index);\n if (i !== -1) {\n this.snapshot.usedGroups.splice(i, 1);\n // Re-insert into groups in ascending index order without mutating while iterating.\n const insertAt = this.snapshot.groups.findIndex(n => n.index > group.index);\n if (insertAt !== -1) {\n this.snapshot.groups.splice(insertAt, 0, group);\n } else {\n this.snapshot.groups.push(group);\n }\n }\n if (apply) {\n this.apply();\n }\n }\n\n /**\n * Builds and emits the current `ClipperSearchFacetsSnapshot` after resolving each applied\n * facet group's filter value into the corresponding snapshot date/sector/author/type fields.\n */\n private apply(): void {\n if (this.snapshot.usedGroups.length > 0) {\n this.snapshot.usedGroups.forEach(n => {\n if (n.index === ClipperFacet.Year) {\n if (n.selectedValue) {\n this.snapshot.fromDate = new Date(parseInt(n.selectedValue), 0, 1, 12, 0, 0);\n this.snapshot.toDate = new Date(parseInt(n.selectedValue), 11, 31, 12, 0, 0);\n } else {\n this.snapshot.fromDate = undefined;\n this.snapshot.toDate = undefined;\n }\n } else if (n.index === ClipperFacet.Sector) {\n this.snapshot.sector = n.selectedValue ?? null;\n } else if (n.index === ClipperFacet.Author) {\n this.snapshot.author = n.selectedValue ?? null;\n } else if (n.index === ClipperFacet.DocumentType) {\n this.snapshot.type = n.selectedValue ?? null;\n } else if (n.index === ClipperFacet.Article) {\n this.snapshot.anchor = n.selectedValue ?? null;\n } else if (n.index === ClipperFacet.Reason) {\n this.snapshot.reason = n.selectedValue ?? null;\n }\n });\n }\n if (this.snapshot.groups.length > 0) {\n this.snapshot.groups.forEach(n => {\n if (n.index === ClipperFacet.Year) {\n this.snapshot.fromDate = undefined;\n this.snapshot.toDate = undefined;\n } else if (n.index === ClipperFacet.Sector) {\n this.snapshot.sector = undefined;\n } else if (n.index === ClipperFacet.Author) {\n this.snapshot.author = undefined;\n } else if (n.index === ClipperFacet.DocumentType) {\n this.snapshot.type = undefined;\n } else if (n.index === ClipperFacet.Article) {\n this.snapshot.anchor = undefined;\n } else if (n.index === ClipperFacet.Reason) {\n this.snapshot.reason = undefined;\n }\n });\n }\n this.changed.emit(this.snapshot);\n }\n\n /**\n * Dismisses one or all applied facet groups and emits a `changed` event if any were removed.\n * @param index - The group index to clear, or `-1` to clear all applied groups at once.\n * @returns The number of groups that were dismissed.\n */\n protected clear(index: number = -1): number {\n let dismissed = 0;\n // Snapshot the list first to avoid mutating usedGroups while iterating it.\n const toRemove = this.snapshot.usedGroups.filter(n => index === -1 || index === n.index);\n toRemove.forEach(n => {\n if (n.index === ClipperFacet.Year) {\n this.snapshot.fromDate = undefined;\n this.snapshot.toDate = undefined;\n } else if (n.index === ClipperFacet.Sector) {\n this.snapshot.sector = undefined;\n } else if (n.index === ClipperFacet.Author) {\n this.snapshot.author = undefined;\n } else if (n.index === ClipperFacet.DocumentType) {\n this.snapshot.type = undefined;\n } else if (n.index === ClipperFacet.Article) {\n this.snapshot.anchor = undefined;\n } else if (n.index === ClipperFacet.Reason) {\n this.snapshot.reason = undefined;\n }\n this.dismiss(n, false);\n dismissed++;\n });\n if (dismissed) {\n this.changed.emit(this.snapshot);\n }\n return dismissed;\n }\n\n /**\n * Resets all facet state: clears every applied/available group and all derived filter fields.\n */\n reset(): void {\n this.snapshot.groups = [];\n this.snapshot.usedGroups = [];\n this.snapshot.hasFacets = false;\n this.snapshot.fromDate = undefined;\n this.snapshot.toDate = undefined;\n this.snapshot.sector = undefined;\n this.snapshot.author = undefined;\n this.snapshot.anchor = undefined;\n this.snapshot.type = undefined;\n this.snapshot.reason = undefined;\n }\n\n /**\n * Restores a previously serialised facets snapshot and refreshes the view.\n * @param data - The snapshot to restore.\n */\n restore(data: ClipperSearchFacetsSnapshot): void {\n if (data) {\n this.snapshot = data;\n this.changeDetector.markForCheck();\n }\n }\n\n /**\n * Returns the current facets snapshot for external serialisation (e.g. save/restore cycle).\n * @returns The current `ClipperSearchFacetsSnapshot`.\n */\n save(): ClipperSearchFacetsSnapshot {\n return this.snapshot;\n }\n}\n","<div fxLayout=\"column\" fxFill class=\"facets-container scroll-hidden\">\r\n @if (snapshot.usedGroups.length > 0) {\r\n <div class=\"facets-selection\">\r\n <mat-chip-set aria-label=\"Selezione\">\r\n @for (ug of snapshot.usedGroups; track $index) {\r\n <mat-chip (removed)=\"dismiss(ug)\" [matTooltip]=\"ug.selectedValueDescription ?? ''\" matTooltipPosition=\"above\">\r\n {{ug.selectedValueDescription}}\r\n <button matChipRemove [attr.aria-label]=\"'Rimuovi ' + ug.name\" [matTooltip]=\"'Rimuovi ' + ug.name\">\r\n <mat-icon>cancel</mat-icon>\r\n </button>\r\n </mat-chip>\r\n }\r\n </mat-chip-set>\r\n <mat-divider class=\"divider\"></mat-divider>\r\n </div>\r\n }\r\n <div fxFlex=\"*\" class=\"scroll-auto facets-items-container\">\r\n @if (snapshot.groups.length > 0) {\r\n @for (group of snapshot.groups; track group.index; let i = $index) {\r\n <mat-accordion multi displayMode=\"flat\">\r\n <mat-expansion-panel class=\"accordion-panel mat-elevation-z0 \" [expanded]=\"i == 0\">\r\n <mat-expansion-panel-header class=\"accordion-header\" [attr.aria-label]=\"group.name\">\r\n <mat-panel-title>\r\n @if (group.index == 2 && snapshot.interval) {\r\n {{snapshot.interval}} ({{group.values.length}})\r\n } @else {\r\n {{group.name}} ({{group.values.length}})\r\n }\r\n </mat-panel-title>\r\n </mat-expansion-panel-header>\r\n <nav class=\"facets-items\">\r\n <ul>\r\n @for (item of group.values; track $index) {\r\n <li (click)=\"use(group, item)\" [attr.aria-label]=\"item.title\">\r\n <div fxLayout=\"row\" fxLayoutGap=\"10px\" fxFill>\r\n <div fxFlex=\"*\" fxFlexAlign=\"center\" class=\"truncated\">\r\n <div class=\"truncated\">{{item.title}}</div>\r\n </div>\r\n <div fxLayoutAlign=\"end\" fxFlexAlign=\"center\">\r\n {{!handleTooManyResults() && snapshot.hasTooManyResults ? '~' : ''}}{{item.count}}\r\n </div>\r\n </div>\r\n </li>\r\n }\r\n </ul>\r\n </nav>\r\n </mat-expansion-panel>\r\n </mat-accordion>\r\n }\r\n } @else if (snapshot.hasFacets && !snapshot.hasMoreFacets) {\r\n <div class=\"facets-message\">\r\n <p class=\"small\"><i>Tutte le opzioni sono state selezionate</i></p>\r\n </div>\r\n }\r\n </div>\r\n</div>","import { Clipboard } from '@angular/cdk/clipboard';\r\nimport { ChangeDetectionStrategy, Component, inject, output, signal } from '@angular/core';\r\nimport { ClipperDocumentInfo, ClipperExportDocumentsParams, ClipperMessages, ClipperModel, ClipperModule, ClipperQueryReferencesMode, ClipperSearchParams, ClipperSendDocumentsByEmailParams, ClipperService } from '@arsedizioni/ars-utils/clipper.common';\r\nimport { BroadcastService, SystemUtils } from '@arsedizioni/ars-utils/core';\r\nimport { DialogResult } from '@arsedizioni/ars-utils/ui';\r\nimport { DialogService } from '@arsedizioni/ars-utils/ui.dialogs';\r\nimport { SelectableItem, SelectDialogDelete, SendToPopulateData } from '@arsedizioni/ars-utils/ui';\r\nimport { SendToDialogComponent } from '@arsedizioni/ars-utils/ui.dialogs.select';\r\nimport saveAs from 'file-saver';\r\nimport { finalize } from 'rxjs';\r\n\r\n\r\n@Component({\r\n template: '<div></div>',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class ClipperDocumentManager {\r\n readonly populateContacts = output<SendToPopulateData>();\r\n protected readonly clipboard = inject(Clipboard);\r\n public readonly clipperService = inject(ClipperService);\r\n protected readonly broadcastService = inject(BroadcastService);\r\n protected readonly dialogService = inject(DialogService);\r\n protected readonly canHandleTooManyResults = signal<boolean>(false);\r\n protected readonly canPopulateContacts = signal<boolean>(false);\r\n\r\n \r\n /**\r\n * Exports a document in PDF format, after asking for confirmation.\r\n * @param item - The document to export.\r\n */\r\n exportPdf(item: ClipperDocumentInfo): void {\r\n if (!this.clipperService.loggedIn()) return;\r\n if (!item) return;\r\n this.dialogService\r\n .confirm(\"Confermi l'esportazione?\", 'Attenzione!')\r\n .componentInstance.choosen.subscribe((data: DialogResult) => {\r\n if (data.result === 'ok') {\r\n const id = item.id ?? item.documentId;\r\n this.dialogService.busy('Esportazione in corso...');\r\n this.clipperService.documents.exportPdf(id)\r\n .pipe(finalize(() => this.dialogService.clearBusy()))\r\n .subscribe(r => {\r\n saveAs(r, (item.title1 ?? id) + '.pdf');\r\n });\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Exports the current document list (or only the selected documents) as CSV or ICS.\r\n * @param documentIds - The list of document IDs to export; if empty, the full search result is exported.\r\n * @param searchParams - The search parameters used to identify the full result set when no IDs are provided.\r\n * @param format - The export format: 1 = list (CSV), 2 = deadlines (ICS).\r\n */\r\n exportItems(\r\n documentIds: string[] | undefined,\r\n searchParams: ClipperSearchParams | undefined = undefined,\r\n format: number = 1): void {\r\n if (!this.clipperService.loggedIn()) return;\r\n const model: ClipperExportDocumentsParams = { ids: documentIds ?? [], query: null, format: format };\r\n if (!model.ids || model.ids.length === 0) {\r\n model.query = searchParams;\r\n }\r\n this.dialogService.busy('Salvataggio in corso...');\r\n this.clipperService.documents.export(model)\r\n .pipe(finalize(() => this.dialogService.clearBusy()))\r\n .subscribe(r => {\r\n if (r.type === 'application/json') {\r\n r.text().then(json => this.dialogService.error(JSON.parse(json).message));\r\n } else {\r\n if (format === 1) {\r\n saveAs(r, 'elenco_' + SystemUtils.formatDate(new Date(), 'yyyyMMddhhmmss') + '.csv');\r\n } else {\r\n saveAs(r, 'scadenze_' + SystemUtils.formatDate(new Date(), 'yyyyMMddhhmmss') + '.ics');\r\n }\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Exports a single document's deadline as an ICS file.\r\n * @param item - The document whose deadline to export.\r\n */\r\n exportDeadline(item: ClipperDocumentInfo): void {\r\n this.exportItems([item.documentId], undefined, 2);\r\n }\r\n\r\n /**\r\n * Sends a broadcast message to add the given documents to the working-documents set.\r\n * @param items - The list of documents to add.\r\n */\r\n addItemsToWorkingDocuments(items: ClipperDocumentInfo[]): void {\r\n this.broadcastService.sendMessage(ClipperMessages.COMMAND_WORKING_ADD, items);\r\n }\r\n\r\n /**\r\n * Sends a request to the Clipper service to add the given documents to the bag.\r\n * @param items - The list of documents to add.\r\n */\r\n addItemsToBag(items: ClipperDocumentInfo[]): void {\r\n if (!this.clipperService.loggedIn()) return;\r\n this.clipperService.documents.addToBag(items?.map(n => n.documentId ?? n.id) ?? []);\r\n }\r\n\r\n\r\n /**\r\n * Copies the document's metadata (ID, titles, number, date, origin) as a tab-separated string to the clipboard.\r\n * @param item - The document whose metadata to copy.\r\n */\r\n copyMetadataToClipboard(item: ClipperDocumentInfo): void {\r\n if (!item || item.model === ClipperModel.Coordinamento) return;\r\n let meta =\r\n (item.id ?? item.documentId) + '\\t' +\r\n (item.title1?.replaceAll(\"\\r\\n\", \" \") ?? '') + '\\t';\r\n if (item.title2)\r\n meta += item.title2.replaceAll(\"\\r\\n\", \" \");\r\n meta += '\\t';\r\n if (item.number)\r\n meta += item.number;\r\n meta += '\\t';\r\n if (item.publishingDate) {\r\n meta += SystemUtils.formatDate(new Date(item.publishingDate));\r\n } else if (item.date) {\r\n meta += SystemUtils.formatDate(new Date(item.date));\r\n }\r\n meta += '\\t';\r\n if (item.originDescription)\r\n meta += item.originDescription;\r\n this.clipboard.copy(meta);\r\n this.dialogService.toast(\"Metadati copiati negli appunti.\");\r\n }\r\n\r\n /**\r\n * Displays a dialog with a shareable permalink for the given document.\r\n * @param item - The document to show the permalink for.\r\n */\r\n showLink(item: ClipperDocumentInfo): void {\r\n if (!item) return;\r\n const id = item.id ?? item.documentId;\r\n if (!id) return;\r\n const channels = item.channelName\r\n ? 'Canali: ' + item.channelName + '<br>'\r\n : '';\r\n const origin = item.origin\r\n ? `Origine: ${item.origin} - ${item.originDescription ?? ''}<br>`\r\n : '';\r\n const topics = item.topics\r\n ? 'Argomenti: ' + item.topics.replaceAll('o', '.') + '<br>'\r\n : '';\r\n const taxonomy = item.taxonomyPath\r\n ? 'Tassonomia:<br> - ' + item.taxonomyPath.replaceAll('\\r\\n', '<br> - ') + '<br>'\r\n : '';\r\n const message =\r\n \"<p >Il link che trovi qui sotto è un riferimento diretto al documento selezionato.</p>\" +\r\n \"<p >Lo puoi utilizzare nella tua documentazione o inviarlo per email ad un tuo collega. La persona che desidererà visualizzare il documento dovrà necessariamente essere un utente abbonato.</p>\" +\r\n \"<p >Seleziona e copia (fai CTRL+C) il link qui sotto.</p>\" +\r\n \"<div class='small accent'>\" +\r\n 'https://clipper.arsedizioni.it/?id=' +\r\n id +\r\n '</div>' +\r\n '<br>' +\r\n '<hr>' +\r\n '<p class=\"small\">' +\r\n channels +\r\n origin +\r\n topics +\r\n taxonomy +\r\n '</p>';\r\n\r\n this.dialogService.info(message, 'Copia link', 'Chiudi');\r\n }\r\n\r\n /**\r\n * Opens a dialog to send document links by email to one or more recipients.\r\n * @param items - The list of documents to send.\r\n */\r\n sendItemsTo(items: ClipperDocumentInfo[]): void {\r\n if (!this.clipperService.loggedIn()) return;\r\n if (!items || items.length === 0) return;\r\n const d = this.dialogService.open(SendToDialogComponent, {\r\n ariaLabel: 'invia documenti per email',\r\n autoFocus: 'dialog',\r\n restoreFocus: false,\r\n disableClose: false,\r\n closeOnNavigation: false,\r\n data: {\r\n info:'Puoi inviare i documenti a chi vuoi ma, per poterli visualizzare, è necessario essere un utente abbonato.',\r\n count: items.length,\r\n canPopulate: this.canPopulateContacts(),\r\n },\r\n minWidth: '375px',\r\n maxWidth: '600px',\r\n width: '100%',\r\n });\r\n d.componentInstance.done\r\n .subscribe(data => {\r\n const params: ClipperSendDocumentsByEmailParams = {\r\n recipients: data.recipients,\r\n subject: data.subject,\r\n text: data.text,\r\n ids: items?.map(n => n.documentId ?? n.id) ?? []\r\n } as ClipperSendDocumentsByEmailParams;\r\n this.dialogService.busy('Invio in corso...');\r\n this.clipperService.documents.sendTo(params)\r\n .pipe(finalize(() => this.dialogService.clearBusy()))\r\n .subscribe(r => {\r\n if (!r.success) {\r\n this.dialogService.error(r.message);\r\n } else {\r\n this.dialogService.toast('Invio completato con successo.');\r\n d.close();\r\n }\r\n });\r\n });\r\n d.componentInstance.populate\r\n .subscribe(data => {\r\n this.populateContacts.emit(data);\r\n });\r\n }\r\n\r\n /**\r\n * Downloads the document's HTML report.\r\n * @param documentId - The ID of the document.\r\n * @param title - Optional display title used as the file name.\r\n */\r\n openReport(documentId: string, title?: string): void {\r\n if (!this.clipperService.loggedIn()) return;\r\n if (!documentId) return;\r\n this.clipperService.documents.report(documentId)\r\n .pipe(finalize(() => this.dialogService.clearBusy()))\r\n .subscribe(r => {\r\n saveAs(r, (title ? title : documentId) + '.html');\r\n });\r\n }\r\n\r\n /**\r\n * Opens a document for display. Override in subclasses to provide the actual implementation.\r\n * @param _documentId - The document ID.\r\n * @param _query - The search query string.\r\n * @param _queryChunks - Pipe-separated highlight chunks (e.g. \"|1|2|3...\").\r\n * @param _newWindow - When true, opens the document in a new browser window.\r\n */\r\n open(\r\n _documentId?: string,\r\n _query?: string,\r\n _queryChunks?: string,\r\n _newWindow?: boolean): void {\r\n }\r\n\r\n /**\r\n * Downloads the HTML report for a normativa/scadenze document.\r\n * @param item - The document to report on.\r\n */\r\n report(item: ClipperDocumentInfo): void {\r\n if (!item) return;\r\n if (item.model !== ClipperModel.NormativaVigente && item.model !== ClipperModel.Scadenze) {\r\n this.dialogService.info(\"Questa funzionalità non è disponibile per questo tipo di documento.\");\r\n return;\r\n } else {\r\n this.openReport(item.documentId, item.title1);\r\n }\r\n }\r\n\r\n /**\r\n * Opens the references dialog for the given document.\r\n * @param documentId - The ID of the document whose references to display.\r\n * @param mode - The reference mode (e.g. ReferencesIn, ReferencesOut).\r\n */\r\n openReferences(documentId?: string, mode: ClipperQueryReferencesMode = ClipperQueryReferencesMode.ReferencesIn): void {\r\n if (!documentId) return;\r\n import('../references/references.component').then(({ ClipperReferencesComponent }) => {\r\n const d = this.dialogService.open(ClipperReferencesComponent, {\r\n ariaLabel: 'riferimenti legati al documento',\r\n autoFocus: 'dialog',\r\n restoreFocus: false,\r\n disableClose: false,\r\n closeOnNavigation: false,\r\n data: { \r\n documentId: documentId, \r\n mode: mode, \r\n canHandleTooManyResults: this.canHandleTooManyResults() \r\n },\r\n minWidth: '375px',\r\n maxWidth: '1200px',\r\n width: '100%',\r\n height: '100%',\r\n });\r\n d.afterClosed()\r\n .subscribe((r: { documentId: string }) => {\r\n if (r && r.documentId) this.open(r.documentId);\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * Opens a dialog to manage the documents in the working bag (view, select, delete).\r\n */\r\n async openBag(): Promise<void> {\r\n const items: SelectableItem[] = [];\r\n this.clipperService.bag().forEach(n => {\r\n const title = n.title1 ?? n.title2 ?? '';\r\n items.push({\r\n template: title,\r\n bag: n,\r\n searchBag: { name: title },\r\n });\r\n });\r\n const d = await this.dialogService.select({\r\n title: 'Gestisci documenti di lavoro',\r\n multipleSelection: false,\r\n mustSelect: false,\r\n okCaption: 'SELEZIONA',\r\n items: items,\r\n canDelete: true,\r\n canView: true,\r\n });\r\n d?.componentInstance.view\r\n .subscribe((r: SelectableItem) => {\r\n let item = r.bag;\r\n this.open(item.documentId);\r\n });\r\n d?.componentInstance.delete\r\n .subscribe((r: SelectDialogDelete) => {\r\n const item = r.selectedItems[0].bag;\r\n this.clipperService.documents.removeFromBag(item.documentId).add(\r\n () => {\r\n this.dialogService.toast('Operazione completata con successo.');\r\n for (let p = 0; p < r.items.length; p++) {\r\n if (r.items[p].bag.DocumentId === item.DocumentId) {\r\n r.items.splice(p, 1);\r\n if (r.items.length === 0) d.close();\r\n return;\r\n }\r\n }\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * Sends a print command to the Clipper document iframe.\r\n */\r\n print(): void {\r\n const f = document.getElementById('clipper-document-iframe') as any;\r\n f?.contentWindow.postMessage('{\"type\": \"print\"}', '*');\r\n }\r\n\r\n /**\r\n * Displays a hint dialog explaining how to use the browser's find-in-page feature.\r\n */\r\n find(): void {\r\n this.dialogService.info('Per cercare nel documento premi CTRL + F.');\r\n }\r\n\r\n\r\n ////\r\n // AI Assistant\r\n ////\r\n /**\r\n * AI: sends a \"concern me\" request for the given document.\r\n * @param document - The document to analyse.\r\n */\r\n AI_concernMe(document?: ClipperDocumentInfo): void {\r\n if (!document) return;\r\n this.broadcastService.sendMessage(ClipperMessages.AI_CONCERN_ME, document);\r\n }\r\n\r\n /**\r\n * AI: sends an \"explain\" request for the given document.\r\n * @param document - The document to explain.\r\n */\r\n AI_explain(document?: ClipperDocumentInfo): void {\r\n if (!document) return;\r\n this.broadcastService.sendMessage(ClipperMessages.AI_EXPLAIN, document);\r\n }\r\n\r\n\r\n /**\r\n * AI: sends a \"comment\" request for the given document.\r\n * @param document - The document to comment on.\r\n */\r\n AI_comment(document?: ClipperDocumentInfo): void {\r\n if (!document) return;\r\n this.broadcastService.sendMessage(ClipperMessages.AI_COMMENT, document);\r\n }\r\n\r\n /**\r\n * AI: sends a \"news\" request for the given document.\r\n * @param document - The document to retrieve news for.\r\n */\r\n AI_news(document?: ClipperDocumentInfo): void {\r\n if (!document) return;\r\n this.broadcastService.sendMessage(ClipperMessages.AI_NEWS, document);\r\n }\r\n\r\n ////\r\n // Registro e scadenzario\r\n ////\r\n\r\n /**\r\n * Returns whether the given Clipper module is supported by Registro e Scadenzario (RS).\r\n * @param module - The module to check.\r\n * @returns `true` if the module is supported by RS.\r\n */\r\n isModuleSupportedByRS(module: ClipperModule): boolean {\r\n return module === ClipperModule.GazzetteBollettiniEFontiDiverse ||\r\n module === ClipperModule.NormativaVigente ||\r\n module === ClipperModule.ScadenzeESegnalazioni;\r\n }\r\n\r\n /**\r\n * Returns whether the given Clipper model is supported by Registro e Scadenzario (RS).\r\n * @param model - The model to check.\r\n * @returns `true` if the model is supported by RS.\r\n */\r\n isModelSupportedByRS(model: ClipperModel): boolean {\r\n return model === ClipperModel.AggiornamentoNormativo ||\r\n model === ClipperModel.NormativaVigente ||\r\n model === ClipperModel.Scadenze;\r\n\r\n }\r\n\r\n /**\r\n * Returns whether every document in the list has a model supported by RS.\r\n * @param documents - The list of documents to check.\r\n * @returns `true` if all documents are RS-compatible.\r\n */\r\n canSupportRS(documents: ClipperDocumentInfo[]): boolean {\r\n return documents.every(n => this.isModelSupportedByRS(n.model));\r\n }\r\n\r\n /**\r\n * Returns whether every document in the list has a model that supports RS tracking.\r\n * @param documents - The documents to check.\r\n * @returns `true` if all documents are RS-enabled.\r\n */\r\n RS_enabled(documents: ClipperDocumentInfo[]): boolean {\r\n if (!documents || documents.length === 0) return false;\r\n return documents.every(n =>\r\n n.model === ClipperModel.NormativaVigente ||\r\n n.model === ClipperModel.AggiornamentoNormativo ||\r\n n.model === ClipperModel.GiurisprudenzaRecente ||\r\n n.model === ClipperModel.Scadenze\r\n );\r\n }\r\n\r\n /**\r\n * Sends a broadcast message to create a new RS law entry linked to the given documents.\r\n * @param documents - The array of documents to link to the new law.\r\n */\r\n RS_newLaw(documents?: ClipperDocumentInfo[]): void {\r\n if (!this.clipperService.supportsRS() || !documents) return;\r\n this.broadcastService.sendMessage(ClipperMessages.INTEROP_RS_NEW_LAW, documents);\r\n }\r\n\r\n /**\r\n * Sends a broadcast message to create a new RS activity linked to the given document.\r\n * @param document - The document to link to the new activity.\r\n */\r\n RS_newActivity(document?: ClipperDocumentInfo): void {\r\n if (!this.clipperService.supportsRS() || !document) return;\r\n this.broadcastService.sendMessage(ClipperMessages.INTEROP_RS_NEW_ACTIVITY, document);\r\n }\r\n\r\n /**\r\n * Sends a broadcast message to open the RS usage report for the given document.\r\n * @param document - The document to generate the usage report for.\r\n */\r\n RS_usageReport(document?: ClipperDocumentInfo): void {\r\n if (!this.clipperService.supportsRS() || !document) return;\r\n this.broadcastService.sendMessage(ClipperMessages.INTEROP_RS_USAGE_REPORT, document);\r\n }\r\n\r\n\r\n}\r\n","import { Service, inject } from '@angular/core';\r\nimport { ClipperModule, ClipperSelectionMode, ClipperService } from '@arsedizioni/ars-utils/clipper.common';\r\nimport { ThemeType } from '@arsedizioni/ars-utils/core';\r\nimport { DialogService } from '@arsedizioni/ars-utils/ui.dialogs';\r\n\r\n/**\r\n * Opens the Clipper document viewer.\r\n *\r\n * It used to be a static method taking an `Injector` and resolving its dependencies through\r\n * `runInInjectionContext`. That is the escape hatch for code that cannot do DI, and both callers\r\n * here are components — they were injecting an `Injector` for the sole purpose of handing it over.\r\n * As a service the dependencies are resolved at field level, which also removes a trap: the\r\n * asynchronous continuation after the dynamic `import()` is outside the injection context, so an\r\n * `inject()` added in there would have failed at runtime.\r\n */\r\n@Service()\r\nexport class ClipperDocumentViewerService {\r\n\r\n private readonly dialogService = inject(DialogService);\r\n private readonly clipperService = inject(ClipperService);\r\n\r\n /**\r\n * Opens the Clipper document viewer dialog for the given document.\r\n * @param documentId - The ID of the document to open.\r\n * @param query - The search query string used for term highlighting.\r\n * @param queryChunks - Pipe-separated highlight chunks (e.g. \"|1|2|3...\").\r\n * @param selectionMode - The Clipper selection mode to activate inside the viewer.\r\n * @param selectableModules - The list of Clipper modules available for selection.\r\n * @param theme - The UI theme to apply. Defaults to the system theme.\r\n * @param canHandleTooManyResults - When `true`, the component handles oversized result sets.\r\n * @param replaceUrl - When provided, after the dialog closes the method calls `window.close()`\r\n * if the page was opened by another window, or navigates to this URL otherwise.\r\n * @returns void\r\n */\r\n openDocument(\r\n documentId: string,\r\n query?: string,\r\n queryChunks?: string,\r\n selectionMode?: ClipperSelectionMode,\r\n selectableModules?: ClipperModule[],\r\n theme?: ThemeType,\r\n canHandleTooManyResults?: boolean,\r\n replaceUrl?: string): void {\r\n if (!this.clipperService.loggedIn()) {\r\n this.dialogService.error(\"Clipper non è disponibile in questo momento. Verifica la connessione.\");\r\n return;\r\n }\r\n if (!documentId) {\r\n this.dialogService.error(\"Documento non valido.\");\r\n return;\r\n }\r\n // NB: the viewer is reached by `import()` on purpose, and `public_api` exports only its types:\r\n // a static import would close a cycle (this service -> viewer -> references -> result manager ->\r\n // this service) that fails at load time, where the references dialog extends a class not yet\r\n // initialised. Kept out of the static graph, the viewer also lands in a chunk of its own.\r\n import('./document/document.component').then(({ ClipperDocumentComponent }) => {\r\n const ref = this.dialogService.open(ClipperDocumentComponent, {\r\n ariaLabel: 'documento',\r\n autoFocus: 'dialog',\r\n restoreFocus: false,\r\n disableClose: false,\r\n data: {\r\n id: documentId,\r\n query: query,\r\n queryChunks: queryChunks,\r\n selectionMode: selectionMode,\r\n selectableModules: selectableModules,\r\n theme: theme,\r\n canHandleTooManyResults: canHandleTooManyResults\r\n },\r\n minWidth: '375px',\r\n maxWidth: '1400px',\r\n width: '100%',\r\n height: '100%'\r\n });\r\n if (replaceUrl && ref) {\r\n ref.beforeClosed().subscribe(() => {\r\n setTimeout(() => {\r\n if (window.opener !== null) {\r\n window.close();\r\n } else {\r\n window.location.replace(replaceUrl);\r\n }\r\n }, 500);\r\n });\r\n }\r\n });\r\n }\r\n}\r\n\r\n/**\r\n * Pure helpers on document data. Deliberately NOT a service: there is nothing to inject, and a\r\n * string function that needs an injector to be called is a function nobody can call from a test.\r\n */\r\nexport class ClipperDocumentsUtils {\r\n\r\n /**\r\n * Extracts the display title from a full document title by stripping any trailing `[...]` suffix.\r\n * @param title - The full document title, which may contain a bracketed qualifier.\r\n * @returns The portion of the title before the first `[`, or the original title when no `[` is present.\r\n */\r\n static parseDocumentTitle(title: string): string {\r\n if (!title) return title;\r\n const p = title.indexOf('[');\r\n return p !== -1 ? title.substring(0, p) : title;\r\n }\r\n}\r\n","import { BreakpointObserver } from '@angular/cdk/layout';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component, DestroyRef, computed, inject, signal,\n viewChild\n} from '@angular/core';\nimport { MatPaginator } from '@angular/material/paginator';\nimport { ClipperDocumentInfo, ClipperMessages, ClipperModel, ClipperQueryDocumentFlags, ClipperSearchParams, ClipperSearchResult, ClipperSearchUtils, ClipperSelectionMode, ClipperSort, ClipperUtils } from '@arsedizioni/ars-utils/clipper.common';\nimport { DateFormat, NameValueItem, ScreenService, SelectableModel, SystemUtils, ThemeService } from '@arsedizioni/ars-utils/core';\nimport { startOfDay, startOfToday, subDays } from 'date-fns';\nimport { ClipperSearchFacetsComponent } from '../search-facets/search-facets.component';\nimport { ClipperDocumentManager } from '../document-manager/document-manager';\nimport { ClipperSearchCalendarComponent } from '../search-calendar/search-calendar.component';\nimport { ClipperDocumentViewerService } from '../documents';\n\n\n\n\n@Component({\n template: '<div></div>',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ClipperSearchResultManager extends ClipperDocumentManager {\n readonly paginator = viewChild<MatPaginator>('paginator');\n readonly facets = viewChild<ClipperSearchFacetsComponent>('facets');\n readonly calendar = viewChild<ClipperSearchCalendarComponent>('calendar');\n protected readonly destroyRef = inject(DestroyRef);\n protected readonly changeDetector = inject(ChangeDetectorRef);\n protected readonly breakpointObserver = inject(BreakpointObserver);\n protected readonly documentUtils = inject(ClipperDocumentViewerService);\n protected readonly themeService = inject(ThemeService);\n public readonly screenService = inject(ScreenService);\n public selection: SelectableModel<ClipperDocumentInfo, string> | undefined;\n public readonly selectionMode = signal<ClipperSelectionMode>(ClipperSelectionMode.None);\n protected snapshot: ClipperSearchResult | undefined = new ClipperSearchResult();\n protected readonly filterBusy = signal<boolean>(false);\n protected filterParams: ClipperSearchParams = new ClipperSearchParams();\n protected readonly filterPaneHasBackdrop = signal<boolean>(false);\n protected readonly filterPaneClosed = signal<boolean>(false);\n protected readonly filterPane2HasBackdrop = signal<boolean>(false);\n protected readonly filterPane2Closed = signal<boolean>(false);\n protected readonly sortOptions = signal<NameValueItem<ClipperSort>[]>([]);\n protected readonly sortMode = signal<NameValueItem<ClipperSort> | undefined>(undefined);\n protected scrollPos: number = 0;\n protected readonly scrollerId: string = 'scroller_' + SystemUtils.generateUUID();\n protected restorableId: string | undefined;\n protected readonly hasFacets = signal<boolean>(false);\n /** `true` when the current sector filter contains any regional-law (LR) entries. */\n protected readonly hasRegions = computed(() =>\n (this.filterParams.sectors?.filter(n => n.value === 'LR').length ?? 0) > 0\n );\n\n\n\n /**\n * Resets the `isMenuOpen` flag on every snapshot item so that action-menu buttons are hidden.\n */\n updateMenuButtonsVisibility(): void {\n if (this.snapshot) {\n this.snapshot.items?.forEach(n => {\n n.isMenuOpen = false;\n });\n }\n }\n\n /**\n * Scrolls the results list container to the given vertical position.\n * @param top - The target scroll offset in pixels. Defaults to 0 (top).\n */\n scroll(top: number = 0): void {\n const elem = document.getElementById(this.scrollerId);\n if (elem) {\n elem.scrollTo({ top: top, left: 0, behavior: 'auto' });\n }\n }\n\n /**\n * Returns whether every item in the current snapshot is selected.\n * @returns `true` if the selection count equals the total snapshot item count.\n */\n allSelected(): boolean {\n return this.selection?.current?.selected?.length === this.snapshot?.items?.length;\n }\n\n /**\n * Selects or deselects all items in the current snapshot.\n * @param select - When `true`, selects all items; when `false`, deselects all.\n */\n selectAll(select: boolean = true): void {\n if (select) {\n this.snapshot?.items?.forEach(n => this.selection?.select(n, n.documentId));\n } else {\n this.snapshot?.items?.forEach(n => this.selection?.deselect(n, n.documentId));\n }\n }\n\n /**\n * Returns whether at least one item is currently selected.\n * @returns `true` if the selection contains one or more items.\n */\n hasAnySelection(): boolean {\n return (this.selection?.all?.length ?? 0) > 0;\n }\n\n /**\n * Returns whether exactly one item is selected.\n * @returns `true` if the selection count is exactly 1.\n */\n hasSingleSelection(): boolean {\n return (this.selection?.all?.length ?? 0) === 1;\n }\n\n /**\n * Returns the first (and only) selected item, or `undefined` when nothing or multiple items are selected.\n * @returns The selected document, or `undefined`.\n */\n getSingleSelection(): ClipperDocumentInfo | undefined {\n return this.hasAnySelection() ? this.selection?.all[0] : undefined;\n }\n\n\n\n /**\n * Clears the entire selection.\n */\n clearSelection(): void {\n this.selection?.clear();\n }\n\n /**\n * Returns the number of currently selected items, or `undefined` when nothing is selected.\n * @returns The selection count, or `undefined`.\n */\n countSelections(): number | undefined {\n return (this.selection && this.selection?.all?.length > 0) ? this.selection?.all?.length : undefined;\n }\n\n /**\n * Returns the document ID of the first selected item, or `undefined` when nothing is selected.\n * @returns The selected document ID, or `undefined`.\n */\n getSeletectId(): string | undefined {\n if (this.hasAnySelection()) {\n return this.selection?.all[0].documentId;\n }\n return undefined;\n }\n\n /**\n * Returns the document IDs of all selected items.\n * Shows an error and returns `undefined` when more than 100 items are selected.\n * @returns An array of document IDs, or `undefined` when the limit is exceeded.\n */\n getSeletectIds(): string[] | undefined {\n if ((this.selection?.all?.length ?? 0) > 100) {\n this.dialogService.error('La selezione non può contenere più di 100 elementi.');\n return undefined;\n }\n const ids: string[] = [];\n if (this.hasAnySelection()) {\n this.selection?.all?.forEach(n => {\n if (n.documentId) {\n ids.push(n.documentId);\n }\n });\n }\n return ids;\n }\n\n /**\n * Returns a list of `[documentId, document]` tuples for all selected items.\n * Shows an error and returns `undefined` when more than 100 items are selected.\n * @returns An array of ID-document tuples, or `undefined` when the limit is exceeded.\n */\n getSeletectIdsAndData(): [string, ClipperDocumentInfo][] | undefined {\n if ((this.selection?.all?.length ?? 0) > 100) {\n this.dialogService.error('La selezione non può contenere più di 100 elementi.');\n return undefined;\n }\n const data: [string, ClipperDocumentInfo][] = [];\n if (this.hasAnySelection()) {\n this.selection?.all?.forEach(n => {\n if (n.documentId) {\n data.push([n.documentId, n]);\n }\n });\n }\n return data;\n }\n\n\n /**\n * Enriches raw search result items with display metadata: grouping labels, expiry/validity\n * state, anchor relevance scores, and model-specific fields.\n * @param items - The raw document list to process in place.\n * @param params - The search parameters used to determine grouping and filtering.\n */\n prepareResultItems(items: ClipperDocumentInfo[], params: ClipperSearchParams): void {\n const today = startOfToday();\n const groupByYear =\n !params.sortMode ||\n params.sortMode === ClipperSort.DateAsc ||\n params.sortMode === ClipperSort.DateDesc ||\n params.sortMode === ClipperSort.SourceDateAsc ||\n params.sortMode === ClipperSort.SourceDateDesc;\n const groupByRelevance = params.sortMode === ClipperSort.Relevance;\n const groupByPopularity = params.sortMode === ClipperSort.Popularity;\n let group = '';\n items?.forEach(n => {\n n.documentId = n.documentId ?? n.id;\n if (n.documentId) {\n this.selection?.updateCurrent(n, n.documentId);\n }\n if (n.model === ClipperModel.Quesiti) {\n n.info = \"Quesito n° \" + n.number + \" del \" + SystemUtils.formatDate(n.date, \"d MMM yyyy\");\n } else if (n.model === ClipperModel.Scadenze ||\n n.model === ClipperModel.Segnalazioni) {\n switch (n.model) {\n case ClipperModel.Scadenze:\n n.originDescription = 'Scadenza';\n break;\n case ClipperModel.Segnalazioni:\n n.originDescription = 'Segnalazione';\n break;\n }\n if (n.expiringInfo) {\n const parts = n.expiringInfo.split('|');\n if (parts.length === 3) {\n n.expiringDescription = parts[2];\n }\n }\n if (n.expiringDate) {\n n.date = startOfDay(new Date(n.expiringDate));\n const d = startOfDay(subDays(n.date, 15));\n n.isExpiring = today <= n.date && today >= d;\n n.isExpired = n.date < today;\n\n }\n } else {\n if ((n.model === ClipperModel.Articoli ||\n n.model === ClipperModel.News) &&\n n.tags) {\n n.info = n.tags.toUpperCase();\n }\n if (n.model !== ClipperModel.AggiornamentoNormativo &&\n n.model !== ClipperModel.NormativaVigente &&\n n.model !== ClipperModel.GiurisprudenzaRecente &&\n n.model !== ClipperModel.Juris &&\n n.date) {\n n.date = startOfDay(new Date(n.date ?? n.publishingDate));\n const d = startOfDay(subDays(startOfToday(), 7))\n n.isNew = n.date > d;\n }\n if (n.anchors) {\n let anchorType: number | undefined;\n const anchors: any[] = [];\n let minScore = 10;\n let maxScore = 0;\n n.anchors.forEach(a => {\n if ((a.score ?? 0) < minScore) {\n minScore = a.score ?? 0;\n }\n if ((a.score ?? 0) > maxScore) {\n maxScore = a.score ?? 0;\n }\n });\n maxScore = maxScore - minScore;\n n.anchors.forEach(a => {\n if (a.type === 20) return;\n if (a.type !== anchorType) {\n if ((a.type ?? 0) >= 3)\n anchors.push({ text: a.typeDescription });\n anchorType = a.type;\n }\n const score = maxScore > 0 ? ((a.score ?? 0) - minScore) / maxScore : 0;\n anchors.push({\n text: a.text,\n title: a.title,\n documentId: a.documentId,\n uri: a.uri,\n veryRelevant: score > 0.7,\n score: score,\n chunk: a.chunk\n });\n });\n n.anchors = anchors;\n }\n if ((n.validityState ?? 0) > 0) {\n n.validityDescription = 'Non è più vigente';\n n.isExpired = true;\n if (n.validUntilDate) {\n const expiringDate = startOfDay(new Date(n.validUntilDate));\n if (expiringDate < today) {\n n.validityDescription =\n 'Non più vigente dal ' +\n SystemUtils.formatDate(expiringDate) +\n '.';\n } else {\n n.validityDescription =\n 'Non sarà più vigente dal ' +\n SystemUtils.formatDate(expiringDate) +\n '.';\n n.isExpired = false;\n }\n }\n }\n if (n.expiringDate) {\n n.date = startOfDay(new Date(n.expiringDate));\n const d = startOfDay(subDays(n.date, 15));\n n.isExpiring = today <= n.date && today >= d;\n n.isExpired = n.date < today;\n }\n }\n if (groupByYear) {\n const d = (this.filterParams.models?.length ?? 0) > 1\n ? n.publishingDate\n : n.date;\n const year = SystemUtils.formatDate(d, DateFormat.LongMonthAndYear)?.toLowerCase();\n if (group !== year) {\n n.group = year;\n group = year;\n }\n } else if (groupByRelevance) {\n if (group !== 'none') {\n n.group =\n 'Elementi più rilevanti per la ricerca: ' + params.text;\n group = 'none';\n }\n } else if (groupByPopularity) {\n if (group !== 'none') {\n n.group = 'Elementi più popolari in ordine decrescente';\n group = 'none';\n }\n }\n });\n }\n\n\n /**\n * Applies a new search result snapshot: clears the current selection, optionally preserves\n * facet state for incremental updates, and triggers change detection.\n * @param data - The incoming search result.\n * @param newSearch - When `true`, facet state is reset along with the results.\n */\n prepareResults(data: ClipperSearchResult, newSearch: boolean = false): void {\n const currentTotal = this.snapshot?.total ?? 0;\n this.selection?.current.clear();\n if (!newSearch) {\n data.facets = this.snapshot?.facets;\n }\n this.snapshot = data;\n if (this.snapshot.total === -1) {\n this.snapshot.total = currentTotal;\n }\n if (this.snapshot.items) {\n this.prepareResultItems(this.snapshot.items, this.filterParams);\n }\n this.changeDetector.markForCheck();\n }\n\n\n /**\n * Exports either the selected documents or the full result set in the given format.\n * @param format - The export format: 1 = list (CSV), 2 = deadlines (ICS).\n */\n exportResults(format: number = 1): void {\n if ((this.snapshot?.total ?? 0) > 0 || this.hasAnySelection()) {\n this.exportItems(this.getSeletectIds(), this.filterParams, format);\n }\n }\n\n\n /**\n * Returns the CSS class that reflects the item's read/expiry state.\n * @param item - The document to evaluate.\n * @returns A CSS class name string, or `undefined` when no special state applies.\n */\n getItemStateCssClass(item: ClipperDocumentInfo): string | undefined {\n if (item.isRead !== true && item.model && ClipperUtils.isClipperModelReadable(item.model)) return 'unread-bg';\n else if (item.isExpired) return 'expired-bg';\n //else if (item.popularity === 3) return 'popular-bg';\n //else if (item.popularity > 3) return 'very-popular-bg';\n return undefined;\n }\n\n /**\n * Returns the tooltip text that explains the item's current read/expiry state.\n * @param item - The document to evaluate.\n * @returns A human-readable state description, or an empty string when no special state applies.\n */\n getItemStateTooltip(item: ClipperDocumentInfo): string {\n if (item.isRead !== true && item.model && ClipperUtils.isClipperModelReadable(item.model)) return 'Non letto';\n else if (item.isExpired) return 'Non più vigente';\n //else if (item.popularity === 3) return 'Documento con numero di citazioni alto';\n //else if (item.popularity > 3) return 'Documento con numero di citazioni molto alto';\n return '';\n }\n\n /**\n * Returns the Material icon name that represents the given document's model.\n * @param item - The document whose icon to determine.\n * @returns A Material icon name string.\n */\n getItemIcon(item: ClipperDocumentInfo): string {\n switch (item.model) {\n case ClipperModel.NormativaVigente: return 'gavel';\n case ClipperModel.Articoli:\n case ClipperModel.Quesiti:\n case ClipperModel.MetodiDiAnalisi: return 'extension';\n default: return 'updated';\n }\n }\n\n /**\n * Toggles the read flag of the given item and stops event propagation.\n * @param item - The document whose read state to toggle.\n * @param e - Optional DOM event; when provided, default action and propagation are suppressed.\n */\n toggleRead(item: ClipperDocumentInfo, e?: Event): void {\n e?.preventDefault();\n e?.stopPropagation();\n this.setRead(!item?.isRead, item);\n\n }\n\n /**\n * Toggles the selection state of the given item and stops event propagation.\n * @param item - The document to select or deselect.\n * @param e - Optional DOM event; when provided, default action and propagation are suppressed.\n */\n toggleSelection(item: ClipperDocumentInfo, e?: Event): void {\n e?.preventDefault();\n e?.stopPropagation();\n this.selection?.toggle(item, item.documentId)\n\n\n }\n\n\n /**\n * Sets the read state on the given item or on all currently selected items.\n *\n * Only the documents the server reports as written change on screen and in the counters: a\n * document older than the unread window keeps no state, and one already in the state asked for\n * has nothing to count. Touching either would leave the counters out of step with the server.\n * @param value - The new read flag value.\n * @param item - When provided, only this item is updated; otherwise the full selection is used.\n * @param silent - When `true`, suppresses the \"too old\" notice.\n */\n setRead(value: boolean, item?: ClipperDocumentInfo, silent?: boolean): void {\n let targets: ClipperDocumentInfo[];\n if (item?.documentId) {\n targets = [item];\n } else if (this.hasAnySelection()) {\n targets = (this.selection?.all ?? []).filter(n => !!n.documentId);\n } else {\n return;\n }\n const documentIds = targets.map(n => n.documentId!);\n this.clipperService.documents.updateState({ documentIds: documentIds, isRead: value })\n .subscribe(r => {\n if (!r.success) {\n // soft error\n this.dialogService.toast(r.message);\n return;\n }\n const updated = new Set(r.value?.updated ?? []);\n const expired = r.value?.expired ?? [];\n if (expired.length > 0 && !silent) {\n this.dialogService.toast(this.getExpiredReadStateMessage(expired.length, targets.length), 5000, 'history');\n }\n let changed = false;\n for (const n of targets) {\n if (!n.documentId || !updated.has(n.documentId) || n.isRead === value) {\n continue;\n }\n n.isRead = value;\n changed = true;\n this.broadcastService.sendMessage(ClipperMessages.DOCUMENT_READ, { document: n, value: value });\n const module = ClipperUtils.getClipperModuleFromModel(n);\n if (module) {\n this.clipperService.account.updateUnreadItems(\n module,\n n.model,\n value ? -1 : 1);\n }\n }\n if (changed) {\n this.changeDetector.markForCheck();\n this.broadcastService.sendMessage(ClipperMessages.COMMAND_DASHBOARD_UPDATED);\n }\n });\n }\n\n /**\n * Words the notice for the documents a read-state update left alone because they are older than\n * the unread window: a single document, the whole selection, or a part of it.\n * @param expired - How many documents were too old.\n * @param total - How many documents the update was asked for.\n * @returns The message to show.\n */\n private getExpiredReadStateMessage(expired: number, total: number): string {\n if (total === 1) {\n return 'Il documento non è stato aggiornato perché più vecchio di 2 mesi.';\n }\n if (expired === total) {\n return 'I documenti selezionati non sono stati aggiornati perché più vecchi di 2 mesi.';\n }\n if (expired === 1) {\n return `Un documento su ${total} non è stato aggiornato perché più vecchio di 2 mesi.`;\n }\n return `${expired} documenti su ${total} non sono stati aggiornati perché più vecchi di 2 mesi.`;\n }\n\n \n\n /**\n * Opens a document by ID, either inline or in a new browser tab.\n * @param documentId - The ID of the document to open.\n * @param query - The current search query used to highlight terms in the viewer.\n * @param queryChunks - Pipe-separated highlight chunks (e.g. \"|1|2|3...\").\n * @param newWindow - When `true`, opens the document in a new browser tab.\n */\n override open(documentId?: string, query?: string, queryChunks?: string, newWindow?: boolean): void {\n if (!documentId) return;\n if (!newWindow) this.openDocument(documentId, query, queryChunks);\n else {\n window.open((this.clipperService.appUri ?? '') + '/documento/' + documentId, '_blank');\n }\n }\n\n /**\n * Opens the Clipper document viewer dialog for the given document.\n * @param documentId - The ID of the document to open.\n * @param query - The normalized search query used for term highlighting.\n * @param queryChunks - Pipe-separated highlight chunks (e.g. \"|1|2|3...\").\n */\n openDocument(documentId?: string, query?: string, queryChunks?: string): void {\n if (!documentId) return;\n query = ClipperSearchUtils.normalizeTextQuery2(query ?? this.filterParams.text ?? '');\n if (((this.filterParams.flags ?? 0) & ClipperQueryDocumentFlags.UseSemanticSearch) > 0) {\n query = '$' + query;\n }\n this.documentUtils.openDocument(\n documentId,\n query,\n queryChunks,\n this.selectionMode(),\n undefined,\n this.themeService.getTheme(),\n this.canHandleTooManyResults()\n );\n\n }\n\n ///\n // Restorable\n ///\n\n /**\n * Serialises the current component state (paginator, facets, filter params, scroll, sort, data)\n * to the given storage under the given key, enabling later restoration.\n * @param id - The storage key to write to.\n * @param storage - The Web Storage instance to use. Defaults to `sessionStorage`.\n */\n save(id: string, storage: Storage = sessionStorage): void {\n this.onStateSaving();\n storage.setItem(\n id,\n JSON.stringify({\n paginator: {\n index: this.paginator()?.pageIndex ?? 0,\n total: this.snapshot?.total ?? 0,\n size: this.paginator()?.pageSize ?? this.filterParams?.count ?? 15\n },\n facets: this.facets()?.save(),\n filterParams: this.filterParams,\n scroll: this.scrollPos,\n sort: { mode: this.sortMode(), options: this.sortOptions() },\n data: this.snapshot\n ? { items: this.snapshot.items, total: this.snapshot.total }\n : null\n }));\n }\n\n /**\n * Restores a previously serialised component state from storage and re-applies it.\n * Facets, paginator, scroll position, and filter parameters are all re-hydrated.\n * @param id - The storage key to read from.\n * @param storage - The Web Storage instance to use. Defaults to `sessionStorage`.\n */\n /**\n * Hook invoked just before the component state is serialised by save().\n * Subclasses that keep a separate form model can commit it to filterParams here.\n */\n protected onStateSaving(): void { }\n\n /**\n * Hook invoked after restore() has fully re-hydrated filterParams.\n * Subclasses that keep a separate form model can rebuild it from filterParams here.\n */\n protected onStateRestored(): void { }\n\n restore(id: string, storage: Storage = sessionStorage): void {\n const value = storage.getItem(id);\n if (value) {\n const data = JSON.parse(value);\n if (data) {\n this.filterParams = data.filterParams;\n const modules = SystemUtils.clone(this.filterParams.modules);\n const sectors = SystemUtils.clone(this.filterParams.sectors);\n const authors = SystemUtils.clone(this.filterParams.authors);\n const tags = SystemUtils.clone(this.filterParams.tags);\n const topics = SystemUtils.clone(this.filterParams.topics);\n this.filterParams.modules = modules;\n this.filterParams.sectors = undefined;\n this.filterParams.authors = undefined;\n this.filterParams.tags = undefined;\n this.filterParams.topics = undefined;\n this.snapshot = data.data;\n this.sortMode.set(data.sort.mode);\n this.sortOptions.set(data.sort.options ?? []);\n setTimeout(() => {\n this.filterParams.sectors = sectors;\n this.filterParams.authors = authors;\n this.filterParams.tags = tags;\n this.filterParams.topics = topics;\n const facets = this.facets();\n if (facets && data.facets) {\n facets.restore(data.facets);\n this.hasFacets.set(data.facets.hasFacets === true);\n }\n const paginator = this.paginator();\n if (paginator && data.paginator) {\n paginator.pageIndex = data.paginator.index;\n paginator.pageSize = data.paginator.size;\n paginator.length = data.paginator.total;\n }\n this.scroll(data.scroll ?? 0);\n this.onStateRestored();\n this.broadcastService.sendMessage(ClipperMessages.COMMAND_SEARCH_RESTORED, data.filterParams)\n this.changeDetector.markForCheck();\n }, 750);\n\n }\n }\n }\n}","import { ChangeDetectionStrategy, Component } from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatDialogActions, MatDialogClose, MatDialogContent, MatDialogTitle } from '@angular/material/dialog';\nimport { SystemUtils } from '@arsedizioni/ars-utils/core';\nimport { FlexLayoutModule } from '@arsedizioni/ars-utils/ui';\n\n@Component({\n host: { 'Bind': SystemUtils.generateUUID() },\n templateUrl: './search-free-text-help.component.html',\n styleUrls: ['./search-free-text-help.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n imports: [MatDialogTitle, MatDialogContent, MatDialogActions, FlexLayoutModule, MatButtonModule, MatDialogClose]\n})\nexport class ClipperSearchFreeTextHelpComponent{\n}\n","<div mat-dialog-title>Come effettuare la ricerca in testo libero</div>\r\n<mat-dialog-content>\r\n <p>Normalmente viene sempre effettuata una ricerca per frase: tutte le parole specificate debbono essere\r\n \"ragionevolmente vicine\" (entro 5 parole) l'una dall'altra.</p>\r\n <p>La ricerca per frase di solito produce i risultati più rilevanti.</p>\r\n <p>Tuttavia è possibile istruire Clipper per eseguire ricerche differenti e più complesse.</p>\r\n <p>Tutte gli elementi che compongono la stringa di ricerca devono essere separati da virgola.</p>\r\n <ul>\r\n <li>Se un elemento è composto da più parole è una frase, altrimenti una parola</li>\r\n <li>Aggiungendo un <b style=\"font-size: 20px\">+</b> davanti all'elemento, l'elemento <b>dovrà per forza</b> essere presente nel documento\r\n </li>\r\n <li>Aggiungendo un <b style=\"font-size: 20px\">-</b> davanti all'elemento, l'elemento <b>non dovrà</b> essere presente nel documento</li>\r\n </ul>\r\n <p>Ecco alcuni esempi:</p>\r\n <ul>\r\n <li><b>serbatoi interrati</b>: sarà effettuata una ricerca per la frase \"serbatoi interrati\"</li>\r\n <li><b>serbatoi, interrati</b>: sarà effettuata una ricerca per le parole \"serbatoi\" e \"interrati\"; il risultato sarà tutti i documenti che contengono una o l'altra parola.</li>\r\n <li><b>serbatoi, +interrati</b>: sarà effettuata una ricerca per le parole \"serbatoi\" e \"interrati\"; il risultato sarà tutti i documenti che contengono necessariamente \"interrati\" ed eventualmente \"serbatoi\".</li>\r\n <li><b>serbatoi, -interrati</b>: sarà effettuata una ricerca per le parole \"serbatoi\" e \"interrati\"; il risultato sarà tutti i documenti che contengono necessariamente \"interrati\" ma non \"serbatoi\".</li>\r\n <li><b>\"serbatoi interrati\", -gas</b>: sarà effettuata una ricerca per la frase \"serbatoi interrati\" e per la parola \"gas\"; il risultato sarà tutti i documenti che contengono la frase \"serbatoi interrati\" ma non la parola \"gas\".</li>\r\n </ul>\r\n <p>Saranno mostrati per primi (più rilevanti) i documenti che rispettano in pieno la condizione.</p>\r\n</mat-dialog-content>\r\n<mat-dialog-actions>\r\n <div fxLayout=\"row\" fxLayoutGap=\"10px\" fxFill>\r\n <div fxLayoutAlign=\"end\" fxFill >\r\n <button mat-stroked-button [mat-dialog-close]=\"true\" >Chiudi</button>\r\n </div>\r\n </div>\r\n</mat-dialog-actions>\r\n","import { ChangeDetectionStrategy, Component, inject, output, signal } from '@angular/core';\r\nimport { form, FormField, FormRoot, maxLength } from '@angular/forms/signals';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatDialogActions, MatDialogClose, MatDialogContent, MatDialogTitle } from '@angular/material/dialog';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatInputModule } from '@angular/material/input';\r\nimport { DtoUtils, SystemUtils } from '@arsedizioni/ars-utils/core';\r\nimport { FlexLayoutModule } from '@arsedizioni/ars-utils/ui';\r\nimport { DialogService } from '@arsedizioni/ars-utils/ui.dialogs';\r\n\r\nexport interface SearchFreeTextQueryParams {\r\n query: string;\r\n}\r\n\r\n/**\r\n * Form model of the free-text query builder: one field per query operator.\r\n *\r\n * The DTO ({@link SearchFreeTextQueryParams}) is not a projection of this model — it\r\n * carries the single Lucene-style expression assembled out of the five fields — which\r\n * is why {@link ClipperSearchFreeTextQueryBuilderComponent.toPayload} is ad-hoc.\r\n */\r\ninterface SearchFreeTextQueryForm {\r\n /** Exact phrase to look for; `''` when the input is empty. */\r\n queryPhrase: string;\r\n /** Comma-separated words that must all appear; `''` when the input is empty. */\r\n queryAnd: string;\r\n /** Comma-separated words of which at least one must appear; `''` when the input is empty. */\r\n queryOr: string;\r\n /** Prefix the document must start with; `''` when the input is empty. */\r\n queryStart: string;\r\n /** Comma-separated words that must not appear; `''` when the input is empty. */\r\n queryNot: string;\r\n}\r\n\r\n/** Neutral form model: it declares every field the form owns and its empty value. */\r\nconst _EMPTY_ITEM: SearchFreeTextQueryForm = {\r\n queryPhrase: '',\r\n queryAnd: '',\r\n queryOr: '',\r\n queryStart: '',\r\n queryNot: '',\r\n};\r\n\r\n@Component({\r\n host: { 'Bind': SystemUtils.generateUUID() },\r\n templateUrl: './search-free-text-query-builder.component.html',\r\n styleUrls: ['./search-free-text-query-builder.component.scss'],\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [MatDialogTitle, MatDialogContent, FormField, FormRoot, FlexLayoutModule, MatFormFieldModule, MatInputModule,\r\n MatButtonModule, MatIconModule, MatDialogActions, MatDialogClose]\r\n})\r\nexport class ClipperSearchFreeTextQueryBuilderComponent {\r\n readonly done = output<SearchFreeTextQueryParams>();\r\n\r\n private readonly dialogService = inject(DialogService);\r\n\r\n /** Model backing the signal form: one entry per query operator field. */\r\n private readonly model = signal<SearchFreeTextQueryForm>(this.toForm());\r\n\r\n /**\r\n * Builds the form model. The builder always opens empty, so the model is the neutral\r\n * one; it also serves as what the \"clear\" button restores.\r\n * @returns A fresh form model.\r\n */\r\n private toForm(): SearchFreeTextQueryForm {\r\n return DtoUtils.toForm(_EMPTY_ITEM);\r\n }\r\n\r\n /**\r\n * Assembles the Lucene-style free-text query out of the five operator fields.\r\n *\r\n * Ad-hoc because the payload is not a projection of the model: every field\r\n * contributes a differently shaped fragment (a quoted phrase, `+` terms, a `*`\r\n * wildcard, `-` exclusions) to one single string.\r\n * @returns The query to emit, or `undefined` when only the exclusion operator was\r\n * filled in, which cannot produce a valid query on its own.\r\n */\r\n private toPayload(): SearchFreeTextQueryParams | undefined {\r\n let query = '';\r\n const m = this.model();\r\n const phrase = m.queryPhrase?.trim() ?? '';\r\n const and = m.queryAnd?.trim() ?? '';\r\n const or = m.queryOr?.trim() ?? '';\r\n const not = m.queryNot?.trim() ?? '';\r\n const start = m.queryStart?.trim() ?? '';\r\n\r\n // Phrase\r\n if (phrase.length > 0) {\r\n query += ` \"${phrase.replaceAll('\"', '')}\" `;\r\n }\r\n // OR — each comma-separated word is wrapped in quotes\r\n if (or.length > 0) {\r\n for (const part of or.split(',')) {\r\n if (query.length > 0) query += ' ';\r\n query += `\"${part.replaceAll('\"', '').trim()}\" `;\r\n }\r\n }\r\n // AND — each comma-separated word is prefixed with +\r\n if (and.length > 0) {\r\n for (const part of and.split(',')) {\r\n if (query.length > 0) query += ' ';\r\n query += `+\"${part.replaceAll('\"', '').trim()}\" `;\r\n }\r\n }\r\n // Starts-with — appends a wildcard suffix\r\n if (start.length > 0) {\r\n if (query.length > 0) query += ' ';\r\n query += `+\"${start.replaceAll('\"', '')}*\" `;\r\n }\r\n // NOT — each comma-separated word is prefixed with - (requires at least one positive term)\r\n if (not.length > 0) {\r\n if (query.length === 0) {\r\n return undefined;\r\n }\r\n for (const part of not.split(',')) {\r\n if (query.length > 0) query += ' ';\r\n query += `-\"${part.replaceAll('\"', '').trim()}\" `;\r\n }\r\n }\r\n return { query: query.trim() };\r\n }\r\n\r\n /** Signal form for the query fields; every field is capped at 200 characters. */\r\n protected readonly form = form(this.model, p => {\r\n maxLength(p.queryPhrase, 200);\r\n maxLength(p.queryAnd, 200);\r\n maxLength(p.queryOr, 200);\r\n maxLength(p.queryStart, 200);\r\n maxLength(p.queryNot, 200);\r\n });\r\n\r\n /**\r\n * Resets all query fields to empty strings.\r\n */\r\n protected clear(): void {\r\n this.model.set(this.toForm());\r\n }\r\n\r\n /**\r\n * Emits the assembled free-text query via `done`.\r\n *\r\n * Shows an error dialog when only the NOT operator has been filled in, since it\r\n * requires at least one positive term to produce a valid query.\r\n */\r\n protected ok(): void {\r\n const payload = this.toPayload();\r\n if (!payload) {\r\n this.dialogService.error(\r\n \"L'operatore di esclusione funziona solo se prima è stato inserito un valore in almeno uno degli altri quattro campi.\"\r\n );\r\n return;\r\n }\r\n if (payload.query.length > 0) this.done.emit(payload);\r\n }\r\n}\r\n","<div mat-dialog-title>Trova gli elementi che contengono...</div>\n<mat-dialog-content>\n <form [formRoot]=\"form\" (keyup.enter)=\"!form().invalid() ? ok() : undefined\" novalidate>\n <div fxLayout=\"column\" style=\"padding-bottom: 20px;\">\n <mat-form-field>\n <mat-label>Questa esatta parola o frase</mat-label>\n <input matInput [formField]=\"form.queryPhrase\" />\n @if (form.queryPhrase().value()) {\n <a matSuffix mat-icon-button aria-label=\"Azzera\" (click)=\"form.queryPhrase().value.set('')\">\n <mat-icon>close</mat-icon>\n </a>\n }\n </mat-form-field>\n <mat-form-field>\n <mat-label>Tutte queste parole</mat-label>\n <input matInput [formField]=\"form.queryAnd\" />\n @if (form.queryAnd().value()) {\n <a matSuffix mat-icon-button aria-label=\"Azzera\" (click)=\"form.queryAnd().value.set('')\">\n <mat-icon>close</mat-icon>\n </a>\n }\n <mat-hint>Separate da virgola</mat-hint>\n </mat-form-field>\n <mat-form-field>\n <mat-label>Una qualunque di queste parole</mat-label>\n <input matInput [formField]=\"form.queryOr\" />\n @if (form.queryOr().value()) {\n <a matSuffix mat-icon-button aria-label=\"Azzera\" (click)=\"form.queryOr().value.set('')\">\n <mat-icon>close</mat-icon>\n </a>\n }\n <mat-hint>Separate da virgola</mat-hint>\n </mat-form-field>\n <!--\n <mat-form-field>\n <mat-label>Parole che iniziano con</mat-label>\n <input matInput [formField]=\"form.queryStart\" />\n @if (form.queryStart().value()) {\n <a matSuffix mat-icon-button aria-label=\"Azzera\" (click)=\"form.queryStart().value.set('')\">\n <mat-icon>close</mat-icon>\n </a>\n }\n <mat-hint>Separate da virgola</mat-hint>\n </mat-form-field>\n -->\n <mat-form-field>\n <mat-label>Nessuna qualunque di queste parole</mat-label>\n <input matInput [formField]=\"form.queryNot\" />\n @if (form.queryNot().value()) {\n <a matSuffix mat-icon-button aria-label=\"Azzera\" (click)=\"form.queryNot().value.set('')\">\n <mat-icon>close</mat-icon>\n </a>\n }\n <mat-hint>Separate da virgola. L'operatore di esclusione funziona solo se prima è stato inserito un valore in\n almeno uno degli altri quattro campi. </mat-hint>\n </mat-form-field>\n </div>\n </form>\n</mat-dialog-content>\n<mat-dialog-actions>\n <div fxLayout=\"row\" fxLayoutGap=\"10px\" fxFill>\n <div fxFlex=\"30\" fxLayoutAlign=\"start\">\n <button type=\"button\" mat-stroked-button (click)=\"clear()\">Pulisci</button>\n </div>\n <div fxFlex=\"70\" fxLayoutAlign=\"end\">\n <button mat-flat-button (click)=\"ok()\">Ok</button>\n <button mat-stroked-button [mat-dialog-close]=\"true\">Annulla</button>\n </div>\n </div>\n</mat-dialog-actions>","import { ChangeDetectionStrategy, Component, DestroyRef, computed, inject, input, model } from '@angular/core';\nimport { takeUntilDestroyed, toObservable, toSignal } from '@angular/core/rxjs-interop';\nimport { EMPTY, switchMap } from 'rxjs';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatMenu, MatMenuModule } from '@angular/material/menu';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { ClipperDocumentInfo, ClipperMessages, ClipperModel, ClipperUtils } from '@arsedizioni/ars-utils/clipper.common';\nimport { BroadcastService, FormatPipe, ScreenService, SystemUtils } from '@arsedizioni/ars-utils/core';\nimport { FlexLayoutModule } from '@arsedizioni/ars-utils/ui';\nimport { ClipperSearchResultManager } from '../search-result-manager/search-result-manager';\n\n\nexport enum ClipperSearchResultItemDisplayMode {\n List = 1,\n Tile = 2,\n Stripe = 3\n}\n\n\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'clipper-search-result-item',\n templateUrl: './search-result-item.component.html',\n styleUrls: ['./search-result-item.component.scss'],\n standalone: true,\n imports: [\n MatCheckboxModule,\n MatButtonModule,\n MatTooltipModule,\n MatIconModule,\n MatMenuModule,\n FlexLayoutModule,\n FormatPipe,\n ],\n})\nexport class ClipperSearchResultItemComponent {\n\n private readonly destroyRef = inject(DestroyRef);\n protected readonly screenService = inject(ScreenService);\n private readonly broadcastService = inject(BroadcastService);\n readonly parent = input.required<ClipperSearchResultManager>();\n readonly item = model.required<ClipperDocumentInfo>();\n readonly actions = input.required<MatMenu>();\n /**\n * Taxonomy path segments derived from `item().taxonomyPath`.\n * Computed (not an effect writing a signal) so it stays lazy and reactive to `item()`.\n */\n protected readonly taxonomy = computed<string[]>(() => {\n const result: string[] = [];\n this.item().taxonomyPath?.split('\\r\\n').forEach(p => {\n const pathValues = p.split('>');\n result.push(SystemUtils.normalizeDisplay(pathValues[pathValues.length - 1].trim()));\n });\n return result;\n });\n readonly tileNoPictureUrl = input<string>();\n readonly tilePictureUrl = input<string>(); \n readonly isSelectable = input<boolean>(true);\n readonly isReadable = input<boolean>(true);\n readonly isReadableModel = input<ClipperModel | undefined>(undefined);\n readonly displayModifiedTitle = input<boolean>(false);\n readonly displayModelName = input<boolean>(false);\n readonly displayDate = input<boolean>(true);\n readonly displayMode = input<ClipperSearchResultItemDisplayMode>(ClipperSearchResultItemDisplayMode.List);\n protected readonly displayModesEnum: typeof ClipperSearchResultItemDisplayMode = ClipperSearchResultItemDisplayMode;\n protected readonly modelsEnum: typeof ClipperModel = ClipperModel;\n\n /**\n * Emits whenever the parent's SelectionModel changes. `toObservable(parent)` + `switchMap`\n * re-binds automatically (tearing down the previous subscription) if `parent` ever changes,\n * avoiding the duplicate subscriptions a subscribe-inside-effect would create.\n */\n private readonly selectionTick = toSignal(\n toObservable(this.parent).pipe(switchMap(p => p?.selection?.changed ?? EMPTY)),\n { initialValue: null },\n );\n\n /**\n * Whether this item is currently selected in the parent's selection model.\n * Recomputed whenever the parent's selection changes.\n */\n protected readonly isSelected = computed(() => {\n this.selectionTick();\n return this.isSelectable() && this.parent()?.selection?.isSelected(this.item().documentId) === true;\n });\n\n /**\n * Whether this item has already been read by the user.\n */\n protected readonly isRead = computed(() => {\n const model = this.isReadableModel() ?? this.item().model ?? 0;\n return this.isReadable() && model > 0 && ClipperUtils.isClipperModelReadable(model) && this.item().isRead === true;\n });\n\n /**\n * Whether this item is readable but not yet read (i.e. the read-flag action should be shown).\n */\n protected readonly canBeRead = computed(() => {\n const model = this.isReadableModel() ?? this.item().model ?? 0;\n return this.isReadable() && model > 0 && ClipperUtils.isClipperModelReadable(model) && this.item().isRead !== true;\n });\n\n constructor() {\n // React to broadcast messages from other components.\n this.broadcastService.getMessage()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(message => {\n if (message.id === ClipperMessages.DOCUMENT_NAVIGATED) {\n if (this.isReadable() && this.item().documentId === message.data.document.documentId && !this.item().isRead) {\n this.parent()?.setRead(true, this.item(), true);\n }\n } else if (message.id === ClipperMessages.DOCUMENT_READ) {\n if (this.isReadable() && this.item().documentId === message.data.document.documentId) {\n this.item.update(v => ({ ...v, isRead: message.data.value }));\n }\n }\n });\n }\n\n}\n","<div>\r\n @if (displayMode() === displayModesEnum.List ) {\r\n <div class=\"item\" fxLayout=\"row\" fxLayoutGap=\"6px\" fxLayoutAlign=\"start center\" fxFill\r\n [class.item-selected]=\"isSelected()\" [matContextMenuTriggerFor]=\"actions()\"\r\n [matContextMenuTriggerData]=\"{item: item()}\" (mouseenter)=\"item().isOver = true\"\r\n (mouseleave)=\"item().isOver = false\">\r\n <div fxFlex=\"6px\" fxFlexAlign=\"stretch\" [class]=\"parent().getItemStateCssClass(item())\"\r\n [matTooltip]=\"parent().getItemStateTooltip(item())\"><span></span>\r\n </div>\r\n <div [fxFlex]=\"isSelectable() ? '48px' : '16px'\" fxLayoutAlign=\"center\">\r\n @if (isSelectable() && (screenService.isTouchable || item().isOver || isSelected())) {\r\n <mat-checkbox (click)=\"$event.stopPropagation()\"\r\n (change)=\"$event ? parent().selection?.toggle(item(), item().documentId) : null\" [checked]=\"isSelected()\">\r\n </mat-checkbox>\r\n }\r\n </div>\r\n <div fxFlex=\"*\">\r\n <div class=\"item-content\">\r\n\r\n @if (displayModelName() && item().modelName) {\r\n @if (item().origin === 'GC' || item().origin === 'GN') {\r\n <div class=\"info-2\">GIURISPRUDENZA</div>\r\n } @else {\r\n <div class=\"info-2\">{{item().modelName}}</div>\r\n }\r\n }\r\n @if (item().info && item().model === modelsEnum.Quesiti) {\r\n @if(item().info) {\r\n <div class=\"info-1\">{{item().info}}</div>\r\n }\r\n }@else if(item().model === modelsEnum.NormativaVigente ||\r\n item().model === modelsEnum.AggiornamentoNormativo ||\r\n item().model === modelsEnum.GiurisprudenzaRecente ||\r\n item().model === modelsEnum.Juris) {\r\n @if (item().author && (item().origin === 'LR' || item().origin === 'GC' || item().origin\r\n === 'GN')) {\r\n <div class=\"info-1\">{{item().author}}</div>\r\n }\r\n @if(item().model === modelsEnum.Juris && displayDate() && item().date) {\r\n <div class=\"info-1\">{{item().date | format:'D':'d MMM yyyy'}}</div>\r\n }\r\n }@else if (displayDate() && item().date) {\r\n <div class=\"info-1\">{{item().date | format:'D':'d MMM yyyy'}}</div>\r\n }\r\n <div>\r\n <a class=\"link\" (click)=\"parent().open(item().documentId, undefined, item().chunksList)\"\r\n [attr.aria-label]=\"'Apri documento ' + item().title1\">{{item().title1 ?? item().title2}}</a>\r\n @if ((item().part ?? 0) > 0) {\r\n <span class=\"badge\">PARTE {{item().part}}</span>\r\n }\r\n @if (item().isCommented) {\r\n <span class=\"badge\">COMMENTATA</span>\r\n }\r\n @if ((item().validityState ?? 0) > 0) {\r\n <span class=\"badge-red\">{{item().validityDescription}}</span>\r\n }\r\n </div>\r\n @if(item().description && item().model === modelsEnum.Coordinamento) {\r\n <div class=\"title\">{{item().description}}</div>\r\n }\r\n @if (item().title2 &&\r\n item().model !== modelsEnum.Coordinamento &&\r\n item().model !== modelsEnum.News &&\r\n item().model !== modelsEnum.Articoli &&\r\n item().model !== modelsEnum.Juris &&\r\n item().model !== modelsEnum.Quesiti &&\r\n item().model !== modelsEnum.Scadenze &&\r\n item().model !== modelsEnum.Segnalazioni) {\r\n <div class=\"title\">{{item().title2}}</div>\r\n }\r\n @if (item().originDescription &&\r\n item().model !== modelsEnum.Scadenze &&\r\n item().model !== modelsEnum.Segnalazioni &&\r\n item().model !== modelsEnum.News &&\r\n item().model !== modelsEnum.Articoli &&\r\n item().model !== modelsEnum.Juris) {\r\n <div class=\"info-1\"\r\n [class.info-3]=\"(item().model === modelsEnum.Coordinamento && (item().validFromDate || item().applicableFromDate))\">\r\n {{item().originDescription}}\r\n @if (item().model === modelsEnum.Coordinamento ) {\r\n @if (item().validFromDate) {\r\n in vigore da: <span class=\"bold\">{{item().validFromDate | format:'D':'d MMMM yyyy'}}</span>\r\n }\r\n @if (item().applicableFromDate) {\r\n applicabile da: <span class=\"bold\">{{item().applicableFromDate | format:'D':'d MMMM yyyy'}}</span>\r\n }\r\n }\r\n </div>\r\n }\r\n @if ((item().anchors?.length ?? 0) > 0) {\r\n <div class=\"details\">\r\n <div>DETTAGLIO</div>\r\n <div class=\"links\">\r\n @for (a of item().anchors; track $index) {\r\n <span>\r\n @if (a.uri && a.text) {\r\n <a (click)=\"parent().open(a.documentId + '#' + a.uri, undefined, item().chunksList)\"\r\n [matTooltip]=\"a.title\" [class.bright]=\"(a.score ?? 0) > 0.75\">\r\n {{a.text}}\r\n @if (a.veryRelevant) {\r\n <sup>\r\n <mat-icon class=\"thumb\"\r\n [matTooltip]=\"(a.score ?? 0) > 0.75 ? 'Molto rilevante' : 'Più rilevante'\">thumb_up_alt</mat-icon>\r\n </sup>\r\n }</a>\r\n }\r\n @if (!a.uri && a.text) {\r\n <span>{{a.text}}</span>\r\n }\r\n </span>\r\n }\r\n </div>\r\n </div>\r\n }\r\n @if (taxonomy().length > 0) {\r\n <div class=\"details\">\r\n <div>ARGOMENTI</div>\r\n <div class=\"links\">\r\n <div [innerHTML]=\"taxonomy().join(' − ')\"></div>\r\n </div>\r\n </div>\r\n }\r\n @if (item().model === modelsEnum.News ||\r\n item().model === modelsEnum.Articoli ||\r\n item().model === modelsEnum.Juris) {\r\n @if (item().info){\r\n <div class=\"details\">\r\n <div class=\"links\">\r\n <div>{{item().info}}</div>\r\n </div>\r\n </div>\r\n }\r\n }\r\n @if (item().model === modelsEnum.Coordinamento) {\r\n @if (item().title1 && displayModifiedTitle()) {\r\n <div class=\"details\">\r\n <div>TITOLO DOCUMENTO MODIFICATO</div>\r\n <div class=\"links\">\r\n <div>{{item().title1}}</div>\r\n </div>\r\n </div>\r\n }\r\n }\r\n @if (item().model === modelsEnum.Scadenze || item().model === modelsEnum.Segnalazioni) {\r\n @if (item().expiringDescription) {\r\n <div class=\"details\">\r\n <div>PROSSIMA SCADENZA</div>\r\n <div class=\"links\">\r\n <div>{{item().expiringDescription}}</div>\r\n </div>\r\n </div>\r\n }\r\n }\r\n </div>\r\n </div>\r\n <div fxFlex=\"48px\" fxLayoutAlign=\"end\">\r\n @if (canBeRead())\r\n {\r\n <button type=\"button\" mat-icon-button matTooltip=\"Segna come già letta\" [attr.aria-label]=\"'Segna come già letta'\"\r\n (click)=\"parent().toggleRead(item(), $event)\" [hidden]=\"!(item().isOver || item().isMenuOpen)\">\r\n <mat-icon>flag</mat-icon>\r\n </button>\r\n }\r\n <button fxFlexAlign=\"center\" type=\"button\" mat-icon-button matTooltip=\"Menu\" [attr.aria-label]=\"'Menu opzioni'\"\r\n [matMenuTriggerFor]=\"actions()\" [matMenuTriggerData]=\"{item: item()}\" (click)=\"item().isMenuOpen = true\"\r\n [hidden]=\"!(item().isOver || item().isMenuOpen)\">\r\n <mat-icon>more_vert</mat-icon>\r\n </button>\r\n </div>\r\n </div>\r\n } @else if (displayMode() === displayModesEnum.Tile ) {\r\n <div class=\"tile\" [matContextMenuTriggerFor]=\"actions()\" [matContextMenuTriggerData]=\"{item: item()}\"\r\n (mouseenter)=\"item().isOver = true\" (mouseleave)=\"item().isOver = false\" [class.item-selected]=\"isSelected()\"\r\n [class.item-unread]=\"isRead()\" (click)=\"parent().open(item().documentId, undefined, item().chunksList)\">\r\n <div class=\"image\">\r\n @if (canBeRead() || isSelectable()) {\r\n <div class=\"buttons\">\r\n @if (canBeRead()) {\r\n <button mat-icon-button class=\"unread-button\" matTooltip=\"Segna come già letto\"\r\n (click)=\"parent().toggleRead(item(), $event)\"><mat-icon>flag</mat-icon></button>\r\n }\r\n @if (isSelectable() && (isSelected() || item().isOver === true)) {\r\n <button mat-icon-button class=\"check\" [class.check-selected]=\"isSelected()\" matTooltip=\"Seleziona/Deseleziona\"\r\n (click)=\"parent().toggleSelection(item(), $event)\"><mat-icon>check</mat-icon></button>\r\n }\r\n </div>\r\n }\r\n <div class=\"info-1\">{{item().modelName}}</div>\r\n @if (item().info) {\r\n <div class=\"info-2\">{{item().info}}</div>\r\n }\r\n @if (item().pictureId && tilePictureUrl()) {\r\n <img decoding=\"async\" loading=\"lazy\" [src]=\"tilePictureUrl() + '?id=' + item().pictureId\" [alt]=\"item().title2\" />\r\n } @else if (tileNoPictureUrl()) {\r\n <picture>\r\n <img decoding=\"async\" loading=\"lazy\" [src]=\"tileNoPictureUrl()\"\r\n [alt]=\"item().title2 || 'immagine non trovata'\" />\r\n </picture>\r\n }\r\n </div>\r\n <div class=\"body\">\r\n <div class=\"date\">\r\n <span class=\"date-day\" [class.unread]=\"!item().isRead\">{{item().date | format:'D':'d\r\n MMMM'}}</span>\r\n <span class=\"date-divider\"></span>\r\n <span>{{item().date| format:'D':'yyyy'}}</span>\r\n </div>\r\n <div class=\"title\">{{item().title2}}</div>\r\n </div>\r\n </div>\r\n } @else if (displayMode() === displayModesEnum.Stripe ) {\r\n <div class=\"stripe\" [matContextMenuTriggerFor]=\"actions()\" [matContextMenuTriggerData]=\"{item: item()}\"\r\n (mouseenter)=\"item().isOver = true\" (mouseleave)=\"item().isOver = false\" [class.item-selected]=\"isSelected()\"\r\n [class.item-unread]=\"isRead()\" (click)=\"parent().open(item().documentId, undefined, item().chunksList)\">\r\n <div fxLayout=\"row\" fxLayoutAlign=\"start center\" fxFill>\r\n <div>\r\n <div fxLayout=\"row\">\r\n <div fxHide.xs class=\"image\">\r\n @if (canBeRead() || isSelectable()) {\r\n <div class=\"buttons\">\r\n @if (canBeRead()) {\r\n <button mat-icon-button class=\"unread-button\" matTooltip=\"Segna come già letto\"\r\n (click)=\"parent().toggleRead(item(), $event)\"><mat-icon>flag</mat-icon></button>\r\n }\r\n @if (isSelectable() && (isSelected() || item().isOver === true)) {\r\n <button mat-icon-button class=\"check\" [class.check-selected]=\"isSelected()\"\r\n matTooltip=\"Seleziona/Deseleziona\"\r\n (click)=\"parent().toggleSelection(item(), $event)\"><mat-icon>check</mat-icon></button>\r\n }\r\n </div>\r\n }\r\n @if (item().pictureId && tilePictureUrl()) {\r\n <img decoding=\"async\" loading=\"lazy\" [src]=\"tilePictureUrl() + '?id=' + item().pictureId\"\r\n [alt]=\"item().title2\" />\r\n } @else if (tileNoPictureUrl()) {\r\n <picture>\r\n <img decoding=\"async\" loading=\"lazy\" [src]=\"tileNoPictureUrl()\"\r\n [alt]=\"item().title2 || 'immagine non trovata'\" />\r\n </picture>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n <div fxFlex=\"*\" class=\"body\">\r\n <div class=\"date\">\r\n <span class=\"date-day\" [class.unread]=\"!item().isRead\">{{item().date | format:'D':'d\r\n MMMM'}}</span>\r\n <span class=\"date-divider\"></span>\r\n <span>{{item().date| format:'D':'yyyy'}}</span>\r\n </div>\r\n <div class=\"title\">{{item().title2}}</div>\r\n <div fxLayout=\"row\" fxLayoutGap=\"10px\">\r\n <div class=\"info-1\">{{item().modelName}}</div>\r\n @if (item().info) {\r\n <div class=\"info-2\">{{item().info}}</div>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n</div>","import { Breakpoints } from '@angular/cdk/layout';\r\nimport { ScrollDispatcher, ScrollingModule } from '@angular/cdk/scrolling';\r\nimport { afterNextRender, ChangeDetectionStrategy, Component, computed, effect, inject, input, signal, untracked, viewChild } from '@angular/core';\r\nimport { outputToObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport { form, FormField, FormRoot, maxLength, min } from '@angular/forms/signals';\r\nimport { SignalsUtils } from '@arsedizioni/ars-utils/core.validators';\r\nimport { MatBadge } from '@angular/material/badge';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatButtonToggleModule } from '@angular/material/button-toggle';\r\nimport { MatCheckboxModule } from '@angular/material/checkbox';\r\nimport { MatChipsModule } from '@angular/material/chips';\r\nimport { MatDatepickerModule } from '@angular/material/datepicker';\r\nimport { MatDatepickerParseErrorFixDirective } from '@arsedizioni/ars-utils/ui.controls.date';\r\nimport { MatDividerModule } from '@angular/material/divider';\r\nimport { MatExpansionModule, MatExpansionPanel } from '@angular/material/expansion';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatInput, MatInputModule } from '@angular/material/input';\r\nimport { MatMenuModule } from '@angular/material/menu';\r\nimport { MatPaginator, PageEvent } from '@angular/material/paginator';\r\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\r\nimport { MatSelectModule } from '@angular/material/select';\r\nimport { MatDrawer, MatSidenavModule } from '@angular/material/sidenav';\r\nimport { MatSlideToggleModule } from '@angular/material/slide-toggle';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\nimport { ClipperAuthors, ClipperChannel, ClipperDocumentChangeReasons, ClipperDocumentInfo, ClipperMessages, ClipperModel, ClipperModule, ClipperRegions, ClipperSearchFacetsSnapshot, ClipperSearchParams, ClipperSearchUtils, ClipperSectors, ClipperSectorTypes, ClipperSort, ClipperSources, ClipperTopicInfo, ClipperUserInfo, ClipperUserSearch, ClipperUtils, SectorInfo } from '@arsedizioni/ars-utils/clipper.common';\r\nimport { DateInterval, DtoUtils, INode, NameValueItem, SelectableModel, SystemUtils } from '@arsedizioni/ars-utils/core';\r\nimport { FlexLayoutModule, DialogResult } from '@arsedizioni/ars-utils/ui';\r\nimport { ButtonSelectorComponent, ButtonToggleComponent, ChipsSelectorComponent } from '@arsedizioni/ars-utils/ui.controls';\r\nimport { finalize, Subject } from 'rxjs';\r\nimport { debounceTime } from 'rxjs/operators';\r\nimport { ClipperDocumentMenuComponent } from '../document-menu/document-menu.component';\r\nimport { ClipperSearchFacetsComponent } from '../search-facets/search-facets.component';\r\nimport { ClipperSearchResultManager } from '../search-result-manager/search-result-manager';\r\nimport { ClipperSearchFreeTextHelpComponent } from '../search-free-text-help/search-free-text-help.component';\r\nimport { ClipperSearchFreeTextQueryBuilderComponent, SearchFreeTextQueryParams } from '../search-free-text-query-builder/search-free-text-query-builder.component';\r\nimport { ClipperSearchResultItemComponent } from '../search-result-item/search-result-item.component';\r\n\r\n\r\n\r\n\r\n/**\r\n * Shape of the browser filter-pane form model, derived from the {@link ClipperSearchParams}\r\n * DTO: every field of that DTO is optional, so it cannot back a signal form directly.\r\n *\r\n * Text fields use '' when empty, numeric/select/date fields use null, list fields use\r\n * null — never undefined, because signal forms only create child fields for defined\r\n * values. Dates are always `Date | null` — never a `Date | string` — because `null` is\r\n * what Material's date accessors write when a datepicker input is cleared.\r\n */\r\ninterface BrowserFilterForm {\r\n modules: NameValueItem<ClipperModule>[] | null;\r\n tags: NameValueItem<string>[] | null;\r\n topics: NameValueItem<string>[] | null;\r\n sectors: NameValueItem<string>[] | null;\r\n authors: NameValueItem<string>[] | null;\r\n channels: NameValueItem<any>[] | null;\r\n number: string;\r\n year: number | null;\r\n from: Date | null;\r\n to: Date | null;\r\n text: string;\r\n titleOnly: boolean;\r\n showNotAbrogatedDocumentsOnly: boolean;\r\n showCommentedDocumentsOnly: boolean;\r\n showUnreadDocumentsOnly: boolean;\r\n sourceNumber: string;\r\n sourceYear: number | null;\r\n sourceFrom: Date | null;\r\n sourceTo: Date | null;\r\n source: string | null;\r\n author: string | null;\r\n type: string | null;\r\n changedNumber: string;\r\n changedYear: number | null;\r\n changedTitle: string;\r\n modifierNumber: string;\r\n modifierYear: number | null;\r\n modifierTitle: string;\r\n changeReason: number | null;\r\n}\r\n\r\n/**\r\n * Revives a range bound coming from a saved filter, whose data is stored as JSON and\r\n * therefore hands the dates back as ISO strings. The form model only ever holds `Date`.\r\n * @param value - The raw bound read from the search parameters.\r\n * @returns The bound as a `Date`, or `null` when it is absent or unparseable.\r\n */\r\nfunction toDate(value: Date | string | undefined): Date | null {\r\n if (!value) return null;\r\n const date = value instanceof Date ? value : new Date(value);\r\n return isNaN(date.getTime()) ? null : date;\r\n}\r\n\r\n/** Neutral form model: it declares every field the form owns and its empty value. */\r\nconst _EMPTY_ITEM: BrowserFilterForm = {\r\n modules: null,\r\n tags: null,\r\n topics: null,\r\n sectors: null,\r\n authors: null,\r\n channels: null,\r\n number: '',\r\n year: null,\r\n from: null,\r\n to: null,\r\n text: '',\r\n titleOnly: false,\r\n showNotAbrogatedDocumentsOnly: false,\r\n showCommentedDocumentsOnly: false,\r\n showUnreadDocumentsOnly: false,\r\n sourceNumber: '',\r\n sourceYear: null,\r\n sourceFrom: null,\r\n sourceTo: null,\r\n source: null,\r\n author: null,\r\n type: null,\r\n changedNumber: '',\r\n changedYear: null,\r\n changedTitle: '',\r\n modifierNumber: '',\r\n modifierYear: null,\r\n modifierTitle: '',\r\n changeReason: null,\r\n};\r\n\r\n@Component({\r\n selector: 'clipper-browser',\r\n standalone: true,\r\n imports: [FormField, FormRoot, FlexLayoutModule, MatIconModule, MatButtonModule, MatTooltipModule, MatSidenavModule,\r\n MatExpansionModule, MatDividerModule, MatMenuModule, MatFormFieldModule, MatInputModule, MatDatepickerModule, MatDatepickerParseErrorFixDirective, MatBadge,\r\n ScrollingModule, MatSelectModule, MatChipsModule, MatSlideToggleModule, MatPaginator, MatCheckboxModule, MatButtonToggleModule, MatProgressBarModule,\r\n ChipsSelectorComponent, ButtonSelectorComponent, ButtonToggleComponent,\r\n ClipperSearchResultItemComponent,\r\n ClipperDocumentMenuComponent, ClipperSearchFacetsComponent],\r\n templateUrl: './browser.component.html',\r\n styleUrl: './browser.component.scss',\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class ClipperBrowserComponent extends ClipperSearchResultManager {\r\n /** Error text of a field: the message declared in the schema, or the shared fallback. */\r\n protected readonly getErrorMessage = SignalsUtils.getFieldErrorMessage;\r\n\r\n /**\r\n * Error text for a date range: whichever end is in error speaks for the pair.\r\n * @param from - Errors of the start field, from `f.from().errors()`.\r\n * @param to - Errors of the end field, from `f.to().errors()`.\r\n * @returns The text to show under the range, or `undefined` when neither end is in error.\r\n */\r\n protected rangeErrorMessage(\r\n from: readonly { kind: string; message?: string }[],\r\n to: readonly { kind: string; message?: string }[]\r\n ): string | undefined {\r\n return SignalsUtils.getFieldErrorMessage(from.length ? from : to, 'Intervallo non valido.');\r\n }\r\n\r\n\r\n\r\n readonly filterByNumber = viewChild<MatInput>('filterByNumber');\r\n readonly filterByText = viewChild<MatInput>('filterByText');\r\n readonly filterByChangeNumber = viewChild<MatInput>('filterByChangeNumber');\r\n readonly filterPane = viewChild.required<MatDrawer>('filterPane');\r\n readonly filterPane2 = viewChild.required<MatDrawer>('filterPane2');\r\n readonly filterSelector = viewChild<ButtonSelectorComponent>('filterSelector');\r\n readonly moduleSelector = viewChild.required<ChipsSelectorComponent>('moduleSelector');\r\n readonly sourceExpansionPanel = viewChild<MatExpansionPanel>('sourceExpansionPanel');\r\n readonly otherOptionsExpansionPanel = viewChild<MatExpansionPanel>('otherOptionsExpansionPanel');\r\n readonly modifierExpansionPanel = viewChild<MatExpansionPanel>('modifierExpansionPanel');\r\n readonly showChannels = input<boolean>(true);\r\n readonly showRSOptions = input<boolean>(true);\r\n readonly showAIAssistantOptions = input<boolean>(false);\r\n readonly selectableModules = input<ClipperModule[]>([]);\r\n readonly initialModule = input<ClipperModule | undefined>(undefined);\r\n protected scrollDispatcher = inject(ScrollDispatcher);\r\n protected readonly filterDescription = signal<string>('');\r\n protected readonly filters = signal<NameValueItem<ClipperUserSearch>[]>([]);\r\n\r\n /** Currently selected saved filter, derived from the filters list and the active search id. */\r\n protected readonly filter = computed<NameValueItem<ClipperUserSearch> | undefined>(() =>\r\n this.hasFilters() && this.filterParams.searchId\r\n ? this.filters().find(x => x.value.id === this.filterParams.searchId)\r\n : undefined\r\n );\r\n\r\n /** True when the user has access to the AI assistant feature. */\r\n protected readonly hasAIAssistant = computed(() =>\r\n this.showAIAssistantOptions() && this.clipperService.user?.hasAIAssistant === true\r\n );\r\n\r\n /** True when at least one saved filter is available. */\r\n protected readonly hasFilters = computed(() => this.filters().length > 0);\r\n\r\n /**\r\n * Checks whether the current module selection targets law-related content.\r\n * @param allowEmpty - When true, an empty module list also counts as law-related. Defaults to true.\r\n * @returns True if the selection includes any law module or (when allowEmpty) is empty.\r\n */\r\n protected isLaws(allowEmpty: boolean = true): boolean {\r\n const modules = this.filterModel().modules;\r\n return (allowEmpty && (modules?.length ?? 0) === 0) ||\r\n (modules?.findIndex(x =>\r\n x.value === ClipperModule.GazzetteBollettiniEFontiDiverse ||\r\n x.value === ClipperModule.NormativaVigente ||\r\n x.value === ClipperModule.GiurisprudenzaRecente) ?? -1) !== -1;\r\n }\r\n\r\n /**\r\n * Checks whether the currently selected modules produce readable content.\r\n * @returns True when the modules allow content reading.\r\n */\r\n protected isReadable(): boolean {\r\n const modules = this.filterModel().modules;\r\n return (this.canSearch() && (modules?.length ?? 0) === 0) ||\r\n ((modules?.length ?? 0) > 0 &&\r\n (modules?.findIndex(\r\n m => m.value === ClipperModule.NormativaVigente || m.value === ClipperModule.ScadenzeESegnalazioni\r\n ) ?? -1) === -1);\r\n }\r\n\r\n /**\r\n * Checks whether the current selection targets the coordination module.\r\n * @returns True when the 'ModificheAbrogazioniERinvii' module is selected.\r\n */\r\n protected isCoordination(): boolean {\r\n const modules = this.filterModel().modules;\r\n return (modules?.length ?? 0) > 0 &&\r\n (modules?.findIndex(x => x.value === ClipperModule.ModificheAbrogazioniERinvii) ?? -1) !== -1;\r\n }\r\n\r\n /**\r\n * Checks whether the current sort mode is one of the date-based sort options.\r\n * @returns True when results are sorted by date (ascending or descending).\r\n */\r\n protected isSortedByDate(): boolean {\r\n return this.sortMode()?.value === ClipperSort.DateAsc ||\r\n this.sortMode()?.value === ClipperSort.DateDesc ||\r\n this.sortMode()?.value === ClipperSort.SourceDateAsc ||\r\n this.sortMode()?.value === ClipperSort.SourceDateDesc;\r\n }\r\n\r\n /**\r\n * Checks whether the current filter parameters define a valid search.\r\n * @returns True when at least one filter parameter has been set.\r\n */\r\n protected canSearch(): boolean {\r\n return this.isFiltering(this.filterParams);\r\n }\r\n\r\n protected readonly sectors = signal<SectorInfo[]>([]);\r\n\r\n /**\r\n * Checks whether sector-based filtering is available for the current selection.\r\n * @returns True when sector filtering applies.\r\n */\r\n protected hasSectors(): boolean {\r\n return this.isLaws();\r\n }\r\n\r\n protected readonly regions = signal<NameValueItem<string>[]>([]);\r\n\r\n /**\r\n * Checks whether region-based filtering is available.\r\n * @returns True when the selection includes sectors with regional content (LR).\r\n */\r\n protected override readonly hasRegions = computed(() =>\r\n this.hasSectors() && (this.filterModel().sectors?.filter(n => n.value === 'LR').length ?? 0) > 0\r\n );\r\n\r\n protected readonly sources = signal<NameValueItem<string>[]>([...ClipperSources]);\r\n\r\n /**\r\n * Checks whether source-based filtering applies to the current module selection.\r\n * @returns True when source filtering is available.\r\n */\r\n protected hasSource(): boolean {\r\n return this.isLaws();\r\n }\r\n\r\n protected readonly authors = signal<NameValueItem<string>[]>([]);\r\n protected readonly types = signal<NameValueItem<string>[]>([]);\r\n /** Topic tree loaded on initialization, used as input for the tree-selection dialog. */\r\n protected topics: INode[] = [];\r\n\r\n /**\r\n * Checks whether topic-based filtering applies to the current module selection.\r\n * @returns True when topic filtering is available.\r\n */\r\n protected hasTopics(): boolean {\r\n return this.isLaws();\r\n }\r\n\r\n protected readonly tags = signal<NameValueItem<string>[]>([]);\r\n\r\n /**\r\n * Checks whether tag-based filtering is available for the current modules.\r\n * @returns True when tags are loaded and the selection includes news or in-depth modules.\r\n */\r\n protected hasTags(): boolean {\r\n const modules = this.filterModel().modules;\r\n return this.tags().length > 0 &&\r\n ((modules?.length === 0 &&\r\n (this.hasModule(ClipperModule.News) || this.hasModule(ClipperModule.Approfondimenti))) ||\r\n (modules?.findIndex(\r\n m => m.value === ClipperModule.News || m.value === ClipperModule.Approfondimenti\r\n ) ?? -1) !== -1);\r\n }\r\n protected reasons = signal<NameValueItem<number>[]>([...ClipperDocumentChangeReasons]);\r\n protected modules = signal<NameValueItem<ClipperModule>[]>(this.getAllModules());\r\n\r\n /**\r\n * The subset of modules available for selection, filtered by `selectableModules` when it is non-empty.\r\n * Falls back to all modules when `selectableModules` is empty or null.\r\n */\r\n protected readonly filteredModules = computed<NameValueItem<ClipperModule>[]>(() => {\r\n const selectable = this.selectableModules();\r\n if (!selectable || selectable.length === 0) return this.modules();\r\n return this.modules().filter(m => selectable.includes(m.value));\r\n });\r\n protected user: ClipperUserInfo | undefined = this.clipperService.user;\r\n\r\n /**\r\n * Model backing the filter-pane signal form. This is the single source of truth\r\n * for every filter value bound in the template; `filterParams` only carries the\r\n * assembled query DTO (see toForm/toPayload and loadFilter). Empty values are\r\n * '' / null / false / null-array — never undefined, so every child field exists.\r\n */\r\n protected readonly filterModel = signal<BrowserFilterForm>(DtoUtils.toForm(_EMPTY_ITEM));\r\n\r\n /**\r\n * Signal form for the filter pane. The four year fields accept values from 1750\r\n * (previously the native min attribute on the inputs).\r\n */\r\n protected readonly filterForm = form(this.filterModel, p => {\r\n min(p.year, 1750);\r\n min(p.sourceYear, 1750);\r\n min(p.changedYear, 1750);\r\n min(p.modifierYear, 1750);\r\n maxLength(p.number, 10);\r\n maxLength(p.sourceNumber, 10);\r\n maxLength(p.changedNumber, 10);\r\n maxLength(p.modifierNumber, 10);\r\n maxLength(p.text, 200);\r\n maxLength(p.changedTitle, 200);\r\n maxLength(p.modifierTitle, 200);\r\n });\r\n\r\n /** Root signal form for the sort-mode button selector. */\r\n protected readonly sortForm = form(this.sortMode);\r\n\r\n /** Debounced stream of keyup events on the interval inputs (shorthand typing support). */\r\n private readonly intervalKeyup = new Subject<{ event: KeyboardEvent; source: boolean; end: boolean }>();\r\n\r\n /**\r\n * Applies a partial update to the filter model.\r\n * @param patch - The fields to change.\r\n */\r\n private patchFilter(patch: Partial<BrowserFilterForm>): void {\r\n this.filterModel.update(m => ({ ...m, ...patch }));\r\n }\r\n\r\n /**\r\n * Blocks the space key on the interval inputs; it is reserved as the\r\n * \"copy the other bound\" shortcut handled by onIntervalKeyup.\r\n * @param event - The keydown event from a start or end date input.\r\n */\r\n protected onIntervalKeydown(event: KeyboardEvent): void {\r\n if (event.key === ' ') {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n }\r\n }\r\n\r\n /**\r\n * Forwards keyup events of the interval inputs to the debounced shorthand parser.\r\n * @param event - The keyup event from a start or end date input.\r\n * @param source - `true` when the event comes from the source-publication range.\r\n * @param end - `true` when the event comes from an end-date input.\r\n */\r\n protected onIntervalKeyup(event: KeyboardEvent, source: boolean, end: boolean): void {\r\n this.intervalKeyup.next({ event, source, end });\r\n }\r\n\r\n /**\r\n * Clears one of the two publication ranges.\r\n * @param source - `true` to clear the source-publication range.\r\n */\r\n protected clearInterval(source: boolean = false): void {\r\n this.patchFilter(source ? { sourceFrom: null, sourceTo: null } : { from: null, to: null });\r\n }\r\n private _viewReady = false;\r\n\r\n\r\n constructor() {\r\n super();\r\n\r\n // Initialize filter params with defaults\r\n this.filterParams.version = 7;\r\n this.patchFilter({ modules: [{ name: \"Normativa vigente\", shortName: \"Normativa vigente\", value: ClipperModule.NormativaVigente }] });\r\n this.initializeFilter();\r\n\r\n // Shorthand typing on the interval inputs (e.g. \"d/m\"): same behavior as\r\n // DateIntervalChangeDirective, rewired to the signal form.\r\n this.intervalKeyup\r\n .pipe(debounceTime(100), takeUntilDestroyed(this.destroyRef))\r\n .subscribe(({ event, source, end }) => {\r\n const value = (event.target as HTMLInputElement)?.value;\r\n if (value !== undefined) {\r\n const m = this.filterModel();\r\n const interval = source\r\n ? new DateInterval(m.sourceFrom ?? undefined, m.sourceTo ?? undefined)\r\n : new DateInterval(m.from ?? undefined, m.to ?? undefined);\r\n SystemUtils.changeDateInterval(value, interval, end, event.key === ' ');\r\n this.patchFilter(source\r\n ? { sourceFrom: interval.from ?? null, sourceTo: interval.to ?? null }\r\n : { from: interval.from ?? null, to: interval.to ?? null });\r\n }\r\n });\r\n\r\n // Initialize document selection model\r\n this.selection = new SelectableModel<ClipperDocumentInfo, string>(true, 'documentId');\r\n\r\n // React to breakpoint changes to update the filter pane layout\r\n this.breakpointObserver\r\n .observe([\r\n Breakpoints.XSmall,\r\n Breakpoints.Small,\r\n Breakpoints.Medium,\r\n Breakpoints.Large,\r\n Breakpoints.XLarge,\r\n ])\r\n .pipe(takeUntilDestroyed(this.destroyRef))\r\n .subscribe(result => {\r\n if (!this._viewReady) return; // DOM not ready yet\r\n for (const query of Object.keys(result.breakpoints)) {\r\n if (result.breakpoints[query]) {\r\n this.handleFilterPaneVisibility();\r\n }\r\n }\r\n });\r\n\r\n // React to broadcasted messages\r\n this.broadcastService.getMessage()\r\n .pipe(takeUntilDestroyed(this.destroyRef))\r\n .subscribe(message => {\r\n if (message.id === ClipperMessages.ERROR) {\r\n this.dialogService.error(message.data?.message ?? \"Si è verificato un errore sconosciuto.\", \"Errore in Clipper\");\r\n } else if (message.id === ClipperMessages.SUCCESS || message.id === ClipperMessages.SUCCESS_TOAST) {\r\n if (message.id === ClipperMessages.SUCCESS) {\r\n this.dialogService.info(message.data?.message ?? \"Operazione completata con successo.\");\r\n } else {\r\n this.dialogService.toast(\r\n message.data?.message ?? \"Operazione completata con successo.\", \r\n message.data?.duration ?? 3000,\r\n message.data?.icon ?? 'check'\r\n );\r\n }\r\n } else if (message.id === ClipperMessages.COMMAND_DASHBOARD_UPDATED) {\r\n this.updateModulesUnreadItems();\r\n } else if (message.id === ClipperMessages.COMMAND_SEARCH_RESTORED) {\r\n const filter = this.filter();\r\n if (filter) {\r\n this.selectFilter(filter);\r\n }\r\n this.handleFilterPaneVisibility();\r\n }\r\n });\r\n\r\n // Load tags if the feature is enabled for this user\r\n if (this.clipperService.allowTags()) {\r\n this.loadTags();\r\n }\r\n\r\n // Load topics and saved searches\r\n this.loadTopics();\r\n this.loadFilters();\r\n\r\n // Set up view-dependent behaviour after the first render\r\n afterNextRender(() => {\r\n this._viewReady = true;\r\n this.handleFilterPaneVisibility();\r\n this.filterPane().openedChange\r\n .pipe(takeUntilDestroyed(this.destroyRef))\r\n .subscribe(opened => {\r\n this.updateFilterPaneFocus();\r\n // Sync backdrop with actual open state when in overlay mode\r\n if (this.filterPane().mode === 'over') {\r\n this.filterPaneHasBackdrop.set(opened);\r\n }\r\n });\r\n this.filterPane2().openedChange\r\n .pipe(takeUntilDestroyed(this.destroyRef))\r\n .subscribe(opened => {\r\n if (this.filterPane2().mode === 'over') {\r\n this.filterPane2HasBackdrop.set(opened);\r\n }\r\n });\r\n this.updateFilterPaneFocus();\r\n this.updateModulesUnreadItems();\r\n this.modulesChanged();\r\n\r\n // Subscribe to facet changes\r\n const facets = this.facets();\r\n if (facets) {\r\n outputToObservable(facets.changed)\r\n .pipe(takeUntilDestroyed(this.destroyRef))\r\n .subscribe((value: ClipperSearchFacetsSnapshot) => {\r\n if (this.snapshot) {\r\n this.snapshot.facets = value;\r\n this.fetch(true);\r\n }\r\n });\r\n }\r\n });\r\n\r\n // React to initialModule changes: preselect the matching module in the UI and in filterParams\r\n effect(() => {\r\n const initialModule = this.initialModule();\r\n const selector = this.moduleSelector();\r\n const selected = this.filteredModules().find(x => x.value === initialModule) ?? this.filteredModules()[0];\r\n // Use untracked to prevent signal reads inside select() and modulesChanged()\r\n // from becoming dependencies of this effect, which would cause a sectors read/write cycle.\r\n // The work is deferred one tick: the chips-selector propagates through its [formField]\r\n // binding, whose input is not available yet while this effect first runs.\r\n untracked(() => {\r\n setTimeout(() => {\r\n selector.select(selected);\r\n if (selected) {\r\n this.patchFilter({ modules: [selected] });\r\n this.modulesChanged();\r\n }\r\n });\r\n });\r\n });\r\n\r\n // Trim the selected modules to only include items still available in filteredModules\r\n effect(() => {\r\n const available = this.filteredModules();\r\n const modules = untracked(this.filterModel).modules;\r\n if (modules) {\r\n this.patchFilter({\r\n modules: modules.filter(x => available.findIndex(y => y.value === x.value) !== -1),\r\n });\r\n }\r\n });\r\n }\r\n\r\n\r\n /**\r\n * Get all available modules\r\n */\r\n private getAllModules(): NameValueItem<ClipperModule>[] {\r\n let modules: NameValueItem<ClipperModule>[] = [];\r\n modules.push({ name: \"News\", shortName: \"News\", value: ClipperModule.News });\r\n modules.push({ name: \"Gazzette, Bollettini e fonti diverse\", shortName: \"Gazzette, Bollettini e fonti diverse\", value: ClipperModule.GazzetteBollettiniEFontiDiverse });\r\n modules.push({ name: \"Modifiche, abrogazioni e rinvii\", shortName: \"Modifiche, abrogazioni e rinvii\", value: ClipperModule.ModificheAbrogazioniERinvii });\r\n modules.push({ name: \"Normativa vigente\", shortName: \"Normativa vigente\", value: ClipperModule.NormativaVigente });\r\n modules.push({ name: \"Giurisprudenza\", shortName: \"Giurisprudenza\", value: ClipperModule.GiurisprudenzaRecente });\r\n modules.push({ name: \"Articoli\", shortName: \"Articoli\", value: ClipperModule.Approfondimenti });\r\n modules.push({ name: \"Note a sentenza\", shortName: \"Note a sentenza\", value: ClipperModule.Giurisprudenza });\r\n modules.push({ name: \"Quesiti\", shortName: \"Quesiti\", value: ClipperModule.QuesitiECasiRisolti });\r\n return modules;\r\n }\r\n\r\n /**\r\n * Return the snapshot document by id\r\n * @param id : the document id\r\n * @returns the document or null\r\n */\r\n public getSnapshotDocument(id: string): ClipperDocumentInfo | undefined {\r\n return this.snapshot.items.find(x => x.documentId === id || x.id === id);\r\n }\r\n\r\n\r\n /**\r\n * Loads available tags from the server and populates the tag signal.\r\n */\r\n protected loadTags(): void {\r\n this.clipperService.documents.getTags()\r\n .subscribe(r => {\r\n if (r.success) {\r\n this.tags.set(r.value);\r\n }\r\n });\r\n }\r\n\r\n\r\n /**\r\n * Load topics\r\n */\r\n private loadTopics() {\r\n if (!this.clipperService.loggedIn()) return;\r\n this.clipperService.documents.getTopicsAsTree()\r\n .subscribe(r => {\r\n if (!r.success) this.dialogService.error(r.message);\r\n else {\r\n this.topics = SystemUtils.toNodes(r.value.children as INode[]);\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Show hide filter pane manually\r\n */\r\n protected toggleFilterPane() {\r\n this.filterPaneClosed.set(!this.filterPaneClosed());\r\n this.filterPane()?.toggle();\r\n }\r\n\r\n /**\r\n * Show hide filter pane manually\r\n */\r\n protected toggleFilterPane2() {\r\n this.filterPane2Closed.set(!this.filterPane2Closed());\r\n this.filterPane2()?.toggle();\r\n }\r\n\r\n\r\n /**\r\n * Handle filter pane visibility\r\n */\r\n protected handleFilterPaneVisibility() {\r\n const filterPane = this.filterPane();\r\n if (filterPane) {\r\n if (this.breakpointObserver.isMatched(Breakpoints.XSmall) ||\r\n this.breakpointObserver.isMatched(Breakpoints.Small) ||\r\n this.breakpointObserver.isMatched(Breakpoints.Medium)) {\r\n if (filterPane.opened) {\r\n filterPane.close();\r\n }\r\n filterPane.mode = 'over';\r\n filterPane.disableClose = false;\r\n this.filterPaneHasBackdrop.set(filterPane.opened);\r\n } else {\r\n if (!filterPane.opened && !this.filterPaneClosed()) {\r\n filterPane.open();\r\n } else if (filterPane.opened && this.filterPaneClosed()) {\r\n filterPane.close();\r\n }\r\n filterPane.mode = 'side';\r\n filterPane.disableClose = true;\r\n this.filterPaneHasBackdrop.set(false);\r\n }\r\n }\r\n setTimeout(() => {\r\n const filterPane2 = this.filterPane2();\r\n if (filterPane2) {\r\n if (this.breakpointObserver.isMatched(Breakpoints.XSmall) ||\r\n this.breakpointObserver.isMatched(Breakpoints.Small) ||\r\n this.breakpointObserver.isMatched(Breakpoints.Medium)) {\r\n if (filterPane2.opened) {\r\n filterPane2.close();\r\n }\r\n filterPane2.mode = 'over';\r\n filterPane2.disableClose = false;\r\n this.filterPane2HasBackdrop.set(filterPane2.opened);\r\n } else {\r\n if (!this.hasFacets()) {\r\n filterPane2.close();\r\n } else if (!filterPane2.opened && !this.filterPane2Closed()) {\r\n filterPane2.open();\r\n } else if (filterPane2.opened && this.filterPane2Closed()) {\r\n filterPane2.close();\r\n }\r\n filterPane2.mode = 'side';\r\n filterPane2.disableClose = true;\r\n this.filterPane2HasBackdrop.set(false);\r\n }\r\n }\r\n }, 250);\r\n }\r\n\r\n /**\r\n * Initialize filter\r\n */\r\n private initializeFilter() {\r\n this.patchFilter({ channels: this.clipperService.activeChannels() });\r\n this.channelsChanged(false);\r\n }\r\n\r\n /**\r\n * Update filter when channels changes\r\n * @param updateChannels: true to update channels\r\n */\r\n protected channelsChanged(updateChannels: boolean = true) {\r\n if (updateChannels) {\r\n this.clipperService.account.updateChannels(this.filterModel().channels ?? undefined);\r\n }\r\n const sectors: SectorInfo[] = [];\r\n const regions: NameValueItem<string>[] = [];\r\n let modules = this.getAllModules();\r\n const channels: NameValueItem<ClipperChannel>[] = this.filterModel().channels ?? [];\r\n // \"Scadenze e segnalazioni\" belongs to the \"Lavoro e Ambiente\" channel only.\r\n if (channels.some(x => x.value === ClipperChannel.LavoroEAmbiente)) {\r\n modules.push({ name: \"Scadenze e segnalazioni\", shortName: \"Scadenze e segnalazioni\", value: ClipperModule.ScadenzeESegnalazioni });\r\n }\r\n // \"Quesiti\" is not part of the \"Energia\" channel: drop it when that is the only selected one.\r\n if (channels.length > 0 && channels.every(x => x.value === ClipperChannel.Energia)) {\r\n modules = modules.filter(x => x.value !== ClipperModule.QuesitiECasiRisolti);\r\n }\r\n channels.forEach(channel => {\r\n const channelSettings = this.clipperService.loginInfo?.channels?.find(x => x.channelId === channel.value);\r\n if (channelSettings) {\r\n channelSettings.sectors.filter(x => x.checked).forEach(x => {\r\n if (sectors.findIndex(y => y.value === x.value) === -1) {\r\n ClipperSectors.filter(y => y.group === 'S' && y.value === x.value).forEach(y => {\r\n sectors.push(y);\r\n });\r\n }\r\n });\r\n channelSettings.regions.filter(x => x.checked).forEach(x => {\r\n if (regions.findIndex(y => y.value === x.value) === -1) {\r\n ClipperRegions.filter(y => y.value === x.value).forEach(y => {\r\n regions.push(y);\r\n });\r\n }\r\n });\r\n }\r\n });\r\n this.modules.set(modules);\r\n this.sectors.set(sectors);\r\n this.regions.set(regions);\r\n const m = this.filterModel();\r\n this.patchFilter({\r\n modules: m.modules ? m.modules.filter(x => this.modules().findIndex(y => y.value === x.value) !== -1) : m.modules,\r\n sectors: m.sectors ? m.sectors.filter(x => this.sectors().findIndex(y => y.value === x.value) !== -1) : m.sectors,\r\n authors: m.authors ? m.authors.filter(x => this.regions().findIndex(y => y.value === x.value) !== -1) : m.authors,\r\n });\r\n this.sectorsChanged();\r\n this.updateModulesUnreadItems();\r\n }\r\n\r\n /**\r\n * Update filter pane focus\r\n */\r\n private updateFilterPaneFocus() {\r\n setTimeout(() => {\r\n let focusableElement = this.filterByText();\r\n if (this.isLaws()) {\r\n focusableElement = this.filterByNumber();\r\n }\r\n focusableElement?.focus();\r\n }, 250);\r\n }\r\n\r\n /**\r\n * Loads the user's saved searches from the server and populates the filter selector.\r\n */\r\n protected loadFilters(): void {\r\n if (!this.clipperService.loggedIn()) return;\r\n this.clipperService.documents.loadSearches(ClipperModule.Ricerca)\r\n .subscribe(\r\n r => {\r\n if (r.success) {\r\n const items: NameValueItem<ClipperUserSearch>[] = [];\r\n r.value.forEach(n => {\r\n items.push({ name: n.name ?? '', value: n });\r\n });\r\n this.filters.set(items);\r\n this.handleFilterPaneVisibility();\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Saves the current filter parameters as a named search.\r\n * @param newFilter - When true, always prompts for a new filter name; otherwise updates the existing one. Defaults to false.\r\n */\r\n async saveFilter(newFilter: boolean = false): Promise<void> {\r\n this.loadFilter();\r\n if (newFilter || !this.filterParams.searchId) {\r\n const d = await this.dialogService.prompt(\r\n \"Crea un nuovo filtro\",\r\n 0,\r\n \"Nome filtro\");\r\n d?.componentInstance.done.subscribe((data) => {\r\n if (data?.value) {\r\n this.clipperService.documents.saveSearch({\r\n module: ClipperModule.Ricerca,\r\n name: data.value,\r\n data: JSON.stringify(this.filterParams)\r\n }).subscribe(r => {\r\n if (!r.success) {\r\n this.dialogService.error(r.message);\r\n } else {\r\n const newItem = { name: r.value.name ?? '', value: r.value };\r\n this.filters.update(items => [...items, newItem]);\r\n setTimeout(() => {\r\n this.filterSelector()?.select(newItem);\r\n }, 250);\r\n this.dialogService.toast(\"Operazione completata con successo.\");\r\n d.close();\r\n }\r\n });\r\n }\r\n });\r\n } else {\r\n this.clipperService.documents.saveSearch({\r\n id: this.filterParams.searchId,\r\n data: JSON.stringify(this.filterParams)\r\n }).subscribe(r => {\r\n if (!r.success) {\r\n this.dialogService.error(r.message);\r\n } else {\r\n this.filters.update(items => {\r\n const item = items.find(n => n.value.id === r.value.id);\r\n if (item) {\r\n item.value.data = r.value.data;\r\n }\r\n return [...items];\r\n });\r\n this.dialogService.toast(\"Operazione completata con successo.\");\r\n }\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Prompts for confirmation and then deletes the currently active saved filter.\r\n */\r\n deleteFilter(): void {\r\n if (this.filterParams.searchId) {\r\n this.dialogService.confirm(\"Vuoi davvero eliminare il filtro in uso?\", \"Conferma\", \"Si, eliminalo\")\r\n .componentInstance.choosen\r\n .subscribe((data: DialogResult) => {\r\n if (data.result === 'ok') {\r\n if (this.filterParams.searchId) {\r\n this.clipperService.documents.deleteSearch(this.filterParams.searchId)\r\n .subscribe(r => {\r\n if (!r.success) {\r\n this.dialogService.error(r.message);\r\n } else {\r\n this.filters.update(items => {\r\n const p = items.findIndex(x => x.value.id === this.filterParams.searchId);\r\n if (p !== -1) {\r\n items.splice(p, 1);\r\n }\r\n return [...items];\r\n });\r\n this.filterSelector()?.reset();\r\n this.filterParams.searchId = undefined;\r\n this.filterParams.searchName = undefined;\r\n this.dialogService.toast('Operazione completata con successo.');\r\n }\r\n });\r\n }\r\n }\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Applies a saved filter by deserializing its parameters into the current filter state.\r\n * @param item - The saved filter to apply, or undefined to clear the filter.\r\n */\r\n selectFilter(item: NameValueItem<ClipperUserSearch> | undefined): void {\r\n if (item && item.value.data) {\r\n this.filterSelector().select(item, false);\r\n const filter = JSON.parse(item.value.data);\r\n this.filterParams.searchId = item.value.id;\r\n this.filterParams.searchName = item.value.name;\r\n this.patchFilter({ modules: filter.modules ?? null });\r\n setTimeout(() => {\r\n this.filterParams.topic = filter.topic;\r\n // The channels are a per-account preference, not part of the saved filter.\r\n this.filterModel.set({ ...this.toForm(filter), channels: this.filterModel().channels });\r\n // Show expansion panels\r\n const m = this.filterModel();\r\n if (m.sourceNumber !== '' ||\r\n m.sourceYear != undefined ||\r\n m.source != undefined ||\r\n m.sourceFrom != undefined) {\r\n this.sourceExpansionPanel()?.open();\r\n }\r\n if (!this.isCoordination() && m.sourceNumber !== '' ||\r\n m.author != undefined ||\r\n m.type != undefined) {\r\n this.otherOptionsExpansionPanel()?.open();\r\n } else if (this.isCoordination() && m.changeReason != undefined) {\r\n this.otherOptionsExpansionPanel()?.open();\r\n }\r\n if (this.isCoordination() &&\r\n m.modifierNumber !== '' ||\r\n m.modifierYear != undefined ||\r\n m.modifierTitle !== '') {\r\n this.modifierExpansionPanel()?.open();\r\n }\r\n }, 250);\r\n } else {\r\n this.clearFilter();\r\n }\r\n\r\n }\r\n\r\n /**\r\n * Clear current filter params\r\n */\r\n protected clearFilter() {\r\n ClipperSearchUtils.clear(this.filterParams);\r\n const module = this.modules().find(x => x.value === ClipperModule.NormativaVigente);\r\n const channels = this.filterModel().channels;\r\n this.filterModel.set({\r\n ...DtoUtils.toForm(_EMPTY_ITEM),\r\n channels,\r\n modules: module ? [module] : null,\r\n });\r\n this.filterSelector()?.reset();\r\n this.filterParams.searchId = undefined;\r\n this.filterParams.searchName = undefined;\r\n }\r\n\r\n /**\r\n * Builds the filter form model from a set of search parameters.\r\n *\r\n * Ad-hoc because the two publication ranges do not map field-to-field: the DTO keeps\r\n * them as `fromDate`/`toDate`, and a range is only restored when both of its bounds\r\n * are set, exactly as the saved filters were written.\r\n *\r\n * @param dto - The search parameters to read: the live `filterParams` on a state\r\n * restore, or the deserialized data of a saved filter.\r\n * @returns A fresh form model; the caller decides what to keep of the current one.\r\n */\r\n private toForm(dto: Partial<ClipperSearchParams>): BrowserFilterForm {\r\n const model = DtoUtils.toForm(_EMPTY_ITEM, dto as unknown as Partial<BrowserFilterForm>);\r\n const from = toDate(dto.fromDate);\r\n const to = toDate(dto.toDate);\r\n const sourceFrom = toDate(dto.sourceFromDate);\r\n const sourceTo = toDate(dto.sourceToDate);\r\n model.from = from && to ? from : null;\r\n model.to = from && to ? to : null;\r\n model.sourceFrom = sourceFrom && sourceTo ? sourceFrom : null;\r\n model.sourceTo = sourceFrom && sourceTo ? sourceTo : null;\r\n return model;\r\n }\r\n\r\n /**\r\n * Builds the search payload out of the filter model, normalizing empty values back to\r\n * the undefined-based convention of {@link ClipperSearchParams}.\r\n *\r\n * Ad-hoc for two reasons. The two publication ranges are not payload fields: they\r\n * reach the DTO as `fromDate`/`toDate` through {@link loadFilter} and\r\n * {@link prepareFetch}. And every key has to be listed, `undefined` included, because\r\n * `filterParams` is a long-lived object — reused across searches and serialized into\r\n * saved filters — so a field the user has just emptied must be overwritten, not\r\n * merely left out of the copy the way {@link DtoUtils.toPayload} does.\r\n *\r\n * @returns The subset of the search parameters the filter pane owns.\r\n */\r\n private toPayload(): Partial<ClipperSearchParams> {\r\n const { from, to, sourceFrom, sourceTo, ...rest } = this.filterModel();\r\n const dto = DtoUtils.toPayload(rest);\r\n return {\r\n modules: dto.modules,\r\n tags: dto.tags,\r\n topics: dto.topics,\r\n sectors: dto.sectors as unknown as SectorInfo[],\r\n authors: dto.authors,\r\n channels: dto.channels,\r\n number: dto.number,\r\n year: dto.year,\r\n text: dto.text,\r\n titleOnly: dto.titleOnly,\r\n showNotAbrogatedDocumentsOnly: dto.showNotAbrogatedDocumentsOnly,\r\n showCommentedDocumentsOnly: dto.showCommentedDocumentsOnly,\r\n showUnreadDocumentsOnly: dto.showUnreadDocumentsOnly,\r\n sourceNumber: dto.sourceNumber,\r\n sourceYear: dto.sourceYear,\r\n source: dto.source,\r\n author: dto.author,\r\n type: dto.type,\r\n changedNumber: dto.changedNumber,\r\n changedYear: dto.changedYear,\r\n changedTitle: dto.changedTitle,\r\n modifierNumber: dto.modifierNumber,\r\n modifierYear: dto.modifierYear,\r\n modifierTitle: dto.modifierTitle,\r\n changeReason: dto.changeReason,\r\n };\r\n }\r\n\r\n /**\r\n * Commits the form model to filterParams before the component state is serialised.\r\n */\r\n protected override onStateSaving(): void {\r\n Object.assign(this.filterParams, this.toPayload());\r\n }\r\n\r\n /**\r\n * Rebuilds the form model from filterParams after a state restore.\r\n * The publication intervals are intentionally not rebuilt here — filterParams carries\r\n * no fromDate/toDate at this point — matching the historical behavior where the range\r\n * inputs were not restored.\r\n */\r\n protected override onStateRestored(): void {\r\n const current = this.filterModel();\r\n this.filterModel.set({\r\n ...this.toForm(this.filterParams),\r\n from: current.from,\r\n to: current.to,\r\n sourceFrom: current.sourceFrom,\r\n sourceTo: current.sourceTo,\r\n });\r\n }\r\n\r\n /**\r\n * Builds a DateInterval for the publication range of the current model.\r\n * @param source - When true, uses the source-publication range instead.\r\n * @returns The interval, with raw (non-normalized) bounds.\r\n */\r\n private modelInterval(source: boolean = false): DateInterval {\r\n const m = this.filterModel();\r\n return source\r\n ? new DateInterval(m.sourceFrom ?? undefined, m.sourceTo ?? undefined)\r\n : new DateInterval(m.from ?? undefined, m.to ?? undefined);\r\n }\r\n\r\n /**\r\n * Load selected filter\r\n */\r\n private loadFilter() {\r\n Object.assign(this.filterParams, this.toPayload());\r\n if (this.filterParams.year && this.filterParams.year > 0) {\r\n const year = this.filterParams.year;\r\n this.filterParams.fromDate = new Date(year, 0, 1, 2);\r\n this.filterParams.toDate = new Date(year, 11, 31, 2);\r\n } else {\r\n this.filterParams.year = undefined;\r\n }\r\n // Kept identical to the historical behavior: the interval always overwrites\r\n // the year-derived bounds, even when it is empty.\r\n const interval = this.modelInterval();\r\n this.filterParams.fromDate = interval.from;\r\n this.filterParams.toDate = interval.to;\r\n if (this.filterParams.sourceYear && this.filterParams.sourceYear > 0) {\r\n const year = this.filterParams.sourceYear;\r\n this.filterParams.sourceFromDate = new Date(year, 0, 1, 2);\r\n this.filterParams.sourceToDate = new Date(year, 11, 31, 2);\r\n } else {\r\n this.filterParams.sourceYear = undefined;\r\n }\r\n const sourceInterval = this.modelInterval(true);\r\n this.filterParams.sourceFromDate = sourceInterval.from;\r\n this.filterParams.sourceToDate = sourceInterval.to;\r\n if (this.filterParams.text) {\r\n this.filterParams.text = ClipperSearchUtils.normalizeTextQuery(this.filterParams.text);\r\n }\r\n }\r\n\r\n /**\r\n * Apply current filter params\r\n */\r\n protected applyFilter() {\r\n if (this.canSearch()) {\r\n this.facets()?.reset();\r\n this.fetch(true);\r\n }\r\n }\r\n\r\n\r\n /**\r\n * Manage sectors selection changes\r\n */\r\n protected sectorsChanged() {\r\n // Reset authors and types\r\n this.patchFilter({ authors: [], type: null });\r\n let authors: NameValueItem<string>[] = [];\r\n const sectors =\r\n (this.filterModel().sectors?.length ?? 0) > 0\r\n ? this.filterModel().sectors\r\n : this.sectors();\r\n ClipperAuthors.forEach(n => {\r\n if (sectors &&\r\n sectors.length > 0 &&\r\n sectors.findIndex(x => x.value === n.sectorId) !== -1) {\r\n authors.push(n);\r\n }\r\n });\r\n if (authors.length == 0) {\r\n ClipperAuthors.forEach(n => {\r\n if (!n.sectorId) {\r\n authors.push(n);\r\n }\r\n });\r\n }\r\n let types: NameValueItem<string>[] = [];\r\n ClipperSectorTypes.forEach(n => {\r\n if (sectors &&\r\n sectors.length > 0 &&\r\n sectors.findIndex(x => x.value === n.parentValue) !== -1) {\r\n types.push(n);\r\n }\r\n });\r\n if (types.length == 0) {\r\n types = [...ClipperSectorTypes];\r\n }\r\n this.authors.set(authors.sort((a, b) => a.name.localeCompare(b.name)));\r\n this.types.set(types);\r\n }\r\n\r\n /**\r\n * Check if any search parameter has been set\r\n * @param params : the search params to check\r\n * @returns true if at least one parameters has been set\r\n */\r\n private isFiltering(params: ClipperSearchParams): boolean {\r\n // NOTE: kept identical to the historical semantics, where fields default to\r\n // undefined and `undefined !== null` short-circuits the check to true.\r\n const m = this.filterModel();\r\n return (params.sector !== null\r\n || (m.sectors?.length ?? 0) > 0\r\n || params.author !== null\r\n || (m.authors?.length ?? 0) > 0\r\n || params.topic !== null\r\n || (m.topics?.length ?? 0) > 0\r\n || params.taxonomy !== null\r\n || params.taxonomyPath !== null\r\n || params.taxonomyNode !== null\r\n || params.number !== null\r\n || params.fromDate !== null\r\n || params.toDate !== null\r\n || params.year !== null\r\n || params.sourceNumber !== null\r\n || params.source !== null\r\n || params.sourceFromDate !== null\r\n || params.sourceToDate !== null\r\n || params.sourceYear !== null\r\n || params.tag !== null\r\n || (m.tags?.length ?? 0) > 0\r\n || params.text !== null\r\n || m.titleOnly === true\r\n || params.type !== null\r\n || m.showUnreadDocumentsOnly === true\r\n || m.showCommentedDocumentsOnly === true\r\n || params.changeReason !== null\r\n || params.changedNumber !== null\r\n || params.changedYear !== null\r\n || params.changedTitle !== null\r\n || params.modifierNumber !== null\r\n || params.modifierYear !== null\r\n || params.modifierTitle !== null\r\n || params.model !== null\r\n || (params.models?.length ?? 0) > 0\r\n || params.module !== null\r\n || (m.modules?.length ?? 0) > 0\r\n || m.from != null\r\n || m.to != null\r\n || m.sourceFrom != null\r\n || m.sourceTo != null);\r\n }\r\n\r\n\r\n /**\r\n * Checkif a single module is selected\r\n * @param module : the module to check\r\n * @returns : true if the specified module is the only one selected\r\n */\r\n private isSingleModule(module: ClipperModule): boolean {\r\n const modules = this.filterModel().modules;\r\n return (modules?.length === 1 && modules?.findIndex(x => x.value === module) !== -1);\r\n }\r\n\r\n /**\r\n * Update modules unread items\r\n */\r\n private updateModulesUnreadItems() {\r\n this.modules().forEach(module => {\r\n let totalUnread = 0;\r\n if (module.value === ClipperModule.News) {\r\n totalUnread = this.clipperService.dashboard.getUnreadItems(module.value, ClipperModel.News);\r\n } else if (module.value === ClipperModule.Approfondimenti) {\r\n totalUnread = this.clipperService.dashboard.getUnreadItems(module.value, ClipperModel.Articoli);\r\n } else if (module.value === ClipperModule.Giurisprudenza) {\r\n totalUnread = this.clipperService.dashboard.getUnreadItems(module.value, ClipperModel.Juris);\r\n } else if (module.value === ClipperModule.GiurisprudenzaRecente) {\r\n totalUnread = this.clipperService.dashboard.getUnreadItems(ClipperModule.Giurisprudenza, null);\r\n } else {\r\n totalUnread = this.clipperService.dashboard.getUnreadItems(module.value, null);\r\n }\r\n if (totalUnread > 0) {\r\n module.bag = totalUnread.toString();\r\n module.bagInfo = totalUnread + ' non letti';\r\n } else {\r\n module.bag = undefined;\r\n module.bagInfo = undefined;\r\n }\r\n });\r\n this.modules.update(values => [...values]);\r\n }\r\n\r\n /**\r\n * Checks if a module is supported\r\n * @param module : the module to check\r\n * @returns true if the module is supported\r\n */\r\n private hasModule(module: ClipperModule) {\r\n return (this.selectableModules().length === 0 || this.selectableModules().findIndex(x => x === module) !== -1) &&\r\n this.modules().findIndex(x => x.value === module) !== -1;\r\n }\r\n\r\n /**\r\n * Manage module selection changes \r\n */\r\n protected modulesChanged() {\r\n const modules = this.filterModel().modules;\r\n const hasModules = (modules?.length ?? 0) > 0;\r\n // Update models\r\n if (!hasModules) {\r\n this.filterParams.models = [];\r\n // Update sectors\r\n this.sectors.set(ClipperSectors.filter(n => n.group === 'S').map(n => {\r\n return { name: n.shortName ?? n.name, value: n.value };\r\n }));\r\n } else {\r\n this.filterParams.models = ClipperSearchUtils.getModulesModels(modules ?? undefined);\r\n // Update sectors\r\n if (this.isSingleModule(ClipperModule.ScadenzeESegnalazioni)) {\r\n this.sectors.set([]);\r\n } else if (this.isSingleModule(ClipperModule.GiurisprudenzaRecente)) {\r\n this.sectors.set(ClipperSectors.filter(n => n.group === 'S' && n.value[0] === 'G').map(n => {\r\n return { name: n.shortName ?? n.name, value: n.value };\r\n }));\r\n } else if (this.isLaws()) {\r\n this.sectors.set(ClipperSectors.filter(n => n.group === 'S').map(n => {\r\n return { name: n.shortName ?? n.name, value: n.value };\r\n }));\r\n }\r\n }\r\n this.selection?.clear();\r\n this.sectorsChanged();\r\n this.updateFilterPaneFocus();\r\n }\r\n\r\n /**\r\n * Checks the current module selection against a list of expected modules.\r\n * @param modules - The modules to check for.\r\n * @param mode - The check mode: 1) exactly these elements, 2) all of these elements, 3) any of these elements.\r\n * @returns True if the check passes.\r\n */\r\n private checkModules(modules: ClipperModule[], mode: number = 1): boolean {\r\n const currentModules = this.filterModel().modules;\r\n let ok: boolean = false;\r\n if (mode === 1) {\r\n // All and only the elements specified\r\n currentModules?.forEach(n => {\r\n ok = (modules.findIndex(x => x === n.value) ?? -1) !== -1;\r\n if (!ok) {\r\n return;\r\n }\r\n });\r\n return ok && modules.length >= (currentModules?.length ?? 0);\r\n } else if (mode === 2) {\r\n // All the elements specified\r\n modules.forEach(n => {\r\n ok = (currentModules?.findIndex(x => x.value === n) ?? -1) !== -1;\r\n if (!ok) {\r\n return;\r\n }\r\n });\r\n } else if (mode === 3) {\r\n // Any of the specified elements \r\n modules.forEach(n => {\r\n ok = (currentModules?.findIndex(x => x.value === n) ?? -1) !== -1;\r\n if (ok) {\r\n return;\r\n }\r\n });\r\n }\r\n return ok;\r\n }\r\n\r\n /**\r\n * Builds the effective query parameters for the next search request.\r\n * @param newSearch - When true, resets pagination and triggers facet loading. Defaults to false.\r\n * @returns The resolved {@link ClipperSearchParams} ready to be sent to the API.\r\n */\r\n private prepareFetch(newSearch: boolean = false): ClipperSearchParams {\r\n Object.assign(this.filterParams, this.toPayload());\r\n this.filterParams.fromDate = this.modelInterval().fromAsDate;\r\n this.filterParams.toDate = this.modelInterval().toAsDate;\r\n this.filterParams.sourceFromDate = this.modelInterval(true).fromAsDate;\r\n this.filterParams.sourceToDate = this.modelInterval(true).toAsDate;\r\n let newParams: ClipperSearchParams = new ClipperSearchParams();\r\n if ((this.filterParams.modules?.length ?? 0) > 0) {\r\n newParams.first = this.filterParams.first;\r\n newParams.channels = this.filterParams.channels\r\n newParams.count = this.filterParams.count;\r\n newParams.sortMode = this.filterParams.sortMode;\r\n if (this.isCoordination()) {\r\n newParams.models = [ClipperModel.Coordinamento];\r\n newParams.authors = this.filterParams.authors ?? [];\r\n newParams.sectors = this.filterParams.sectors ?? [];\r\n newParams.fromDate = this.filterParams.fromDate;\r\n newParams.toDate = this.filterParams.toDate;\r\n newParams.changeReason = this.filterParams.changeReason;\r\n newParams.changedNumber = this.filterParams.changedNumber;\r\n newParams.changedYear = this.filterParams.changedYear;\r\n newParams.changedTitle = this.filterParams.changedTitle;\r\n newParams.modifierNumber = this.filterParams.modifierNumber;\r\n newParams.modifierYear = this.filterParams.modifierYear;\r\n newParams.modifierTitle = this.filterParams.modifierTitle;\r\n } else {\r\n if (this.filterParams.text) {\r\n newParams.text = ClipperSearchUtils.normalizeTextQuery2(this.filterParams.text);\r\n }\r\n newParams.titleOnly = this.filterParams.titleOnly;\r\n newParams.fromDate = this.filterParams.fromDate;\r\n newParams.toDate = this.filterParams.toDate;\r\n newParams.models = ClipperSearchUtils.getModulesModels(this.filterParams.modules);\r\n if (this.checkModules([\r\n ClipperModule.News,\r\n ClipperModule.GazzetteBollettiniEFontiDiverse,\r\n ClipperModule.GiurisprudenzaRecente,\r\n ClipperModule.QuesitiECasiRisolti], 1)) {\r\n newParams.showUnreadDocumentsOnly = this.filterParams.showUnreadDocumentsOnly;\r\n }\r\n if (this.checkModules([\r\n ClipperModule.NormativaVigente,\r\n ClipperModule.GazzetteBollettiniEFontiDiverse,\r\n ClipperModule.GiurisprudenzaRecente], 1)) {\r\n newParams.showCommentedDocumentsOnly = this.filterParams.showCommentedDocumentsOnly;\r\n newParams.showNotAbrogatedDocumentsOnly = this.filterParams.showNotAbrogatedDocumentsOnly;\r\n newParams.sectors = this.filterParams.sectors;\r\n newParams.number = this.filterParams.number;\r\n newParams.year = this.filterParams.year;\r\n newParams.topics = this.filterParams.topics;\r\n newParams.authors = this.filterParams.authors ?? [];\r\n if (newParams.authors.length == 0 && this.filterParams.author) {\r\n newParams.authors = [{ name: '?', value: this.filterParams.author }];\r\n }\r\n newParams.types = this.filterParams.types ?? [];\r\n if (newParams.types.length == 0 && this.filterParams.type) {\r\n newParams.types = [{ name: '?', value: this.filterParams.type }];\r\n }\r\n newParams.source = this.filterParams.source;\r\n newParams.sourceNumber = this.filterParams.sourceNumber;\r\n newParams.sourceYear = this.filterParams.sourceYear;\r\n newParams.sourceFromDate = this.filterParams.sourceFromDate;\r\n newParams.sourceToDate = this.filterParams.sourceToDate;\r\n }\r\n if (this.checkModules([ClipperModule.News], 1)) {\r\n newParams.tags = this.filterParams.tags;\r\n }\r\n }\r\n } else {\r\n newParams = SystemUtils.clone(this.filterParams) as ClipperSearchParams;\r\n newParams.channels = this.filterParams.channels\r\n newParams.authors = this.filterParams.authors ?? [];\r\n if (newParams.authors.length == 0 && this.filterParams.author) {\r\n newParams.authors = [{ name: '?', value: this.filterParams.author }];\r\n }\r\n newParams.types = this.filterParams.types ?? [];\r\n if (newParams.types.length == 0 && this.filterParams.type) {\r\n newParams.types = [{ name: '?', value: this.filterParams.type }];\r\n }\r\n if (newParams.text) {\r\n newParams.text = ClipperSearchUtils.normalizeTextQuery2(newParams.text);\r\n }\r\n newParams.titleOnly = this.filterParams.titleOnly;\r\n }\r\n // Setup sort options\r\n this.sortOptions.set(ClipperUtils.getClipperAvailableSortOptions(this.filterParams.modules, newParams));\r\n if (newParams.text && newSearch) {\r\n this.sortMode.set(this.sortOptions()[0]);\r\n this.changeDetector.markForCheck();\r\n }\r\n if (!this.sortMode() || this.sortOptions().findIndex((x: NameValueItem<ClipperSort>) => x.value === this.sortMode()?.value) === -1) {\r\n this.sortMode.set(this.sortOptions()[0]);\r\n }\r\n newParams.sortMode = this.sortMode()?.value;\r\n // Apply facets\r\n if (this.snapshot?.facets?.fromDate) {\r\n newParams.fromDate = this.snapshot.facets?.fromDate;\r\n newParams.toDate = this.snapshot.facets?.toDate;\r\n newParams.year = this.snapshot.facets?.fromDate.getFullYear();\r\n }\r\n if (this.snapshot?.facets?.sector) {\r\n if (this.snapshot?.facets?.sector) {\r\n const model: ClipperModel = parseInt(this.snapshot.facets?.sector) as ClipperModel;\r\n if (model > 0) {\r\n newParams.models = [model];\r\n } else\r\n newParams.sectors = [{ value: this.snapshot.facets?.sector ?? \"\", name: \"\" }];\r\n } else {\r\n if ((newParams.sectors?.length ?? 0) == 0)\r\n newParams.models = ClipperSearchUtils.getModulesModels(this.filterParams.modules);\r\n }\r\n }\r\n if (this.snapshot?.facets?.type) {\r\n newParams.types = [{ value: this.snapshot.facets.type ?? \"\", name: \"\" }];\r\n }\r\n if (this.snapshot?.facets?.author) {\r\n newParams.authors = [{ value: this.snapshot.facets?.author ?? \"\", name: \"\" }];\r\n }\r\n\r\n newParams.version = 7;\r\n newParams.count = 15;\r\n if (newSearch) {\r\n newParams.first = 0;\r\n this.filterParams.first = 0;\r\n }\r\n\r\n // Compute a filter description\r\n this.updateFilterDescription();\r\n\r\n return newParams;\r\n }\r\n\r\n /**\r\n * Update filter description\r\n */\r\n private updateFilterDescription() {\r\n let filterDescription = \"\";\r\n this.filterParams.modules?.forEach((n, i) => {\r\n if (i > 0) filterDescription += \", \";\r\n filterDescription += n.shortName;\r\n });\r\n if ((this.filterParams.sectors?.length ?? 0) > 0) {\r\n filterDescription += \" > \";\r\n this.filterParams.sectors?.forEach((n, i) => {\r\n if (i > 0) filterDescription += \", \";\r\n filterDescription += n.name;\r\n });\r\n }\r\n if ((this.filterParams.authors?.length ?? 0) > 0) {\r\n filterDescription += \" > \";\r\n this.filterParams.authors?.forEach((n, i) => {\r\n if (i > 0) filterDescription += \", \";\r\n filterDescription += n.name;\r\n });\r\n }\r\n this.filterDescription.set(filterDescription);\r\n }\r\n\r\n /**\r\n * Fetches and applies search facets for the current result set.\r\n * @param params - The search parameters used to query facets.\r\n */\r\n protected fetchFacets(params: ClipperSearchParams): void {\r\n if (!this.clipperService.loggedIn()) return;\r\n this.filterBusy.set(true);\r\n this.clipperService.documents.queryFacets(params)\r\n .subscribe({\r\n next: r => {\r\n if (r.success) {\r\n let hasFacets = (r.value.facets?.length ?? 0) > 0;\r\n if (r.value.facets) {\r\n this.facets()?.update(r.value.facets, r.value.interval);\r\n if (this.facets && this.snapshot) {\r\n hasFacets = this.facets().hasFacets();\r\n this.snapshot.facets = this.facets().save();\r\n this.snapshot.facets.hasTooManyResults = (this.snapshot?.total ?? 0) >= 1000;\r\n }\r\n }\r\n this.hasFacets.set(hasFacets);\r\n this.handleFilterPaneVisibility();\r\n }\r\n },\r\n complete: () => {\r\n this.filterBusy.set(false);\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Hide facets\r\n */\r\n protected hideFacets() {\r\n this.hasFacets.set(false);\r\n this.facets()?.reset();\r\n this.filterPane2().close();\r\n this.filterPane2Closed.set(false);\r\n }\r\n\r\n /**\r\n * Executes the search query and updates the result snapshot.\r\n * @param newSearch - When true, resets pagination and reloads facets. Defaults to false.\r\n */\r\n protected fetch(newSearch: boolean = false): void {\r\n const searchParams = this.prepareFetch(newSearch);\r\n this.dialogService.busy('Ricerca in corso...');\r\n this.clipperService.documents.query(searchParams)\r\n .pipe(finalize(() => this.dialogService.clearBusy()))\r\n .subscribe(r => {\r\n if (!r.success) this.dialogService.error(r.message);\r\n else {\r\n // Handle data\r\n this.prepareResults(r.value, newSearch);\r\n // Handle facets\r\n if (this.snapshot?.total ?? 0 > 0) {\r\n if (newSearch) {\r\n this.fetchFacets(searchParams);\r\n }\r\n } else {\r\n this.hideFacets();\r\n }\r\n\r\n if (newSearch) {\r\n if (this.paginator()) {\r\n this.paginator().pageIndex = 0;\r\n }\r\n }\r\n\r\n this.scroll(0);\r\n this.handleFilterPaneVisibility();\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Navigate to a new result page.\r\n * @param e - The paginator {@link PageEvent} containing the new page index and size.\r\n */\r\n protected fetchMore(e: PageEvent): void {\r\n let first = e.pageIndex * (this.filterParams.count ?? 15);\r\n this.filterParams.first = first;\r\n this.fetch();\r\n }\r\n\r\n\r\n /**\r\n * Change the current sort mode and refresh results.\r\n * @param newSort - The new sort option to apply.\r\n */\r\n protected sort(newSort?: NameValueItem<ClipperSort>): void {\r\n if (newSort) {\r\n this.sortMode.set(newSort);\r\n this.fetch();\r\n }\r\n }\r\n\r\n /**\r\n * Open the free-text search help dialog.\r\n */\r\n protected help(): void {\r\n this.dialogService.open(ClipperSearchFreeTextHelpComponent, {\r\n ariaLabel: 'informazioni ricerca',\r\n autoFocus: 'dialog',\r\n restoreFocus: true,\r\n disableClose: false,\r\n minWidth: '375px',\r\n maxWidth: '800px',\r\n width: '99%',\r\n });\r\n }\r\n\r\n /**\r\n * Open the query-builder dialog to compose a free-text search expression.\r\n */\r\n protected compose(): void {\r\n const d = this.dialogService.open(ClipperSearchFreeTextQueryBuilderComponent, {\r\n ariaLabel: 'costruisci ricerca',\r\n autoFocus: 'dialog',\r\n restoreFocus: true,\r\n disableClose: false,\r\n minWidth: '375px',\r\n maxWidth: '500px',\r\n width: '99%',\r\n });\r\n d.componentInstance.done.subscribe((result: SearchFreeTextQueryParams) => {\r\n this.patchFilter({ text: result.query });\r\n d.close();\r\n });\r\n }\r\n\r\n /**\r\n * Open the topic-selection dialog and append the chosen topics to the current filter.\r\n */\r\n protected addTopic(): void {\r\n const topics = this.filterModel().topics;\r\n this.dialogService\r\n .selectTree(\r\n this.topics,\r\n 'Seleziona un argomento',\r\n undefined,\r\n (topics && topics.length > 0)\r\n ? topics[topics.length - 1].name\r\n : undefined\r\n )\r\n .then(d => d?.componentInstance.done.subscribe(r => {\r\n const added = r.selectedItems.map(item => {\r\n const bag = item.bag as ClipperTopicInfo;\r\n return { name: bag.name, value: bag.id };\r\n });\r\n this.patchFilter({ topics: [...(this.filterModel().topics ?? []), ...added] });\r\n }));\r\n }\r\n\r\n /**\r\n * Remove a topic from the current filter.\r\n * @param item - The topic item to remove.\r\n */\r\n protected deleteTopic(item: NameValueItem<string>): void {\r\n const topics = this.filterModel().topics;\r\n if ((topics?.findIndex(x => x.value === item.value) ?? -1) !== -1) {\r\n this.patchFilter({ topics: topics!.filter(x => x.value !== item.value) });\r\n }\r\n }\r\n\r\n /**\r\n * Remove all topics from the current filter.\r\n */\r\n protected clearTopics(): void {\r\n this.patchFilter({ topics: [] });\r\n }\r\n\r\n}\r\n\r\n\r\n","<mat-drawer-container [hasBackdrop]=\"filterPaneHasBackdrop()\" class=\"fill\">\n <mat-drawer #filterPane class=\"drawer\">\n <div fxLayout=\"column\" fxFill>\n <div fxFlex=\"78px\" class=\"title-container\">\n <div fxLayout=\"row\" fxLayoutGap=\"10px\" fxLayoutAlign=\"start center\" fxFill>\n <div class=\"title\">Filtro</div>\n <div fxFlex=\"*\" fxLayoutAlign=\"end\">\n <button fxFlexAlign=\"center\" mat-icon-button (click)=\"saveFilter(true)\"\n matTooltip=\"Crea una nuovo filtro con i parametri attuali \"><mat-icon>add</mat-icon></button>\n <button fxFlexAlign=\"center\" mat-icon-button (click)=\"toggleFilterPane()\"\n matTooltip=\"Nascondi\"><mat-icon>left_panel_close</mat-icon></button>\n </div>\n </div>\n </div>\n @if(hasFilters()) {\n <div style=\"padding:10px 20px\">\n <div fxLayout=\"row\" fxLayoutGap=\"10px\" fxFill>\n <div fxFlex=\"*\">\n <button-selector #filterSelector [options]=\"filters()\" label=\"Seleziona un filtro salvato\"\n labelSelected=\"Filtro in uso:\" fxFlexAlign=\"center\" (selected)=\"selectFilter($event)\"\n [matTooltip]=\"filterParams.searchName ?? ''\"></button-selector>\n </div>\n @if(filterParams.searchId) {\n <div fxFlex=\"40px\">\n <button fxFlexAlign=\"center\" mat-icon-button (click)=\"deleteFilter()\"\n matTooltip=\"Elimina il filtro in uso\"><mat-icon>delete</mat-icon></button>\n </div>\n }\n </div>\n </div>\n }\n <div fxFlex=\"*\" class=\"content scroll-hidden\" style=\"padding-bottom: 10px;\">\n <div class=\"scroll-auto\" style=\"padding: 0 10px;\">\n <form [formRoot]=\"filterForm\" (keyup.enter)=\"applyFilter()\" novalidate>\n <mat-accordion multi displayMode=\"flat\">\n <mat-expansion-panel expanded class=\"accordion-panel mat-elevation-z0 \">\n <mat-expansion-panel-header class=\"accordion-header\">\n <mat-panel-title>\n Cerca in..\n </mat-panel-title>\n </mat-expansion-panel-header>\n\n <chips-selector #moduleSelector [formField]=\"filterForm.modules\" [collapseAt]=\"599\" [multiple]=\"true\"\n label=\"Sezioni\" name=\"modules\" [options]=\"filteredModules()\" (changed)=\"modulesChanged()\">\n </chips-selector>\n </mat-expansion-panel>\n\n @if((hasTags() || hasTopics()) && !isCoordination()) {\n <mat-expansion-panel class=\"accordion-panel mat-elevation-z0\">\n <mat-expansion-panel-header class=\"accordion-header\">\n <mat-panel-title>\n Argomenti\n </mat-panel-title>\n </mat-expansion-panel-header>\n @if(hasTags()) {\n <chips-selector [collapseAt]=\"599\" [formField]=\"filterForm.tags\" [multiple]=\"true\"\n label=\"Argomenti\" [options]=\"tags()\"></chips-selector>\n }\n @if(hasTopics()) {\n @if ((filterForm.topics().value()?.length ?? 0) > 0) {\n <mat-chip-grid #topics style=\"padding-bottom: 5px;\">\n @for (o of filterForm.topics().value(); track $index) {\n <mat-chip-row [value]=\"o\" (removed)=\"deleteTopic(o)\">\n {{o.name}}\n <button matChipRemove>\n <mat-icon>cancel</mat-icon>\n </button></mat-chip-row>\n }\n </mat-chip-grid>\n <input style=\"display: none;\" [matChipInputFor]=\"topics\" />\n }\n <div fxLayout=\"row\" fxLayoutAlign=\"end center\">\n <button mat-button type=\"button\" (click)=\"addTopic()\"><mat-icon>add</mat-icon> Aggiungi\n argomento</button>\n @if ((filterForm.topics().value()?.length ?? 0) > 0) {\n <button mat-button type=\"button\" (click)=\"clearTopics()\"><mat-icon>delete</mat-icon> Azzera</button>\n }\n </div>\n }\n </mat-expansion-panel>\n }\n @if(hasSectors()) {\n <mat-expansion-panel class=\"accordion-panel mat-elevation-z0 \">\n <mat-expansion-panel-header class=\"accordion-header\">\n <mat-panel-title>\n Settori\n </mat-panel-title>\n </mat-expansion-panel-header>\n <chips-selector [collapseAt]=\"599\" [formField]=\"filterForm.sectors\" [multiple]=\"true\"\n label=\"Settori\" [options]=\"sectors()\" (changed)=\"sectorsChanged()\" />\n @if(hasRegions())\n {\n <mat-divider style=\"padding-top: 8px; margin-top:8px\"></mat-divider>\n <chips-selector [formField]=\"filterForm.authors\" [multiple]=\"true\" mode=\"collapsed\"\n label=\"Tutte le regioni\" [options]=\"regions()\" />\n }\n </mat-expansion-panel>\n }\n @if(!isCoordination()) {\n <mat-expansion-panel expanded class=\"accordion-panel mat-elevation-z0 \">\n <mat-expansion-panel-header class=\"accordion-header\">\n <mat-panel-title>\n Documento\n </mat-panel-title>\n </mat-expansion-panel-header>\n <div fxLayout=\"column\">\n @if(isLaws()) {\n <div fxLayout=\"row wrap\" fxLayoutAlign=\"space-between center\" fxFill>\n <mat-form-field fxFlex=\"59\" fxFlex.xs=\"49\">\n <mat-label>Numero</mat-label>\n <input matInput [formField]=\"filterForm.number\"\n #filterByNumber=\"matInput\" />\n @if (filterForm.number().value()) {\n <button type=\"button\" tabindex=\"-1\" matSuffix mat-icon-button aria-label=\"Pulisci\"\n (click)=\"filterForm.number().value.set('')\">\n <mat-icon>close</mat-icon>\n </button>\n }\n </mat-form-field>\n <mat-form-field fxFlex=\"39\" fxFlex.xs=\"49\">\n <mat-label>Anno</mat-label>\n <input type=\"number\" matInput [formField]=\"filterForm.year\" />\n @if (filterForm.year().value()) {\n <button type=\"button\" tabindex=\"-1\" matSuffix mat-icon-button aria-label=\"Pulisci\"\n (click)=\"filterForm.year().value.set(null)\">\n <mat-icon>close</mat-icon>\n </button>\n }\n </mat-form-field>\n </div>\n }\n <mat-form-field>\n <mat-label>Intervallo di pubblicazione</mat-label>\n <mat-date-range-input [rangePicker]=\"picker1\">\n <input matStartDate [formField]=\"filterForm.from\" placeholder=\"Da data\"\n (keydown)=\"onIntervalKeydown($event)\" (keyup)=\"onIntervalKeyup($event, false, false)\">\n <input matEndDate [formField]=\"filterForm.to\" placeholder=\"A data\"\n (keydown)=\"onIntervalKeydown($event)\" (keyup)=\"onIntervalKeyup($event, false, true)\">\n </mat-date-range-input>\n @if (filterForm.from().value() || filterForm.to().value()) {\n <button type=\"button\" tabindex=\"-1\" matSuffix mat-icon-button aria-label=\"Pulisci\"\n (click)=\"clearInterval()\">\n <mat-icon>close</mat-icon>\n </button>\n }\n <mat-datepicker-toggle matSuffix [for]=\"picker1\"></mat-datepicker-toggle>\n <mat-date-range-picker #picker1></mat-date-range-picker>\n @if (filterForm.from().invalid() || filterForm.to().invalid()) {\n <mat-error>{{ rangeErrorMessage(filterForm.from().errors(), filterForm.to().errors()) }}</mat-error>\n }\n </mat-form-field>\n <mat-form-field>\n <mat-label>Testo</mat-label>\n <input matInput [formField]=\"filterForm.text\"\n #filterByText=\"matInput\" />\n @if (filterForm.text().value()) {\n <button type=\"button\" tabindex=\"-1\" matSuffix mat-icon-button aria-label=\"Pulisci\"\n (click)=\"filterForm.text().value.set('')\">\n <mat-icon>close</mat-icon>\n </button>\n }\n <button type=\"button\" tabindex=\"-1\" mat-icon-button matSuffix matTooltip=\"Opzioni\"\n aria-label=\"Opzioni\"\n [matMenuTriggerFor]=\"filterPaneOptionsMenu\"><mat-icon>more_vert</mat-icon></button>\n </mat-form-field>\n <div>\n @if(filterForm.text().value()) {\n <div style=\"padding-bottom:10px\">\n <mat-slide-toggle [formField]=\"filterForm.titleOnly\">Cerca solo nel\n titolo</mat-slide-toggle>\n </div>\n }\n @if(isLaws(false)) {\n <div style=\"padding-bottom:10px\">\n <mat-slide-toggle [formField]=\"filterForm.showNotAbrogatedDocumentsOnly\">Mostra solo elementi non abrogati</mat-slide-toggle>\n </div>\n <div style=\"padding-bottom:10px\">\n <mat-slide-toggle [formField]=\"filterForm.showCommentedDocumentsOnly\">Mostra solo elementi con commenti</mat-slide-toggle>\n </div>\n }\n @if(isReadable()) {\n <div style=\"padding-bottom:10px\">\n <mat-slide-toggle [formField]=\"filterForm.showUnreadDocumentsOnly\">Mostra solo elementi non letti</mat-slide-toggle>\n </div>\n }\n\n </div>\n </div>\n </mat-expansion-panel>\n @if(isLaws(false)) {\n <mat-expansion-panel #sourceExpansionPanel class=\"accordion-panel mat-elevation-z0 \">\n <mat-expansion-panel-header class=\"accordion-header\">\n <mat-panel-title>\n Fonte\n </mat-panel-title>\n </mat-expansion-panel-header>\n <div fxLayout=\"column\">\n <div fxLayout=\"row wrap\" fxLayoutAlign=\"space-between center\" fxFill>\n <mat-form-field fxFlex=\"59\" fxFlex.xs=\"100\">\n <mat-label>Numero</mat-label>\n <input matInput [formField]=\"filterForm.sourceNumber\" />\n @if (filterForm.sourceNumber().value()) {\n <button type=\"button\" tabindex=\"-1\" matSuffix mat-icon-button aria-label=\"Pulisci\"\n (click)=\"filterForm.sourceNumber().value.set('')\">\n <mat-icon>close</mat-icon>\n </button>\n }\n </mat-form-field>\n <mat-form-field fxHide.xs fxFlex=\"39\" fxFlex.xs=\"100\">\n <mat-label>Anno</mat-label>\n <input type=\"number\" matInput [formField]=\"filterForm.sourceYear\" />\n @if (filterForm.sourceYear().value()) {\n <button type=\"button\" tabindex=\"-1\" matSuffix mat-icon-button aria-label=\"Pulisci\"\n (click)=\"filterForm.sourceYear().value.set(null)\">\n <mat-icon>close</mat-icon>\n </button>\n }\n </mat-form-field>\n </div>\n <mat-form-field>\n <mat-label>Intervallo di pubblicazione</mat-label>\n <mat-date-range-input [rangePicker]=\"picker2\">\n <input matStartDate [formField]=\"filterForm.sourceFrom\" placeholder=\"Da data\"\n (keydown)=\"onIntervalKeydown($event)\" (keyup)=\"onIntervalKeyup($event, true, false)\">\n <input matEndDate [formField]=\"filterForm.sourceTo\" placeholder=\"A data\"\n (keydown)=\"onIntervalKeydown($event)\" (keyup)=\"onIntervalKeyup($event, true, true)\">\n </mat-date-range-input>\n @if (filterForm.sourceFrom().value() || filterForm.sourceTo().value()) {\n <button type=\"button\" tabindex=\"-1\" matSuffix mat-icon-button aria-label=\"Pulisci\"\n (click)=\"clearInterval(true)\">\n <mat-icon>close</mat-icon>\n </button>\n }\n <mat-datepicker-toggle matSuffix [for]=\"picker2\"></mat-datepicker-toggle>\n <mat-date-range-picker #picker2></mat-date-range-picker>\n @if (filterForm.sourceFrom().invalid() || filterForm.sourceTo().invalid()) {\n <mat-error>{{ rangeErrorMessage(filterForm.sourceFrom().errors(), filterForm.sourceTo().errors()) }}</mat-error>\n }\n </mat-form-field>\n <mat-form-field>\n <mat-label>Tipo</mat-label>\n <mat-select [formField]=\"filterForm.source\">\n @for (s of sources(); track $index) {\n <mat-option [value]=\"s.value\" [matTooltip]=\"s.name\">\n {{s.name}}\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n\n </div>\n </mat-expansion-panel>\n <mat-expansion-panel #otherOptionsExpansionPanel class=\"accordion-panel mat-elevation-z0\">\n <mat-expansion-panel-header class=\"accordion-header\">\n <mat-panel-title>\n Altre opzioni\n </mat-panel-title>\n </mat-expansion-panel-header>\n <div fxLayout=\"column\">\n @if(authors().length > 0 && !hasRegions()) {\n <mat-form-field>\n <mat-label>Autore</mat-label>\n <mat-select [formField]=\"filterForm.author\">\n @for (a of authors(); track $index) {\n <mat-option [value]=\"a.value\" [matTooltip]=\"a.name\">\n {{a.name}}\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n }\n <mat-form-field>\n <mat-label>Tipo documento</mat-label>\n <mat-select [formField]=\"filterForm.type\">\n @for (t of types(); track $index) {\n <mat-option [value]=\"t.value\" [matTooltip]=\"t.name\">\n {{t.name}}\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n\n </mat-expansion-panel>\n }\n } @else {\n <mat-expansion-panel expanded class=\"accordion-panel mat-elevation-z0 \">\n <mat-expansion-panel-header class=\"accordion-header\">\n <mat-panel-title>\n Periodo\n </mat-panel-title>\n </mat-expansion-panel-header>\n <mat-form-field style=\"width:100%\">\n <mat-label>Intervallo di pubblicazione</mat-label>\n <mat-date-range-input [rangePicker]=\"picker1\">\n <input matStartDate [formField]=\"filterForm.from\" placeholder=\"Da data\"\n (keydown)=\"onIntervalKeydown($event)\" (keyup)=\"onIntervalKeyup($event, false, false)\">\n <input matEndDate [formField]=\"filterForm.to\" placeholder=\"A data\"\n (keydown)=\"onIntervalKeydown($event)\" (keyup)=\"onIntervalKeyup($event, false, true)\">\n </mat-date-range-input>\n @if (filterForm.from().value() || filterForm.to().value()) {\n <button type=\"button\" tabindex=\"-1\" matSuffix mat-icon-button aria-label=\"Pulisci\"\n (click)=\"clearInterval()\">\n <mat-icon>close</mat-icon>\n </button>\n }\n <mat-datepicker-toggle matSuffix [for]=\"picker1\"></mat-datepicker-toggle>\n <mat-date-range-picker #picker1></mat-date-range-picker>\n @if (filterForm.from().invalid() || filterForm.to().invalid()) {\n <mat-error>{{ rangeErrorMessage(filterForm.from().errors(), filterForm.to().errors()) }}</mat-error>\n }\n </mat-form-field>\n @if(isReadable()) {\n <div style=\"padding-bottom:10px\">\n <mat-slide-toggle [formField]=\"filterForm.showUnreadDocumentsOnly\">Mostra solo elementi non letti</mat-slide-toggle>\n </div>\n }\n </mat-expansion-panel>\n <mat-expansion-panel expanded class=\"accordion-panel mat-elevation-z0 \">\n <mat-expansion-panel-header class=\"accordion-header\">\n <mat-panel-title>\n Documento modificato\n </mat-panel-title>\n </mat-expansion-panel-header>\n <div fxLayout=\"column\">\n <div fxLayout=\"row wrap\" fxLayoutAlign=\"space-between center\" fxFill>\n <mat-form-field fxFlex=\"59\" fxFlex.xs=\"100\">\n <mat-label>Numero</mat-label>\n <input matInput [formField]=\"filterForm.changedNumber\"\n #filterByChangeNumber=\"matInput\" />\n @if (filterForm.changedNumber().value()) {\n <button type=\"button\" tabindex=\"-1\" matSuffix mat-icon-button aria-label=\"Pulisci\"\n (click)=\"filterForm.changedNumber().value.set('')\">\n <mat-icon>close</mat-icon>\n </button>\n }\n </mat-form-field>\n <mat-form-field fxHide.xs fxFlex=\"39\" fxFlex.xs=\"100\">\n <mat-label>Anno</mat-label>\n <input type=\"number\" matInput [formField]=\"filterForm.changedYear\" />\n @if (filterForm.changedYear().value()) {\n <button type=\"button\" tabindex=\"-1\" matSuffix mat-icon-button aria-label=\"Pulisci\"\n (click)=\"filterForm.changedYear().value.set(null)\">\n <mat-icon>close</mat-icon>\n </button>\n }\n </mat-form-field>\n </div>\n <mat-form-field>\n <mat-label>Titolo</mat-label>\n <input matInput [formField]=\"filterForm.changedTitle\" />\n @if (filterForm.changedTitle().value()) {\n <button type=\"button\" tabindex=\"-1\" matSuffix mat-icon-button aria-label=\"Pulisci\"\n (click)=\"filterForm.changedTitle().value.set('')\">\n <mat-icon>close</mat-icon>\n </button>\n }\n </mat-form-field>\n </div>\n </mat-expansion-panel>\n <mat-expansion-panel #modifierOptionsExpansionPanel class=\"accordion-panel mat-elevation-z0 \">\n <mat-expansion-panel-header class=\"accordion-header\">\n <mat-panel-title>\n Documento modificante\n </mat-panel-title>\n </mat-expansion-panel-header>\n <div fxLayout=\"column\">\n <div fxLayout=\"row wrap\" fxLayoutAlign=\"space-between center\" fxFill>\n <mat-form-field fxFlex=\"59\" fxFlex.xs=\"100\">\n <mat-label>Numero</mat-label>\n <input matInput [formField]=\"filterForm.modifierNumber\" />\n @if (filterForm.modifierNumber().value()) {\n <button type=\"button\" tabindex=\"-1\" matSuffix mat-icon-button aria-label=\"Pulisci\"\n (click)=\"filterForm.modifierNumber().value.set('')\">\n <mat-icon>close</mat-icon>\n </button>\n }\n </mat-form-field>\n <mat-form-field fxHide.xs fxFlex=\"39\" fxFlex.xs=\"100\">\n <mat-label>Anno</mat-label>\n <input type=\"number\" matInput [formField]=\"filterForm.modifierYear\" />\n @if (filterForm.modifierYear().value()) {\n <button type=\"button\" tabindex=\"-1\" matSuffix mat-icon-button aria-label=\"Pulisci\"\n (click)=\"filterForm.modifierYear().value.set(null)\">\n <mat-icon>close</mat-icon>\n </button>\n }\n </mat-form-field>\n </div>\n <mat-form-field>\n <mat-label>Titolo</mat-label>\n <input matInput [formField]=\"filterForm.modifierTitle\" />\n @if (filterForm.modifierTitle().value()) {\n <button type=\"button\" tabindex=\"-1\" matSuffix mat-icon-button aria-label=\"Pulisci\"\n (click)=\"filterForm.modifierTitle().value.set('')\">\n <mat-icon>close</mat-icon>\n </button>\n }\n </mat-form-field>\n </div>\n </mat-expansion-panel>\n <mat-expansion-panel #otherOptionsExpansionPanel class=\"accordion-panel mat-elevation-z0\">\n <mat-expansion-panel-header class=\"accordion-header\">\n <mat-panel-title>\n Altre opzioni\n </mat-panel-title>\n </mat-expansion-panel-header>\n <div fxLayout=\"column\">\n <mat-form-field>\n <mat-label>Motivo</mat-label>\n <mat-select [formField]=\"filterForm.changeReason\">\n @for (r of reasons(); track $index) {\n <mat-option [value]=\"r.value\" [matTooltip]=\"r.name\">\n {{r.name}}\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n </mat-expansion-panel>\n }\n </mat-accordion>\n </form>\n </div>\n </div>\n @if(showChannels()) {\n <div style=\"padding:10px\">\n <div fxLayout=\"column\">\n <mat-expansion-panel class=\"accordion-panel mat-elevation-z0\" style=\"margin-bottom: 10px;\">\n <mat-expansion-panel-header class=\"accordion-header\">\n <mat-panel-title>\n Canali\n </mat-panel-title>\n <mat-panel-description>\n @for (c of clipperService.availableChannels(); track $index) {\n <div class=\"channel-box\" [class.channel-disabled]=\"!c.active || c.disabled\" [matTooltip]=\"c.name\">\n <span class=\"label\">{{c.header}}</span>\n </div>\n }\n </mat-panel-description>\n </mat-expansion-panel-header>\n <chips-selector [collapseAt]=\"599\" [formField]=\"filterForm.channels\" [multiple]=\"true\"\n label=\"Canali\" [options]=\"clipperService.availableChannels()\"\n (changed)=\"channelsChanged()\"></chips-selector>\n\n </mat-expansion-panel>\n <div fxLayout=\"row\" fxLayoutGap=\"10px\" fxFill>\n <div fxFlex=\"*\" fxFlexAlign=\"end\">\n <button mat-stroked-button (click)=\"clearFilter()\">Pulisci</button>\n <button mat-stroked-button (click)=\"saveFilter()\" style=\"margin-left: 10px;\">Salva</button>\n </div>\n <div fxLayoutAlign=\"end\">\n <button fxFlexAlign=\"end\" mat-flat-button (click)=\"applyFilter()\"\n [disabled]=\"!canSearch()\">Applica</button>\n </div>\n </div>\n </div>\n </div>\n }\n </div>\n </mat-drawer>\n <div fxLayout=\"column\" fxLayoutGap=\"10px\" fxFill class=\"drawer-content scroll-hidden\">\n <div class=\"module-toolbar \">\n <div fxLayout=\"row wrap\" fxLayoutAlign=\"space-between\" fxFill>\n <div fxFlex=\"49\" fxFlex.lt-md=\"100\" style=\"padding-left: 10px; padding-bottom: 5px;\">\n @if(!filterPane.opened) {\n <button-toggle cssClass=\"small\" cssClassSmall=\"x-small\" iconOn=\"left_panel_close\" iconOff=\"tune\"\n labelOn=\"Nascondi<br>filtri\" labelOff=\"Mostra<br>filtri\" [value]=\"filterPane.opened\"\n (changed)=\"toggleFilterPane()\"></button-toggle>\n }\n </div>\n <div fxFlex=\"49\" fxFlex.lt-md=\"100\" fxLayoutAlign=\"end\">\n <div fxLayout=\"row\" style=\"height:48px; padding-bottom: 5px;\">\n @if((snapshot?.total ?? 0) > 0) {\n @if(sortOptions().length > 0) {\n <button-selector [options]=\"sortOptions()\" label=\"Ordina per:\" style=\"margin-right: 5px;\" [border]=\"0\"\n fxFlexAlign=\"center\" [formField]=\"sortForm\" (selected)=\"sort($event)\"></button-selector>\n }\n <button fxFlexAlign=\"center\" mat-icon-button matSuffix matTooltip=\"Opzioni sulla selezione\"\n aria-label=\"Opzioni sulla selezione\" [matMenuTriggerFor]=\"selectionOptionsMenu\"\n [matBadge]=\"countSelections()\"><mat-icon>checklist</mat-icon></button>\n <button fxFlexAlign=\"center\" mat-icon-button matTooltip=\"Salva elenco in Excel \"\n (click)=\"exportResults()\"><mat-icon>save_alt</mat-icon></button>\n @if (!filterPane2?.opened && hasFacets()){\n <button fxFlexAlign=\"center\" mat-icon-button matTooltip=\"Affina ricerca\"\n (click)=\"toggleFilterPane2()\"><mat-icon>right_panel_open</mat-icon></button>\n }\n }\n </div>\n </div>\n </div>\n </div>\n <div fxFlex=\"*\" class=\"module-content\">\n <mat-drawer-container [hasBackdrop]=\"filterPane2HasBackdrop()\" class=\"fill\">\n <mat-drawer #filterPane2 class=\"drawer-small drawer-with-loader\" position=\"end\" opened=\"false\">\n @if (filterBusy()) {\n <div class=\"overlay\"></div>\n }\n <div fxLayout=\"column\" fxFill>\n <div fxFlex=\"6px\">\n @if (filterBusy()) {\n <mat-progress-bar style=\"z-index: 11;\" mode=\"indeterminate\">\n </mat-progress-bar>\n }\n </div>\n <div fxFlex=\"78px\" class=\"title-container-with-loader\">\n <div fxLayout=\"row\" fxLayoutAlign=\"start center\" fxFill>\n <div class=\"title\">Affina ricerca</div>\n <div fxFlex=\"*\" fxLayoutAlign=\"end\">\n <button mat-icon-button (click)=\"toggleFilterPane2()\"\n matTooltip=\"Nascondi\"><mat-icon>right_panel_close</mat-icon></button>\n </div>\n </div>\n </div>\n <div fxFlex=\"*\" class=\"content scroll-hidden\" style=\"padding: 0 5px;\">\n <clipper-search-facets #facets></clipper-search-facets>\n\n </div>\n </div>\n </mat-drawer>\n <div fxLayout=\"column\" fxFill>\n <div fxFlex=\"*\" [id]=\"scrollerId\" cdkScrollable class=\"scroll-auto\" style=\"padding: 0 20px;\">\n @if (!snapshot?.total) {\n <div class=\"message-container\">\n @if(snapshot?.total === 0) {\n <p class=\"message\"><b>Nessun elemento da visualizzare.</b></p>\n } @else {\n <div class=\"message\">\n <p fxHide.xs><b>Esegui una ricerca compilando i campi necessari nella maschera di ricarca qui a\n fianco.</b></p>\n <p fxHide.gt-xs><b>Fai click sul bottone <span class=\"accent\"><mat-icon>tune</mat-icon></span> ed esegui\n una\n ricerca compilando i campi necessari.</b></p>\n <p>E' possibile salvare i parametri delle le ricerche più utilizzate facendo clic su \n <mat-icon\n style=\"display: inline-flex; border-radius: 9999px; height: 25px; width: 25px; color: var(--ars-color-text-low); background-color: var(--ars-color-accent);\">add</mat-icon>.\n </p>\n </div>\n }\n </div>\n } @else {\n @if (snapshot && (snapshot.total ?? 0) > 0) {\n @for (item of snapshot.items; track $index; let i = $index) {\n @if (item.group && isSortedByDate()) {\n <div class=\"items-group-title\">\n <div [class.group-spaced]=\"i > 0\">{{item.group}}</div>\n </div>\n }\n <clipper-search-result-item [item]=\"item\" [parent]=\"this\" [displayModelName]=\"true\" [actions]=\"contextMenu\"\n [isReadable]=\"true\"></clipper-search-result-item>\n }\n }\n }\n </div>\n <!-- footer -->\n @if ((snapshot?.total ?? 0) > 0) {\n <div class=\"items-footer\">\n <div fxLayout=\"row wrap\" fxLayoutGap=\"10px\" fxLayoutAlign=\"space-between center\" fxFill>\n <!-- legend -->\n <div fxFlex.lt-md=\"100\" class=\"legend-container\">\n <div class=\"legend unread-bg\"></div>\n non letto\n <!--<div class=\"legend next very-popular-bg\"></div>\n molto citato\n <div class=\"legend next popular-bg\"></div>\n citato-->\n <div class=\"legend next expired-bg \"></div>\n non più vigente\n </div>\n <div fxFlex.lt-md=\"100\" fxLayoutAlign=\"end\" [class.wide]=\"filterPane2?.opened\">\n <div fxLayout=\"row\">\n <mat-paginator fxFlexAlign=\"center\" #paginator class=\"paginator\" [hidePageSize]=\"true\"\n [length]=\"snapshot?.total ?? 0\" [pageSize]=\"filterParams.count\" [showFirstLastButtons]=\"true\"\n (page)=\"fetchMore($event)\">\n </mat-paginator>\n </div>\n </div>\n </div>\n </div>\n }\n </div>\n </mat-drawer-container>\n </div>\n </div>\n</mat-drawer-container>\n<mat-menu #filterPaneOptionsMenu=\"matMenu\">\n <button mat-menu-item (click)=\"compose()\">\n <mat-icon>build</mat-icon>Componi\n </button>\n <button mat-menu-item (click)=\"help()\">\n <mat-icon>help</mat-icon>Come usare la ricerca in testo libero\n </button>\n</mat-menu>\n<mat-menu #selectionOptionsMenu=\"matMenu\">\n <button mat-menu-item (click)=\"selectAll()\">\n <mat-icon>select_all</mat-icon>Seleziona tutti\n </button>\n <clipper-document-menu [parent]=\"this\" [useSelections]=\"true\" [isReadable]=\"true\"\n [canUseAIAssistant]=\"hasAIAssistant()\" [canUseRS]=\"showRSOptions()\">\n </clipper-document-menu>\n</mat-menu>\n<mat-menu #contextMenu=\"matMenu\" (closed)=\"updateMenuButtonsVisibility()\">\n <ng-template matMenuContent let-item=\"item\">\n <clipper-document-menu [parent]=\"this\" [item]=\"item\" [isReadable]=\"true\"\n [canUseAIAssistant]=\"hasAIAssistant()\" [canUseRS]=\"showRSOptions()\">\n </clipper-document-menu>\n </ng-template>\n</mat-menu>","import { ChangeDetectionStrategy, Component, DestroyRef, effect, inject, viewChild } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { MAT_DIALOG_DATA, MatDialogClose, MatDialogContent, MatDialogRef } from '@angular/material/dialog';\nimport { ClipperMessages, ClipperModule, ClipperSelectionMode, ClipperService, ClipperUtils } from '@arsedizioni/ars-utils/clipper.common';\nimport { BroadcastService, SystemUtils, ThemeType } from '@arsedizioni/ars-utils/core';\nimport { ClipperBrowserComponent } from '../browser.component';\nimport { MatIconModule } from '@angular/material/icon';\nimport { FlexLayoutModule } from '@arsedizioni/ars-utils/ui';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatBadgeModule } from '@angular/material/badge';\n\n\nexport interface ClipperBrowserDialogData {\n showChannels?: boolean;\n selectionMode?: ClipperSelectionMode;\n selectableModules?: ClipperModule[];\n selectionMessage?: string;\n initialModule?: number;\n theme?: ThemeType;\n}\n\n@Component({\n host: { 'Bind': SystemUtils.generateUUID() },\n templateUrl: './browser-dialog.component.html',\n styleUrls: ['./browser-dialog.component.scss'],\n imports: [MatDialogClose, MatDialogContent, MatButtonModule, MatBadgeModule, MatIconModule, FlexLayoutModule, ClipperBrowserComponent],\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class ClipperBrowserDialogComponent {\n private readonly destroyRef = inject(DestroyRef);\n readonly clipperBrowser = viewChild.required<ClipperBrowserComponent>('clipperBrowser');\n protected clipperService = inject(ClipperService);\n protected dialogData: ClipperBrowserDialogData = inject(MAT_DIALOG_DATA);\n private dialogRef = inject(MatDialogRef<ClipperBrowserDialogComponent>);\n private broadcastService = inject(BroadcastService);\n\n constructor() {\n // Apply the selection mode from dialog data once the browser view is available.\n // Falls back to ClipperSelectionMode.None when selectionMode is not provided.\n effect(() => {\n this.clipperBrowser().selectionMode.set(this.dialogData.selectionMode ?? ClipperSelectionMode.None);\n });\n\n // Subscribe to inner document-selection events and forward them as dialog output.\n this.broadcastService.getMessage()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(message => {\n if (message.id === ClipperMessages.DOCUMENT_SELECTED_INNER) {\n const documentId: string | undefined = message.data.documentId ?? message.data.id;\n const document = documentId != null ? this.clipperBrowser().getSnapshotDocument(documentId) : undefined;\n if (document) {\n this.broadcastService.sendMessage(\n this.dialogData.selectionMessage ?? ClipperMessages.DOCUMENT_SELECTED, [document]);\n this.dialogRef.close();\n }\n }\n });\n }\n\n /**\n * Determines whether the current selection satisfies the required selection mode\n * and module constraints defined in the dialog data.\n *\n * @returns `true` if the selection is valid and can be confirmed; `false` otherwise.\n */\n protected canSelect(): boolean {\n const selection = this.clipperBrowser().selection;\n const selectionCount = selection?.all?.length ?? 0;\n const mode = this.dialogData.selectionMode;\n\n let allow =\n (mode === ClipperSelectionMode.Single && selectionCount === 1) ||\n (mode === ClipperSelectionMode.TwoOrMore && selectionCount > 1) ||\n (mode === ClipperSelectionMode.Multi && selectionCount > 0);\n\n if (allow && (this.dialogData.selectableModules?.length ?? 0) > 0) {\n selection?.all?.forEach(n => {\n const module = ClipperUtils.getClipperModuleFromModel(n);\n if (this.dialogData.selectableModules?.findIndex(x => x === module) === -1) {\n allow = false;\n }\n });\n }\n\n return allow;\n }\n\n /**\n * Broadcasts the current selection as a message and closes the dialog.\n * Does nothing when the selection is empty.\n */\n protected select(): void {\n const items = this.clipperBrowser().selection?.all;\n if (items && items.length > 0) {\n this.broadcastService.sendMessage(\n this.dialogData.selectionMessage ?? ClipperMessages.DOCUMENT_SELECTED,\n items\n );\n this.dialogRef.close();\n }\n }\n\n}\n","<div style=\"padding:10px 0 10px 0\">\r\n <div fxLayout=\"row\" fxLayoutGap=\"20px\" fxLayoutAlign=\"start center\" fxFill>\r\n <div class=\"dialog-title\">\r\n <a href=\"https://clipper.arsedizioni.it\" matTooltip=\"Apri Clipper in un nuovo tab\" target=\"_blank\">\r\n <div class=\"clipper-logo\"></div>\r\n </a>\r\n </div>\r\n <div fxFlex=\"*\"></div>\r\n @if ((dialogData.selectionMode ?? 0) > 0 && canSelect()) {\r\n <div fxFlexAlign=\"center\" fxFlex=\"170px\" fxFlex.lt-md=\"58px\">\r\n <button fxHide.lt-md fxFlexAlign=\"center\" type=\"button\" mat-flat-button (click)=\"select()\"\r\n class=\"clipper-selection-button\">\r\n <span class=\"small bold\">Usa selezione</span>\r\n </button>\r\n <button fxHide.gt-sm fxFlexAlign=\"center\" type=\"button\" mat-icon-button (click)=\"select()\"\r\n matTooltip=\"Usa selezione\" aria-label=\"'Usa la selezione'\" class=\"clipper-selection-icon-button\">\r\n <mat-icon>check</mat-icon>\r\n </button>\r\n </div>\r\n }\r\n <div fxFlexAlign=\"center\" class=\"dialog-close\">\r\n <div fxLayout=\"row\" fxLayoutAlign=\"end center\" fxLayoutGap=\"5px\">\r\n @if (clipperService.bag.length > 0) {\r\n <button type=\"button\" mat-icon-button matTooltip=\"Documenti di lavoro\"\r\n aria-label=\"'Documenti di lavoro'\" (click)=\"clipperBrowser.openBag()\">\r\n <mat-icon aria-hidden=\"false\" [matBadge]=\"clipperService.bag.length\"\r\n >work_outline</mat-icon>\r\n </button>\r\n }\r\n <button type=\"button\" mat-icon-button matTooltip=\"Chiudi\" [mat-dialog-close]=\"true\" aria-label=\"Chiudi\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n<mat-dialog-content style=\"padding: 0\">\r\n <clipper-browser #clipperBrowser class=\"wide fill\" [showChannels]=\"dialogData.showChannels ?? true\"\r\n [selectableModules]=\"dialogData.selectableModules ?? []\"\r\n [initialModule]=\"dialogData.initialModule\" [showRSOptions]=\"false\" [showAIAssistantOptions]=\"false\"></clipper-browser>\r\n</mat-dialog-content>","import {\n ChangeDetectionStrategy,\n Component,\n inject,\n signal,\n output,\n viewChild\n} from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MAT_DIALOG_DATA, MatDialogActions, MatDialogClose, MatDialogContent, MatDialogTitle } from '@angular/material/dialog';\nimport { MatListModule, MatSelectionList } from '@angular/material/list';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { ClipperDocumentAnchorInfo, ClipperService } from '@arsedizioni/ars-utils/clipper.common';\nimport { SystemUtils } from '@arsedizioni/ars-utils/core';\nimport { FlexLayoutModule } from '@arsedizioni/ars-utils/ui';\nimport { DialogService } from '@arsedizioni/ars-utils/ui.dialogs';\nimport { finalize } from 'rxjs';\n\n\nexport interface ClipperDocumentIndexDialogData {\n documentId: string;\n excludedTypes?: number[];\n multiple?: boolean;\n}\n\nexport interface ClipperDocumentIndexDialogResult {\n data: ClipperDocumentAnchorInfo[];\n}\n\n@Component({\n host: { 'Bind': SystemUtils.generateUUID() },\n templateUrl: './document-index.component.html',\n styleUrls: ['./document-index.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n imports: [\n FlexLayoutModule,\n MatDialogTitle,\n MatDialogContent,\n MatListModule,\n MatTooltipModule,\n MatDialogActions,\n MatButtonModule,\n MatDialogClose,\n ],\n})\nexport class ClipperDocumentIndexComponent {\n readonly selection = viewChild.required<MatSelectionList>('selection');\n readonly done = output<ClipperDocumentIndexDialogResult>();\n\n private clipperService = inject(ClipperService);\n private dialogService = inject(DialogService);\n protected dialogData: ClipperDocumentIndexDialogData = inject(MAT_DIALOG_DATA);\n protected readonly items = signal<ClipperDocumentAnchorInfo[]>([]);\n protected readonly okDisabled = signal<boolean>(false);\n\n constructor() {\n if (this.dialogData?.documentId) {\n this.load();\n }\n }\n\n /**\n * Loads the document's structural index from the server and populates the item list.\n * Items whose type appears in {@link ClipperDocumentIndexDialogData.excludedTypes} are filtered out.\n * Each item's description is built from its title, or derived from its type and text when no title is set.\n */\n private load(): void {\n if (!this.clipperService.loggedIn()) return;\n this.dialogService.setBusy('Caricamento in corso...');\n this.clipperService.documents.index(this.dialogData.documentId)\n .pipe(finalize(() => this.dialogService.clearBusy()))\n .subscribe(r => {\n if (!r.success) {\n this.dialogService.error(r.message);\n return;\n }\n const result: ClipperDocumentAnchorInfo[] = [];\n r.value?.items.forEach((n: ClipperDocumentAnchorInfo) => {\n if (this.dialogData.excludedTypes && this.dialogData.excludedTypes.indexOf(n.type) !== -1) return;\n if (n.title) {\n n.description = n.title;\n } else if (n.type < 3) {\n n.description = n.text?.trim() ?? '';\n } else {\n n.description = `${n.typeDescription?.trim() ?? ''} ${n.text?.trim() ?? ''}.`;\n }\n result.push(n);\n });\n this.items.set(result);\n });\n }\n\n /**\n * Updates the OK button disabled state based on whether anything is selected in the list.\n */\n protected select(): void {\n const selected = this.selection().selectedOptions.selected;\n this.okDisabled.set(selected.length === 0);\n }\n\n /**\n * Emits the current selection as the dialog result.\n * In single-selection mode, emits the explicitly provided item.\n * In multiple-selection mode, collects all selected items from the list.\n * @param item - The directly clicked item for single-selection mode; omit for multiple-selection mode.\n */\n protected use(item?: ClipperDocumentAnchorInfo): void {\n if (this.dialogData?.multiple) {\n if (item != null) return; // Direct-click not supported in multiple-selection mode\n const selected: ClipperDocumentAnchorInfo[] = this.selection()\n .selectedOptions.selected.map(o => o.value as ClipperDocumentAnchorInfo);\n if (selected.length === 0) return;\n this.done.emit({ data: selected });\n } else if (item != null) {\n this.done.emit({ data: [item] });\n }\n }\n}\n\n","<div mat-dialog-title>Indice</div>\r\n<mat-dialog-content>\r\n @if (items().length === 0) {\r\n <div>\r\n <p class=\"message\"><i>Nessun elemento da visualizzare.</i></p>\r\n </div>\r\n } @else {\r\n <mat-selection-list dense #selection (selectionChange)=\"select();\" [multiple]=\"dialogData.multiple\"\r\n hideSingleSelectionIndicator=\"true\">\r\n @for (item of items(); track $index) {\r\n @if (item.type > 4) {\r\n <div class=\"small uppercase truncated accent\" style=\"display: flex; align-items: center; min-height: 36px;\">\r\n <div><b>{{item.description}}</b></div>\r\n </div>\r\n } @else {\r\n <mat-list-option [selected]=\"false\" [value]=\"item\" (click)=\"use(item)\">\r\n <div fxLayout=\"row\" fxLayoutGap=\"10px\" fxFill>\r\n <div [fxFlex]=\"(10 * item.level) + 'px'\"></div>\r\n <div fxFlex=\"*\" class=\"truncated\">\r\n <div class=\"small\" [matTooltip]=\"item.description\">{{item.description}}</div>\r\n </div>\r\n </div>\r\n </mat-list-option>\r\n }\r\n }\r\n </mat-selection-list>\r\n }\r\n</mat-dialog-content>\r\n<mat-dialog-actions>\r\n <div fxLayout=\"row\" fxLayoutAlign=\"end\" fxFill>\r\n @if (dialogData.multiple) {\r\n <button mat-flat-button [disabled]=\"okDisabled()\" (click)=\"use()\">Usa</button>\r\n }\r\n <button mat-stroked-button [mat-dialog-close]=\"true\" >Chiudi</button>\r\n </div>\r\n</mat-dialog-actions>","import { ChangeDetectionStrategy, ChangeDetectorRef, Component, inject, input, signal, output, viewChild } from '@angular/core';\nimport { DateInterval } from '@arsedizioni/ars-utils/core';\nimport { MatExpansionModule } from '@angular/material/expansion';\nimport { MatDividerModule } from '@angular/material/divider';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { MatButtonModule } from '@angular/material/button';\nimport { FlexLayoutModule } from '@arsedizioni/ars-utils/ui';\nimport { MatChipsModule } from '@angular/material/chips';\nimport { MatCalendar, MatCalendarCellClassFunction } from '@angular/material/datepicker';\nimport { endOfDay, endOfMonth, startOfMonth, startOfToday, subDays } from 'date-fns';\nimport { CalendarEmptyHeader } from '@arsedizioni/ars-utils/ui.controls.date';\nimport { ClipperSearchCalendarSnapshotMonth, ClipperSearchCalendarSnapshotResult } from '@arsedizioni/ars-utils/clipper.common';\n\n\n\n@Component({\n selector: 'clipper-search-calendar',\n templateUrl: './search-calendar.component.html',\n styleUrls: ['./search-calendar.component.scss'],\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n FlexLayoutModule,\n MatButtonModule,\n MatTooltipModule,\n MatCalendar,\n MatChipsModule,\n MatIconModule,\n MatDividerModule,\n MatExpansionModule\n ],\n})\nexport class ClipperSearchCalendarComponent {\n readonly calendar = viewChild.required<MatCalendar<any>>('calendar');\n readonly changed = output<DateInterval | undefined>();\n private readonly changeDetector = inject(ChangeDetectorRef);\n\n protected busy = signal<boolean>(false);\n protected months = signal<ClipperSearchCalendarSnapshotMonth[] | undefined>(undefined);\n protected calendarSpecialDays?: number[];\n protected calendarEmptyHeader = CalendarEmptyHeader;\n public calendarDate: Date = startOfToday();\n protected calendarDateClass: MatCalendarCellClassFunction<Date> = (cellDate) => {\n if (!this.calendarSpecialDays) return '';\n if (this.calendarSpecialDays[cellDate.getDate() - 1] > 0) {\n if (cellDate < startOfToday()) return 'special-date-expired';\n else if (subDays(cellDate, 15) <= startOfToday()) return 'special-date-expiring';\n else return 'special-date';\n }\n return '';\n };\n protected calendarDateFilter = (cellDate: Date): boolean => {\n return this.canFilter() && this.calendarSpecialDays != null && this.calendarSpecialDays[cellDate.getDate() - 1] > 0;\n }\n readonly canFilter = input<boolean>(false);\n\n\n /**\n * Refreshes the calendar with a new month/days snapshot and updates the active date.\n * @param month - The single-month snapshot used to populate special-day highlighting.\n * @param months - The full year snapshot used to populate the month-selector chips.\n * @param date - The date the calendar should navigate to. Defaults to today.\n */\n update(month?: ClipperSearchCalendarSnapshotResult,\n months?: ClipperSearchCalendarSnapshotResult,\n date: Date = startOfToday()): void {\n if (months?.months) {\n this.months.set(months.months);\n }\n if (month && month.months && month.months.length > 0) {\n this.calendarSpecialDays = month.months[0].days;\n }\n const calendar = this.calendar();\n if (calendar) {\n calendar.activeDate = date;\n calendar.selected = date;\n calendar.updateTodaysDate();\n }\n this.calendarDate = date;\n this.changeDetector.markForCheck();\n }\n\n\n /**\n * Emits a `DateInterval` for the given date or, when `'month'` is passed, for the entire\n * current calendar month. Passing `undefined` clears the active date filter.\n * @param date - A specific `Date` to filter by, the string `'month'` to filter the whole\n * month, or `undefined` to clear the filter.\n */\n protected filterByDate(date?: Date | string): void {\n if (date === 'month') {\n if (this.calendarDate) {\n const today = new Date();\n const start = endOfDay(startOfMonth(this.calendarDate));\n const end = endOfMonth(this.calendarDate);\n this.changed.emit(new DateInterval(start, end));\n if (start <= today && end >= today) {\n const calendar = this.calendar();\n calendar.selected = today;\n calendar.updateTodaysDate();\n }\n }\n } else if (date) {\n const d = date as Date;\n this.changed.emit(new DateInterval(endOfDay(d), endOfDay(d)));\n this.calendarDate = d;\n const calendar = this.calendar();\n calendar.selected = d;\n calendar.updateTodaysDate();\n } else {\n this.changed.emit(undefined);\n }\n }\n\n /**\n * Navigates the calendar to the given month and emits its full date range as a filter.\n * @param monthInfo - The month snapshot to navigate to and filter by.\n */\n protected filterByMonth(monthInfo: ClipperSearchCalendarSnapshotMonth): void {\n const newDate = new Date(monthInfo.year, monthInfo.month - 1, 1);\n const today = new Date();\n const start = endOfDay(startOfMonth(newDate));\n const end = endOfMonth(newDate);\n this.changed.emit(new DateInterval(start, end));\n this.calendarSpecialDays = monthInfo.days;\n const calendar = this.calendar();\n if (start <= today && end >= today) {\n calendar.selected = today;\n }\n calendar.activeDate = newDate;\n calendar.updateTodaysDate();\n this.calendarDate = newDate;\n }\n}\n","<div fxLayout=\"column\" fxFill class=\"calendar-container scroll-hidden\">\r\n <div class=\"calendar-months\">\r\n <div>\r\n <div fxLayout=\"row wrap\" fxLayoutAlign=\"center\" fxLayoutGap=\"8px\" fxFill>\r\n @for (m of months(); track $index) {\r\n <button fxFlex=\"37px\" mat-button class=\"small uppercase\" (click)=\"filterByMonth(m)\" [disabled]=\"m.total === 0\">\r\n @if (m.expired) {\r\n <span class=\"expired\" [matTooltip]=\"m.expired + ' elementi in ritardo'\">{{m.monthShortName}}</span>\r\n } @else {\r\n <span [matTooltip]=\"m.total + ' elementi'\">{{m.monthShortName}}</span>\r\n }\r\n </button>\r\n }\r\n </div>\r\n </div>\r\n <div class=\"separator\"></div>\r\n </div>\r\n <div fxFlex=\"*\" class=\"scroll-auto\">\r\n @if (!busy()) {\r\n <mat-calendar #calendar [headerComponent]=\"calendarEmptyHeader\" [dateClass]=\"calendarDateClass\"\r\n [dateFilter]=\"calendarDateFilter\" (selectedChange)=\"filterByDate($event)\" class=\"calendar-month\">\r\n </mat-calendar>\r\n <div fxLayout=\"row\" fxLayoutAlign=\"space-around\" style=\"padding:0 15px\">\r\n <button type=\"button\" mat-stroked-button (click)=\"filterByDate('month')\">Tutto il\r\n mese</button>\r\n </div>\r\n }\r\n </div>\r\n</div>"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAA,UAAA,CAAA,aAAA;IAAA;IAAA;KAAA,MAAA;KAAA,MACX;IAAc;IAAA;KAAA,MAAA;KAAA,MACd;IAAa;IAAA;KAAA,MAAA;KAAA,MACb;IAAgB;IAAA;KAAA,MAAA;KAAA,MAChB;IAAkB;GAAA;GAAA,iBAAA,GAAA,wBAAA;EAAA,CAAA;CAAA;;AAGT,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAA8B,YAAA,CAAA;EAjB1C,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAyB,YAGvB;GAAI,iBACC,wBAAwB;GAAM,SACtC;IACP;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACD;GAAA,UAAA;GAAA,QAAA,CAAA,+VAAA;EAAA,CAAA;CAGwD,CAAA;CAAA,gBAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,YAAU,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,SAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,SAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"arsedizioni-ars-utils-clipper.ui.mjs","names":[],"sources":["../../../projects/ars-utils/clipper.ui/document-menu/document-menu.component.ts","../../../projects/ars-utils/clipper.ui/document-menu/document-menu.component.html","../../../projects/ars-utils/clipper.ui/search-facets/search-facets.component.ts","../../../projects/ars-utils/clipper.ui/search-facets/search-facets.component.html","../../../projects/ars-utils/clipper.ui/document-manager/document-manager.ts","../../../projects/ars-utils/clipper.ui/documents.ts","../../../projects/ars-utils/clipper.ui/search-result-manager/search-result-manager.ts","../../../projects/ars-utils/clipper.ui/search-free-text-help/search-free-text-help.component.ts","../../../projects/ars-utils/clipper.ui/search-free-text-help/search-free-text-help.component.html","../../../projects/ars-utils/clipper.ui/search-free-text-query-builder/search-free-text-query-builder.component.ts","../../../projects/ars-utils/clipper.ui/search-free-text-query-builder/search-free-text-query-builder.component.html","../../../projects/ars-utils/clipper.ui/search-result-item/search-result-item.component.ts","../../../projects/ars-utils/clipper.ui/search-result-item/search-result-item.component.html","../../../projects/ars-utils/clipper.ui/browser/browser.component.ts","../../../projects/ars-utils/clipper.ui/browser/browser.component.html","../../../projects/ars-utils/clipper.ui/browser/browser-dialog/browser-dialog.component.ts","../../../projects/ars-utils/clipper.ui/browser/browser-dialog/browser-dialog.component.html","../../../projects/ars-utils/clipper.ui/document-analysis/document-analysis.component.ts","../../../projects/ars-utils/clipper.ui/document-analysis/document-analysis.component.html","../../../projects/ars-utils/clipper.ui/document-index/document-index.component.ts","../../../projects/ars-utils/clipper.ui/document-index/document-index.component.html","../../../projects/ars-utils/clipper.ui/search-calendar/search-calendar.component.ts","../../../projects/ars-utils/clipper.ui/search-calendar/search-calendar.component.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component, Renderer2, computed, inject, input, viewChild } from '@angular/core';\r\nimport { toObservable, toSignal } from '@angular/core/rxjs-interop';\r\nimport { EMPTY, switchMap } from 'rxjs';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\nimport { MatDividerModule } from '@angular/material/divider';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatMenuModule, MatMenuTrigger } from '@angular/material/menu';\r\nimport { FlexLayoutModule } from '@arsedizioni/ars-utils/ui';\r\nimport { ClipperDocumentInfo, ClipperModel, ClipperService, ClipperUtils } from '@arsedizioni/ars-utils/clipper.common';\r\n\r\n@Component({\r\n selector: 'clipper-document-menu',\r\n templateUrl: './document-menu.component.html',\r\n styleUrls: ['./document-menu.component.scss'],\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [FlexLayoutModule, MatMenuModule, MatIconModule, MatDividerModule, MatTooltipModule]\r\n})\r\nexport class ClipperDocumentMenuComponent {\r\n\r\n private readonly rsMenuTrigger = viewChild<MatMenuTrigger>('rsMenuTrigger');\r\n private readonly aiAssistantMenuTrigger = viewChild<MatMenuTrigger>('aiAssistantMenuTrigger');\r\n private readonly linksMenuTrigger = viewChild<MatMenuTrigger>('linksMenuTrigger');\r\n private readonly allMenuTriggers = [\r\n this.linksMenuTrigger,\r\n this.rsMenuTrigger,\r\n this.aiAssistantMenuTrigger,\r\n ];\r\n\r\n private readonly renderer2 = inject(Renderer2);\r\n private readonly clipperService = inject(ClipperService);\r\n\r\n readonly useSelections = input<boolean>(false);\r\n readonly selectionSource = input<'bag' | 'selection' | 'none' | undefined>('selection');\r\n\r\n /**\r\n * Computed signal that returns the current effective document selection.\r\n * Re-evaluates when any input signal or the underlying selection model changes.\r\n */\r\n protected readonly selection = computed((): ClipperDocumentInfo[] => {\r\n this.selectionTick(); // track external SelectionModel changes\r\n if (this.useSelections()) {\r\n switch (this.selectionSource()) {\r\n case 'bag': return this.parent()?.clipperService.bag() ?? [];\r\n case 'selection': return this.parent()?.selection?.all ?? [];\r\n }\r\n }\r\n return [];\r\n });\r\n\r\n readonly parent = input.required<any>();\r\n /**\r\n * Emits whenever the parent's SelectionModel changes (relevant only for the 'selection'\r\n * source; the 'bag' source is already a signal). `toObservable`+`switchMap` re-binds\r\n * cleanly if `parent` ever changes and removes the manual subscription/afterNextRender.\r\n */\r\n private readonly selectionTick = toSignal(\r\n toObservable(this.parent).pipe(\r\n switchMap(p => this.selectionSource() === 'selection' ? (p?.selection?.changed ?? EMPTY) : EMPTY),\r\n ),\r\n { initialValue: null },\r\n );\r\n readonly item = input<ClipperDocumentInfo>();\r\n readonly isReference = input<boolean>(false);\r\n readonly isReadable = input<boolean>(true);\r\n readonly isReadableModel = input<ClipperModel | undefined>(undefined);\r\n readonly isLawInForce = input<boolean>(false);\r\n readonly canPrint = input<boolean>(false);\r\n readonly canFind = input<boolean>(false);\r\n readonly canUseAIAssistant = input<boolean>(false);\r\n\r\n protected readonly canUseAIEditor: boolean = this.clipperService.user?.hasAIEditor ?? false;\r\n\r\n readonly canUseRS = input<boolean>(true);\r\n readonly canOpenDocument = input<boolean>(true);\r\n\r\n /** `true` when the current selection source is 'selection' and at least one item is selected. */\r\n protected readonly canDeselectAll = computed(() =>\r\n this.selectionSource() === 'selection' && this.selection().length > 0\r\n );\r\n /** `true` when operating in bag-management mode. */\r\n protected readonly canManageBag = computed(() => this.selectionSource() === 'bag');\r\n /** `true` when opening a document is allowed and exactly one item is selected. */\r\n protected readonly canOpen = computed(() => this.canOpenDocument() && this.hasSingleSelection());\r\n /** `true` when at least one item can be sent by email. */\r\n protected readonly canSendByEmail = computed(() => this.getMultipleSelection().length > 0);\r\n /** `true` when all selected items are deadline/alert documents and can travel as an ICS file. */\r\n protected readonly canExportCalendar = computed(() => {\r\n const items = this.getMultipleSelection();\r\n return items.length > 0 && items.every(\r\n n => n.model === ClipperModel.Scadenze || n.model === ClipperModel.Segnalazioni\r\n ) && !this.isReference();\r\n });\r\n /** `true` when the selection contains non-Coordinamento items that can be added to working documents. */\r\n protected readonly canAddToWorkingDocuments = computed(() => {\r\n if (this.selectionSource() === 'bag') return false;\r\n const items = this.getMultipleSelection();\r\n return items.length > 0 && items.every(n => n.model !== ClipperModel.Coordinamento);\r\n });\r\n /** `true` when a single non-Coordinamento document is selected and can be saved as PDF. */\r\n protected readonly canSaveAsPdf = computed(() => {\r\n const item = this.getSingleSelection();\r\n return item !== undefined && item.model !== ClipperModel.Coordinamento;\r\n });\r\n /** `true` when the selection contains at least one unread document that supports the read state. */\r\n protected readonly canSetAsRead = computed(() => {\r\n const items = this.getMultipleSelection();\r\n return this.isReadable() && (\r\n items.length > 1 ||\r\n (items.length === 1 && items[0].isRead !== true &&\r\n ClipperUtils.isClipperModelReadable(this.isReadableModel() ?? items[0].model ?? ClipperModel.Unknown))\r\n );\r\n });\r\n /** `true` when the selection contains at least one already-read document that supports the read state. */\r\n protected readonly canSetAsUnread = computed(() => {\r\n const items = this.getMultipleSelection();\r\n return this.isReadable() && (\r\n items.length > 1 ||\r\n (items.length === 1 && items[0].isRead === true &&\r\n ClipperUtils.isClipperModelReadable(this.isReadableModel() ?? items[0].model ?? ClipperModel.Unknown))\r\n );\r\n });\r\n /** `true` when the Clipper service supports RS and all selected items are RS-enabled. */\r\n protected readonly canAccessRS = computed(() => {\r\n const items = this.getMultipleSelection();\r\n return this.clipperService.supportsRS() && this.canUseRS() && this.parent()?.RS_enabled(items) === true;\r\n });\r\n\r\n /**\r\n * Returns a single selected document: the bound item if present, or the sole item in the selection list.\r\n * @returns The selected document, or `undefined` when zero or more than one item is selected.\r\n */\r\n protected getSingleSelection(): ClipperDocumentInfo | undefined {\r\n if (this.item()) {\r\n return this.item();\r\n } else if (this.selection().length === 1) {\r\n return this.selection()[0];\r\n }\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Returns the full effective selection as an array.\r\n * If a bound item is present it is returned wrapped in a single-element array;\r\n * otherwise the full selection list is returned.\r\n * @returns An array of selected documents, or an empty array when nothing is selected.\r\n */\r\n protected getMultipleSelection(): ClipperDocumentInfo[] {\r\n const item = this.item();\r\n if (item) return [item];\r\n return this.selection().length > 0 ? this.selection() : [];\r\n }\r\n\r\n /**\r\n * Returns whether exactly one document is available for single-item operations.\r\n * @returns `true` if the bound item has a non-empty document ID, or if exactly one item is selected.\r\n */\r\n protected hasSingleSelection(): boolean {\r\n return (this.item()?.documentId?.length ?? 0) > 0 || this.selection().length === 1;\r\n }\r\n\r\n /**\r\n * Closes all open sub-menu panels, then optionally opens the given trigger's menu.\r\n * @param trigger - The menu trigger to open after closing others; omit to only close.\r\n */\r\n protected showSubMenu(trigger?: MatMenuTrigger): void {\r\n this.allMenuTriggers.forEach(menuTrigger => {\r\n const menu = menuTrigger();\r\n if (menu?.menuOpen) {\r\n menu.closeMenu();\r\n this.resetSubMenu(menu);\r\n }\r\n });\r\n trigger?.openMenu();\r\n }\r\n\r\n /**\r\n * Removes the CDK focus classes from the given trigger element to reset its visual state.\r\n * @param trigger - The menu trigger whose focus styles to clear.\r\n */\r\n protected resetSubMenu(trigger: MatMenuTrigger): void {\r\n this.renderer2.removeClass(trigger['_element'].nativeElement, 'cdk-focused');\r\n this.renderer2.removeClass(trigger['_element'].nativeElement, 'cdk-program-focused');\r\n }\r\n\r\n /**\r\n * Returns the read state of the current item or selection.\r\n * @returns `0` if unread, `1` if read, `2` if mixed or unknown.\r\n */\r\n protected isRead(): number {\r\n if (this.item()) return this.item()?.isRead === true ? 1 : 0;\r\n if (this.parent()?.hasAnySelection()) return 2;\r\n const firstSelection = this.parent()?.getSingleSelection();\r\n if (firstSelection) {\r\n return firstSelection.isRead === true ? 1 : 0;\r\n }\r\n return 0;\r\n }\r\n\r\n /**\r\n * Delegates a read/unread state change to the parent component.\r\n * @param value - `true` to mark as read, `false` to mark as unread.\r\n */\r\n protected setRead(value: boolean): void {\r\n this.parent()?.setRead(value, this.item());\r\n }\r\n\r\n /**\r\n * Opens the given document, optionally in a new browser window.\r\n * @param item - The document to open; no-op when `undefined`.\r\n * @param newWindow - When `true`, opens the document in a new window.\r\n */\r\n protected open(item: ClipperDocumentInfo | undefined, newWindow: boolean = false): void {\r\n if (item?.documentId) {\r\n this.parent()?.open(item.documentId, undefined, undefined, newWindow);\r\n }\r\n }\r\n\r\n /**\r\n * Opens the references panel for the given document in the specified mode.\r\n * @param item - The document whose references to display; no-op when `undefined`.\r\n * @param mode - The reference query mode (e.g. 1 = referenced by, 2 = references, 4 = case law).\r\n */\r\n protected openReferences(item: ClipperDocumentInfo | undefined, mode: number): void {\r\n if (item?.documentId) {\r\n this.parent()?.openReferences(item.documentId, mode);\r\n }\r\n }\r\n}\r\n","@if (canDeselectAll()) {\r\n<button mat-menu-item (click)=\"parent().selection?.clear()\" [attr.aria-label]=\"'Deseleziona tutti'\"\r\n (mouseenter)=\"showSubMenu()\">\r\n <mat-icon>clear</mat-icon>Deseleziona tutti\r\n</button>\r\n} @else if (canManageBag()) {\r\n<button mat-menu-item (click)=\"parent().openBag()\" [attr.aria-label]=\"'Gestisci documenti di lavoro'\"\r\n (mouseenter)=\"showSubMenu()\">\r\n <mat-icon>work_outline</mat-icon>Gestisci documenti di lavoro\r\n</button>\r\n}\r\n@if (canOpen()) {\r\n<button mat-menu-item [attr.aria-label]=\"'Apri documento'\" (mouseenter)=\"showSubMenu()\"\r\n (click)=\"open(getSingleSelection())\">\r\n <mat-icon></mat-icon>Apri\r\n</button>\r\n}\r\n@if( this.hasSingleSelection()) {\r\n<button mat-menu-item [attr.aria-label]=\"'Apri documento in una nuova finestra'\" (mouseenter)=\"showSubMenu()\"\r\n (click)=\"open(getSingleSelection(), true)\">\r\n <mat-icon>open_in_new</mat-icon>Apri in una nuova finestra...\r\n</button>\r\n}\r\n@if (canAddToWorkingDocuments()) {\r\n<button mat-menu-item [attr.aria-label]=\"'Aggiungi ai documenti di lavoro'\"\r\n (click)=\"parent().addItemsToBag(getMultipleSelection())\" (mouseenter)=\"showSubMenu()\">\r\n <mat-icon>work_outline</mat-icon>Aggiungi ai documenti di lavoro\r\n</button>\r\n}\r\n@if(canPrint()) {\r\n<button mat-menu-item (click)=\"parent().print()\" [attr.aria-label]=\"'Stampa documento'\" (mouseenter)=\"showSubMenu()\">\r\n <div fxLayout=\"row\" fxLayoutGap=\"20px\" fxLayoutAlign=\"start center\" fxFill>\r\n <div fxFlex=\"*\" fxLayout=\"row\" fxFill fxLayoutAlign=\"start center\">\r\n <mat-icon>print</mat-icon>\r\n <div>Stampa</div>\r\n </div>\r\n <div class=\"accent small bold\">CTRL+P</div>\r\n </div>\r\n</button>\r\n}\r\n@if(canFind()) {\r\n<button mat-menu-item (click)=\"parent().find()\" [attr.aria-label]=\"'Trova nel documento'\" (mouseenter)=\"showSubMenu()\">\r\n <div fxLayout=\"row\" fxLayoutGap=\"20px\" fxLayoutAlign=\"start center\" fxFill>\r\n <div fxFlex=\"*\" fxLayout=\"row\" fxFill fxLayoutAlign=\"start center\">\r\n <mat-icon>find_in_page</mat-icon>\r\n <div>Trova nel documento</div>\r\n </div>\r\n <div class=\"accent small bold\">CTRL+F</div>\r\n </div>\r\n</button>\r\n}\r\n@if (canSendByEmail()) {\r\n<button mat-menu-item (click)=\"parent().sendItemsTo(getMultipleSelection())\"\r\n [attr.aria-label]=\"'Invia documento per email'\" (mouseenter)=\"showSubMenu()\">\r\n <mat-icon>send</mat-icon>Invia per email\r\n</button>\r\n}\r\n@if (canSaveAsPdf()) {\r\n<button mat-menu-item (click)=\"parent().exportPdf(getSingleSelection())\" (mouseenter)=\"showSubMenu()\"\r\n [attr.aria-label]=\"'Salva documento in pdf'\">\r\n <mat-icon>save_alt</mat-icon>Salva in pdf\r\n</button>\r\n}\r\n@if( this.hasSingleSelection()) {\r\n<button mat-menu-item [attr.aria-label]=\"'Genera un link permanente da utilizzare esternamente'\"\r\n (click)=\"parent().showLink(getSingleSelection())\" (mouseenter)=\"showSubMenu()\">\r\n <mat-icon>link</mat-icon>Link\r\n</button>\r\n<button mat-menu-item [attr.aria-label]=\"'Copia metadati negli appunti'\"\r\n (click)=\"parent().copyMetadataToClipboard(getSingleSelection())\" (mouseenter)=\"showSubMenu()\">\r\n <mat-icon>content_copy</mat-icon>Copia metadati\r\n</button>\r\n}\r\n@if (!isReference() && this.hasSingleSelection()) {\r\n<button mat-menu-item [matMenuTriggerFor]=\"linksMenu\" #linksMenuTrigger=\"matMenuTrigger\"\r\n (mouseenter)=\"showSubMenu(linksMenuTrigger)\" (mouseleave)=\"resetSubMenu(linksMenuTrigger)\">\r\n <mat-icon>compare_arrows</mat-icon>Collegamenti\r\n</button>\r\n<mat-menu #linksMenu=\"matMenu\">\r\n <button mat-menu-item [attr.aria-label]=\"'Mostra i documenti richiamati da questo'\"\r\n (click)=\"openReferences(getSingleSelection(), 1)\">\r\n Documenti richiamati\r\n </button>\r\n <button mat-menu-item [attr.aria-label]=\"'Mostra i documenti che richiamano questo'\"\r\n (click)=\"openReferences(getSingleSelection(), 2)\">\r\n Documenti che richiamano\r\n </button>\r\n @if (isLawInForce()) {\r\n <button mat-menu-item [attr.aria-label]=\"'Mostra giurisprudenza'\" (click)=\"openReferences(getSingleSelection(), 4)\">\r\n Juris\r\n </button>\r\n }\r\n @if (isLawInForce()) {\r\n <button mat-menu-item [attr.aria-label]=\"'Mostra modifiche normative'\"\r\n (click)=\"openReferences(getSingleSelection(), 3)\">\r\n Modifiche\r\n </button>\r\n }\r\n</mat-menu>\r\n}\r\n@if (canExportCalendar()) {\r\n@if(useSelections()) {\r\n<button mat-menu-item [attr.aria-label]=\"'Importa in Oultook (iCalandar)'\" (click)=\"parent().exportResults(2)\">\r\n <mat-icon>mail_outline</mat-icon>Importa in Outlook (iCalendar)\r\n</button>\r\n} @else if (item()) {\r\n<button mat-menu-item [attr.aria-label]=\"'Importa in Oultook (iCalandar)'\"\r\n (click)=\"parent().exportItems([item()?.documentId ?? ''], undefined, 2)\">\r\n <mat-icon>mail_outline</mat-icon>Importa in Outlook (iCalendar)\r\n</button>\r\n}\r\n}\r\n@if (canSetAsUnread()) {\r\n<button mat-menu-item [attr.aria-label]=\"'Segna come da leggere'\" (click)=\"setRead(false)\" (mouseenter)=\"showSubMenu()\">\r\n <mat-icon>outlined_flag</mat-icon>Segna come da leggere\r\n</button>\r\n}\r\n@if (canSetAsRead()) {\r\n<button mat-menu-item [attr.aria-label]=\"'Segna come già letto'\" (click)=\"setRead(true)\" (mouseenter)=\"showSubMenu()\">\r\n <mat-icon>flag</mat-icon>Segna come già letto\r\n</button>\r\n}\r\n\r\n\r\n@if (isLawInForce() && this.hasSingleSelection()) {\r\n<button mat-menu-item [attr.aria-label]=\"'Mostra report'\" (click)=\"parent().report(getSingleSelection())\"\r\n (mouseenter)=\"showSubMenu()\">\r\n <mat-icon>assignment</mat-icon>Report\r\n</button>\r\n}\r\n\r\n@if (canUseAIAssistant() && hasSingleSelection()) {\r\n<mat-divider></mat-divider>\r\n<button mat-menu-item matTooltip=\"Assistente IA\" [attr.aria-label]=\"'Assistente IA'\"\r\n [matMenuTriggerFor]=\"aiAssistantMenu\" #aiAssistantMenuTrigger=\"matMenuTrigger\"\r\n (mouseenter)=\"showSubMenu(aiAssistantMenuTrigger)\" (mouseleave)=\"resetSubMenu(aiAssistantMenuTrigger)\">\r\n <mat-icon>borg</mat-icon>\r\n Assistente IA\r\n</button>\r\n<mat-menu #aiAssistantMenu=\"matMenu\">\r\n <button mat-menu-item [attr.aria-label]=\"'Mi riguarda?'\" (click)=\"parent().AI_concernMe(getSingleSelection())\">\r\n Mi riguarda?\r\n </button>\r\n <button mat-menu-item [attr.aria-label]=\"'Di che si tratta?'\" (click)=\"parent().AI_explain(getSingleSelection())\">\r\n Di che si tratta?\r\n </button>\r\n @if (canUseAIEditor) {\r\n <button mat-menu-item [attr.aria-label]=\"'Genera commento tecnico'\"\r\n (click)=\"parent().AI_comment(getSingleSelection())\">\r\n Genera commento tecnico\r\n </button>\r\n <button mat-menu-item [attr.aria-label]=\"'Genera news'\" (click)=\"parent().AI_news(getSingleSelection())\">\r\n Genera news\r\n </button>\r\n }\r\n</mat-menu>\r\n}\r\n\r\n@if (canAccessRS()) {\r\n<mat-divider></mat-divider>\r\n<button mat-menu-item matTooltip=\"Registro & Scadenzario\" [attr.aria-label]=\"'Opzioni di Registro & Scadenzario'\"\r\n [matMenuTriggerFor]=\"rsMenu\" #rsMenuTrigger=\"matMenuTrigger\" (mouseenter)=\"showSubMenu(rsMenuTrigger)\"\r\n (mouseleave)=\"resetSubMenu(rsMenuTrigger)\">\r\n <mat-icon>alarm_on</mat-icon>\r\n Registro e scadenzario\r\n</button>\r\n<mat-menu #rsMenu=\"matMenu\">\r\n <button mat-menu-item [attr.aria-label]=\"'Nuova legge'\" (click)=\"parent().RS_newLaw(getMultipleSelection())\">\r\n Nuova legge\r\n </button>\r\n @if (hasSingleSelection()) {\r\n <button mat-menu-item [attr.aria-label]=\"'Nuova attività'\" (click)=\"parent().RS_newActivity(getSingleSelection())\">\r\n Nuova attività\r\n </button>\r\n }\r\n @if (hasSingleSelection()) {\r\n <button mat-menu-item [attr.aria-label]=\"'Report utilizzo norma'\"\r\n (click)=\"parent().RS_usageReport(getSingleSelection())\">\r\n Report utilizzo norma\r\n </button>\r\n }\r\n</mat-menu>\r\n}","import { ChangeDetectionStrategy, ChangeDetectorRef, Component, inject, input, output } from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatChipsModule } from '@angular/material/chips';\nimport { MatDividerModule } from '@angular/material/divider';\nimport { MatExpansionModule } from '@angular/material/expansion';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { ClipperFacet, ClipperSearchFacet, ClipperSearchFacetGroup, ClipperSearchFacetsSnapshot } from '@arsedizioni/ars-utils/clipper.common';\nimport { FlexLayoutModule } from '@arsedizioni/ars-utils/ui';\n\n\n@Component({\n selector: 'clipper-search-facets',\n templateUrl: './search-facets.component.html',\n styleUrls: ['./search-facets.component.scss'],\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [FlexLayoutModule, MatButtonModule, MatTooltipModule, MatChipsModule, MatIconModule, \n MatDividerModule, MatExpansionModule]\n})\nexport class ClipperSearchFacetsComponent {\n readonly changed = output<ClipperSearchFacetsSnapshot>();\n private readonly changeDetector = inject(ChangeDetectorRef);\n\n protected snapshot: ClipperSearchFacetsSnapshot = new ClipperSearchFacetsSnapshot();\n\n /**\n * Returns whether the current snapshot contains at least one available or applied facet group.\n */\n public hasFacets(): boolean { return this.snapshot.hasFacets; }\n\n readonly handleTooManyResults = input<boolean>(false);\n\n /**\n * Pushes a new set of facet groups into the snapshot and refreshes the view.\n * @param values - The raw facet data returned by the search engine, grouped by type.\n * @param interval - Optional display label for the year-range interval (YEAR facet type).\n */\n update(values?: ClipperSearchFacet[][], interval?: string): void {\n this.snapshot.interval = interval;\n if (values) {\n this.snapshot.groups = [];\n values.forEach(n => {\n const name = n[0].typeName;\n const index = n[0].type;\n const i = this.snapshot.usedGroups.findIndex(n => n.index === index);\n const j = this.snapshot.groups.findIndex(n => n.index === index);\n if (i === -1 && j === -1) {\n this.snapshot.groups.push({\n name: name,\n selectedValue: null,\n selectedValueDescription: null,\n values: n,\n index: index,\n }); \n }\n });\n }\n this.snapshot.hasFacets = this.snapshot.groups.length > 0 || this.snapshot.usedGroups.length > 0; \n this.snapshot.hasMoreFacets = this.snapshot.hasFacets && this.snapshot.groups.length > this.snapshot.usedGroups.length; \n this.changeDetector.markForCheck();\n }\n\n\n\n /**\n * Applies the given facet item as an active filter and emits a `changed` event.\n * @param group - The facet group that owns the selected item.\n * @param item - The facet item chosen by the user.\n */\n protected use(group: ClipperSearchFacetGroup, item: ClipperSearchFacet): void {\n group.selectedValue = item.value;\n group.selectedValueDescription = item.title;\n const j = this.snapshot.groups.findIndex(n => n.index === group.index);\n if (j !== -1) {\n this.snapshot.groups.splice(j, 1);\n // Insert into usedGroups in ascending index order without mutating while iterating.\n const insertAt = this.snapshot.usedGroups.findIndex(n => n.index > group.index);\n if (insertAt !== -1) {\n this.snapshot.usedGroups.splice(insertAt, 0, group);\n } else {\n this.snapshot.usedGroups.push(group);\n }\n }\n this.apply();\n }\n\n /**\n * Removes an active facet filter from the selection and optionally emits a `changed` event.\n * @param group - The applied facet group to dismiss.\n * @param apply - When `true` (default), emits the `changed` event to trigger a new search.\n */\n protected dismiss(group: ClipperSearchFacetGroup, apply: boolean = true): void {\n group.selectedValue = undefined;\n group.selectedValueDescription = undefined;\n const i = this.snapshot.usedGroups.findIndex(n => n.index === group.index);\n if (i !== -1) {\n this.snapshot.usedGroups.splice(i, 1);\n // Re-insert into groups in ascending index order without mutating while iterating.\n const insertAt = this.snapshot.groups.findIndex(n => n.index > group.index);\n if (insertAt !== -1) {\n this.snapshot.groups.splice(insertAt, 0, group);\n } else {\n this.snapshot.groups.push(group);\n }\n }\n if (apply) {\n this.apply();\n }\n }\n\n /**\n * Builds and emits the current `ClipperSearchFacetsSnapshot` after resolving each applied\n * facet group's filter value into the corresponding snapshot date/sector/author/type fields.\n */\n private apply(): void {\n if (this.snapshot.usedGroups.length > 0) {\n this.snapshot.usedGroups.forEach(n => {\n if (n.index === ClipperFacet.Year) {\n if (n.selectedValue) {\n this.snapshot.fromDate = new Date(parseInt(n.selectedValue), 0, 1, 12, 0, 0);\n this.snapshot.toDate = new Date(parseInt(n.selectedValue), 11, 31, 12, 0, 0);\n } else {\n this.snapshot.fromDate = undefined;\n this.snapshot.toDate = undefined;\n }\n } else if (n.index === ClipperFacet.Sector) {\n this.snapshot.sector = n.selectedValue ?? null;\n } else if (n.index === ClipperFacet.Author) {\n this.snapshot.author = n.selectedValue ?? null;\n } else if (n.index === ClipperFacet.DocumentType) {\n this.snapshot.type = n.selectedValue ?? null;\n } else if (n.index === ClipperFacet.Article) {\n this.snapshot.anchor = n.selectedValue ?? null;\n } else if (n.index === ClipperFacet.Reason) {\n this.snapshot.reason = n.selectedValue ?? null;\n }\n });\n }\n if (this.snapshot.groups.length > 0) {\n this.snapshot.groups.forEach(n => {\n if (n.index === ClipperFacet.Year) {\n this.snapshot.fromDate = undefined;\n this.snapshot.toDate = undefined;\n } else if (n.index === ClipperFacet.Sector) {\n this.snapshot.sector = undefined;\n } else if (n.index === ClipperFacet.Author) {\n this.snapshot.author = undefined;\n } else if (n.index === ClipperFacet.DocumentType) {\n this.snapshot.type = undefined;\n } else if (n.index === ClipperFacet.Article) {\n this.snapshot.anchor = undefined;\n } else if (n.index === ClipperFacet.Reason) {\n this.snapshot.reason = undefined;\n }\n });\n }\n this.changed.emit(this.snapshot);\n }\n\n /**\n * Dismisses one or all applied facet groups and emits a `changed` event if any were removed.\n * @param index - The group index to clear, or `-1` to clear all applied groups at once.\n * @returns The number of groups that were dismissed.\n */\n protected clear(index: number = -1): number {\n let dismissed = 0;\n // Snapshot the list first to avoid mutating usedGroups while iterating it.\n const toRemove = this.snapshot.usedGroups.filter(n => index === -1 || index === n.index);\n toRemove.forEach(n => {\n if (n.index === ClipperFacet.Year) {\n this.snapshot.fromDate = undefined;\n this.snapshot.toDate = undefined;\n } else if (n.index === ClipperFacet.Sector) {\n this.snapshot.sector = undefined;\n } else if (n.index === ClipperFacet.Author) {\n this.snapshot.author = undefined;\n } else if (n.index === ClipperFacet.DocumentType) {\n this.snapshot.type = undefined;\n } else if (n.index === ClipperFacet.Article) {\n this.snapshot.anchor = undefined;\n } else if (n.index === ClipperFacet.Reason) {\n this.snapshot.reason = undefined;\n }\n this.dismiss(n, false);\n dismissed++;\n });\n if (dismissed) {\n this.changed.emit(this.snapshot);\n }\n return dismissed;\n }\n\n /**\n * Resets all facet state: clears every applied/available group and all derived filter fields.\n */\n reset(): void {\n this.snapshot.groups = [];\n this.snapshot.usedGroups = [];\n this.snapshot.hasFacets = false;\n this.snapshot.fromDate = undefined;\n this.snapshot.toDate = undefined;\n this.snapshot.sector = undefined;\n this.snapshot.author = undefined;\n this.snapshot.anchor = undefined;\n this.snapshot.type = undefined;\n this.snapshot.reason = undefined;\n }\n\n /**\n * Restores a previously serialised facets snapshot and refreshes the view.\n * @param data - The snapshot to restore.\n */\n restore(data: ClipperSearchFacetsSnapshot): void {\n if (data) {\n this.snapshot = data;\n this.changeDetector.markForCheck();\n }\n }\n\n /**\n * Returns the current facets snapshot for external serialisation (e.g. save/restore cycle).\n * @returns The current `ClipperSearchFacetsSnapshot`.\n */\n save(): ClipperSearchFacetsSnapshot {\n return this.snapshot;\n }\n}\n","<div fxLayout=\"column\" fxFill class=\"facets-container scroll-hidden\">\r\n @if (snapshot.usedGroups.length > 0) {\r\n <div class=\"facets-selection\">\r\n <mat-chip-set aria-label=\"Selezione\">\r\n @for (ug of snapshot.usedGroups; track $index) {\r\n <mat-chip (removed)=\"dismiss(ug)\" [matTooltip]=\"ug.selectedValueDescription ?? ''\" matTooltipPosition=\"above\">\r\n {{ug.selectedValueDescription}}\r\n <button matChipRemove [attr.aria-label]=\"'Rimuovi ' + ug.name\" [matTooltip]=\"'Rimuovi ' + ug.name\">\r\n <mat-icon>cancel</mat-icon>\r\n </button>\r\n </mat-chip>\r\n }\r\n </mat-chip-set>\r\n <mat-divider class=\"divider\"></mat-divider>\r\n </div>\r\n }\r\n <div fxFlex=\"*\" class=\"scroll-auto facets-items-container\">\r\n @if (snapshot.groups.length > 0) {\r\n @for (group of snapshot.groups; track group.index; let i = $index) {\r\n <mat-accordion multi displayMode=\"flat\">\r\n <mat-expansion-panel class=\"accordion-panel mat-elevation-z0 \" [expanded]=\"i == 0\">\r\n <mat-expansion-panel-header class=\"accordion-header\" [attr.aria-label]=\"group.name\">\r\n <mat-panel-title>\r\n @if (group.index == 2 && snapshot.interval) {\r\n {{snapshot.interval}} ({{group.values.length}})\r\n } @else {\r\n {{group.name}} ({{group.values.length}})\r\n }\r\n </mat-panel-title>\r\n </mat-expansion-panel-header>\r\n <nav class=\"facets-items\">\r\n <ul>\r\n @for (item of group.values; track $index) {\r\n <li (click)=\"use(group, item)\" [attr.aria-label]=\"item.title\">\r\n <div fxLayout=\"row\" fxLayoutGap=\"10px\" fxFill>\r\n <div fxFlex=\"*\" fxFlexAlign=\"center\" class=\"truncated\">\r\n <div class=\"truncated\">{{item.title}}</div>\r\n </div>\r\n <div fxLayoutAlign=\"end\" fxFlexAlign=\"center\">\r\n {{!handleTooManyResults() && snapshot.hasTooManyResults ? '~' : ''}}{{item.count}}\r\n </div>\r\n </div>\r\n </li>\r\n }\r\n </ul>\r\n </nav>\r\n </mat-expansion-panel>\r\n </mat-accordion>\r\n }\r\n } @else if (snapshot.hasFacets && !snapshot.hasMoreFacets) {\r\n <div class=\"facets-message\">\r\n <p class=\"small\"><i>Tutte le opzioni sono state selezionate</i></p>\r\n </div>\r\n }\r\n </div>\r\n</div>","import { Clipboard } from '@angular/cdk/clipboard';\r\nimport { ChangeDetectionStrategy, Component, inject, output, signal } from '@angular/core';\r\nimport { ClipperDocumentInfo, ClipperExportDocumentsParams, ClipperMessages, ClipperModel, ClipperModule, ClipperQueryReferencesMode, ClipperSearchParams, ClipperSendDocumentsByEmailParams, ClipperService } from '@arsedizioni/ars-utils/clipper.common';\r\nimport { BroadcastService, SystemUtils } from '@arsedizioni/ars-utils/core';\r\nimport { DialogResult } from '@arsedizioni/ars-utils/ui';\r\nimport { DialogService } from '@arsedizioni/ars-utils/ui.dialogs';\r\nimport { SelectableItem, SelectDialogDelete, SendToPopulateData } from '@arsedizioni/ars-utils/ui';\r\nimport { SendToDialogComponent } from '@arsedizioni/ars-utils/ui.dialogs.select';\r\nimport saveAs from 'file-saver';\r\nimport { finalize } from 'rxjs';\r\n\r\n\r\n@Component({\r\n template: '<div></div>',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class ClipperDocumentManager {\r\n readonly populateContacts = output<SendToPopulateData>();\r\n protected readonly clipboard = inject(Clipboard);\r\n public readonly clipperService = inject(ClipperService);\r\n protected readonly broadcastService = inject(BroadcastService);\r\n protected readonly dialogService = inject(DialogService);\r\n protected readonly canHandleTooManyResults = signal<boolean>(false);\r\n protected readonly canPopulateContacts = signal<boolean>(false);\r\n\r\n \r\n /**\r\n * Exports a document in PDF format, after asking for confirmation.\r\n * @param item - The document to export.\r\n */\r\n exportPdf(item: ClipperDocumentInfo): void {\r\n if (!this.clipperService.loggedIn()) return;\r\n if (!item) return;\r\n this.dialogService\r\n .confirm(\"Confermi l'esportazione?\", 'Attenzione!')\r\n .componentInstance.choosen.subscribe((data: DialogResult) => {\r\n if (data.result === 'ok') {\r\n const id = item.id ?? item.documentId;\r\n this.dialogService.busy('Esportazione in corso...');\r\n this.clipperService.documents.exportPdf(id)\r\n .pipe(finalize(() => this.dialogService.clearBusy()))\r\n .subscribe(r => {\r\n saveAs(r, (item.title1 ?? id) + '.pdf');\r\n });\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Exports the current document list (or only the selected documents) as CSV or ICS.\r\n * @param documentIds - The list of document IDs to export; if empty, the full search result is exported.\r\n * @param searchParams - The search parameters used to identify the full result set when no IDs are provided.\r\n * @param format - The export format: 1 = list (CSV), 2 = deadlines (ICS).\r\n */\r\n exportItems(\r\n documentIds: string[] | undefined,\r\n searchParams: ClipperSearchParams | undefined = undefined,\r\n format: number = 1): void {\r\n if (!this.clipperService.loggedIn()) return;\r\n const model: ClipperExportDocumentsParams = { ids: documentIds ?? [], query: null, format: format };\r\n if (!model.ids || model.ids.length === 0) {\r\n model.query = searchParams;\r\n }\r\n this.dialogService.busy('Salvataggio in corso...');\r\n this.clipperService.documents.export(model)\r\n .pipe(finalize(() => this.dialogService.clearBusy()))\r\n .subscribe(r => {\r\n if (r.type === 'application/json') {\r\n r.text().then(json => this.dialogService.error(JSON.parse(json).message));\r\n } else {\r\n if (format === 1) {\r\n saveAs(r, 'elenco_' + SystemUtils.formatDate(new Date(), 'yyyyMMddhhmmss') + '.csv');\r\n } else {\r\n saveAs(r, 'scadenze_' + SystemUtils.formatDate(new Date(), 'yyyyMMddhhmmss') + '.ics');\r\n }\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Exports a single document's deadline as an ICS file.\r\n * @param item - The document whose deadline to export.\r\n */\r\n exportDeadline(item: ClipperDocumentInfo): void {\r\n this.exportItems([item.documentId], undefined, 2);\r\n }\r\n\r\n /**\r\n * Sends a broadcast message to add the given documents to the working-documents set.\r\n * @param items - The list of documents to add.\r\n */\r\n addItemsToWorkingDocuments(items: ClipperDocumentInfo[]): void {\r\n this.broadcastService.sendMessage(ClipperMessages.COMMAND_WORKING_ADD, items);\r\n }\r\n\r\n /**\r\n * Sends a request to the Clipper service to add the given documents to the bag.\r\n * @param items - The list of documents to add.\r\n */\r\n addItemsToBag(items: ClipperDocumentInfo[]): void {\r\n if (!this.clipperService.loggedIn()) return;\r\n this.clipperService.documents.addToBag(items?.map(n => n.documentId ?? n.id) ?? []);\r\n }\r\n\r\n\r\n /**\r\n * Copies the document's metadata (ID, titles, number, date, origin) as a tab-separated string to the clipboard.\r\n * @param item - The document whose metadata to copy.\r\n */\r\n copyMetadataToClipboard(item: ClipperDocumentInfo): void {\r\n if (!item || item.model === ClipperModel.Coordinamento) return;\r\n let meta =\r\n (item.id ?? item.documentId) + '\\t' +\r\n (item.title1?.replaceAll(\"\\r\\n\", \" \") ?? '') + '\\t';\r\n if (item.title2)\r\n meta += item.title2.replaceAll(\"\\r\\n\", \" \");\r\n meta += '\\t';\r\n if (item.number)\r\n meta += item.number;\r\n meta += '\\t';\r\n if (item.publishingDate) {\r\n meta += SystemUtils.formatDate(new Date(item.publishingDate));\r\n } else if (item.date) {\r\n meta += SystemUtils.formatDate(new Date(item.date));\r\n }\r\n meta += '\\t';\r\n if (item.originDescription)\r\n meta += item.originDescription;\r\n this.clipboard.copy(meta);\r\n this.dialogService.toast(\"Metadati copiati negli appunti.\");\r\n }\r\n\r\n /**\r\n * Displays a dialog with a shareable permalink for the given document.\r\n * @param item - The document to show the permalink for.\r\n */\r\n showLink(item: ClipperDocumentInfo): void {\r\n if (!item) return;\r\n const id = item.id ?? item.documentId;\r\n if (!id) return;\r\n const channels = item.channelName\r\n ? 'Canali: ' + item.channelName + '<br>'\r\n : '';\r\n const origin = item.origin\r\n ? `Origine: ${item.origin} - ${item.originDescription ?? ''}<br>`\r\n : '';\r\n const topics = item.topics\r\n ? 'Argomenti: ' + item.topics.replaceAll('o', '.') + '<br>'\r\n : '';\r\n const taxonomy = item.taxonomyPath\r\n ? 'Tassonomia:<br> - ' + item.taxonomyPath.replaceAll('\\r\\n', '<br> - ') + '<br>'\r\n : '';\r\n const message =\r\n \"<p >Il link che trovi qui sotto è un riferimento diretto al documento selezionato.</p>\" +\r\n \"<p >Lo puoi utilizzare nella tua documentazione o inviarlo per email ad un tuo collega. La persona che desidererà visualizzare il documento dovrà necessariamente essere un utente abbonato.</p>\" +\r\n \"<p >Seleziona e copia (fai CTRL+C) il link qui sotto.</p>\" +\r\n \"<div class='small accent'>\" +\r\n 'https://clipper.arsedizioni.it/?id=' +\r\n id +\r\n '</div>' +\r\n '<br>' +\r\n '<hr>' +\r\n '<p class=\"small\">' +\r\n channels +\r\n origin +\r\n topics +\r\n taxonomy +\r\n '</p>';\r\n\r\n this.dialogService.info(message, 'Copia link', 'Chiudi');\r\n }\r\n\r\n /**\r\n * Opens a dialog to send document links by email to one or more recipients.\r\n * @param items - The list of documents to send.\r\n */\r\n sendItemsTo(items: ClipperDocumentInfo[]): void {\r\n if (!this.clipperService.loggedIn()) return;\r\n if (!items || items.length === 0) return;\r\n const d = this.dialogService.open(SendToDialogComponent, {\r\n ariaLabel: 'invia documenti per email',\r\n autoFocus: 'dialog',\r\n restoreFocus: false,\r\n disableClose: false,\r\n closeOnNavigation: false,\r\n data: {\r\n info:'Puoi inviare i documenti a chi vuoi ma, per poterli visualizzare, è necessario essere un utente abbonato.',\r\n count: items.length,\r\n canPopulate: this.canPopulateContacts(),\r\n },\r\n minWidth: '375px',\r\n maxWidth: '600px',\r\n width: '100%',\r\n });\r\n d.componentInstance.done\r\n .subscribe(data => {\r\n const params: ClipperSendDocumentsByEmailParams = {\r\n recipients: data.recipients,\r\n subject: data.subject,\r\n text: data.text,\r\n ids: items?.map(n => n.documentId ?? n.id) ?? []\r\n } as ClipperSendDocumentsByEmailParams;\r\n this.dialogService.busy('Invio in corso...');\r\n this.clipperService.documents.sendTo(params)\r\n .pipe(finalize(() => this.dialogService.clearBusy()))\r\n .subscribe(r => {\r\n if (!r.success) {\r\n this.dialogService.error(r.message);\r\n } else {\r\n this.dialogService.toast('Invio completato con successo.');\r\n d.close();\r\n }\r\n });\r\n });\r\n d.componentInstance.populate\r\n .subscribe(data => {\r\n this.populateContacts.emit(data);\r\n });\r\n }\r\n\r\n /**\r\n * Downloads the document's HTML report.\r\n * @param documentId - The ID of the document.\r\n * @param title - Optional display title used as the file name.\r\n */\r\n openReport(documentId: string, title?: string): void {\r\n if (!this.clipperService.loggedIn()) return;\r\n if (!documentId) return;\r\n this.clipperService.documents.report(documentId)\r\n .pipe(finalize(() => this.dialogService.clearBusy()))\r\n .subscribe(r => {\r\n saveAs(r, (title ? title : documentId) + '.html');\r\n });\r\n }\r\n\r\n /**\r\n * Opens a document for display. Override in subclasses to provide the actual implementation.\r\n * @param _documentId - The document ID.\r\n * @param _query - The search query string.\r\n * @param _queryChunks - Pipe-separated highlight chunks (e.g. \"|1|2|3...\").\r\n * @param _newWindow - When true, opens the document in a new browser window.\r\n */\r\n open(\r\n _documentId?: string,\r\n _query?: string,\r\n _queryChunks?: string,\r\n _newWindow?: boolean): void {\r\n }\r\n\r\n /**\r\n * Downloads the HTML report for a normativa/scadenze document.\r\n * @param item - The document to report on.\r\n */\r\n report(item: ClipperDocumentInfo): void {\r\n if (!item) return;\r\n if (item.model !== ClipperModel.NormativaVigente && item.model !== ClipperModel.Scadenze) {\r\n this.dialogService.info(\"Questa funzionalità non è disponibile per questo tipo di documento.\");\r\n return;\r\n } else {\r\n this.openReport(item.documentId, item.title1);\r\n }\r\n }\r\n\r\n /**\r\n * Opens the references dialog for the given document.\r\n * @param documentId - The ID of the document whose references to display.\r\n * @param mode - The reference mode (e.g. ReferencesIn, ReferencesOut).\r\n */\r\n openReferences(documentId?: string, mode: ClipperQueryReferencesMode = ClipperQueryReferencesMode.ReferencesIn): void {\r\n if (!documentId) return;\r\n import('../references/references.component').then(({ ClipperReferencesComponent }) => {\r\n const d = this.dialogService.open(ClipperReferencesComponent, {\r\n ariaLabel: 'riferimenti legati al documento',\r\n autoFocus: 'dialog',\r\n restoreFocus: false,\r\n disableClose: false,\r\n closeOnNavigation: false,\r\n data: { \r\n documentId: documentId, \r\n mode: mode, \r\n canHandleTooManyResults: this.canHandleTooManyResults() \r\n },\r\n minWidth: '375px',\r\n maxWidth: '1200px',\r\n width: '100%',\r\n height: '100%',\r\n });\r\n d.afterClosed()\r\n .subscribe((r: { documentId: string }) => {\r\n if (r && r.documentId) this.open(r.documentId);\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * Opens a dialog to manage the documents in the working bag (view, select, delete).\r\n */\r\n async openBag(): Promise<void> {\r\n const items: SelectableItem[] = [];\r\n this.clipperService.bag().forEach(n => {\r\n const title = n.title1 ?? n.title2 ?? '';\r\n items.push({\r\n template: title,\r\n bag: n,\r\n searchBag: { name: title },\r\n });\r\n });\r\n const d = await this.dialogService.select({\r\n title: 'Gestisci documenti di lavoro',\r\n multipleSelection: false,\r\n mustSelect: false,\r\n okCaption: 'SELEZIONA',\r\n items: items,\r\n canDelete: true,\r\n canView: true,\r\n });\r\n d?.componentInstance.view\r\n .subscribe((r: SelectableItem) => {\r\n let item = r.bag;\r\n this.open(item.documentId);\r\n });\r\n d?.componentInstance.delete\r\n .subscribe((r: SelectDialogDelete) => {\r\n const item = r.selectedItems[0].bag;\r\n this.clipperService.documents.removeFromBag(item.documentId).add(\r\n () => {\r\n this.dialogService.toast('Operazione completata con successo.');\r\n for (let p = 0; p < r.items.length; p++) {\r\n if (r.items[p].bag.DocumentId === item.DocumentId) {\r\n r.items.splice(p, 1);\r\n if (r.items.length === 0) d.close();\r\n return;\r\n }\r\n }\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * Sends a print command to the Clipper document iframe.\r\n */\r\n print(): void {\r\n const f = document.getElementById('clipper-document-iframe') as any;\r\n f?.contentWindow.postMessage('{\"type\": \"print\"}', '*');\r\n }\r\n\r\n /**\r\n * Displays a hint dialog explaining how to use the browser's find-in-page feature.\r\n */\r\n find(): void {\r\n this.dialogService.info('Per cercare nel documento premi CTRL + F.');\r\n }\r\n\r\n\r\n ////\r\n // AI Assistant\r\n ////\r\n /**\r\n * AI: sends a \"concern me\" request for the given document.\r\n * @param document - The document to analyse.\r\n */\r\n AI_concernMe(document?: ClipperDocumentInfo): void {\r\n if (!document) return;\r\n this.broadcastService.sendMessage(ClipperMessages.AI_CONCERN_ME, document);\r\n }\r\n\r\n /**\r\n * AI: sends an \"explain\" request for the given document.\r\n * @param document - The document to explain.\r\n */\r\n AI_explain(document?: ClipperDocumentInfo): void {\r\n if (!document) return;\r\n this.broadcastService.sendMessage(ClipperMessages.AI_EXPLAIN, document);\r\n }\r\n\r\n\r\n /**\r\n * AI: sends a \"comment\" request for the given document.\r\n * @param document - The document to comment on.\r\n */\r\n AI_comment(document?: ClipperDocumentInfo): void {\r\n if (!document) return;\r\n this.broadcastService.sendMessage(ClipperMessages.AI_COMMENT, document);\r\n }\r\n\r\n /**\r\n * AI: sends a \"news\" request for the given document.\r\n * @param document - The document to retrieve news for.\r\n */\r\n AI_news(document?: ClipperDocumentInfo): void {\r\n if (!document) return;\r\n this.broadcastService.sendMessage(ClipperMessages.AI_NEWS, document);\r\n }\r\n\r\n ////\r\n // Registro e scadenzario\r\n ////\r\n\r\n /**\r\n * Returns whether the given Clipper module is supported by Registro e Scadenzario (RS).\r\n * @param module - The module to check.\r\n * @returns `true` if the module is supported by RS.\r\n */\r\n isModuleSupportedByRS(module: ClipperModule): boolean {\r\n return module === ClipperModule.GazzetteBollettiniEFontiDiverse ||\r\n module === ClipperModule.NormativaVigente ||\r\n module === ClipperModule.ScadenzeESegnalazioni;\r\n }\r\n\r\n /**\r\n * Returns whether the given Clipper model is supported by Registro e Scadenzario (RS).\r\n * @param model - The model to check.\r\n * @returns `true` if the model is supported by RS.\r\n */\r\n isModelSupportedByRS(model: ClipperModel): boolean {\r\n return model === ClipperModel.AggiornamentoNormativo ||\r\n model === ClipperModel.NormativaVigente ||\r\n model === ClipperModel.Scadenze;\r\n\r\n }\r\n\r\n /**\r\n * Returns whether every document in the list has a model supported by RS.\r\n * @param documents - The list of documents to check.\r\n * @returns `true` if all documents are RS-compatible.\r\n */\r\n canSupportRS(documents: ClipperDocumentInfo[]): boolean {\r\n return documents.every(n => this.isModelSupportedByRS(n.model));\r\n }\r\n\r\n /**\r\n * Returns whether every document in the list has a model that supports RS tracking.\r\n * @param documents - The documents to check.\r\n * @returns `true` if all documents are RS-enabled.\r\n */\r\n RS_enabled(documents: ClipperDocumentInfo[]): boolean {\r\n if (!documents || documents.length === 0) return false;\r\n return documents.every(n =>\r\n n.model === ClipperModel.NormativaVigente ||\r\n n.model === ClipperModel.AggiornamentoNormativo ||\r\n n.model === ClipperModel.GiurisprudenzaRecente ||\r\n n.model === ClipperModel.Scadenze\r\n );\r\n }\r\n\r\n /**\r\n * Sends a broadcast message to create a new RS law entry linked to the given documents.\r\n * @param documents - The array of documents to link to the new law.\r\n */\r\n RS_newLaw(documents?: ClipperDocumentInfo[]): void {\r\n if (!this.clipperService.supportsRS() || !documents) return;\r\n this.broadcastService.sendMessage(ClipperMessages.INTEROP_RS_NEW_LAW, documents);\r\n }\r\n\r\n /**\r\n * Sends a broadcast message to create a new RS activity linked to the given document.\r\n * @param document - The document to link to the new activity.\r\n */\r\n RS_newActivity(document?: ClipperDocumentInfo): void {\r\n if (!this.clipperService.supportsRS() || !document) return;\r\n this.broadcastService.sendMessage(ClipperMessages.INTEROP_RS_NEW_ACTIVITY, document);\r\n }\r\n\r\n /**\r\n * Sends a broadcast message to open the RS usage report for the given document.\r\n * @param document - The document to generate the usage report for.\r\n */\r\n RS_usageReport(document?: ClipperDocumentInfo): void {\r\n if (!this.clipperService.supportsRS() || !document) return;\r\n this.broadcastService.sendMessage(ClipperMessages.INTEROP_RS_USAGE_REPORT, document);\r\n }\r\n\r\n\r\n}\r\n","import { Service, inject } from '@angular/core';\r\nimport { ClipperModule, ClipperSelectionMode, ClipperService } from '@arsedizioni/ars-utils/clipper.common';\r\nimport { ThemeType } from '@arsedizioni/ars-utils/core';\r\nimport { DialogService } from '@arsedizioni/ars-utils/ui.dialogs';\r\n\r\n/**\r\n * Opens the Clipper document viewer.\r\n *\r\n * It used to be a static method taking an `Injector` and resolving its dependencies through\r\n * `runInInjectionContext`. That is the escape hatch for code that cannot do DI, and both callers\r\n * here are components — they were injecting an `Injector` for the sole purpose of handing it over.\r\n * As a service the dependencies are resolved at field level, which also removes a trap: the\r\n * asynchronous continuation after the dynamic `import()` is outside the injection context, so an\r\n * `inject()` added in there would have failed at runtime.\r\n */\r\n@Service()\r\nexport class ClipperDocumentViewerService {\r\n\r\n private readonly dialogService = inject(DialogService);\r\n private readonly clipperService = inject(ClipperService);\r\n\r\n /**\r\n * Opens the Clipper document viewer dialog for the given document.\r\n * @param documentId - The ID of the document to open.\r\n * @param query - The search query string used for term highlighting.\r\n * @param queryChunks - Pipe-separated highlight chunks (e.g. \"|1|2|3...\").\r\n * @param selectionMode - The Clipper selection mode to activate inside the viewer.\r\n * @param selectableModules - The list of Clipper modules available for selection.\r\n * @param theme - The UI theme to apply. Defaults to the system theme.\r\n * @param canHandleTooManyResults - When `true`, the component handles oversized result sets.\r\n * @param replaceUrl - When provided, after the dialog closes the method calls `window.close()`\r\n * if the page was opened by another window, or navigates to this URL otherwise.\r\n * @returns void\r\n */\r\n openDocument(\r\n documentId: string,\r\n query?: string,\r\n queryChunks?: string,\r\n selectionMode?: ClipperSelectionMode,\r\n selectableModules?: ClipperModule[],\r\n theme?: ThemeType,\r\n canHandleTooManyResults?: boolean,\r\n replaceUrl?: string): void {\r\n if (!this.clipperService.loggedIn()) {\r\n this.dialogService.error(\"Clipper non è disponibile in questo momento. Verifica la connessione.\");\r\n return;\r\n }\r\n if (!documentId) {\r\n this.dialogService.error(\"Documento non valido.\");\r\n return;\r\n }\r\n // NB: the viewer is reached by `import()` on purpose, and `public_api` exports only its types:\r\n // a static import would close a cycle (this service -> viewer -> references -> result manager ->\r\n // this service) that fails at load time, where the references dialog extends a class not yet\r\n // initialised. Kept out of the static graph, the viewer also lands in a chunk of its own.\r\n import('./document/document.component').then(({ ClipperDocumentComponent }) => {\r\n const ref = this.dialogService.open(ClipperDocumentComponent, {\r\n ariaLabel: 'documento',\r\n autoFocus: 'dialog',\r\n restoreFocus: false,\r\n disableClose: false,\r\n data: {\r\n id: documentId,\r\n query: query,\r\n queryChunks: queryChunks,\r\n selectionMode: selectionMode,\r\n selectableModules: selectableModules,\r\n theme: theme,\r\n canHandleTooManyResults: canHandleTooManyResults\r\n },\r\n minWidth: '375px',\r\n maxWidth: '1400px',\r\n width: '100%',\r\n height: '100%'\r\n });\r\n if (replaceUrl && ref) {\r\n ref.beforeClosed().subscribe(() => {\r\n setTimeout(() => {\r\n if (window.opener !== null) {\r\n window.close();\r\n } else {\r\n window.location.replace(replaceUrl);\r\n }\r\n }, 500);\r\n });\r\n }\r\n });\r\n }\r\n}\r\n\r\n/**\r\n * Pure helpers on document data. Deliberately NOT a service: there is nothing to inject, and a\r\n * string function that needs an injector to be called is a function nobody can call from a test.\r\n */\r\nexport class ClipperDocumentsUtils {\r\n\r\n /**\r\n * Extracts the display title from a full document title by stripping any trailing `[...]` suffix.\r\n * @param title - The full document title, which may contain a bracketed qualifier.\r\n * @returns The portion of the title before the first `[`, or the original title when no `[` is present.\r\n */\r\n static parseDocumentTitle(title: string): string {\r\n if (!title) return title;\r\n const p = title.indexOf('[');\r\n return p !== -1 ? title.substring(0, p) : title;\r\n }\r\n}\r\n","import { BreakpointObserver } from '@angular/cdk/layout';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component, DestroyRef, computed, inject, signal,\n viewChild\n} from '@angular/core';\nimport { MatPaginator } from '@angular/material/paginator';\nimport { ClipperDocumentInfo, ClipperMessages, ClipperModel, ClipperQueryDocumentFlags, ClipperSearchParams, ClipperSearchResult, ClipperSearchUtils, ClipperSelectionMode, ClipperSort, ClipperUtils } from '@arsedizioni/ars-utils/clipper.common';\nimport { DateFormat, NameValueItem, ScreenService, SelectableModel, SystemUtils, ThemeService } from '@arsedizioni/ars-utils/core';\nimport { startOfDay, startOfToday, subDays } from 'date-fns';\nimport { ClipperSearchFacetsComponent } from '../search-facets/search-facets.component';\nimport { ClipperDocumentManager } from '../document-manager/document-manager';\nimport { ClipperSearchCalendarComponent } from '../search-calendar/search-calendar.component';\nimport { ClipperDocumentViewerService } from '../documents';\n\n\n\n\n@Component({\n template: '<div></div>',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ClipperSearchResultManager extends ClipperDocumentManager {\n readonly paginator = viewChild<MatPaginator>('paginator');\n readonly facets = viewChild<ClipperSearchFacetsComponent>('facets');\n readonly calendar = viewChild<ClipperSearchCalendarComponent>('calendar');\n protected readonly destroyRef = inject(DestroyRef);\n protected readonly changeDetector = inject(ChangeDetectorRef);\n protected readonly breakpointObserver = inject(BreakpointObserver);\n protected readonly documentUtils = inject(ClipperDocumentViewerService);\n protected readonly themeService = inject(ThemeService);\n public readonly screenService = inject(ScreenService);\n public selection: SelectableModel<ClipperDocumentInfo, string> | undefined;\n public readonly selectionMode = signal<ClipperSelectionMode>(ClipperSelectionMode.None);\n protected snapshot: ClipperSearchResult | undefined = new ClipperSearchResult();\n protected readonly filterBusy = signal<boolean>(false);\n protected filterParams: ClipperSearchParams = new ClipperSearchParams();\n protected readonly filterPaneHasBackdrop = signal<boolean>(false);\n protected readonly filterPaneClosed = signal<boolean>(false);\n protected readonly filterPane2HasBackdrop = signal<boolean>(false);\n protected readonly filterPane2Closed = signal<boolean>(false);\n protected readonly sortOptions = signal<NameValueItem<ClipperSort>[]>([]);\n protected readonly sortMode = signal<NameValueItem<ClipperSort> | undefined>(undefined);\n protected scrollPos: number = 0;\n protected readonly scrollerId: string = 'scroller_' + SystemUtils.generateUUID();\n protected restorableId: string | undefined;\n protected readonly hasFacets = signal<boolean>(false);\n /** `true` when the current sector filter contains any regional-law (LR) entries. */\n protected readonly hasRegions = computed(() =>\n (this.filterParams.sectors?.filter(n => n.value === 'LR').length ?? 0) > 0\n );\n\n\n\n /**\n * Resets the `isMenuOpen` flag on every snapshot item so that action-menu buttons are hidden.\n */\n updateMenuButtonsVisibility(): void {\n if (this.snapshot) {\n this.snapshot.items?.forEach(n => {\n n.isMenuOpen = false;\n });\n }\n }\n\n /**\n * Scrolls the results list container to the given vertical position.\n * @param top - The target scroll offset in pixels. Defaults to 0 (top).\n */\n scroll(top: number = 0): void {\n const elem = document.getElementById(this.scrollerId);\n if (elem) {\n elem.scrollTo({ top: top, left: 0, behavior: 'auto' });\n }\n }\n\n /**\n * Returns whether every item in the current snapshot is selected.\n * @returns `true` if the selection count equals the total snapshot item count.\n */\n allSelected(): boolean {\n return this.selection?.current?.selected?.length === this.snapshot?.items?.length;\n }\n\n /**\n * Selects or deselects all items in the current snapshot.\n * @param select - When `true`, selects all items; when `false`, deselects all.\n */\n selectAll(select: boolean = true): void {\n if (select) {\n this.snapshot?.items?.forEach(n => this.selection?.select(n, n.documentId));\n } else {\n this.snapshot?.items?.forEach(n => this.selection?.deselect(n, n.documentId));\n }\n }\n\n /**\n * Returns whether at least one item is currently selected.\n * @returns `true` if the selection contains one or more items.\n */\n hasAnySelection(): boolean {\n return (this.selection?.all?.length ?? 0) > 0;\n }\n\n /**\n * Returns whether exactly one item is selected.\n * @returns `true` if the selection count is exactly 1.\n */\n hasSingleSelection(): boolean {\n return (this.selection?.all?.length ?? 0) === 1;\n }\n\n /**\n * Returns the first (and only) selected item, or `undefined` when nothing or multiple items are selected.\n * @returns The selected document, or `undefined`.\n */\n getSingleSelection(): ClipperDocumentInfo | undefined {\n return this.hasAnySelection() ? this.selection?.all[0] : undefined;\n }\n\n\n\n /**\n * Clears the entire selection.\n */\n clearSelection(): void {\n this.selection?.clear();\n }\n\n /**\n * Returns the number of currently selected items, or `undefined` when nothing is selected.\n * @returns The selection count, or `undefined`.\n */\n countSelections(): number | undefined {\n return (this.selection && this.selection?.all?.length > 0) ? this.selection?.all?.length : undefined;\n }\n\n /**\n * Returns the document ID of the first selected item, or `undefined` when nothing is selected.\n * @returns The selected document ID, or `undefined`.\n */\n getSeletectId(): string | undefined {\n if (this.hasAnySelection()) {\n return this.selection?.all[0].documentId;\n }\n return undefined;\n }\n\n /**\n * Returns the document IDs of all selected items.\n * Shows an error and returns `undefined` when more than 100 items are selected.\n * @returns An array of document IDs, or `undefined` when the limit is exceeded.\n */\n getSeletectIds(): string[] | undefined {\n if ((this.selection?.all?.length ?? 0) > 100) {\n this.dialogService.error('La selezione non può contenere più di 100 elementi.');\n return undefined;\n }\n const ids: string[] = [];\n if (this.hasAnySelection()) {\n this.selection?.all?.forEach(n => {\n if (n.documentId) {\n ids.push(n.documentId);\n }\n });\n }\n return ids;\n }\n\n /**\n * Returns a list of `[documentId, document]` tuples for all selected items.\n * Shows an error and returns `undefined` when more than 100 items are selected.\n * @returns An array of ID-document tuples, or `undefined` when the limit is exceeded.\n */\n getSeletectIdsAndData(): [string, ClipperDocumentInfo][] | undefined {\n if ((this.selection?.all?.length ?? 0) > 100) {\n this.dialogService.error('La selezione non può contenere più di 100 elementi.');\n return undefined;\n }\n const data: [string, ClipperDocumentInfo][] = [];\n if (this.hasAnySelection()) {\n this.selection?.all?.forEach(n => {\n if (n.documentId) {\n data.push([n.documentId, n]);\n }\n });\n }\n return data;\n }\n\n\n /**\n * Enriches raw search result items with display metadata: grouping labels, expiry/validity\n * state, anchor relevance scores, and model-specific fields.\n * @param items - The raw document list to process in place.\n * @param params - The search parameters used to determine grouping and filtering.\n */\n prepareResultItems(items: ClipperDocumentInfo[], params: ClipperSearchParams): void {\n const today = startOfToday();\n const groupByYear =\n !params.sortMode ||\n params.sortMode === ClipperSort.DateAsc ||\n params.sortMode === ClipperSort.DateDesc ||\n params.sortMode === ClipperSort.SourceDateAsc ||\n params.sortMode === ClipperSort.SourceDateDesc;\n const groupByRelevance = params.sortMode === ClipperSort.Relevance;\n const groupByPopularity = params.sortMode === ClipperSort.Popularity;\n let group = '';\n items?.forEach(n => {\n n.documentId = n.documentId ?? n.id;\n if (n.documentId) {\n this.selection?.updateCurrent(n, n.documentId);\n }\n if (n.model === ClipperModel.Quesiti) {\n n.info = \"Quesito n° \" + n.number + \" del \" + SystemUtils.formatDate(n.date, \"d MMM yyyy\");\n } else if (n.model === ClipperModel.Scadenze ||\n n.model === ClipperModel.Segnalazioni) {\n switch (n.model) {\n case ClipperModel.Scadenze:\n n.originDescription = 'Scadenza';\n break;\n case ClipperModel.Segnalazioni:\n n.originDescription = 'Segnalazione';\n break;\n }\n if (n.expiringInfo) {\n const parts = n.expiringInfo.split('|');\n if (parts.length === 3) {\n n.expiringDescription = parts[2];\n }\n }\n if (n.expiringDate) {\n n.date = startOfDay(new Date(n.expiringDate));\n const d = startOfDay(subDays(n.date, 15));\n n.isExpiring = today <= n.date && today >= d;\n n.isExpired = n.date < today;\n\n }\n } else {\n if ((n.model === ClipperModel.Articoli ||\n n.model === ClipperModel.News) &&\n n.tags) {\n n.info = n.tags.toUpperCase();\n }\n if (n.model !== ClipperModel.AggiornamentoNormativo &&\n n.model !== ClipperModel.NormativaVigente &&\n n.model !== ClipperModel.GiurisprudenzaRecente &&\n n.model !== ClipperModel.Juris &&\n n.date) {\n n.date = startOfDay(new Date(n.date ?? n.publishingDate));\n const d = startOfDay(subDays(startOfToday(), 7))\n n.isNew = n.date > d;\n }\n if (n.anchors) {\n let anchorType: number | undefined;\n const anchors: any[] = [];\n let minScore = 10;\n let maxScore = 0;\n n.anchors.forEach(a => {\n if ((a.score ?? 0) < minScore) {\n minScore = a.score ?? 0;\n }\n if ((a.score ?? 0) > maxScore) {\n maxScore = a.score ?? 0;\n }\n });\n maxScore = maxScore - minScore;\n n.anchors.forEach(a => {\n if (a.type === 20) return;\n if (a.type !== anchorType) {\n if ((a.type ?? 0) >= 3)\n anchors.push({ text: a.typeDescription });\n anchorType = a.type;\n }\n const score = maxScore > 0 ? ((a.score ?? 0) - minScore) / maxScore : 0;\n anchors.push({\n text: a.text,\n title: a.title,\n documentId: a.documentId,\n uri: a.uri,\n veryRelevant: score > 0.7,\n score: score,\n chunk: a.chunk\n });\n });\n n.anchors = anchors;\n }\n if ((n.validityState ?? 0) > 0) {\n n.validityDescription = 'Non è più vigente';\n n.isExpired = true;\n if (n.validUntilDate) {\n const expiringDate = startOfDay(new Date(n.validUntilDate));\n if (expiringDate < today) {\n n.validityDescription =\n 'Non più vigente dal ' +\n SystemUtils.formatDate(expiringDate) +\n '.';\n } else {\n n.validityDescription =\n 'Non sarà più vigente dal ' +\n SystemUtils.formatDate(expiringDate) +\n '.';\n n.isExpired = false;\n }\n }\n }\n if (n.expiringDate) {\n n.date = startOfDay(new Date(n.expiringDate));\n const d = startOfDay(subDays(n.date, 15));\n n.isExpiring = today <= n.date && today >= d;\n n.isExpired = n.date < today;\n }\n }\n if (groupByYear) {\n const d = (this.filterParams.models?.length ?? 0) > 1\n ? n.publishingDate\n : n.date;\n const year = SystemUtils.formatDate(d, DateFormat.LongMonthAndYear)?.toLowerCase();\n if (group !== year) {\n n.group = year;\n group = year;\n }\n } else if (groupByRelevance) {\n if (group !== 'none') {\n n.group =\n 'Elementi più rilevanti per la ricerca: ' + params.text;\n group = 'none';\n }\n } else if (groupByPopularity) {\n if (group !== 'none') {\n n.group = 'Elementi più popolari in ordine decrescente';\n group = 'none';\n }\n }\n });\n }\n\n\n /**\n * Applies a new search result snapshot: clears the current selection, optionally preserves\n * facet state for incremental updates, and triggers change detection.\n * @param data - The incoming search result.\n * @param newSearch - When `true`, facet state is reset along with the results.\n */\n prepareResults(data: ClipperSearchResult, newSearch: boolean = false): void {\n const currentTotal = this.snapshot?.total ?? 0;\n this.selection?.current.clear();\n if (!newSearch) {\n data.facets = this.snapshot?.facets;\n }\n this.snapshot = data;\n if (this.snapshot.total === -1) {\n this.snapshot.total = currentTotal;\n }\n if (this.snapshot.items) {\n this.prepareResultItems(this.snapshot.items, this.filterParams);\n }\n this.changeDetector.markForCheck();\n }\n\n\n /**\n * Exports either the selected documents or the full result set in the given format.\n * @param format - The export format: 1 = list (CSV), 2 = deadlines (ICS).\n */\n exportResults(format: number = 1): void {\n if ((this.snapshot?.total ?? 0) > 0 || this.hasAnySelection()) {\n this.exportItems(this.getSeletectIds(), this.filterParams, format);\n }\n }\n\n\n /**\n * Returns the CSS class that reflects the item's read/expiry state.\n * @param item - The document to evaluate.\n * @returns A CSS class name string, or `undefined` when no special state applies.\n */\n getItemStateCssClass(item: ClipperDocumentInfo): string | undefined {\n if (item.isRead !== true && item.model && ClipperUtils.isClipperModelReadable(item.model)) return 'unread-bg';\n else if (item.isExpired) return 'expired-bg';\n //else if (item.popularity === 3) return 'popular-bg';\n //else if (item.popularity > 3) return 'very-popular-bg';\n return undefined;\n }\n\n /**\n * Returns the tooltip text that explains the item's current read/expiry state.\n * @param item - The document to evaluate.\n * @returns A human-readable state description, or an empty string when no special state applies.\n */\n getItemStateTooltip(item: ClipperDocumentInfo): string {\n if (item.isRead !== true && item.model && ClipperUtils.isClipperModelReadable(item.model)) return 'Non letto';\n else if (item.isExpired) return 'Non più vigente';\n //else if (item.popularity === 3) return 'Documento con numero di citazioni alto';\n //else if (item.popularity > 3) return 'Documento con numero di citazioni molto alto';\n return '';\n }\n\n /**\n * Returns the Material icon name that represents the given document's model.\n * @param item - The document whose icon to determine.\n * @returns A Material icon name string.\n */\n getItemIcon(item: ClipperDocumentInfo): string {\n switch (item.model) {\n case ClipperModel.NormativaVigente: return 'gavel';\n case ClipperModel.Articoli:\n case ClipperModel.Quesiti:\n case ClipperModel.MetodiDiAnalisi: return 'extension';\n default: return 'updated';\n }\n }\n\n /**\n * Toggles the read flag of the given item and stops event propagation.\n * @param item - The document whose read state to toggle.\n * @param e - Optional DOM event; when provided, default action and propagation are suppressed.\n */\n toggleRead(item: ClipperDocumentInfo, e?: Event): void {\n e?.preventDefault();\n e?.stopPropagation();\n this.setRead(!item?.isRead, item);\n\n }\n\n /**\n * Toggles the selection state of the given item and stops event propagation.\n * @param item - The document to select or deselect.\n * @param e - Optional DOM event; when provided, default action and propagation are suppressed.\n */\n toggleSelection(item: ClipperDocumentInfo, e?: Event): void {\n e?.preventDefault();\n e?.stopPropagation();\n this.selection?.toggle(item, item.documentId)\n\n\n }\n\n\n /**\n * Sets the read state on the given item or on all currently selected items.\n *\n * Only the documents the server reports as written change on screen and in the counters: a\n * document older than the unread window keeps no state, and one already in the state asked for\n * has nothing to count. Touching either would leave the counters out of step with the server.\n * @param value - The new read flag value.\n * @param item - When provided, only this item is updated; otherwise the full selection is used.\n * @param silent - When `true`, suppresses the \"too old\" notice.\n */\n setRead(value: boolean, item?: ClipperDocumentInfo, silent?: boolean): void {\n let targets: ClipperDocumentInfo[];\n if (item?.documentId) {\n targets = [item];\n } else if (this.hasAnySelection()) {\n targets = (this.selection?.all ?? []).filter(n => !!n.documentId);\n } else {\n return;\n }\n const documentIds = targets.map(n => n.documentId!);\n this.clipperService.documents.updateState({ documentIds: documentIds, isRead: value })\n .subscribe(r => {\n if (!r.success) {\n // soft error\n this.dialogService.toast(r.message);\n return;\n }\n const updated = new Set(r.value?.updated ?? []);\n const expired = r.value?.expired ?? [];\n if (expired.length > 0 && !silent) {\n this.dialogService.toast(this.getExpiredReadStateMessage(expired.length, targets.length), 5000, 'history');\n }\n let changed = false;\n for (const n of targets) {\n if (!n.documentId || !updated.has(n.documentId) || n.isRead === value) {\n continue;\n }\n n.isRead = value;\n changed = true;\n this.broadcastService.sendMessage(ClipperMessages.DOCUMENT_READ, { document: n, value: value });\n const module = ClipperUtils.getClipperModuleFromModel(n);\n if (module) {\n this.clipperService.account.updateUnreadItems(\n module,\n n.model,\n value ? -1 : 1);\n }\n }\n if (changed) {\n this.changeDetector.markForCheck();\n this.broadcastService.sendMessage(ClipperMessages.COMMAND_DASHBOARD_UPDATED);\n }\n });\n }\n\n /**\n * Words the notice for the documents a read-state update left alone because they are older than\n * the unread window: a single document, the whole selection, or a part of it.\n * @param expired - How many documents were too old.\n * @param total - How many documents the update was asked for.\n * @returns The message to show.\n */\n private getExpiredReadStateMessage(expired: number, total: number): string {\n if (total === 1) {\n return 'Il documento non è stato aggiornato perché più vecchio di 2 mesi.';\n }\n if (expired === total) {\n return 'I documenti selezionati non sono stati aggiornati perché più vecchi di 2 mesi.';\n }\n if (expired === 1) {\n return `Un documento su ${total} non è stato aggiornato perché più vecchio di 2 mesi.`;\n }\n return `${expired} documenti su ${total} non sono stati aggiornati perché più vecchi di 2 mesi.`;\n }\n\n \n\n /**\n * Opens a document by ID, either inline or in a new browser tab.\n * @param documentId - The ID of the document to open.\n * @param query - The current search query used to highlight terms in the viewer.\n * @param queryChunks - Pipe-separated highlight chunks (e.g. \"|1|2|3...\").\n * @param newWindow - When `true`, opens the document in a new browser tab.\n */\n override open(documentId?: string, query?: string, queryChunks?: string, newWindow?: boolean): void {\n if (!documentId) return;\n if (!newWindow) this.openDocument(documentId, query, queryChunks);\n else {\n window.open((this.clipperService.appUri ?? '') + '/documento/' + documentId, '_blank');\n }\n }\n\n /**\n * Opens the Clipper document viewer dialog for the given document.\n * @param documentId - The ID of the document to open.\n * @param query - The normalized search query used for term highlighting.\n * @param queryChunks - Pipe-separated highlight chunks (e.g. \"|1|2|3...\").\n */\n openDocument(documentId?: string, query?: string, queryChunks?: string): void {\n if (!documentId) return;\n query = ClipperSearchUtils.normalizeTextQuery2(query ?? this.filterParams.text ?? '');\n if (((this.filterParams.flags ?? 0) & ClipperQueryDocumentFlags.UseSemanticSearch) > 0) {\n query = '$' + query;\n }\n this.documentUtils.openDocument(\n documentId,\n query,\n queryChunks,\n this.selectionMode(),\n undefined,\n this.themeService.getTheme(),\n this.canHandleTooManyResults()\n );\n\n }\n\n ///\n // Restorable\n ///\n\n /**\n * Serialises the current component state (paginator, facets, filter params, scroll, sort, data)\n * to the given storage under the given key, enabling later restoration.\n * @param id - The storage key to write to.\n * @param storage - The Web Storage instance to use. Defaults to `sessionStorage`.\n */\n save(id: string, storage: Storage = sessionStorage): void {\n this.onStateSaving();\n storage.setItem(\n id,\n JSON.stringify({\n paginator: {\n index: this.paginator()?.pageIndex ?? 0,\n total: this.snapshot?.total ?? 0,\n size: this.paginator()?.pageSize ?? this.filterParams?.count ?? 15\n },\n facets: this.facets()?.save(),\n filterParams: this.filterParams,\n scroll: this.scrollPos,\n sort: { mode: this.sortMode(), options: this.sortOptions() },\n data: this.snapshot\n ? { items: this.snapshot.items, total: this.snapshot.total }\n : null\n }));\n }\n\n /**\n * Restores a previously serialised component state from storage and re-applies it.\n * Facets, paginator, scroll position, and filter parameters are all re-hydrated.\n * @param id - The storage key to read from.\n * @param storage - The Web Storage instance to use. Defaults to `sessionStorage`.\n */\n /**\n * Hook invoked just before the component state is serialised by save().\n * Subclasses that keep a separate form model can commit it to filterParams here.\n */\n protected onStateSaving(): void { }\n\n /**\n * Hook invoked after restore() has fully re-hydrated filterParams.\n * Subclasses that keep a separate form model can rebuild it from filterParams here.\n */\n protected onStateRestored(): void { }\n\n restore(id: string, storage: Storage = sessionStorage): void {\n const value = storage.getItem(id);\n if (value) {\n const data = JSON.parse(value);\n if (data) {\n this.filterParams = data.filterParams;\n const modules = SystemUtils.clone(this.filterParams.modules);\n const sectors = SystemUtils.clone(this.filterParams.sectors);\n const authors = SystemUtils.clone(this.filterParams.authors);\n const tags = SystemUtils.clone(this.filterParams.tags);\n const topics = SystemUtils.clone(this.filterParams.topics);\n this.filterParams.modules = modules;\n this.filterParams.sectors = undefined;\n this.filterParams.authors = undefined;\n this.filterParams.tags = undefined;\n this.filterParams.topics = undefined;\n this.snapshot = data.data;\n this.sortMode.set(data.sort.mode);\n this.sortOptions.set(data.sort.options ?? []);\n setTimeout(() => {\n this.filterParams.sectors = sectors;\n this.filterParams.authors = authors;\n this.filterParams.tags = tags;\n this.filterParams.topics = topics;\n const facets = this.facets();\n if (facets && data.facets) {\n facets.restore(data.facets);\n this.hasFacets.set(data.facets.hasFacets === true);\n }\n const paginator = this.paginator();\n if (paginator && data.paginator) {\n paginator.pageIndex = data.paginator.index;\n paginator.pageSize = data.paginator.size;\n paginator.length = data.paginator.total;\n }\n this.scroll(data.scroll ?? 0);\n this.onStateRestored();\n this.broadcastService.sendMessage(ClipperMessages.COMMAND_SEARCH_RESTORED, data.filterParams)\n this.changeDetector.markForCheck();\n }, 750);\n\n }\n }\n }\n}","import { ChangeDetectionStrategy, Component } from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatDialogActions, MatDialogClose, MatDialogContent, MatDialogTitle } from '@angular/material/dialog';\nimport { SystemUtils } from '@arsedizioni/ars-utils/core';\nimport { FlexLayoutModule } from '@arsedizioni/ars-utils/ui';\n\n@Component({\n host: { 'Bind': SystemUtils.generateUUID() },\n templateUrl: './search-free-text-help.component.html',\n styleUrls: ['./search-free-text-help.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n imports: [MatDialogTitle, MatDialogContent, MatDialogActions, FlexLayoutModule, MatButtonModule, MatDialogClose]\n})\nexport class ClipperSearchFreeTextHelpComponent{\n}\n","<div mat-dialog-title>Come effettuare la ricerca in testo libero</div>\r\n<mat-dialog-content>\r\n <p>Normalmente viene sempre effettuata una ricerca per frase: tutte le parole specificate debbono essere\r\n \"ragionevolmente vicine\" (entro 5 parole) l'una dall'altra.</p>\r\n <p>La ricerca per frase di solito produce i risultati più rilevanti.</p>\r\n <p>Tuttavia è possibile istruire Clipper per eseguire ricerche differenti e più complesse.</p>\r\n <p>Tutte gli elementi che compongono la stringa di ricerca devono essere separati da virgola.</p>\r\n <ul>\r\n <li>Se un elemento è composto da più parole è una frase, altrimenti una parola</li>\r\n <li>Aggiungendo un <b style=\"font-size: 20px\">+</b> davanti all'elemento, l'elemento <b>dovrà per forza</b> essere presente nel documento\r\n </li>\r\n <li>Aggiungendo un <b style=\"font-size: 20px\">-</b> davanti all'elemento, l'elemento <b>non dovrà</b> essere presente nel documento</li>\r\n </ul>\r\n <p>Ecco alcuni esempi:</p>\r\n <ul>\r\n <li><b>serbatoi interrati</b>: sarà effettuata una ricerca per la frase \"serbatoi interrati\"</li>\r\n <li><b>serbatoi, interrati</b>: sarà effettuata una ricerca per le parole \"serbatoi\" e \"interrati\"; il risultato sarà tutti i documenti che contengono una o l'altra parola.</li>\r\n <li><b>serbatoi, +interrati</b>: sarà effettuata una ricerca per le parole \"serbatoi\" e \"interrati\"; il risultato sarà tutti i documenti che contengono necessariamente \"interrati\" ed eventualmente \"serbatoi\".</li>\r\n <li><b>serbatoi, -interrati</b>: sarà effettuata una ricerca per le parole \"serbatoi\" e \"interrati\"; il risultato sarà tutti i documenti che contengono necessariamente \"interrati\" ma non \"serbatoi\".</li>\r\n <li><b>\"serbatoi interrati\", -gas</b>: sarà effettuata una ricerca per la frase \"serbatoi interrati\" e per la parola \"gas\"; il risultato sarà tutti i documenti che contengono la frase \"serbatoi interrati\" ma non la parola \"gas\".</li>\r\n </ul>\r\n <p>Saranno mostrati per primi (più rilevanti) i documenti che rispettano in pieno la condizione.</p>\r\n</mat-dialog-content>\r\n<mat-dialog-actions>\r\n <div fxLayout=\"row\" fxLayoutGap=\"10px\" fxFill>\r\n <div fxLayoutAlign=\"end\" fxFill >\r\n <button mat-stroked-button [mat-dialog-close]=\"true\" >Chiudi</button>\r\n </div>\r\n </div>\r\n</mat-dialog-actions>\r\n","import { ChangeDetectionStrategy, Component, inject, output, signal } from '@angular/core';\r\nimport { form, FormField, FormRoot, maxLength } from '@angular/forms/signals';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatDialogActions, MatDialogClose, MatDialogContent, MatDialogTitle } from '@angular/material/dialog';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatInputModule } from '@angular/material/input';\r\nimport { DtoUtils, SystemUtils } from '@arsedizioni/ars-utils/core';\r\nimport { FlexLayoutModule } from '@arsedizioni/ars-utils/ui';\r\nimport { DialogService } from '@arsedizioni/ars-utils/ui.dialogs';\r\n\r\nexport interface SearchFreeTextQueryParams {\r\n query: string;\r\n}\r\n\r\n/**\r\n * Form model of the free-text query builder: one field per query operator.\r\n *\r\n * The DTO ({@link SearchFreeTextQueryParams}) is not a projection of this model — it\r\n * carries the single Lucene-style expression assembled out of the five fields — which\r\n * is why {@link ClipperSearchFreeTextQueryBuilderComponent.toPayload} is ad-hoc.\r\n */\r\ninterface SearchFreeTextQueryForm {\r\n /** Exact phrase to look for; `''` when the input is empty. */\r\n queryPhrase: string;\r\n /** Comma-separated words that must all appear; `''` when the input is empty. */\r\n queryAnd: string;\r\n /** Comma-separated words of which at least one must appear; `''` when the input is empty. */\r\n queryOr: string;\r\n /** Prefix the document must start with; `''` when the input is empty. */\r\n queryStart: string;\r\n /** Comma-separated words that must not appear; `''` when the input is empty. */\r\n queryNot: string;\r\n}\r\n\r\n/** Neutral form model: it declares every field the form owns and its empty value. */\r\nconst _EMPTY_ITEM: SearchFreeTextQueryForm = {\r\n queryPhrase: '',\r\n queryAnd: '',\r\n queryOr: '',\r\n queryStart: '',\r\n queryNot: '',\r\n};\r\n\r\n@Component({\r\n host: { 'Bind': SystemUtils.generateUUID() },\r\n templateUrl: './search-free-text-query-builder.component.html',\r\n styleUrls: ['./search-free-text-query-builder.component.scss'],\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [MatDialogTitle, MatDialogContent, FormField, FormRoot, FlexLayoutModule, MatFormFieldModule, MatInputModule,\r\n MatButtonModule, MatIconModule, MatDialogActions, MatDialogClose]\r\n})\r\nexport class ClipperSearchFreeTextQueryBuilderComponent {\r\n readonly done = output<SearchFreeTextQueryParams>();\r\n\r\n private readonly dialogService = inject(DialogService);\r\n\r\n /** Model backing the signal form: one entry per query operator field. */\r\n private readonly model = signal<SearchFreeTextQueryForm>(this.toForm());\r\n\r\n /**\r\n * Builds the form model. The builder always opens empty, so the model is the neutral\r\n * one; it also serves as what the \"clear\" button restores.\r\n * @returns A fresh form model.\r\n */\r\n private toForm(): SearchFreeTextQueryForm {\r\n return DtoUtils.toForm(_EMPTY_ITEM);\r\n }\r\n\r\n /**\r\n * Assembles the Lucene-style free-text query out of the five operator fields.\r\n *\r\n * Ad-hoc because the payload is not a projection of the model: every field\r\n * contributes a differently shaped fragment (a quoted phrase, `+` terms, a `*`\r\n * wildcard, `-` exclusions) to one single string.\r\n * @returns The query to emit, or `undefined` when only the exclusion operator was\r\n * filled in, which cannot produce a valid query on its own.\r\n */\r\n private toPayload(): SearchFreeTextQueryParams | undefined {\r\n let query = '';\r\n const m = this.model();\r\n const phrase = m.queryPhrase?.trim() ?? '';\r\n const and = m.queryAnd?.trim() ?? '';\r\n const or = m.queryOr?.trim() ?? '';\r\n const not = m.queryNot?.trim() ?? '';\r\n const start = m.queryStart?.trim() ?? '';\r\n\r\n // Phrase\r\n if (phrase.length > 0) {\r\n query += ` \"${phrase.replaceAll('\"', '')}\" `;\r\n }\r\n // OR — each comma-separated word is wrapped in quotes\r\n if (or.length > 0) {\r\n for (const part of or.split(',')) {\r\n if (query.length > 0) query += ' ';\r\n query += `\"${part.replaceAll('\"', '').trim()}\" `;\r\n }\r\n }\r\n // AND — each comma-separated word is prefixed with +\r\n if (and.length > 0) {\r\n for (const part of and.split(',')) {\r\n if (query.length > 0) query += ' ';\r\n query += `+\"${part.replaceAll('\"', '').trim()}\" `;\r\n }\r\n }\r\n // Starts-with — appends a wildcard suffix\r\n if (start.length > 0) {\r\n if (query.length > 0) query += ' ';\r\n query += `+\"${start.replaceAll('\"', '')}*\" `;\r\n }\r\n // NOT — each comma-separated word is prefixed with - (requires at least one positive term)\r\n if (not.length > 0) {\r\n if (query.length === 0) {\r\n return undefined;\r\n }\r\n for (const part of not.split(',')) {\r\n if (query.length > 0) query += ' ';\r\n query += `-\"${part.replaceAll('\"', '').trim()}\" `;\r\n }\r\n }\r\n return { query: query.trim() };\r\n }\r\n\r\n /** Signal form for the query fields; every field is capped at 200 characters. */\r\n protected readonly form = form(this.model, p => {\r\n maxLength(p.queryPhrase, 200);\r\n maxLength(p.queryAnd, 200);\r\n maxLength(p.queryOr, 200);\r\n maxLength(p.queryStart, 200);\r\n maxLength(p.queryNot, 200);\r\n });\r\n\r\n /**\r\n * Resets all query fields to empty strings.\r\n */\r\n protected clear(): void {\r\n this.model.set(this.toForm());\r\n }\r\n\r\n /**\r\n * Emits the assembled free-text query via `done`.\r\n *\r\n * Shows an error dialog when only the NOT operator has been filled in, since it\r\n * requires at least one positive term to produce a valid query.\r\n */\r\n protected ok(): void {\r\n const payload = this.toPayload();\r\n if (!payload) {\r\n this.dialogService.error(\r\n \"L'operatore di esclusione funziona solo se prima è stato inserito un valore in almeno uno degli altri quattro campi.\"\r\n );\r\n return;\r\n }\r\n if (payload.query.length > 0) this.done.emit(payload);\r\n }\r\n}\r\n","<div mat-dialog-title>Trova gli elementi che contengono...</div>\n<mat-dialog-content>\n <form [formRoot]=\"form\" (keyup.enter)=\"!form().invalid() ? ok() : undefined\" novalidate>\n <div fxLayout=\"column\" style=\"padding-bottom: 20px;\">\n <mat-form-field>\n <mat-label>Questa esatta parola o frase</mat-label>\n <input matInput [formField]=\"form.queryPhrase\" />\n @if (form.queryPhrase().value()) {\n <a matSuffix mat-icon-button aria-label=\"Azzera\" (click)=\"form.queryPhrase().value.set('')\">\n <mat-icon>close</mat-icon>\n </a>\n }\n </mat-form-field>\n <mat-form-field>\n <mat-label>Tutte queste parole</mat-label>\n <input matInput [formField]=\"form.queryAnd\" />\n @if (form.queryAnd().value()) {\n <a matSuffix mat-icon-button aria-label=\"Azzera\" (click)=\"form.queryAnd().value.set('')\">\n <mat-icon>close</mat-icon>\n </a>\n }\n <mat-hint>Separate da virgola</mat-hint>\n </mat-form-field>\n <mat-form-field>\n <mat-label>Una qualunque di queste parole</mat-label>\n <input matInput [formField]=\"form.queryOr\" />\n @if (form.queryOr().value()) {\n <a matSuffix mat-icon-button aria-label=\"Azzera\" (click)=\"form.queryOr().value.set('')\">\n <mat-icon>close</mat-icon>\n </a>\n }\n <mat-hint>Separate da virgola</mat-hint>\n </mat-form-field>\n <!--\n <mat-form-field>\n <mat-label>Parole che iniziano con</mat-label>\n <input matInput [formField]=\"form.queryStart\" />\n @if (form.queryStart().value()) {\n <a matSuffix mat-icon-button aria-label=\"Azzera\" (click)=\"form.queryStart().value.set('')\">\n <mat-icon>close</mat-icon>\n </a>\n }\n <mat-hint>Separate da virgola</mat-hint>\n </mat-form-field>\n -->\n <mat-form-field>\n <mat-label>Nessuna qualunque di queste parole</mat-label>\n <input matInput [formField]=\"form.queryNot\" />\n @if (form.queryNot().value()) {\n <a matSuffix mat-icon-button aria-label=\"Azzera\" (click)=\"form.queryNot().value.set('')\">\n <mat-icon>close</mat-icon>\n </a>\n }\n <mat-hint>Separate da virgola. L'operatore di esclusione funziona solo se prima è stato inserito un valore in\n almeno uno degli altri quattro campi. </mat-hint>\n </mat-form-field>\n </div>\n </form>\n</mat-dialog-content>\n<mat-dialog-actions>\n <div fxLayout=\"row\" fxLayoutGap=\"10px\" fxFill>\n <div fxFlex=\"30\" fxLayoutAlign=\"start\">\n <button type=\"button\" mat-stroked-button (click)=\"clear()\">Pulisci</button>\n </div>\n <div fxFlex=\"70\" fxLayoutAlign=\"end\">\n <button mat-flat-button (click)=\"ok()\">Ok</button>\n <button mat-stroked-button [mat-dialog-close]=\"true\">Annulla</button>\n </div>\n </div>\n</mat-dialog-actions>","import { ChangeDetectionStrategy, Component, DestroyRef, computed, inject, input, model } from '@angular/core';\nimport { takeUntilDestroyed, toObservable, toSignal } from '@angular/core/rxjs-interop';\nimport { EMPTY, switchMap } from 'rxjs';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatMenu, MatMenuModule } from '@angular/material/menu';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { ClipperDocumentInfo, ClipperMessages, ClipperModel, ClipperUtils } from '@arsedizioni/ars-utils/clipper.common';\nimport { BroadcastService, FormatPipe, ScreenService, SystemUtils } from '@arsedizioni/ars-utils/core';\nimport { FlexLayoutModule } from '@arsedizioni/ars-utils/ui';\nimport { ClipperSearchResultManager } from '../search-result-manager/search-result-manager';\n\n\nexport enum ClipperSearchResultItemDisplayMode {\n List = 1,\n Tile = 2,\n Stripe = 3\n}\n\n\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'clipper-search-result-item',\n templateUrl: './search-result-item.component.html',\n styleUrls: ['./search-result-item.component.scss'],\n standalone: true,\n imports: [\n MatCheckboxModule,\n MatButtonModule,\n MatTooltipModule,\n MatIconModule,\n MatMenuModule,\n FlexLayoutModule,\n FormatPipe,\n ],\n})\nexport class ClipperSearchResultItemComponent {\n\n private readonly destroyRef = inject(DestroyRef);\n protected readonly screenService = inject(ScreenService);\n private readonly broadcastService = inject(BroadcastService);\n readonly parent = input.required<ClipperSearchResultManager>();\n readonly item = model.required<ClipperDocumentInfo>();\n readonly actions = input.required<MatMenu>();\n /**\n * Taxonomy path segments derived from `item().taxonomyPath`.\n * Computed (not an effect writing a signal) so it stays lazy and reactive to `item()`.\n */\n protected readonly taxonomy = computed<string[]>(() => {\n const result: string[] = [];\n this.item().taxonomyPath?.split('\\r\\n').forEach(p => {\n const pathValues = p.split('>');\n result.push(SystemUtils.normalizeDisplay(pathValues[pathValues.length - 1].trim()));\n });\n return result;\n });\n readonly tileNoPictureUrl = input<string>();\n readonly tilePictureUrl = input<string>(); \n readonly isSelectable = input<boolean>(true);\n readonly isReadable = input<boolean>(true);\n readonly isReadableModel = input<ClipperModel | undefined>(undefined);\n readonly displayModifiedTitle = input<boolean>(false);\n readonly displayModelName = input<boolean>(false);\n readonly displayDate = input<boolean>(true);\n readonly displayMode = input<ClipperSearchResultItemDisplayMode>(ClipperSearchResultItemDisplayMode.List);\n protected readonly displayModesEnum: typeof ClipperSearchResultItemDisplayMode = ClipperSearchResultItemDisplayMode;\n protected readonly modelsEnum: typeof ClipperModel = ClipperModel;\n\n /**\n * Emits whenever the parent's SelectionModel changes. `toObservable(parent)` + `switchMap`\n * re-binds automatically (tearing down the previous subscription) if `parent` ever changes,\n * avoiding the duplicate subscriptions a subscribe-inside-effect would create.\n */\n private readonly selectionTick = toSignal(\n toObservable(this.parent).pipe(switchMap(p => p?.selection?.changed ?? EMPTY)),\n { initialValue: null },\n );\n\n /**\n * Whether this item is currently selected in the parent's selection model.\n * Recomputed whenever the parent's selection changes.\n */\n protected readonly isSelected = computed(() => {\n this.selectionTick();\n return this.isSelectable() && this.parent()?.selection?.isSelected(this.item().documentId) === true;\n });\n\n /**\n * Whether this item has already been read by the user.\n */\n protected readonly isRead = computed(() => {\n const model = this.isReadableModel() ?? this.item().model ?? 0;\n return this.isReadable() && model > 0 && ClipperUtils.isClipperModelReadable(model) && this.item().isRead === true;\n });\n\n /**\n * Whether this item is readable but not yet read (i.e. the read-flag action should be shown).\n */\n protected readonly canBeRead = computed(() => {\n const model = this.isReadableModel() ?? this.item().model ?? 0;\n return this.isReadable() && model > 0 && ClipperUtils.isClipperModelReadable(model) && this.item().isRead !== true;\n });\n\n constructor() {\n // React to broadcast messages from other components.\n this.broadcastService.getMessage()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(message => {\n if (message.id === ClipperMessages.DOCUMENT_NAVIGATED) {\n if (this.isReadable() && this.item().documentId === message.data.document.documentId && !this.item().isRead) {\n this.parent()?.setRead(true, this.item(), true);\n }\n } else if (message.id === ClipperMessages.DOCUMENT_READ) {\n if (this.isReadable() && this.item().documentId === message.data.document.documentId) {\n this.item.update(v => ({ ...v, isRead: message.data.value }));\n }\n }\n });\n }\n\n}\n","<div>\r\n @if (displayMode() === displayModesEnum.List ) {\r\n <div class=\"item\" fxLayout=\"row\" fxLayoutGap=\"6px\" fxLayoutAlign=\"start center\" fxFill\r\n [class.item-selected]=\"isSelected()\" [matContextMenuTriggerFor]=\"actions()\"\r\n [matContextMenuTriggerData]=\"{item: item()}\" (mouseenter)=\"item().isOver = true\"\r\n (mouseleave)=\"item().isOver = false\">\r\n <div fxFlex=\"6px\" fxFlexAlign=\"stretch\" [class]=\"parent().getItemStateCssClass(item())\"\r\n [matTooltip]=\"parent().getItemStateTooltip(item())\"><span></span>\r\n </div>\r\n <div [fxFlex]=\"isSelectable() ? '48px' : '16px'\" fxLayoutAlign=\"center\">\r\n @if (isSelectable() && (screenService.isTouchable || item().isOver || isSelected())) {\r\n <mat-checkbox (click)=\"$event.stopPropagation()\"\r\n (change)=\"$event ? parent().selection?.toggle(item(), item().documentId) : null\" [checked]=\"isSelected()\">\r\n </mat-checkbox>\r\n }\r\n </div>\r\n <div fxFlex=\"*\">\r\n <div class=\"item-content\">\r\n\r\n @if (displayModelName() && item().modelName) {\r\n @if (item().origin === 'GC' || item().origin === 'GN') {\r\n <div class=\"info-2\">GIURISPRUDENZA</div>\r\n } @else {\r\n <div class=\"info-2\">{{item().modelName}}</div>\r\n }\r\n }\r\n @if (item().info && item().model === modelsEnum.Quesiti) {\r\n @if(item().info) {\r\n <div class=\"info-1\">{{item().info}}</div>\r\n }\r\n }@else if(item().model === modelsEnum.NormativaVigente ||\r\n item().model === modelsEnum.AggiornamentoNormativo ||\r\n item().model === modelsEnum.GiurisprudenzaRecente ||\r\n item().model === modelsEnum.Juris) {\r\n @if (item().author && (item().origin === 'LR' || item().origin === 'GC' || item().origin\r\n === 'GN')) {\r\n <div class=\"info-1\">{{item().author}}</div>\r\n }\r\n @if(item().model === modelsEnum.Juris && displayDate() && item().date) {\r\n <div class=\"info-1\">{{item().date | format:'D':'d MMM yyyy'}}</div>\r\n }\r\n }@else if (displayDate() && item().date) {\r\n <div class=\"info-1\">{{item().date | format:'D':'d MMM yyyy'}}</div>\r\n }\r\n <div>\r\n <a class=\"link\" (click)=\"parent().open(item().documentId, undefined, item().chunksList)\"\r\n [attr.aria-label]=\"'Apri documento ' + item().title1\">{{item().title1 ?? item().title2}}</a>\r\n @if ((item().part ?? 0) > 0) {\r\n <span class=\"badge\">PARTE {{item().part}}</span>\r\n }\r\n @if (item().isCommented) {\r\n <span class=\"badge\">COMMENTATA</span>\r\n }\r\n @if ((item().validityState ?? 0) > 0) {\r\n <span class=\"badge-red\">{{item().validityDescription}}</span>\r\n }\r\n </div>\r\n @if(item().description && item().model === modelsEnum.Coordinamento) {\r\n <div class=\"title\">{{item().description}}</div>\r\n }\r\n @if (item().title2 &&\r\n item().model !== modelsEnum.Coordinamento &&\r\n item().model !== modelsEnum.News &&\r\n item().model !== modelsEnum.Articoli &&\r\n item().model !== modelsEnum.Juris &&\r\n item().model !== modelsEnum.Quesiti &&\r\n item().model !== modelsEnum.Scadenze &&\r\n item().model !== modelsEnum.Segnalazioni) {\r\n <div class=\"title\">{{item().title2}}</div>\r\n }\r\n @if (item().originDescription &&\r\n item().model !== modelsEnum.Scadenze &&\r\n item().model !== modelsEnum.Segnalazioni &&\r\n item().model !== modelsEnum.News &&\r\n item().model !== modelsEnum.Articoli &&\r\n item().model !== modelsEnum.Juris) {\r\n <div class=\"info-1\"\r\n [class.info-3]=\"(item().model === modelsEnum.Coordinamento && (item().validFromDate || item().applicableFromDate))\">\r\n {{item().originDescription}}\r\n @if (item().model === modelsEnum.Coordinamento ) {\r\n @if (item().validFromDate) {\r\n in vigore da: <span class=\"bold\">{{item().validFromDate | format:'D':'d MMMM yyyy'}}</span>\r\n }\r\n @if (item().applicableFromDate) {\r\n applicabile da: <span class=\"bold\">{{item().applicableFromDate | format:'D':'d MMMM yyyy'}}</span>\r\n }\r\n }\r\n </div>\r\n }\r\n @if ((item().anchors?.length ?? 0) > 0) {\r\n <div class=\"details\">\r\n <div>DETTAGLIO</div>\r\n <div class=\"links\">\r\n @for (a of item().anchors; track $index) {\r\n <span>\r\n @if (a.uri && a.text) {\r\n <a (click)=\"parent().open(a.documentId + '#' + a.uri, undefined, item().chunksList)\"\r\n [matTooltip]=\"a.title\" [class.bright]=\"(a.score ?? 0) > 0.75\">\r\n {{a.text}}\r\n @if (a.veryRelevant) {\r\n <sup>\r\n <mat-icon class=\"thumb\"\r\n [matTooltip]=\"(a.score ?? 0) > 0.75 ? 'Molto rilevante' : 'Più rilevante'\">thumb_up_alt</mat-icon>\r\n </sup>\r\n }</a>\r\n }\r\n @if (!a.uri && a.text) {\r\n <span>{{a.text}}</span>\r\n }\r\n </span>\r\n }\r\n </div>\r\n </div>\r\n }\r\n @if (taxonomy().length > 0) {\r\n <div class=\"details\">\r\n <div>ARGOMENTI</div>\r\n <div class=\"links\">\r\n <div [innerHTML]=\"taxonomy().join(' − ')\"></div>\r\n </div>\r\n </div>\r\n }\r\n @if (item().model === modelsEnum.News ||\r\n item().model === modelsEnum.Articoli ||\r\n item().model === modelsEnum.Juris) {\r\n @if (item().info){\r\n <div class=\"details\">\r\n <div class=\"links\">\r\n <div>{{item().info}}</div>\r\n </div>\r\n </div>\r\n }\r\n }\r\n @if (item().model === modelsEnum.Coordinamento) {\r\n @if (item().title1 && displayModifiedTitle()) {\r\n <div class=\"details\">\r\n <div>TITOLO DOCUMENTO MODIFICATO</div>\r\n <div class=\"links\">\r\n <div>{{item().title1}}</div>\r\n </div>\r\n </div>\r\n }\r\n }\r\n @if (item().model === modelsEnum.Scadenze || item().model === modelsEnum.Segnalazioni) {\r\n @if (item().expiringDescription) {\r\n <div class=\"details\">\r\n <div>PROSSIMA SCADENZA</div>\r\n <div class=\"links\">\r\n <div>{{item().expiringDescription}}</div>\r\n </div>\r\n </div>\r\n }\r\n }\r\n </div>\r\n </div>\r\n <div fxFlex=\"48px\" fxLayoutAlign=\"end\">\r\n @if (canBeRead())\r\n {\r\n <button type=\"button\" mat-icon-button matTooltip=\"Segna come già letta\" [attr.aria-label]=\"'Segna come già letta'\"\r\n (click)=\"parent().toggleRead(item(), $event)\" [hidden]=\"!(item().isOver || item().isMenuOpen)\">\r\n <mat-icon>flag</mat-icon>\r\n </button>\r\n }\r\n <button fxFlexAlign=\"center\" type=\"button\" mat-icon-button matTooltip=\"Menu\" [attr.aria-label]=\"'Menu opzioni'\"\r\n [matMenuTriggerFor]=\"actions()\" [matMenuTriggerData]=\"{item: item()}\" (click)=\"item().isMenuOpen = true\"\r\n [hidden]=\"!(item().isOver || item().isMenuOpen)\">\r\n <mat-icon>more_vert</mat-icon>\r\n </button>\r\n </div>\r\n </div>\r\n } @else if (displayMode() === displayModesEnum.Tile ) {\r\n <div class=\"tile\" [matContextMenuTriggerFor]=\"actions()\" [matContextMenuTriggerData]=\"{item: item()}\"\r\n (mouseenter)=\"item().isOver = true\" (mouseleave)=\"item().isOver = false\" [class.item-selected]=\"isSelected()\"\r\n [class.item-unread]=\"isRead()\" (click)=\"parent().open(item().documentId, undefined, item().chunksList)\">\r\n <div class=\"image\">\r\n @if (canBeRead() || isSelectable()) {\r\n <div class=\"buttons\">\r\n @if (canBeRead()) {\r\n <button mat-icon-button class=\"unread-button\" matTooltip=\"Segna come già letto\"\r\n (click)=\"parent().toggleRead(item(), $event)\"><mat-icon>flag</mat-icon></button>\r\n }\r\n @if (isSelectable() && (isSelected() || item().isOver === true)) {\r\n <button mat-icon-button class=\"check\" [class.check-selected]=\"isSelected()\" matTooltip=\"Seleziona/Deseleziona\"\r\n (click)=\"parent().toggleSelection(item(), $event)\"><mat-icon>check</mat-icon></button>\r\n }\r\n </div>\r\n }\r\n <div class=\"info-1\">{{item().modelName}}</div>\r\n @if (item().info) {\r\n <div class=\"info-2\">{{item().info}}</div>\r\n }\r\n @if (item().pictureId && tilePictureUrl()) {\r\n <img decoding=\"async\" loading=\"lazy\" [src]=\"tilePictureUrl() + '?id=' + item().pictureId\" [alt]=\"item().title2\" />\r\n } @else if (tileNoPictureUrl()) {\r\n <picture>\r\n <img decoding=\"async\" loading=\"lazy\" [src]=\"tileNoPictureUrl()\"\r\n [alt]=\"item().title2 || 'immagine non trovata'\" />\r\n </picture>\r\n }\r\n </div>\r\n <div class=\"body\">\r\n <div class=\"date\">\r\n <span class=\"date-day\" [class.unread]=\"!item().isRead\">{{item().date | format:'D':'d\r\n MMMM'}}</span>\r\n <span class=\"date-divider\"></span>\r\n <span>{{item().date| format:'D':'yyyy'}}</span>\r\n </div>\r\n <div class=\"title\">{{item().title2}}</div>\r\n </div>\r\n </div>\r\n } @else if (displayMode() === displayModesEnum.Stripe ) {\r\n <div class=\"stripe\" [matContextMenuTriggerFor]=\"actions()\" [matContextMenuTriggerData]=\"{item: item()}\"\r\n (mouseenter)=\"item().isOver = true\" (mouseleave)=\"item().isOver = false\" [class.item-selected]=\"isSelected()\"\r\n [class.item-unread]=\"isRead()\" (click)=\"parent().open(item().documentId, undefined, item().chunksList)\">\r\n <div fxLayout=\"row\" fxLayoutAlign=\"start center\" fxFill>\r\n <div>\r\n <div fxLayout=\"row\">\r\n <div fxHide.xs class=\"image\">\r\n @if (canBeRead() || isSelectable()) {\r\n <div class=\"buttons\">\r\n @if (canBeRead()) {\r\n <button mat-icon-button class=\"unread-button\" matTooltip=\"Segna come già letto\"\r\n (click)=\"parent().toggleRead(item(), $event)\"><mat-icon>flag</mat-icon></button>\r\n }\r\n @if (isSelectable() && (isSelected() || item().isOver === true)) {\r\n <button mat-icon-button class=\"check\" [class.check-selected]=\"isSelected()\"\r\n matTooltip=\"Seleziona/Deseleziona\"\r\n (click)=\"parent().toggleSelection(item(), $event)\"><mat-icon>check</mat-icon></button>\r\n }\r\n </div>\r\n }\r\n @if (item().pictureId && tilePictureUrl()) {\r\n <img decoding=\"async\" loading=\"lazy\" [src]=\"tilePictureUrl() + '?id=' + item().pictureId\"\r\n [alt]=\"item().title2\" />\r\n } @else if (tileNoPictureUrl()) {\r\n <picture>\r\n <img decoding=\"async\" loading=\"lazy\" [src]=\"tileNoPictureUrl()\"\r\n [alt]=\"item().title2 || 'immagine non trovata'\" />\r\n </picture>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n <div fxFlex=\"*\" class=\"body\">\r\n <div class=\"date\">\r\n <span class=\"date-day\" [class.unread]=\"!item().isRead\">{{item().date | format:'D':'d\r\n MMMM'}}</span>\r\n <span class=\"date-divider\"></span>\r\n <span>{{item().date| format:'D':'yyyy'}}</span>\r\n </div>\r\n <div class=\"title\">{{item().title2}}</div>\r\n <div fxLayout=\"row\" fxLayoutGap=\"10px\">\r\n <div class=\"info-1\">{{item().modelName}}</div>\r\n @if (item().info) {\r\n <div class=\"info-2\">{{item().info}}</div>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n</div>","import { Breakpoints } from '@angular/cdk/layout';\r\nimport { ScrollDispatcher, ScrollingModule } from '@angular/cdk/scrolling';\r\nimport { afterNextRender, ChangeDetectionStrategy, Component, computed, effect, inject, input, signal, untracked, viewChild } from '@angular/core';\r\nimport { outputToObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport { form, FormField, FormRoot, maxLength, min } from '@angular/forms/signals';\r\nimport { SignalsUtils } from '@arsedizioni/ars-utils/core.validators';\r\nimport { MatBadge } from '@angular/material/badge';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatButtonToggleModule } from '@angular/material/button-toggle';\r\nimport { MatCheckboxModule } from '@angular/material/checkbox';\r\nimport { MatChipsModule } from '@angular/material/chips';\r\nimport { MatDatepickerModule } from '@angular/material/datepicker';\r\nimport { MatDatepickerParseErrorFixDirective } from '@arsedizioni/ars-utils/ui.controls.date';\r\nimport { MatDividerModule } from '@angular/material/divider';\r\nimport { MatExpansionModule, MatExpansionPanel } from '@angular/material/expansion';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatInput, MatInputModule } from '@angular/material/input';\r\nimport { MatMenuModule } from '@angular/material/menu';\r\nimport { MatPaginator, PageEvent } from '@angular/material/paginator';\r\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\r\nimport { MatSelectModule } from '@angular/material/select';\r\nimport { MatDrawer, MatSidenavModule } from '@angular/material/sidenav';\r\nimport { MatSlideToggleModule } from '@angular/material/slide-toggle';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\nimport { ClipperAuthors, ClipperChannel, ClipperDocumentChangeReasons, ClipperDocumentInfo, ClipperMessages, ClipperModel, ClipperModule, ClipperRegions, ClipperSearchFacetsSnapshot, ClipperSearchParams, ClipperSearchUtils, ClipperSectors, ClipperSectorTypes, ClipperSort, ClipperSources, ClipperTopicInfo, ClipperUserInfo, ClipperUserSearch, ClipperUtils, SectorInfo } from '@arsedizioni/ars-utils/clipper.common';\r\nimport { DateInterval, DtoUtils, INode, NameValueItem, SelectableModel, SystemUtils } from '@arsedizioni/ars-utils/core';\r\nimport { FlexLayoutModule, DialogResult } from '@arsedizioni/ars-utils/ui';\r\nimport { ButtonSelectorComponent, ButtonToggleComponent, ChipsSelectorComponent } from '@arsedizioni/ars-utils/ui.controls';\r\nimport { finalize, Subject } from 'rxjs';\r\nimport { debounceTime } from 'rxjs/operators';\r\nimport { ClipperDocumentMenuComponent } from '../document-menu/document-menu.component';\r\nimport { ClipperSearchFacetsComponent } from '../search-facets/search-facets.component';\r\nimport { ClipperSearchResultManager } from '../search-result-manager/search-result-manager';\r\nimport { ClipperSearchFreeTextHelpComponent } from '../search-free-text-help/search-free-text-help.component';\r\nimport { ClipperSearchFreeTextQueryBuilderComponent, SearchFreeTextQueryParams } from '../search-free-text-query-builder/search-free-text-query-builder.component';\r\nimport { ClipperSearchResultItemComponent } from '../search-result-item/search-result-item.component';\r\n\r\n\r\n\r\n\r\n/**\r\n * Shape of the browser filter-pane form model, derived from the {@link ClipperSearchParams}\r\n * DTO: every field of that DTO is optional, so it cannot back a signal form directly.\r\n *\r\n * Text fields use '' when empty, numeric/select/date fields use null, list fields use\r\n * null — never undefined, because signal forms only create child fields for defined\r\n * values. Dates are always `Date | null` — never a `Date | string` — because `null` is\r\n * what Material's date accessors write when a datepicker input is cleared.\r\n */\r\ninterface BrowserFilterForm {\r\n modules: NameValueItem<ClipperModule>[] | null;\r\n tags: NameValueItem<string>[] | null;\r\n topics: NameValueItem<string>[] | null;\r\n sectors: NameValueItem<string>[] | null;\r\n authors: NameValueItem<string>[] | null;\r\n channels: NameValueItem<any>[] | null;\r\n number: string;\r\n year: number | null;\r\n from: Date | null;\r\n to: Date | null;\r\n text: string;\r\n titleOnly: boolean;\r\n showNotAbrogatedDocumentsOnly: boolean;\r\n showCommentedDocumentsOnly: boolean;\r\n showUnreadDocumentsOnly: boolean;\r\n sourceNumber: string;\r\n sourceYear: number | null;\r\n sourceFrom: Date | null;\r\n sourceTo: Date | null;\r\n source: string | null;\r\n author: string | null;\r\n type: string | null;\r\n changedNumber: string;\r\n changedYear: number | null;\r\n changedTitle: string;\r\n modifierNumber: string;\r\n modifierYear: number | null;\r\n modifierTitle: string;\r\n changeReason: number | null;\r\n}\r\n\r\n/**\r\n * Revives a range bound coming from a saved filter, whose data is stored as JSON and\r\n * therefore hands the dates back as ISO strings. The form model only ever holds `Date`.\r\n * @param value - The raw bound read from the search parameters.\r\n * @returns The bound as a `Date`, or `null` when it is absent or unparseable.\r\n */\r\nfunction toDate(value: Date | string | undefined): Date | null {\r\n if (!value) return null;\r\n const date = value instanceof Date ? value : new Date(value);\r\n return isNaN(date.getTime()) ? null : date;\r\n}\r\n\r\n/** Neutral form model: it declares every field the form owns and its empty value. */\r\nconst _EMPTY_ITEM: BrowserFilterForm = {\r\n modules: null,\r\n tags: null,\r\n topics: null,\r\n sectors: null,\r\n authors: null,\r\n channels: null,\r\n number: '',\r\n year: null,\r\n from: null,\r\n to: null,\r\n text: '',\r\n titleOnly: false,\r\n showNotAbrogatedDocumentsOnly: false,\r\n showCommentedDocumentsOnly: false,\r\n showUnreadDocumentsOnly: false,\r\n sourceNumber: '',\r\n sourceYear: null,\r\n sourceFrom: null,\r\n sourceTo: null,\r\n source: null,\r\n author: null,\r\n type: null,\r\n changedNumber: '',\r\n changedYear: null,\r\n changedTitle: '',\r\n modifierNumber: '',\r\n modifierYear: null,\r\n modifierTitle: '',\r\n changeReason: null,\r\n};\r\n\r\n@Component({\r\n selector: 'clipper-browser',\r\n standalone: true,\r\n imports: [FormField, FormRoot, FlexLayoutModule, MatIconModule, MatButtonModule, MatTooltipModule, MatSidenavModule,\r\n MatExpansionModule, MatDividerModule, MatMenuModule, MatFormFieldModule, MatInputModule, MatDatepickerModule, MatDatepickerParseErrorFixDirective, MatBadge,\r\n ScrollingModule, MatSelectModule, MatChipsModule, MatSlideToggleModule, MatPaginator, MatCheckboxModule, MatButtonToggleModule, MatProgressBarModule,\r\n ChipsSelectorComponent, ButtonSelectorComponent, ButtonToggleComponent,\r\n ClipperSearchResultItemComponent,\r\n ClipperDocumentMenuComponent, ClipperSearchFacetsComponent],\r\n templateUrl: './browser.component.html',\r\n styleUrl: './browser.component.scss',\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class ClipperBrowserComponent extends ClipperSearchResultManager {\r\n /** Error text of a field: the message declared in the schema, or the shared fallback. */\r\n protected readonly getErrorMessage = SignalsUtils.getFieldErrorMessage;\r\n\r\n /**\r\n * Error text for a date range: whichever end is in error speaks for the pair.\r\n * @param from - Errors of the start field, from `f.from().errors()`.\r\n * @param to - Errors of the end field, from `f.to().errors()`.\r\n * @returns The text to show under the range, or `undefined` when neither end is in error.\r\n */\r\n protected rangeErrorMessage(\r\n from: readonly { kind: string; message?: string }[],\r\n to: readonly { kind: string; message?: string }[]\r\n ): string | undefined {\r\n return SignalsUtils.getFieldErrorMessage(from.length ? from : to, 'Intervallo non valido.');\r\n }\r\n\r\n\r\n\r\n readonly filterByNumber = viewChild<MatInput>('filterByNumber');\r\n readonly filterByText = viewChild<MatInput>('filterByText');\r\n readonly filterByChangeNumber = viewChild<MatInput>('filterByChangeNumber');\r\n readonly filterPane = viewChild.required<MatDrawer>('filterPane');\r\n readonly filterPane2 = viewChild.required<MatDrawer>('filterPane2');\r\n readonly filterSelector = viewChild<ButtonSelectorComponent>('filterSelector');\r\n readonly moduleSelector = viewChild.required<ChipsSelectorComponent>('moduleSelector');\r\n readonly sourceExpansionPanel = viewChild<MatExpansionPanel>('sourceExpansionPanel');\r\n readonly otherOptionsExpansionPanel = viewChild<MatExpansionPanel>('otherOptionsExpansionPanel');\r\n readonly modifierExpansionPanel = viewChild<MatExpansionPanel>('modifierExpansionPanel');\r\n readonly showChannels = input<boolean>(true);\r\n readonly showRSOptions = input<boolean>(true);\r\n readonly showAIAssistantOptions = input<boolean>(false);\r\n readonly selectableModules = input<ClipperModule[]>([]);\r\n readonly initialModule = input<ClipperModule | undefined>(undefined);\r\n protected scrollDispatcher = inject(ScrollDispatcher);\r\n protected readonly filterDescription = signal<string>('');\r\n protected readonly filters = signal<NameValueItem<ClipperUserSearch>[]>([]);\r\n\r\n /** Currently selected saved filter, derived from the filters list and the active search id. */\r\n protected readonly filter = computed<NameValueItem<ClipperUserSearch> | undefined>(() =>\r\n this.hasFilters() && this.filterParams.searchId\r\n ? this.filters().find(x => x.value.id === this.filterParams.searchId)\r\n : undefined\r\n );\r\n\r\n /** True when the user has access to the AI assistant feature. */\r\n protected readonly hasAIAssistant = computed(() =>\r\n this.showAIAssistantOptions() && this.clipperService.user?.hasAIAssistant === true\r\n );\r\n\r\n /** True when at least one saved filter is available. */\r\n protected readonly hasFilters = computed(() => this.filters().length > 0);\r\n\r\n /**\r\n * Checks whether the current module selection targets law-related content.\r\n * @param allowEmpty - When true, an empty module list also counts as law-related. Defaults to true.\r\n * @returns True if the selection includes any law module or (when allowEmpty) is empty.\r\n */\r\n protected isLaws(allowEmpty: boolean = true): boolean {\r\n const modules = this.filterModel().modules;\r\n return (allowEmpty && (modules?.length ?? 0) === 0) ||\r\n (modules?.findIndex(x =>\r\n x.value === ClipperModule.GazzetteBollettiniEFontiDiverse ||\r\n x.value === ClipperModule.NormativaVigente ||\r\n x.value === ClipperModule.GiurisprudenzaRecente) ?? -1) !== -1;\r\n }\r\n\r\n /**\r\n * Checks whether the currently selected modules produce readable content.\r\n * @returns True when the modules allow content reading.\r\n */\r\n protected isReadable(): boolean {\r\n const modules = this.filterModel().modules;\r\n return (this.canSearch() && (modules?.length ?? 0) === 0) ||\r\n ((modules?.length ?? 0) > 0 &&\r\n (modules?.findIndex(\r\n m => m.value === ClipperModule.NormativaVigente || m.value === ClipperModule.ScadenzeESegnalazioni\r\n ) ?? -1) === -1);\r\n }\r\n\r\n /**\r\n * Checks whether the current selection targets the coordination module.\r\n * @returns True when the 'ModificheAbrogazioniERinvii' module is selected.\r\n */\r\n protected isCoordination(): boolean {\r\n const modules = this.filterModel().modules;\r\n return (modules?.length ?? 0) > 0 &&\r\n (modules?.findIndex(x => x.value === ClipperModule.ModificheAbrogazioniERinvii) ?? -1) !== -1;\r\n }\r\n\r\n /**\r\n * Checks whether the current sort mode is one of the date-based sort options.\r\n * @returns True when results are sorted by date (ascending or descending).\r\n */\r\n protected isSortedByDate(): boolean {\r\n return this.sortMode()?.value === ClipperSort.DateAsc ||\r\n this.sortMode()?.value === ClipperSort.DateDesc ||\r\n this.sortMode()?.value === ClipperSort.SourceDateAsc ||\r\n this.sortMode()?.value === ClipperSort.SourceDateDesc;\r\n }\r\n\r\n /**\r\n * Checks whether the current filter parameters define a valid search.\r\n * @returns True when at least one filter parameter has been set.\r\n */\r\n protected canSearch(): boolean {\r\n return this.isFiltering(this.filterParams);\r\n }\r\n\r\n protected readonly sectors = signal<SectorInfo[]>([]);\r\n\r\n /**\r\n * Checks whether sector-based filtering is available for the current selection.\r\n * @returns True when sector filtering applies.\r\n */\r\n protected hasSectors(): boolean {\r\n return this.isLaws();\r\n }\r\n\r\n protected readonly regions = signal<NameValueItem<string>[]>([]);\r\n\r\n /**\r\n * Checks whether region-based filtering is available.\r\n * @returns True when the selection includes sectors with regional content (LR).\r\n */\r\n protected override readonly hasRegions = computed(() =>\r\n this.hasSectors() && (this.filterModel().sectors?.filter(n => n.value === 'LR').length ?? 0) > 0\r\n );\r\n\r\n protected readonly sources = signal<NameValueItem<string>[]>([...ClipperSources]);\r\n\r\n /**\r\n * Checks whether source-based filtering applies to the current module selection.\r\n * @returns True when source filtering is available.\r\n */\r\n protected hasSource(): boolean {\r\n return this.isLaws();\r\n }\r\n\r\n protected readonly authors = signal<NameValueItem<string>[]>([]);\r\n protected readonly types = signal<NameValueItem<string>[]>([]);\r\n /** Topic tree loaded on initialization, used as input for the tree-selection dialog. */\r\n protected topics: INode[] = [];\r\n\r\n /**\r\n * Checks whether topic-based filtering applies to the current module selection.\r\n * @returns True when topic filtering is available.\r\n */\r\n protected hasTopics(): boolean {\r\n return this.isLaws();\r\n }\r\n\r\n protected readonly tags = signal<NameValueItem<string>[]>([]);\r\n\r\n /**\r\n * Checks whether tag-based filtering is available for the current modules.\r\n * @returns True when tags are loaded and the selection includes news or in-depth modules.\r\n */\r\n protected hasTags(): boolean {\r\n const modules = this.filterModel().modules;\r\n return this.tags().length > 0 &&\r\n ((modules?.length === 0 &&\r\n (this.hasModule(ClipperModule.News) || this.hasModule(ClipperModule.Approfondimenti))) ||\r\n (modules?.findIndex(\r\n m => m.value === ClipperModule.News || m.value === ClipperModule.Approfondimenti\r\n ) ?? -1) !== -1);\r\n }\r\n protected reasons = signal<NameValueItem<number>[]>([...ClipperDocumentChangeReasons]);\r\n protected modules = signal<NameValueItem<ClipperModule>[]>(this.getAllModules());\r\n\r\n /**\r\n * The subset of modules available for selection, filtered by `selectableModules` when it is non-empty.\r\n * Falls back to all modules when `selectableModules` is empty or null.\r\n */\r\n protected readonly filteredModules = computed<NameValueItem<ClipperModule>[]>(() => {\r\n const selectable = this.selectableModules();\r\n if (!selectable || selectable.length === 0) return this.modules();\r\n return this.modules().filter(m => selectable.includes(m.value));\r\n });\r\n protected user: ClipperUserInfo | undefined = this.clipperService.user;\r\n\r\n /**\r\n * Model backing the filter-pane signal form. This is the single source of truth\r\n * for every filter value bound in the template; `filterParams` only carries the\r\n * assembled query DTO (see toForm/toPayload and loadFilter). Empty values are\r\n * '' / null / false / null-array — never undefined, so every child field exists.\r\n */\r\n protected readonly filterModel = signal<BrowserFilterForm>(DtoUtils.toForm(_EMPTY_ITEM));\r\n\r\n /**\r\n * Signal form for the filter pane. The four year fields accept values from 1750\r\n * (previously the native min attribute on the inputs).\r\n */\r\n protected readonly filterForm = form(this.filterModel, p => {\r\n min(p.year, 1750);\r\n min(p.sourceYear, 1750);\r\n min(p.changedYear, 1750);\r\n min(p.modifierYear, 1750);\r\n maxLength(p.number, 10);\r\n maxLength(p.sourceNumber, 10);\r\n maxLength(p.changedNumber, 10);\r\n maxLength(p.modifierNumber, 10);\r\n maxLength(p.text, 200);\r\n maxLength(p.changedTitle, 200);\r\n maxLength(p.modifierTitle, 200);\r\n });\r\n\r\n /** Root signal form for the sort-mode button selector. */\r\n protected readonly sortForm = form(this.sortMode);\r\n\r\n /** Debounced stream of keyup events on the interval inputs (shorthand typing support). */\r\n private readonly intervalKeyup = new Subject<{ event: KeyboardEvent; source: boolean; end: boolean }>();\r\n\r\n /**\r\n * Applies a partial update to the filter model.\r\n * @param patch - The fields to change.\r\n */\r\n private patchFilter(patch: Partial<BrowserFilterForm>): void {\r\n this.filterModel.update(m => ({ ...m, ...patch }));\r\n }\r\n\r\n /**\r\n * Blocks the space key on the interval inputs; it is reserved as the\r\n * \"copy the other bound\" shortcut handled by onIntervalKeyup.\r\n * @param event - The keydown event from a start or end date input.\r\n */\r\n protected onIntervalKeydown(event: KeyboardEvent): void {\r\n if (event.key === ' ') {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n }\r\n }\r\n\r\n /**\r\n * Forwards keyup events of the interval inputs to the debounced shorthand parser.\r\n * @param event - The keyup event from a start or end date input.\r\n * @param source - `true` when the event comes from the source-publication range.\r\n * @param end - `true` when the event comes from an end-date input.\r\n */\r\n protected onIntervalKeyup(event: KeyboardEvent, source: boolean, end: boolean): void {\r\n this.intervalKeyup.next({ event, source, end });\r\n }\r\n\r\n /**\r\n * Clears one of the two publication ranges.\r\n * @param source - `true` to clear the source-publication range.\r\n */\r\n protected clearInterval(source: boolean = false): void {\r\n this.patchFilter(source ? { sourceFrom: null, sourceTo: null } : { from: null, to: null });\r\n }\r\n private _viewReady = false;\r\n\r\n\r\n constructor() {\r\n super();\r\n\r\n // Initialize filter params with defaults\r\n this.filterParams.version = 7;\r\n this.patchFilter({ modules: [{ name: \"Normativa vigente\", shortName: \"Normativa vigente\", value: ClipperModule.NormativaVigente }] });\r\n this.initializeFilter();\r\n\r\n // Shorthand typing on the interval inputs (e.g. \"d/m\"): same behavior as\r\n // DateIntervalChangeDirective, rewired to the signal form.\r\n this.intervalKeyup\r\n .pipe(debounceTime(100), takeUntilDestroyed(this.destroyRef))\r\n .subscribe(({ event, source, end }) => {\r\n const value = (event.target as HTMLInputElement)?.value;\r\n if (value !== undefined) {\r\n const m = this.filterModel();\r\n const interval = source\r\n ? new DateInterval(m.sourceFrom ?? undefined, m.sourceTo ?? undefined)\r\n : new DateInterval(m.from ?? undefined, m.to ?? undefined);\r\n SystemUtils.changeDateInterval(value, interval, end, event.key === ' ');\r\n this.patchFilter(source\r\n ? { sourceFrom: interval.from ?? null, sourceTo: interval.to ?? null }\r\n : { from: interval.from ?? null, to: interval.to ?? null });\r\n }\r\n });\r\n\r\n // Initialize document selection model\r\n this.selection = new SelectableModel<ClipperDocumentInfo, string>(true, 'documentId');\r\n\r\n // React to breakpoint changes to update the filter pane layout\r\n this.breakpointObserver\r\n .observe([\r\n Breakpoints.XSmall,\r\n Breakpoints.Small,\r\n Breakpoints.Medium,\r\n Breakpoints.Large,\r\n Breakpoints.XLarge,\r\n ])\r\n .pipe(takeUntilDestroyed(this.destroyRef))\r\n .subscribe(result => {\r\n if (!this._viewReady) return; // DOM not ready yet\r\n for (const query of Object.keys(result.breakpoints)) {\r\n if (result.breakpoints[query]) {\r\n this.handleFilterPaneVisibility();\r\n }\r\n }\r\n });\r\n\r\n // React to broadcasted messages\r\n this.broadcastService.getMessage()\r\n .pipe(takeUntilDestroyed(this.destroyRef))\r\n .subscribe(message => {\r\n if (message.id === ClipperMessages.ERROR) {\r\n this.dialogService.error(message.data?.message ?? \"Si è verificato un errore sconosciuto.\", \"Errore in Clipper\");\r\n } else if (message.id === ClipperMessages.SUCCESS || message.id === ClipperMessages.SUCCESS_TOAST) {\r\n if (message.id === ClipperMessages.SUCCESS) {\r\n this.dialogService.info(message.data?.message ?? \"Operazione completata con successo.\");\r\n } else {\r\n this.dialogService.toast(\r\n message.data?.message ?? \"Operazione completata con successo.\", \r\n message.data?.duration ?? 3000,\r\n message.data?.icon ?? 'check'\r\n );\r\n }\r\n } else if (message.id === ClipperMessages.COMMAND_DASHBOARD_UPDATED) {\r\n this.updateModulesUnreadItems();\r\n } else if (message.id === ClipperMessages.COMMAND_SEARCH_RESTORED) {\r\n const filter = this.filter();\r\n if (filter) {\r\n this.selectFilter(filter);\r\n }\r\n this.handleFilterPaneVisibility();\r\n }\r\n });\r\n\r\n // Load tags if the feature is enabled for this user\r\n if (this.clipperService.allowTags()) {\r\n this.loadTags();\r\n }\r\n\r\n // Load topics and saved searches\r\n this.loadTopics();\r\n this.loadFilters();\r\n\r\n // Set up view-dependent behaviour after the first render\r\n afterNextRender(() => {\r\n this._viewReady = true;\r\n this.handleFilterPaneVisibility();\r\n this.filterPane().openedChange\r\n .pipe(takeUntilDestroyed(this.destroyRef))\r\n .subscribe(opened => {\r\n this.updateFilterPaneFocus();\r\n // Sync backdrop with actual open state when in overlay mode\r\n if (this.filterPane().mode === 'over') {\r\n this.filterPaneHasBackdrop.set(opened);\r\n }\r\n });\r\n this.filterPane2().openedChange\r\n .pipe(takeUntilDestroyed(this.destroyRef))\r\n .subscribe(opened => {\r\n if (this.filterPane2().mode === 'over') {\r\n this.filterPane2HasBackdrop.set(opened);\r\n }\r\n });\r\n this.updateFilterPaneFocus();\r\n this.updateModulesUnreadItems();\r\n this.modulesChanged();\r\n\r\n // Subscribe to facet changes\r\n const facets = this.facets();\r\n if (facets) {\r\n outputToObservable(facets.changed)\r\n .pipe(takeUntilDestroyed(this.destroyRef))\r\n .subscribe((value: ClipperSearchFacetsSnapshot) => {\r\n if (this.snapshot) {\r\n this.snapshot.facets = value;\r\n this.fetch(true);\r\n }\r\n });\r\n }\r\n });\r\n\r\n // React to initialModule changes: preselect the matching module in the UI and in filterParams\r\n effect(() => {\r\n const initialModule = this.initialModule();\r\n const selector = this.moduleSelector();\r\n const selected = this.filteredModules().find(x => x.value === initialModule) ?? this.filteredModules()[0];\r\n // Use untracked to prevent signal reads inside select() and modulesChanged()\r\n // from becoming dependencies of this effect, which would cause a sectors read/write cycle.\r\n // The work is deferred one tick: the chips-selector propagates through its [formField]\r\n // binding, whose input is not available yet while this effect first runs.\r\n untracked(() => {\r\n setTimeout(() => {\r\n selector.select(selected);\r\n if (selected) {\r\n this.patchFilter({ modules: [selected] });\r\n this.modulesChanged();\r\n }\r\n });\r\n });\r\n });\r\n\r\n // Trim the selected modules to only include items still available in filteredModules\r\n effect(() => {\r\n const available = this.filteredModules();\r\n const modules = untracked(this.filterModel).modules;\r\n if (modules) {\r\n this.patchFilter({\r\n modules: modules.filter(x => available.findIndex(y => y.value === x.value) !== -1),\r\n });\r\n }\r\n });\r\n }\r\n\r\n\r\n /**\r\n * Get all available modules\r\n */\r\n private getAllModules(): NameValueItem<ClipperModule>[] {\r\n let modules: NameValueItem<ClipperModule>[] = [];\r\n modules.push({ name: \"News\", shortName: \"News\", value: ClipperModule.News });\r\n modules.push({ name: \"Gazzette, Bollettini e fonti diverse\", shortName: \"Gazzette, Bollettini e fonti diverse\", value: ClipperModule.GazzetteBollettiniEFontiDiverse });\r\n modules.push({ name: \"Modifiche, abrogazioni e rinvii\", shortName: \"Modifiche, abrogazioni e rinvii\", value: ClipperModule.ModificheAbrogazioniERinvii });\r\n modules.push({ name: \"Normativa vigente\", shortName: \"Normativa vigente\", value: ClipperModule.NormativaVigente });\r\n modules.push({ name: \"Giurisprudenza\", shortName: \"Giurisprudenza\", value: ClipperModule.GiurisprudenzaRecente });\r\n modules.push({ name: \"Articoli\", shortName: \"Articoli\", value: ClipperModule.Approfondimenti });\r\n modules.push({ name: \"Note a sentenza\", shortName: \"Note a sentenza\", value: ClipperModule.Giurisprudenza });\r\n modules.push({ name: \"Quesiti\", shortName: \"Quesiti\", value: ClipperModule.QuesitiECasiRisolti });\r\n return modules;\r\n }\r\n\r\n /**\r\n * Return the snapshot document by id\r\n * @param id : the document id\r\n * @returns the document or null\r\n */\r\n public getSnapshotDocument(id: string): ClipperDocumentInfo | undefined {\r\n return this.snapshot.items.find(x => x.documentId === id || x.id === id);\r\n }\r\n\r\n\r\n /**\r\n * Loads available tags from the server and populates the tag signal.\r\n */\r\n protected loadTags(): void {\r\n this.clipperService.documents.getTags()\r\n .subscribe(r => {\r\n if (r.success) {\r\n this.tags.set(r.value);\r\n }\r\n });\r\n }\r\n\r\n\r\n /**\r\n * Load topics\r\n */\r\n private loadTopics() {\r\n if (!this.clipperService.loggedIn()) return;\r\n this.clipperService.documents.getTopicsAsTree()\r\n .subscribe(r => {\r\n if (!r.success) this.dialogService.error(r.message);\r\n else {\r\n this.topics = SystemUtils.toNodes(r.value.children as INode[]);\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Show hide filter pane manually\r\n */\r\n protected toggleFilterPane() {\r\n this.filterPaneClosed.set(!this.filterPaneClosed());\r\n this.filterPane()?.toggle();\r\n }\r\n\r\n /**\r\n * Show hide filter pane manually\r\n */\r\n protected toggleFilterPane2() {\r\n this.filterPane2Closed.set(!this.filterPane2Closed());\r\n this.filterPane2()?.toggle();\r\n }\r\n\r\n\r\n /**\r\n * Handle filter pane visibility\r\n */\r\n protected handleFilterPaneVisibility() {\r\n const filterPane = this.filterPane();\r\n if (filterPane) {\r\n if (this.breakpointObserver.isMatched(Breakpoints.XSmall) ||\r\n this.breakpointObserver.isMatched(Breakpoints.Small) ||\r\n this.breakpointObserver.isMatched(Breakpoints.Medium)) {\r\n if (filterPane.opened) {\r\n filterPane.close();\r\n }\r\n filterPane.mode = 'over';\r\n filterPane.disableClose = false;\r\n this.filterPaneHasBackdrop.set(filterPane.opened);\r\n } else {\r\n if (!filterPane.opened && !this.filterPaneClosed()) {\r\n filterPane.open();\r\n } else if (filterPane.opened && this.filterPaneClosed()) {\r\n filterPane.close();\r\n }\r\n filterPane.mode = 'side';\r\n filterPane.disableClose = true;\r\n this.filterPaneHasBackdrop.set(false);\r\n }\r\n }\r\n setTimeout(() => {\r\n const filterPane2 = this.filterPane2();\r\n if (filterPane2) {\r\n if (this.breakpointObserver.isMatched(Breakpoints.XSmall) ||\r\n this.breakpointObserver.isMatched(Breakpoints.Small) ||\r\n this.breakpointObserver.isMatched(Breakpoints.Medium)) {\r\n if (filterPane2.opened) {\r\n filterPane2.close();\r\n }\r\n filterPane2.mode = 'over';\r\n filterPane2.disableClose = false;\r\n this.filterPane2HasBackdrop.set(filterPane2.opened);\r\n } else {\r\n if (!this.hasFacets()) {\r\n filterPane2.close();\r\n } else if (!filterPane2.opened && !this.filterPane2Closed()) {\r\n filterPane2.open();\r\n } else if (filterPane2.opened && this.filterPane2Closed()) {\r\n filterPane2.close();\r\n }\r\n filterPane2.mode = 'side';\r\n filterPane2.disableClose = true;\r\n this.filterPane2HasBackdrop.set(false);\r\n }\r\n }\r\n }, 250);\r\n }\r\n\r\n /**\r\n * Initialize filter\r\n */\r\n private initializeFilter() {\r\n this.patchFilter({ channels: this.clipperService.activeChannels() });\r\n this.channelsChanged(false);\r\n }\r\n\r\n /**\r\n * Update filter when channels changes\r\n * @param updateChannels: true to update channels\r\n */\r\n protected channelsChanged(updateChannels: boolean = true) {\r\n if (updateChannels) {\r\n this.clipperService.account.updateChannels(this.filterModel().channels ?? undefined);\r\n }\r\n const sectors: SectorInfo[] = [];\r\n const regions: NameValueItem<string>[] = [];\r\n let modules = this.getAllModules();\r\n const channels: NameValueItem<ClipperChannel>[] = this.filterModel().channels ?? [];\r\n // \"Scadenze e segnalazioni\" belongs to the \"Lavoro e Ambiente\" channel only.\r\n if (channels.some(x => x.value === ClipperChannel.LavoroEAmbiente)) {\r\n modules.push({ name: \"Scadenze e segnalazioni\", shortName: \"Scadenze e segnalazioni\", value: ClipperModule.ScadenzeESegnalazioni });\r\n }\r\n // \"Quesiti\" is not part of the \"Energia\" channel: drop it when that is the only selected one.\r\n if (channels.length > 0 && channels.every(x => x.value === ClipperChannel.Energia)) {\r\n modules = modules.filter(x => x.value !== ClipperModule.QuesitiECasiRisolti);\r\n }\r\n channels.forEach(channel => {\r\n const channelSettings = this.clipperService.loginInfo?.channels?.find(x => x.channelId === channel.value);\r\n if (channelSettings) {\r\n channelSettings.sectors.filter(x => x.checked).forEach(x => {\r\n if (sectors.findIndex(y => y.value === x.value) === -1) {\r\n ClipperSectors.filter(y => y.group === 'S' && y.value === x.value).forEach(y => {\r\n sectors.push(y);\r\n });\r\n }\r\n });\r\n channelSettings.regions.filter(x => x.checked).forEach(x => {\r\n if (regions.findIndex(y => y.value === x.value) === -1) {\r\n ClipperRegions.filter(y => y.value === x.value).forEach(y => {\r\n regions.push(y);\r\n });\r\n }\r\n });\r\n }\r\n });\r\n this.modules.set(modules);\r\n this.sectors.set(sectors);\r\n this.regions.set(regions);\r\n const m = this.filterModel();\r\n this.patchFilter({\r\n modules: m.modules ? m.modules.filter(x => this.modules().findIndex(y => y.value === x.value) !== -1) : m.modules,\r\n sectors: m.sectors ? m.sectors.filter(x => this.sectors().findIndex(y => y.value === x.value) !== -1) : m.sectors,\r\n authors: m.authors ? m.authors.filter(x => this.regions().findIndex(y => y.value === x.value) !== -1) : m.authors,\r\n });\r\n this.sectorsChanged();\r\n this.updateModulesUnreadItems();\r\n }\r\n\r\n /**\r\n * Update filter pane focus\r\n */\r\n private updateFilterPaneFocus() {\r\n setTimeout(() => {\r\n let focusableElement = this.filterByText();\r\n if (this.isLaws()) {\r\n focusableElement = this.filterByNumber();\r\n }\r\n focusableElement?.focus();\r\n }, 250);\r\n }\r\n\r\n /**\r\n * Loads the user's saved searches from the server and populates the filter selector.\r\n */\r\n protected loadFilters(): void {\r\n if (!this.clipperService.loggedIn()) return;\r\n this.clipperService.documents.loadSearches(ClipperModule.Ricerca)\r\n .subscribe(\r\n r => {\r\n if (r.success) {\r\n const items: NameValueItem<ClipperUserSearch>[] = [];\r\n r.value.forEach(n => {\r\n items.push({ name: n.name ?? '', value: n });\r\n });\r\n this.filters.set(items);\r\n this.handleFilterPaneVisibility();\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Saves the current filter parameters as a named search.\r\n * @param newFilter - When true, always prompts for a new filter name; otherwise updates the existing one. Defaults to false.\r\n */\r\n async saveFilter(newFilter: boolean = false): Promise<void> {\r\n this.loadFilter();\r\n if (newFilter || !this.filterParams.searchId) {\r\n const d = await this.dialogService.prompt(\r\n \"Crea un nuovo filtro\",\r\n 0,\r\n \"Nome filtro\");\r\n d?.componentInstance.done.subscribe((data) => {\r\n if (data?.value) {\r\n this.clipperService.documents.saveSearch({\r\n module: ClipperModule.Ricerca,\r\n name: data.value,\r\n data: JSON.stringify(this.filterParams)\r\n }).subscribe(r => {\r\n if (!r.success) {\r\n this.dialogService.error(r.message);\r\n } else {\r\n const newItem = { name: r.value.name ?? '', value: r.value };\r\n this.filters.update(items => [...items, newItem]);\r\n setTimeout(() => {\r\n this.filterSelector()?.select(newItem);\r\n }, 250);\r\n this.dialogService.toast(\"Operazione completata con successo.\");\r\n d.close();\r\n }\r\n });\r\n }\r\n });\r\n } else {\r\n this.clipperService.documents.saveSearch({\r\n id: this.filterParams.searchId,\r\n data: JSON.stringify(this.filterParams)\r\n }).subscribe(r => {\r\n if (!r.success) {\r\n this.dialogService.error(r.message);\r\n } else {\r\n this.filters.update(items => {\r\n const item = items.find(n => n.value.id === r.value.id);\r\n if (item) {\r\n item.value.data = r.value.data;\r\n }\r\n return [...items];\r\n });\r\n this.dialogService.toast(\"Operazione completata con successo.\");\r\n }\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Prompts for confirmation and then deletes the currently active saved filter.\r\n */\r\n deleteFilter(): void {\r\n if (this.filterParams.searchId) {\r\n this.dialogService.confirm(\"Vuoi davvero eliminare il filtro in uso?\", \"Conferma\", \"Si, eliminalo\")\r\n .componentInstance.choosen\r\n .subscribe((data: DialogResult) => {\r\n if (data.result === 'ok') {\r\n if (this.filterParams.searchId) {\r\n this.clipperService.documents.deleteSearch(this.filterParams.searchId)\r\n .subscribe(r => {\r\n if (!r.success) {\r\n this.dialogService.error(r.message);\r\n } else {\r\n this.filters.update(items => {\r\n const p = items.findIndex(x => x.value.id === this.filterParams.searchId);\r\n if (p !== -1) {\r\n items.splice(p, 1);\r\n }\r\n return [...items];\r\n });\r\n this.filterSelector()?.reset();\r\n this.filterParams.searchId = undefined;\r\n this.filterParams.searchName = undefined;\r\n this.dialogService.toast('Operazione completata con successo.');\r\n }\r\n });\r\n }\r\n }\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Applies a saved filter by deserializing its parameters into the current filter state.\r\n * @param item - The saved filter to apply, or undefined to clear the filter.\r\n */\r\n selectFilter(item: NameValueItem<ClipperUserSearch> | undefined): void {\r\n if (item && item.value.data) {\r\n this.filterSelector().select(item, false);\r\n const filter = JSON.parse(item.value.data);\r\n this.filterParams.searchId = item.value.id;\r\n this.filterParams.searchName = item.value.name;\r\n this.patchFilter({ modules: filter.modules ?? null });\r\n setTimeout(() => {\r\n this.filterParams.topic = filter.topic;\r\n // The channels are a per-account preference, not part of the saved filter.\r\n this.filterModel.set({ ...this.toForm(filter), channels: this.filterModel().channels });\r\n // Show expansion panels\r\n const m = this.filterModel();\r\n if (m.sourceNumber !== '' ||\r\n m.sourceYear != undefined ||\r\n m.source != undefined ||\r\n m.sourceFrom != undefined) {\r\n this.sourceExpansionPanel()?.open();\r\n }\r\n if (!this.isCoordination() && m.sourceNumber !== '' ||\r\n m.author != undefined ||\r\n m.type != undefined) {\r\n this.otherOptionsExpansionPanel()?.open();\r\n } else if (this.isCoordination() && m.changeReason != undefined) {\r\n this.otherOptionsExpansionPanel()?.open();\r\n }\r\n if (this.isCoordination() &&\r\n m.modifierNumber !== '' ||\r\n m.modifierYear != undefined ||\r\n m.modifierTitle !== '') {\r\n this.modifierExpansionPanel()?.open();\r\n }\r\n }, 250);\r\n } else {\r\n this.clearFilter();\r\n }\r\n\r\n }\r\n\r\n /**\r\n * Clear current filter params\r\n */\r\n protected clearFilter() {\r\n ClipperSearchUtils.clear(this.filterParams);\r\n const module = this.modules().find(x => x.value === ClipperModule.NormativaVigente);\r\n const channels = this.filterModel().channels;\r\n this.filterModel.set({\r\n ...DtoUtils.toForm(_EMPTY_ITEM),\r\n channels,\r\n modules: module ? [module] : null,\r\n });\r\n this.filterSelector()?.reset();\r\n this.filterParams.searchId = undefined;\r\n this.filterParams.searchName = undefined;\r\n }\r\n\r\n /**\r\n * Builds the filter form model from a set of search parameters.\r\n *\r\n * Ad-hoc because the two publication ranges do not map field-to-field: the DTO keeps\r\n * them as `fromDate`/`toDate`, and a range is only restored when both of its bounds\r\n * are set, exactly as the saved filters were written.\r\n *\r\n * @param dto - The search parameters to read: the live `filterParams` on a state\r\n * restore, or the deserialized data of a saved filter.\r\n * @returns A fresh form model; the caller decides what to keep of the current one.\r\n */\r\n private toForm(dto: Partial<ClipperSearchParams>): BrowserFilterForm {\r\n const model = DtoUtils.toForm(_EMPTY_ITEM, dto as unknown as Partial<BrowserFilterForm>);\r\n const from = toDate(dto.fromDate);\r\n const to = toDate(dto.toDate);\r\n const sourceFrom = toDate(dto.sourceFromDate);\r\n const sourceTo = toDate(dto.sourceToDate);\r\n model.from = from && to ? from : null;\r\n model.to = from && to ? to : null;\r\n model.sourceFrom = sourceFrom && sourceTo ? sourceFrom : null;\r\n model.sourceTo = sourceFrom && sourceTo ? sourceTo : null;\r\n return model;\r\n }\r\n\r\n /**\r\n * Builds the search payload out of the filter model, normalizing empty values back to\r\n * the undefined-based convention of {@link ClipperSearchParams}.\r\n *\r\n * Ad-hoc for two reasons. The two publication ranges are not payload fields: they\r\n * reach the DTO as `fromDate`/`toDate` through {@link loadFilter} and\r\n * {@link prepareFetch}. And every key has to be listed, `undefined` included, because\r\n * `filterParams` is a long-lived object — reused across searches and serialized into\r\n * saved filters — so a field the user has just emptied must be overwritten, not\r\n * merely left out of the copy the way {@link DtoUtils.toPayload} does.\r\n *\r\n * @returns The subset of the search parameters the filter pane owns.\r\n */\r\n private toPayload(): Partial<ClipperSearchParams> {\r\n const { from, to, sourceFrom, sourceTo, ...rest } = this.filterModel();\r\n const dto = DtoUtils.toPayload(rest);\r\n return {\r\n modules: dto.modules,\r\n tags: dto.tags,\r\n topics: dto.topics,\r\n sectors: dto.sectors as unknown as SectorInfo[],\r\n authors: dto.authors,\r\n channels: dto.channels,\r\n number: dto.number,\r\n year: dto.year,\r\n text: dto.text,\r\n titleOnly: dto.titleOnly,\r\n showNotAbrogatedDocumentsOnly: dto.showNotAbrogatedDocumentsOnly,\r\n showCommentedDocumentsOnly: dto.showCommentedDocumentsOnly,\r\n showUnreadDocumentsOnly: dto.showUnreadDocumentsOnly,\r\n sourceNumber: dto.sourceNumber,\r\n sourceYear: dto.sourceYear,\r\n source: dto.source,\r\n author: dto.author,\r\n type: dto.type,\r\n changedNumber: dto.changedNumber,\r\n changedYear: dto.changedYear,\r\n changedTitle: dto.changedTitle,\r\n modifierNumber: dto.modifierNumber,\r\n modifierYear: dto.modifierYear,\r\n modifierTitle: dto.modifierTitle,\r\n changeReason: dto.changeReason,\r\n };\r\n }\r\n\r\n /**\r\n * Commits the form model to filterParams before the component state is serialised.\r\n */\r\n protected override onStateSaving(): void {\r\n Object.assign(this.filterParams, this.toPayload());\r\n }\r\n\r\n /**\r\n * Rebuilds the form model from filterParams after a state restore.\r\n * The publication intervals are intentionally not rebuilt here — filterParams carries\r\n * no fromDate/toDate at this point — matching the historical behavior where the range\r\n * inputs were not restored.\r\n */\r\n protected override onStateRestored(): void {\r\n const current = this.filterModel();\r\n this.filterModel.set({\r\n ...this.toForm(this.filterParams),\r\n from: current.from,\r\n to: current.to,\r\n sourceFrom: current.sourceFrom,\r\n sourceTo: current.sourceTo,\r\n });\r\n }\r\n\r\n /**\r\n * Builds a DateInterval for the publication range of the current model.\r\n * @param source - When true, uses the source-publication range instead.\r\n * @returns The interval, with raw (non-normalized) bounds.\r\n */\r\n private modelInterval(source: boolean = false): DateInterval {\r\n const m = this.filterModel();\r\n return source\r\n ? new DateInterval(m.sourceFrom ?? undefined, m.sourceTo ?? undefined)\r\n : new DateInterval(m.from ?? undefined, m.to ?? undefined);\r\n }\r\n\r\n /**\r\n * Load selected filter\r\n */\r\n private loadFilter() {\r\n Object.assign(this.filterParams, this.toPayload());\r\n if (this.filterParams.year && this.filterParams.year > 0) {\r\n const year = this.filterParams.year;\r\n this.filterParams.fromDate = new Date(year, 0, 1, 2);\r\n this.filterParams.toDate = new Date(year, 11, 31, 2);\r\n } else {\r\n this.filterParams.year = undefined;\r\n }\r\n // Kept identical to the historical behavior: the interval always overwrites\r\n // the year-derived bounds, even when it is empty.\r\n const interval = this.modelInterval();\r\n this.filterParams.fromDate = interval.from;\r\n this.filterParams.toDate = interval.to;\r\n if (this.filterParams.sourceYear && this.filterParams.sourceYear > 0) {\r\n const year = this.filterParams.sourceYear;\r\n this.filterParams.sourceFromDate = new Date(year, 0, 1, 2);\r\n this.filterParams.sourceToDate = new Date(year, 11, 31, 2);\r\n } else {\r\n this.filterParams.sourceYear = undefined;\r\n }\r\n const sourceInterval = this.modelInterval(true);\r\n this.filterParams.sourceFromDate = sourceInterval.from;\r\n this.filterParams.sourceToDate = sourceInterval.to;\r\n if (this.filterParams.text) {\r\n this.filterParams.text = ClipperSearchUtils.normalizeTextQuery(this.filterParams.text);\r\n }\r\n }\r\n\r\n /**\r\n * Apply current filter params\r\n */\r\n protected applyFilter() {\r\n if (this.canSearch()) {\r\n this.facets()?.reset();\r\n this.fetch(true);\r\n }\r\n }\r\n\r\n\r\n /**\r\n * Manage sectors selection changes\r\n */\r\n protected sectorsChanged() {\r\n // Reset authors and types\r\n this.patchFilter({ authors: [], type: null });\r\n let authors: NameValueItem<string>[] = [];\r\n const sectors =\r\n (this.filterModel().sectors?.length ?? 0) > 0\r\n ? this.filterModel().sectors\r\n : this.sectors();\r\n ClipperAuthors.forEach(n => {\r\n if (sectors &&\r\n sectors.length > 0 &&\r\n sectors.findIndex(x => x.value === n.sectorId) !== -1) {\r\n authors.push(n);\r\n }\r\n });\r\n if (authors.length == 0) {\r\n ClipperAuthors.forEach(n => {\r\n if (!n.sectorId) {\r\n authors.push(n);\r\n }\r\n });\r\n }\r\n let types: NameValueItem<string>[] = [];\r\n ClipperSectorTypes.forEach(n => {\r\n if (sectors &&\r\n sectors.length > 0 &&\r\n sectors.findIndex(x => x.value === n.parentValue) !== -1) {\r\n types.push(n);\r\n }\r\n });\r\n if (types.length == 0) {\r\n types = [...ClipperSectorTypes];\r\n }\r\n this.authors.set(authors.sort((a, b) => a.name.localeCompare(b.name)));\r\n this.types.set(types);\r\n }\r\n\r\n /**\r\n * Check if any search parameter has been set\r\n * @param params : the search params to check\r\n * @returns true if at least one parameters has been set\r\n */\r\n private isFiltering(params: ClipperSearchParams): boolean {\r\n // NOTE: kept identical to the historical semantics, where fields default to\r\n // undefined and `undefined !== null` short-circuits the check to true.\r\n const m = this.filterModel();\r\n return (params.sector !== null\r\n || (m.sectors?.length ?? 0) > 0\r\n || params.author !== null\r\n || (m.authors?.length ?? 0) > 0\r\n || params.topic !== null\r\n || (m.topics?.length ?? 0) > 0\r\n || params.taxonomy !== null\r\n || params.taxonomyPath !== null\r\n || params.taxonomyNode !== null\r\n || params.number !== null\r\n || params.fromDate !== null\r\n || params.toDate !== null\r\n || params.year !== null\r\n || params.sourceNumber !== null\r\n || params.source !== null\r\n || params.sourceFromDate !== null\r\n || params.sourceToDate !== null\r\n || params.sourceYear !== null\r\n || params.tag !== null\r\n || (m.tags?.length ?? 0) > 0\r\n || params.text !== null\r\n || m.titleOnly === true\r\n || params.type !== null\r\n || m.showUnreadDocumentsOnly === true\r\n || m.showCommentedDocumentsOnly === true\r\n || params.changeReason !== null\r\n || params.changedNumber !== null\r\n || params.changedYear !== null\r\n || params.changedTitle !== null\r\n || params.modifierNumber !== null\r\n || params.modifierYear !== null\r\n || params.modifierTitle !== null\r\n || params.model !== null\r\n || (params.models?.length ?? 0) > 0\r\n || params.module !== null\r\n || (m.modules?.length ?? 0) > 0\r\n || m.from != null\r\n || m.to != null\r\n || m.sourceFrom != null\r\n || m.sourceTo != null);\r\n }\r\n\r\n\r\n /**\r\n * Checkif a single module is selected\r\n * @param module : the module to check\r\n * @returns : true if the specified module is the only one selected\r\n */\r\n private isSingleModule(module: ClipperModule): boolean {\r\n const modules = this.filterModel().modules;\r\n return (modules?.length === 1 && modules?.findIndex(x => x.value === module) !== -1);\r\n }\r\n\r\n /**\r\n * Update modules unread items\r\n */\r\n private updateModulesUnreadItems() {\r\n this.modules().forEach(module => {\r\n let totalUnread = 0;\r\n if (module.value === ClipperModule.News) {\r\n totalUnread = this.clipperService.dashboard.getUnreadItems(module.value, ClipperModel.News);\r\n } else if (module.value === ClipperModule.Approfondimenti) {\r\n totalUnread = this.clipperService.dashboard.getUnreadItems(module.value, ClipperModel.Articoli);\r\n } else if (module.value === ClipperModule.Giurisprudenza) {\r\n totalUnread = this.clipperService.dashboard.getUnreadItems(module.value, ClipperModel.Juris);\r\n } else if (module.value === ClipperModule.GiurisprudenzaRecente) {\r\n totalUnread = this.clipperService.dashboard.getUnreadItems(ClipperModule.Giurisprudenza, null);\r\n } else {\r\n totalUnread = this.clipperService.dashboard.getUnreadItems(module.value, null);\r\n }\r\n if (totalUnread > 0) {\r\n module.bag = totalUnread.toString();\r\n module.bagInfo = totalUnread + ' non letti';\r\n } else {\r\n module.bag = undefined;\r\n module.bagInfo = undefined;\r\n }\r\n });\r\n this.modules.update(values => [...values]);\r\n }\r\n\r\n /**\r\n * Checks if a module is supported\r\n * @param module : the module to check\r\n * @returns true if the module is supported\r\n */\r\n private hasModule(module: ClipperModule) {\r\n return (this.selectableModules().length === 0 || this.selectableModules().findIndex(x => x === module) !== -1) &&\r\n this.modules().findIndex(x => x.value === module) !== -1;\r\n }\r\n\r\n /**\r\n * Manage module selection changes \r\n */\r\n protected modulesChanged() {\r\n const modules = this.filterModel().modules;\r\n const hasModules = (modules?.length ?? 0) > 0;\r\n // Update models\r\n if (!hasModules) {\r\n this.filterParams.models = [];\r\n // Update sectors\r\n this.sectors.set(ClipperSectors.filter(n => n.group === 'S').map(n => {\r\n return { name: n.shortName ?? n.name, value: n.value };\r\n }));\r\n } else {\r\n this.filterParams.models = ClipperSearchUtils.getModulesModels(modules ?? undefined);\r\n // Update sectors\r\n if (this.isSingleModule(ClipperModule.ScadenzeESegnalazioni)) {\r\n this.sectors.set([]);\r\n } else if (this.isSingleModule(ClipperModule.GiurisprudenzaRecente)) {\r\n this.sectors.set(ClipperSectors.filter(n => n.group === 'S' && n.value[0] === 'G').map(n => {\r\n return { name: n.shortName ?? n.name, value: n.value };\r\n }));\r\n } else if (this.isLaws()) {\r\n this.sectors.set(ClipperSectors.filter(n => n.group === 'S').map(n => {\r\n return { name: n.shortName ?? n.name, value: n.value };\r\n }));\r\n }\r\n }\r\n this.selection?.clear();\r\n this.sectorsChanged();\r\n this.updateFilterPaneFocus();\r\n }\r\n\r\n /**\r\n * Checks the current module selection against a list of expected modules.\r\n * @param modules - The modules to check for.\r\n * @param mode - The check mode: 1) exactly these elements, 2) all of these elements, 3) any of these elements.\r\n * @returns True if the check passes.\r\n */\r\n private checkModules(modules: ClipperModule[], mode: number = 1): boolean {\r\n const currentModules = this.filterModel().modules;\r\n let ok: boolean = false;\r\n if (mode === 1) {\r\n // All and only the elements specified\r\n currentModules?.forEach(n => {\r\n ok = (modules.findIndex(x => x === n.value) ?? -1) !== -1;\r\n if (!ok) {\r\n return;\r\n }\r\n });\r\n return ok && modules.length >= (currentModules?.length ?? 0);\r\n } else if (mode === 2) {\r\n // All the elements specified\r\n modules.forEach(n => {\r\n ok = (currentModules?.findIndex(x => x.value === n) ?? -1) !== -1;\r\n if (!ok) {\r\n return;\r\n }\r\n });\r\n } else if (mode === 3) {\r\n // Any of the specified elements \r\n modules.forEach(n => {\r\n ok = (currentModules?.findIndex(x => x.value === n) ?? -1) !== -1;\r\n if (ok) {\r\n return;\r\n }\r\n });\r\n }\r\n return ok;\r\n }\r\n\r\n /**\r\n * Builds the effective query parameters for the next search request.\r\n * @param newSearch - When true, resets pagination and triggers facet loading. Defaults to false.\r\n * @returns The resolved {@link ClipperSearchParams} ready to be sent to the API.\r\n */\r\n private prepareFetch(newSearch: boolean = false): ClipperSearchParams {\r\n Object.assign(this.filterParams, this.toPayload());\r\n this.filterParams.fromDate = this.modelInterval().fromAsDate;\r\n this.filterParams.toDate = this.modelInterval().toAsDate;\r\n this.filterParams.sourceFromDate = this.modelInterval(true).fromAsDate;\r\n this.filterParams.sourceToDate = this.modelInterval(true).toAsDate;\r\n let newParams: ClipperSearchParams = new ClipperSearchParams();\r\n if ((this.filterParams.modules?.length ?? 0) > 0) {\r\n newParams.first = this.filterParams.first;\r\n newParams.channels = this.filterParams.channels\r\n newParams.count = this.filterParams.count;\r\n newParams.sortMode = this.filterParams.sortMode;\r\n if (this.isCoordination()) {\r\n newParams.models = [ClipperModel.Coordinamento];\r\n newParams.authors = this.filterParams.authors ?? [];\r\n newParams.sectors = this.filterParams.sectors ?? [];\r\n newParams.fromDate = this.filterParams.fromDate;\r\n newParams.toDate = this.filterParams.toDate;\r\n newParams.changeReason = this.filterParams.changeReason;\r\n newParams.changedNumber = this.filterParams.changedNumber;\r\n newParams.changedYear = this.filterParams.changedYear;\r\n newParams.changedTitle = this.filterParams.changedTitle;\r\n newParams.modifierNumber = this.filterParams.modifierNumber;\r\n newParams.modifierYear = this.filterParams.modifierYear;\r\n newParams.modifierTitle = this.filterParams.modifierTitle;\r\n } else {\r\n if (this.filterParams.text) {\r\n newParams.text = ClipperSearchUtils.normalizeTextQuery2(this.filterParams.text);\r\n }\r\n newParams.titleOnly = this.filterParams.titleOnly;\r\n newParams.fromDate = this.filterParams.fromDate;\r\n newParams.toDate = this.filterParams.toDate;\r\n newParams.models = ClipperSearchUtils.getModulesModels(this.filterParams.modules);\r\n if (this.checkModules([\r\n ClipperModule.News,\r\n ClipperModule.GazzetteBollettiniEFontiDiverse,\r\n ClipperModule.GiurisprudenzaRecente,\r\n ClipperModule.QuesitiECasiRisolti], 1)) {\r\n newParams.showUnreadDocumentsOnly = this.filterParams.showUnreadDocumentsOnly;\r\n }\r\n if (this.checkModules([\r\n ClipperModule.NormativaVigente,\r\n ClipperModule.GazzetteBollettiniEFontiDiverse,\r\n ClipperModule.GiurisprudenzaRecente], 1)) {\r\n newParams.showCommentedDocumentsOnly = this.filterParams.showCommentedDocumentsOnly;\r\n newParams.showNotAbrogatedDocumentsOnly = this.filterParams.showNotAbrogatedDocumentsOnly;\r\n newParams.sectors = this.filterParams.sectors;\r\n newParams.number = this.filterParams.number;\r\n newParams.year = this.filterParams.year;\r\n newParams.topics = this.filterParams.topics;\r\n newParams.authors = this.filterParams.authors ?? [];\r\n if (newParams.authors.length == 0 && this.filterParams.author) {\r\n newParams.authors = [{ name: '?', value: this.filterParams.author }];\r\n }\r\n newParams.types = this.filterParams.types ?? [];\r\n if (newParams.types.length == 0 && this.filterParams.type) {\r\n newParams.types = [{ name: '?', value: this.filterParams.type }];\r\n }\r\n newParams.source = this.filterParams.source;\r\n newParams.sourceNumber = this.filterParams.sourceNumber;\r\n newParams.sourceYear = this.filterParams.sourceYear;\r\n newParams.sourceFromDate = this.filterParams.sourceFromDate;\r\n newParams.sourceToDate = this.filterParams.sourceToDate;\r\n }\r\n if (this.checkModules([ClipperModule.News], 1)) {\r\n newParams.tags = this.filterParams.tags;\r\n }\r\n }\r\n } else {\r\n newParams = SystemUtils.clone(this.filterParams) as ClipperSearchParams;\r\n newParams.channels = this.filterParams.channels\r\n newParams.authors = this.filterParams.authors ?? [];\r\n if (newParams.authors.length == 0 && this.filterParams.author) {\r\n newParams.authors = [{ name: '?', value: this.filterParams.author }];\r\n }\r\n newParams.types = this.filterParams.types ?? [];\r\n if (newParams.types.length == 0 && this.filterParams.type) {\r\n newParams.types = [{ name: '?', value: this.filterParams.type }];\r\n }\r\n if (newParams.text) {\r\n newParams.text = ClipperSearchUtils.normalizeTextQuery2(newParams.text);\r\n }\r\n newParams.titleOnly = this.filterParams.titleOnly;\r\n }\r\n // Setup sort options\r\n this.sortOptions.set(ClipperUtils.getClipperAvailableSortOptions(this.filterParams.modules, newParams));\r\n if (newParams.text && newSearch) {\r\n this.sortMode.set(this.sortOptions()[0]);\r\n this.changeDetector.markForCheck();\r\n }\r\n if (!this.sortMode() || this.sortOptions().findIndex((x: NameValueItem<ClipperSort>) => x.value === this.sortMode()?.value) === -1) {\r\n this.sortMode.set(this.sortOptions()[0]);\r\n }\r\n newParams.sortMode = this.sortMode()?.value;\r\n // Apply facets\r\n if (this.snapshot?.facets?.fromDate) {\r\n newParams.fromDate = this.snapshot.facets?.fromDate;\r\n newParams.toDate = this.snapshot.facets?.toDate;\r\n newParams.year = this.snapshot.facets?.fromDate.getFullYear();\r\n }\r\n if (this.snapshot?.facets?.sector) {\r\n if (this.snapshot?.facets?.sector) {\r\n const model: ClipperModel = parseInt(this.snapshot.facets?.sector) as ClipperModel;\r\n if (model > 0) {\r\n newParams.models = [model];\r\n } else\r\n newParams.sectors = [{ value: this.snapshot.facets?.sector ?? \"\", name: \"\" }];\r\n } else {\r\n if ((newParams.sectors?.length ?? 0) == 0)\r\n newParams.models = ClipperSearchUtils.getModulesModels(this.filterParams.modules);\r\n }\r\n }\r\n if (this.snapshot?.facets?.type) {\r\n newParams.types = [{ value: this.snapshot.facets.type ?? \"\", name: \"\" }];\r\n }\r\n if (this.snapshot?.facets?.author) {\r\n newParams.authors = [{ value: this.snapshot.facets?.author ?? \"\", name: \"\" }];\r\n }\r\n\r\n newParams.version = 7;\r\n newParams.count = 15;\r\n if (newSearch) {\r\n newParams.first = 0;\r\n this.filterParams.first = 0;\r\n }\r\n\r\n // Compute a filter description\r\n this.updateFilterDescription();\r\n\r\n return newParams;\r\n }\r\n\r\n /**\r\n * Update filter description\r\n */\r\n private updateFilterDescription() {\r\n let filterDescription = \"\";\r\n this.filterParams.modules?.forEach((n, i) => {\r\n if (i > 0) filterDescription += \", \";\r\n filterDescription += n.shortName;\r\n });\r\n if ((this.filterParams.sectors?.length ?? 0) > 0) {\r\n filterDescription += \" > \";\r\n this.filterParams.sectors?.forEach((n, i) => {\r\n if (i > 0) filterDescription += \", \";\r\n filterDescription += n.name;\r\n });\r\n }\r\n if ((this.filterParams.authors?.length ?? 0) > 0) {\r\n filterDescription += \" > \";\r\n this.filterParams.authors?.forEach((n, i) => {\r\n if (i > 0) filterDescription += \", \";\r\n filterDescription += n.name;\r\n });\r\n }\r\n this.filterDescription.set(filterDescription);\r\n }\r\n\r\n /**\r\n * Fetches and applies search facets for the current result set.\r\n * @param params - The search parameters used to query facets.\r\n */\r\n protected fetchFacets(params: ClipperSearchParams): void {\r\n if (!this.clipperService.loggedIn()) return;\r\n this.filterBusy.set(true);\r\n this.clipperService.documents.queryFacets(params)\r\n .subscribe({\r\n next: r => {\r\n if (r.success) {\r\n let hasFacets = (r.value.facets?.length ?? 0) > 0;\r\n if (r.value.facets) {\r\n this.facets()?.update(r.value.facets, r.value.interval);\r\n if (this.facets && this.snapshot) {\r\n hasFacets = this.facets().hasFacets();\r\n this.snapshot.facets = this.facets().save();\r\n this.snapshot.facets.hasTooManyResults = (this.snapshot?.total ?? 0) >= 1000;\r\n }\r\n }\r\n this.hasFacets.set(hasFacets);\r\n this.handleFilterPaneVisibility();\r\n }\r\n },\r\n complete: () => {\r\n this.filterBusy.set(false);\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Hide facets\r\n */\r\n protected hideFacets() {\r\n this.hasFacets.set(false);\r\n this.facets()?.reset();\r\n this.filterPane2().close();\r\n this.filterPane2Closed.set(false);\r\n }\r\n\r\n /**\r\n * Executes the search query and updates the result snapshot.\r\n * @param newSearch - When true, resets pagination and reloads facets. Defaults to false.\r\n */\r\n protected fetch(newSearch: boolean = false): void {\r\n const searchParams = this.prepareFetch(newSearch);\r\n this.dialogService.busy('Ricerca in corso...');\r\n this.clipperService.documents.query(searchParams)\r\n .pipe(finalize(() => this.dialogService.clearBusy()))\r\n .subscribe(r => {\r\n if (!r.success) this.dialogService.error(r.message);\r\n else {\r\n // Handle data\r\n this.prepareResults(r.value, newSearch);\r\n // Handle facets\r\n if (this.snapshot?.total ?? 0 > 0) {\r\n if (newSearch) {\r\n this.fetchFacets(searchParams);\r\n }\r\n } else {\r\n this.hideFacets();\r\n }\r\n\r\n if (newSearch) {\r\n if (this.paginator()) {\r\n this.paginator().pageIndex = 0;\r\n }\r\n }\r\n\r\n this.scroll(0);\r\n this.handleFilterPaneVisibility();\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Navigate to a new result page.\r\n * @param e - The paginator {@link PageEvent} containing the new page index and size.\r\n */\r\n protected fetchMore(e: PageEvent): void {\r\n let first = e.pageIndex * (this.filterParams.count ?? 15);\r\n this.filterParams.first = first;\r\n this.fetch();\r\n }\r\n\r\n\r\n /**\r\n * Change the current sort mode and refresh results.\r\n * @param newSort - The new sort option to apply.\r\n */\r\n protected sort(newSort?: NameValueItem<ClipperSort>): void {\r\n if (newSort) {\r\n this.sortMode.set(newSort);\r\n this.fetch();\r\n }\r\n }\r\n\r\n /**\r\n * Open the free-text search help dialog.\r\n */\r\n protected help(): void {\r\n this.dialogService.open(ClipperSearchFreeTextHelpComponent, {\r\n ariaLabel: 'informazioni ricerca',\r\n autoFocus: 'dialog',\r\n restoreFocus: true,\r\n disableClose: false,\r\n minWidth: '375px',\r\n maxWidth: '800px',\r\n width: '99%',\r\n });\r\n }\r\n\r\n /**\r\n * Open the query-builder dialog to compose a free-text search expression.\r\n */\r\n protected compose(): void {\r\n const d = this.dialogService.open(ClipperSearchFreeTextQueryBuilderComponent, {\r\n ariaLabel: 'costruisci ricerca',\r\n autoFocus: 'dialog',\r\n restoreFocus: true,\r\n disableClose: false,\r\n minWidth: '375px',\r\n maxWidth: '500px',\r\n width: '99%',\r\n });\r\n d.componentInstance.done.subscribe((result: SearchFreeTextQueryParams) => {\r\n this.patchFilter({ text: result.query });\r\n d.close();\r\n });\r\n }\r\n\r\n /**\r\n * Open the topic-selection dialog and append the chosen topics to the current filter.\r\n */\r\n protected addTopic(): void {\r\n const topics = this.filterModel().topics;\r\n this.dialogService\r\n .selectTree(\r\n this.topics,\r\n 'Seleziona un argomento',\r\n undefined,\r\n (topics && topics.length > 0)\r\n ? topics[topics.length - 1].name\r\n : undefined\r\n )\r\n .then(d => d?.componentInstance.done.subscribe(r => {\r\n const added = r.selectedItems.map(item => {\r\n const bag = item.bag as ClipperTopicInfo;\r\n return { name: bag.name, value: bag.id };\r\n });\r\n this.patchFilter({ topics: [...(this.filterModel().topics ?? []), ...added] });\r\n }));\r\n }\r\n\r\n /**\r\n * Remove a topic from the current filter.\r\n * @param item - The topic item to remove.\r\n */\r\n protected deleteTopic(item: NameValueItem<string>): void {\r\n const topics = this.filterModel().topics;\r\n if ((topics?.findIndex(x => x.value === item.value) ?? -1) !== -1) {\r\n this.patchFilter({ topics: topics!.filter(x => x.value !== item.value) });\r\n }\r\n }\r\n\r\n /**\r\n * Remove all topics from the current filter.\r\n */\r\n protected clearTopics(): void {\r\n this.patchFilter({ topics: [] });\r\n }\r\n\r\n}\r\n\r\n\r\n","<mat-drawer-container [hasBackdrop]=\"filterPaneHasBackdrop()\" class=\"fill\">\n <mat-drawer #filterPane class=\"drawer\">\n <div fxLayout=\"column\" fxFill>\n <div fxFlex=\"78px\" class=\"title-container\">\n <div fxLayout=\"row\" fxLayoutGap=\"10px\" fxLayoutAlign=\"start center\" fxFill>\n <div class=\"title\">Filtro</div>\n <div fxFlex=\"*\" fxLayoutAlign=\"end\">\n <button fxFlexAlign=\"center\" mat-icon-button (click)=\"saveFilter(true)\"\n matTooltip=\"Crea una nuovo filtro con i parametri attuali \"><mat-icon>add</mat-icon></button>\n <button fxFlexAlign=\"center\" mat-icon-button (click)=\"toggleFilterPane()\"\n matTooltip=\"Nascondi\"><mat-icon>left_panel_close</mat-icon></button>\n </div>\n </div>\n </div>\n @if(hasFilters()) {\n <div style=\"padding:10px 20px\">\n <div fxLayout=\"row\" fxLayoutGap=\"10px\" fxFill>\n <div fxFlex=\"*\">\n <button-selector #filterSelector [options]=\"filters()\" label=\"Seleziona un filtro salvato\"\n labelSelected=\"Filtro in uso:\" fxFlexAlign=\"center\" (selected)=\"selectFilter($event)\"\n [matTooltip]=\"filterParams.searchName ?? ''\"></button-selector>\n </div>\n @if(filterParams.searchId) {\n <div fxFlex=\"40px\">\n <button fxFlexAlign=\"center\" mat-icon-button (click)=\"deleteFilter()\"\n matTooltip=\"Elimina il filtro in uso\"><mat-icon>delete</mat-icon></button>\n </div>\n }\n </div>\n </div>\n }\n <div fxFlex=\"*\" class=\"content scroll-hidden\" style=\"padding-bottom: 10px;\">\n <div class=\"scroll-auto\" style=\"padding: 0 10px;\">\n <form [formRoot]=\"filterForm\" (keyup.enter)=\"applyFilter()\" novalidate>\n <mat-accordion multi displayMode=\"flat\">\n <mat-expansion-panel expanded class=\"accordion-panel mat-elevation-z0 \">\n <mat-expansion-panel-header class=\"accordion-header\">\n <mat-panel-title>\n Cerca in..\n </mat-panel-title>\n </mat-expansion-panel-header>\n\n <chips-selector #moduleSelector [formField]=\"filterForm.modules\" [collapseAt]=\"599\" [multiple]=\"true\"\n label=\"Sezioni\" name=\"modules\" [options]=\"filteredModules()\" (changed)=\"modulesChanged()\">\n </chips-selector>\n </mat-expansion-panel>\n\n @if((hasTags() || hasTopics()) && !isCoordination()) {\n <mat-expansion-panel class=\"accordion-panel mat-elevation-z0\">\n <mat-expansion-panel-header class=\"accordion-header\">\n <mat-panel-title>\n Argomenti\n </mat-panel-title>\n </mat-expansion-panel-header>\n @if(hasTags()) {\n <chips-selector [collapseAt]=\"599\" [formField]=\"filterForm.tags\" [multiple]=\"true\"\n label=\"Argomenti\" [options]=\"tags()\"></chips-selector>\n }\n @if(hasTopics()) {\n @if ((filterForm.topics().value()?.length ?? 0) > 0) {\n <mat-chip-grid #topics style=\"padding-bottom: 5px;\">\n @for (o of filterForm.topics().value(); track $index) {\n <mat-chip-row [value]=\"o\" (removed)=\"deleteTopic(o)\">\n {{o.name}}\n <button matChipRemove>\n <mat-icon>cancel</mat-icon>\n </button></mat-chip-row>\n }\n </mat-chip-grid>\n <input style=\"display: none;\" [matChipInputFor]=\"topics\" />\n }\n <div fxLayout=\"row\" fxLayoutAlign=\"end center\">\n <button mat-button type=\"button\" (click)=\"addTopic()\"><mat-icon>add</mat-icon> Aggiungi\n argomento</button>\n @if ((filterForm.topics().value()?.length ?? 0) > 0) {\n <button mat-button type=\"button\" (click)=\"clearTopics()\"><mat-icon>delete</mat-icon> Azzera</button>\n }\n </div>\n }\n </mat-expansion-panel>\n }\n @if(hasSectors()) {\n <mat-expansion-panel class=\"accordion-panel mat-elevation-z0 \">\n <mat-expansion-panel-header class=\"accordion-header\">\n <mat-panel-title>\n Settori\n </mat-panel-title>\n </mat-expansion-panel-header>\n <chips-selector [collapseAt]=\"599\" [formField]=\"filterForm.sectors\" [multiple]=\"true\"\n label=\"Settori\" [options]=\"sectors()\" (changed)=\"sectorsChanged()\" />\n @if(hasRegions())\n {\n <mat-divider style=\"padding-top: 8px; margin-top:8px\"></mat-divider>\n <chips-selector [formField]=\"filterForm.authors\" [multiple]=\"true\" mode=\"collapsed\"\n label=\"Tutte le regioni\" [options]=\"regions()\" />\n }\n </mat-expansion-panel>\n }\n @if(!isCoordination()) {\n <mat-expansion-panel expanded class=\"accordion-panel mat-elevation-z0 \">\n <mat-expansion-panel-header class=\"accordion-header\">\n <mat-panel-title>\n Documento\n </mat-panel-title>\n </mat-expansion-panel-header>\n <div fxLayout=\"column\">\n @if(isLaws()) {\n <div fxLayout=\"row wrap\" fxLayoutAlign=\"space-between center\" fxFill>\n <mat-form-field fxFlex=\"59\" fxFlex.xs=\"49\">\n <mat-label>Numero</mat-label>\n <input matInput [formField]=\"filterForm.number\"\n #filterByNumber=\"matInput\" />\n @if (filterForm.number().value()) {\n <button type=\"button\" tabindex=\"-1\" matSuffix mat-icon-button aria-label=\"Pulisci\"\n (click)=\"filterForm.number().value.set('')\">\n <mat-icon>close</mat-icon>\n </button>\n }\n </mat-form-field>\n <mat-form-field fxFlex=\"39\" fxFlex.xs=\"49\">\n <mat-label>Anno</mat-label>\n <input type=\"number\" matInput [formField]=\"filterForm.year\" />\n @if (filterForm.year().value()) {\n <button type=\"button\" tabindex=\"-1\" matSuffix mat-icon-button aria-label=\"Pulisci\"\n (click)=\"filterForm.year().value.set(null)\">\n <mat-icon>close</mat-icon>\n </button>\n }\n </mat-form-field>\n </div>\n }\n <mat-form-field>\n <mat-label>Intervallo di pubblicazione</mat-label>\n <mat-date-range-input [rangePicker]=\"picker1\">\n <input matStartDate [formField]=\"filterForm.from\" placeholder=\"Da data\"\n (keydown)=\"onIntervalKeydown($event)\" (keyup)=\"onIntervalKeyup($event, false, false)\">\n <input matEndDate [formField]=\"filterForm.to\" placeholder=\"A data\"\n (keydown)=\"onIntervalKeydown($event)\" (keyup)=\"onIntervalKeyup($event, false, true)\">\n </mat-date-range-input>\n @if (filterForm.from().value() || filterForm.to().value()) {\n <button type=\"button\" tabindex=\"-1\" matSuffix mat-icon-button aria-label=\"Pulisci\"\n (click)=\"clearInterval()\">\n <mat-icon>close</mat-icon>\n </button>\n }\n <mat-datepicker-toggle matSuffix [for]=\"picker1\"></mat-datepicker-toggle>\n <mat-date-range-picker #picker1></mat-date-range-picker>\n @if (filterForm.from().invalid() || filterForm.to().invalid()) {\n <mat-error>{{ rangeErrorMessage(filterForm.from().errors(), filterForm.to().errors()) }}</mat-error>\n }\n </mat-form-field>\n <mat-form-field>\n <mat-label>Testo</mat-label>\n <input matInput [formField]=\"filterForm.text\"\n #filterByText=\"matInput\" />\n @if (filterForm.text().value()) {\n <button type=\"button\" tabindex=\"-1\" matSuffix mat-icon-button aria-label=\"Pulisci\"\n (click)=\"filterForm.text().value.set('')\">\n <mat-icon>close</mat-icon>\n </button>\n }\n <button type=\"button\" tabindex=\"-1\" mat-icon-button matSuffix matTooltip=\"Opzioni\"\n aria-label=\"Opzioni\"\n [matMenuTriggerFor]=\"filterPaneOptionsMenu\"><mat-icon>more_vert</mat-icon></button>\n </mat-form-field>\n <div>\n @if(filterForm.text().value()) {\n <div style=\"padding-bottom:10px\">\n <mat-slide-toggle [formField]=\"filterForm.titleOnly\">Cerca solo nel\n titolo</mat-slide-toggle>\n </div>\n }\n @if(isLaws(false)) {\n <div style=\"padding-bottom:10px\">\n <mat-slide-toggle [formField]=\"filterForm.showNotAbrogatedDocumentsOnly\">Mostra solo elementi non abrogati</mat-slide-toggle>\n </div>\n <div style=\"padding-bottom:10px\">\n <mat-slide-toggle [formField]=\"filterForm.showCommentedDocumentsOnly\">Mostra solo elementi con commenti</mat-slide-toggle>\n </div>\n }\n @if(isReadable()) {\n <div style=\"padding-bottom:10px\">\n <mat-slide-toggle [formField]=\"filterForm.showUnreadDocumentsOnly\">Mostra solo elementi non letti</mat-slide-toggle>\n </div>\n }\n\n </div>\n </div>\n </mat-expansion-panel>\n @if(isLaws(false)) {\n <mat-expansion-panel #sourceExpansionPanel class=\"accordion-panel mat-elevation-z0 \">\n <mat-expansion-panel-header class=\"accordion-header\">\n <mat-panel-title>\n Fonte\n </mat-panel-title>\n </mat-expansion-panel-header>\n <div fxLayout=\"column\">\n <div fxLayout=\"row wrap\" fxLayoutAlign=\"space-between center\" fxFill>\n <mat-form-field fxFlex=\"59\" fxFlex.xs=\"100\">\n <mat-label>Numero</mat-label>\n <input matInput [formField]=\"filterForm.sourceNumber\" />\n @if (filterForm.sourceNumber().value()) {\n <button type=\"button\" tabindex=\"-1\" matSuffix mat-icon-button aria-label=\"Pulisci\"\n (click)=\"filterForm.sourceNumber().value.set('')\">\n <mat-icon>close</mat-icon>\n </button>\n }\n </mat-form-field>\n <mat-form-field fxHide.xs fxFlex=\"39\" fxFlex.xs=\"100\">\n <mat-label>Anno</mat-label>\n <input type=\"number\" matInput [formField]=\"filterForm.sourceYear\" />\n @if (filterForm.sourceYear().value()) {\n <button type=\"button\" tabindex=\"-1\" matSuffix mat-icon-button aria-label=\"Pulisci\"\n (click)=\"filterForm.sourceYear().value.set(null)\">\n <mat-icon>close</mat-icon>\n </button>\n }\n </mat-form-field>\n </div>\n <mat-form-field>\n <mat-label>Intervallo di pubblicazione</mat-label>\n <mat-date-range-input [rangePicker]=\"picker2\">\n <input matStartDate [formField]=\"filterForm.sourceFrom\" placeholder=\"Da data\"\n (keydown)=\"onIntervalKeydown($event)\" (keyup)=\"onIntervalKeyup($event, true, false)\">\n <input matEndDate [formField]=\"filterForm.sourceTo\" placeholder=\"A data\"\n (keydown)=\"onIntervalKeydown($event)\" (keyup)=\"onIntervalKeyup($event, true, true)\">\n </mat-date-range-input>\n @if (filterForm.sourceFrom().value() || filterForm.sourceTo().value()) {\n <button type=\"button\" tabindex=\"-1\" matSuffix mat-icon-button aria-label=\"Pulisci\"\n (click)=\"clearInterval(true)\">\n <mat-icon>close</mat-icon>\n </button>\n }\n <mat-datepicker-toggle matSuffix [for]=\"picker2\"></mat-datepicker-toggle>\n <mat-date-range-picker #picker2></mat-date-range-picker>\n @if (filterForm.sourceFrom().invalid() || filterForm.sourceTo().invalid()) {\n <mat-error>{{ rangeErrorMessage(filterForm.sourceFrom().errors(), filterForm.sourceTo().errors()) }}</mat-error>\n }\n </mat-form-field>\n <mat-form-field>\n <mat-label>Tipo</mat-label>\n <mat-select [formField]=\"filterForm.source\">\n @for (s of sources(); track $index) {\n <mat-option [value]=\"s.value\" [matTooltip]=\"s.name\">\n {{s.name}}\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n\n </div>\n </mat-expansion-panel>\n <mat-expansion-panel #otherOptionsExpansionPanel class=\"accordion-panel mat-elevation-z0\">\n <mat-expansion-panel-header class=\"accordion-header\">\n <mat-panel-title>\n Altre opzioni\n </mat-panel-title>\n </mat-expansion-panel-header>\n <div fxLayout=\"column\">\n @if(authors().length > 0 && !hasRegions()) {\n <mat-form-field>\n <mat-label>Autore</mat-label>\n <mat-select [formField]=\"filterForm.author\">\n @for (a of authors(); track $index) {\n <mat-option [value]=\"a.value\" [matTooltip]=\"a.name\">\n {{a.name}}\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n }\n <mat-form-field>\n <mat-label>Tipo documento</mat-label>\n <mat-select [formField]=\"filterForm.type\">\n @for (t of types(); track $index) {\n <mat-option [value]=\"t.value\" [matTooltip]=\"t.name\">\n {{t.name}}\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n\n </mat-expansion-panel>\n }\n } @else {\n <mat-expansion-panel expanded class=\"accordion-panel mat-elevation-z0 \">\n <mat-expansion-panel-header class=\"accordion-header\">\n <mat-panel-title>\n Periodo\n </mat-panel-title>\n </mat-expansion-panel-header>\n <mat-form-field style=\"width:100%\">\n <mat-label>Intervallo di pubblicazione</mat-label>\n <mat-date-range-input [rangePicker]=\"picker1\">\n <input matStartDate [formField]=\"filterForm.from\" placeholder=\"Da data\"\n (keydown)=\"onIntervalKeydown($event)\" (keyup)=\"onIntervalKeyup($event, false, false)\">\n <input matEndDate [formField]=\"filterForm.to\" placeholder=\"A data\"\n (keydown)=\"onIntervalKeydown($event)\" (keyup)=\"onIntervalKeyup($event, false, true)\">\n </mat-date-range-input>\n @if (filterForm.from().value() || filterForm.to().value()) {\n <button type=\"button\" tabindex=\"-1\" matSuffix mat-icon-button aria-label=\"Pulisci\"\n (click)=\"clearInterval()\">\n <mat-icon>close</mat-icon>\n </button>\n }\n <mat-datepicker-toggle matSuffix [for]=\"picker1\"></mat-datepicker-toggle>\n <mat-date-range-picker #picker1></mat-date-range-picker>\n @if (filterForm.from().invalid() || filterForm.to().invalid()) {\n <mat-error>{{ rangeErrorMessage(filterForm.from().errors(), filterForm.to().errors()) }}</mat-error>\n }\n </mat-form-field>\n @if(isReadable()) {\n <div style=\"padding-bottom:10px\">\n <mat-slide-toggle [formField]=\"filterForm.showUnreadDocumentsOnly\">Mostra solo elementi non letti</mat-slide-toggle>\n </div>\n }\n </mat-expansion-panel>\n <mat-expansion-panel expanded class=\"accordion-panel mat-elevation-z0 \">\n <mat-expansion-panel-header class=\"accordion-header\">\n <mat-panel-title>\n Documento modificato\n </mat-panel-title>\n </mat-expansion-panel-header>\n <div fxLayout=\"column\">\n <div fxLayout=\"row wrap\" fxLayoutAlign=\"space-between center\" fxFill>\n <mat-form-field fxFlex=\"59\" fxFlex.xs=\"100\">\n <mat-label>Numero</mat-label>\n <input matInput [formField]=\"filterForm.changedNumber\"\n #filterByChangeNumber=\"matInput\" />\n @if (filterForm.changedNumber().value()) {\n <button type=\"button\" tabindex=\"-1\" matSuffix mat-icon-button aria-label=\"Pulisci\"\n (click)=\"filterForm.changedNumber().value.set('')\">\n <mat-icon>close</mat-icon>\n </button>\n }\n </mat-form-field>\n <mat-form-field fxHide.xs fxFlex=\"39\" fxFlex.xs=\"100\">\n <mat-label>Anno</mat-label>\n <input type=\"number\" matInput [formField]=\"filterForm.changedYear\" />\n @if (filterForm.changedYear().value()) {\n <button type=\"button\" tabindex=\"-1\" matSuffix mat-icon-button aria-label=\"Pulisci\"\n (click)=\"filterForm.changedYear().value.set(null)\">\n <mat-icon>close</mat-icon>\n </button>\n }\n </mat-form-field>\n </div>\n <mat-form-field>\n <mat-label>Titolo</mat-label>\n <input matInput [formField]=\"filterForm.changedTitle\" />\n @if (filterForm.changedTitle().value()) {\n <button type=\"button\" tabindex=\"-1\" matSuffix mat-icon-button aria-label=\"Pulisci\"\n (click)=\"filterForm.changedTitle().value.set('')\">\n <mat-icon>close</mat-icon>\n </button>\n }\n </mat-form-field>\n </div>\n </mat-expansion-panel>\n <mat-expansion-panel #modifierOptionsExpansionPanel class=\"accordion-panel mat-elevation-z0 \">\n <mat-expansion-panel-header class=\"accordion-header\">\n <mat-panel-title>\n Documento modificante\n </mat-panel-title>\n </mat-expansion-panel-header>\n <div fxLayout=\"column\">\n <div fxLayout=\"row wrap\" fxLayoutAlign=\"space-between center\" fxFill>\n <mat-form-field fxFlex=\"59\" fxFlex.xs=\"100\">\n <mat-label>Numero</mat-label>\n <input matInput [formField]=\"filterForm.modifierNumber\" />\n @if (filterForm.modifierNumber().value()) {\n <button type=\"button\" tabindex=\"-1\" matSuffix mat-icon-button aria-label=\"Pulisci\"\n (click)=\"filterForm.modifierNumber().value.set('')\">\n <mat-icon>close</mat-icon>\n </button>\n }\n </mat-form-field>\n <mat-form-field fxHide.xs fxFlex=\"39\" fxFlex.xs=\"100\">\n <mat-label>Anno</mat-label>\n <input type=\"number\" matInput [formField]=\"filterForm.modifierYear\" />\n @if (filterForm.modifierYear().value()) {\n <button type=\"button\" tabindex=\"-1\" matSuffix mat-icon-button aria-label=\"Pulisci\"\n (click)=\"filterForm.modifierYear().value.set(null)\">\n <mat-icon>close</mat-icon>\n </button>\n }\n </mat-form-field>\n </div>\n <mat-form-field>\n <mat-label>Titolo</mat-label>\n <input matInput [formField]=\"filterForm.modifierTitle\" />\n @if (filterForm.modifierTitle().value()) {\n <button type=\"button\" tabindex=\"-1\" matSuffix mat-icon-button aria-label=\"Pulisci\"\n (click)=\"filterForm.modifierTitle().value.set('')\">\n <mat-icon>close</mat-icon>\n </button>\n }\n </mat-form-field>\n </div>\n </mat-expansion-panel>\n <mat-expansion-panel #otherOptionsExpansionPanel class=\"accordion-panel mat-elevation-z0\">\n <mat-expansion-panel-header class=\"accordion-header\">\n <mat-panel-title>\n Altre opzioni\n </mat-panel-title>\n </mat-expansion-panel-header>\n <div fxLayout=\"column\">\n <mat-form-field>\n <mat-label>Motivo</mat-label>\n <mat-select [formField]=\"filterForm.changeReason\">\n @for (r of reasons(); track $index) {\n <mat-option [value]=\"r.value\" [matTooltip]=\"r.name\">\n {{r.name}}\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n </mat-expansion-panel>\n }\n </mat-accordion>\n </form>\n </div>\n </div>\n @if(showChannels()) {\n <div style=\"padding:10px\">\n <div fxLayout=\"column\">\n <mat-expansion-panel class=\"accordion-panel mat-elevation-z0\" style=\"margin-bottom: 10px;\">\n <mat-expansion-panel-header class=\"accordion-header\">\n <mat-panel-title>\n Canali\n </mat-panel-title>\n <mat-panel-description>\n @for (c of clipperService.availableChannels(); track $index) {\n <div class=\"channel-box\" [class.channel-disabled]=\"!c.active || c.disabled\" [matTooltip]=\"c.name\">\n <span class=\"label\">{{c.header}}</span>\n </div>\n }\n </mat-panel-description>\n </mat-expansion-panel-header>\n <chips-selector [collapseAt]=\"599\" [formField]=\"filterForm.channels\" [multiple]=\"true\"\n label=\"Canali\" [options]=\"clipperService.availableChannels()\"\n (changed)=\"channelsChanged()\"></chips-selector>\n\n </mat-expansion-panel>\n <div fxLayout=\"row\" fxLayoutGap=\"10px\" fxFill>\n <div fxFlex=\"*\" fxFlexAlign=\"end\">\n <button mat-stroked-button (click)=\"clearFilter()\">Pulisci</button>\n <button mat-stroked-button (click)=\"saveFilter()\" style=\"margin-left: 10px;\">Salva</button>\n </div>\n <div fxLayoutAlign=\"end\">\n <button fxFlexAlign=\"end\" mat-flat-button (click)=\"applyFilter()\"\n [disabled]=\"!canSearch()\">Applica</button>\n </div>\n </div>\n </div>\n </div>\n }\n </div>\n </mat-drawer>\n <div fxLayout=\"column\" fxLayoutGap=\"10px\" fxFill class=\"drawer-content scroll-hidden\">\n <div class=\"module-toolbar \">\n <div fxLayout=\"row wrap\" fxLayoutAlign=\"space-between\" fxFill>\n <div fxFlex=\"49\" fxFlex.lt-md=\"100\" style=\"padding-left: 10px; padding-bottom: 5px;\">\n @if(!filterPane.opened) {\n <button-toggle cssClass=\"small\" cssClassSmall=\"x-small\" iconOn=\"left_panel_close\" iconOff=\"tune\"\n labelOn=\"Nascondi<br>filtri\" labelOff=\"Mostra<br>filtri\" [value]=\"filterPane.opened\"\n (changed)=\"toggleFilterPane()\"></button-toggle>\n }\n </div>\n <div fxFlex=\"49\" fxFlex.lt-md=\"100\" fxLayoutAlign=\"end\">\n <div fxLayout=\"row\" style=\"height:48px; padding-bottom: 5px;\">\n @if((snapshot?.total ?? 0) > 0) {\n @if(sortOptions().length > 0) {\n <button-selector [options]=\"sortOptions()\" label=\"Ordina per:\" style=\"margin-right: 5px;\" [border]=\"0\"\n fxFlexAlign=\"center\" [formField]=\"sortForm\" (selected)=\"sort($event)\"></button-selector>\n }\n <button fxFlexAlign=\"center\" mat-icon-button matSuffix matTooltip=\"Opzioni sulla selezione\"\n aria-label=\"Opzioni sulla selezione\" [matMenuTriggerFor]=\"selectionOptionsMenu\"\n [matBadge]=\"countSelections()\"><mat-icon>checklist</mat-icon></button>\n <button fxFlexAlign=\"center\" mat-icon-button matTooltip=\"Salva elenco in Excel \"\n (click)=\"exportResults()\"><mat-icon>save_alt</mat-icon></button>\n @if (!filterPane2?.opened && hasFacets()){\n <button fxFlexAlign=\"center\" mat-icon-button matTooltip=\"Affina ricerca\"\n (click)=\"toggleFilterPane2()\"><mat-icon>right_panel_open</mat-icon></button>\n }\n }\n </div>\n </div>\n </div>\n </div>\n <div fxFlex=\"*\" class=\"module-content\">\n <mat-drawer-container [hasBackdrop]=\"filterPane2HasBackdrop()\" class=\"fill\">\n <mat-drawer #filterPane2 class=\"drawer-small drawer-with-loader\" position=\"end\" opened=\"false\">\n @if (filterBusy()) {\n <div class=\"overlay\"></div>\n }\n <div fxLayout=\"column\" fxFill>\n <div fxFlex=\"6px\">\n @if (filterBusy()) {\n <mat-progress-bar style=\"z-index: 11;\" mode=\"indeterminate\">\n </mat-progress-bar>\n }\n </div>\n <div fxFlex=\"78px\" class=\"title-container-with-loader\">\n <div fxLayout=\"row\" fxLayoutAlign=\"start center\" fxFill>\n <div class=\"title\">Affina ricerca</div>\n <div fxFlex=\"*\" fxLayoutAlign=\"end\">\n <button mat-icon-button (click)=\"toggleFilterPane2()\"\n matTooltip=\"Nascondi\"><mat-icon>right_panel_close</mat-icon></button>\n </div>\n </div>\n </div>\n <div fxFlex=\"*\" class=\"content scroll-hidden\" style=\"padding: 0 5px;\">\n <clipper-search-facets #facets></clipper-search-facets>\n\n </div>\n </div>\n </mat-drawer>\n <div fxLayout=\"column\" fxFill>\n <div fxFlex=\"*\" [id]=\"scrollerId\" cdkScrollable class=\"scroll-auto\" style=\"padding: 0 20px;\">\n @if (!snapshot?.total) {\n <div class=\"message-container\">\n @if(snapshot?.total === 0) {\n <p class=\"message\"><b>Nessun elemento da visualizzare.</b></p>\n } @else {\n <div class=\"message\">\n <p fxHide.xs><b>Esegui una ricerca compilando i campi necessari nella maschera di ricarca qui a\n fianco.</b></p>\n <p fxHide.gt-xs><b>Fai click sul bottone <span class=\"accent\"><mat-icon>tune</mat-icon></span> ed esegui\n una\n ricerca compilando i campi necessari.</b></p>\n <p>E' possibile salvare i parametri delle le ricerche più utilizzate facendo clic su \n <mat-icon\n style=\"display: inline-flex; border-radius: 9999px; height: 25px; width: 25px; color: var(--ars-color-text-low); background-color: var(--ars-color-accent);\">add</mat-icon>.\n </p>\n </div>\n }\n </div>\n } @else {\n @if (snapshot && (snapshot.total ?? 0) > 0) {\n @for (item of snapshot.items; track $index; let i = $index) {\n @if (item.group && isSortedByDate()) {\n <div class=\"items-group-title\">\n <div [class.group-spaced]=\"i > 0\">{{item.group}}</div>\n </div>\n }\n <clipper-search-result-item [item]=\"item\" [parent]=\"this\" [displayModelName]=\"true\" [actions]=\"contextMenu\"\n [isReadable]=\"true\"></clipper-search-result-item>\n }\n }\n }\n </div>\n <!-- footer -->\n @if ((snapshot?.total ?? 0) > 0) {\n <div class=\"items-footer\">\n <div fxLayout=\"row wrap\" fxLayoutGap=\"10px\" fxLayoutAlign=\"space-between center\" fxFill>\n <!-- legend -->\n <div fxFlex.lt-md=\"100\" class=\"legend-container\">\n <div class=\"legend unread-bg\"></div>\n non letto\n <!--<div class=\"legend next very-popular-bg\"></div>\n molto citato\n <div class=\"legend next popular-bg\"></div>\n citato-->\n <div class=\"legend next expired-bg \"></div>\n non più vigente\n </div>\n <div fxFlex.lt-md=\"100\" fxLayoutAlign=\"end\" [class.wide]=\"filterPane2?.opened\">\n <div fxLayout=\"row\">\n <mat-paginator fxFlexAlign=\"center\" #paginator class=\"paginator\" [hidePageSize]=\"true\"\n [length]=\"snapshot?.total ?? 0\" [pageSize]=\"filterParams.count\" [showFirstLastButtons]=\"true\"\n (page)=\"fetchMore($event)\">\n </mat-paginator>\n </div>\n </div>\n </div>\n </div>\n }\n </div>\n </mat-drawer-container>\n </div>\n </div>\n</mat-drawer-container>\n<mat-menu #filterPaneOptionsMenu=\"matMenu\">\n <button mat-menu-item (click)=\"compose()\">\n <mat-icon>build</mat-icon>Componi\n </button>\n <button mat-menu-item (click)=\"help()\">\n <mat-icon>help</mat-icon>Come usare la ricerca in testo libero\n </button>\n</mat-menu>\n<mat-menu #selectionOptionsMenu=\"matMenu\">\n <button mat-menu-item (click)=\"selectAll()\">\n <mat-icon>select_all</mat-icon>Seleziona tutti\n </button>\n <clipper-document-menu [parent]=\"this\" [useSelections]=\"true\" [isReadable]=\"true\"\n [canUseAIAssistant]=\"hasAIAssistant()\" [canUseRS]=\"showRSOptions()\">\n </clipper-document-menu>\n</mat-menu>\n<mat-menu #contextMenu=\"matMenu\" (closed)=\"updateMenuButtonsVisibility()\">\n <ng-template matMenuContent let-item=\"item\">\n <clipper-document-menu [parent]=\"this\" [item]=\"item\" [isReadable]=\"true\"\n [canUseAIAssistant]=\"hasAIAssistant()\" [canUseRS]=\"showRSOptions()\">\n </clipper-document-menu>\n </ng-template>\n</mat-menu>","import { ChangeDetectionStrategy, Component, DestroyRef, effect, inject, viewChild } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { MAT_DIALOG_DATA, MatDialogClose, MatDialogContent, MatDialogRef } from '@angular/material/dialog';\nimport { ClipperMessages, ClipperModule, ClipperSelectionMode, ClipperService, ClipperUtils } from '@arsedizioni/ars-utils/clipper.common';\nimport { BroadcastService, SystemUtils, ThemeType } from '@arsedizioni/ars-utils/core';\nimport { ClipperBrowserComponent } from '../browser.component';\nimport { MatIconModule } from '@angular/material/icon';\nimport { FlexLayoutModule } from '@arsedizioni/ars-utils/ui';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatBadgeModule } from '@angular/material/badge';\n\n\nexport interface ClipperBrowserDialogData {\n showChannels?: boolean;\n selectionMode?: ClipperSelectionMode;\n selectableModules?: ClipperModule[];\n selectionMessage?: string;\n initialModule?: number;\n theme?: ThemeType;\n}\n\n@Component({\n host: { 'Bind': SystemUtils.generateUUID() },\n templateUrl: './browser-dialog.component.html',\n styleUrls: ['./browser-dialog.component.scss'],\n imports: [MatDialogClose, MatDialogContent, MatButtonModule, MatBadgeModule, MatIconModule, FlexLayoutModule, ClipperBrowserComponent],\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class ClipperBrowserDialogComponent {\n private readonly destroyRef = inject(DestroyRef);\n readonly clipperBrowser = viewChild.required<ClipperBrowserComponent>('clipperBrowser');\n protected clipperService = inject(ClipperService);\n protected dialogData: ClipperBrowserDialogData = inject(MAT_DIALOG_DATA);\n private dialogRef = inject(MatDialogRef<ClipperBrowserDialogComponent>);\n private broadcastService = inject(BroadcastService);\n\n constructor() {\n // Apply the selection mode from dialog data once the browser view is available.\n // Falls back to ClipperSelectionMode.None when selectionMode is not provided.\n effect(() => {\n this.clipperBrowser().selectionMode.set(this.dialogData.selectionMode ?? ClipperSelectionMode.None);\n });\n\n // Subscribe to inner document-selection events and forward them as dialog output.\n this.broadcastService.getMessage()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(message => {\n if (message.id === ClipperMessages.DOCUMENT_SELECTED_INNER) {\n const documentId: string | undefined = message.data.documentId ?? message.data.id;\n const document = documentId != null ? this.clipperBrowser().getSnapshotDocument(documentId) : undefined;\n if (document) {\n this.broadcastService.sendMessage(\n this.dialogData.selectionMessage ?? ClipperMessages.DOCUMENT_SELECTED, [document]);\n this.dialogRef.close();\n }\n }\n });\n }\n\n /**\n * Determines whether the current selection satisfies the required selection mode\n * and module constraints defined in the dialog data.\n *\n * @returns `true` if the selection is valid and can be confirmed; `false` otherwise.\n */\n protected canSelect(): boolean {\n const selection = this.clipperBrowser().selection;\n const selectionCount = selection?.all?.length ?? 0;\n const mode = this.dialogData.selectionMode;\n\n let allow =\n (mode === ClipperSelectionMode.Single && selectionCount === 1) ||\n (mode === ClipperSelectionMode.TwoOrMore && selectionCount > 1) ||\n (mode === ClipperSelectionMode.Multi && selectionCount > 0);\n\n if (allow && (this.dialogData.selectableModules?.length ?? 0) > 0) {\n selection?.all?.forEach(n => {\n const module = ClipperUtils.getClipperModuleFromModel(n);\n if (this.dialogData.selectableModules?.findIndex(x => x === module) === -1) {\n allow = false;\n }\n });\n }\n\n return allow;\n }\n\n /**\n * Broadcasts the current selection as a message and closes the dialog.\n * Does nothing when the selection is empty.\n */\n protected select(): void {\n const items = this.clipperBrowser().selection?.all;\n if (items && items.length > 0) {\n this.broadcastService.sendMessage(\n this.dialogData.selectionMessage ?? ClipperMessages.DOCUMENT_SELECTED,\n items\n );\n this.dialogRef.close();\n }\n }\n\n}\n","<div style=\"padding:10px 0 10px 0\">\r\n <div fxLayout=\"row\" fxLayoutGap=\"20px\" fxLayoutAlign=\"start center\" fxFill>\r\n <div class=\"dialog-title\">\r\n <a href=\"https://clipper.arsedizioni.it\" matTooltip=\"Apri Clipper in un nuovo tab\" target=\"_blank\">\r\n <div class=\"clipper-logo\"></div>\r\n </a>\r\n </div>\r\n <div fxFlex=\"*\"></div>\r\n @if ((dialogData.selectionMode ?? 0) > 0 && canSelect()) {\r\n <div fxFlexAlign=\"center\" fxFlex=\"170px\" fxFlex.lt-md=\"58px\">\r\n <button fxHide.lt-md fxFlexAlign=\"center\" type=\"button\" mat-flat-button (click)=\"select()\"\r\n class=\"clipper-selection-button\">\r\n <span class=\"small bold\">Usa selezione</span>\r\n </button>\r\n <button fxHide.gt-sm fxFlexAlign=\"center\" type=\"button\" mat-icon-button (click)=\"select()\"\r\n matTooltip=\"Usa selezione\" aria-label=\"'Usa la selezione'\" class=\"clipper-selection-icon-button\">\r\n <mat-icon>check</mat-icon>\r\n </button>\r\n </div>\r\n }\r\n <div fxFlexAlign=\"center\" class=\"dialog-close\">\r\n <div fxLayout=\"row\" fxLayoutAlign=\"end center\" fxLayoutGap=\"5px\">\r\n @if (clipperService.bag.length > 0) {\r\n <button type=\"button\" mat-icon-button matTooltip=\"Documenti di lavoro\"\r\n aria-label=\"'Documenti di lavoro'\" (click)=\"clipperBrowser.openBag()\">\r\n <mat-icon aria-hidden=\"false\" [matBadge]=\"clipperService.bag.length\"\r\n >work_outline</mat-icon>\r\n </button>\r\n }\r\n <button type=\"button\" mat-icon-button matTooltip=\"Chiudi\" [mat-dialog-close]=\"true\" aria-label=\"Chiudi\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n<mat-dialog-content style=\"padding: 0\">\r\n <clipper-browser #clipperBrowser class=\"wide fill\" [showChannels]=\"dialogData.showChannels ?? true\"\r\n [selectableModules]=\"dialogData.selectableModules ?? []\"\r\n [initialModule]=\"dialogData.initialModule\" [showRSOptions]=\"false\" [showAIAssistantOptions]=\"false\"></clipper-browser>\r\n</mat-dialog-content>","import { ChangeDetectionStrategy, Component, DestroyRef, computed, inject, signal } from '@angular/core';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MAT_DIALOG_DATA, MatDialogActions, MatDialogClose, MatDialogContent, MatDialogTitle } from '@angular/material/dialog';\r\nimport { MatTabsModule } from '@angular/material/tabs';\r\nimport { SafeHtmlPipe, SystemUtils } from '@arsedizioni/ars-utils/core';\r\nimport { MarkdownUtils } from '@arsedizioni/ars-utils/core.markdown';\r\nimport { FlexLayoutModule } from '@arsedizioni/ars-utils/ui';\r\nimport { DialogService } from '@arsedizioni/ars-utils/ui.dialogs';\r\nimport { finalize } from 'rxjs';\r\nimport { ClipperDocumentAnalysis, ClipperService } from '@arsedizioni/ars-utils/clipper.common';\r\n\r\n/** What the viewer is opened with: the document, and nothing else - the texts are read here. */\r\nexport interface ClipperDocumentAnalysisDialogData {\r\n /** The document: the act or its current text. */\r\n documentId: string;\r\n\r\n /**\r\n * Whether the editors wrote a comment on the document (bag[7]): the first tab is «Commento» then, «Sintesi» when\r\n * there is only the assistant's analysis.\r\n */\r\n hasComment?: boolean;\r\n\r\n /**\r\n * Whether to show the editors' comment alone, without the tabs: a document with a comment opened by a reader who\r\n * is not of Ars. The analysis is not read then - the comment comes from the comments, as it always did.\r\n */\r\n commentOnly?: boolean;\r\n}\r\n\r\n/**\r\n * The comment viewer of a law, in three tabs: «Commento» (`whatIsAllAbout`), «Cosa cambia» (`whatIsChanged`)\r\n * and «Sarebbe interessante se l'azienda» (`wouldBeInterestingIf`), the same three sections the viewer of the\r\n * updates shows in Evolution.\r\n *\r\n * IT READS FROM THE SERVER WHEN IT OPENS, like the other dialogs of the documents: first the analysis\r\n * (`ArsCMS.DocumentAnalysis`); when the document has none, the editorial comment, which goes into «Commento» as\r\n * the HTML it is. The caller only says which document.\r\n *\r\n * THE TABS ARE ALWAYS ACTIVE, and each says what it cannot show. «Commento» is for the readers of the editorial\r\n * comments only: anybody else reads that the comment is not available for their licence. The two tabs of useful\r\n * information are for everybody until 1 May 2027 - «Cosa cambia» announces it above its text, when there is one -\r\n * and from then on they are reserved to the readers of the comments too. The server is what withholds the texts\r\n * (`canReadComments`): this component only draws the reason in their place.\r\n *\r\n * The texts are Markdown and are converted once, when they arrive, rather than at every change detection.\r\n */\r\n@Component({\r\n host: { 'Bind': SystemUtils.generateUUID() },\r\n templateUrl: './document-analysis.component.html',\r\n styleUrls: ['./document-analysis.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n standalone: true,\r\n imports: [\r\n FlexLayoutModule,\r\n MatDialogTitle,\r\n MatDialogContent,\r\n MatDialogActions,\r\n MatDialogClose,\r\n MatTabsModule,\r\n MatButtonModule,\r\n SafeHtmlPipe,\r\n ],\r\n})\r\nexport class ClipperDocumentAnalysisComponent {\r\n private readonly clipperService = inject(ClipperService);\r\n private readonly dialogService = inject(DialogService);\r\n private readonly destroyRef = inject(DestroyRef);\r\n protected readonly dialogData: ClipperDocumentAnalysisDialogData = inject(MAT_DIALOG_DATA);\r\n\r\n /** The day the useful information stops being free: the day the server enforces too. */\r\n private static readonly USEFUL_INFORMATION_CUTOFF = new Date(2027, 4, 1);\r\n\r\n /** The cut-off day as the notice writes it. */\r\n private static readonly USEFUL_INFORMATION_CUTOFF_TEXT = '1° maggio 2027';\r\n\r\n /** What the server answers when the subscription does not include the comments. */\r\n private static readonly NOT_ENTITLED = 'Il tuo abbonamento non consente di visualizzare i commenti alle norme.';\r\n\r\n /** The analysis, once read; undefined when the document has none. */\r\n protected readonly analysis = signal<ClipperDocumentAnalysis | undefined>(undefined);\r\n\r\n /** The editorial comment as HTML, read when the document has no analysis. */\r\n protected readonly commentHtml = signal<string | undefined>(undefined);\r\n\r\n /** Why «Commento» shows nothing: the licence, or a comment withdrawn for revision. */\r\n protected readonly commentMessage = signal<string | undefined>(undefined);\r\n\r\n /**\r\n * «Commento», as HTML; undefined when empty. The heading «Applicabilità e entrate in vigore future» gets the class\r\n * `info-title` and the table under it the class `future-dates`, which give the four columns their widths - as in\r\n * the viewer of the updates of Evolution (ComplianceUpdatesUtils.aboutHtml): Markdown has no way to say either.\r\n */\r\n protected readonly aboutHtml = computed(() => ClipperDocumentAnalysisComponent.toHtml(this.analysis()?.whatIsAllAbout)?.replace(\r\n /<(h[23])((?![^>]*class=)[^>]*)>([^<]*Applicabilit[^<]*entrate in vigore future[^<]*)<\\/\\1>(\\s*)<table(?![^>]*class=)/i,\r\n '<$1$2 class=\"info-title\">$3</$1>$4<table class=\"future-dates\"'));\r\n\r\n /**\r\n * «Cosa cambia», as HTML; undefined when empty. The heading «Adempimenti nuovi e modificati» gets the class\r\n * `info-title` and the table under it the class `obligations` (30%, 30%, 40%), as in Evolution\r\n * (ComplianceUpdatesUtils.changedHtml); the other tables of the tab take 25%, 25%, 50%.\r\n */\r\n protected readonly changedHtml = computed(() => ClipperDocumentAnalysisComponent.toHtml(this.analysis()?.whatIsChanged)?.replace(\r\n /<(h[23])((?![^>]*class=)[^>]*)>([^<]*Adempimenti nuovi e modificati[^<]*)<\\/\\1>(\\s*)<table(?![^>]*class=)/i,\r\n '<$1$2 class=\"info-title\">$3</$1>$4<table class=\"obligations\"'));\r\n\r\n /** «Sarebbe interessante se l'azienda», as HTML; undefined when empty. */\r\n protected readonly interestingHtml = computed(() => ClipperDocumentAnalysisComponent.toHtml(this.analysis()?.wouldBeInterestingIf));\r\n\r\n /**\r\n * Whether the reader holds the editorial comments. The analysis says it; without one, a comment that was read\r\n * says yes and a refusal says no.\r\n */\r\n protected readonly canReadComments = computed<boolean>(() =>\r\n this.analysis() ? this.analysis()!.canReadComments === true : !!this.commentHtml());\r\n\r\n /** Whether the cut-off day has come. */\r\n protected readonly restricted = new Date() >= ClipperDocumentAnalysisComponent.USEFUL_INFORMATION_CUTOFF;\r\n\r\n /** The notice above «Cosa cambia»: a promise before the cut-off day, a statement after it. */\r\n protected readonly notice = this.restricted\r\n ? `Dal ${ClipperDocumentAnalysisComponent.USEFUL_INFORMATION_CUTOFF_TEXT} le informazioni sono disponibili solo per chi ha accesso ai commenti.`\r\n : `Dal ${ClipperDocumentAnalysisComponent.USEFUL_INFORMATION_CUTOFF_TEXT} le seguenti informazioni saranno disponibili solo per chi ha accesso ai commenti.`;\r\n\r\n /** The name of the first tab: «Commento» when the editors wrote one, «Sintesi» for the assistant's analysis alone. */\r\n protected readonly firstTab = this.dialogData.hasComment ? 'Commento' : 'Sintesi';\r\n\r\n /** Whether the editors' comment is shown alone, without the tabs and without the analysis. */\r\n protected readonly commentOnly = this.dialogData.commentOnly === true;\r\n\r\n /** The tab shown: the first, always - when it is not available, its message says so. */\r\n protected readonly dialogTab = signal<number>(1);\r\n\r\n constructor() {\r\n this.fetch();\r\n }\r\n\r\n /**\r\n * Reads the analysis of the document and, when there is none, its editorial comment. The busy overlay of the\r\n * dialogs covers the tabs meanwhile, and whichever of the two readings ends last clears it.\r\n */\r\n private fetch(): void {\r\n this.dialogService.busy('Caricamento in corso...');\r\n // The comment alone: straight from the editors' comments, so that the assistant's synthesis - which «Commento»\r\n // shows until the comment is copied onto the analysis - never reaches this reader.\r\n if (this.commentOnly) {\r\n this.fetchComment();\r\n return;\r\n }\r\n this.clipperService.documents.analysis(this.dialogData.documentId)\r\n .pipe(takeUntilDestroyed(this.destroyRef))\r\n .subscribe({\r\n next: r => {\r\n if (r.success && r.value) {\r\n this.analysis.set(r.value);\r\n this.dialogService.clearBusy();\r\n } else {\r\n this.fetchComment();\r\n }\r\n },\r\n error: () => this.fetchComment(),\r\n });\r\n }\r\n\r\n /**\r\n * Reads the editorial comment: what «Commento» showed before the analyses, and what it still shows when a\r\n * document has none. The server refuses it to a licence without the comments, and that is what the tab says.\r\n */\r\n private fetchComment(): void {\r\n this.clipperService.documents.comment(this.dialogData.documentId)\r\n .pipe(takeUntilDestroyed(this.destroyRef), finalize(() => this.dialogService.clearBusy()))\r\n .subscribe({\r\n next: r => {\r\n if (!r.success) {\r\n this.commentMessage.set(r.message === ClipperDocumentAnalysisComponent.NOT_ENTITLED\r\n ? 'Il commento non è disponibile per questa licenza.'\r\n : r.message || 'Commento non disponibile.');\r\n } else if (r.value && r.value.length > 1) {\r\n this.commentHtml.set(r.value.replace(/<\\/p><br>\\r\\n/g, '</p>\\r\\n'));\r\n } else {\r\n this.commentMessage.set('Commento non più disponibile o in fase di revisione.');\r\n }\r\n },\r\n error: () => this.commentMessage.set('Commento non disponibile.'),\r\n });\r\n }\r\n\r\n /**\r\n * Converts one of the three texts.\r\n * @param text - the Markdown\r\n * @returns the HTML, or undefined when there is no text\r\n */\r\n private static toHtml(text?: string | null): string | undefined {\r\n return text && text.trim().length > 0 ? MarkdownUtils.toHtml(text) : undefined;\r\n }\r\n}\r\n","<!-- The comment alone (commentOnly): no tabs, only the editors' comment. -->\r\n@if (commentOnly) {\r\n<div mat-dialog-title> Commento</div>\r\n} @else {\r\n<div mat-dialog-title> {{ firstTab }} e informazioni utili</div>\r\n<nav mat-tab-nav-bar mat-stretch-tabs [tabPanel]=\"tabPanel\">\r\n <a mat-tab-link (click)=\"dialogTab.set(1)\" [active]=\"dialogTab() === 1\">{{ firstTab }}</a>\r\n <a mat-tab-link (click)=\"dialogTab.set(2)\" [active]=\"dialogTab() === 2\">Cosa cambia</a>\r\n <a mat-tab-link (click)=\"dialogTab.set(3)\" [active]=\"dialogTab() === 3\">Sarebbe\r\n interessante<br> se l'azienda...</a>\r\n</nav>\r\n<mat-tab-nav-panel #tabPanel></mat-tab-nav-panel>\r\n}\r\n<mat-dialog-content>\r\n <!-- Commento: the analysis for the readers of the editorial comments, the editorial comment itself when the\r\n document has no analysis. The server sends no text to anybody else, and the tab says why. -->\r\n <div [hidden]=\"dialogTab() !== 1\">\r\n <!-- The first tab is reserved to the readers of the comments, «Commento» and «Sintesi» alike. -->\r\n @if (analysis() && !canReadComments()) {\r\n <div class=\"message-container\">\r\n <div class=\"message\">{{ firstTab === 'Commento' ? 'Il commento' : 'La sintesi' }} non è disponibile per questa licenza.</div>\r\n </div>\r\n } @else if (aboutHtml()) {\r\n <div class=\"analysis-text\" [innerHTML]=\"aboutHtml() | safeHtml\"></div>\r\n } @else if (commentHtml()) {\r\n <div class=\"analysis-text\" [innerHTML]=\"commentHtml() | safeHtml\"></div>\r\n } @else if (commentMessage()) {\r\n <div class=\"message-container\">\r\n <div class=\"message\">{{ commentMessage() }}</div>\r\n </div>\r\n } @else {\r\n <div class=\"message-container\">\r\n <div class=\"message\">Nessuna informazione disponibile.</div>\r\n </div>\r\n }\r\n </div>\r\n <!-- Cosa cambia: for everybody until the cut-off day, with the notice above the text - and only above a\r\n text; reserved to the readers of the comments from then on. -->\r\n <div [hidden]=\"dialogTab() !== 2\">\r\n @if (restricted && analysis() && !canReadComments()) {\r\n <div class=\"message-container\">\r\n <div class=\"message\">Le informazioni non sono disponibili per questa licenza.</div>\r\n </div>\r\n } @else if (changedHtml()) {\r\n <div class=\"notice small secondary italic\">{{ notice }}</div>\r\n <div class=\"analysis-text changes\" [innerHTML]=\"changedHtml() | safeHtml\"></div>\r\n } @else {\r\n <div class=\"message-container\">\r\n <div class=\"message\">Nessuna informazione disponibile.</div>\r\n </div>\r\n }\r\n </div>\r\n <!-- Sarebbe interessante se l'azienda: the same rule, without the notice. -->\r\n <div [hidden]=\"dialogTab() !== 3\">\r\n @if (restricted && analysis() && !canReadComments()) {\r\n <div class=\"message-container\">\r\n <div class=\"message\">Le informazioni non sono disponibili per questa licenza.</div>\r\n </div>\r\n } @else if (interestingHtml()) {\r\n <div class=\"analysis-text\" [innerHTML]=\"interestingHtml() | safeHtml\"></div>\r\n } @else {\r\n <div class=\"message-container\">\r\n <div class=\"message\">Nessuna informazione disponibile.</div>\r\n </div>\r\n }\r\n </div>\r\n</mat-dialog-content>\r\n<div mat-dialog-actions>\r\n <div fxLayout=\"row\" fxLayoutAlign=\"end\" fxFill>\r\n <button mat-stroked-button [mat-dialog-close]=\"true\">Chiudi</button>\r\n </div>\r\n</div>\r\n","import {\n ChangeDetectionStrategy,\n Component,\n inject,\n signal,\n output,\n viewChild\n} from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MAT_DIALOG_DATA, MatDialogActions, MatDialogClose, MatDialogContent, MatDialogTitle } from '@angular/material/dialog';\nimport { MatListModule, MatSelectionList } from '@angular/material/list';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { ClipperDocumentAnchorInfo, ClipperService } from '@arsedizioni/ars-utils/clipper.common';\nimport { SystemUtils } from '@arsedizioni/ars-utils/core';\nimport { FlexLayoutModule } from '@arsedizioni/ars-utils/ui';\nimport { DialogService } from '@arsedizioni/ars-utils/ui.dialogs';\nimport { finalize } from 'rxjs';\n\n\nexport interface ClipperDocumentIndexDialogData {\n documentId: string;\n excludedTypes?: number[];\n multiple?: boolean;\n}\n\nexport interface ClipperDocumentIndexDialogResult {\n data: ClipperDocumentAnchorInfo[];\n}\n\n@Component({\n host: { 'Bind': SystemUtils.generateUUID() },\n templateUrl: './document-index.component.html',\n styleUrls: ['./document-index.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n imports: [\n FlexLayoutModule,\n MatDialogTitle,\n MatDialogContent,\n MatListModule,\n MatTooltipModule,\n MatDialogActions,\n MatButtonModule,\n MatDialogClose,\n ],\n})\nexport class ClipperDocumentIndexComponent {\n readonly selection = viewChild.required<MatSelectionList>('selection');\n readonly done = output<ClipperDocumentIndexDialogResult>();\n\n private clipperService = inject(ClipperService);\n private dialogService = inject(DialogService);\n protected dialogData: ClipperDocumentIndexDialogData = inject(MAT_DIALOG_DATA);\n protected readonly items = signal<ClipperDocumentAnchorInfo[]>([]);\n protected readonly okDisabled = signal<boolean>(false);\n\n constructor() {\n if (this.dialogData?.documentId) {\n this.load();\n }\n }\n\n /**\n * Loads the document's structural index from the server and populates the item list.\n * Items whose type appears in {@link ClipperDocumentIndexDialogData.excludedTypes} are filtered out.\n * Each item's description is built from its title, or derived from its type and text when no title is set.\n */\n private load(): void {\n if (!this.clipperService.loggedIn()) return;\n this.dialogService.setBusy('Caricamento in corso...');\n this.clipperService.documents.index(this.dialogData.documentId)\n .pipe(finalize(() => this.dialogService.clearBusy()))\n .subscribe(r => {\n if (!r.success) {\n this.dialogService.error(r.message);\n return;\n }\n const result: ClipperDocumentAnchorInfo[] = [];\n r.value?.items.forEach((n: ClipperDocumentAnchorInfo) => {\n if (this.dialogData.excludedTypes && this.dialogData.excludedTypes.indexOf(n.type) !== -1) return;\n if (n.title) {\n n.description = n.title;\n } else if (n.type < 3) {\n n.description = n.text?.trim() ?? '';\n } else {\n n.description = `${n.typeDescription?.trim() ?? ''} ${n.text?.trim() ?? ''}.`;\n }\n result.push(n);\n });\n this.items.set(result);\n });\n }\n\n /**\n * Updates the OK button disabled state based on whether anything is selected in the list.\n */\n protected select(): void {\n const selected = this.selection().selectedOptions.selected;\n this.okDisabled.set(selected.length === 0);\n }\n\n /**\n * Emits the current selection as the dialog result.\n * In single-selection mode, emits the explicitly provided item.\n * In multiple-selection mode, collects all selected items from the list.\n * @param item - The directly clicked item for single-selection mode; omit for multiple-selection mode.\n */\n protected use(item?: ClipperDocumentAnchorInfo): void {\n if (this.dialogData?.multiple) {\n if (item != null) return; // Direct-click not supported in multiple-selection mode\n const selected: ClipperDocumentAnchorInfo[] = this.selection()\n .selectedOptions.selected.map(o => o.value as ClipperDocumentAnchorInfo);\n if (selected.length === 0) return;\n this.done.emit({ data: selected });\n } else if (item != null) {\n this.done.emit({ data: [item] });\n }\n }\n}\n\n","<div mat-dialog-title>Indice</div>\r\n<mat-dialog-content>\r\n @if (items().length === 0) {\r\n <div>\r\n <p class=\"message\"><i>Nessun elemento da visualizzare.</i></p>\r\n </div>\r\n } @else {\r\n <mat-selection-list dense #selection (selectionChange)=\"select();\" [multiple]=\"dialogData.multiple\"\r\n hideSingleSelectionIndicator=\"true\">\r\n @for (item of items(); track $index) {\r\n @if (item.type > 4) {\r\n <div class=\"small uppercase truncated accent\" style=\"display: flex; align-items: center; min-height: 36px;\">\r\n <div><b>{{item.description}}</b></div>\r\n </div>\r\n } @else {\r\n <mat-list-option [selected]=\"false\" [value]=\"item\" (click)=\"use(item)\">\r\n <div fxLayout=\"row\" fxLayoutGap=\"10px\" fxFill>\r\n <div [fxFlex]=\"(10 * item.level) + 'px'\"></div>\r\n <div fxFlex=\"*\" class=\"truncated\">\r\n <div class=\"small\" [matTooltip]=\"item.description\">{{item.description}}</div>\r\n </div>\r\n </div>\r\n </mat-list-option>\r\n }\r\n }\r\n </mat-selection-list>\r\n }\r\n</mat-dialog-content>\r\n<mat-dialog-actions>\r\n <div fxLayout=\"row\" fxLayoutAlign=\"end\" fxFill>\r\n @if (dialogData.multiple) {\r\n <button mat-flat-button [disabled]=\"okDisabled()\" (click)=\"use()\">Usa</button>\r\n }\r\n <button mat-stroked-button [mat-dialog-close]=\"true\" >Chiudi</button>\r\n </div>\r\n</mat-dialog-actions>","import { ChangeDetectionStrategy, ChangeDetectorRef, Component, inject, input, signal, output, viewChild } from '@angular/core';\nimport { DateInterval } from '@arsedizioni/ars-utils/core';\nimport { MatExpansionModule } from '@angular/material/expansion';\nimport { MatDividerModule } from '@angular/material/divider';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { MatButtonModule } from '@angular/material/button';\nimport { FlexLayoutModule } from '@arsedizioni/ars-utils/ui';\nimport { MatChipsModule } from '@angular/material/chips';\nimport { MatCalendar, MatCalendarCellClassFunction } from '@angular/material/datepicker';\nimport { endOfDay, endOfMonth, startOfMonth, startOfToday, subDays } from 'date-fns';\nimport { CalendarEmptyHeader } from '@arsedizioni/ars-utils/ui.controls.date';\nimport { ClipperSearchCalendarSnapshotMonth, ClipperSearchCalendarSnapshotResult } from '@arsedizioni/ars-utils/clipper.common';\n\n\n\n@Component({\n selector: 'clipper-search-calendar',\n templateUrl: './search-calendar.component.html',\n styleUrls: ['./search-calendar.component.scss'],\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n FlexLayoutModule,\n MatButtonModule,\n MatTooltipModule,\n MatCalendar,\n MatChipsModule,\n MatIconModule,\n MatDividerModule,\n MatExpansionModule\n ],\n})\nexport class ClipperSearchCalendarComponent {\n readonly calendar = viewChild.required<MatCalendar<any>>('calendar');\n readonly changed = output<DateInterval | undefined>();\n private readonly changeDetector = inject(ChangeDetectorRef);\n\n protected busy = signal<boolean>(false);\n protected months = signal<ClipperSearchCalendarSnapshotMonth[] | undefined>(undefined);\n protected calendarSpecialDays?: number[];\n protected calendarEmptyHeader = CalendarEmptyHeader;\n public calendarDate: Date = startOfToday();\n protected calendarDateClass: MatCalendarCellClassFunction<Date> = (cellDate) => {\n if (!this.calendarSpecialDays) return '';\n if (this.calendarSpecialDays[cellDate.getDate() - 1] > 0) {\n if (cellDate < startOfToday()) return 'special-date-expired';\n else if (subDays(cellDate, 15) <= startOfToday()) return 'special-date-expiring';\n else return 'special-date';\n }\n return '';\n };\n protected calendarDateFilter = (cellDate: Date): boolean => {\n return this.canFilter() && this.calendarSpecialDays != null && this.calendarSpecialDays[cellDate.getDate() - 1] > 0;\n }\n readonly canFilter = input<boolean>(false);\n\n\n /**\n * Refreshes the calendar with a new month/days snapshot and updates the active date.\n * @param month - The single-month snapshot used to populate special-day highlighting.\n * @param months - The full year snapshot used to populate the month-selector chips.\n * @param date - The date the calendar should navigate to. Defaults to today.\n */\n update(month?: ClipperSearchCalendarSnapshotResult,\n months?: ClipperSearchCalendarSnapshotResult,\n date: Date = startOfToday()): void {\n if (months?.months) {\n this.months.set(months.months);\n }\n if (month && month.months && month.months.length > 0) {\n this.calendarSpecialDays = month.months[0].days;\n }\n const calendar = this.calendar();\n if (calendar) {\n calendar.activeDate = date;\n calendar.selected = date;\n calendar.updateTodaysDate();\n }\n this.calendarDate = date;\n this.changeDetector.markForCheck();\n }\n\n\n /**\n * Emits a `DateInterval` for the given date or, when `'month'` is passed, for the entire\n * current calendar month. Passing `undefined` clears the active date filter.\n * @param date - A specific `Date` to filter by, the string `'month'` to filter the whole\n * month, or `undefined` to clear the filter.\n */\n protected filterByDate(date?: Date | string): void {\n if (date === 'month') {\n if (this.calendarDate) {\n const today = new Date();\n const start = endOfDay(startOfMonth(this.calendarDate));\n const end = endOfMonth(this.calendarDate);\n this.changed.emit(new DateInterval(start, end));\n if (start <= today && end >= today) {\n const calendar = this.calendar();\n calendar.selected = today;\n calendar.updateTodaysDate();\n }\n }\n } else if (date) {\n const d = date as Date;\n this.changed.emit(new DateInterval(endOfDay(d), endOfDay(d)));\n this.calendarDate = d;\n const calendar = this.calendar();\n calendar.selected = d;\n calendar.updateTodaysDate();\n } else {\n this.changed.emit(undefined);\n }\n }\n\n /**\n * Navigates the calendar to the given month and emits its full date range as a filter.\n * @param monthInfo - The month snapshot to navigate to and filter by.\n */\n protected filterByMonth(monthInfo: ClipperSearchCalendarSnapshotMonth): void {\n const newDate = new Date(monthInfo.year, monthInfo.month - 1, 1);\n const today = new Date();\n const start = endOfDay(startOfMonth(newDate));\n const end = endOfMonth(newDate);\n this.changed.emit(new DateInterval(start, end));\n this.calendarSpecialDays = monthInfo.days;\n const calendar = this.calendar();\n if (start <= today && end >= today) {\n calendar.selected = today;\n }\n calendar.activeDate = newDate;\n calendar.updateTodaysDate();\n this.calendarDate = newDate;\n }\n}\n","<div fxLayout=\"column\" fxFill class=\"calendar-container scroll-hidden\">\r\n <div class=\"calendar-months\">\r\n <div>\r\n <div fxLayout=\"row wrap\" fxLayoutAlign=\"center\" fxLayoutGap=\"8px\" fxFill>\r\n @for (m of months(); track $index) {\r\n <button fxFlex=\"37px\" mat-button class=\"small uppercase\" (click)=\"filterByMonth(m)\" [disabled]=\"m.total === 0\">\r\n @if (m.expired) {\r\n <span class=\"expired\" [matTooltip]=\"m.expired + ' elementi in ritardo'\">{{m.monthShortName}}</span>\r\n } @else {\r\n <span [matTooltip]=\"m.total + ' elementi'\">{{m.monthShortName}}</span>\r\n }\r\n </button>\r\n }\r\n </div>\r\n </div>\r\n <div class=\"separator\"></div>\r\n </div>\r\n <div fxFlex=\"*\" class=\"scroll-auto\">\r\n @if (!busy()) {\r\n <mat-calendar #calendar [headerComponent]=\"calendarEmptyHeader\" [dateClass]=\"calendarDateClass\"\r\n [dateFilter]=\"calendarDateFilter\" (selectedChange)=\"filterByDate($event)\" class=\"calendar-month\">\r\n </mat-calendar>\r\n <div fxLayout=\"row\" fxLayoutAlign=\"space-around\" style=\"padding:0 15px\">\r\n <button type=\"button\" mat-stroked-button (click)=\"filterByDate('month')\">Tutto il\r\n mese</button>\r\n </div>\r\n }\r\n </div>\r\n</div>"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,IAAa,+BAAb,MAAa,6BAA4B;CARzC,cAAA;EAUmB,KAAA,gBAAgB,UAA0B,iBAAgB,GAAA,YAAA,CAAA,EAAA,WAAA,gBAAA,CAAA,+BAAA,CAAA,CAAA;EAC1D,KAAA,yBAAyB,UAA0B,0BAAyB,GAAA,YAAA,CAAA,EAAA,WAAA,yBAAA,CAAA,+BAAA,CAAA,CAAA;EAC5E,KAAA,mBAAmB,UAA0B,oBAAmB,GAAA,YAAA,CAAA,EAAA,WAAA,mBAAA,CAAA,+BAAA,CAAA,CAAA;EAChE,KAAA,kBAAkB;GACjC,KAAK;GACL,KAAK;GACL,KAAK;EACN;EAEgB,KAAA,YAAY,OAAO,SAAS;EAC5B,KAAA,iBAAiB,OAAO,cAAc;EAE9C,KAAA,gBAAgB,MAAe,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,gBAAA,CAAA,+BAAA,CAAA,CAAA;EACrC,KAAA,kBAAkB,MAAgD,aAAY,GAAA,YAAA,CAAA,EAAA,WAAA,kBAAA,CAAA,+BAAA,C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