@pdftools/four-heights-pdf-web-viewer 4.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +446 -0
- package/README.md +145 -0
- package/css/pdf-web-viewer.css +2407 -0
- package/doc/PdfWebViewer.pdf +0 -0
- package/es6/common/Checkbox.d.ts +9 -0
- package/es6/common/Checkbox.js +8 -0
- package/es6/common/Color.d.ts +23 -0
- package/es6/common/Color.js +118 -0
- package/es6/common/ColorPicker.d.ts +15 -0
- package/es6/common/ColorPicker.js +46 -0
- package/es6/common/Contextbar.d.ts +6 -0
- package/es6/common/Contextbar.js +19 -0
- package/es6/common/DragMoveHandler.d.ts +51 -0
- package/es6/common/DragMoveHandler.js +175 -0
- package/es6/common/Dropdown.d.ts +36 -0
- package/es6/common/Dropdown.js +76 -0
- package/es6/common/DropdownMenu.d.ts +9 -0
- package/es6/common/DropdownMenu.js +10 -0
- package/es6/common/DropdownSeparator.d.ts +3 -0
- package/es6/common/DropdownSeparator.js +6 -0
- package/es6/common/Icon.d.ts +13 -0
- package/es6/common/Icon.js +8 -0
- package/es6/common/Loader.d.ts +3 -0
- package/es6/common/Loader.js +6 -0
- package/es6/common/RangeSlider.d.ts +17 -0
- package/es6/common/RangeSlider.js +42 -0
- package/es6/common/StrokeStylePicker.d.ts +11 -0
- package/es6/common/StrokeStylePicker.js +20 -0
- package/es6/common/StrokeWidthPicker.d.ts +11 -0
- package/es6/common/StrokeWidthPicker.js +20 -0
- package/es6/common/Toolbar.d.ts +10 -0
- package/es6/common/Toolbar.js +6 -0
- package/es6/common/ToolbarButton.d.ts +14 -0
- package/es6/common/ToolbarButton.js +21 -0
- package/es6/common/ToolbarFileButton.d.ts +15 -0
- package/es6/common/ToolbarFileButton.js +27 -0
- package/es6/common/ToolbarItemGroup.d.ts +8 -0
- package/es6/common/ToolbarItemGroup.js +12 -0
- package/es6/common/ToolbarSeparator.d.ts +3 -0
- package/es6/common/ToolbarSeparator.js +6 -0
- package/es6/common/Tools.d.ts +10 -0
- package/es6/common/Tools.js +89 -0
- package/es6/common/TooltipManager.d.ts +12 -0
- package/es6/common/TooltipManager.js +54 -0
- package/es6/common/TranslationManager.d.ts +11 -0
- package/es6/common/TranslationManager.js +61 -0
- package/es6/common/classNames.d.ts +2 -0
- package/es6/common/classNames.js +18 -0
- package/es6/common/formatDate.d.ts +1 -0
- package/es6/common/formatDate.js +1 -0
- package/es6/common/icons.d.ts +13 -0
- package/es6/common/icons.js +412 -0
- package/es6/common/utils.d.ts +2 -0
- package/es6/common/utils.js +19 -0
- package/es6/custom/history.d.ts +2 -0
- package/es6/custom/history.js +59 -0
- package/es6/index.d.ts +5 -0
- package/es6/index.js +5 -0
- package/es6/lib/hyperapp/index.d.ts +108 -0
- package/es6/lib/hyperapp/index.js +327 -0
- package/es6/modules/CanvasLayer.d.ts +32 -0
- package/es6/modules/CanvasLayer.js +83 -0
- package/es6/modules/CanvasModule.d.ts +59 -0
- package/es6/modules/CanvasModule.js +98 -0
- package/es6/modules/eraser/EraserLayer.d.ts +13 -0
- package/es6/modules/eraser/EraserLayer.js +141 -0
- package/es6/modules/eraser/EraserModule.d.ts +19 -0
- package/es6/modules/eraser/EraserModule.js +34 -0
- package/es6/modules/eraser/EraserToolbar.d.ts +10 -0
- package/es6/modules/eraser/EraserToolbar.js +30 -0
- package/es6/modules/form-fields/CheckBoxWidget.d.ts +9 -0
- package/es6/modules/form-fields/CheckBoxWidget.js +45 -0
- package/es6/modules/form-fields/ComboBoxWidget.d.ts +22 -0
- package/es6/modules/form-fields/ComboBoxWidget.js +152 -0
- package/es6/modules/form-fields/EditFormFieldLayer.d.ts +17 -0
- package/es6/modules/form-fields/EditFormFieldLayer.js +238 -0
- package/es6/modules/form-fields/FormFieldModule.d.ts +15 -0
- package/es6/modules/form-fields/FormFieldModule.js +27 -0
- package/es6/modules/form-fields/ListBoxWidget.d.ts +9 -0
- package/es6/modules/form-fields/ListBoxWidget.js +73 -0
- package/es6/modules/form-fields/RadioButtonWidget.d.ts +9 -0
- package/es6/modules/form-fields/RadioButtonWidget.js +45 -0
- package/es6/modules/form-fields/SelectListWidget.d.ts +9 -0
- package/es6/modules/form-fields/SelectListWidget.js +45 -0
- package/es6/modules/form-fields/TextBoxWidget.d.ts +9 -0
- package/es6/modules/form-fields/TextBoxWidget.js +53 -0
- package/es6/modules/form-fields/WidgetBase.d.ts +23 -0
- package/es6/modules/form-fields/WidgetBase.js +29 -0
- package/es6/modules/freetext-annotation/AddFreetextAnnotationLayer.d.ts +19 -0
- package/es6/modules/freetext-annotation/AddFreetextAnnotationLayer.js +181 -0
- package/es6/modules/freetext-annotation/AddFreetextAnnotationToolbar.d.ts +21 -0
- package/es6/modules/freetext-annotation/AddFreetextAnnotationToolbar.js +37 -0
- package/es6/modules/freetext-annotation/EditFreetextAnnotationLayer.d.ts +20 -0
- package/es6/modules/freetext-annotation/EditFreetextAnnotationLayer.js +211 -0
- package/es6/modules/freetext-annotation/EditFreetextAnnotationToolbar.d.ts +50 -0
- package/es6/modules/freetext-annotation/EditFreetextAnnotationToolbar.js +118 -0
- package/es6/modules/freetext-annotation/FreetextAnnotationModule.d.ts +28 -0
- package/es6/modules/freetext-annotation/FreetextAnnotationModule.js +58 -0
- package/es6/modules/freetext-annotation/RichTextEditor.d.ts +31 -0
- package/es6/modules/freetext-annotation/RichTextEditor.js +223 -0
- package/es6/modules/highlight-annotation/AddHighlightAnnotationLayer.d.ts +31 -0
- package/es6/modules/highlight-annotation/AddHighlightAnnotationLayer.js +289 -0
- package/es6/modules/highlight-annotation/AddHighlightAnnotationToolbar.d.ts +20 -0
- package/es6/modules/highlight-annotation/AddHighlightAnnotationToolbar.js +52 -0
- package/es6/modules/highlight-annotation/EditHighlightAnnotationLayer.d.ts +15 -0
- package/es6/modules/highlight-annotation/EditHighlightAnnotationLayer.js +104 -0
- package/es6/modules/highlight-annotation/EditHighlightAnnotationToolbar.d.ts +15 -0
- package/es6/modules/highlight-annotation/EditHighlightAnnotationToolbar.js +28 -0
- package/es6/modules/highlight-annotation/HighlightAnnotationModule.d.ts +27 -0
- package/es6/modules/highlight-annotation/HighlightAnnotationModule.js +54 -0
- package/es6/modules/image-annotations/ImageAnnotationModule.d.ts +23 -0
- package/es6/modules/image-annotations/ImageAnnotationModule.js +169 -0
- package/es6/modules/index.d.ts +13 -0
- package/es6/modules/index.js +13 -0
- package/es6/modules/ink-annotation/AddInkAnnotationLayer.d.ts +40 -0
- package/es6/modules/ink-annotation/AddInkAnnotationLayer.js +503 -0
- package/es6/modules/ink-annotation/AddInkAnnotationToolbar.d.ts +30 -0
- package/es6/modules/ink-annotation/AddInkAnnotationToolbar.js +53 -0
- package/es6/modules/ink-annotation/EditInkAnnotationLayer.d.ts +20 -0
- package/es6/modules/ink-annotation/EditInkAnnotationLayer.js +137 -0
- package/es6/modules/ink-annotation/EditInkAnnotationToolbar.d.ts +25 -0
- package/es6/modules/ink-annotation/EditInkAnnotationToolbar.js +47 -0
- package/es6/modules/ink-annotation/InkAnnotationModule.d.ts +27 -0
- package/es6/modules/ink-annotation/InkAnnotationModule.js +50 -0
- package/es6/modules/popup/Popup.d.ts +64 -0
- package/es6/modules/popup/Popup.js +360 -0
- package/es6/modules/popup/PopupLayer.d.ts +31 -0
- package/es6/modules/popup/PopupLayer.js +509 -0
- package/es6/modules/popup/PopupModule.d.ts +16 -0
- package/es6/modules/popup/PopupModule.js +25 -0
- package/es6/modules/print-service/PrintServiceDialog.d.ts +30 -0
- package/es6/modules/print-service/PrintServiceDialog.js +134 -0
- package/es6/modules/print-service/PrintServiceLayer.d.ts +24 -0
- package/es6/modules/print-service/PrintServiceLayer.js +310 -0
- package/es6/modules/print-service/PrintServiceModule.d.ts +18 -0
- package/es6/modules/print-service/PrintServiceModule.js +30 -0
- package/es6/modules/shape-annotations/AddShapeAnnotationLayer.d.ts +24 -0
- package/es6/modules/shape-annotations/AddShapeAnnotationLayer.js +210 -0
- package/es6/modules/shape-annotations/AddShapeAnnotationToolbar.d.ts +26 -0
- package/es6/modules/shape-annotations/AddShapeAnnotationToolbar.js +69 -0
- package/es6/modules/shape-annotations/EditShapeAnnotationLayer.d.ts +19 -0
- package/es6/modules/shape-annotations/EditShapeAnnotationLayer.js +148 -0
- package/es6/modules/shape-annotations/EditShapeAnnotationToolbar.d.ts +24 -0
- package/es6/modules/shape-annotations/EditShapeAnnotationToolbar.js +57 -0
- package/es6/modules/shape-annotations/ShapeAnnotationModule.d.ts +28 -0
- package/es6/modules/shape-annotations/ShapeAnnotationModule.js +50 -0
- package/es6/modules/stamp-annotation/AddStampAnnotationLayer.d.ts +19 -0
- package/es6/modules/stamp-annotation/AddStampAnnotationLayer.js +257 -0
- package/es6/modules/stamp-annotation/AddStampAnnotationToolbar.d.ts +17 -0
- package/es6/modules/stamp-annotation/AddStampAnnotationToolbar.js +68 -0
- package/es6/modules/stamp-annotation/StampAnnotationModule.d.ts +20 -0
- package/es6/modules/stamp-annotation/StampAnnotationModule.js +35 -0
- package/es6/modules/text-annotation/AddTextAnnotationLayer.d.ts +14 -0
- package/es6/modules/text-annotation/AddTextAnnotationLayer.js +132 -0
- package/es6/modules/text-annotation/AddTextAnnotationToolbar.d.ts +15 -0
- package/es6/modules/text-annotation/AddTextAnnotationToolbar.js +27 -0
- package/es6/modules/text-annotation/TextAnnotationModule.d.ts +19 -0
- package/es6/modules/text-annotation/TextAnnotationModule.js +34 -0
- package/es6/pdf-viewer-api/ImageContainer.d.ts +10 -0
- package/es6/pdf-viewer-api/ImageContainer.js +43 -0
- package/es6/pdf-viewer-api/PdfViewerApi.d.ts +463 -0
- package/es6/pdf-viewer-api/PdfViewerApi.js +732 -0
- package/es6/pdf-viewer-api/PdfViewingWrapper.d.ts +178 -0
- package/es6/pdf-viewer-api/PdfViewingWrapper.js +2037 -0
- package/es6/pdf-viewer-api/annotationDefaultBehaviors.d.ts +3 -0
- package/es6/pdf-viewer-api/annotationDefaultBehaviors.js +30 -0
- package/es6/pdf-viewer-api/enums.d.ts +100 -0
- package/es6/pdf-viewer-api/enums.js +113 -0
- package/es6/pdf-viewer-api/index.d.ts +3 -0
- package/es6/pdf-viewer-api/index.js +3 -0
- package/es6/pdf-viewer-api/types.d.ts +284 -0
- package/es6/pdf-viewer-api/types.js +6 -0
- package/es6/pdf-viewer-canvas/CanvasEvents.d.ts +76 -0
- package/es6/pdf-viewer-canvas/CanvasEvents.js +345 -0
- package/es6/pdf-viewer-canvas/PdfViewerCanvas.d.ts +175 -0
- package/es6/pdf-viewer-canvas/PdfViewerCanvas.js +1226 -0
- package/es6/pdf-viewer-canvas/state/annotations.d.ts +36 -0
- package/es6/pdf-viewer-canvas/state/annotations.js +157 -0
- package/es6/pdf-viewer-canvas/state/appState.d.ts +10 -0
- package/es6/pdf-viewer-canvas/state/appState.js +60 -0
- package/es6/pdf-viewer-canvas/state/canvas.d.ts +31 -0
- package/es6/pdf-viewer-canvas/state/canvas.js +41 -0
- package/es6/pdf-viewer-canvas/state/document.d.ts +50 -0
- package/es6/pdf-viewer-canvas/state/document.js +99 -0
- package/es6/pdf-viewer-canvas/state/pointer.d.ts +31 -0
- package/es6/pdf-viewer-canvas/state/pointer.js +31 -0
- package/es6/pdf-viewer-canvas/state/scroll.d.ts +22 -0
- package/es6/pdf-viewer-canvas/state/scroll.js +25 -0
- package/es6/pdf-viewer-canvas/state/search.d.ts +36 -0
- package/es6/pdf-viewer-canvas/state/search.js +27 -0
- package/es6/pdf-viewer-canvas/state/store.d.ts +39 -0
- package/es6/pdf-viewer-canvas/state/store.js +52 -0
- package/es6/pdf-viewer-canvas/state/viewer.d.ts +91 -0
- package/es6/pdf-viewer-canvas/state/viewer.js +175 -0
- package/es6/pdf-viewer-canvas/view-layers/AnnotationSelectionLayer.d.ts +28 -0
- package/es6/pdf-viewer-canvas/view-layers/AnnotationSelectionLayer.js +452 -0
- package/es6/pdf-viewer-canvas/view-layers/BusyStateLayer.d.ts +9 -0
- package/es6/pdf-viewer-canvas/view-layers/BusyStateLayer.js +25 -0
- package/es6/pdf-viewer-canvas/view-layers/PdfDocumentLayer.d.ts +10 -0
- package/es6/pdf-viewer-canvas/view-layers/PdfDocumentLayer.js +149 -0
- package/es6/pdf-viewer-canvas/view-layers/ScrollLayer.d.ts +48 -0
- package/es6/pdf-viewer-canvas/view-layers/ScrollLayer.js +308 -0
- package/es6/pdf-viewer-canvas/view-layers/TextSelectionLayer.d.ts +19 -0
- package/es6/pdf-viewer-canvas/view-layers/TextSelectionLayer.js +289 -0
- package/es6/pdf-viewer-canvas/view-layers/ViewLayerBase.d.ts +31 -0
- package/es6/pdf-viewer-canvas/view-layers/ViewLayerBase.js +106 -0
- package/es6/pdf-viewer-canvas/view-layers/canvasShapes.d.ts +11 -0
- package/es6/pdf-viewer-canvas/view-layers/canvasShapes.js +149 -0
- package/es6/pdf-viewer-canvas/view-layers/canvasUtlis.d.ts +3 -0
- package/es6/pdf-viewer-canvas/view-layers/canvasUtlis.js +10 -0
- package/es6/pdf-viewer-canvas/view-layers/views/AnnotationBorder.d.ts +52 -0
- package/es6/pdf-viewer-canvas/view-layers/views/AnnotationBorder.js +377 -0
- package/es6/pdf-viewer-canvas/view-layers/views/AnnotationContextBar.d.ts +47 -0
- package/es6/pdf-viewer-canvas/view-layers/views/AnnotationContextBar.js +102 -0
- package/es6/pdf-viewer-canvas/view-layers/views/TextSelectionContextBar.d.ts +14 -0
- package/es6/pdf-viewer-canvas/view-layers/views/TextSelectionContextBar.js +36 -0
- package/es6/pdf-viewing/PdfViewing.d.ts +4865 -0
- package/es6/pdf-viewing/PdfViewing.js +9611 -0
- package/es6/pdf-web-viewer/PdfWebViewer.d.ts +372 -0
- package/es6/pdf-web-viewer/PdfWebViewer.js +1386 -0
- package/es6/pdf-web-viewer/UserSettings.d.ts +8 -0
- package/es6/pdf-web-viewer/UserSettings.js +40 -0
- package/es6/pdf-web-viewer/WebViewerOptions.d.ts +387 -0
- package/es6/pdf-web-viewer/WebViewerOptions.js +582 -0
- package/es6/pdf-web-viewer/state/index.d.ts +80 -0
- package/es6/pdf-web-viewer/state/index.js +98 -0
- package/es6/pdf-web-viewer/state/layout.d.ts +24 -0
- package/es6/pdf-web-viewer/state/layout.js +21 -0
- package/es6/pdf-web-viewer/state/mobile.d.ts +16 -0
- package/es6/pdf-web-viewer/state/mobile.js +11 -0
- package/es6/pdf-web-viewer/state/navigationPanel.d.ts +61 -0
- package/es6/pdf-web-viewer/state/navigationPanel.js +84 -0
- package/es6/pdf-web-viewer/state/passwordForm.d.ts +18 -0
- package/es6/pdf-web-viewer/state/passwordForm.js +21 -0
- package/es6/pdf-web-viewer/state/pdfDocument.d.ts +31 -0
- package/es6/pdf-web-viewer/state/pdfDocument.js +41 -0
- package/es6/pdf-web-viewer/state/search.d.ts +29 -0
- package/es6/pdf-web-viewer/state/search.js +23 -0
- package/es6/pdf-web-viewer/views/App.d.ts +4 -0
- package/es6/pdf-web-viewer/views/App.js +19 -0
- package/es6/pdf-web-viewer/views/CustomButtons.d.ts +9 -0
- package/es6/pdf-web-viewer/views/CustomButtons.js +18 -0
- package/es6/pdf-web-viewer/views/DropZone.d.ts +9 -0
- package/es6/pdf-web-viewer/views/DropZone.js +53 -0
- package/es6/pdf-web-viewer/views/Layout.d.ts +4 -0
- package/es6/pdf-web-viewer/views/Layout.js +22 -0
- package/es6/pdf-web-viewer/views/annotationbar/Annotationbar.d.ts +4 -0
- package/es6/pdf-web-viewer/views/annotationbar/Annotationbar.js +21 -0
- package/es6/pdf-web-viewer/views/appbar/AddonsToolbar.d.ts +4 -0
- package/es6/pdf-web-viewer/views/appbar/AddonsToolbar.js +35 -0
- package/es6/pdf-web-viewer/views/appbar/AnnotationsMenu.d.ts +4 -0
- package/es6/pdf-web-viewer/views/appbar/AnnotationsMenu.js +22 -0
- package/es6/pdf-web-viewer/views/appbar/AppBar.d.ts +4 -0
- package/es6/pdf-web-viewer/views/appbar/AppBar.js +26 -0
- package/es6/pdf-web-viewer/views/appbar/DocumentBar.d.ts +4 -0
- package/es6/pdf-web-viewer/views/appbar/DocumentBar.js +36 -0
- package/es6/pdf-web-viewer/views/appbar/Menu.d.ts +4 -0
- package/es6/pdf-web-viewer/views/appbar/Menu.js +80 -0
- package/es6/pdf-web-viewer/views/appbar/NavigationBar.d.ts +4 -0
- package/es6/pdf-web-viewer/views/appbar/NavigationBar.js +74 -0
- package/es6/pdf-web-viewer/views/appbar/SearchBar.d.ts +4 -0
- package/es6/pdf-web-viewer/views/appbar/SearchBar.js +83 -0
- package/es6/pdf-web-viewer/views/appbar/SearchOptions.d.ts +10 -0
- package/es6/pdf-web-viewer/views/appbar/SearchOptions.js +55 -0
- package/es6/pdf-web-viewer/views/appbar/ViewBar.d.ts +4 -0
- package/es6/pdf-web-viewer/views/appbar/ViewBar.js +52 -0
- package/es6/pdf-web-viewer/views/appbar/ZoomBar.d.ts +4 -0
- package/es6/pdf-web-viewer/views/appbar/ZoomBar.js +18 -0
- package/es6/pdf-web-viewer/views/modal/ApplicationError.d.ts +4 -0
- package/es6/pdf-web-viewer/views/modal/ApplicationError.js +25 -0
- package/es6/pdf-web-viewer/views/modal/LoadApplication.d.ts +3 -0
- package/es6/pdf-web-viewer/views/modal/LoadApplication.js +6 -0
- package/es6/pdf-web-viewer/views/modal/LoadFile.d.ts +3 -0
- package/es6/pdf-web-viewer/views/modal/LoadFile.js +10 -0
- package/es6/pdf-web-viewer/views/modal/Modal.d.ts +4 -0
- package/es6/pdf-web-viewer/views/modal/Modal.js +39 -0
- package/es6/pdf-web-viewer/views/modal/OpenFile.d.ts +4 -0
- package/es6/pdf-web-viewer/views/modal/OpenFile.js +30 -0
- package/es6/pdf-web-viewer/views/modal/OpenFileError.d.ts +4 -0
- package/es6/pdf-web-viewer/views/modal/OpenFileError.js +13 -0
- package/es6/pdf-web-viewer/views/modal/PasswordForm.d.ts +4 -0
- package/es6/pdf-web-viewer/views/modal/PasswordForm.js +54 -0
- package/es6/pdf-web-viewer/views/modal/SaveFile.d.ts +4 -0
- package/es6/pdf-web-viewer/views/modal/SaveFile.js +10 -0
- package/es6/pdf-web-viewer/views/modal/UnsavedChanges.d.ts +4 -0
- package/es6/pdf-web-viewer/views/modal/UnsavedChanges.js +32 -0
- package/es6/pdf-web-viewer/views/navigation/AnnotationList.d.ts +8 -0
- package/es6/pdf-web-viewer/views/navigation/AnnotationList.js +26 -0
- package/es6/pdf-web-viewer/views/navigation/AnnotationListItem.d.ts +8 -0
- package/es6/pdf-web-viewer/views/navigation/AnnotationListItem.js +158 -0
- package/es6/pdf-web-viewer/views/navigation/AnnotationNavigation.d.ts +4 -0
- package/es6/pdf-web-viewer/views/navigation/AnnotationNavigation.js +11 -0
- package/es6/pdf-web-viewer/views/navigation/NavigationPanel.d.ts +4 -0
- package/es6/pdf-web-viewer/views/navigation/NavigationPanel.js +50 -0
- package/es6/pdf-web-viewer/views/navigation/OutlineList.d.ts +12 -0
- package/es6/pdf-web-viewer/views/navigation/OutlineList.js +19 -0
- package/es6/pdf-web-viewer/views/navigation/OutlineNavigation.d.ts +4 -0
- package/es6/pdf-web-viewer/views/navigation/OutlineNavigation.js +10 -0
- package/es6/pdf-web-viewer/views/navigation/ThumbnailNavigation.d.ts +16 -0
- package/es6/pdf-web-viewer/views/navigation/ThumbnailNavigation.js +32 -0
- package/package.json +24 -0
- package/pdfwebviewer/PdfViewing.data +0 -0
- package/pdfwebviewer/PdfViewing_Main.js +1 -0
- package/pdfwebviewer/PdfViewing_Main.wasm +0 -0
- package/pdfwebviewer/PdfViewing_Worker.js +1 -0
- package/pdfwebviewer/PdfViewing_Worker.wasm +0 -0
- package/pdfwebviewer/pdf-web-viewer.css +2407 -0
- package/pdfwebviewer/pdf-web-viewer.development.js +25955 -0
- package/pdfwebviewer/pdf-web-viewer.min.js +1 -0
- package/pdfwebviewer/translations.de.json +151 -0
- package/pdfwebviewer/translations.en.json +151 -0
- package/pdfwebviewer/translations.fr.json +151 -0
- package/pdfwebviewer/translations.it.json +151 -0
- package/scss/common/_breakpoints.scss +44 -0
- package/scss/common/_buttons.scss +42 -0
- package/scss/common/_colorpicker.scss +89 -0
- package/scss/common/_common.scss +21 -0
- package/scss/common/_contextbar.scss +44 -0
- package/scss/common/_dropdown.scss +176 -0
- package/scss/common/_icon.scss +9 -0
- package/scss/common/_index.scss +19 -0
- package/scss/common/_loader.scss +30 -0
- package/scss/common/_rangeslider.scss +24 -0
- package/scss/common/_scrollbars.scss +64 -0
- package/scss/common/_stroke-style-picker.scss +64 -0
- package/scss/common/_stroke-width-picker.scss +23 -0
- package/scss/common/_toolbar.scss +117 -0
- package/scss/common/_tooltip.scss +39 -0
- package/scss/modules/_eraser.scss +28 -0
- package/scss/modules/_forms.scss +56 -0
- package/scss/modules/_highlightannotation.scss +12 -0
- package/scss/modules/_index.scss +5 -0
- package/scss/modules/_inkannotation.scss +41 -0
- package/scss/modules/_stampannotation.scss +19 -0
- package/scss/pdf-viewer-canvas/_annotationborder.scss +107 -0
- package/scss/pdf-viewer-canvas/_busy-loader.scss +53 -0
- package/scss/pdf-viewer-canvas/_freetexteditor.scss +28 -0
- package/scss/pdf-viewer-canvas/_index.scss +7 -0
- package/scss/pdf-viewer-canvas/_layout.scss +52 -0
- package/scss/pdf-viewer-canvas/_popup.scss +217 -0
- package/scss/pdf-viewer-canvas/_printservice.scss +171 -0
- package/scss/pdf-viewer-canvas/_textselection.scss +17 -0
- package/scss/pdf-web-viewer/_annotationbar.scss +47 -0
- package/scss/pdf-web-viewer/_index.scss +8 -0
- package/scss/pdf-web-viewer/_layout.scss +63 -0
- package/scss/pdf-web-viewer/_modal.scss +186 -0
- package/scss/pdf-web-viewer/_navigationpanel.scss +398 -0
- package/scss/pdf-web-viewer/_searchbar.scss +47 -0
- package/scss/pdf-web-viewer/_toolbar.scss +134 -0
- package/scss/pdf-web-viewer/_viewer.scss +54 -0
- package/scss/pdf-web-viewer.scss +1 -0
- package/scss/themes/default/_light.scss +32 -0
- package/scss/themes/default/_mixins.scss +129 -0
- package/scss/themes/default/_theme.scss +161 -0
- package/scss/themes/pdf-web-viewer.scss +1 -0
- package/umd/pdf-web-viewer.development.js +25955 -0
- package/umd/pdf-web-viewer.development.js.map +1 -0
- package/umd/pdf-web-viewer.min.js +1 -0
- package/wasm/PdfViewing.data +0 -0
- package/wasm/PdfViewing_Main.js +1 -0
- package/wasm/PdfViewing_Main.wasm +0 -0
- package/wasm/PdfViewing_Worker.js +1 -0
- package/wasm/PdfViewing_Worker.wasm +0 -0
- package/wasm/translations.de.json +151 -0
- package/wasm/translations.en.json +151 -0
- package/wasm/translations.fr.json +151 -0
- package/wasm/translations.it.json +151 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pdf-web-viewer.development.js","mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;;;;;;;;;;;;;;;;;;;ACVA,iBAAiB,SAAI,IAAI,SAAI;AAC7B,4BAA4B,+DAA+D,iBAAiB;AAC5G;AACA,oCAAoC,MAAM,+BAA+B,YAAY;AACrF,mCAAmC,MAAM,mCAAmC,YAAY;AACxF,gCAAgC;AAChC;AACA,KAAK;AACL;AACA,qBAAqB,SAAI,IAAI,SAAI;AACjC;AACA;AACA,2GAA2G,uFAAuF,cAAc;AAChN,uBAAuB,8BAA8B,gDAAgD,wDAAwD;AAC7J,6CAA6C,sCAAsC,UAAU,mBAAmB,IAAI;AACpH;AAC4K;AACxI;AACsC;AACnB;AACL;AAC3C;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,8EAAyB,MAAM,2EAAsB;AAC7D;AACA;AACA,+BAA+B,qFAAgC;AAC/D,iCAAiC,gFAA2B;AAC5D;AACA,gCAAgC,sFAAiC;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,gDAAY;AACzC;AACA;AACA;AACA,4BAA4B,OAAO;AACnC;AACA,0CAA0C,8EAAyB;AACnE;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,oCAAoC,8DAA8D;AAClG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,2EAAsB;AACrD;AACA;AACA;AACA;AACA;AACA,2DAA2D,gDAAY;AACvE,sCAAsC,oFAA+B;AACrE;AACA;AACA,2DAA2D,gDAAY;AACvE;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,+EAA0B;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,sGAAiD;AAC1G;AACA;AACA,gDAAgD,yFAAoC;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,iFAA4B;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,gBAAgB,uCAAuC;AACvD,iCAAiC,+EAA0B;AAC3D;AACA,iBAAiB,gDAAY;AAC7B,wCAAwC,+EAA0B;AAClE;AACA;AACA,wCAAwC,+EAA0B;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,iCAAiC,gGAA2C;AAC5E;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6EAA6E,yBAAyB;AACtG;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,+BAA+B;AAChF;AACA;AACA;AACA;AACA,0FAA0F,oEAAoE;AAC9J;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,QAAQ;AACxC;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA,0FAA0F,oEAAoE;AAC9J;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,kBAAkB,IAAI,WAAW;AACtE;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,gCAAgC,QAAQ;AACxC;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA,aAAa;AACb;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,SAAS,IAAI,WAAW;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,0FAAqC;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,yFAAoC;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,iFAA4B;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,oDAAoD,KAAK;AACzD;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,0CAA0C,+DAA2B;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA,YAAY,8EAAyB,MAAM,2EAAsB;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,qFAAgC;AAC/C;AACA;AACA;AACA;AACA,sBAAsB,uDAAmB;AACzC,0BAA0B,6FAAwC;AAClE,4BAA4B,6DAAyB;AACrD;AACA,0BAA0B,0FAAqC;AAC/D,4BAA4B,0DAAsB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,0FAAqC;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,6FAAwC;AACxE;AACA;AACA;AACA,wBAAwB,WAAW;AACnC;AACA;AACA,wCAAwC,uBAAuB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,yDAAyD;AACzF;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,6FAAwC;AAC7E,mCAAmC,6FAAwC;AAC3E;AACA;AACA;AACA,wBAAwB,WAAW;AACnC;AACA;AACA,wCAAwC,uBAAuB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,6FAAwC;AAC7E,mCAAmC,6FAAwC;AAC3E;AACA;AACA;AACA,wBAAwB,WAAW;AACnC;AACA;AACA,wCAAwC,uBAAuB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,6FAAwC;AAC7E,mCAAmC,6FAAwC;AAC3E;AACA;AACA;AACA,wBAAwB,OAAO;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,6FAAwC;AAC7E,mCAAmC,6FAAwC;AAC3E;AACA;AACA;AACA,wBAAwB,OAAO;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,sBAAsB;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,sGAAiD;AACpF;AACA;AACA;AACA;AACA;AACA,wCAAwC,iGAA4C;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,oBAAoB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,iEAAiE,KAAK,IAAI,IAAI;AAC9E;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,uEAAuE,IAAI,UAAU,IAAI;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,2EAAsB;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,mBAAmB,iBAAiB,GAAG,iBAAiB,GAAG;AAC3D,oBAAoB,kBAAkB,GAAG,kBAAkB,GAAG,kBAAkB,EAAE,wBAAwB,gCAAgC;;AAE1I;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,2BAA2B;AACnF;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,aAAa;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,qGAAgD;AAC1E,2BAA2B,gGAA2C;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,iGAA4C;AACrE;AACA;AACA,yCAAyC,6FAAwC;AACjF,uBAAuB,iGAA4C;AACnE;AACA,uBAAuB,+FAA0C,0EAA0E,gGAA2C;AACtL;AACA,uBAAuB,0GAAqD;AAC5E;AACA,uBAAuB,wGAAmD;AAC1E;AACA,uBAAuB,gGAA2C;AAClE;AACA,uBAAuB,gGAA2C;AAClE;AACA,uBAAuB,+FAA0C;AACjE;AACA,uBAAuB,oGAA+C;AACtE;AACA;AACA,2BAA2B,sGAAiD,6EAA6E,gGAA2C;AACpM;AACA;AACA,2BAA2B,uGAAkD,0DAA0D,gGAA2C;AAClL;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,sFAAiC;AAClE;AACA,wCAAwC,+FAA0C;AAClF,oCAAoC,oBAAoB;AACxD,2CAA2C,uFAAkC;AAC7E,wCAAwC,uBAAuB;AAC/D,+CAA+C,uFAAkC;AACjF;AACA;AACA;AACA;AACA,uBAAuB,oGAA+C;AACtE;AACA,2EAA2E,cAAc;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,sCAAsC,mGAA8C;AACpF,wBAAwB,2BAA2B;AACnD;AACA,sCAAsC,qGAAgD,mBAAmB,uFAAkC,sCAAsC,uFAAkC,wCAAwC,uFAAkC,kCAAkC,uFAAkC;AACjW;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,qGAAgD;AACvE;AACA,uBAAuB,uGAAkD;AACzE;AACA,uBAAuB,qGAAgD;AACvE;AACA,uBAAuB,yGAAoD;AAC3E;AACA,uBAAuB,qGAAgD;AACvE;AACA;AACA;AACA;AACA,iBAAiB,qGAAgD;AACjE;AACA,iBAAiB,uGAAkD;AACnE;AACA,iBAAiB,qGAAgD;AACjE;AACA,iBAAiB,yGAAoD;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,sDAAkB;AACpD;AACA;AACA;AACA,iBAAiB;AACjB;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,iGAA4C;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,iGAA4C;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,oDAAgB;AAC1D;AACA;AACA;AACA,0CAA0C,yDAAqB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,mDAAe;AACzD;AACA;AACA;AACA,gCAAgC,mBAAmB;AACnD;AACA;AACA;AACA;AACA,gCAAgC,OAAO;AACvC,gCAAgC,WAAW;AAC3C;AACA;AACA;AACA;AACA;AACA,qDAAqD,wFAAmC,kCAAkC,sGAAiD;AAC3K;AACA;AACA;AACA,qDAAqD,wFAAmC,kCAAkC,sGAAiD;AAC3K;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,sDAAkB,sBAAsB,sDAAkB;AACpG;AACA,gCAAgC,mBAAmB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,yDAAqB;AAC/D,0CAA0C,wDAAoB;AAC9D,0CAA0C,0DAAsB;AAChE,0CAA0C,yDAAqB;AAC/D;AACA;AACA;AACA,0CAA0C,qDAAiB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,aAAa;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,qBAAqB;AACrB;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,qFAAgC;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,qFAAgC;AACnD;AACA;AACA;AACA;AACA,gCAAgC,8DAA0B;AAC1D;AACA,6BAA6B,gGAA2C;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,gGAA2C;AAC3F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,gGAA2C;AAC3F;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,0FAAqC;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,0FAAqC;AACtE;AACA,oCAAoC,oDAAgB;AACpD;AACA,sCAAsC,wFAAmC;AACzE,oCAAoC,yDAAqB;AACzD;AACA;AACA;AACA;AACA,oNAAoN,sBAAsB,eAAe,OAAO,mBAAmB;AACnR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,mGAA8C;AACpF;AACA,yCAAyC,sDAAkB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,iGAA4C;AAClF;AACA,yCAAyC,sDAAkB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,iGAA4C;AAClF,oCAAoC,uDAAmB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,kGAA6C;AACnF,oCAAoC,yDAAqB;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,0FAAqC;AAC3E;AACA;AACA;AACA;AACA,wCAAwC,+BAA+B;AACvE;AACA;AACA;AACA,qCAAqC,yFAAoC;AACzE,8CAA8C,yDAAqB;AACnE;AACA,0CAA0C,yFAAoC;AAC9E,8CAA8C,yDAAqB;AACnE;AACA,0CAA0C,wFAAmC;AAC7E,8CAA8C,wDAAoB;AAClE;AACA,0CAA0C,6FAAwC;AAClF,8CAA8C,0DAAsB;AACpE;AACA;AACA,sCAAsC,qFAAgC;AACtE;AACA,sCAAsC,qDAAiB;AACvD;AACA;AACA,sCAAsC,0FAAqC;AAC3E;AACA;AACA,sCAAsC,6FAAwC;AAC9E;AACA;AACA,oCAAoC,mDAAe;AACnD;AACA;AACA;AACA,2BAA2B,+DAA2B;AACtD;AACA;AACA,wBAAwB,WAAW;AACnC;AACA,gCAAgC,mBAAmB;AACnD;AACA,4CAA4C,sGAAiD;AAC7F;AACA;AACA;AACA,kCAAkC,0BAA0B;AAC5D;AACA,iDAAiD,sGAAiD;AAClG,gFAAgF,0BAA0B;AAC1G;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,qFAAgC;AACtE;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,oFAA+B;AACjE,gCAAgC,oDAAgB;AAChD;AACA;AACA;AACA,iCAAiC,uFAAkC;AACnE;AACA,uCAAuC,qDAAiB;AACxD;AACA,sCAAsC,4FAAuC;AAC7E;AACA,uCAAuC,uDAAmB;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,gFAA2B;AAC7D;AACA;AACA,mCAAmC,sDAAkB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,kFAA6B;AAC9D,yCAAyC,wDAAoB;AAC7D;AACA,sCAAsC,qFAAgC;AACtE,yCAAyC,2DAAuB;AAChE;AACA,sCAAsC,iFAA4B;AAClE,yCAAyC,uDAAmB;AAC5D;AACA,sCAAsC,iFAA4B;AAClE,yCAAyC,uDAAmB;AAC5D;AACA,sCAAsC,kFAA6B;AACnE,yCAAyC,wDAAoB;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,wDAAwD;AAC5E;AACA;AACA;AACA,kBAAkB,qFAAgC,GAAG,uFAAkC;AACvF;AACA;AACA;AACA;AACA;AACA,kCAAkC,qFAAgC,GAAG,uFAAkC;AACvG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,mFAA0B;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,uFAAkC;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,eAAe;AAC/C;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,wGAAmD;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,mGAA8C;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,0FAAqC;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,0FAAqC;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,wEAAwE;AACxG;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,6EAAwB;AAC7D,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0HAA0H,6FAAwC;AAClK;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6HAA6H,iGAA4C;AACzK;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,8FAAyC;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uEAAuE,6FAAwC;AAC/G,uEAAuE,6FAAwC;AAC/G,uEAAuE,6FAAwC;AAC/G,uEAAuE,6FAAwC;AAC/G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,oBAAoB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D,+EAA0B;AACvF;AACA,gBAAgB,4CAA4C;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,+EAA0B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,uGAAkD;AACnE,uBAAuB,gEAA4B;AACnD,iBAAiB,wGAAmD;AACpE,uBAAuB,iEAA6B;AACpD,iBAAiB,2GAAsD;AACvE,uBAAuB,qEAAiC;AACxD,iBAAiB,4GAAuD;AACxE,uBAAuB,sEAAkC;AACzD,iBAAiB,yGAAoD;AACrE,uBAAuB,mEAA+B;AACtD,iBAAiB,0GAAqD;AACtE,uBAAuB,oEAAgC;AACvD;AACA,uBAAuB,gEAA4B;AACnD;AACA;AACA;AACA;AACA,iBAAiB,gEAA4B;AAC7C,uBAAuB,uGAAkD;AACzE,iBAAiB,iEAA6B;AAC9C,uBAAuB,wGAAmD;AAC1E,iBAAiB,qEAAiC;AAClD,uBAAuB,2GAAsD;AAC7E,iBAAiB,sEAAkC;AACnD,uBAAuB,4GAAuD;AAC9E,iBAAiB,mEAA+B;AAChD,uBAAuB,yGAAoD;AAC3E,iBAAiB,oEAAgC;AACjD,uBAAuB,0GAAqD;AAC5E,iBAAiB,gEAA4B;AAC7C;AACA,uBAAuB,uGAAkD;AACzE;AACA;AACA;AACA;AACA,iBAAiB,mDAAe;AAChC,uBAAuB,2FAAsC;AAC7D,iBAAiB,uDAAmB;AACpC,uBAAuB,8FAAyC;AAChE,iBAAiB,wDAAoB;AACrC,uBAAuB,+FAA0C;AACjE;AACA,uBAAuB,2FAAsC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,4BAA4B;AACxD,wBAAwB,8BAA8B;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,yBAAyB;AACzD,gCAAgC,iBAAiB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,2FAAsC;AAC/F,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,2DAAc;AAC9D;AACA;AACA;AACA;AACA,eAAe,2EAAsB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;AC38DuD;AACjB;AACJ;AACkB;AACC;AACkB;AAClB;AACG;AACU;AACR;AAC+B;AACnC;AAC/C;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA,2BAA2B,gEAAgB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,0EAAsB;AAC9B,6BAA6B,yDAAW;AACxC;AACA,cAAc,4DAAiB;AAC/B,cAAc,6DAAkB;AAChC;AACA,oCAAoC,8CAAG,gBAAgB,iDAAO,EAAE,2CAAG;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA,gBAAgB;AAChB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,+DAAY,GAAG,+DAAY;AAChE,8BAA8B,UAAU;AACxC;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,2EAAsB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,sEAAsE;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,2FAAmC;AAClF;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,4CAA4C,+EAAe;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,4BAA4B;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mEAAmE,gBAAgB;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,2DAAgB;AACzC,uBAAuB,2DAAgB;AACvC;AACA,yBAAyB,4DAAiB;AAC1C,uBAAuB,4DAAiB;AACxC;AACA,mBAAmB,2DAAgB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,YAAY;AAC5B;AACA,qCAAqC,mEAAmB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,gBAAgB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,gBAAgB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,gBAAgB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,eAAe;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,eAAe;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,eAAe;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,eAAe;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,UAAU;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,UAAU;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,UAAU;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,UAAU;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,yBAAyB;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,iBAAiB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yFAAyF,QAAQ,kFAAkF;AACnL;AACA;AACA;AACA,kDAAkD,uEAA0B;AAC5E;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,4BAA4B,gBAAgB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,oDAAoD;AACnG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,kBAAkB;AACtC;AACA,yFAAyF,KAAK;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,sCAAsC;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,kBAAkB;AACtC;AACA,0FAA0F,cAAc;AACxG;AACA,yCAAyC,oBAAoB;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,kBAAkB;AACtC;AACA;AACA,8FAA8F,cAAc;AAC5G;AACA,6CAA6C,oBAAoB;AACjE;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,+DAAe;AACvC;AACA,sHAAsH,+DAAe;AACrI,mDAAmD,EAAE,IAAI,qCAAqC,wBAAwB,+DAAe,IAAI;AACzI,iDAAiD,iCAAiC,+DAAe,KAAK;AACtG;AACA;AACA,aAAa;AACb,wBAAwB,+DAAe;AACvC;AACA;AACA,qDAAqD,+DAAe;AACpE,kDAAkD,GAAG,kBAAkB,+DAAe,IAAI,WAAW,+DAAe,KAAK,kBAAkB,EAAE;AAC7I;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;ACnqCO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,QAAQ,GAAG,QAAQ,GAAG,QAAQ;AACpD;AACA;AACA,uBAAuB,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO;AAC/D;AACA;AACA,mBAAmB,oBAAoB,EAAE,oBAAoB,EAAE,oBAAoB;AACnF;AACA;AACA,mBAAmB,oBAAoB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,oBAAoB;AACzG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;ACpHoC;AACM;AACF;AACO;AACjB;AACoB;AAC3C,uBAAuB,2EAA2E;AACzG,gEAAgE,gDAAK;AACrE;AACA,eAAe,gDAAC,uBAAuB,6DAA6D;AACpG;AACA;AACA,gBAAgB,gDAAC,wBAAwB,mGAAmG;AAC5I;AACA;AACA,+BAA+B,mDAAmD;AAClF;AACA,gBAAgB,gDAAC,UAAU,oEAAoE;AAC/F,YAAY,gDAAC,2BAA2B,EAAE,yEAA4B,aAAa,UAAU,+DAAwB,YAAY,+DAAwB,EAAE;AAC3J,gBAAgB,gDAAC,CAAC,uCAAI,IAAI,YAAY;AACtC,gBAAgB,gDAAC,UAAU,OAAO,uDAAU,6CAA6C,0BAA0B;AACnH;AACA;AACA,gBAAgB,gDAAC,UAAU,uDAAuD;AAClF,YAAY,gDAAC,2BAA2B,EAAE,yEAA4B,aAAa,UAAU,+DAAwB,YAAY,+DAAwB,EAAE;AAC3J,gBAAgB,gDAAC,CAAC,uCAAI,IAAI,YAAY;AACtC,gBAAgB,gDAAC,UAAU,OAAO,uDAAU,6CAA6C,0BAA0B;AACnH,YAAY,gDAAC,UAAU,OAAO,uDAAU;AACxC;AACA,iBAAiB,GAAG,qBAAqB,gDAAC,aAAa,0DAA0D,uDAAU;AAC3H;AACA,iBAAiB;AACjB;AACA,mBAAmB;AACnB,gBAAgB,gDAAC,UAAU,SAAS,sBAAsB;AAC1D;AACA;AACA,8BAA8B,+BAA+B;AAC7D,YAAY,gDAAC,UAAU,mDAAmD,qBAAqB,gDAAC,aAAa,0DAA0D,uDAAU;AACjL;AACA,SAAS;AACT;AACA,WAAW;AACX,QAAQ,gDAAC,UAAU,SAAS,sBAAsB;AAClD;;;;;;;;;;;;;;;;AC5CoC;AACpC;AACA;AACA;AACO,sBAAsB;AAC7B,YAAY,gDAAC,UAAU;AACvB;AACA;AACA,aAAa,IAAI,gBAAgB;AACjC;AACA;AACA;AACA,sEAAsE,gBAAgB;AACtF,qEAAqE,eAAe;AACpF,oEAAoE,eAAe;AACnF,WAAW;AACX,QAAQ,gDAAC,UAAU,iCAAiC;AACpD;;;;;;;;;;;;;;;ACjBO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uEAAuE,eAAe;AACtF,yEAAyE,gBAAgB;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2EAA2E,eAAe;AAC1F,6EAA6E,gBAAgB;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qEAAqE,eAAe;AACpF,iEAAiE,eAAe;AAChF;AACA;AACA;AACA;AACA;AACA,qEAAqE,gBAAgB;AACrF,mEAAmE,gBAAgB;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,8BAA8B,+DAA+D;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,qEAAqE;AACvG;AACA;AACA;AACA;AACA,+BAA+B,qEAAqE;AACpG;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,6BAA6B,4EAA4E;AACzG;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;AC7KoC;AACc;AACb;AACK;AACnC,oBAAoB,gHAAgH;AAC3I;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC,UAAU,OAAO,uDAAU,mBAAmB,0BAA0B,IAAI,uDAAuD,IAAI,+CAA+C,IAAI,iDAAiD,4BAA4B;AACpR,QAAQ,gDAAC,2BAA2B,YAAY,EAAE,yEAA4B,aAAa,4FAA4F;AACvL,0DAA0D,gDAAC,WAAW,4BAA4B;AAClG,wBAAwB,gDAAC,CAAC,uCAAI,IAAI,YAAY;AAC9C;AACA,2BAA2B,gDAAC,WAAW,6BAA6B;AACpE,gBAAgB,gDAAC,CAAC,uCAAI,IAAI,MAAM,sDAAmB,EAAE;AACrD,sBAAsB,gDAAC,UAAU,4BAA4B;AAC7D,YAAY,gDAAC,kCAAkC,gDAAC,SAAS,4EAA4E,+CAA+C,gDAAC,WAAW,iCAAiC;AACjO;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,0EAA6B;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,eAAe;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;AC3EoC;AACc;AACpB;AACY;AACK;AACxC,wBAAwB,0BAA0B;AACzD,YAAY,gDAAC,UAAU,OAAO,uDAAU,6BAA6B;AACrE,QAAQ,gDAAC,2BAA2B,4BAA4B,EAAE,yEAA4B,aAAa,UAAU,+DAAwB,YAAY,+DAAwB,EAAE,WAAW,gDAAC,CAAC,uCAAI,IAAI,YAAY;AACpN,QAAQ,gDAAC,UAAU,4BAA4B;AAC/C;;;;;;;;;;;;;;;;ACToC;AAC7B,6BAA6B;AACpC,YAAY,gDAAC,UAAU,gCAAgC;AACvD,QAAQ,gDAAC;AACT;;;;;;;;;;;;;;;;;;;ACJoC;AACM;AAClB;AACjB,gBAAgB,kCAAkC,MAAM,gDAAC,WAAW,OAAO,uDAAU,uCAAuC;AACnI,IAAI,gDAAC,UAAU,gBAAgB,YAAY,EAAE,YAAY,GAAG;AAC5D,yBAAyB,gDAAC,WAAW,sBAAsB;AAC3D,QAAQ,gDAAC,WAAW,0FAA0F;;;;;;;;;;;;;;;;ACN1E;AAC7B,kBAAkB;AACzB,YAAY,gDAAC,UAAU,qBAAqB;AAC5C,QAAQ,gDAAC;AACT;;;;;;;;;;;;;;;;;;;;ACJoC;AACW;AACV;AACK;AACQ;AAC3C,uBAAuB,6EAA6E;AAC3G;AACA;AACA;AACA;AACA,gBAAgB,gDAAC,wBAAwB,EAAE,yEAA4B,aAAa,OAAO,uDAAU,mFAAmF;AACxL;AACA,0BAA0B,gDAAC,WAAW,6BAA6B;AACnE;AACA,4BAA4B,gDAAC,CAAC,uCAAI,IAAI,YAAY;AAClD,YAAY,gDAAC,WAAW,4BAA4B;AACpD,YAAY,gDAAC,WAAW,6BAA6B;AACrD,gBAAgB,gDAAC,CAAC,uCAAI,IAAI,MAAM,sDAAmB,EAAE;AACrD;AACA;AACA,gBAAgB,gDAAC,UAAU,OAAO,uDAAU,uEAAuE;AACnH,YAAY,gDAAC,2BAA2B,EAAE,yEAA4B,aAAa,UAAU,+DAAwB,YAAY,+DAAwB,EAAE;AAC3J;AACA,8BAA8B,gDAAC,WAAW,6BAA6B;AACvE;AACA,gCAAgC,gDAAC,CAAC,uCAAI,IAAI,YAAY;AACtD,gBAAgB,gDAAC,WAAW,4BAA4B;AACxD,gBAAgB,gDAAC,WAAW,6BAA6B;AACzD,oBAAoB,gDAAC,CAAC,uCAAI,IAAI,MAAM,sDAAmB,EAAE;AACzD,YAAY,gDAAC,UAAU,4BAA4B;AACnD,gBAAgB,gDAAC,YAAY;AAC7B;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,uBAAuB;AACvB;AACA;;;;;;;;;;;;;;;;;;ACxCoC;AACsB;AACpB;AACtC,sBAAsB,OAAO;AAC7B,kCAAkC,yEAA4B;AAC9D,YAAY,gDAAC,UAAU,wDAAwD,YAAY,GAAG;AAC9F,QAAQ,gDAAC;AACT;AACA,wBAAwB,OAAO;AAC/B,kCAAkC,yEAA4B;AAC9D,YAAY,gDAAC,UAAU,0DAA0D,YAAY,GAAG;AAChG,QAAQ,gDAAC;AACT;AACO,6BAA6B,gDAAgD;AACpF,mBAAmB,wEAA2B,EAAE,yEAA4B;AAC5E;AACA,2BAA2B,gDAAC,eAAe,aAAa;AACxD,KAAK;AACL,YAAY,gDAAC,CAAC,+CAAQ,IAAI,8DAA8D,UAAU,8GAA8G,gDAAC,iBAAiB,cAAc,uBAAuB;AACvQ;;;;;;;;;;;;;;;;;ACnBoC;AACE;AACtC,sBAAsB,uBAAuB;AAC7C;AACA,gBAAgB,gDAAC,UAAU,uCAAuC;AAClE,YAAY,gDAAC;AACb;AACA,YAAY,gDAAC,UAAU,uCAAuC;AAC9D,QAAQ,gDAAC;AACT;AACA;AACA,QAAQ,gDAAC,WAAW,oCAAoC,WAAW,MAAM,OAAO;AAChF;AACO,6BAA6B,mEAAmE;AACvG;AACA;AACA,2BAA2B,gDAAC,eAAe,gDAAgD;AAC3F,KAAK;AACL,YAAY,gDAAC,CAAC,+CAAQ,IAAI,iJAAiJ,gDAAC,eAAe,8CAA8C,uBAAuB;AAChQ;;;;;;;;;;;;;;;;;ACnBoC;AACM;AACnC,mBAAmB,0CAA0C;AACpE,YAAY,gDAAC,UAAU,OAAO,uDAAU,kBAAkB,oCAAoC,IAAI,6BAA6B,IAAI,gCAAgC,cAAc;AACjL;;;;;;;;;;;;;;;;;;;ACJoC;AACN;AACY;AACQ;AAC3C,yBAAyB,2DAA2D;AAC3F;AACA,gBAAgB,gDAAC,2BAA2B,0CAA0C,0EAA6B,EAAE,EAAE,yEAA4B,aAAa,OAAO,uDAAU,iEAAiE;AAClP,oBAAoB,gDAAC,CAAC,uCAAI,IAAI,YAAY;AAC1C,mCAAmC,gDAAC,WAAW,kCAAkC;AACjF;AACA;AACA,gBAAgB,gDAAC,2BAA2B,sBAAsB,0EAA6B,EAAE,EAAE,yEAA4B,aAAa,OAAO,uDAAU;AAC7J;AACA,aAAa;AACb;AACA,eAAe;AACf,oBAAoB,gDAAC,CAAC,uCAAI,IAAI,YAAY;AAC1C,mCAAmC,gDAAC,WAAW,kCAAkC;AACjF;AACA;;;;;;;;;;;;;;;;;;;ACnBoC;AACN;AACY;AACQ;AAC3C,6BAA6B,mEAAmE;AACvG;AACA,gBAAgB,gDAAC,wBAAwB,UAAU,0EAA6B,EAAE,EAAE,yEAA4B,aAAa,OAAO,uDAAU,iEAAiE;AAC/M,YAAY,gDAAC,CAAC,uCAAI,IAAI,YAAY;AAClC;AACA;AACA,gBAAgB,gDAAC,0BAA0B,wCAAwC,0EAA6B,EAAE,EAAE,yEAA4B,aAAa,OAAO,uDAAU,kCAAkC;AAChN,YAAY,gDAAC,CAAC,uCAAI,IAAI,YAAY;AAClC,YAAY,gDAAC,YAAY,SAAS,iBAAiB;AACnD;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;;;;;;;;;;;;;;;;;ACzBoC;AACM;AACnC,4BAA4B,sBAAsB;AACzD,YAAY,gDAAC,UAAU,OAAO,uDAAU;AACxC;AACA,SAAS;AACT;AACA;AACA;AACA,WAAW;AACX;;;;;;;;;;;;;;;;ACVoC;AAC7B,4BAA4B;AACnC,YAAY,gDAAC,UAAU,+BAA+B;AACtD,QAAQ,gDAAC;AACT;;;;;;;;;;;;;;;;;;;;;;;ACJsD;AAC/C;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP,iBAAiB,kEAAe;AAChC;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA,mBAAmB,oBAAoB;AACvC;AACA,iBAAiB,eAAe;AAChC;AACA,kBAAkB,gBAAgB;AAClC;AACA,qBAAqB,kBAAkB;AACvC;AACA,qBAAqB,kBAAkB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa;AAC1F;AACA;AACO;AACP;AACA,kBAAkB,yBAAyB,GAAG,yBAAyB,GAAG,yBAAyB,EAAE,0BAA0B,GAAG,0BAA0B;AAC5J;AACA,cAAc,yBAAyB,GAAG,wBAAwB,GAAG,yBAAyB,EAAE,0BAA0B,GAAG,0BAA0B;AACvJ;AACO;AACP;AACA,eAAe,oCAAoC,EAAE,EAAE;AACvD;AACA;AACA;AACO;AACP,yDAAyD;AACzD;AACA;AACA,oBAAoB,kBAAkB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mBAAmB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;ACtFA;AACO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;;;;;;;;;;;;;;ACpDA,iBAAiB,SAAI,IAAI,SAAI;AAC7B,4BAA4B,+DAA+D,iBAAiB;AAC5G;AACA,oCAAoC,MAAM,+BAA+B,YAAY;AACrF,mCAAmC,MAAM,mCAAmC,YAAY;AACxF,gCAAgC;AAChC;AACA,KAAK;AACL;AACA;AACA;AACO;AACP;AACA;AACA,qDAAqD;AACrD,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,IAAI;AAC9C;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,gFAAgF,SAAS;AACzF;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE,mBAAmB;AAC3F;AACA;AACA;AACA;AACA,8BAA8B,SAAS;;AAEvC;;AAEA,mDAAmD;AACnD;AACA;AACA;AACA,KAAK;AACL;;;;;;;;;;;;;;;AC1DO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,KAAK;AACL;AACA;;;;;;;;;;;;;;;AChBO;AACP;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;;;;;;;;;;;;;;;ACzZO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;;;;;;;;;;;;;;;AClBgD;AACzC;AACP;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,4DAAa;AAC7D;AACA,WAAW,4DAAa;AACxB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,QAAQ;AAChD;AACA;AACA;AACA,wCAAwC,QAAQ;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;ACzDoD;AAC7C;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,4BAA4B;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,gCAAgC;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gEAAe;AAC3B;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;AClFO;AACP;AACA;AACA;AACA,CAAC,4CAA4C;AACtC;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,iBAAiB;AACzC;AACA;AACA;AACA;AACA;AACA,wBAAwB,iBAAiB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,iBAAiB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,iBAAiB;AAC7C;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;ACjG6C;AACO;AACe;AACb;AACtD;AACO,0BAA0B,qDAAW;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,mEAAmB;AAC3B;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,6EAAgB,GAAG,oFAAuB;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qHAAqH,6DAAe;AACpI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;;;;;;;;;;;;;;;;;AC3IiE;AACrB;AACrC,2BAA2B,uDAAY;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,qDAAW;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,gEAAqB;AACrC;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;ACjC4C;AACyB;AACtB;AACkB;AACN;AAChB;AACsB;AACV;AAChD;AACP;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,aAAa,QAAQ;AACtE,SAAS;AACT;AACA,mCAAmC;AACnC,SAAS;AACT;AACA,sBAAsB,gDAAC;AACvB,6BAA6B,4BAA4B,gDAAC,CAAC,oDAAO,IAAI,oCAAoC;AAC1G,QAAQ,gDAAC,CAAC,sEAAgB;AAC1B,YAAY,gDAAC,CAAC,4DAAW,IAAI,SAAS,kFAA0B,iFAAiF,cAAc,WAAW,6DAAkB,gEAAgE;AAC5P,QAAQ,gDAAC,CAAC,sEAAgB,IAAI,iBAAiB;AAC/C,YAAY,gDAAC,CAAC,sEAAgB;AAC9B,YAAY,gDAAC,CAAC,gEAAa,IAAI,MAAM,sDAAW,2BAA2B;AAC3E,WAAW,kDAAG;AACd;;;;;;;;;;;;;;;;AC7B0C;AACnC,6BAA6B,mDAAU;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;AC5C0C;AACnC,6BAA6B,mDAAU;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,8BAA8B;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,cAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;AClJ6C;AACkB;AACb;AACA;AACI;AACN;AACQ;AACR;AAChD;AACA;AACA;AACA;AACO,iCAAiC,qDAAW;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gFAAgF,gBAAgB;AAChG,+EAA+E,eAAe;AAC9F,8EAA8E,eAAe;AAC7F;AACA;AACA;AACA;AACA,4BAA4B,iEAAoB,mBAAmB,oEAAuB;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,iBAAiB,iEAAoB;AACrC,wCAAwC,2DAAc;AACtD;AACA,iBAAiB,oEAAuB;AACxC,wCAAwC,iEAAiB;AACzD;AACA,iBAAiB,gEAAmB;AACpC,wCAAwC,yDAAa;AACrD;AACA,iBAAiB,iEAAoB;AACrC;AACA;AACA,gDAAgD,2DAAc;AAC9D;AACA;AACA,gDAAgD,+DAAgB;AAChE;AACA;AACA;AACA,iBAAiB,gEAAmB;AACpC,wCAAwC,yDAAa;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,wCAAwC,+BAA+B;AACvE;AACA,+DAA+D,+DAAkB;AACjF;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,oCAAoC;AACtF,iDAAiD,oCAAoC;AACrF,mDAAmD,oCAAoC;AACvF,oDAAoD,oCAAoC;AACxF;AACA;AACA;AACA;AACA,oBAAoB,wBAAwB;AAC5C;AACA;AACA;AACA,oCAAoC,iBAAiB;AACrD;AACA;AACA,gDAAgD,+DAAkB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,QAAQ;AAC5C;AACA;AACA,gDAAgD,+DAAkB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yGAAyG,QAAQ,yFAAyF;AAC1M;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;AC3OiE;AACP;AACnD,8BAA8B,uDAAY;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,mEAAkB;AACzD;AACA;AACA;AACA;AACA,gBAAgB,iEAAsB;AACtC;AACA;AACA;AACA,KAAK;AACL;;;;;;;;;;;;;;;;AC1B0C;AACnC,4BAA4B,mDAAU;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,yBAAyB;AACvE;AACA;AACA;AACA,wBAAwB,8BAA8B;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;ACxE0C;AACnC,gCAAgC,mDAAU;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;AC5C0C;AACnC,+BAA+B,mDAAU;AAChD;AACA;AACA;AACA,wBAAwB,8BAA8B;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;ACzC0C;AACnC,4BAA4B,mDAAU;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;ACjDO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA,SAAS;AACT;AACA;AACA,sDAAsD,KAAK;AAC3D;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;AC5BA,iBAAiB,SAAI,IAAI,SAAI;AAC7B,4BAA4B,+DAA+D,iBAAiB;AAC5G;AACA,oCAAoC,MAAM,+BAA+B,YAAY;AACrF,mCAAmC,MAAM,mCAAmC,YAAY;AACxF,gCAAgC;AAChC;AACA,KAAK;AACL;AAC6C;AAC8B;AACR;AACW;AACM;AACpF;AACO,yCAAyC,qDAAW;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,iGAAkC;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,gFAAmB;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA,qDAAqD,kFAAqB;AAC1E;AACA;AACA,qDAAqD,oFAAuB;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,uFAAoB;AACzD;AACA;AACA,yBAAyB;AACzB;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,uFAAoB;AACrD;AACA;AACA,qBAAqB;AACrB;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,+BAA+B;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,kEAAqB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,wEAA2B;AACtD,iBAAiB;AACjB,gNAAgN,kDAAkD;AAClQ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;;;;;;;;;;;;;;;;;;;;;;;;AChL4C;AACyB;AACtB;AACkB;AACN;AAChB;AACsB;AACV;AACY;AAC5D;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,aAAa,sBAAsB;AACpF,SAAS;AACT;AACA;AACA,iDAAiD,aAAa,kCAAkC;AAChG,SAAS;AACT;AACA,sBAAsB,gDAAC;AACvB,4CAA4C,4BAA4B,gDAAC,CAAC,oDAAO,IAAI,oCAAoC;AACzH,QAAQ,gDAAC,CAAC,sEAAgB;AAC1B,YAAY,gDAAC,CAAC,4DAAW,IAAI,0DAA0D,0DAAe,gDAAgD;AACtJ,YAAY,gDAAC,CAAC,wEAAiB,IAAI,SAAS,kFAA0B,+CAA+C,kFAA0B,yHAAyH;AACxQ,QAAQ,gDAAC,CAAC,sEAAgB,IAAI,iBAAiB;AAC/C,YAAY,gDAAC,CAAC,sEAAgB;AAC9B,YAAY,gDAAC,CAAC,gEAAa,IAAI,MAAM,sDAAW,0BAA0B;AAC1E,WAAW,kDAAG;AACd;;;;;;;;;;;;;;;;;;;;;ACnC6C;AACF;AAC4C;AACrC;AAC8B;AACzB;AACvD;AACO,0CAA0C,qDAAW;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,8CAA8C;AACzE;AACA,2BAA2B,mEAAoB,IAAI,8CAA8C;AACjG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,yCAAyC;AACpE,2BAA2B,mEAAoB,IAAI,yCAAyC;AAC5F;AACA,4CAA4C;AAC5C,qDAAqD;AACrD,oDAAoD;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,mEAAoB;AACvD;AACA;AACA;AACA;AACA;AACA,+BAA+B,mEAAoB;AACnD;AACA,kCAAkC,2DAAc;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,2BAA2B,mGAAmC;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,gCAAgC;AACnF,kDAAkD,gCAAgC;AAClF;AACA;AACA;AACA,+DAA+D,SAAS;AACxE;AACA,wDAAwD,OAAO;AAC/D,yDAAyD,MAAM;AAC/D,kEAAkE,UAAU,KAAK,UAAU;AAC3F;AACA;AACA,wDAAwD,MAAM;AAC9D,yDAAyD,OAAO;AAChE,kEAAkE,UAAU,KAAK,WAAW;AAC5F;AACA;AACA,wDAAwD,OAAO;AAC/D,yDAAyD,MAAM;AAC/D,kEAAkE,WAAW,KAAK,WAAW;AAC7F;AACA;AACA,wDAAwD,MAAM;AAC9D,yDAAyD,OAAO;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gEAAe;AACnC;AACA,sCAAsC,gDAAK;AAC3C;AACA;AACA,0BAA0B,gDAAK;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,mEAAoB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;AChN4C;AACyB;AACtB;AACkB;AACN;AACV;AACM;AACZ;AACsB;AACE;AAC5D;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,0CAA0C;AACpE,iDAAiD,aAAa,kCAAkC;AAChG,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA,0BAA0B,gCAAgC;AAC1D,iDAAiD,aAAa,wBAAwB;AACtF,SAAS;AACT;AACA,0BAA0B,oCAAoC;AAC9D,iDAAiD,aAAa,qBAAqB,SAAS,KAAK;AACjG,SAAS;AACT;AACA,0BAA0B,kCAAkC;AAC5D,iDAAiD,aAAa,0BAA0B;AACxF,SAAS;AACT;AACA,0BAA0B,kCAAkC;AAC5D,iDAAiD,aAAa,gCAAgC;AAC9F,SAAS;AACT;AACA,iDAAiD,aAAa,wDAAwD;AACtH,SAAS;AACT,oGAAoG,aAAa,mBAAmB;AACpI;AACA;AACA;AACA,SAAS;AACT;AACA,uBAAuB,gDAAC,kCAAkC,oDAAoD;AAC9G,6CAA6C,uBAAuB,4BAA4B,gDAAC,CAAC,oDAAO,IAAI,oCAAoC;AACjJ,QAAQ,gDAAC,CAAC,sEAAgB;AAC1B,YAAY,gDAAC,CAAC,sDAAQ,IAAI,SAAS,kFAA0B;AAC7D;AACA;AACA,iBAAiB,sCAAsC;AACvD,YAAY,gDAAC,CAAC,sDAAQ,IAAI,SAAS,kFAA0B;AAC7D,6BAA6B,KAAK;AAClC;AACA,iBAAiB,oCAAoC;AACrD,YAAY,gDAAC,CAAC,sEAAgB;AAC9B,QAAQ,gDAAC,CAAC,sEAAgB;AAC1B,YAAY,gDAAC,CAAC,4DAAW,IAAI,SAAS,kFAA0B,8DAA8D,0DAAe,oEAAoE;AACjN,YAAY,gDAAC,CAAC,4DAAW,IAAI,SAAS,kFAA0B,kEAAkE,0DAAe,gFAAgF;AACjO,YAAY,gDAAC,CAAC,wEAAiB,IAAI,SAAS,kFAA0B,+CAA+C,kFAA0B,yHAAyH;AACxQ,YAAY,gDAAC,CAAC,sEAAgB;AAC9B,QAAQ,gDAAC,CAAC,sEAAgB;AAC1B,YAAY,gDAAC,CAAC,gEAAa,IAAI,SAAS,kFAA0B,mCAAmC,0DAAe;AACpH,8CAA8C,oBAAoB;AAClE,mBAAmB;AACnB,YAAY,gDAAC,CAAC,gEAAa,IAAI,SAAS,kFAA0B,qCAAqC,4DAAiB;AACxH,8CAA8C,sBAAsB;AACpE,mBAAmB;AACnB,YAAY,gDAAC,CAAC,gEAAa,IAAI,SAAS,kFAA0B,oCAAoC,2DAAgB;AACtH,8CAA8C,qBAAqB;AACnE,mBAAmB;AACnB,YAAY,gDAAC,CAAC,sEAAgB;AAC9B,QAAQ,gDAAC,CAAC,sEAAgB;AAC1B,YAAY,gDAAC,CAAC,gEAAa,IAAI,SAAS,kFAA0B,8BAA8B,qDAAU;AAC1G,8CAA8C,aAAa;AAC3D,mBAAmB;AACnB,YAAY,gDAAC,CAAC,gEAAa,IAAI,SAAS,kFAA0B,gCAAgC,uDAAY;AAC9G,8CAA8C,eAAe;AAC7D,mBAAmB;AACnB,YAAY,gDAAC,CAAC,gEAAa,IAAI,SAAS,kFAA0B,mCAAmC,0DAAe;AACpH,8CAA8C,kBAAkB;AAChE,mBAAmB;AACnB,YAAY,gDAAC,CAAC,sEAAgB;AAC9B,uCAAuC,gDAAC,CAAC,sEAAgB;AACzD,YAAY,gDAAC,CAAC,gEAAa,IAAI,SAAS,kFAA0B,qHAAqH,qDAAU,GAAG,uDAAY;AAChN;AACA;AACA,mBAAmB;AACnB,YAAY,gDAAC,CAAC,sEAAgB;AAC9B,mCAAmC,gDAAC,CAAC,sEAAgB;AACrD,YAAY,gDAAC,UAAU,+BAA+B;AACtD,gBAAgB,gDAAC,YAAY,iEAAiE,kFAA0B;AACxH;AACA,qBAAqB,gCAAgC;AACrD,QAAQ,gDAAC,CAAC,sEAAgB,IAAI,iBAAiB;AAC/C,YAAY,gDAAC,CAAC,gEAAa,IAAI,MAAM,mDAAQ,2BAA2B;AACxE,WAAW,kDAAG;AACd;;;;;;;;;;;;;;;;;;;;;AClHiE;AACS;AACvB;AACT;AAC2B;AACO;AACrE,uCAAuC,uDAAY;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,kEAAqB;AACjD,sBAAsB,oDAAU;AAChC,yBAAyB,kFAA0B;AACnD;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,mFAA0B;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,qFAA2B;AAClE;AACA;AACA;AACA;AACA,gBAAgB,gEAAqB;AACrC;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;;;;;;;;;;;;;;;ACzD2C;AAC2B;AAC/D;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,mDAAmD;AAC9G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,oBAAoB;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,IAAI,gBAAgB;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,sDAAsD,KAAK;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,mBAAmB,gRAAgR;AAChV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gEAAgE,SAAS;AACzE;AACA;AACA;AACA,6BAA6B,mEAAoB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD;AACxD;AACA,oDAAoD;AACpD;AACA,8CAA8C;AAC9C;AACA,6EAA6E;AAC7E;AACA,qCAAqC;AACrC,4CAA4C;AAC5C,oDAAoD;AACpD,0CAA0C;AAC1C,gDAAgD;AAChD,gDAAgD;AAChD,gDAAgD;AAChD,6DAA6D;AAC7D;AACA,mBAAmB,yDAAU;AAC7B,6CAA6C;AAC7C,SAAS;AACT;AACA,uBAAuB,gDAAK;AAC5B,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;AC9M6C;AACO;AACe;AACoB;AAC5C;AAC2C;AACR;AACvE;AACP;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,sCAAsC;AACvC;AACO,0CAA0C,qDAAW;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,mGAAmC;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,kFAAqB;AAC1E;AACA;AACA,qDAAqD,oFAAuB;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,uFAAoB;AACzD;AACA;AACA,yBAAyB;AACzB;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,uFAAoB;AACrD;AACA;AACA,qBAAqB;AACrB;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D,6EAAgB;AAC7E;AACA;AACA,6DAA6D,gFAAmB;AAChF;AACA;AACA;AACA,yDAAyD,gFAAmB;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,0CAA0C;AAC9E;AACA;AACA;AACA,oBAAoB,gGAAmB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,kEAAqB;AAC5C;AACA,uBAAuB,kEAAqB;AAC5C;AACA,uBAAuB,kEAAqB;AAC5C;AACA,uBAAuB,iEAAoB;AAC3C;AACA,uBAAuB,mEAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,gDAAK;AAClC;AACA;AACA;AACA;AACA;AACA,0BAA0B,kCAAkC;AAC5D,2BAA2B,iDAAiD;AAC5E,uBAAuB,iDAAiD;AACxE,wBAAwB,gEAAgE;AACxF,SAAS;AACT;AACA,sBAAsB,kEAAqB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,qCAAqC;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,kEAAqB;AACzD,yCAAyC,gDAAK;AAC9C;AACA;AACA;AACA,gCAAgC,sBAAsB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;AC9R4C;AACyB;AACtB;AACkB;AACN;AAChB;AACsB;AACV;AACO;AACvD;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,aAAa,sBAAsB;AACpF,SAAS;AACT;AACA;AACA,iDAAiD,aAAa,oBAAoB;AAClF,SAAS;AACT;AACA,sBAAsB,gDAAC;AACvB,6CAA6C,4BAA4B,gDAAC,CAAC,oDAAO,IAAI,oCAAoC;AAC1H,QAAQ,gDAAC,CAAC,sEAAgB;AAC1B,YAAY,gDAAC,CAAC,4DAAW,IAAI,0DAA0D,0DAAe,gDAAgD;AACtJ,YAAY,gDAAC,CAAC,sEAAgB;AAC9B,QAAQ,gDAAC,CAAC,sEAAgB;AAC1B,YAAY,gDAAC,CAAC,gEAAa,IAAI,SAAS,kFAA0B,oCAAoC,4DAAiB,kCAAkC,iFAAuB;AAChL,qCAAqC,iFAAuB;AAC5D,mBAAmB;AACnB,YAAY,gDAAC,CAAC,gEAAa,IAAI,SAAS,kFAA0B,oCAAoC,0DAAe,kCAAkC,iFAAuB;AAC9K,qCAAqC,iFAAuB;AAC5D,mBAAmB;AACnB,YAAY,gDAAC,CAAC,gEAAa,IAAI,SAAS,kFAA0B,mCAAmC,yDAAc,kCAAkC,gFAAsB;AAC3K,qCAAqC,gFAAsB;AAC3D,mBAAmB;AACnB,YAAY,gDAAC,CAAC,gEAAa,IAAI,SAAS,kFAA0B,oCAAoC,8DAAmB,kCAAkC,kFAAwB;AACnL,qCAAqC,kFAAwB;AAC7D,mBAAmB;AACnB,YAAY,gDAAC,CAAC,gEAAa,IAAI,SAAS,kFAA0B,+CAA+C,uEAA4B,kCAAkC,6FAAmC;AAClN,qCAAqC,6FAAmC;AACxE,mBAAmB;AACnB,QAAQ,gDAAC,CAAC,sEAAgB,IAAI,iBAAiB;AAC/C,YAAY,gDAAC,CAAC,sEAAgB;AAC9B,YAAY,gDAAC,CAAC,gEAAa,IAAI,MAAM,sDAAW,0BAA0B;AAC1E,WAAW,kDAAG;AACd;;;;;;;;;;;;;;;;;;AClD6C;AACF;AAC6C;AACxF;AACO,2CAA2C,qDAAW;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,qGAAoC;AAC5C;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,gDAAK;AACtC,qCAAqC,gDAAK;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;ACrG4C;AACG;AACkB;AACN;AAChB;AACsB;AACV;AAChD;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,aAAa,sBAAsB;AACpF,SAAS;AACT;AACA,sBAAsB,gDAAC;AACvB,8CAA8C,4BAA4B,gDAAC,CAAC,oDAAO,IAAI,oCAAoC;AAC3H,QAAQ,gDAAC,CAAC,sEAAgB;AAC1B,YAAY,gDAAC,CAAC,4DAAW,IAAI,0DAA0D,0DAAe,gDAAgD;AACtJ,QAAQ,gDAAC,CAAC,sEAAgB,IAAI,iBAAiB;AAC/C,YAAY,gDAAC,CAAC,sEAAgB;AAC9B,YAAY,gDAAC,CAAC,gEAAa,IAAI,MAAM,sDAAW,0BAA0B;AAC1E,WAAW,kDAAG;AACd;;;;;;;;;;;;;;;;;;;;;AC1BiE;AACW;AACzB;AACT;AAC2B;AACS;AACvE,wCAAwC,uDAAY;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,kEAAqB;AACzC,oBAAoB,kEAAqB;AACzC,oBAAoB,iEAAoB;AACxC,oBAAoB,mEAAsB;AAC1C;AACA,sBAAsB,oDAAU;AAChC,yBAAyB,kFAA0B;AACnD;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA,0CAA0C,qFAA2B;AACrE;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,uFAA4B;AACnE;AACA;AACA;AACA;AACA,gBAAgB,gEAAqB;AACrC;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;;;;;;;;;;;;;;;;;ACrDA,iBAAiB,SAAI,IAAI,SAAI;AAC7B,4BAA4B,+DAA+D,iBAAiB;AAC5G;AACA,oCAAoC,MAAM,+BAA+B,YAAY;AACrF,mCAAmC,MAAM,mCAAmC,YAAY;AACxF,gCAAgC;AAChC;AACA,KAAK;AACL;AACiE;AACd;AACW;AACwB;AAC/E,oCAAoC,uDAAY;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,2FAAQ,kBAAkB,2FAAQ;AACpF;AACA;AACA;AACA,0BAA0B,2FAAQ;AAClC,wBAAwB,2FAAQ;AAChC;AACA;AACA,yBAAyB,2FAAQ;AACjC,yBAAyB,2FAAQ;AACjC;AACA;AACA;AACA;AACA,4BAA4B,uEAAwB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,8DAAiB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,qBAAqB;AACrB;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,gBAAgB,gEAAqB;AACrC;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACnK+D;AACE;AACZ;AACjB;AACqB;AACF;AACG;AACA;AACpB;AACa;AACL;AAChB;AACC;;;;;;;;;;;;;;;;;;;;ACZ/B,iBAAiB,SAAI,IAAI,SAAI;AAC7B,4BAA4B,+DAA+D,iBAAiB;AAC5G;AACA,oCAAoC,MAAM,+BAA+B,YAAY;AACrF,mCAAmC,MAAM,mCAAmC,YAAY;AACxF,gCAAgC;AAChC;AACA,KAAK;AACL;AAC6C;AAC8B;AACR;AACQ;AAChC;AAC3C;AACO,oCAAoC,qDAAW;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6EAA6E,MAAM;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,SAAS;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,uFAA6B;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,kFAAqB;AACtE;AACA;AACA,iDAAiD,oFAAuB;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,SAAS;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,sBAAsB;AACtD;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,sBAAsB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,cAAc;AACrE;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,sBAAsB;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,sCAAsC,gDAAK;AAC3C;AACA;AACA,8BAA8B,4DAAe;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,+BAA+B,wEAA2B;AAC1D;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,sBAAsB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;ACpf4C;AACyB;AACtB;AACkB;AACN;AAChB;AACsB;AACE;AACZ;AACA;AAChD;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,aAAa,yBAAyB;AACvF,SAAS;AACT;AACA;AACA,iDAAiD,aAAa,wBAAwB;AACtF,SAAS;AACT;AACA;AACA,iDAAiD,aAAa,qBAAqB;AACnF,SAAS;AACT,gFAAgF,aAAa,WAAW;AACxG;AACA,sBAAsB,gDAAC;AACvB,uCAAuC;AACvC;AACA,gBAAgB,gDAAC,CAAC,oDAAO,IAAI,oCAAoC;AACjE,YAAY,gDAAC,CAAC,sEAAgB;AAC9B,gBAAgB,gDAAC,CAAC,4DAAW,IAAI,gEAAgE,0DAAe,qEAAqE;AACrL,YAAY,gDAAC,CAAC,sEAAgB;AAC9B,gBAAgB,gDAAC,CAAC,4DAAW,IAAI,SAAS,kFAA0B,6FAA6F,kBAAkB,UAAU,qDAAU,oEAAoE;AAC3Q,gBAAgB,gDAAC,CAAC,wEAAiB,IAAI,SAAS,kFAA0B,gJAAgJ;AAC1N,YAAY,gDAAC,CAAC,sEAAgB;AAC9B,gBAAgB,gDAAC,CAAC,sEAAgB;AAClC,gBAAgB,gDAAC,CAAC,gEAAa,IAAI,SAAS,kFAA0B,iCAAiC,uDAAY,yDAAyD;AAC5K,gBAAgB,gDAAC,CAAC,gEAAa,IAAI,SAAS,kFAA0B,mCAAmC,yDAAc,wDAAwD;AAC/K,YAAY,gDAAC,CAAC,sEAAgB,IAAI,iBAAiB;AACnD,gBAAgB,gDAAC,CAAC,sEAAgB;AAClC,wCAAwC,gDAAC,CAAC,gEAAa,IAAI,MAAM,sDAAW,2BAA2B,MAAM,gDAAC,CAAC,gEAAa,IAAI,MAAM,mDAAQ,yBAAyB;AACvK;AACA,WAAW,kDAAG;AACd;;;;;;;;;;;;;;;;;;;ACpD6C;AACgB;AACgB;AAClC;AAC3C;AACO,qCAAqC,qDAAW;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,gDAAK;AAC/B;AACA;AACA,uBAAuB,yFAA8B;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,gDAAK;AACtC,qCAAqC,gDAAK;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,wEAA2B;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,gDAAK;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;ACtI4C;AACyB;AACtB;AACkB;AACN;AAChB;AACsB;AACE;AACZ;AACA;AAChD;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,aAAa,yBAAyB;AACvF,SAAS;AACT;AACA;AACA,iDAAiD,aAAa,wBAAwB;AACtF,SAAS;AACT;AACA;AACA,iDAAiD,aAAa,qBAAqB;AACnF,SAAS;AACT;AACA,sBAAsB,gDAAC;AACvB,wCAAwC;AACxC;AACA,gBAAgB,gDAAC,CAAC,oDAAO,IAAI,oCAAoC;AACjE,YAAY,gDAAC,CAAC,sEAAgB;AAC9B,gBAAgB,gDAAC,CAAC,4DAAW,IAAI,gEAAgE,0DAAe,qEAAqE;AACrL,YAAY,gDAAC,CAAC,sEAAgB;AAC9B,gBAAgB,gDAAC,CAAC,4DAAW,IAAI,SAAS,kFAA0B,6FAA6F,8BAA8B,UAAU,qDAAU,oEAAoE;AACvR,gBAAgB,gDAAC,CAAC,wEAAiB,IAAI,SAAS,kFAA0B,gJAAgJ;AAC1N,YAAY,gDAAC,CAAC,sEAAgB,IAAI,iBAAiB;AACnD,gBAAgB,gDAAC,CAAC,sEAAgB;AAClC,gBAAgB,gDAAC,CAAC,gEAAa,IAAI,MAAM,sDAAW,2BAA2B;AAC/E;AACA,WAAW,kDAAG;AACd;;;;;;;;;;;;;;;;;;;;;AC9CiE;AACD;AACE;AACf;AACT;AAC2B;AAC9D,kCAAkC,uDAAY;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,4DAAe;AAC3C,sBAAsB,oDAAU;AAChC,yBAAyB,kFAA0B;AACnD;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA,0CAA0C,yEAAqB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,2EAAsB;AAC7D;AACA;AACA;AACA;AACA,gBAAgB,gEAAqB;AACrC;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;ACjD4C;AACyB;AACtB;AACkB;AACN;AACjB;AACa;AACF;AACU;AACZ;AACR;AACpC;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,iDAAiD,aAAa,YAAY;AAC1E,SAAS;AACT;AACA,iDAAiD,aAAa,0BAA0B;AACxF,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC,SAAS;AACT;AACA,2FAA2F,QAAQ,uBAAuB;AAC1H,iDAAiD,aAAa,mLAAmL;AACjP,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,iDAAiD,aAAa,gDAAgD;AAC9G,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,iDAAiD,aAAa,iDAAiD;AAC/G,SAAS;AACT;AACA,iDAAiD,aAAa,qBAAqB;AACnF,SAAS;AACT;AACA,sBAAsB,gDAAC;AACvB,0BAA0B;AAC1B,gBAAgB,gDAAC,gDAAgD,gDAAC,UAAU,qCAAqC,YAAY,6CAA6C;AAC1K;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA,eAAe;AACf;AACA,WAAW,kDAAG;AACd;AACA,iBAAiB,iKAAiK;AAClL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,iDAAK;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC,UAAU,OAAO,8DAAU;AACxC;AACA;AACA,SAAS,sDAAsD;AAC/D,QAAQ,gDAAC,UAAU;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,eAAe;AACf,YAAY,gDAAC,UAAU,2BAA2B;AAClD,gBAAgB,gDAAC,UAAU,qDAAqD;AAChF,oBAAoB,gDAAC,UAAU,kCAAkC;AACjE,oBAAoB,gDAAC,UAAU,oCAAoC;AACnE,8BAA8B,gDAAC,CAAC,oDAAO;AACvC,oBAAoB,gDAAC,CAAC,sEAAgB,IAAI,iBAAiB;AAC3D,wBAAwB,gDAAC,CAAC,gEAAa,IAAI;AAC3C;AACA;AACA;AACA;AACA;AACA,6BAA6B,QAAQ,qDAAW,EAAE,QAAQ,gDAAC,CAAC,oDAAO;AACnE,oBAAoB,gDAAC,CAAC,sEAAgB;AACtC,wBAAwB,gDAAC,CAAC,gEAAa,IAAI,SAAS,kFAA0B,6BAA6B,yDAAY;AACvH;AACA,6BAA6B,2DAA2D;AACxF,iDAAiD,gDAAC,CAAC,gEAAa,IAAI,SAAS,kFAA0B;AACvG;AACA;AACA;AACA;AACA;AACA,6BAA6B,yBAAyB,oDAAU,GAAG,sDAAY,EAAE;AACjF,2CAA2C,8DAAiB,KAAK,gDAAC,CAAC,4DAAW,IAAI,SAAS,kFAA0B,kDAAkD,yDAAe;AACtL;AACA;AACA;AACA,iCAAiC;AACjC,6BAA6B,2DAA2D;AACxF,oBAAoB,gDAAC,CAAC,sEAAgB,IAAI,iBAAiB;AAC3D,wBAAwB,gDAAC,CAAC,gEAAa,IAAI;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,QAAQ,qDAAW,EAAE;AAClD,0BAA0B,gDAAC,UAAU,sCAAsC;AAC3E,iDAAiD,gDAAC;AAClD,gBAAgB,gDAAC,kCAAkC,gDAAC;AACpD,+BAA+B,gDAAC,YAAY;AAC5C;AACA;AACA;AACA,yCAAyC,MAAM,gDAAC,UAAU,4BAA4B,mDAAmD,gDAAC,YAAY,kDAAkD,kFAA0B;AAClO;AACA,qBAAqB;AACrB;AACA;AACA;AACA,yCAAyC,MAAM,gDAAC,UAAU,qCAAqC;AAC/F,gBAAgB,gDAAC,UAAU,OAAO,8DAAU;AAC5C;AACA,qBAAqB,GAAG,mDAAmD,gDAAC,eAAe,aAAa,kFAA0B;AAClI;AACA,qBAAqB;AACrB;AACA,uBAAuB;AACvB;AACA;AACA;AACA,yCAAyC,gDAAC,UAAU,qCAAqC;AACzF,QAAQ,gDAAC;AACT,YAAY,gDAAC,UAAU,+BAA+B;AACtD,YAAY,gDAAC,UAAU;AACvB;AACA,iBAAiB;AACjB;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,oEAAe;AAC3B,YAAY,oEAAe;AAC3B,6EAA6E,eAAe;AAC5F;AACA;AACA;AACA;AACA;AACA;AACA,0EAA0E,eAAe;AACzF,yEAAyE,eAAe;AACxF,wEAAwE,eAAe;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0EAA0E,mBAAmB;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0EAA0E,mBAAmB;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;ACjW6C;AACH;AAC2C;AACjC;AACiC;AACN;AACpC;AACU;AACE;AAChD,yBAAyB,qDAAW;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,sFAAyB;AACxD,iDAAiD,gFAAmB;AACpE;AACA,oBAAoB,4BAA4B;AAChD,iDAAiD,+EAAkB,mBAAmB,sFAAyB;AAC/G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,sFAAyB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,0BAA0B;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,EAAE;AAC1D,yDAAyD,EAAE;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,sFAAyB;AAChE,sCAAsC,+EAAkB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,sFAAyB;AAC5D,mCAAmC,+EAAS;AAC5C;AACA;AACA;AACA,oCAAoC,mBAAmB;AACvD;AACA,+CAA+C,6DAAgB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,gFAAmB;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,8FAAiB,oFAAoF,kBAAkB;AACnJ;AACA;AACA;AACA;AACA;AACA,oCAAoC,0BAA0B;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,mFAAa;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,8DAAe;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,gDAAK;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,uDAAe;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,kBAAkB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,wBAAwB;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,wBAAwB;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,gEAAe;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,gEAAe;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,6DAAgB;AAC5D,4CAA4C,kEAAqB;AACjE,4CAA4C,iEAAoB;AAChE,4CAA4C,kEAAqB;AACjE,4CAA4C,mEAAsB;AAClE;AACA;AACA;AACA,iDAAiD,4DAAe;AAChE,4CAA4C,+DAAkB;AAC9D,4CAA4C,+DAAkB;AAC9D,yCAAyC,gDAAK;AAC9C,6CAA6C,gDAAK;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;ACzfiE;AACvB;AACnC,0BAA0B,uDAAY;AAC7C;AACA;AACA;AACA;AACA;AACA,wCAAwC,mDAAU;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,iEAAsB;AACtC;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;;;;;;;;;;;;;;;;;;;ACxB4C;AACD;AACF;AACI;AACwB;AAC9D;AACP;AACA;AACA;AACA,CAAC,kCAAkC;AAC5B;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,aAAa,gBAAgB;AAC9E,SAAS;AACT;AACA,iDAAiD,aAAa,sBAAsB;AACpF,SAAS;AACT;AACA,iDAAiD,aAAa,cAAc;AAC5E,SAAS;AACT;AACA,iDAAiD,aAAa,gDAAgD;AAC9G,SAAS;AACT;AACA,uBAAuB,gDAAC,uBAAuB,wKAAwK;AACvN,kCAAkC,0CAA0C,4BAA4B,gDAAC,UAAU,+CAA+C;AAClK,QAAQ,gDAAC,UAAU,0BAA0B;AAC7C,YAAY,gDAAC,CAAC,8CAAI,IAAI,mCAAmC,sDAAW,mBAAmB;AACvF,YAAY,kFAA0B;AACtC,+BAA+B,gDAAC;AAChC,YAAY,gDAAC,CAAC,kDAAM;AACpB,YAAY,gDAAC,UAAU,mDAAmD;AAC1E,gBAAgB,gDAAC,aAAa;AAC9B;AACA,uBAAuB,EAAE,kFAA0B,wBAAwB,gDAAC;AAC5E,YAAY,gDAAC,UAAU,0BAA0B;AACjD,gBAAgB,gDAAC,UAAU,2BAA2B;AACtD,oBAAoB,gDAAC;AACrB,wBAAwB,gDAAC,YAAY;AACrC;AACA,+BAA+B;AAC/B,wBAAwB,gDAAC,WAAW,0BAA0B;AAC9D,wBAAwB,kFAA0B;AAClD,gBAAgB,gDAAC,UAAU,2BAA2B;AACtD,oBAAoB,gDAAC;AACrB,wBAAwB,gDAAC,YAAY;AACrC;AACA,+BAA+B;AAC/B,wBAAwB,gDAAC,WAAW,0BAA0B;AAC9D,wBAAwB,kFAA0B;AAClD,gBAAgB,gDAAC,UAAU,2BAA2B;AACtD,oBAAoB,gDAAC;AACrB,wBAAwB,gDAAC,YAAY;AACrC;AACA,+BAA+B;AAC/B,wBAAwB,gDAAC,WAAW,0BAA0B;AAC9D,wBAAwB,kFAA0B;AAClD,oBAAoB,gDAAC,YAAY;AACjC;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B,gBAAgB,gDAAC,UAAU,iDAAiD;AAC5E,oBAAoB,gDAAC,UAAU,2EAA2E,EAAE,kFAA0B;AACtI,gBAAgB,gDAAC,UAAU,2BAA2B;AACtD,oBAAoB,gDAAC,UAAU;AAC/B;AACA,2BAA2B;AAC3B,qDAAqD,gDAAC,CAAC,8CAAI,IAAI,MAAM,gEAAqB,EAAE,MAAM,gDAAC,CAAC,8CAAI,IAAI,MAAM,yDAAc,EAAE;AAClI,wBAAwB,kFAA0B;AAClD,YAAY,gDAAC,UAAU,2BAA2B;AAClD,gBAAgB,gDAAC,aAAa;AAC9B;AACA,uBAAuB,EAAE,kFAA0B;AACnD,gBAAgB,gDAAC,aAAa;AAC9B;AACA,uDAAuD,yBAAyB;AAChF;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA,uBAAuB,EAAE,kFAA0B;AACnD,WAAW,kDAAG;AACd;;;;;;;;;;;;;;;;;ACrIA,iBAAiB,SAAI,IAAI,SAAI;AAC7B,4BAA4B,+DAA+D,iBAAiB;AAC5G;AACA,oCAAoC,MAAM,+BAA+B,YAAY;AACrF,mCAAmC,MAAM,mCAAmC,YAAY;AACxF,gCAAgC;AAChC;AACA,KAAK;AACL;AAC6C;AACmB;AAChE;AACO,gCAAgC,qDAAW;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,6EAAwB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,iBAAiB,oCAAoC;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,QAAQ,SAAS;AAClC,gBAAgB,SAAS,UAAU,uBAAuB;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,GAAG,GAAG,GAAG;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,kCAAkC;AACjF;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;;;;;;;;;;;;;;;;AClRiE;AACT;AACjD,iCAAiC,uDAAY;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,iEAAiB;AAC3D;AACA;AACA;AACA;AACA;AACA,gBAAgB,iEAAsB;AACtC;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;;;;;;;;;;;;;;;;;;;AC5B6C;AAC8B;AACR;AACW;AACC;AACpC;AAC3C;AACO,sCAAsC,qDAAW;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,2FAA+B;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,gFAAmB;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,kFAAqB;AAC1E;AACA;AACA,qDAAqD,oFAAuB;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,uFAAoB;AACzD;AACA;AACA,yBAAyB;AACzB;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,oDAAoD,gDAAK;AACzD;AACA,kDAAkD,gDAAK;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6EAA6E,yEAA4B;AACzG;AACA;AACA,kDAAkD,+DAAkB;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,uFAAoB;AACrD;AACA;AACA,qBAAqB;AACrB;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;AC/M4C;AACO;AACkB;AACtB;AACkB;AACN;AAChB;AACsB;AACE;AACA;AACZ;AAChD;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,aAAa,sBAAsB;AACpF,SAAS;AACT;AACA;AACA,iDAAiD,aAAa,4BAA4B;AAC1F,SAAS;AACT;AACA;AACA,iDAAiD,aAAa,4BAA4B;AAC1F,SAAS;AACT;AACA;AACA,iDAAiD,aAAa,4BAA4B;AAC1F,SAAS;AACT;AACA;AACA,iDAAiD,aAAa,0BAA0B;AACxF,SAAS;AACT;AACA,mCAAmC;AACnC,SAAS;AACT;AACA,sBAAsB,gDAAC;AACvB,yCAAyC,4BAA4B,gDAAC,CAAC,oDAAO,IAAI,oCAAoC;AACtH,QAAQ,gDAAC,CAAC,sEAAgB;AAC1B,YAAY,gDAAC,CAAC,gEAAa,IAAI,SAAS,kFAA0B,mCAAmC,0DAAe,mCAAmC,+DAAkB;AACzK,sCAAsC,+DAAkB;AACxD,mBAAmB;AACnB,YAAY,gDAAC,CAAC,gEAAa,IAAI,SAAS,kFAA0B,iCAAiC,uDAAY,mCAAmC,+DAAkB;AACpK,sCAAsC,+DAAkB;AACxD,mBAAmB;AACnB,YAAY,gDAAC,CAAC,sEAAgB;AAC9B,QAAQ,gDAAC,CAAC,sEAAgB;AAC1B,YAAY,gDAAC,CAAC,wEAAiB,IAAI,SAAS,kFAA0B,4CAA4C,kFAA0B,0HAA0H;AACtQ,YAAY,gDAAC,CAAC,wEAAiB,IAAI,SAAS,kFAA0B,kLAAkL,+DAAkB,2BAA2B;AACrS,YAAY,gDAAC,CAAC,6DAAW,IAAI,SAAS,kFAA0B,8IAA8I,uDAAY,qCAAqC;AAC/P,QAAQ,gDAAC,CAAC,sEAAgB;AAC1B,YAAY,gDAAC,CAAC,sEAAgB;AAC9B,YAAY,gDAAC,CAAC,6DAAW,IAAI,SAAS,kFAA0B,0FAA0F,0DAAe,mCAAmC;AAC5M,QAAQ,gDAAC,CAAC,sEAAgB,IAAI,iBAAiB;AAC/C,YAAY,gDAAC,CAAC,sEAAgB;AAC9B,YAAY,gDAAC,CAAC,gEAAa,IAAI,MAAM,sDAAW,2BAA2B;AAC3E,WAAW,kDAAG;AACd;;;;;;;;;;;;;;;;;;;ACpE6C;AACsB;AACc;AACtC;AAC3C;AACO,uCAAuC,qDAAW;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,6FAAgC;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,gFAAmB;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,gDAAK;AACtC,qCAAqC,gDAAK;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,gDAAK;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;ACjJ4C;AACO;AACkB;AACtB;AACkB;AACN;AAChB;AACsB;AACE;AACA;AACZ;AAChD;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,aAAa,4BAA4B;AAC1F,SAAS;AACT;AACA;AACA,iDAAiD,aAAa,4BAA4B;AAC1F,SAAS;AACT;AACA;AACA,iDAAiD,aAAa,4BAA4B;AAC1F,SAAS;AACT;AACA;AACA,iDAAiD,aAAa,0BAA0B;AACxF,SAAS;AACT;AACA,mCAAmC;AACnC,SAAS;AACT;AACA,sBAAsB,gDAAC;AACvB,0CAA0C,4BAA4B,gDAAC,CAAC,oDAAO,IAAI,oCAAoC;AACvH,QAAQ,gDAAC,CAAC,sEAAgB;AAC1B,YAAY,gDAAC,CAAC,wEAAiB,IAAI,SAAS,kFAA0B,4CAA4C,kFAA0B,0HAA0H;AACtQ,YAAY,gDAAC,CAAC,wEAAiB,IAAI,SAAS,kFAA0B,6KAA6K,+DAAkB,2BAA2B;AAChS,YAAY,gDAAC,CAAC,6DAAW,IAAI,SAAS,kFAA0B,8IAA8I,uDAAY,qCAAqC;AAC/P,QAAQ,gDAAC,CAAC,sEAAgB;AAC1B,YAAY,gDAAC,CAAC,sEAAgB;AAC9B,YAAY,gDAAC,CAAC,6DAAW,IAAI,SAAS,kFAA0B,0FAA0F,0DAAe,mCAAmC;AAC5M,QAAQ,gDAAC,CAAC,sEAAgB,IAAI,iBAAiB;AAC/C,YAAY,gDAAC,CAAC,sEAAgB;AAC9B,YAAY,gDAAC,CAAC,gEAAa,IAAI,MAAM,sDAAW,2BAA2B;AAC3E,WAAW,kDAAG;AACd;;;;;;;;;;;;;;;;;;;;;ACxDiE;AACG;AACE;AACnB;AACT;AAC2B;AAC9D,oCAAoC,uDAAY;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,+DAAkB,EAAE,+DAAkB;AAClE,sBAAsB,oDAAU;AAChC,yBAAyB,kFAA0B;AACnD;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA,0CAA0C,6EAAuB,EAAE,+DAAkB;AACrF;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,+EAAwB;AAC/D;AACA;AACA;AACA;AACA,gBAAgB,gEAAqB;AACrC;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;ACjD6C;AAC6B;AACP;AACW;AACA;AACT;AACP;AAC9D;AACO,sCAAsC,qDAAW;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,2FAA+B;AACvC;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,gFAAmB;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA,qDAAqD,kFAAqB;AAC1E;AACA;AACA,qDAAqD,oFAAuB;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,uFAAoB;AAC7D;AACA;AACA,yBAAyB;AACzB;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D,kFAA0B;AACzF;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,8DAAiB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA,4BAA4B,uEAAwB;AACpD;AACA;AACA,8BAA8B,8DAAiB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,8DAAiB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,kFAA0B;AAChD,8DAA8D,uEAA0B;AACxF;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;AC7P4C;AACyB;AACtB;AACkB;AACN;AAChB;AACsB;AAChB;AAC1C;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,aAAa,sBAAsB;AACpF,SAAS;AACT;AACA;AACA;AACA;AACA,oBAAoB,gDAAC,UAAU,0BAA0B;AACzD,gBAAgB,gDAAC,UAAU,sBAAsB;AACjD;AACA;AACA,mBAAmB,gDAAC,UAAU,0BAA0B;AACxD;AACA,gBAAgB,gDAAC,UAAU,0BAA0B;AACrD;AACA;AACA;AACA,kBAAkB,kFAA0B;AAC5C;AACA;AACA;AACA,oBAAoB,gDAAC,UAAU,4BAA4B,EAAE,kFAA0B;AACvF;AACA;AACA;AACA,oBAAoB,gDAAC,UAAU,4BAA4B;AAC3D,gBAAgB,gDAAC,UAAU,sBAAsB;AACjD;AACA;AACA,mBAAmB,gDAAC,UAAU,4BAA4B;AAC1D;AACA,gBAAgB,gDAAC,UAAU,4BAA4B;AACvD;AACA;AACA;AACA,kBAAkB,kFAA0B;AAC5C;AACA,sBAAsB,gDAAC;AACvB,yCAAyC,4BAA4B,gDAAC,CAAC,oDAAO,IAAI,oCAAoC;AACtH,QAAQ,gDAAC,CAAC,sEAAgB;AAC1B,YAAY,gDAAC,CAAC,sDAAQ,IAAI;AAC1B;AACA;AACA,iBAAiB,+DAA+D;AAChF,QAAQ,gDAAC,CAAC,sEAAgB,IAAI,iBAAiB;AAC/C,YAAY,gDAAC,CAAC,sEAAgB;AAC9B,YAAY,gDAAC,CAAC,gEAAa,IAAI,MAAM,sDAAW,0BAA0B;AAC1E,WAAW,kDAAG;AACd;;;;;;;;;;;;;;;;;AChEiE;AACG;AAC7D,oCAAoC,uDAAY;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,6EAAuB;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,gEAAqB;AACrC;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;;;;;;;;;;;;;;;;;;AClC6C;AACO;AACe;AACiB;AACR;AAC5E;AACO,qCAAqC,qDAAW;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,yFAA8B;AACtC;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,6FAAgB;AACpC,qDAAqD,gFAAmB;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,oFAAuB;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,sBAAsB,6DAAgB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,2BAA2B;AAC3E;AACA;AACA,SAAS;AACT;AACA;;;;;;;;;;;;;;;;;;;;;;ACjI4C;AACG;AACkB;AACN;AAChB;AACsB;AACV;AAChD;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,aAAa,sBAAsB;AACpF,SAAS;AACT;AACA,sBAAsB,gDAAC;AACvB,wCAAwC,4BAA4B,gDAAC,CAAC,oDAAO,IAAI,oCAAoC;AACrH,QAAQ,gDAAC,CAAC,sEAAgB;AAC1B,YAAY,gDAAC,CAAC,4DAAW,IAAI,0DAA0D,0DAAe,gDAAgD;AACtJ,QAAQ,gDAAC,CAAC,sEAAgB,IAAI,iBAAiB;AAC/C,YAAY,gDAAC,CAAC,sEAAgB;AAC9B,YAAY,gDAAC,CAAC,gEAAa,IAAI,MAAM,sDAAW,0BAA0B;AAC1E,WAAW,kDAAG;AACd;;;;;;;;;;;;;;;;;AC1BiE;AACC;AAC3D,mCAAmC,uDAAY;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,2EAAsB;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,gEAAqB;AACrC;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;;;;;;;;;;;;;ACjCA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;AC1CuD;AACb;AACc;AACxD;AACA;AACA,sCAAsC,YAAY,6BAA6B,SAAS,YAAY,cAAc;AAClH;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,2EAAsB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,8DAA0B;AACnD;AACA;AACA;AACA;AACA,0BAA0B;AAC1B,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,iEAAiB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;ACnXsC;AAC/B;AACP,KAAK,oDAAgB;AACrB,KAAK,oDAAgB;AACrB,KAAK,yDAAqB;AAC1B,KAAK,oDAAgB;AACrB,KAAK,sDAAkB;AACvB,KAAK,sDAAkB;AACvB,KAAK,uDAAmB;AACxB,KAAK,yDAAqB;AAC1B,KAAK,yDAAqB;AAC1B,KAAK,yDAAqB;AAC1B,KAAK,wDAAoB;AACzB,KAAK,0DAAsB;AAC3B,KAAK,qDAAiB;AACtB,KAAK,qDAAiB;AACtB,KAAK,mDAAe;AACpB,KAAK,qDAAiB;AACtB,KAAK,+DAA2B;AAChC,KAAK,qDAAiB;AACtB,KAAK,qDAAiB;AACtB,KAAK,sDAAkB;AACvB,KAAK,sDAAkB;AACvB,KAAK,4DAAwB;AAC7B,KAAK,wDAAoB;AACzB,KAAK,yDAAqB;AAC1B,KAAK,sDAAkB;AACvB;;;;;;;;;;;;;;;;;;;;;;;;;;;AC3BO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,0CAA0C;AACpC;AACP;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,sDAAsD;AAChD;AACP;AACA;AACA;AACA;AACA,CAAC,oDAAoD;AAC9C;AACP;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gCAAgC;AAC1B;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,kCAAkC;AAC5B;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gDAAgD;AAC1C;AACP;AACA;AACA;AACA;AACA,CAAC,gCAAgC;AAC1B;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,8CAA8C;AACxC;AACP;AACA;AACA;AACA;AACA,CAAC,sCAAsC;AAChC;AACP;AACA;AACA;AACA,CAAC,8BAA8B;AACxB;AACP;AACA;AACA;AACA;AACA,CAAC,4CAA4C;AACtC;AACP;AACA;AACA;AACA;AACA,CAAC,wCAAwC;AAClC;AACP;AACA;AACA;AACA,CAAC,8CAA8C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AChHvB;AACA;AACO;;;;;;;;;;;;;;;ACFxB;AACP;AACA;AACA;AACA,CAAC,4BAA4B;;;;;;;;;;;;;;;ACJtB;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS,IAAI,eAAe;AAC5B;AACA;AACA,SAAS,IAAI,eAAe;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,6BAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,eAAe;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,uEAAuE,gBAAgB;AACvF;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,6BAA6B;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,uEAAuE,gBAAgB;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACpVA,iBAAiB,SAAI,IAAI,SAAI;AAC7B,4BAA4B,+DAA+D,iBAAiB;AAC5G;AACA,oCAAoC,MAAM,+BAA+B,YAAY;AACrF,mCAAmC,MAAM,mCAAmC,YAAY;AACxF,gCAAgC;AAChC;AACA,KAAK;AACL;AAC4C;AAC6D;AACvC;AACR;AACZ;AAC4C;AACxB;AACV;AACM;AACoB;AACZ;AACQ;AACnB;AACJ;AACD;AACb;AAClC;AACP;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,yDAAW;AAChC;AACA;AACA;AACA;AACA,kDAAkD,kDAAW;AAC7D;AACA;AACA,gCAAgC,yDAAY;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,uDAAY;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT,QAAQ,2FAAmC;AAC3C,QAAQ,0EAAsB;AAC9B;AACA;AACA,uDAAuD,kGAAqB;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,gBAAgB,wFAAkC;AAClD,uCAAuC,wFAAkC;AACzE;AACA,gBAAgB,8FAAwC;AACxD,uCAAuC,8FAAwC;AAC/E;AACA,gBAAgB,4FAAsC;AACtD,uCAAuC,4FAAsC;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,yBAAyB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA,2BAA2B,iBAAiB,KAAK,iBAAiB;AAClE;AACA;AACA,2BAA2B,aAAa;AACxC;AACA;AACA,2BAA2B,aAAa,KAAK,aAAa;AAC1D;AACA;AACA,2BAA2B,YAAY;AACvC;AACA;AACA,2BAA2B,eAAe,KAAK,eAAe;AAC9D;AACA;AACA;AACA;AACA;AACA,uCAAuC,yDAAY;AACnD;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4EAAsB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,0DAA0D;AAC1E;AACA,gFAAgF,gFAAkB;AAClG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,iDAAiD,0FAAoC;AACrF;AACA;AACA;AACA,4BAA4B,eAAe;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,oBAAoB,yDAAyD;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,uEAA0B;AAClE;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,gBAAgB,mCAAmC;AACnD;AACA;AACA,oBAAoB,uBAAuB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,uBAAuB;AACvD;AACA;AACA;AACA;AACA;AACA,gCAAgC,oBAAoB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,IAAI;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,wEAAwB;AACjD;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,YAAY,2EAAgB;AAC5B,YAAY,uEAAc;AAC1B,YAAY,2FAAwB;AACpC,YAAY,gFAAkB;AAC9B,YAAY,iEAAW;AACvB;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,uDAAuD,YAAY;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,6CAA6C;AAClF;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,iEAAiE,gDAAgD;AACjH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,MAAM;AACxC;AACA;AACA,mCAAmC,MAAM;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,MAAM;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,gEAAoB;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,YAAY;AAC5B;AACA,qCAAqC,mEAAmB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,oEAAwB;AACnE;AACA;AACA,iEAAiE,6BAA6B;AAC9F;AACA;AACA;AACA,2CAA2C,0EAA8B;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,mEAAmB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,mEAAmB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,gEAAmB;AAC3D;AACA;AACA;AACA,wCAAwC,iEAAoB;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,qBAAqB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,2BAA2B;AAC/C;AACA;AACA;AACA;AACA,+BAA+B,oEAAwB;AACvD,qDAAqD,6BAA6B;AAClF;AACA;AACA,+BAA+B,0EAA8B;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,oEAAwB;AACvD,qDAAqD,6BAA6B;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,+BAA+B,aAAa;AAC5C;AACA;AACA,4CAA4C,uEAA0B;AACtE;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,uEAA0B;AAC5D;AACA;AACA;AACA;AACA;AACA,kCAAkC,uEAA0B;AAC5D;AACA;AACA;AACA;AACA;AACA,yCAAyC,uEAA0B;AACnE;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,uEAA0B;AACpE;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,gEAAmB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+EAA+E,QAAQ;AACvF;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,0DAA0D;AAClF;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;ACzpCoD;AAC7C;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,gCAAgC,6DAAgB;AAChD;AACA;AACA,gCAAgC,kEAAqB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,yCAAyC;AACzC,gBAAgB,YAAY;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACO;AACP;AACA,+BAA+B,iBAAiB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA,+BAA+B,iBAAiB;AAChD;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;ACvJO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;ACzDO;AACP;AACA;AACA;AACA;AACA,aAAa,+BAA+B;AAC5C,cAAc,+BAA+B;AAC7C;AACA;AACO;AACP;AACA;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,4FAA4F,aAAa,mBAAmB;AAC5H;;;;;;;;;;;;;;;;;;ACtCqE;AAC9D;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,4DAAe;AAC5B,oBAAoB,0EAA6B;AACjD;AACA,aAAa,+BAA+B;AAC5C,cAAc,+BAA+B;AAC7C;AACO;AACP,uFAAuF,aAAa,6DAA6D;AACjK,uFAAuF,aAAa,2DAA2D;AAC/J;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,8EAA8E,aAAa,iCAAiC;AAC5H,+EAA+E,aAAa,WAAW;AACvG,gFAAgF,aAAa,mCAAmC;AAChI,4EAA4E,aAAa,SAAS;AAClG,0FAA0F,aAAa,gBAAgB;AACvH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;AC9FO;AACP;AACA;AACA;AACA;AACA;AACA,SAAS,+BAA+B;AACxC,SAAS,+BAA+B;AACxC;AACO;AACP,sEAAsE,aAAa,QAAQ;AAC3F;AACA;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;;;;;;;;;;;;;;;AC5BO;AACP;AACA;AACA,WAAW,+BAA+B;AAC1C,YAAY,+BAA+B;AAC3C;AACO;AACP;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;;;;;;;;;;;;;;;ACtBO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,iFAAiF,uBAAuB,sBAAsB;AAC9H,uFAAuF,uBAAuB,gBAAgB;AAC9H;AACA,6CAA6C,aAAa,eAAe;AACzE,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;;;;;;;;;;;;;;;;;;;;;;;;ACxBsC;AACC;AACM;AACV;AACA;AACE;AACF;AACA;AAC5B;AACP,cAAc,4CAAc;AAC5B,iBAAiB,+CAAiB;AAClC,YAAY,0CAAY;AACxB,YAAY,0CAAY;AACxB,aAAa,2CAAa;AAC1B,kBAAkB,2CAAa;AAC/B,YAAY,0CAAY;AACxB,YAAY,0CAAY;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,cAAc,8CAAgB;AAC9B,iBAAiB,iDAAmB;AACpC,YAAY,4CAAc;AAC1B,YAAY,4CAAc;AAC1B,YAAY,4CAAc;AAC1B,aAAa,6CAAe;AAC5B,kBAAkB,6CAAe;AACjC,YAAY,4CAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,wEAAwE,aAAa,sDAAsD,oBAAoB,0JAA0J,8CAA8C,yBAAyB,oDAAoD,2CAA2C,sBAAsB,+KAA+K,yCAAyC,oBAAoB,qEAAqE,yCAAyC,oBAAoB,uDAAuD,0CAA0C,qBAAqB,2DAA2D,GAAG;AACvhC;AACO;AACP,WAAW,mDAAQ;AACnB;;;;;;;;;;;;;;;;;;;AC9CA,iBAAiB,SAAI,IAAI,SAAI;AAC7B,4BAA4B,+DAA+D,iBAAiB;AAC5G;AACA,oCAAoC,MAAM,+BAA+B,YAAY;AACrF,mCAAmC,MAAM,mCAAmC,YAAY;AACxF,gCAAgC;AAChC;AACA,KAAK;AACL;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gCAAgC;AAC1B;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD;AAChD,CAAC,kCAAkC;AAC5B;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,6CAA6C,aAAa,iBAAiB;AAC3E,KAAK;AACL,2EAA2E,aAAa,qBAAqB;AAC7G,gFAAgF,aAAa,qEAAqE;AAClK,iFAAiF,aAAa,mOAAmO;AACjU;AACA;AACA,6CAA6C,aAAa,6LAA6L;AACvP,KAAK;AACL;AACA,6CAA6C,aAAa,yRAAyR;AACnV,KAAK;AACL;AACA;AACA;AACA,6CAA6C,aAAa;AAC1D,kBAAkB;AAClB,KAAK;AACL;AACA,6CAA6C,aAAa,oBAAoB;AAC9E,KAAK;AACL;AACA,gBAAgB,kBAAkB;AAClC;AACA;AACA,kDAAkD;AAClD;AACA;AACA;AACA,wBAAwB,yDAAyD;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,6CAA6C,aAAa;AAC1D,4HAA4H;AAC5H,KAAK;AACL;AACA;AACA;AACA,6CAA6C,aAAa;AAC1D,sJAAsJ;AACtJ,KAAK;AACL;AACA,6CAA6C,aAAa,kBAAkB;AAC5E,KAAK;AACL;AACA;AACA;AACA,6CAA6C,aAAa;AAC1D,yBAAyB;AACzB,KAAK;AACL;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;;;;;;;;;ACzKuF;AACxC;AAC+B;AACL;AACd;AACL;AAChD,uCAAuC,yDAAa;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,8BAA8B,uFAA0B;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,oCAAoC,qEAAgB;AACpD;AACA;AACA;AACA,gDAAgD,yEAA8B;AAC9E;AACA;AACA,gBAAgB,iBAAiB;AACjC,gCAAgC,0EAA6B;AAC7D,+BAA+B,4EAA+B;AAC9D,+BAA+B,6EAAgC;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,6DAAkB;AACxC,yBAAyB,yEAA8B;AACvD,yBAAyB,oEAAyB;AAClD;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,4DAA4D,QAAQ;AACpE;AACA;AACA;AACA,+DAA+D,+DAAkB;AACjF;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,yEAA8B;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,sBAAsB;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,8DAAmB;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,kEAAqB;AACvD,kCAAkC,kEAAqB;AACvD,kCAAkC,iEAAoB;AACtD,kCAAkC,mEAAsB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,kEAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,gEAAe;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gEAAe;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,0BAA0B;AAC1E,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,0BAA0B;AAC9E,iBAAiB;AACjB;AACA;AACA;AACA,gDAAgD,0BAA0B;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,YAAY;AAChC;AACA;AACA;AACA,kCAAkC,kEAAqB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,uEAA0B;AAC5D;AACA;AACA;AACA;;;;;;;;;;;;;;;;AChcgD;AACzC,6BAA6B,yDAAa;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;ACvBmE;AACnB;AACU;AACL;AAC9C,+BAA+B,yDAAa;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,6DAAkB;AACzE;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,8DAAmB;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,kEAAqB;AAC/D,yCAAyC,iEAAoB;AAC7D,yCAAyC,mEAAsB;AAC/D;AACA,6DAA6D,2DAAgB;AAC7E;AACA,8CAA8C,6DAAgB;AAC9D;AACA,yEAAyE,gEAAmB;AAC5F;AACA,wDAAwD,8DAAiB;AACzE;AACA,iEAAiE,8DAAmB;AACpF;AACA;AACA,4EAA4E,gEAAmB;AAC/F;AACA;AACA;AACA,wDAAwD,8DAAiB;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D,2DAAgB;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,gCAAgC;AACxD,0CAA0C,qEAA0B;AACpE;AACA,0DAA0D,+BAA+B;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,+BAA+B;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,iBAAiB;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,qCAAqC;AACzE;AACA;AACA;AACA,oBAAoB,kEAAmB;AACvC;AACA;AACA;AACA;AACA,gCAAgC,gBAAgB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;ACjJgD;AACe;AAClB;AACtC,0BAA0B,yDAAa;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,oEAAe;AAC3B,YAAY,oEAAe;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,6DAAkB;AACrD,sCAAsC,yEAA8B;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;AC3SgD;AACI;AAC4B;AACrC;AACoC;AACxB;AAChD,iCAAiC,yDAAa;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,mEAAwB;AAC1D;AACA;AACA;AACA;AACA;AACA,kCAAkC,qEAA0B;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,iDAAiD,0CAA0C;AAC3F;AACA;AACA,uCAAuC,6DAAkB;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,oCAAoC;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,wBAAwB,iBAAiB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,2DAAgB;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,6BAA6B;AAC9E;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,8DAAmB;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,6FAA6B;AACrC;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,qCAAqC;AACrE;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,kEAAqB;AACtD,yCAAyC,gDAAK;AAC9C;AACA;AACA;AACA,gCAAgC,4BAA4B;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,gEAAe;AAC/C;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,kEAAmB;AAC3B;AACA;;;;;;;;;;;;;;;;AC3RuD;AAChD;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,4BAA4B;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,gCAAgC;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,gEAAe;AACvB;AACA;;;;;;;;;;;;;;;;;;;ACzGO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,sBAAsB;AAC9C;AACA,4BAA4B,iBAAiB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;AC9IkE;AAClE;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,8BAA8B;AACxB;AACA;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,oEAAe;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,oEAAe;AAClD;AACA;AACA;AACA;AACA,mCAAmC,oEAAe;AAClD;AACA;AACA;AACA;AACA,mCAAmC,oEAAe;AAClD;AACA;AACA;AACA;AACA,mCAAmC,oEAAe;AAClD;AACA;AACA;AACA,gBAAgB,YAAY;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,WAAW;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;AC9W+C;AACO;AACkB;AACtB;AACkB;AACN;AACN;AACV;AACe;AACtD;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,uBAAuB;AAC3C,oBAAoB,YAAY;AAChC;AACA,iDAAiD,aAAa,kFAAkF,sEAAkB,qNAAqN,sEAAkB,wCAAwC,6DAAgB,EAAE;AACnc,SAAS;AACT;AACA,iDAAiD,aAAa,yBAAyB;AACvF,SAAS;AACT;AACA,iDAAiD,aAAa,0BAA0B;AACxF,SAAS;AACT;AACA;AACA,mCAAmC;AACnC,SAAS;AACT;AACA;AACA,mCAAmC;AACnC,SAAS;AACT;AACA;AACA,mCAAmC;AACnC,SAAS;AACT;AACA;AACA,iDAAiD,aAAa,gBAAgB;AAC9E,SAAS;AACT;AACA;AACA,mCAAmC;AACnC,SAAS;AACT;AACA;AACA,iDAAiD,aAAa,iBAAiB;AAC/E,SAAS;AACT;AACA;AACA,iDAAiD,aAAa,4BAA4B;AAC1F,SAAS;AACT;AACA,sBAAsB,gDAAC;AACvB,0BAA0B;AAC1B;AACA;AACA,wBAAwB,gDAAC,CAAC,0DAAU;AACpC,oBAAoB,gDAAC,CAAC,oDAAO;AAC7B,2CAA2C,gDAAC,CAAC,gEAAa,IAAI,SAAS,kFAA0B,+BAA+B,qDAAU,8BAA8B;AACxK,mEAAmE,gDAAC,CAAC,gEAAa,IAAI,SAAS,kFAA0B,gCAAgC,2DAAgB,+BAA+B;AACxM;AACA;AACA;AACA,gBAAgB,gDAAC,CAAC,0DAAU;AAC5B,YAAY,gDAAC,CAAC,oDAAO,oCAAoC,gDAAC,CAAC,sEAAgB;AAC3E,gBAAgB,gDAAC,CAAC,gEAAa,IAAI,0BAA0B,EAAE,kFAA0B;AACzF,gBAAgB,gDAAC,CAAC,gEAAa,IAAI,gCAAgC,EAAE,kFAA0B,kCAAkC,gDAAC,CAAC,sEAAgB;AACnJ;AACA,kDAAkD,gDAAC,CAAC,gEAAa,IAAI;AACrE;AACA,yBAAyB,yFAAyF;AAClH,mCAAmC,gDAAC,CAAC,gEAAa,IAAI,SAAS,kFAA0B,+BAA+B,qDAAU,8BAA8B;AAChK,qCAAqC,gDAAC,CAAC,gEAAa,IAAI,SAAS,kFAA0B,6BAA6B,uDAAY,mHAAmH;AACvP;AACA;AACA;AACA,yCAAyC,gDAAC,CAAC,gEAAa,IAAI,SAAS,kFAA0B,+BAA+B,8DAAmB,qHAAqH;AACtQ,2DAA2D,gDAAC,CAAC,gEAAa,IAAI,SAAS,kFAA0B;AACjH;AACA;AACA,0BAA0B,2DAAgB;AAC1C,0BAA0B,+DAAoB,+BAA+B;AAC7E,6DAA6D,gDAAC,CAAC,gEAAa,IAAI,SAAS,kFAA0B,kCAAkC,iEAAsB,wHAAwH;AACnS,qEAAqE,gDAAC,CAAC,gEAAa,IAAI,SAAS,kFAA0B,qFAAqF,qDAAU,GAAG,uDAAY,6DAA6D;AACtS,qCAAqC,gDAAC,CAAC,gEAAa,IAAI,SAAS,kFAA0B,6BAA6B,0DAAY,wHAAwH;AAC5P;AACA,WAAW,kDAAG;AACd;;;;;;;;;;;;;;;;;;;;;;;;ACpG+C;AACO;AACkB;AACtB;AACkB;AACN;AACJ;AACF;AACV;AACvC;AACP;AACA;AACA;AACA;AACA,sBAAsB,gDAAC;AACvB,0BAA0B;AAC1B,gBAAgB,gDAAC,CAAC,0DAAU;AAC5B,YAAY,gDAAC,CAAC,oDAAO,4BAA4B,gDAAC,CAAC,sEAAgB;AACnE,gBAAgB,gDAAC,CAAC,gEAAa,IAAI,SAAS,kFAA0B,+BAA+B,qDAAU,6BAA6B,OAAO,gDAAC,CAAC,sEAAgB;AACrK,wCAAwC,gDAAC,CAAC,gEAAa,IAAI,SAAS,kFAA0B,+BAA+B,qDAAU,6BAA6B;AACpK,gBAAgB,gDAAC,CAAC,4DAAW,IAAI,SAAS,kFAA0B,oEAAoE,4DAAiB;AACzJ,iDAAiD,kEAAqB;AACtE,uBAAuB;AACvB,gBAAgB,gDAAC,CAAC,4DAAW,IAAI,SAAS,kFAA0B,oEAAoE,0DAAe;AACvJ,iDAAiD,kEAAqB;AACtE,uBAAuB;AACvB,gBAAgB,gDAAC,CAAC,4DAAW,IAAI,SAAS,kFAA0B,mEAAmE,yDAAc;AACrJ,iDAAiD,iEAAoB;AACrE,uBAAuB;AACvB,gBAAgB,gDAAC,CAAC,4DAAW,IAAI,SAAS,kFAA0B,oEAAoE,8DAAmB;AAC3J,iDAAiD,mEAAsB;AACvE,uBAAuB;AACvB;AACA,WAAW,kDAAG;AACd;;;;;;;;;;;;;;;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,oDAAoD;AACpD;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,6DAA6D;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,+EAA+E;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,kBAAkB;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6EAA6E,gCAAgC;AAC7G;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gFAAgF,gCAAgC;AAChH;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gFAAgF,gCAAgC;AAChH;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8EAA8E,gCAAgC;AAC9G;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,6CAA6C;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,kBAAkB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,kBAAkB;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,kBAAkB;AACjE;AACA;AACA,gCAAgC,eAAe;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,kBAAkB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,kBAAkB;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,2CAA2C;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,iEAAiE;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,qDAAqD;AAC9D;AACA;AACA;AACA;AACA,SAAS,2DAA2D;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,kBAAkB;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,kBAAkB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,kBAAkB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gFAAgF,gCAAgC;AAChH;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4EAA4E,gCAAgC;AAC5G;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wFAAwF,gCAAgC;AACxH;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wFAAwF,gCAAgC;AACxH;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sFAAsF,gCAAgC;AACtH;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sFAAsF,gCAAgC;AACtH;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wFAAwF,gCAAgC;AACxH;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uFAAuF,gCAAgC;AACvH;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mFAAmF,gCAAgC;AACnH;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kFAAkF,gCAAgC;AAClH;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sFAAsF,gCAAgC;AACtH;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+FAA+F,gCAAgC;AAC/H;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qFAAqF,gCAAgC;AACrH;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wFAAwF,gCAAgC;AACxH;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iFAAiF,gCAAgC;AACjH;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,kBAAkB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,8EAA8E;AAC3F;AACA;AACA;AACA;AACA;AACA,aAAa,qEAAqE;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,6FAA6F;AAC1G;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,oFAAoF;AACjG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,qEAAqE;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,kBAAkB;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,wDAAwD;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,sCAAsC;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,yDAAyD;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,gEAAgE;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,kBAAkB;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,kBAAkB;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,kBAAkB;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,kBAAkB;AAClE;AACA;AACA,wCAAwC,eAAe;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,6CAA6C;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,sDAAsD;AACnE,SAAS,+CAA+C;AACxD;AACA;AACA;AACA;AACA;AACA,aAAa,0DAA0D;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,4CAA4C;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,0DAA0D;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,+EAA+E;AAC5F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,kBAAkB;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,kBAAkB;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,kBAAkB;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,kBAAkB;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,kBAAkB;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,qDAAqD;AAC9D,KAAK,8CAA8C;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,8CAA8C;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gCAAgC;;;;;;;;;;;;;;;AC/qL1B;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACvC8C;AACoN;AACrL;AACtE;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACO;AACP,MAAM,8CAA8C,uEAA0B,EAAE;AAChF,MAAM,iDAAiD,qEAAwB,EAAE;AACjF,MAAM,2CAA2C,sEAAyB,EAAE;AAC5E,MAAM,2CAA2C,uEAA0B,EAAE;AAC7E,MAAM,+CAA+C,uEAA0B,EAAE;AACjF;AACA;AACA,eAAe,sEAAyB;AACxC,KAAK;AACL,MAAM,+CAA+C,sEAAyB,EAAE;AAChF;AACA;AACA,eAAe,sEAAyB;AACxC,KAAK;AACL,MAAM,0CAA0C,qEAAwB,EAAE;AAC1E,MAAM,gDAAgD,sEAAyB,EAAE;AACjF;AACA;AACA,eAAe,sEAAyB;AACxC,KAAK;AACL;AACA;AACA,eAAe,sEAAyB;AACxC,KAAK;AACL;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,QAAQ,yEAA4B;AACpC,QAAQ,0EAA6B;AACrC,QAAQ,8EAAiC;AACzC,QAAQ,+EAAkC;AAC1C,QAAQ,4EAA+B;AACvC,QAAQ,6EAAgC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,cAAc,UAAU;AACxB,eAAe,UAAU;AACzB,gBAAgB,iBAAiB;AACjC,oBAAoB,eAAe;AACnC,iBAAiB,aAAa;AAC9B,gBAAgB,YAAY;AAC5B,gBAAgB,gBAAgB;AAChC,kBAAkB,kBAAkB;AACpC,kBAAkB,kBAAkB;AACpC,mBAAmB,mBAAmB;AACtC,wBAAwB,eAAe;AACvC;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL,kBAAkB,WAAW;AAC7B;AACA;AACA;AACA,KAAK;AACL,mBAAmB,eAAe;AAClC;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL,4BAA4B,eAAe;AAC3C;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACO;AACP,IAAI,iDAAW;AACf,IAAI,0DAAoB;AACxB,IAAI,yDAAmB;AACvB,IAAI,kDAAY;AAChB,IAAI,8DAAwB;AAC5B,IAAI,+DAAyB;AAC7B,IAAI,2DAAqB;AACzB,IAAI,2DAAqB;AACzB,IAAI,2DAAqB;AACzB;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,uDAAY;AAC/C;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA,qDAAqD;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA,qDAAqD;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA,qDAAqD;AACrD;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA,mDAAmD;AACnD,mDAAmD;AACnD,uDAAuD;AACvD,qDAAqD;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA,qDAAqD;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA,qDAAqD;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA,qDAAqD;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA,4DAA4D;AAC5D,qDAAqD,wDAAkB;AACvE,sFAAsF,wDAAkB;AACxG;AACA,qIAAqI,qDAAe;AACpJ,sFAAsF,qDAAe;AACrG;AACA;AACA;AACA;AACA;AACA;AACA,oEAAoE;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;ACrkBmC;AACY;AACM;AACR;AACV;AAC2B;AAC9D;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,0CAAY;AACxB,kBAAkB,gDAAkB;AACpC,qBAAqB,mDAAqB;AAC1C,iBAAiB,+CAAiB;AAClC,YAAY,0CAAY;AACxB,aAAa,sEAAuB;AACpC;AACA;AACA;AACO;AACP,gDAAgD,+CAA+C,SAAS;AACxG,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,YAAY,4CAAc;AAC1B,kBAAkB,kDAAoB;AACtC,qBAAqB,qDAAuB;AAC5C,iBAAiB,iDAAmB;AACpC,YAAY,4CAAc;AAC1B,2EAA2E,aAAa,qBAAqB;AAC7G,qFAAqF,aAAa,wFAAwF;AAC1L,iFAAiF,aAAa,2DAA2D;AACzJ,oFAAoF,aAAa,8BAA8B;AAC/H;AACA,6CAA6C,aAAa,yFAAyF;AACnJ,KAAK;AACL;AACA,6CAA6C,aAAa,iIAAiI;AAC3L,KAAK;AACL,yEAAyE,aAAa,kIAAkI;AACxN,gFAAgF,aAAa,8IAA8I;AAC3O,kFAAkF,aAAa,uDAAuD;AACtJ;AACA;AACA;AACA,6CAA6C,aAAa,mEAAmE;AAC7H,KAAK;AACL,oEAAoE,+CAA+C,oIAAoI;AACvP;AACA,6CAA6C,aAAa;AAC1D,2DAA2D;AAC3D,KAAK;AACL;AACA,6CAA6C,aAAa,2GAA2G;AACrK,KAAK;AACL;AACA,6CAA6C,aAAa,yIAAyI;AACnM,KAAK;AACL;AACA,6CAA6C,aAAa,0FAA0F;AACpJ,KAAK;AACL,6EAA6E,aAAa,yBAAyB;AACnH,iFAAiF,aAAa,0BAA0B;AACxH,gFAAgF,aAAa,qFAAqF;AAClL,oEAAoE,aAAa,qCAAqC;AACtH;AACA,+BAA+B;AAC/B,KAAK;AACL,iDAAiD;AACjD;;;;;;;;;;;;;;;;;;AC9FO;AACP;AACA;AACA;AACA,CAAC,gCAAgC;AAC1B;AACP;AACA;AACA;AACA;AACA,CAAC,gCAAgC;AAC1B;AACP;AACA;AACA;AACO;AACP,8EAA8E,aAAa,YAAY;AACvG,8EAA8E,aAAa,YAAY;AACvG;;;;;;;;;;;;;;;;AClBO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACO;AACP,4DAA4D,aAAa,qEAAqE;AAC9I;AACA;AACA,wBAAwB,eAAe;AACvC;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,6CAA6C,aAAa,OAAO;AACjE,KAAK;AACL,kFAAkF,aAAa,+FAA+F;AAC9L,0EAA0E,aAAa,oCAAoC;AAC3H,4EAA4E,aAAa,wCAAwC;AACjI,0EAA0E,aAAa,sBAAsB;AAC7G,0EAA0E,aAAa,uBAAuB;AAC9G,iFAAiF,aAAa,sDAAsD;AACpJ;AACA,yCAAyC;AACzC,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL,uEAAuE,aAAa,eAAe,2DAA2D;AAC9J,0EAA0E,aAAa,yBAAyB;AAChH;AACA;AACA,wBAAwB,gBAAgB;AACxC;AACA;AACA,6CAA6C,aAAa,aAAa;AACvE,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,6CAA6C,aAAa,2CAA2C,yBAAyB,+BAA+B,GAAG;AAChK,KAAK;AACL;AACA;AACA;AACA,uEAAuE;AACvE;AACA,6CAA6C,aAAa,2CAA2C,yBAAyB,qBAAqB,GAAG;AACtJ,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA,6CAA6C,aAAa,2CAA2C,yBAAyB,qBAAqB,GAAG;AACtJ,KAAK;AACL;AACA,6CAA6C,aAAa;AAC1D;AACA;AACA,eAAe;AACf,KAAK;AACL,yEAAyE,aAAa,+BAA+B;AACrH;;;;;;;;;;;;;;;;ACjFO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,6CAA6C,aAAa,UAAU;AACpE,KAAK;AACL;AACA,6CAA6C,aAAa,4EAA4E;AACtI,KAAK;AACL,8EAA8E,aAAa,4BAA4B;AACvH;;;;;;;;;;;;;;;;;AClBsE;AAC/D;AACP;AACA;AACA;AACA;AACA,aAAa,4DAAe;AAC5B,oBAAoB,yEAA4B;AAChD;AACA;AACA;AACA;AACA;AACO;AACP,kEAAkE,aAAa,MAAM;AACrF,wEAAwE,aAAa,SAAS;AAC9F,sFAAsF,aAAa,gBAAgB;AACnH,8EAA8E,aAAa,YAAY;AACvG;AACA;AACA,6CAA6C,aAAa,kBAAkB;AAC5E,KAAK;AACL;AACA;AACA,6CAA6C,aAAa,iBAAiB;AAC3E,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,aAAa,YAAY;AACtE,KAAK;AACL;AACA,6CAA6C,aAAa,WAAW;AACrE,KAAK;AACL,+EAA+E,aAAa,gEAAgE;AAC5J;;;;;;;;;;;;;;;;ACtCO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,iFAAiF,aAAa,cAAc;AAC5G,iEAAiE,aAAa,kBAAkB;AAChG,kEAAkE,aAAa,qCAAqC;AACpH,0EAA0E,aAAa,sCAAsC;AAC7H,2EAA2E,aAAa,gCAAgC;AACxH,kEAAkE,aAAa,4BAA4B;AAC3G,8EAA8E,aAAa,wBAAwB;AACnH,+EAA+E,aAAa,qBAAqB;AACjH,sEAAsE,aAAa,mBAAmB;AACtG;;;;;;;;;;;;;;;;;;;;;ACpBuC;AACc;AACR;AACX;AACI;AACA;AAC/B;AACP,yDAAyD,2DAAgB;AACzE;AACA,sCAAsC,4DAAiB;AACvD;AACA;AACA,YAAY,gDAAC,CAAC,+CAAQ,IAAI,WAAW,8DAAU,oCAAoC,iBAAiB;AACpG;AACA,yGAAyG,WAAW,oCAAoC,GAAG;AAC3J,+BAA+B,gDAAC,CAAC,2CAAM;AACvC,QAAQ,gDAAC,CAAC,+CAAK;AACf;;;;;;;;;;;;;;;;;ACjBuC;AACsB;AACtD,yBAAyB,iBAAiB;AACjD,YAAY,gBAAgB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,gDAAC,UAAU,4BAA4B,uBAAuB,gDAAC,2BAA2B,UAAU,iFAA6B,EAAE,EAAE,gFAA4B,aAAa,iDAAiD;AAChQ,QAAQ,gDAAC,WAAW,mBAAmB;AACvC,YAAY,gDAAC,UAAU,cAAc,WAAW,gDAAC,mCAAmC,gDAAC,aAAa,gDAAgD;AAClJ,QAAQ,gDAAC,WAAW,mBAAmB;AACvC,YAAY,gDAAC,UAAU,cAAc;AACrC;AACA;;;;;;;;;;;;;;;;;AChBuC;AACc;AACrD;AACO,oBAAoB,oCAAoC;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,iCAAiC;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,iCAAiC;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC,UAAU,OAAO,8DAAU,6EAA6E;AACrH;;;;;;;;;;;;;;;;;;;;ACjDuC;AACc;AACZ;AACqB;AACC;AACxD,kBAAkB;AACzB,YAAY,kDAAkD;AAC9D,YAAY,gDAAC,UAAU,OAAO,8DAAU;AACxC;AACA;AACA,SAAS,GAAG;AACZ,QAAQ,gDAAC,CAAC,kDAAM;AAChB,QAAQ,gDAAC,UAAU,4BAA4B;AAC/C,YAAY,gDAAC,UAAU,OAAO,8DAAU,2CAA2C,sBAAsB,IAAI;AAC7G,gBAAgB,gDAAC,UAAU;AAC3B;AACA;AACA,uBAAuB;AACvB,6CAA6C,gDAAC,CAAC,uEAAa;AAC5D,YAAY,gDAAC,CAAC,wEAAe;AAC7B;;;;;;;;;;;;;;;;;;;;;;ACpB0C;AACM;AACwB;AACV;AACN;AACV;AACG;AAC1C,yBAAyB;AAChC,oDAAoD,2DAAgB;AACpE;AACA;AACA;AACA,YAAY,gDAAC,UAAU,OAAO,8DAAU,2CAA2C,mDAAmD,IAAI;AAC1I;AACA,uBAAuB,YAAY;AACnC,yBAAyB,gDAAC,CAAC,gEAAa,IAAI,MAAM,gDAAK,8BAA8B,kFAA0B;AAC/G;AACA,eAAe;AACf,QAAQ,gDAAC,CAAC,yDAAa,IAAI,4CAA4C;AACvE;;;;;;;;;;;;;;;;;;;;;;;ACnB0C;AACM;AACwB;AAC1B;AACsB;AACN;AACV;AACH;AAC1C,yBAAyB;AAChC,oDAAoD,2DAAgB;AACpE,oDAAoD,4DAAiB;AACrE,YAAY,UAAU;AACtB,YAAY,2BAA2B;AACvC,YAAY,gDAAC,CAAC,sEAAgB,IAAI,4BAA4B;AAC9D,oDAAoD,gDAAC,CAAC,6DAAe;AACrE,0DAA0D,gDAAC,CAAC,gEAAa,IAAI,+BAA+B,kFAA0B,0BAA0B,uDAAY;AAC5K;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,mCAAmC;AAChD;AACA;AACA;AACA,kDAAkD,gDAAC,CAAC,gEAAa,IAAI,iCAAiC,kFAA0B,kCAAkC,8DAAmB;AACrL;AACA;AACA,aAAa,gDAAgD;AAC7D,QAAQ,gDAAC,CAAC,yDAAa,IAAI,6CAA6C;AACxE;;;;;;;;;;;;;;;;;;;;ACjC0C;AAC8B;AACrB;AACS;AACX;AAC1C,2BAA2B;AAClC;AACA;AACA;AACA,YAAY,gDAAC,CAAC,8DAAY,IAAI,uDAAuD,kFAA0B,yCAAyC,oDAAU,EAAE;AACpK,QAAQ,gDAAC;AACT;AACA;AACA,6BAA6B,gDAAC,aAAa;AAC3C;AACA,mBAAmB;AACnB,gBAAgB,gDAAC,CAAC,8CAAI,IAAI,MAAM,+CAAK,qBAAqB;AAC1D;AACA,gBAAgB,kFAA0B;AAC1C,YAAY,gDAAC,CAAC,yDAAa,IAAI,8CAA8C;AAC7E;;;;;;;;;;;;;;;;;;;;;;;;;;ACpB0C;AACM;AACE;AACkB;AACtC;AACc;AACI;AACZ;AACI;AACJ;AACY;AACzC,kBAAkB;AACzB,oDAAoD,4DAAiB;AACrE,YAAY,qBAAqB;AACjC,YAAY,gDAAC,UAAU,qBAAqB;AAC5C,6DAA6D,gDAAC,CAAC,oDAAO,IAAI,iBAAiB;AAC3F,2BAA2B,gDAAC,CAAC,uCAAI,UAAU,gDAAC,CAAC,qDAAW;AACxD,YAAY,gDAAC,CAAC,yDAAa;AAC3B,YAAY,gDAAC,CAAC,sEAAgB;AAC9B,YAAY,gDAAC,CAAC,6CAAO;AACrB,YAAY,gDAAC,CAAC,sEAAgB;AAC9B,YAAY,gDAAC,CAAC,6CAAO;AACrB,YAAY,gDAAC,CAAC,0DAAa;AAC3B,oFAAoF,gDAAC,CAAC,iDAAS;AAC/F;;;;;;;;;;;;;;;;;;;;;;ACxB0C;AAC8B;AACJ;AACN;AACjB;AACyB;AACrB;AAC1C,uBAAuB;AAC9B,YAAY,yBAAyB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,WAAW;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC,CAAC,sEAAgB,IAAI,8BAA8B;AAChE,4EAA4E,gDAAC,CAAC,wEAAiB,IAAI,oEAAoE,wDAAc,2BAA2B,kFAA0B,uEAAuE,WAAW,cAAc,GAAG;AAC7U,2EAA2E,gDAAC,CAAC,gEAAa,IAAI,oEAAoE,wDAAc,WAAW,kFAA0B,sEAAsE;AAC3R,sCAAsC,gDAAC,CAAC,gEAAa,IAAI,oEAAoE,wDAAc,WAAW,kFAA0B,4DAA4D;AAC5O,uCAAuC,gDAAC,CAAC,gEAAa,IAAI,qEAAqE,yDAAe,WAAW,kFAA0B,8DAA8D;AACjP,sCAAsC,gDAAC,CAAC,gEAAa,IAAI,6DAA6D,qDAAW,WAAW,kFAA0B,+CAA+C;AACrN,QAAQ,gDAAC,CAAC,yDAAa,IAAI,0CAA0C;AACrE;;;;;;;;;;;;;;;;;;;;;;;AClC0C;AACM;AACwB;AACJ;AACjB;AACS;AACU;AACrB;AAC1C,gBAAgB;AACvB,YAAY,yBAAyB;AACrC,YAAY,0CAA0C;AACtD,YAAY,aAAa;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC,CAAC,sEAAgB,IAAI,8BAA8B;AAChE,QAAQ,gDAAC,CAAC,8DAAY,IAAI,iCAAiC,oDAAU,EAAE;AACvE,YAAY,gDAAC;AACb,oFAAoF,gDAAC,YAAY,2BAA2B;AAC5H,oBAAoB,gDAAC,CAAC,8CAAI,IAAI,MAAM,wDAAc,EAAE;AACpD;AACA,oBAAoB,kFAA0B;AAC9C,oBAAoB,gDAAC,YAAY;AACjC;AACA;AACA,mDAAmD,WAAW,cAAc;AAC5E;AACA,yBAAyB,WAAW,mBAAmB;AACvD,mFAAmF,gDAAC,aAAa,uEAAuE;AACxK,oBAAoB,gDAAC,CAAC,8CAAI,IAAI,MAAM,wDAAc,EAAE;AACpD;AACA,oBAAoB,kFAA0B;AAC9C,8CAA8C,gDAAC,aAAa,6DAA6D;AACzH,oBAAoB,gDAAC,CAAC,8CAAI,IAAI,MAAM,wDAAc,EAAE;AACpD;AACA,oBAAoB,kFAA0B;AAC9C,+CAA+C,gDAAC,aAAa,8DAA8D;AAC3H,oBAAoB,gDAAC,CAAC,8CAAI,IAAI,MAAM,yDAAe,EAAE;AACrD;AACA,oBAAoB,kFAA0B;AAC9C,8CAA8C,gDAAC,aAAa,uDAAuD;AACnH,oBAAoB,gDAAC,CAAC,8CAAI,IAAI,MAAM,qDAAW,EAAE;AACjD;AACA,oBAAoB,kFAA0B;AAC9C,gBAAgB,gDAAC,CAAC,yDAAa,IAAI,4CAA4C;AAC/E,+CAA+C,gDAAC,CAAC,wEAAiB;AAClE,gDAAgD,gDAAC,aAAa,wDAAwD;AACtH,oBAAoB,gDAAC,CAAC,8CAAI,IAAI,MAAM,sDAAY,EAAE;AAClD;AACA,oBAAoB,kFAA0B;AAC9C,+BAA+B,2DAAgB,oDAAoD,gDAAC,CAAC,wEAAiB;AACtH,+BAA+B,2DAAgB,0BAA0B,gDAAC,aAAa;AACvF;AACA;AACA,uBAAuB;AACvB,oBAAoB,gDAAC,CAAC,8CAAI,IAAI,MAAM,+DAAqB,EAAE;AAC3D;AACA,oBAAoB,kFAA0B;AAC9C,+BAA+B,2DAAgB,6BAA6B,gDAAC,aAAa;AAC1F;AACA;AACA,uBAAuB;AACvB,oBAAoB,gDAAC,CAAC,8CAAI,IAAI,MAAM,kEAAwB,EAAE;AAC9D;AACA,oBAAoB,kFAA0B;AAC9C;;;;;;;;;;;;;;;;;;;;AC9E0C;AAC8B;AACJ;AACN;AAChB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,0BAA0B;AACxE;AACA;AACA,SAAS;AACT;AACA,CAAC;AACM,yBAAyB;AAChC,YAAY,cAAc;AAC1B,YAAY,gDAAC,CAAC,sEAAgB,IAAI,gCAAgC;AAClE,QAAQ,gDAAC,CAAC,gEAAa,IAAI,+BAA+B,kFAA0B,gCAAgC,6DAAkB,oFAAoF;AAC1N,QAAQ,gDAAC,UAAU,2DAA2D;AAC9E,YAAY,gDAAC,YAAY;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,uCAAuC;AACxD,YAAY,gDAAC,eAAe,kFAA0B;AACtD,YAAY,gDAAC,YAAY;AACzB;AACA,iBAAiB;AACjB;AACA,mBAAmB;AACnB,QAAQ,gDAAC,CAAC,gEAAa,IAAI,2BAA2B,kFAA0B,4BAA4B,yDAAc,qGAAqG;AAC/N;;;;;;;;;;;;;;;;;;;;;;;;ACvE0C;AAC8B;AACtB;AACkB;AACN;AACM;AACtB;AACc;AACZ;AACzC,qBAAqB,0BAA0B,gDAAC,CAAC,oDAAO,IAAI,4BAA4B;AAC/F,IAAI,gDAAC,CAAC,sEAAgB;AACtB,QAAQ,gDAAC,UAAU,8CAA8C;AACjE,YAAY,gDAAC,YAAY;AACzB;AACA;AACA;AACA,gCAAgC,YAAY;AAC5C,oCAAoC,kEAAmB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,gCAAgC,YAAY;AAC5C,oCAAoC,kEAAmB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,mBAAmB;AACnB,QAAQ,gDAAC,CAAC,gEAAa,IAAI,SAAS,kFAA0B,gCAAgC,6DAAkB,wFAAwF;AACxM,QAAQ,gDAAC,CAAC,gEAAa,IAAI,SAAS,kFAA0B,4BAA4B,yDAAc,oFAAoF;AAC5L,QAAQ,gDAAC,CAAC,yDAAa;AACvB,QAAQ,gDAAC,CAAC,sEAAgB;AAC1B,IAAI,gDAAC,CAAC,sEAAgB,IAAI,iBAAiB;AAC3C,QAAQ,gDAAC,CAAC,gEAAa,IAAI,MAAM,sDAAW;AAC5C;AACA;AACA,eAAe;;;;;;;;;;;;;;;;;;;;AC7E2B;AAC8B;AACX;AACV;AACa;AACzD;AACP;AACA,gBAAgB,gDAAC,UAAU,OAAO,kFAA0B,mGAAmG;AAC/J,YAAY,gDAAC,WAAW,4BAA4B;AACpD,gBAAgB,gDAAC,CAAC,8CAAI,IAAI,MAAM,uDAAa,EAAE;AAC/C,YAAY,gDAAC,WAAW,6BAA6B;AACrD,gBAAgB,gDAAC,CAAC,8CAAI,IAAI,MAAM,6DAAmB,EAAE;AACrD;AACA;AACA,gBAAgB,gDAAC,UAAU,kEAAkE;AAC7F,YAAY,gDAAC,2BAA2B,EAAE,gFAA4B,CAAC,kFAA0B,uBAAuB,UAAU,sEAAwB,YAAY,sEAAwB,EAAE;AAChM,gBAAgB,gDAAC,WAAW,4BAA4B;AACxD,oBAAoB,gDAAC,CAAC,8CAAI,IAAI,MAAM,uDAAa,EAAE;AACnD,gBAAgB,gDAAC,WAAW,6BAA6B;AACzD,oBAAoB,gDAAC,CAAC,8CAAI,IAAI,MAAM,6DAAmB,EAAE;AACzD,YAAY,gDAAC,UAAU,4BAA4B;AACnD,gBAAgB,gDAAC;AACjB,oBAAoB,gDAAC,SAAS;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B,uDAAuD,gDAAC,CAAC,8CAAI,IAAI,MAAM,+DAAqB,EAAE,MAAM,gDAAC,CAAC,8CAAI,IAAI,MAAM,wDAAc,EAAE;AACpI,wBAAwB,kFAA0B;AAClD,oBAAoB,gDAAC,SAAS;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B,oDAAoD,gDAAC,CAAC,8CAAI,IAAI,MAAM,+DAAqB,EAAE,MAAM,gDAAC,CAAC,8CAAI,IAAI,MAAM,wDAAc,EAAE;AACjI,wBAAwB,kFAA0B;AAClD,oBAAoB,gDAAC,SAAS;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B,kDAAkD,gDAAC,CAAC,8CAAI,IAAI,MAAM,+DAAqB,EAAE,MAAM,gDAAC,CAAC,8CAAI,IAAI,MAAM,wDAAc,EAAE;AAC/H,wBAAwB,kFAA0B;AAClD;AACA;;;;;;;;;;;;;;;;;;;;;;;;ACrD0C;AAC8B;AACxB;AACwB;AACJ;AACN;AACV;AACR;AACE;AAC9C;AACA;AACA,aAAa,yEAA4B;AACzC,mBAAmB,kFAA0B;AAC7C,aAAa,0EAA6B;AAC1C,mBAAmB,kFAA0B;AAC7C,aAAa,8EAAiC;AAC9C,mBAAmB,kFAA0B;AAC7C,aAAa,+EAAkC;AAC/C,mBAAmB,kFAA0B;AAC7C,aAAa,4EAA+B;AAC5C,mBAAmB,kFAA0B;AAC7C,aAAa,6EAAgC;AAC7C,mBAAmB,kFAA0B;AAC7C;AACA;AACO,mBAAmB;AAC1B,YAAY,cAAc;AAC1B,YAAY,aAAa;AACzB;AACA;AACA;AACA,4BAA4B,gDAAC,WAAW,wCAAwC;AAChF,YAAY,gDAAC,CAAC,8CAAI,IAAI,MAAM,gDAAK,kBAAkB,QAAQ,4CAA4C;AACvG;AACA,KAAK;AACL,YAAY,gDAAC,CAAC,sEAAgB,IAAI,0BAA0B;AAC5D,gCAAgC,4DAAe,KAAK,gDAAC,CAAC,gEAAa,IAAI,0BAA0B,kFAA0B,wBAAwB,8DAAmB;AACtK,uCAAuC,gEAAmB;AAC1D,eAAe;AACf,gCAAgC,gEAAmB,KAAK,gDAAC,CAAC,gEAAa,IAAI,0BAA0B,kFAA0B,wBAAwB,wDAAa;AACpK,uCAAuC,iEAAoB;AAC3D,eAAe;AACf,gCAAgC,iEAAoB,KAAK,gDAAC,CAAC,gEAAa,IAAI,0BAA0B,kFAA0B,yBAAyB,yDAAc;AACvK,uCAAuC,4DAAe;AACtD;AACA,eAAe;AACf,kEAAkE,gDAAC,CAAC,sDAAQ,IAAI,qNAAqN,gDAAC,CAAC,8CAAI,IAAI,MAAM,gDAAK,kBAAkB,EAAE,4CAA4C;AAC1X;AACA,eAAe;AACf,2EAA2E,2DAAgB,KAAK,gDAAC,CAAC,gEAAa,IAAI,6BAA6B,kFAA0B,8BAA8B,uDAAY,+BAA+B;AACnP;;;;;;;;;;;;;;;;;;;;;AClD0C;AAC8B;AAC1B;AACsB;AACN;AACV;AAC7C,mBAAmB;AAC1B,YAAY,oBAAoB;AAChC,YAAY,OAAO;AACnB,YAAY,gDAAC,CAAC,sEAAgB,IAAI,0BAA0B;AAC5D,QAAQ,gDAAC,CAAC,gEAAa,IAAI,yBAAyB,kFAA0B,kEAAkE,uDAAY,gHAAgH;AAC5Q,QAAQ,gDAAC,CAAC,gEAAa,IAAI,0BAA0B,kFAA0B,mEAAmE,wDAAa,sFAAsF;AACrP,QAAQ,gDAAC,CAAC,sDAAQ,IAAI,uBAAuB,kFAA0B;AACvE;AACA;AACA,aAAa,8GAA8G;AAC3H;;;;;;;;;;;;;;;;;;AChB0C;AACS;AACqB;AACjE,4BAA4B;AACnC,kBAAkB,kFAA0B;AAC5C;AACA;AACA,sBAAsB,kFAA0B;AAChD;AACA;AACA,oBAAoB,kFAA0B;AAC9C,YAAY,gDAAC,UAAU,gDAAgD;AACvE,QAAQ,gDAAC,UAAU,2BAA2B;AAC9C,YAAY,gDAAC,UAAU,2BAA2B;AAClD,gBAAgB,gDAAC,CAAC,8CAAI,IAAI,MAAM,qDAAW,EAAE;AAC7C,gBAAgB,gDAAC,aAAa,kFAA0B;AACxD,YAAY,gDAAC,UAAU,yBAAyB;AAChD,gBAAgB,gDAAC,UAAU,4BAA4B;AACvD,oBAAoB,gDAAC;AACrB,4BAA4B,gDAAC,UAAU,sBAAsB;AAC7D,oBAAoB,gDAAC,aAAa;AAClC;AACA,2BAA2B;AAC3B;;;;;;;;;;;;;;;;;ACvB0C;AACM;AACzC,2BAA2B,MAAM,gDAAC,UAAU,+CAA+C;AAClG,IAAI,gDAAC,UAAU,kCAAkC;AACjD,QAAQ,gDAAC,CAAC,kDAAM;;;;;;;;;;;;;;;;;;ACJ0B;AAC8B;AACxB;AACzC,oBAAoB,MAAM,gDAAC,UAAU,wCAAwC;AACpF,IAAI,gDAAC,UAAU,2BAA2B;AAC1C,QAAQ,gDAAC,UAAU,yBAAyB;AAC5C,YAAY,gDAAC,UAAU,4BAA4B;AACnD,gBAAgB,gDAAC,aAAa,kFAA0B;AACxD,gBAAgB,gDAAC,CAAC,kDAAM;;;;;;;;;;;;;;;;;;;;;;;;ACRkB;AACJ;AACU;AACE;AACJ;AACM;AACE;AAChB;AACA;AAC/B,iBAAiB;AACxB;AACA,eAAe,gDAAC,CAAC,+DAAgB;AACjC;AACA;AACA,eAAe,gDAAC,CAAC,6DAAe;AAChC;AACA;AACA,eAAe,gDAAC,CAAC,yDAAa;AAC9B;AACA;AACA,eAAe,gDAAC,CAAC,uDAAY;AAC7B;AACA;AACA,eAAe,gDAAC,CAAC,2DAAc;AAC/B;AACA;AACA,eAAe,gDAAC,CAAC,+CAAQ;AACzB;AACA;AACA,eAAe,gDAAC,CAAC,+CAAQ;AACzB;AACA;AACA,eAAe,gDAAC,CAAC,+CAAQ;AACzB;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;ACrC0C;AACS;AACqB;AACxB;AACzC,oBAAoB;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,WAAW,oCAAoC;AAClF;AACA;AACA;AACA,YAAY,yBAAyB;AACrC,YAAY,aAAa;AACzB,YAAY,gDAAC,UAAU,sDAAsD;AAC7E,QAAQ,gDAAC,UAAU,2BAA2B;AAC9C,YAAY,gDAAC,UAAU,2BAA2B;AAClD,gBAAgB,gDAAC,CAAC,8CAAI,IAAI,MAAM,uDAAa,EAAE;AAC/C,YAAY,gDAAC,UAAU,yBAAyB;AAChD,gBAAgB,gDAAC,UAAU,4BAA4B,iBAAiB,6DAAkB;AAC1F;AACA,iDAAiD,gDAAC,aAAa,kFAA0B,2DAA2D,gDAAC,aAAa,kFAA0B,+BAA+B,gDAAC,aAAa,kFAA0B;AACnQ,gBAAgB,gDAAC,UAAU,sBAAsB,oEAAoE,gDAAC,aAAa,8DAA8D,EAAE,kFAA0B,6BAA6B,gDAAC,YAAY,kBAAkB;AACzR,oBAAoB,kFAA0B;AAC9C,oBAAoB,gDAAC,YAAY,qDAAqD,mBAAmB,QAAQ,gDAAC;AAClH;;;;;;;;;;;;;;;;;;AC5B0C;AACS;AACqB;AACjE,yBAAyB,0BAA0B,gDAAC,UAAU,6CAA6C;AAClH,IAAI,gDAAC,UAAU,2BAA2B;AAC1C,QAAQ,gDAAC,UAAU,2BAA2B;AAC9C,YAAY,gDAAC,CAAC,8CAAI,IAAI,MAAM,yDAAe,EAAE;AAC7C,QAAQ,gDAAC,UAAU,yBAAyB;AAC5C,YAAY,gDAAC,UAAU,4BAA4B;AACnD,gBAAgB,gDAAC,YAAY,kFAA0B;AACvD,YAAY,gDAAC,UAAU,sBAAsB;AAC7C,gBAAgB,gDAAC,aAAa,gEAAgE,EAAE,kFAA0B;;;;;;;;;;;;;;;;;;;ACXhF;AACS;AACK;AACgB;AACjE,wBAAwB;AAC/B;AACA;AACA;AACA;AACA,YAAY,gDAAC,UAAU,4CAA4C;AACnE,QAAQ,gDAAC,UAAU,2BAA2B;AAC9C,YAAY,gDAAC,UAAU,2BAA2B;AAClD,gBAAgB,gDAAC,CAAC,8CAAI,IAAI,MAAM,sDAAY,EAAE;AAC9C,YAAY,gDAAC,UAAU,yBAAyB;AAChD,gBAAgB,gDAAC,WAAW;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+EAA+E,yBAAyB,UAAU;AAClH;AACA;AACA,uBAAuB;AACvB,oBAAoB,gDAAC,UAAU,4BAA4B;AAC3D,wBAAwB,gDAAC,YAAY,kFAA0B;AAC/D,oBAAoB,gDAAC,UAAU,uBAAuB;AACtD,wBAAwB,gDAAC,UAAU,8CAA8C;AACjF,4BAA4B,gDAAC,YAAY;AACzC;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA,mCAAmC;AACnC,wEAAwE,gDAAC,UAAU,yBAAyB;AAC5G,gCAAgC,gDAAC,CAAC,8CAAI,IAAI,MAAM,uDAAa,EAAE;AAC/D,gCAAgC,gDAAC,eAAe,kFAA0B;AAC1E,yEAAyE,gDAAC,UAAU,yBAAyB;AAC7G,gCAAgC,gDAAC,CAAC,8CAAI,IAAI,MAAM,uDAAa,EAAE;AAC/D,gCAAgC,gDAAC,eAAe,kFAA0B;AAC1E,oBAAoB,gDAAC,UAAU,sBAAsB;AACrD,wBAAwB,gDAAC,aAAa,OAAO,8DAAU;AACvD;AACA,6BAA6B,2CAA2C,EAAE,kFAA0B;AACpG,mDAAmD,gDAAC,aAAa,uEAAuE,EAAE,kFAA0B;AACpK;;;;;;;;;;;;;;;;;;ACpD0C;AAC8B;AACxB;AACzC,oBAAoB,0BAA0B,gDAAC,UAAU,wCAAwC;AACxG,IAAI,gDAAC,UAAU,2BAA2B;AAC1C,QAAQ,gDAAC,UAAU,yBAAyB;AAC5C,YAAY,gDAAC,UAAU,4BAA4B;AACnD,gBAAgB,gDAAC,aAAa,kFAA0B;AACxD,gBAAgB,gDAAC,CAAC,kDAAM;;;;;;;;;;;;;;;;;;ACRkB;AACS;AACqB;AACjE,0BAA0B,4BAA4B,gDAAC,UAAU,8CAA8C;AACtH,IAAI,gDAAC,UAAU,2BAA2B;AAC1C,QAAQ,gDAAC,UAAU,2BAA2B;AAC9C,YAAY,gDAAC,CAAC,8CAAI,IAAI,MAAM,uDAAa,EAAE;AAC3C,QAAQ,gDAAC,UAAU,yBAAyB;AAC5C,YAAY,gDAAC,UAAU,4BAA4B;AACnD,gBAAgB,gDAAC,YAAY,kFAA0B;AACvD,YAAY,gDAAC,UAAU,sBAAsB;AAC7C,gBAAgB,gDAAC,aAAa;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,uBAAuB,EAAE,kFAA0B;AACnD,gBAAgB,gDAAC,aAAa;AAC9B;AACA;AACA;AACA;AACA,uBAAuB,EAAE,kFAA0B;AACnD,gBAAgB,gDAAC,aAAa,gEAAgE,EAAE,kFAA0B;;;;;;;;;;;;;;;;;;;AC9B9D;AAClB;AACgB;AACc;AACjE;AACP,YAAY,aAAa;AACzB;AACA;AACA;AACA;AACA;AACA,sCAAsC,qEAAkB;AACxD;AACA;AACA;AACA;AACA,YAAY,gDAAC;AACb,QAAQ,gDAAC;AACT,YAAY,kFAA0B;AACtC;AACA;AACA,QAAQ,gDAAC,oDAAoD,gDAAC,CAAC,mEAAkB,IAAI;AACrF;AACA,mEAAmE;AACnE;;;;;;;;;;;;;;;;;;;;;ACxB0C;AAC8B;AACZ;AACT;AACK;AACL;AACnD,0BAA0B,WAAW;AACrC,YAAY,kBAAkB;AAC9B;AACA;AACA,aAAa,wEAAqB;AAClC,aAAa,uEAAoB;AACjC,aAAa,wEAAqB;AAClC,aAAa,yEAAsB;AACnC,mBAAmB,gDAAC,CAAC,8CAAI,IAAI,MAAM,2DAAiB,UAAU;AAC9D,aAAa,oEAAiB;AAC9B,mBAAmB,gDAAC,CAAC,8CAAI,IAAI,MAAM,qDAAW,UAAU;AACxD,aAAa,wEAAqB;AAClC,mBAAmB,gDAAC,CAAC,8CAAI,IAAI,MAAM,wDAAc,UAAU;AAC3D,aAAa,oEAAiB;AAC9B,aAAa,mEAAgB;AAC7B,mBAAmB,gDAAC,CAAC,8CAAI,IAAI,MAAM,0DAAgB,UAAU;AAC7D,aAAa,kEAAe;AAC5B,mBAAmB,gDAAC,CAAC,8CAAI,IAAI,MAAM,sDAAY,UAAU;AACzD,aAAa,qEAAkB;AAC/B;AACA,mBAAmB,gDAAC,CAAC,8CAAI,IAAI,MAAM,yDAAe,YAAY;AAC9D;AACA,aAAa,qEAAkB;AAC/B;AACA,mBAAmB,gDAAC,CAAC,8CAAI,IAAI,MAAM,sDAAY,YAAY;AAC3D;AACA;AACA,mBAAmB,gDAAC,CAAC,8CAAI,IAAI,MAAM,0DAAgB,UAAU;AAC7D;AACA;AACA,uBAAuB,MAAM;AAC7B;AACA;AACA,oBAAoB,gDAAC;AACrB,gBAAgB,gDAAC;AACjB,oBAAoB,gDAAC,CAAC,8CAAI,IAAI,MAAM,wDAAc,EAAE;AACpD,8BAA8B,gDAAC,WAAW,qBAAqB;AAC/D,oBAAoB,gDAAC,eAAe,yDAAU;AAC9C;AACA;AACA;AACA,gCAAgC,uBAAuB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gDAAC;AACrB,gBAAgB,gDAAC;AACjB,oBAAoB,gDAAC,CAAC,8CAAI,IAAI,MAAM,mDAAS,EAAE;AAC/C,8BAA8B,gDAAC,WAAW,qBAAqB;AAC/D,oBAAoB,gDAAC,eAAe,yDAAU;AAC9C,gBAAgB,gDAAC,UAAU,wCAAwC;AACnE,uCAAuC,gDAAC;AACxC,2CAA2C,gDAAC;AAC5C;AACA,oBAAoB,gDAAC;AACrB,gBAAgB,gDAAC;AACjB,oBAAoB,gDAAC,CAAC,8CAAI,IAAI,MAAM,oDAAU,EAAE;AAChD,8BAA8B,gDAAC,WAAW,qBAAqB;AAC/D,oBAAoB,gDAAC,eAAe,yDAAU;AAC9C;AACA,oBAAoB,gDAAC;AACrB,gBAAgB,gDAAC;AACjB,oBAAoB,gDAAC,CAAC,8CAAI,IAAI,MAAM,sDAAY,EAAE;AAClD,8BAA8B,gDAAC,WAAW,qBAAqB;AAC/D,oBAAoB,gDAAC,eAAe,yDAAU;AAC9C;AACA,oBAAoB,gDAAC;AACrB,gBAAgB,gDAAC;AACjB,oBAAoB,gDAAC,CAAC,8CAAI,IAAI,MAAM,yDAAY,EAAE;AAClD,8BAA8B,gDAAC,WAAW,qBAAqB;AAC/D,oBAAoB,gDAAC,eAAe,yDAAU;AAC9C;AACA,mBAAmB,gDAAC;AACpB;AACA;AACA,6BAA6B,WAAW;AACxC,YAAY,8BAA8B;AAC1C;AACA,aAAa,wEAAqB;AAClC,mBAAmB,gDAAC,WAAW,SAAS,0BAA0B;AAClE,aAAa,uEAAoB;AACjC,oBAAoB,gDAAC,WAAW;AAChC;AACA;AACA;AACA,mBAAmB;AACnB,aAAa,wEAAqB;AAClC,oBAAoB,gDAAC,WAAW;AAChC;AACA;AACA,mBAAmB;AACnB,aAAa,yEAAsB;AACnC,oBAAoB,gDAAC,WAAW,SAAS,8DAA8D;AACvG;AACA;AACA;AACA;AACA;AACO,8BAA8B,sBAAsB;AAC3D;AACA,2DAA2D,wEAAqB;AAChF,gCAAgC,uEAAoB;AACpD,gCAAgC,wEAAqB;AACrD,gCAAgC,yEAAsB;AACtD,YAAY,uBAAuB;AACnC;AACA;AACA;AACA,YAAY,gDAAC,SAAS,OAAO,8DAAU;AACvC;AACA;AACA,SAAS,yCAAyC,cAAc;AAChE;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,8BAA8B;AAC/E;AACA,iBAAiB;AACjB;AACA,SAAS;AACT,yCAAyC,4BAA4B;AACrE;AACA,WAAW;AACX,QAAQ,gDAAC;AACT,YAAY,gDAAC,mBAAmB,uBAAuB;AACvD,iCAAiC,gDAAC,WAAW,qBAAqB;AAClE,YAAY,gDAAC;AACb,oEAAoE,gDAAC,UAAU,gCAAgC;AAC/G,YAAY,gDAAC,sBAAsB,uBAAuB;AAC1D,QAAQ,gDAAC;AACT,+DAA+D,gDAAC;AAChE,kCAAkC,gDAAC;AACnC,uCAAuC,gDAAC,CAAC,8CAAI,IAAI,MAAM,oDAAU,gCAAgC;AACjG,oFAAoF,gDAAC,UAAU,qCAAqC;AACpI,YAAY,gDAAC,aAAa,kFAA0B;AACpD,YAAY,gDAAC,+OAA+O,gDAAC,gBAAgB,eAAe;AAC5R;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;AC1J0C;AACQ;AACsB;AACjE,gCAAgC;AACvC,YAAY,iCAAiC;AAC7C;AACA,YAAY,gDAAC,UAAU,oCAAoC;AAC3D,kEAAkE,gDAAC,CAAC,2DAAc,IAAI,wBAAwB,2BAA2B,gDAAC,UAAU,uCAAuC,EAAE,kFAA0B;AACvN,8BAA8B,gDAAC,UAAU,yBAAyB;AAClE;;;;;;;;;;;;;;;;;;;;;;;;;;ACT0C;AACM;AACwB;AAChB;AACX;AACK;AACkB;AACN;AACF;AACJ;AACM;AAC9D;AACO,2BAA2B;AAClC,YAAY,+DAA+D;AAC3E;AACA;AACA,YAAY,qCAAqC;AACjD,wDAAwD,2DAAgB;AACxE,YAAY,gDAAC,UAAU,OAAO,8DAAU,0BAA0B,6CAA6C,GAAG;AAClH,QAAQ,gDAAC,UAAU,mCAAmC;AACtD,6BAA6B,gDAAC,CAAC,oDAAO;AACtC,qCAAqC,gDAAC,CAAC,sEAAgB;AACvD,4CAA4C,gDAAC,CAAC,gEAAa,IAAI,MAAM,kEAAwB,WAAW,kFAA0B,4KAA4K;AAC9S,0CAA0C,gDAAC,CAAC,gEAAa,IAAI,MAAM,+DAAqB,WAAW,kFAA0B,qKAAqK;AAClS,6CAA6C,gDAAC,CAAC,gEAAa,IAAI,MAAM,kEAAwB,WAAW,kFAA0B,8KAA8K;AACjT,gBAAgB,gDAAC,CAAC,sEAAgB,IAAI,iBAAiB;AACvD,oBAAoB,gDAAC,CAAC,gEAAa,IAAI,MAAM,qDAAW,qFAAqF;AAC7I,YAAY,gDAAC,UAAU;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B,yBAAyB;AACzB,qBAAqB;AACrB,mBAAmB;AACnB,8EAA8E,gDAAC;AAC/E,oBAAoB,gDAAC,CAAC,qEAAmB,IAAI,gPAAgP;AAC7R,0EAA0E,gDAAC;AAC3E,oBAAoB,gDAAC,CAAC,iEAAiB;AACvC,gFAAgF,gDAAC;AACjF,oBAAoB,gDAAC,CAAC,wEAAoB;AAC1C;;;;;;;;;;;;;;;;;;AChD0C;AACc;AACL;AAC5C,uBAAuB,mDAAmD,MAAM,gDAAC,kCAAkC,gDAAC,oBAAoB,kGAAkG;AACjP,2BAA2B,kDAAkD;AAC7E;AACA;AACA,YAAY,gDAAC;AACb,QAAQ,gDAAC;AACT,mCAAmC,gDAAC,WAAW,OAAO,8DAAU,GAAG,2CAA2C,IAAI,4CAA4C;AAC9J;AACA,mBAAmB;AACnB,gBAAgB,gDAAC,CAAC,8CAAI,IAAI,kBAAkB,2DAAiB,GAAG,6DAAmB,EAAE,OAAO,gDAAC,WAAW,kCAAkC;AAC1I,YAAY,gDAAC,WAAW;AACxB;AACA,iBAAiB,iCAAiC;AAClD,0CAA0C,gDAAC,gBAAgB,oHAAoH;AAC/K;;;;;;;;;;;;;;;;;;ACjB0C;AACE;AAC4B;AACjE,6BAA6B;AACpC,YAAY,+BAA+B;AAC3C,YAAY,gDAAC,UAAU,iCAAiC;AACxD,+BAA+B,gDAAC,CAAC,qDAAW,IAAI,6HAA6H,2BAA2B,gDAAC,UAAU,uCAAuC,EAAE,kFAA0B;AACtR,+BAA+B,gDAAC,UAAU,yBAAyB;AACnE;;;;;;;;;;;;;;;;;;;;;ACR0C;AACc;AACX;AACqB;AACJ;AACU;AACjE,+BAA+B,oEAAoE,gBAAgB,gDAAC,UAAU,mCAAmC;AACxK,IAAI,gDAAC,kCAAkC,gDAAC,SAAS,qCAAqC,gBAAgB,gCAAgC,8DAAU;AAChJ;AACA,SAAS,GAAG;AACZ,QAAQ,gDAAC,UAAU,iDAAiD,6BAA6B,gDAAC,UAAU;AAC5G;AACA,eAAe,MAAM,gDAAC,UAAU;AAChC;AACA,eAAe,2BAA2B,gDAAC,UAAU,yBAAyB;AAC9E,QAAQ,gDAAC,UAAU,sBAAsB;AACzC,oEAAoE,gDAAC,UAAU,iDAAiD;AAChI,gBAAgB,gDAAC,CAAC,gEAAa,IAAI,MAAM,0DAAgB,WAAW,kFAA0B;AAC9F;AACA;AACA,uCAAuC,qFAAkC;AACzE,yBAAyB;AACzB,uBAAuB;AACvB,gBAAgB,gDAAC,CAAC,gEAAa,IAAI,MAAM,2DAAiB,WAAW,kFAA0B;AAC/F;AACA;AACA,uCAAuC,8EAA2B;AAClE,yBAAyB;AACzB,uBAAuB;AACvB,YAAY,gDAAC;;;;;;;;;;;;;;;;AC7BN;AACP;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,iCAAiC,UAAU;AAC3C;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA,2BAA2B;AAC3B;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA,UAAU;AACV;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA,sBAAsB,0BAA0B;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA,sBAAsB,0BAA0B;AAChD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;;AAEA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,sBAAsB,wBAAwB;AAC9C;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;UClZA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACN8C;AACI;AACE;AACnB;AACP","sources":["webpack://PdfTools/webpack/universalModuleDefinition","webpack://PdfTools/./src/pdf-viewer-api/PdfViewingWrapper.ts","webpack://PdfTools/./src/pdf-web-viewer/PdfWebViewer.ts","webpack://PdfTools/./src/common/Color.ts","webpack://PdfTools/./src/common/ColorPicker.tsx","webpack://PdfTools/./src/common/Contextbar.tsx","webpack://PdfTools/./src/common/DragMoveHandler.ts","webpack://PdfTools/./src/common/Dropdown.tsx","webpack://PdfTools/./src/common/DropdownMenu.tsx","webpack://PdfTools/./src/common/DropdownSeparator.tsx","webpack://PdfTools/./src/common/Icon.tsx","webpack://PdfTools/./src/common/Loader.tsx","webpack://PdfTools/./src/common/RangeSlider.tsx","webpack://PdfTools/./src/common/StrokeStylePicker.tsx","webpack://PdfTools/./src/common/StrokeWidthPicker.tsx","webpack://PdfTools/./src/common/Toolbar.tsx","webpack://PdfTools/./src/common/ToolbarButton.tsx","webpack://PdfTools/./src/common/ToolbarFileButton.tsx","webpack://PdfTools/./src/common/ToolbarItemGroup.tsx","webpack://PdfTools/./src/common/ToolbarSeparator.tsx","webpack://PdfTools/./src/common/Tools.ts","webpack://PdfTools/./src/common/TooltipManager.ts","webpack://PdfTools/./src/common/TranslationManager.ts","webpack://PdfTools/./src/common/classNames.ts","webpack://PdfTools/./src/common/icons.ts","webpack://PdfTools/./src/common/utils.ts","webpack://PdfTools/./src/custom/history.ts","webpack://PdfTools/./src/modules/CanvasLayer.ts","webpack://PdfTools/./src/modules/CanvasModule.ts","webpack://PdfTools/./src/modules/eraser/EraserLayer.ts","webpack://PdfTools/./src/modules/eraser/EraserModule.ts","webpack://PdfTools/./src/modules/eraser/EraserToolbar.tsx","webpack://PdfTools/./src/modules/form-fields/CheckBoxWidget.ts","webpack://PdfTools/./src/modules/form-fields/ComboBoxWidget.ts","webpack://PdfTools/./src/modules/form-fields/EditFormFieldLayer.ts","webpack://PdfTools/./src/modules/form-fields/FormFieldModule.ts","webpack://PdfTools/./src/modules/form-fields/ListBoxWidget.ts","webpack://PdfTools/./src/modules/form-fields/RadioButtonWidget.ts","webpack://PdfTools/./src/modules/form-fields/SelectListWidget.ts","webpack://PdfTools/./src/modules/form-fields/TextBoxWidget.ts","webpack://PdfTools/./src/modules/form-fields/WidgetBase.ts","webpack://PdfTools/./src/modules/freetext-annotation/AddFreetextAnnotationLayer.ts","webpack://PdfTools/./src/modules/freetext-annotation/AddFreetextAnnotationToolbar.tsx","webpack://PdfTools/./src/modules/freetext-annotation/EditFreetextAnnotationLayer.ts","webpack://PdfTools/./src/modules/freetext-annotation/EditFreetextAnnotationToolbar.tsx","webpack://PdfTools/./src/modules/freetext-annotation/FreetextAnnotationModule.ts","webpack://PdfTools/./src/modules/freetext-annotation/RichTextEditor.ts","webpack://PdfTools/./src/modules/highlight-annotation/AddHighlightAnnotationLayer.ts","webpack://PdfTools/./src/modules/highlight-annotation/AddHighlightAnnotationToolbar.tsx","webpack://PdfTools/./src/modules/highlight-annotation/EditHighlightAnnotationLayer.ts","webpack://PdfTools/./src/modules/highlight-annotation/EditHighlightAnnotationToolbar.tsx","webpack://PdfTools/./src/modules/highlight-annotation/HighlightAnnotationModule.ts","webpack://PdfTools/./src/modules/image-annotations/ImageAnnotationModule.ts","webpack://PdfTools/./src/modules/index.ts","webpack://PdfTools/./src/modules/ink-annotation/AddInkAnnotationLayer.ts","webpack://PdfTools/./src/modules/ink-annotation/AddInkAnnotationToolbar.tsx","webpack://PdfTools/./src/modules/ink-annotation/EditInkAnnotationLayer.ts","webpack://PdfTools/./src/modules/ink-annotation/EditInkAnnotationToolbar.tsx","webpack://PdfTools/./src/modules/ink-annotation/InkAnnotationModule.ts","webpack://PdfTools/./src/modules/popup/Popup.tsx","webpack://PdfTools/./src/modules/popup/PopupLayer.ts","webpack://PdfTools/./src/modules/popup/PopupModule.ts","webpack://PdfTools/./src/modules/print-service/PrintServiceDialog.tsx","webpack://PdfTools/./src/modules/print-service/PrintServiceLayer.ts","webpack://PdfTools/./src/modules/print-service/PrintServiceModule.ts","webpack://PdfTools/./src/modules/shape-annotations/AddShapeAnnotationLayer.ts","webpack://PdfTools/./src/modules/shape-annotations/AddShapeAnnotationToolbar.tsx","webpack://PdfTools/./src/modules/shape-annotations/EditShapeAnnotationLayer.ts","webpack://PdfTools/./src/modules/shape-annotations/EditShapeAnnotationToolbar.tsx","webpack://PdfTools/./src/modules/shape-annotations/ShapeAnnotationModule.ts","webpack://PdfTools/./src/modules/stamp-annotation/AddStampAnnotationLayer.ts","webpack://PdfTools/./src/modules/stamp-annotation/AddStampAnnotationToolbar.tsx","webpack://PdfTools/./src/modules/stamp-annotation/StampAnnotationModule.ts","webpack://PdfTools/./src/modules/text-annotation/AddTextAnnotationLayer.ts","webpack://PdfTools/./src/modules/text-annotation/AddTextAnnotationToolbar.tsx","webpack://PdfTools/./src/modules/text-annotation/TextAnnotationModule.ts","webpack://PdfTools/./src/pdf-viewer-api/ImageContainer.ts","webpack://PdfTools/./src/pdf-viewer-api/PdfViewerApi.ts","webpack://PdfTools/./src/pdf-viewer-api/annotationDefaultBehaviors.ts","webpack://PdfTools/./src/pdf-viewer-api/enums.ts","webpack://PdfTools/./src/pdf-viewer-api/index.ts","webpack://PdfTools/./src/pdf-viewer-api/types.ts","webpack://PdfTools/./src/pdf-viewer-canvas/CanvasEvents.ts","webpack://PdfTools/./src/pdf-viewer-canvas/PdfViewerCanvas.ts","webpack://PdfTools/./src/pdf-viewer-canvas/state/annotations.ts","webpack://PdfTools/./src/pdf-viewer-canvas/state/appState.ts","webpack://PdfTools/./src/pdf-viewer-canvas/state/canvas.ts","webpack://PdfTools/./src/pdf-viewer-canvas/state/document.ts","webpack://PdfTools/./src/pdf-viewer-canvas/state/pointer.ts","webpack://PdfTools/./src/pdf-viewer-canvas/state/scroll.ts","webpack://PdfTools/./src/pdf-viewer-canvas/state/search.ts","webpack://PdfTools/./src/pdf-viewer-canvas/state/store.ts","webpack://PdfTools/./src/pdf-viewer-canvas/state/viewer.ts","webpack://PdfTools/./src/pdf-viewer-canvas/view-layers/AnnotationSelectionLayer.ts","webpack://PdfTools/./src/pdf-viewer-canvas/view-layers/BusyStateLayer.ts","webpack://PdfTools/./src/pdf-viewer-canvas/view-layers/PdfDocumentLayer.ts","webpack://PdfTools/./src/pdf-viewer-canvas/view-layers/ScrollLayer.ts","webpack://PdfTools/./src/pdf-viewer-canvas/view-layers/TextSelectionLayer.ts","webpack://PdfTools/./src/pdf-viewer-canvas/view-layers/ViewLayerBase.ts","webpack://PdfTools/./src/pdf-viewer-canvas/view-layers/canvasShapes.ts","webpack://PdfTools/./src/pdf-viewer-canvas/view-layers/views/AnnotationBorder.ts","webpack://PdfTools/./src/pdf-viewer-canvas/view-layers/views/AnnotationContextBar.tsx","webpack://PdfTools/./src/pdf-viewer-canvas/view-layers/views/TextSelectionContextBar.tsx","webpack://PdfTools/./src/pdf-viewing/PdfViewing.ts","webpack://PdfTools/./src/pdf-web-viewer/UserSettings.ts","webpack://PdfTools/./src/pdf-web-viewer/WebViewerOptions.ts","webpack://PdfTools/./src/pdf-web-viewer/state/index.ts","webpack://PdfTools/./src/pdf-web-viewer/state/layout.ts","webpack://PdfTools/./src/pdf-web-viewer/state/navigationPanel.ts","webpack://PdfTools/./src/pdf-web-viewer/state/passwordForm.ts","webpack://PdfTools/./src/pdf-web-viewer/state/pdfDocument.ts","webpack://PdfTools/./src/pdf-web-viewer/state/search.ts","webpack://PdfTools/./src/pdf-web-viewer/views/App.tsx","webpack://PdfTools/./src/pdf-web-viewer/views/CustomButtons.tsx","webpack://PdfTools/./src/pdf-web-viewer/views/DropZone.tsx","webpack://PdfTools/./src/pdf-web-viewer/views/Layout.tsx","webpack://PdfTools/./src/pdf-web-viewer/views/annotationbar/Annotationbar.tsx","webpack://PdfTools/./src/pdf-web-viewer/views/appbar/AddonsToolbar.tsx","webpack://PdfTools/./src/pdf-web-viewer/views/appbar/AnnotationsMenu.tsx","webpack://PdfTools/./src/pdf-web-viewer/views/appbar/AppBar.tsx","webpack://PdfTools/./src/pdf-web-viewer/views/appbar/DocumentBar.tsx","webpack://PdfTools/./src/pdf-web-viewer/views/appbar/Menu.tsx","webpack://PdfTools/./src/pdf-web-viewer/views/appbar/NavigationBar.tsx","webpack://PdfTools/./src/pdf-web-viewer/views/appbar/SearchBar.tsx","webpack://PdfTools/./src/pdf-web-viewer/views/appbar/SearchOptions.tsx","webpack://PdfTools/./src/pdf-web-viewer/views/appbar/ViewBar.tsx","webpack://PdfTools/./src/pdf-web-viewer/views/appbar/ZoomBar.tsx","webpack://PdfTools/./src/pdf-web-viewer/views/modal/ApplicationError.tsx","webpack://PdfTools/./src/pdf-web-viewer/views/modal/LoadApplication.tsx","webpack://PdfTools/./src/pdf-web-viewer/views/modal/LoadFile.tsx","webpack://PdfTools/./src/pdf-web-viewer/views/modal/Modal.tsx","webpack://PdfTools/./src/pdf-web-viewer/views/modal/OpenFile.tsx","webpack://PdfTools/./src/pdf-web-viewer/views/modal/OpenFileError.tsx","webpack://PdfTools/./src/pdf-web-viewer/views/modal/PasswordForm.tsx","webpack://PdfTools/./src/pdf-web-viewer/views/modal/SaveFile.tsx","webpack://PdfTools/./src/pdf-web-viewer/views/modal/UnsavedChanges.tsx","webpack://PdfTools/./src/pdf-web-viewer/views/navigation/AnnotationList.tsx","webpack://PdfTools/./src/pdf-web-viewer/views/navigation/AnnotationListItem.tsx","webpack://PdfTools/./src/pdf-web-viewer/views/navigation/AnnotationNavigation.tsx","webpack://PdfTools/./src/pdf-web-viewer/views/navigation/NavigationPanel.tsx","webpack://PdfTools/./src/pdf-web-viewer/views/navigation/OutlineList.tsx","webpack://PdfTools/./src/pdf-web-viewer/views/navigation/OutlineNavigation.tsx","webpack://PdfTools/./src/pdf-web-viewer/views/navigation/ThumbnailNavigation.tsx","webpack://PdfTools/./src/lib/hyperapp/index.js","webpack://PdfTools/webpack/bootstrap","webpack://PdfTools/webpack/runtime/define property getters","webpack://PdfTools/webpack/runtime/hasOwnProperty shorthand","webpack://PdfTools/webpack/runtime/make namespace object","webpack://PdfTools/./src/index.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"PdfTools\"] = factory();\n\telse\n\t\troot[\"PdfTools\"] = factory();\n})(self, () => {\nreturn ","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __asyncValues = (this && this.__asyncValues) || function (o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n};\nimport { PdfActionType, PdfFitMode, PdfItemCategory, PdfItemType, WidgetType, PdfPageLayoutMode, AnnotationBorderStyle, DocumentChange, RotationDirection, } from './enums';\nimport { FileType, } from './types';\nimport { annotationDefaultBehaviors } from './annotationDefaultBehaviors';\nimport { PdfViewing } from '../pdf-viewing/PdfViewing';\nimport { ImageContainer } from './ImageContainer';\nexport class PdfViewingWrapper {\n constructor(key, pdfViewerApiOptions) {\n this.pdfDocument = null;\n this.objectUrls = [];\n this.view = null;\n this.textFragmentCache = new Map();\n this.nativeAnnotationCache = new Map();\n this.handleAnnotationCache = new Map();\n this.pageAnnotationCache = new Map();\n this.imageBitmapCache = new Map();\n this.ignoreDocumentPreferences = false;\n this.nativeOutlines = new Map();\n this.devicePixelRatio = window.devicePixelRatio;\n this.xDPI = 0;\n this.yDPI = 0;\n PdfViewing.Sdk.initialize(key, PdfViewing.Sdk.version);\n this.validateViewingSdkVersion();\n this.pdfViewerApiOptions = pdfViewerApiOptions;\n this.licenseFeatures = PdfViewing.Sdk.supportedFeatures;\n this.pdfController = new PdfViewing.ViewerController();\n this.eventListeners = new Map();\n this.viewportSize = new PdfViewing.Pdf.Geometry.Real.Size(0, 0);\n this.pdfStampDocuments = new Map();\n this.registeredPdfStamps = new Map();\n this.attachEventListeners = this.attachEventListeners.bind(this);\n this.onDocumentOpened = this.onDocumentOpened.bind(this);\n this.onViewUpdated = this.onViewUpdated.bind(this);\n this.onImageCreated = this.onImageCreated.bind(this);\n this.onImageRemovedFromCache = this.onImageRemovedFromCache.bind(this);\n this.getAnnotationsFromPage = this.getAnnotationsFromPage.bind(this);\n }\n getIgnoringPreferences() {\n return this.ignoreDocumentPreferences;\n }\n setIgnoringPreferences(ignorePreferences) {\n this.ignoreDocumentPreferences = ignorePreferences;\n }\n open(pdfFile, fdfFiles, password, viewOptions, renderOptions, viewportSize) {\n return new Promise((resolve, reject) => {\n const mapInputDocument = (file, fileType) => {\n try {\n let mimeType = 'application/pdf';\n switch (fileType) {\n case FileType.Fdf:\n mimeType = 'application/vnd.fdf';\n break;\n }\n const { data } = file;\n let uri = '';\n let httpOptions = new PdfViewing.IO.HttpOptions();\n if (data) {\n uri = URL.createObjectURL(new File([data], pdfFile.sourceTag || '', {\n type: mimeType,\n }));\n }\n else {\n const inputUri = file;\n uri = inputUri.uri;\n if (inputUri.httpOptions) {\n const { headers, mode, cache, credentials, redirect, referrerPolicy } = inputUri.httpOptions;\n if (mode !== undefined ||\n cache !== undefined ||\n credentials !== undefined ||\n redirect !== undefined ||\n referrerPolicy !== undefined) {\n console.warn(`\n You are using a property that has been deprecated for stability reasons on iOS. \n Affected properties are: mode, cache, credentials, redirect, referrerPolicy.\n If you want to continue using one of these properties, please switch to the separate build that is now available at: https://pdftools-public-downloads-production.s3.eu-west-1.amazonaws.com/productkits/VIEWWEB/4.3.6/extended/pdf-tools-four-heights-pdf-web-viewer-__WebViewerVersion__.tar.gz\n You can read more about this in our docs: https://www.pdf-tools.com/public/downloads/manuals/PdfWebViewer.pdf\n `);\n }\n if (headers) {\n Object.keys(headers).forEach((key) => {\n var _a;\n (_a = httpOptions.headers) === null || _a === void 0 ? void 0 : _a.set(key, headers[key]);\n });\n }\n httpOptions.credentials = null;\n httpOptions.cache = null;\n httpOptions.mode = null;\n httpOptions.redirect = null;\n httpOptions.referrerPolicy = null;\n }\n }\n return new PdfViewing.IO.InputUri(uri, httpOptions, pdfFile.sourceTag);\n }\n catch (err) {\n throw new Error('failed to create InputDocument');\n }\n };\n const pdfInputFile = mapInputDocument(pdfFile, FileType.Pdf);\n const fdfInputFiles = new PdfViewing.IO.InputDocumentList();\n if (fdfFiles && fdfFiles.length) {\n fdfFiles.forEach((file) => {\n const fdfFile = mapInputDocument(file, FileType.Fdf);\n if (fdfFile) {\n fdfInputFiles.add(fdfFile);\n }\n });\n }\n const mapViewOptions = (viewOptions) => {\n try {\n if (!viewOptions) {\n return null;\n }\n const options = new PdfViewing.Pdf.ViewOptions();\n options.initialDestination = null;\n if (typeof viewOptions.initialFitMode === 'number') {\n options.initialFitMode = this.WwFitModeToViewingFitMode(viewOptions.initialFitMode);\n }\n if (typeof viewOptions.initialPageLayoutMode === 'number') {\n options.initialPageLayoutMode = this.WwPageLayoutToViewingPageLayout(viewOptions.initialPageLayoutMode);\n }\n if (typeof viewOptions.initialPageNumber === 'number' ||\n typeof viewOptions.initialZoom === 'number') {\n const pageNumber = typeof viewOptions.initialPageNumber === 'number' ? viewOptions.initialPageNumber : 1;\n const zoom = typeof viewOptions.initialZoom === 'number' ? viewOptions.initialZoom : null;\n options.initialDestination = new PdfViewing.Pdf.Navigation.LocationZoomDestination(pageNumber, null, null, zoom);\n }\n if (typeof viewportSize === 'object') {\n this.viewportSize = new PdfViewing.Pdf.Geometry.Integer.Size(viewportSize.width, viewportSize.height);\n options.viewportSize = this.viewportSize;\n }\n return options;\n }\n catch (err) {\n console.error(err);\n throw new Error('failed to create View Options');\n }\n };\n const sdkViewOptions = mapViewOptions(viewOptions);\n const mapRenderOptions = (renderOptions) => {\n try {\n if (!renderOptions) {\n return null;\n }\n const options = new PdfViewing.Pdf.RenderOptions();\n if (renderOptions.formFieldHighlightColor) {\n options.formFieldHighlightColor = this.createNativeColor(renderOptions.formFieldHighlightColor);\n }\n if (renderOptions.formFieldRequiredHighlightColor) {\n options.formFieldRequiredHighlightColor = this.createNativeColor(renderOptions.formFieldRequiredHighlightColor);\n }\n return options;\n }\n catch (err) {\n throw new Error('failed to create Render Options');\n }\n };\n const sdkRenderOptions = mapRenderOptions(renderOptions);\n this.pdfController\n .open(pdfInputFile, fdfInputFiles, password)\n .then((document) => {\n this.pdfDocument = document;\n this.onDocumentOpened(document, sdkRenderOptions, sdkViewOptions);\n resolve();\n })\n .catch((error) => {\n console.warn(error);\n reject(error);\n });\n });\n }\n save(saveOptions) {\n const { fileType, annotationFilter, password } = saveOptions || {};\n const _saveOptions = new PdfViewing.Pdf.SaveOptions();\n switch (fileType) {\n case FileType.Fdf:\n _saveOptions.fileType = PdfViewing.IO.FileType.Fdf;\n break;\n default:\n _saveOptions.fileType = PdfViewing.IO.FileType.Pdf;\n }\n _saveOptions.annotationFilter = annotationFilter\n ? this.createAnnotationFilter(annotationFilter)\n : null;\n if (password) {\n _saveOptions.password = password;\n }\n return new Promise((resolve, reject) => {\n if (this.pdfDocument) {\n this.pdfDocument\n .save(_saveOptions)\n .then((file) => {\n const buffer = file.bufferData;\n if (buffer) {\n const blob = new Blob([file.bufferData]);\n file.close();\n resolve(blob);\n }\n else {\n reject('Returned save buffer is null');\n }\n })\n .catch((error) => {\n console.warn(error);\n reject(error);\n });\n }\n else {\n reject('No document opened');\n }\n });\n }\n close() {\n var _a, _b;\n this.nativeAnnotationCache.forEach((annot) => {\n var _a;\n if (annot instanceof PdfViewing.Pdf.Annotations.MarkupAnnotation) {\n (_a = annot.info) === null || _a === void 0 ? void 0 : _a.close();\n }\n annot.close();\n });\n this.nativeAnnotationCache.clear();\n this.handleAnnotationCache.clear();\n this.pageAnnotationCache.clear();\n this.textFragmentCache.clear();\n this.objectUrls.forEach((url) => {\n URL.revokeObjectURL(url);\n });\n this.objectUrls = [];\n this.nativeOutlines.forEach((outline) => {\n outline.close();\n });\n this.nativeOutlines.clear();\n (_a = this.view) === null || _a === void 0 ? void 0 : _a.close();\n (_b = this.pdfDocument) === null || _b === void 0 ? void 0 : _b.close();\n this.pdfDocument = null;\n }\n destroy() {\n if (this.view) {\n this.view.removeEventListener('viewUpdated', this.onViewUpdated);\n this.view.removeEventListener('imageCreated', this.onImageCreated);\n this.view.removeEventListener('imageRemovedFromCache', this.onImageRemovedFromCache);\n }\n this.close();\n this.pdfStampDocuments.forEach((stampDocument) => {\n stampDocument.close();\n });\n this.pdfController.close();\n this.imageBitmapCache.forEach((imageContainer) => {\n imageContainer.destroy();\n });\n this.nativeOutlines.clear();\n this.imageBitmapCache.clear();\n this.textFragmentCache.clear();\n this.nativeAnnotationCache.clear();\n this.handleAnnotationCache.clear();\n this.pageAnnotationCache.clear();\n this.pdfStampDocuments.clear();\n this.registeredPdfStamps.clear();\n }\n registerPdfStampFile(pdfStampFileName, data, onStampCreated) {\n const url = URL.createObjectURL(new File([data], pdfStampFileName, { type: 'application/pdf' }));\n this.objectUrls.push(url);\n this.pdfController\n .openUri(url, null, null, null, null)\n .then((pdfDocument) => {\n const createStamps = () => __awaiter(this, void 0, void 0, function* () {\n var e_1, _a, e_2, _b;\n const pageNumbers = Array.from({ length: pdfDocument.pageCount }, (_, i) => i + 1);\n let maxHeight = 0;\n let maxWidth = 0;\n const stampSizes = {};\n try {\n for (var pageNumbers_1 = __asyncValues(pageNumbers), pageNumbers_1_1; pageNumbers_1_1 = yield pageNumbers_1.next(), !pageNumbers_1_1.done;) {\n let pageNumber = pageNumbers_1_1.value;\n const size = yield pdfDocument.getPagePdfSize(pageNumber);\n stampSizes[pageNumber] = size;\n maxHeight = Math.max(size.height, maxHeight);\n maxWidth = Math.max(size.width, maxWidth);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (pageNumbers_1_1 && !pageNumbers_1_1.done && (_a = pageNumbers_1.return)) yield _a.call(pageNumbers_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n const MAX_PX_WIDTH = 200;\n const MAX_PX_HEIGHT = 100;\n const scale = Math.max(maxHeight / MAX_PX_HEIGHT, maxWidth / MAX_PX_WIDTH);\n try {\n for (var pageNumbers_2 = __asyncValues(pageNumbers), pageNumbers_2_1; pageNumbers_2_1 = yield pageNumbers_2.next(), !pageNumbers_2_1.done;) {\n let pageNumber = pageNumbers_2_1.value;\n const size = stampSizes[pageNumber];\n const aspectRatio = size.width / size.height;\n const img = yield pdfDocument.renderPage(pageNumber, size.width / scale, size.height / scale, 0);\n const tempCanvas = document.createElement('canvas');\n tempCanvas.width = img.width;\n tempCanvas.height = img.height;\n const tempContext = tempCanvas.getContext('2d');\n const imgData = new ImageData(new Uint8ClampedArray(img.bufferView), img.width, img.height);\n tempContext.putImageData(imgData, 0, 0);\n const thumbnail = tempCanvas.toDataURL('png');\n onStampCreated({\n pdfStampFileName,\n name: `${pdfStampFileName} - ${pageNumber}`,\n pageNumber,\n thumbnail,\n aspectRatio,\n });\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (pageNumbers_2_1 && !pageNumbers_2_1.done && (_b = pageNumbers_2.return)) yield _b.call(pageNumbers_2);\n }\n finally { if (e_2) throw e_2.error; }\n }\n });\n this.pdfStampDocuments.set(pdfStampFileName, pdfDocument);\n createStamps();\n })\n .catch((error) => {\n console.warn(error);\n });\n }\n getPageCount() {\n if (this.pdfDocument) {\n return this.pdfDocument.pageCount;\n }\n else {\n return null;\n }\n }\n registerImage(imageBuffer) {\n return new Promise((resolve, reject) => {\n if (this.pdfDocument) {\n const imgBlob = URL.createObjectURL(new Blob([imageBuffer]));\n this.pdfDocument.registerImageUri(imgBlob, null).then((id) => {\n resolve(id);\n });\n }\n });\n }\n registerPdfPage(fileName, pageNumber) {\n return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {\n if (this.pdfDocument) {\n const pdfDoc = this.pdfStampDocuments.get(fileName);\n if (!pdfDoc) {\n resolve(0);\n }\n else {\n const registeredPdfStampsKey = `${fileName}__${pageNumber}`;\n const stampRefId = this.registeredPdfStamps.get(registeredPdfStampsKey);\n if (stampRefId) {\n resolve(stampRefId);\n }\n else {\n const id = yield this.pdfDocument.registerPdfPage(pdfDoc, pageNumber);\n this.registeredPdfStamps.set(registeredPdfStampsKey, id);\n resolve(id);\n }\n }\n }\n }));\n }\n getPageNumber() {\n if (this.view) {\n return this.view.pageNumber;\n }\n return 0;\n }\n getFitMode() {\n var _a;\n var fitMode = (_a = this.view) === null || _a === void 0 ? void 0 : _a.fitMode;\n if (fitMode === undefined) {\n throw new Error('Invalid fit mode');\n }\n else {\n return fitMode;\n }\n }\n setFitMode(mode) {\n if (this.view) {\n this.view.fitMode = mode;\n }\n }\n setPageNumber(page) {\n if (this.view) {\n this.view.pageNumber = page;\n }\n }\n getZoom() {\n if (this.view) {\n return this.view.zoom;\n }\n return 0;\n }\n setZoom(zoom, location) {\n if (this.view) {\n if (location) {\n const p = new PdfViewing.Pdf.Geometry.Integer.Point(location.x, location.y);\n this.view.zoomOnLocation(zoom, p);\n }\n else {\n this.view.zoom = zoom;\n }\n }\n }\n getRotation() {\n if (this.view) {\n return this.view.viewRotation;\n }\n return 0;\n }\n setRotation(rotation) {\n if (this.view) {\n this.view.viewRotation = rotation;\n }\n }\n setBorderSize(size) {\n if (this.view) {\n this.view.borderSize = size;\n }\n }\n getBorderSize() {\n if (this.view) {\n return this.view.borderSize;\n }\n return 0;\n }\n suspendDrawing() {\n var _a;\n (_a = this.view) === null || _a === void 0 ? void 0 : _a.suspendDrawing();\n }\n resumeDrawing() {\n var _a;\n (_a = this.view) === null || _a === void 0 ? void 0 : _a.resumeDrawing();\n }\n renderCanvas(ctx, options) {\n var _a;\n if (this.view) {\n if (this.viewportSize.width != ctx.canvas.width ||\n this.viewportSize.height != ctx.canvas.height) {\n this.viewportSize.width = ctx.canvas.width;\n this.viewportSize.height = ctx.canvas.height;\n this.view.viewportSize = new PdfViewing.Pdf.Geometry.Integer.Size(ctx.canvas.width, ctx.canvas.height);\n }\n const data = (_a = this.view) === null || _a === void 0 ? void 0 : _a.getRenderedResults();\n if (data) {\n this.drawImages(ctx, data, options);\n data.close();\n }\n }\n }\n renderPage(page, width, height, annotationFilter) {\n let renderOptions = null;\n if (annotationFilter) {\n renderOptions = new PdfViewing.Pdf.RenderOptions();\n renderOptions.annotationFilter = this.createAnnotationFilter(annotationFilter);\n }\n return new Promise((resolve, reject) => {\n var _a;\n (_a = this.pdfDocument) === null || _a === void 0 ? void 0 : _a.renderPage(page, width, height, 0, renderOptions).then((image) => {\n const imgBuffer = image.bufferView;\n if (!imgBuffer) {\n reject();\n }\n let pageImage = {};\n pageImage.page = page;\n pageImage.imageData = new ImageData(new Uint8ClampedArray(imgBuffer), image.width, image.height);\n image.close();\n resolve(pageImage);\n }).catch((err) => {\n if (err.message !== 'Document was closed before operation could finish') {\n reject(`failed to render page ${page}`);\n }\n });\n });\n }\n rotatePage(pageNumber, direction) {\n var _a;\n const page = (_a = this.pdfDocument) === null || _a === void 0 ? void 0 : _a.pages.get(pageNumber - 1);\n if (page) {\n page.rotatePage(direction === RotationDirection.CLOCKWISE ? 90 : -90);\n this.dispatchEvent('pageChanged', pageNumber);\n }\n }\n getPagePdfSize(page) {\n return new Promise((resolve, reject) => {\n var _a;\n (_a = this.pdfDocument) === null || _a === void 0 ? void 0 : _a.getPagePdfSize(page).then((pageSize) => {\n resolve(pageSize);\n });\n });\n }\n setLicenseKey(key) {\n try {\n PdfViewing.Sdk.initialize(key, PdfViewing.Sdk.version);\n return true;\n }\n catch (error) {\n return false;\n }\n }\n getSupportedFeatures() {\n return PdfViewing.Sdk.supportedFeatures;\n }\n hasChanges() {\n if (this.pdfDocument) {\n const changes = this.pdfDocument.hasChanges;\n let ret = DocumentChange.NONE;\n if (changes & PdfViewing.Pdf.DocumentChange.Annotation) {\n ret = ret | DocumentChange.ANNOTATION;\n }\n if (changes & PdfViewing.Pdf.DocumentChange.Content) {\n ret = ret | DocumentChange.CONTENT;\n }\n return ret;\n }\n return null;\n }\n getSearchIterator(keyword, page, caseSensitive, wrap, regex) {\n var _a;\n try {\n return (_a = this.pdfDocument) === null || _a === void 0 ? void 0 : _a.searchText(keyword, page, caseSensitive, wrap, regex);\n }\n catch (err) {\n if (err.message !== 'Invalid search text') {\n throw err;\n }\n console.warn(err.message);\n }\n }\n getTextFragmentOnPoint(point) {\n var _a;\n const pointOnVp = new PdfViewing.Pdf.Geometry.Integer.Point(point.x, point.y);\n if (this.pdfDocument === null)\n return null;\n try {\n const fragmentList = (_a = this.view) === null || _a === void 0 ? void 0 : _a.getTextFragmentsOnPoint(pointOnVp);\n let frag = null;\n if (fragmentList && fragmentList.size > 0) {\n const nativeFrag = fragmentList.get(0);\n frag = this.createWebViewerFragment(nativeFrag);\n nativeFrag.close();\n fragmentList === null || fragmentList === void 0 ? void 0 : fragmentList.close();\n }\n return frag;\n }\n catch (error) {\n return null;\n }\n }\n getWordOnPoint(point) {\n var _a;\n const pointOnPage = new PdfViewing.Pdf.Geometry.Real.PointOnPage(point.page, point.pdfX, point.pdfY);\n try {\n const selection = (_a = this.view) === null || _a === void 0 ? void 0 : _a.getWordOnPoint(pointOnPage);\n if (selection) {\n const { textArea } = selection;\n if (textArea) {\n const quadrilaterals = [];\n for (let index = 0; index < textArea.size; index++) {\n quadrilaterals.push(textArea.get(index));\n }\n textArea.close();\n selection.close();\n const q = quadrilaterals[0];\n if (q) {\n const { bottomLeft, bottomRight, topRight, topLeft, pageNumber } = q;\n return {\n quadrilaterals,\n startPoint: {\n pdfX: Math.min(bottomLeft.x, bottomRight.x, topRight.x, topLeft.x),\n pdfY: Math.max(bottomLeft.y, bottomRight.y, topRight.y, topLeft.y),\n page: pageNumber,\n },\n endPoint: {\n pdfX: Math.max(bottomLeft.x, bottomRight.x, topRight.x, topLeft.x),\n pdfY: Math.min(bottomLeft.y, bottomRight.y, topRight.y, topLeft.y),\n page: pageNumber,\n },\n };\n }\n }\n }\n }\n catch (e) { }\n return null;\n }\n getTextSelection(startPoint, endPoint) {\n var _a;\n const startPointOnPage = new PdfViewing.Pdf.Geometry.Real.PointOnPage(startPoint.page, startPoint.pdfX, startPoint.pdfY);\n const endPointOnPage = new PdfViewing.Pdf.Geometry.Real.PointOnPage(endPoint.page, endPoint.pdfX, endPoint.pdfY);\n try {\n const selection = (_a = this.view) === null || _a === void 0 ? void 0 : _a.getTextSelection(startPointOnPage, endPointOnPage);\n if (selection) {\n const { textArea } = selection;\n if (textArea) {\n const quadrilaterals = [];\n for (let index = 0; index < textArea.size; index++) {\n quadrilaterals.push(textArea.get(index));\n }\n textArea.close();\n selection.close();\n return {\n quadrilaterals,\n startPoint,\n endPoint,\n };\n }\n }\n }\n catch (e) { }\n return null;\n }\n getRectangularTextSelection(startPoint, endPoint) {\n var _a;\n const startPointOnPage = new PdfViewing.Pdf.Geometry.Real.PointOnPage(startPoint.page, startPoint.pdfX, startPoint.pdfY);\n const endPointOnPage = new PdfViewing.Pdf.Geometry.Real.PointOnPage(endPoint.page, endPoint.pdfX, endPoint.pdfY);\n try {\n const selection = (_a = this.view) === null || _a === void 0 ? void 0 : _a.getRectangularTextSelection(startPointOnPage, endPointOnPage);\n if (selection) {\n const { textArea } = selection;\n if (textArea) {\n const quadrilaterals = [];\n for (let index = 0; index < textArea.size; index++) {\n quadrilaterals.push(textArea.get(index));\n }\n textArea.close();\n selection.close();\n return {\n quadrilaterals,\n startPoint,\n endPoint,\n };\n }\n }\n }\n catch (err) { }\n return null;\n }\n getText(startPoint, endPoint) {\n var _a;\n const startPointOnPage = new PdfViewing.Pdf.Geometry.Real.PointOnPage(startPoint.page, startPoint.pdfX, startPoint.pdfY);\n const endPointOnPage = new PdfViewing.Pdf.Geometry.Real.PointOnPage(endPoint.page, endPoint.pdfX, endPoint.pdfY);\n try {\n const selection = (_a = this.view) === null || _a === void 0 ? void 0 : _a.getTextSelection(startPointOnPage, endPointOnPage);\n if (selection) {\n const { text } = selection;\n selection.close();\n return text;\n }\n }\n catch (e) { }\n return null;\n }\n getTextForRectangularSelection(startPoint, endPoint) {\n var _a;\n const startPointOnPage = new PdfViewing.Pdf.Geometry.Real.PointOnPage(startPoint.page, startPoint.pdfX, startPoint.pdfY);\n const endPointOnPage = new PdfViewing.Pdf.Geometry.Real.PointOnPage(endPoint.page, endPoint.pdfX, endPoint.pdfY);\n try {\n const selection = (_a = this.view) === null || _a === void 0 ? void 0 : _a.getRectangularTextSelection(startPointOnPage, endPointOnPage);\n if (selection) {\n const { text } = selection;\n selection.close();\n return text;\n }\n }\n catch (e) { }\n return null;\n }\n createWebViewerFragment(nativeFragment) {\n const fragment = {};\n fragment.glyphOffsets = nativeFragment.glyphOffsets ? nativeFragment.glyphOffsets : [];\n fragment.text = nativeFragment.text || '';\n const fragRect = nativeFragment.rectangleOnPage;\n if (fragRect) {\n fragment.pdfRect = this.ViewingPdfRect2WwPdfRect(fragRect);\n }\n return fragment;\n }\n getIsOpen() {\n return this.pdfDocument !== null;\n }\n getOutlines(parent) {\n return new Promise((resolve, reject) => {\n if (this.pdfDocument) {\n if (parent !== null) {\n parent = this.nativeOutlines.get(parent.id);\n }\n this.pdfDocument\n .getOutlines(parent)\n .then((outlineList) => {\n const outlines = [];\n for (let i = 0; i < outlineList.size; i++) {\n const nativeOutline = outlineList.get(i);\n const outline = {};\n outline.id = nativeOutline.getHashCode();\n outline.title = nativeOutline.title || '';\n outline.hasDescendants = nativeOutline.hasChildren;\n outline.destination = nativeOutline.destination;\n this.nativeOutlines.set(nativeOutline.getHashCode(), nativeOutline);\n outlines.push(outline);\n }\n outlineList.close();\n resolve(outlines);\n })\n .catch((err) => {\n if (err.message !== 'Document was closed before operation could finish') {\n reject('failed to get outlines');\n }\n });\n }\n else {\n reject();\n }\n });\n }\n goTo(destination) {\n if (destination != null)\n this.goToPage(destination.pageNumber, destination.left, destination.top, destination.zoom);\n }\n goToPage(pageNumber, left = null, top = null, zoom = null) {\n if (this.view) {\n const nativeDest = new PdfViewing.Pdf.Navigation.LocationZoomDestination(pageNumber, left, top, zoom);\n this.view.goToDestination(nativeDest);\n }\n }\n goToRectangle(rectangle) {\n if (this.view) {\n const rectangleOnPage = new PdfViewing.Pdf.Geometry.Real.RectangleOnPage(rectangle.page, rectangle.pdfX, rectangle.pdfY, rectangle.pdfW, rectangle.pdfH);\n this.view.goToRectangle(rectangleOnPage);\n }\n }\n getAnnotationsFromPage(page) {\n return new Promise((resolve, reject) => {\n var _a;\n (_a = this.pdfDocument) === null || _a === void 0 ? void 0 : _a.getAnnotations(page).then((annotList) => {\n var _a;\n const annotRet = {};\n annotRet.page = page;\n annotRet.itemCategory = 1;\n annotRet.items = [];\n for (let i = 0; i < annotList.size; i++) {\n const nativeAnnot = annotList.get(i);\n const ww_annot = this.createWebViewerAnnotation(nativeAnnot, page);\n if (ww_annot) {\n annotRet.items.push(ww_annot);\n this.nativeAnnotationCache.set(ww_annot.id, nativeAnnot);\n this.handleAnnotationCache.set(ww_annot.id, ww_annot);\n if (!this.pageAnnotationCache.has(page)) {\n this.pageAnnotationCache.set(page, []);\n }\n (_a = this.pageAnnotationCache.get(page)) === null || _a === void 0 ? void 0 : _a.push(ww_annot);\n }\n }\n resolve(annotRet);\n }).catch((err) => {\n if (err.message !== 'Document was closed before operation could finish') {\n reject(`Failed to get annotations for page ${page}, ${err}`);\n }\n });\n });\n }\n deleteItem(item) {\n return this.deleteAnnotation(item);\n }\n validateViewingSdkVersion() {\n const parseVersionString = (versionString) => {\n const match = versionString.match(/(\\d+)\\.(\\d+)\\.(\\d+)[\\-]{0,1}(\\w*)[\\.]{0,1}(\\d*)/);\n if (match) {\n return {\n major: parseInt(match[1]),\n minor: parseInt(match[2]),\n patch: parseInt(match[3]),\n type: match[4],\n buildId: parseInt(match[5]),\n };\n }\n };\n const requiredSdk = parseVersionString('4.3.6-rc.17600');\n const currentSdk = parseVersionString(PdfViewing.Sdk.version);\n if (requiredSdk && currentSdk) {\n const valid = requiredSdk.major === currentSdk.major &&\n requiredSdk.minor === currentSdk.minor &&\n requiredSdk.patch === currentSdk.patch &&\n (requiredSdk.type ? requiredSdk.buildId === currentSdk.buildId : true);\n if (!valid) {\n console.warn(`**************************************\nVersion mismatch between PDF Viewing SDK and PDF Web Viewer\n\nMost likely, the static assets of the PDF Viewing SDK have not been copied to the configured location. For more information please consult the documentation (\"static assets\").\n\nCurrent version: ${currentSdk.major}.${currentSdk.minor}.${currentSdk.patch}\nRequired version: ${requiredSdk.major}.${requiredSdk.minor}.${requiredSdk.patch}${requiredSdk.type ? ` (${requiredSdk.type.toUpperCase()} version)` : ''}\n\n**************************************`);\n }\n }\n else {\n console.warn('The PDF Viewing SDK version number has an incorrect format');\n }\n }\n deleteAnnotation(item) {\n return new Promise((resolve, reject) => {\n var _a;\n const id = item.id;\n const nativeAnnot = this.nativeAnnotationCache.get(id);\n const page = item.page;\n if (nativeAnnot) {\n (_a = this.pdfDocument) === null || _a === void 0 ? void 0 : _a.deleteAnnotation(nativeAnnot).then(() => {\n nativeAnnot.close();\n this.nativeAnnotationCache.delete(id);\n this.handleAnnotationCache.delete(id);\n this.dispatchEvent('itemDeleted', { page, id, categoryType: 1 });\n this.dispatchEvent('pageChanged', page);\n resolve();\n });\n }\n });\n }\n getItem(id) {\n if (this.handleAnnotationCache.has(id)) {\n return this.handleAnnotationCache.get(id);\n }\n return null;\n }\n createItem(item) {\n return this.createAnnotation(item);\n }\n createAnnotationFilter(annotationFilter) {\n return (annot) => {\n const { pageNumber } = annot.boundingBox;\n const ww_annot = this.createWebViewerAnnotation(annot, pageNumber);\n annot.close();\n const res = annotationFilter(ww_annot);\n return res;\n };\n }\n createMarkupAnnotation(item) {\n const color = this.createNativeColor(item.color);\n const fillColor = this.createNativeColor(item.fillColor);\n let borderStyle = PdfViewing.Pdf.Annotations.BorderStyleType.Lined;\n const stroke = new PdfViewing.Pdf.Annotations.AnnotationStroke();\n if (item.border) {\n stroke.lineWidth = item.border.width;\n borderStyle = this.convertToNativeBorderStyle(item.border.style);\n if (item.border.style === 1) {\n stroke.dashArray = [item.border.width];\n }\n }\n const bbox = new PdfViewing.Pdf.Geometry.Real.RectangleOnPage(item.pdfRect.page, item.pdfRect.pdfX, item.pdfRect.pdfY, item.pdfRect.pdfW, item.pdfRect.pdfH);\n switch (item.itemType) {\n case 1:\n const stickyOrigin = new PdfViewing.Pdf.Geometry.Real.PointOnPage(item.pdfRect.page, item.pdfRect.pdfX, item.pdfRect.pdfY);\n return PdfViewing.Pdf.Annotations.StickyNote.create(stickyOrigin, '', color);\n case 3:\n return PdfViewing.Pdf.Annotations.FreeText.create(bbox, item.richtext, color, stroke, this.view ? this.view.viewRotation : PdfViewing.Pdf.Geometry.Rotation.NoRotation);\n case 5:\n return PdfViewing.Pdf.Annotations.RectangleAnnotation.create(bbox, stroke.lineWidth ? color : null, stroke, borderStyle, fillColor);\n case 6:\n return PdfViewing.Pdf.Annotations.EllipseAnnotation.create(bbox, stroke.lineWidth ? color : null, stroke, borderStyle, fillColor);\n case 9:\n return PdfViewing.Pdf.Annotations.Highlight.create(this.createQuadrilateralList(item.quadrilaterals), color);\n case 10:\n return PdfViewing.Pdf.Annotations.Underline.create(this.createQuadrilateralList(item.quadrilaterals), color);\n case 11:\n return PdfViewing.Pdf.Annotations.Squiggly.create(this.createQuadrilateralList(item.quadrilaterals), color);\n case 12:\n return PdfViewing.Pdf.Annotations.StrikeThrough.create(this.createQuadrilateralList(item.quadrilaterals), color);\n case 13:\n if (item.stampText) {\n return PdfViewing.Pdf.Annotations.CustomTextStamp.create(bbox, item.stampText, item.stampColor, this.view ? this.view.viewRotation : PdfViewing.Pdf.Geometry.Rotation.NoRotation);\n }\n else if (item.imageId) {\n return PdfViewing.Pdf.Annotations.CustomImageStamp.create(bbox, item.imageId, this.view ? this.view.viewRotation : PdfViewing.Pdf.Geometry.Rotation.NoRotation);\n }\n else {\n throw new Error(`createAnnotation: Unknown custom stamp annotation`);\n }\n case 15:\n const inkList = item.inkList;\n const path = new PdfViewing.Pdf.Geometry.Real.Path();\n if (inkList) {\n const pathGen = new PdfViewing.Pdf.Geometry.Real.PathGenerator(path);\n for (let i = 0; i < inkList.length; i++) {\n pathGen.moveTo(new PdfViewing.Pdf.Geometry.Real.Point(inkList[i][0], inkList[i][1]));\n for (let j = 2; j < inkList[i].length; j += 2) {\n pathGen.lineTo(new PdfViewing.Pdf.Geometry.Real.Point(inkList[i][j], inkList[i][j + 1]));\n }\n }\n pathGen.close();\n }\n return PdfViewing.Pdf.Annotations.InkAnnotation.create(item.page, path, color, stroke);\n default:\n throw new Error(`createAnnotation: Type not implemented: ${item.itemType}`);\n }\n }\n createAnnotation(item) {\n let annot = this.createMarkupAnnotation(item);\n const page = item.page;\n annot.info.author = item.author || '';\n return new Promise((resolve, reject) => {\n var _a;\n (_a = this.pdfDocument) === null || _a === void 0 ? void 0 : _a.createAnnotation(annot).then(() => {\n const ww_annot = this.createWebViewerAnnotation(annot, item.page);\n if (ww_annot) {\n this.nativeAnnotationCache.set(ww_annot.id, annot);\n this.handleAnnotationCache.set(ww_annot.id, ww_annot);\n this.dispatchEvent('itemCreated', ww_annot);\n this.dispatchEvent('pageChanged', page);\n resolve(ww_annot);\n }\n reject('Failed to create Web Viewer annotation');\n }).catch((error) => {\n reject(error);\n });\n });\n }\n createQuadrilateralList(quadrilaterals) {\n const quadrilateralList = new PdfViewing.Pdf.Geometry.Real.QuadrilateralList();\n for (let i = 0; i < quadrilaterals.length; i++) {\n const q = quadrilaterals[i];\n quadrilateralList.add(new PdfViewing.Pdf.Geometry.Real.QuadrilateralOnPage(q.pageNumber, new PdfViewing.Pdf.Geometry.Real.Point(q.bottomLeft.x, q.bottomLeft.y), new PdfViewing.Pdf.Geometry.Real.Point(q.bottomRight.x, q.bottomRight.y), new PdfViewing.Pdf.Geometry.Real.Point(q.topRight.x, q.topRight.y), new PdfViewing.Pdf.Geometry.Real.Point(q.topLeft.x, q.topLeft.y)));\n }\n return quadrilateralList;\n }\n convertToNativeBorderStyle(style) {\n switch (style) {\n case 0:\n return PdfViewing.Pdf.Annotations.BorderStyleType.Lined;\n case 2:\n return PdfViewing.Pdf.Annotations.BorderStyleType.Beveled;\n case 3:\n return PdfViewing.Pdf.Annotations.BorderStyleType.Inset;\n case 4:\n return PdfViewing.Pdf.Annotations.BorderStyleType.Underline;\n default:\n return PdfViewing.Pdf.Annotations.BorderStyleType.Lined;\n }\n }\n convertToWebViewerBorderStyle(style) {\n switch (style) {\n case PdfViewing.Pdf.Annotations.BorderStyleType.Lined:\n return 0;\n case PdfViewing.Pdf.Annotations.BorderStyleType.Beveled:\n return 2;\n case PdfViewing.Pdf.Annotations.BorderStyleType.Inset:\n return 3;\n case PdfViewing.Pdf.Annotations.BorderStyleType.Underline:\n return 4;\n default:\n return 0;\n }\n }\n updateItem(item) {\n return new Promise((resolve, reject) => {\n var _a, _b;\n if (item.itemType === PdfItemType.WIDGET) {\n (_a = this.pdfDocument) === null || _a === void 0 ? void 0 : _a.editAnnotation(item.widget).then(() => {\n this.dispatchEvent('pageChanged', item.widget.boundingBox.pageNumber);\n resolve(item);\n }).catch((error) => {\n reject(error);\n });\n }\n else {\n const nativeAnnot = this.nativeAnnotationCache.get(item.id);\n if (nativeAnnot) {\n const rotationChanged = item.hasOwnProperty('rotation') &&\n item.rotation % 360 !== nativeAnnot.rotation % 360;\n if (!rotationChanged) {\n const bbox = new PdfViewing.Pdf.Geometry.Real.RectangleOnPage(item.pdfRect.page, item.pdfRect.pdfX, item.pdfRect.pdfY, item.pdfRect.pdfW, item.pdfRect.pdfH);\n nativeAnnot.boundingBox = bbox;\n }\n let nativeColor = null;\n nativeColor = this.createNativeColor(item.color);\n const markupAnnot = nativeAnnot;\n if (markupAnnot && item.privateData) {\n markupAnnot.privateData = item.privateData;\n }\n if (nativeAnnot.popup) {\n const rect = item.popup.pdfRect;\n nativeAnnot.popup.boundingBox =\n new PdfViewing.Pdf.Geometry.Real.RectangleOnPage(rect.page, rect.pdfX, rect.pdfY, rect.pdfW, rect.pdfH);\n nativeAnnot.popup.isOpen = item.popup.isOpen;\n }\n if (markupAnnot && markupAnnot.info) {\n markupAnnot.info.content = item.content || '';\n markupAnnot.info.subject = item.subject || '';\n }\n if (item.itemType === PdfItemType.TEXT) {\n const stickyAnnot = nativeAnnot;\n stickyAnnot.color = nativeColor;\n }\n if (item.itemType === PdfItemType.FREE_TEXT) {\n const freetextAnnot = nativeAnnot;\n freetextAnnot.richText = item.richText;\n freetextAnnot.backgroundColor = this.createNativeColor(item.color);\n const stroke = freetextAnnot.annotationStroke;\n if (stroke) {\n stroke.lineWidth = item.border.width;\n freetextAnnot.annotationStroke = stroke;\n stroke.close();\n }\n if (rotationChanged) {\n freetextAnnot.rotation = item.rotation;\n item.pdfRect = {\n page: freetextAnnot.boundingBox.pageNumber,\n pdfX: freetextAnnot.boundingBox.x,\n pdfY: freetextAnnot.boundingBox.y,\n pdfW: freetextAnnot.boundingBox.width,\n pdfH: freetextAnnot.boundingBox.height,\n };\n }\n }\n if (item.itemType === PdfItemType.INK) {\n const inkAnnotation = nativeAnnot;\n const inkAnnot = item;\n inkAnnotation.strokeColor = nativeColor;\n const { annotationStroke } = inkAnnotation;\n if (annotationStroke) {\n annotationStroke.lineWidth = item.border.width;\n inkAnnotation.annotationStroke = annotationStroke;\n }\n const { path } = inkAnnotation;\n const { vertices } = path;\n vertices.clear();\n for (let line of inkAnnot.inkList) {\n let isFirstPoint = true;\n for (let point of line) {\n if (isFirstPoint) {\n vertices.add(new PdfViewing.Pdf.Geometry.Real.Vertex(inkAnnot.page, point.x, point.y, PdfViewing.Pdf.Geometry.Real.PathOperation.MoveTo));\n isFirstPoint = false;\n }\n else {\n vertices.add(new PdfViewing.Pdf.Geometry.Real.Vertex(inkAnnot.page, point.x, point.y, PdfViewing.Pdf.Geometry.Real.PathOperation.LineTo));\n }\n }\n }\n path.vertices = vertices;\n inkAnnotation.setPath(path);\n }\n if (item.itemType === PdfItemType.SQUARE || item.itemType === PdfItemType.CIRCLE) {\n const shapeAnnotation = nativeAnnot;\n const { annotationStroke } = shapeAnnotation;\n if (annotationStroke) {\n annotationStroke.lineWidth = item.border.width;\n if (item.border.style === 1) {\n annotationStroke.dashArray = [item.border.width];\n }\n else {\n annotationStroke.dashArray = [0];\n }\n shapeAnnotation.annotationStroke = annotationStroke;\n }\n shapeAnnotation.borderStyleType = this.convertToNativeBorderStyle(item.border.style);\n shapeAnnotation.strokeColor = nativeColor;\n shapeAnnotation.fillColor = this.createNativeColor(item.fillColor);\n }\n if (item.itemType === PdfItemType.HIGHLIGHT ||\n item.itemType === PdfItemType.SQUIGGLY ||\n item.itemType === PdfItemType.STRIKE_OUT ||\n item.itemType === PdfItemType.UNDERLINE) {\n const textMarkupAnnot = nativeAnnot;\n textMarkupAnnot.color = nativeColor;\n }\n if (item.itemType === PdfItemType.STAMP) {\n const stampAnnot = nativeAnnot;\n if (rotationChanged) {\n stampAnnot.rotation = item.rotation;\n item.pdfRect = {\n page: stampAnnot.boundingBox.pageNumber,\n pdfX: stampAnnot.boundingBox.x,\n pdfY: stampAnnot.boundingBox.y,\n pdfW: stampAnnot.boundingBox.width,\n pdfH: stampAnnot.boundingBox.height,\n };\n }\n }\n (_b = this.pdfDocument) === null || _b === void 0 ? void 0 : _b.editAnnotation(nativeAnnot).then(() => {\n const { pageNumber } = nativeAnnot.boundingBox;\n const updatedItem = this.createWebViewerAnnotation(nativeAnnot, pageNumber);\n if (updatedItem) {\n this.handleAnnotationCache.set(item.id, updatedItem);\n this.dispatchEvent('itemUpdated', updatedItem);\n this.dispatchEvent('pageChanged', pageNumber);\n resolve(updatedItem);\n }\n else {\n throw new Error('failed to update item');\n }\n }).catch((error) => {\n reject(error);\n });\n }\n }\n });\n }\n getTextStampAspectRatio(stampText) {\n return new Promise((resolve, reject) => {\n var _a;\n if (this.pdfDocument && this.view) {\n (_a = this.pdfDocument) === null || _a === void 0 ? void 0 : _a.getTextStampAspectRatio(stampText).then((ratio) => {\n resolve(ratio);\n });\n }\n else {\n reject('No document opened');\n }\n });\n }\n createNativeColor(color) {\n let red = 0;\n let green = 0;\n let blue = 0;\n let alpha = 0;\n if (!color) {\n return new PdfViewing.Pdf.Annotations.Color(red, green, blue, alpha);\n }\n color = color.replace(/\\s+/gi, '');\n if (color.indexOf('#') === 0) {\n if (color.length === 4) {\n red = parseInt(color.substring(1, 2), 16);\n green = parseInt(color.substring(2, 3), 16);\n blue = parseInt(color.substring(3, 4), 16);\n alpha = 255;\n }\n else if (color.length === 5) {\n red = parseInt(color.substring(1, 2), 16);\n green = parseInt(color.substring(2, 3), 16);\n blue = parseInt(color.substring(3, 4), 16);\n alpha = parseInt(color.substring(4, 5), 16);\n }\n else if (color.length === 7) {\n red = parseInt(color.substring(1, 3), 16);\n green = parseInt(color.substring(3, 5), 16);\n blue = parseInt(color.substring(5, 7), 16);\n alpha = 255;\n }\n else if (color.length === 9) {\n red = parseInt(color.substring(1, 3), 16);\n green = parseInt(color.substring(3, 5), 16);\n blue = parseInt(color.substring(5, 7), 16);\n alpha = parseInt(color.substring(7, 9), 16);\n }\n else {\n throw new Error('invalid color string: ' + color);\n }\n }\n else if (color.indexOf('rgb') === 0) {\n const values = color.substring(color.indexOf('(') + 1, color.indexOf(')')).split(',');\n if (values.length < 3 || values.length > 4) {\n throw new Error('invalid color string: ' + color);\n }\n red = parseInt(values[0], 10);\n green = parseInt(values[1], 10);\n blue = parseInt(values[2], 10);\n if (values.length === 4) {\n alpha = Math.floor(parseFloat(values[3]) * 255);\n }\n else {\n alpha = 255;\n }\n }\n else {\n throw new Error('invalid color string: ' + color);\n }\n return new PdfViewing.Pdf.Annotations.Color(red, green, blue, alpha);\n }\n createWebViewerAnnotation(annot, page) {\n var _a, _b;\n let ww_annot = {};\n ww_annot.itemCategory = PdfItemCategory.ANNOTATION;\n ww_annot.sourceTag = annot.sourceTag;\n if (annot instanceof PdfViewing.Pdf.Annotations.MarkupAnnotation) {\n const bbox = annot.boundingBox;\n if (bbox) {\n ww_annot.pdfRect = this.ViewingPdfRect2WwPdfRect(bbox);\n }\n ww_annot.page = page;\n ww_annot.privateData = annot.privateData ? annot.privateData : null;\n const info = annot.info;\n if (info) {\n ww_annot.content = info === null || info === void 0 ? void 0 : info.content;\n ww_annot.author = (info === null || info === void 0 ? void 0 : info.author) || '';\n ww_annot.id = info === null || info === void 0 ? void 0 : info.getHashCode();\n ww_annot.modificationDate = (info === null || info === void 0 ? void 0 : info.modificationDate) || null;\n ww_annot.creationDate = (info === null || info === void 0 ? void 0 : info.creationDate) || null;\n ww_annot.subject = info === null || info === void 0 ? void 0 : info.subject;\n }\n ww_annot.isLocked = () => {\n const cachedAnnotation = this.nativeAnnotationCache.get(ww_annot.id);\n if (cachedAnnotation instanceof PdfViewing.Pdf.Annotations.MarkupAnnotation) {\n const markupAnnot = cachedAnnotation;\n if (markupAnnot.info) {\n return markupAnnot.info.locked;\n }\n }\n console.warn('annotation not found');\n return false;\n };\n ww_annot.setLock = (isLocked) => {\n const cachedAnnotation = this.nativeAnnotationCache.get(ww_annot.id);\n if (cachedAnnotation instanceof PdfViewing.Pdf.Annotations.MarkupAnnotation) {\n const markupAnnot = cachedAnnotation;\n if (markupAnnot.info) {\n markupAnnot.info.locked = isLocked;\n }\n }\n };\n if (annot instanceof PdfViewing.Pdf.Annotations.TextMarkup) {\n ww_annot.color = this.convertColorToRgbaString(annot.color);\n }\n ww_annot.isHidden = () => {\n const cachedAnnotation = this.nativeAnnotationCache.get(ww_annot.id);\n if (!cachedAnnotation) {\n console.warn('annotation not found');\n return false;\n }\n return cachedAnnotation.hidden;\n };\n ww_annot.setHidden = (isHidden) => {\n const cachedAnnotation = this.nativeAnnotationCache.get(ww_annot.id);\n if (!cachedAnnotation) {\n console.warn('annotation not found');\n return false;\n }\n return (cachedAnnotation.hidden = isHidden);\n };\n ww_annot.border = {};\n this.addPopup(ww_annot, annot);\n if (annot instanceof PdfViewing.Pdf.Annotations.StickyNote) {\n ww_annot.color = this.convertColorToRgbaString(annot.color);\n ww_annot.itemType = PdfItemType.TEXT;\n }\n else if (annot instanceof PdfViewing.Pdf.Annotations.FreeText) {\n ww_annot.itemType = PdfItemType.FREE_TEXT;\n const freetextAnnot = annot;\n const ww_freetextAnnot = ww_annot;\n ww_freetextAnnot.richText =\n freetextAnnot.richText ||\n `<?xml version=\"1.0\"?><body xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:xfa=\"http://www.xfa.org/schema/xfa-data/1.0/\" xfa:APIVersion=\"Acrobat:21.11.0\" xfa:spec=\"2.0.2\" style=\"color:#000000;font-family:Helvetica;font-size:12pt;\"><p>${annot.info.content}</p></body>`;\n ww_freetextAnnot.rotation = freetextAnnot.rotation;\n ww_freetextAnnot.color = this.convertColorToRgbaString(freetextAnnot.backgroundColor);\n const stroke = freetextAnnot.annotationStroke;\n if (stroke) {\n ww_freetextAnnot.border.width = stroke === null || stroke === void 0 ? void 0 : stroke.lineWidth;\n ww_freetextAnnot.border.style = 0;\n stroke.close();\n }\n }\n else if (annot instanceof PdfViewing.Pdf.Annotations.RectangleAnnotation) {\n const ww_shapeAnnot = ww_annot;\n ww_shapeAnnot.itemType = PdfItemType.SQUARE;\n ww_shapeAnnot.color = this.convertColorToRgbaString(annot.strokeColor);\n const stroke = annot.annotationStroke;\n if (stroke) {\n ww_shapeAnnot.border.width = stroke === null || stroke === void 0 ? void 0 : stroke.lineWidth;\n const hasDashArray = stroke.dashArray.length && stroke.dashArray[0] > 0;\n ww_shapeAnnot.border.style = hasDashArray\n ? 1\n : this.convertToWebViewerBorderStyle(annot.borderStyleType);\n stroke.close();\n }\n if (annot.fillColor) {\n ww_shapeAnnot.fillColor = this.convertColorToRgbaString(annot.fillColor);\n }\n }\n else if (annot instanceof PdfViewing.Pdf.Annotations.EllipseAnnotation) {\n const ww_shapeAnnot = ww_annot;\n ww_shapeAnnot.itemType = PdfItemType.CIRCLE;\n ww_shapeAnnot.color = this.convertColorToRgbaString(annot.strokeColor);\n const stroke = annot.annotationStroke;\n if (stroke) {\n ww_shapeAnnot.border.width = stroke === null || stroke === void 0 ? void 0 : stroke.lineWidth;\n const hasDashArray = stroke.dashArray.length && stroke.dashArray[0] > 0;\n ww_shapeAnnot.border.style = hasDashArray\n ? 1\n : this.convertToWebViewerBorderStyle(annot.borderStyleType);\n stroke.close();\n }\n if (annot.fillColor) {\n ww_shapeAnnot.fillColor = this.convertColorToRgbaString(annot.fillColor);\n }\n }\n else if (annot instanceof PdfViewing.Pdf.Annotations.PolygonAnnotation) {\n ww_annot.itemType = PdfItemType.POLYGON;\n const stroke = annot.annotationStroke;\n if (stroke) {\n ww_annot.border.width = stroke === null || stroke === void 0 ? void 0 : stroke.lineWidth;\n const hasDashArray = stroke.dashArray.length && stroke.dashArray[0] > 0;\n ww_annot.border.style = hasDashArray\n ? 1\n : this.convertToWebViewerBorderStyle(annot.borderStyleType);\n }\n }\n else if (annot instanceof PdfViewing.Pdf.Annotations.PolyLineAnnotation) {\n ww_annot.itemType = PdfItemType.POLY_LINE;\n const stroke = annot.annotationStroke;\n if (stroke) {\n ww_annot.border.width = stroke === null || stroke === void 0 ? void 0 : stroke.lineWidth;\n ww_annot.border.style = 0;\n stroke.close();\n }\n }\n else if (annot instanceof PdfViewing.Pdf.Annotations.TextMarkup) {\n const highlightAnnot = ww_annot;\n highlightAnnot.markedText = annot.markedText;\n if (annot.markupArea !== null) {\n highlightAnnot.quadrilaterals = [];\n for (let index = 0; index < annot.markupArea.size; index++) {\n highlightAnnot.quadrilaterals.push(annot.markupArea.get(index));\n }\n }\n if (annot instanceof PdfViewing.Pdf.Annotations.Highlight) {\n highlightAnnot.itemType = PdfItemType.HIGHLIGHT;\n }\n else if (annot instanceof PdfViewing.Pdf.Annotations.Underline) {\n highlightAnnot.itemType = PdfItemType.UNDERLINE;\n }\n else if (annot instanceof PdfViewing.Pdf.Annotations.Squiggly) {\n highlightAnnot.itemType = PdfItemType.SQUIGGLY;\n }\n else if (annot instanceof PdfViewing.Pdf.Annotations.StrikeThrough) {\n highlightAnnot.itemType = PdfItemType.STRIKE_OUT;\n }\n }\n else if (annot instanceof PdfViewing.Pdf.Annotations.Stamp) {\n const stampAnnot = ww_annot;\n stampAnnot.itemType = PdfItemType.STAMP;\n stampAnnot.rotation = annot.rotation;\n }\n else if (annot instanceof PdfViewing.Pdf.Annotations.TextInsert) {\n return null;\n }\n else if (annot instanceof PdfViewing.Pdf.Annotations.InkAnnotation) {\n const sdkInkAnnot = annot;\n const inkAnnot = ww_annot;\n inkAnnot.itemType = PdfItemType.INK;\n inkAnnot.color = this.convertColorToRgbaString(sdkInkAnnot.strokeColor);\n inkAnnot.border = {\n width: ((_a = sdkInkAnnot.annotationStroke) === null || _a === void 0 ? void 0 : _a.lineWidth) || 1,\n style: AnnotationBorderStyle.SOLID,\n };\n inkAnnot.inkList = [];\n const { vertices } = sdkInkAnnot.path;\n let path = null;\n for (let i = 0; i < vertices.size; i++) {\n const vertex = vertices.get(i);\n if (vertex.operator === PdfViewing.Pdf.Geometry.Real.PathOperation.MoveTo) {\n if (path) {\n inkAnnot.inkList.push(path);\n }\n path = [{ x: vertex.x, y: vertex.y }];\n }\n else if (vertex.operator === PdfViewing.Pdf.Geometry.Real.PathOperation.LineTo) {\n path === null || path === void 0 ? void 0 : path.push({ x: vertex.x, y: vertex.y });\n }\n }\n if (path) {\n inkAnnot.inkList.push(path);\n }\n }\n else if (annot instanceof PdfViewing.Pdf.Annotations.Popup) {\n return null;\n }\n else {\n return null;\n }\n }\n else if (annot instanceof PdfViewing.Pdf.Annotations.Link) {\n ww_annot.itemType = PdfItemType.LINK;\n const linkAnnot = ww_annot;\n ww_annot.id = annot.getHashCode();\n ww_annot.pdfRect = this.ViewingPdfRect2WwPdfRect(annot.boundingBox);\n if (annot instanceof PdfViewing.Pdf.Annotations.WebLink) {\n linkAnnot.uri = annot.uri;\n linkAnnot.actionType = PdfActionType.URI;\n }\n else if (annot instanceof PdfViewing.Pdf.Annotations.InternalLink) {\n const target = (_b = annot.destination) === null || _b === void 0 ? void 0 : _b.target;\n linkAnnot.actionType = PdfActionType.GO_TO;\n if (target) {\n linkAnnot.destination = {\n destinationType: 8,\n pageNumber: target.pageNumber,\n left: null,\n top: null,\n zoom: null,\n };\n }\n }\n }\n else if (annot instanceof PdfViewing.Pdf.Forms.Widget) {\n const widgetAnnot = ww_annot;\n widgetAnnot.id = annot.getHashCode();\n widgetAnnot.itemType = PdfItemType.WIDGET;\n widgetAnnot.page = page;\n const bbox = annot.boundingBox;\n widgetAnnot.pdfRect = this.ViewingPdfRect2WwPdfRect(bbox);\n widgetAnnot.widget = annot;\n widgetAnnot.isLocked = () => {\n return false;\n };\n widgetAnnot.isHidden = () => {\n return annot.hidden;\n };\n widgetAnnot.setHidden = (isHidden) => {\n annot.hidden = isHidden;\n };\n widgetAnnot.pdfDocument = this.pdfDocument;\n if (annot instanceof PdfViewing.Pdf.Forms.CheckBox) {\n widgetAnnot.widgetType = WidgetType.CHECK_BOX;\n }\n else if (annot instanceof PdfViewing.Pdf.Forms.RadioButton) {\n widgetAnnot.widgetType = WidgetType.RADIO_BUTTON;\n }\n else if (annot instanceof PdfViewing.Pdf.Forms.TextBox) {\n widgetAnnot.widgetType = WidgetType.TEXT_BOX;\n }\n else if (annot instanceof PdfViewing.Pdf.Forms.ListBox) {\n widgetAnnot.widgetType = WidgetType.LIST_BOX;\n }\n else if (annot instanceof PdfViewing.Pdf.Forms.ComboBox) {\n widgetAnnot.widgetType = WidgetType.COMBO_BOX;\n }\n }\n else {\n return null;\n }\n const isReadOnly = () => {\n const { annotationPermissionCallback, onlyAuthorCanEdit, user } = this.pdfViewerApiOptions;\n let eventThrottlingTimer = null;\n let lastResult = false;\n const viewOnly = this.pdfViewerApiOptions.viewOnly ||\n !(PdfViewing.Sdk.supportedFeatures & PdfViewing.LicenseFeature.Annotate);\n return () => {\n if (eventThrottlingTimer) {\n return lastResult;\n }\n lastResult = false;\n if (viewOnly || !(PdfViewing.Sdk.supportedFeatures & PdfViewing.LicenseFeature.Annotate)) {\n lastResult = true;\n }\n else if (annotationPermissionCallback) {\n lastResult = !annotationPermissionCallback(ww_annot, user);\n }\n else if (onlyAuthorCanEdit) {\n lastResult = !ww_annot.author || user !== ww_annot.author;\n }\n eventThrottlingTimer = window.setTimeout(() => {\n eventThrottlingTimer = null;\n }, 50);\n return lastResult;\n };\n };\n ww_annot.isReadOnly = isReadOnly();\n ww_annot.behaviors = this.getAnnotationBehaviors(ww_annot);\n return ww_annot;\n }\n getAnnotationBehaviors(ww_annot) {\n const defaultBehaviors = annotationDefaultBehaviors[ww_annot.itemType];\n if (!defaultBehaviors) {\n return {\n isReadOnly: true,\n selectable: false,\n editable: false,\n deletable: false,\n movable: false,\n rotatable: false,\n resizable: false,\n aspectRatioChangeable: false,\n canHavePopup: false,\n link: false,\n text: false,\n };\n }\n let isReadOnly = false;\n if (this.pdfViewerApiOptions.viewOnly ||\n !(this.licenseFeatures & PdfViewing.LicenseFeature.Annotate)) {\n isReadOnly = true;\n }\n const behaviors = {\n isReadOnly,\n selectable: defaultBehaviors[0],\n editable: defaultBehaviors[1],\n deletable: defaultBehaviors[2],\n movable: defaultBehaviors[3],\n rotatable: defaultBehaviors[4],\n resizable: defaultBehaviors[5],\n aspectRatioChangeable: defaultBehaviors[6],\n canHavePopup: this.pdfViewerApiOptions.allowPopups && defaultBehaviors[7],\n link: defaultBehaviors[8],\n text: defaultBehaviors[9],\n };\n return behaviors;\n }\n addPopup(ww_annot, annot) {\n const popup = annot.popup;\n if (popup) {\n ww_annot.popup = {};\n ww_annot.popup.pdfRect = this.ViewingPdfRect2WwPdfRect(popup.boundingBox);\n ww_annot.popup.isOpen = popup.isOpen;\n ww_annot.popup.pdfRect.page = ww_annot.page;\n popup.close();\n }\n }\n getOpenPopups(firstPage, lastPage) {\n var _a;\n const annotationsWithOpenPopups = [];\n for (let i = firstPage; i <= lastPage; i++) {\n (_a = this.pageAnnotationCache.get(i)) === null || _a === void 0 ? void 0 : _a.forEach((annot) => {\n if (annot.popup && annot.popup.isOpen) {\n annotationsWithOpenPopups.push(annot);\n }\n });\n }\n return annotationsWithOpenPopups;\n }\n convertColorToRgbaString(color) {\n let rgba_string = '#';\n if (!color) {\n rgba_string += '00000000';\n return rgba_string;\n }\n rgba_string += color.red.toString(16).padStart(2, '0');\n rgba_string += color.green.toString(16).padStart(2, '0');\n rgba_string += color.blue.toString(16).padStart(2, '0');\n rgba_string += color.alpha.toString(16).padStart(2, '0');\n return rgba_string;\n }\n getPageLayoutMode() {\n if (this.view) {\n return this.view.pageLayoutMode;\n }\n return PdfViewing.Pdf.Navigation.PageLayoutMode.SinglePage;\n }\n setPageLayoutMode(layout) {\n if (this.view) {\n this.view.pageLayoutMode = layout;\n }\n }\n getScrollMaxPosition() {\n var _a;\n const sp = (_a = this.view) === null || _a === void 0 ? void 0 : _a.scrollMaxPosition;\n if (sp) {\n sp.x = Math.max(sp.x - this.viewportSize.width, 0);\n sp.y = Math.max(sp.y - this.viewportSize.height, 0);\n }\n return sp;\n }\n getScrollPosition() {\n var _a;\n return (_a = this.view) === null || _a === void 0 ? void 0 : _a.scrollPosition;\n }\n setScrollPosition(pos) {\n const sp = new PdfViewing.Pdf.Geometry.Integer.ScrollPosition(pos.x, pos.y);\n if (this.view) {\n this.view.scrollPosition = pos;\n }\n }\n getPageScreenRect(page) {\n var _a;\n const viewingRect = (_a = this.view) === null || _a === void 0 ? void 0 : _a.getPageRectangleOnViewport(page);\n if (viewingRect) {\n return this.ViewingVPRect2WwVpRect(viewingRect);\n }\n return null;\n }\n getClosestPointOnPdfByScreenPoint(point, padding = 0, page) {\n if (this.view && this.pdfDocument) {\n const p = new PdfViewing.Pdf.Geometry.Integer.Point(point.x, point.y);\n const pointOnPage = page\n ? this.view.transformPointFromViewportToSpecificPage(p, page, true)\n : this.view.transformPointFromViewportToPage(p, true);\n const pageSize = this.pdfDocument.getPageSize(pointOnPage.pageNumber, true);\n const pdfPoint = {\n pdfX: pointOnPage.x,\n pdfY: pointOnPage.y,\n page: pointOnPage.pageNumber,\n };\n if (pdfPoint.pdfX < padding) {\n pdfPoint.pdfX = padding;\n }\n else if (pdfPoint.pdfX > pageSize.width - padding) {\n pdfPoint.pdfX = pageSize.width - padding;\n }\n if (pdfPoint.pdfY < padding) {\n pdfPoint.pdfY = padding;\n }\n else if (pdfPoint.pdfY > pageSize.height - padding) {\n pdfPoint.pdfY = pageSize.height - padding;\n }\n return pdfPoint;\n }\n throw new Error('PDF Document must not be null');\n }\n transformPdfLengthToScreenLength(pdfLength) {\n var _a;\n if (this.view) {\n return (_a = this.view) === null || _a === void 0 ? void 0 : _a.transformPdfLengthToViewportLength(pdfLength);\n }\n throw new Error('View must not be null');\n }\n transformScreenLengthToPdfLength(pdfLength) {\n var _a;\n if (this.view) {\n return (_a = this.view) === null || _a === void 0 ? void 0 : _a.transformViewportLengthToPdfLength(pdfLength);\n }\n throw new Error('View must not be null');\n }\n transformScreenPointToPdfPoint(point, page) {\n if (this.view && this.pdfDocument) {\n const p = new PdfViewing.Pdf.Geometry.Integer.Point(point.x, point.y);\n try {\n const pointOnPage = page\n ? this.view.transformPointFromViewportToSpecificPage(p, page, false)\n : this.view.transformPointFromViewportToPage(p, false);\n const pageSize = this.pdfDocument.getPageSize(pointOnPage.pageNumber, true);\n return {\n pdfPoint: { pdfX: pointOnPage.x, pdfY: pointOnPage.y, page: pointOnPage.pageNumber },\n isOnPage: pointOnPage.x >= 0 &&\n pointOnPage.x <= pageSize.width &&\n pointOnPage.y >= 0 &&\n pointOnPage.y <= pageSize.height,\n };\n }\n catch (error) {\n if (error instanceof PdfViewing.ArgumentError) {\n return { pdfPoint: null, isOnPage: false };\n }\n }\n }\n return null;\n }\n transformPdfPointToScreenPoint(pdfPoint) {\n var _a;\n const screenPoint = (_a = this.view) === null || _a === void 0 ? void 0 : _a.transformPointFromPageToViewport(new PdfViewing.Pdf.Geometry.Real.PointOnPage(pdfPoint.page, pdfPoint.pdfX, pdfPoint.pdfY));\n return {\n x: screenPoint === null || screenPoint === void 0 ? void 0 : screenPoint.x,\n y: screenPoint === null || screenPoint === void 0 ? void 0 : screenPoint.y,\n };\n }\n transformPdfPageRectToScreenRect(pdfRect) {\n var _a;\n const screenRect = (_a = this.view) === null || _a === void 0 ? void 0 : _a.transformRectangleFromPageToViewport(new PdfViewing.Pdf.Geometry.Real.RectangleOnPage(pdfRect.page, pdfRect.pdfX, pdfRect.pdfY, pdfRect.pdfW, pdfRect.pdfH));\n return {\n x: screenRect === null || screenRect === void 0 ? void 0 : screenRect.x,\n y: screenRect === null || screenRect === void 0 ? void 0 : screenRect.y,\n w: screenRect === null || screenRect === void 0 ? void 0 : screenRect.width,\n h: screenRect === null || screenRect === void 0 ? void 0 : screenRect.height,\n };\n }\n transformScreenRectToPdfRect(screenRect, page) {\n var _a;\n const vpRect = new PdfViewing.Pdf.Geometry.Integer.Rectangle(screenRect.x, screenRect.y, screenRect.w, screenRect.h);\n try {\n const pdfRect = (_a = this.view) === null || _a === void 0 ? void 0 : _a.transformRectangleFromViewportToSpecificPage(vpRect, page);\n return {\n pdfX: pdfRect === null || pdfRect === void 0 ? void 0 : pdfRect.x,\n pdfY: pdfRect === null || pdfRect === void 0 ? void 0 : pdfRect.y,\n pdfW: pdfRect === null || pdfRect === void 0 ? void 0 : pdfRect.width,\n pdfH: pdfRect === null || pdfRect === void 0 ? void 0 : pdfRect.height,\n page,\n };\n }\n catch (error) {\n return null;\n }\n }\n transformQuadrilateralToViewport(quadrilateral) {\n const points = [];\n if (this.view) {\n points.push(this.view.transformPointFromPageToViewport(new PdfViewing.Pdf.Geometry.Real.PointOnPage(quadrilateral.pageNumber, quadrilateral.topLeft.x, quadrilateral.topLeft.y)));\n points.push(this.view.transformPointFromPageToViewport(new PdfViewing.Pdf.Geometry.Real.PointOnPage(quadrilateral.pageNumber, quadrilateral.topRight.x, quadrilateral.topRight.y)));\n points.push(this.view.transformPointFromPageToViewport(new PdfViewing.Pdf.Geometry.Real.PointOnPage(quadrilateral.pageNumber, quadrilateral.bottomRight.x, quadrilateral.bottomRight.y)));\n points.push(this.view.transformPointFromPageToViewport(new PdfViewing.Pdf.Geometry.Real.PointOnPage(quadrilateral.pageNumber, quadrilateral.bottomLeft.x, quadrilateral.bottomLeft.y)));\n }\n return points;\n }\n getAnnotationsOnPoint(point, onlySelectable) {\n var _a;\n const annotList = (_a = this.view) === null || _a === void 0 ? void 0 : _a.getAnnotationsOnPoint(point, onlySelectable);\n if (annotList && annotList.size > 0) {\n const annotationList = [];\n for (let i = 0; i < annotList.size; i++) {\n const annot = annotList.get(i);\n const annotId = annot.getHashCode();\n if (this.handleAnnotationCache.has(annotId)) {\n annotationList.push(this.handleAnnotationCache.get(annotId));\n }\n else {\n console.warn('annotation handle is not cached');\n }\n annot.close();\n }\n annotList.close();\n return annotationList;\n }\n return null;\n }\n getItemsFromPage(page, type) {\n if (type === 1) {\n return this.getAnnotationsFromPage(page);\n }\n }\n onDocumentOpened(document, renderOptions, viewOptions) {\n const _viewOptions = viewOptions ? viewOptions : new PdfViewing.Pdf.ViewOptions();\n _viewOptions.viewDPI = this.getXDPI();\n const { initialDestination, initialPageLayoutMode } = document;\n if (initialPageLayoutMode !== null && _viewOptions.initialPageLayoutMode === null) {\n _viewOptions.initialPageLayoutMode = initialPageLayoutMode;\n }\n if (initialDestination !== null && _viewOptions.initialDestination === null) {\n _viewOptions.initialDestination = initialDestination;\n }\n this.view = PdfViewing.Pdf.View.create(document, renderOptions, viewOptions);\n this.attachEventListeners();\n if (this.view) {\n this.dispatchEvent('firstVisiblePage', this.view.firstVisiblePage);\n this.dispatchEvent('lastVisiblePage', this.view.lastVisiblePage);\n this.dispatchEvent('pageNumber', this.view.pageNumber);\n this.dispatchEvent('fitMode', this.view.fitMode);\n this.dispatchEvent('pageLayoutMode', this.ViewingPageLayoutToWwPageLayout(this.view.pageLayoutMode));\n }\n }\n ViewingPageLayoutToWwPageLayout(layout) {\n switch (layout) {\n case PdfViewing.Pdf.Navigation.PageLayoutMode.OneColumn:\n return PdfPageLayoutMode.ONE_COLUMN;\n case PdfViewing.Pdf.Navigation.PageLayoutMode.SinglePage:\n return PdfPageLayoutMode.SINGLE_PAGE;\n case PdfViewing.Pdf.Navigation.PageLayoutMode.TwoColumnLeft:\n return PdfPageLayoutMode.TWO_COLUMN_LEFT;\n case PdfViewing.Pdf.Navigation.PageLayoutMode.TwoColumnRight:\n return PdfPageLayoutMode.TWO_COLUMN_RIGHT;\n case PdfViewing.Pdf.Navigation.PageLayoutMode.TwoPageLeft:\n return PdfPageLayoutMode.TWO_PAGE_LEFT;\n case PdfViewing.Pdf.Navigation.PageLayoutMode.TwoPageRight:\n return PdfPageLayoutMode.TWO_PAGE_RIGHT;\n default:\n return PdfPageLayoutMode.ONE_COLUMN;\n }\n }\n WwPageLayoutToViewingPageLayout(layout) {\n switch (layout) {\n case PdfPageLayoutMode.ONE_COLUMN:\n return PdfViewing.Pdf.Navigation.PageLayoutMode.OneColumn;\n case PdfPageLayoutMode.SINGLE_PAGE:\n return PdfViewing.Pdf.Navigation.PageLayoutMode.SinglePage;\n case PdfPageLayoutMode.TWO_COLUMN_LEFT:\n return PdfViewing.Pdf.Navigation.PageLayoutMode.TwoColumnLeft;\n case PdfPageLayoutMode.TWO_COLUMN_RIGHT:\n return PdfViewing.Pdf.Navigation.PageLayoutMode.TwoColumnRight;\n case PdfPageLayoutMode.TWO_PAGE_LEFT:\n return PdfViewing.Pdf.Navigation.PageLayoutMode.TwoPageLeft;\n case PdfPageLayoutMode.TWO_PAGE_RIGHT:\n return PdfViewing.Pdf.Navigation.PageLayoutMode.TwoPageRight;\n case PdfPageLayoutMode.ONE_COLUMN:\n default:\n return PdfViewing.Pdf.Navigation.PageLayoutMode.OneColumn;\n }\n }\n WwFitModeToViewingFitMode(fitMode) {\n switch (fitMode) {\n case PdfFitMode.NONE:\n return PdfViewing.Pdf.Navigation.FitMode.None;\n case PdfFitMode.FIT_PAGE:\n return PdfViewing.Pdf.Navigation.FitMode.FitPage;\n case PdfFitMode.FIT_WIDTH:\n return PdfViewing.Pdf.Navigation.FitMode.FitWidth;\n default:\n return PdfViewing.Pdf.Navigation.FitMode.None;\n }\n }\n getLastVisiblePage() {\n if (this.view) {\n return this.view.lastVisiblePage;\n }\n return 0;\n }\n getFirstVisiblePage() {\n if (this.view) {\n return this.view.firstVisiblePage;\n }\n return 0;\n }\n drawImages(ctx, data, options) {\n if (data.visiblePages) {\n ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);\n const currentPage = this.getPageNumber();\n for (let i = 0; i < data.visiblePages.size; i++) {\n const { image, pageRect, pageNumber } = data.visiblePages.get(i);\n ctx.save();\n if (currentPage === pageNumber && options.currentPageShadow) {\n ctx.shadowColor = options.currentPageShadow.shadowColor;\n ctx.shadowBlur = options.currentPageShadow.shadowBlur;\n ctx.shadowOffsetX = options.currentPageShadow.shadowOffsetX;\n ctx.shadowOffsetY = options.currentPageShadow.shadowOffsetY;\n }\n else if (options.pageShadow) {\n ctx.shadowColor = options.pageShadow.shadowColor;\n ctx.shadowBlur = options.pageShadow.shadowBlur;\n ctx.shadowOffsetX = options.pageShadow.shadowOffsetX;\n ctx.shadowOffsetY = options.pageShadow.shadowOffsetY;\n }\n ctx.fillStyle = '#ffffffff';\n ctx.fillRect(pageRect.x, pageRect.y, pageRect.width, pageRect.height);\n ctx.restore();\n if (image) {\n const imageContainer = this.imageBitmapCache.get(image.id);\n if (imageContainer) {\n const { scaledImage, imageData } = imageContainer;\n const { imageRectangle } = image;\n if (imageData && scaledImage) {\n if (imageRectangle.width !== image.width || imageRectangle.height !== image.height) {\n ctx.drawImage(scaledImage, pageRect.x + imageRectangle.x, pageRect.y + imageRectangle.y, imageRectangle.width, imageRectangle.height);\n }\n else {\n ctx.putImageData(imageData, pageRect.x + imageRectangle.x, pageRect.y + imageRectangle.y);\n }\n }\n }\n image.close();\n }\n }\n }\n }\n addEventListener(type, listener) {\n if (type === 'busyState') {\n this.pdfController.addEventListener('busyChanged', listener);\n return;\n }\n if (this.eventListeners.has(type)) {\n ;\n this.eventListeners.get(type).push(listener);\n }\n else {\n this.eventListeners.set(type, [listener]);\n }\n }\n removeEventListener(type, listener) {\n if (this.eventListeners.has(type)) {\n let listeners = this.eventListeners.get(type);\n listeners = listeners.filter((listenerInArray) => listenerInArray !== listener);\n if (listeners.length !== 0) {\n this.eventListeners.set(type, listeners);\n }\n else {\n this.eventListeners.delete(type);\n }\n }\n }\n dispatchEvent(type, args) {\n if (this.eventListeners.has(type)) {\n const listeners = this.eventListeners.get(type);\n listeners.forEach((listener) => listener(args));\n }\n }\n attachEventListeners() {\n if (this.view) {\n this.view.addEventListener('viewUpdated', this.onViewUpdated);\n this.view.addEventListener('imageCreated', this.onImageCreated);\n this.view.addEventListener('imageRemovedFromCache', this.onImageRemovedFromCache);\n }\n }\n onViewUpdated(args) {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n if (args.bitmapsUpdated) {\n }\n if (args.fitmodeChanged) {\n (_a = this.eventListeners.get('fitMode')) === null || _a === void 0 ? void 0 : _a.forEach((listener) => {\n listener(this.view ? this.view.fitMode : PdfViewing.Pdf.Navigation.FitMode.None);\n });\n }\n if (args.pageLayoutModeChanged) {\n (_b = this.eventListeners.get('pageLayoutMode')) === null || _b === void 0 ? void 0 : _b.forEach((listener) => {\n listener(this.view ? this.view.pageLayoutMode : 0);\n });\n }\n if (args.pageSizeUpdated) {\n }\n if (args.scrollMaxPositionChanged) {\n }\n if (args.viewRotationChanged) {\n (_c = this.eventListeners.get('rotation')) === null || _c === void 0 ? void 0 : _c.forEach((listener) => {\n listener(this.view ? this.view.viewRotation : 0);\n });\n }\n if (args.visisblePageRangeChanged) {\n (_d = this.eventListeners.get('firstVisiblePage')) === null || _d === void 0 ? void 0 : _d.forEach((listener) => {\n listener(this.view ? this.view.firstVisiblePage : 0);\n });\n (_e = this.eventListeners.get('lastVisiblePage')) === null || _e === void 0 ? void 0 : _e.forEach((listener) => {\n listener(this.view ? this.view.lastVisiblePage : 0);\n });\n }\n if (args.pageNumberChanged) {\n (_f = this.eventListeners.get('pageNumber')) === null || _f === void 0 ? void 0 : _f.forEach((listener) => {\n listener(this.view ? this.view.pageNumber : 0);\n });\n }\n if (args.zoomChanged) {\n (_g = this.eventListeners.get('zoom')) === null || _g === void 0 ? void 0 : _g.forEach((listener) => {\n listener(this.view ? this.view.zoom : 0);\n });\n }\n (_h = this.eventListeners.get('canvasInvalidated')) === null || _h === void 0 ? void 0 : _h.forEach((listener) => {\n listener(true);\n });\n }\n onImageRemovedFromCache(id) {\n const imgContainer = this.imageBitmapCache.get(id);\n imgContainer === null || imgContainer === void 0 ? void 0 : imgContainer.destroy();\n this.imageBitmapCache.delete(id);\n }\n onImageCreated(image) {\n this.imageBitmapCache.set(image.id, new ImageContainer(image));\n image.removeImageData();\n image.close();\n }\n getProductVersion() {\n return PdfViewing.Sdk.version;\n }\n getXDPI() {\n var _a;\n if (this.devicePixelRatio !== window.devicePixelRatio || this.xDPI === 0) {\n const dpi = document.createElement('div');\n dpi.style.height = '1in';\n dpi.style.width = '1in';\n dpi.style.visibility = 'hidden';\n document.body.appendChild(dpi);\n this.xDPI = window.devicePixelRatio * dpi.offsetWidth;\n (_a = dpi.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(dpi);\n }\n return this.xDPI;\n }\n getYDPI() {\n var _a;\n if (this.devicePixelRatio !== window.devicePixelRatio || this.yDPI === 0) {\n const dpi = document.createElement('div');\n dpi.style.height = '1in';\n dpi.style.width = '1in';\n dpi.style.visibility = 'hidden';\n document.body.appendChild(dpi);\n this.yDPI = window.devicePixelRatio * dpi.offsetHeight;\n (_a = dpi.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(dpi);\n }\n return this.yDPI;\n }\n ViewingPdfRect2WwPdfRect(rect) {\n return {\n pdfX: rect.x,\n pdfY: rect.y,\n pdfW: rect.width,\n pdfH: rect.height,\n page: rect.pageNumber,\n };\n }\n ViewingQuadrilateral2WwPdfRect(quadrilateral) {\n if (quadrilateral.bottomLeft && quadrilateral.bottomRight && quadrilateral.topLeft) {\n const width = quadrilateral.bottomRight.x - quadrilateral.bottomLeft.x;\n const height = quadrilateral.topLeft.y - quadrilateral.bottomLeft.y;\n return {\n pdfX: quadrilateral.bottomLeft.x,\n pdfY: quadrilateral.bottomLeft.y,\n pdfW: width,\n pdfH: height,\n page: quadrilateral.pageNumber,\n };\n }\n return { page: -1, pdfX: -1, pdfY: -1, pdfW: -1, pdfH: -1 };\n }\n ViewingVPRect2WwVpRect(rect) {\n return { x: rect.x, y: rect.y, w: rect.width, h: rect.height };\n }\n}\n","import { PdfViewing } from '../pdf-viewing/PdfViewing';\nimport { app } from '../lib/hyperapp';\nimport { App } from './views/App';\nimport { FileType, } from '../pdf-viewer-api/types';\nimport { PdfItemCategory, } from '../pdf-viewer-api';\nimport { PdfViewerCanvas } from '../pdf-viewer-canvas/PdfViewerCanvas';\nimport { createState, actions } from './state/index';\nimport { DeviceType, ScreenSize } from './state/layout';\nimport { translationManager } from '../common/TranslationManager';\nimport { tooltipManager } from '../common/TooltipManager';\nimport { ColorPaletteMap, OptionsToVerify, WebViewerOptions, } from './WebViewerOptions';\nimport { getKeyboardCommands } from '../common/utils';\nexport class PdfWebViewer {\n constructor(containerElement, license, options) {\n this.visiblePageRange = {\n firstPage: 0,\n lastPage: 0,\n };\n this.eventListeners = new Map();\n this.loadThumbnailsQueue = [];\n this.loadPageThumbnailsTimer = null;\n this.metadata = {\n version: '4.3.6',\n type: 'stable',\n };\n if (!containerElement) {\n throw { error: 'PdfWebViewer container element is null' };\n }\n this.licenseKey = license;\n this.element = containerElement;\n this.options = new WebViewerOptions(options);\n if (options) {\n this.verifyOptions(options, this.options);\n }\n this.handleKeyboardShortcuts = this.handleKeyboardShortcuts.bind(this);\n this.createView = this.createView.bind(this);\n this.loadPageThumbnails = this.loadPageThumbnails.bind(this);\n this.loadDocumentOutlines = this.loadDocumentOutlines.bind(this);\n this.handleAppLoaded = this.handleAppLoaded.bind(this);\n this.handleResize = this.handleResize.bind(this);\n this.getScreenSize = this.getScreenSize.bind(this);\n this.handleDocumentOpened = this.handleDocumentOpened.bind(this);\n this.handleDocumentClosed = this.handleDocumentClosed.bind(this);\n this.handleFirstVisiblePageChanged = this.handleFirstVisiblePageChanged.bind(this);\n this.handleLastVisiblePageChanged = this.handleLastVisiblePageChanged.bind(this);\n this.handlePageNumberChanged = this.handlePageNumberChanged.bind(this);\n this.handleZoomChanged = this.handleZoomChanged.bind(this);\n this.handleRotationChanged = this.handleRotationChanged.bind(this);\n this.handleFitModeChanged = this.handleFitModeChanged.bind(this);\n this.handlePageLayoutModeChanged = this.handlePageLayoutModeChanged.bind(this);\n this.handleBusyStateChanged = this.handleBusyStateChanged.bind(this);\n this.handlePageChanged = this.handlePageChanged.bind(this);\n this.handleTextSelected = this.handleTextSelected.bind(this);\n this.handleError = this.handleError.bind(this);\n this.addPagesToThumbnailsQueue = this.addPagesToThumbnailsQueue.bind(this);\n this.handleAnnotationCreated = this.handleAnnotationCreated.bind(this);\n this.handleAnnotationUpdated = this.handleAnnotationUpdated.bind(this);\n this.handleAnnotationDeleted = this.handleAnnotationDeleted.bind(this);\n this.handleAnnotationSelected = this.handleAnnotationSelected.bind(this);\n this.handleAnnotationDeselected = this.handleAnnotationDeselected.bind(this);\n this.showUnconfirmedChangesDialog = this.showUnconfirmedChangesDialog.bind(this);\n document.addEventListener('keydown', this.handleKeyboardShortcuts, false);\n const resizeObserver = new ResizeObserver(this.handleResize);\n resizeObserver.observe(this.element);\n tooltipManager.setType(this.options.viewer.general.tooltips || 'title');\n const initialState = createState(this.options);\n initialState.layout.deviceType = /iPhone|iPad|iPod|Android|mobile/i.test(navigator.userAgent)\n ? DeviceType.Mobile\n : DeviceType.Desktop;\n initialState.layout.screenSize = this.getScreenSize();\n this.view = this.createView(app)(initialState, actions, App, this.element);\n }\n open(pdfFile, fdfFiles, password, viewOptions, renderOptions) {\n var _a;\n (_a = this.view) === null || _a === void 0 ? void 0 : _a.api.open({\n pdfFile,\n fdfFiles,\n password,\n viewOptions,\n renderOptions,\n });\n }\n openFile(file, password, pdfAuthorization) {\n let inputFile = undefined;\n if (typeof file === 'string') {\n inputFile = { uri: file };\n if (pdfAuthorization) {\n inputFile.httpOptions = {\n headers: {\n Authorization: pdfAuthorization,\n },\n };\n }\n }\n else {\n inputFile = { data: file };\n }\n this.open(inputFile, null, password);\n }\n openFDF(pdfFile, fdfFile, password, pdfAuthorization, fdfAuthorization) {\n let pdfInputFile = undefined;\n if (typeof pdfFile === 'string') {\n pdfInputFile = { uri: pdfFile };\n if (pdfAuthorization) {\n pdfInputFile.httpOptions = {\n headers: {\n Authorization: pdfAuthorization,\n },\n };\n }\n }\n else {\n pdfInputFile = { data: pdfFile };\n }\n const fdfInputFile = typeof fdfFile === 'string'\n ? { uri: fdfFile }\n : { data: fdfFile };\n this.open(pdfInputFile, [fdfInputFile], password);\n }\n save(saveOptions) {\n return this.viewerCanvas ? this.viewerCanvas.save(saveOptions) : null;\n }\n saveFile(asFdf) {\n return new Promise((resolve, reject) => {\n var _a;\n const fileType = asFdf ? FileType.Fdf : FileType.Pdf;\n (_a = this.save({ fileType })) === null || _a === void 0 ? void 0 : _a.then((blob) => {\n resolve(blob.arrayBuffer());\n });\n });\n }\n downloadFile(saveOptions) {\n if (this.view) {\n return this.view.api.downloadFile(saveOptions);\n }\n }\n close() {\n if (this.view) {\n return this.view.api.close();\n }\n }\n destroy() {\n var _a;\n document.removeEventListener('keydown', this.handleKeyboardShortcuts, false);\n this.eventListeners.clear();\n if (this.viewerCanvas) {\n this.viewerCanvas.removeEventListener('appLoaded', this.handleAppLoaded);\n this.viewerCanvas.removeEventListener('firstVisiblePage', this.handleFirstVisiblePageChanged);\n this.viewerCanvas.removeEventListener('lastVisiblePage', this.handleLastVisiblePageChanged);\n this.viewerCanvas.removeEventListener('pageNumber', this.handlePageNumberChanged);\n this.viewerCanvas.removeEventListener('zoom', this.handleZoomChanged);\n this.viewerCanvas.removeEventListener('fitMode', this.handleFitModeChanged);\n this.viewerCanvas.removeEventListener('pageLayoutMode', this.handlePageLayoutModeChanged);\n this.viewerCanvas.removeEventListener('busyState', this.handleBusyStateChanged);\n this.viewerCanvas.removeEventListener('rotation', this.handleRotationChanged);\n this.viewerCanvas.removeEventListener('pageChanged', this.handlePageChanged);\n this.viewerCanvas.removeEventListener('error', this.handleError);\n this.viewerCanvas.removeEventListener('itemCreated', this.handleAnnotationCreated);\n this.viewerCanvas.removeEventListener('itemUpdated', this.handleAnnotationUpdated);\n this.viewerCanvas.removeEventListener('itemDeleted', this.handleAnnotationDeleted);\n this.viewerCanvas.removeEventListener('itemSelected', this.handleAnnotationSelected);\n this.viewerCanvas.removeEventListener('itemDeselected', this.handleAnnotationDeselected);\n }\n (_a = this.viewerCanvas) === null || _a === void 0 ? void 0 : _a.destroy();\n this.viewerCanvas = undefined;\n this.view = undefined;\n this.loadThumbnailsQueue = [];\n if (this.loadPageThumbnailsTimer) {\n clearTimeout(this.loadPageThumbnailsTimer);\n }\n while (this.element.firstChild) {\n this.element.removeChild(this.element.firstChild);\n }\n }\n getPageCount() {\n return this.viewerCanvas ? this.viewerCanvas.getPageCount() : null;\n }\n getPageNumber() {\n if (this.viewerCanvas) {\n return this.viewerCanvas.getPageNumber();\n }\n return null;\n }\n setPageNumber(pageNumber) {\n if (this.viewerCanvas) {\n this.viewerCanvas.setPageNumber(pageNumber);\n }\n }\n rotatePage(pageNumber, direction) {\n if (this.viewerCanvas) {\n this.viewerCanvas.rotatePage(pageNumber, direction);\n }\n }\n nextPage() {\n if (this.viewerCanvas) {\n this.viewerCanvas.nextPage();\n }\n }\n previousPage() {\n if (this.viewerCanvas) {\n this.viewerCanvas.previousPage();\n }\n }\n getZoom() {\n if (this.viewerCanvas) {\n return this.viewerCanvas.getZoom();\n }\n return null;\n }\n setZoom(zoom) {\n if (this.viewerCanvas) {\n this.viewerCanvas.setZoom(zoom);\n }\n }\n zoomIn() {\n var _a;\n (_a = this.viewerCanvas) === null || _a === void 0 ? void 0 : _a.zoomIn();\n }\n zoomOut() {\n var _a;\n (_a = this.viewerCanvas) === null || _a === void 0 ? void 0 : _a.zoomOut();\n }\n getFitMode() {\n if (this.viewerCanvas) {\n return this.viewerCanvas.getFitMode();\n }\n return null;\n }\n setFitMode(fitMode) {\n if (this.viewerCanvas) {\n this.viewerCanvas.setFitMode(fitMode);\n }\n }\n getPageLayoutMode() {\n if (this.viewerCanvas) {\n return this.viewerCanvas.getPageLayoutMode();\n }\n return null;\n }\n setPageLayoutMode(pageLayoutMode) {\n if (this.viewerCanvas) {\n this.viewerCanvas.setPageLayoutMode(pageLayoutMode);\n }\n }\n getRotation() {\n if (this.viewerCanvas) {\n return this.viewerCanvas.getRotation();\n }\n return null;\n }\n setRotation(rotation) {\n if (this.viewerCanvas) {\n this.viewerCanvas.setRotation(rotation);\n }\n }\n getProductVersion() {\n return PdfViewing.Sdk.version;\n }\n getMetadata() {\n return this.metadata;\n }\n hasChanges() {\n if (this.view) {\n return this.view.api.hasChanges();\n }\n return null;\n }\n showInformationPane(selectedPane) {\n if (this.view) {\n if (selectedPane) {\n this.view.navigationPanel.selectNavigation(selectedPane);\n }\n else {\n this.view.navigationPanel.showNavigationPanel();\n }\n }\n }\n hideInformationPane() {\n if (this.view) {\n this.view.navigationPanel.hideNavigationPanel();\n }\n }\n toggleInformationPane() {\n if (this.view) {\n this.view.navigationPanel.toggleNavigationPanel();\n }\n }\n startSearch(searchString, searchOptions) {\n if (this.view && this.viewerCanvas) {\n const { startPage, isCaseSensitive, isWrappingEnabled, isRegex, hideToolbar } = searchOptions || {};\n const caseSensitive = Boolean(isCaseSensitive);\n const wrappingEnabled = Boolean(isWrappingEnabled);\n const regex = Boolean(isRegex);\n if (!hideToolbar) {\n this.view.search.openSearch();\n this.view.search.updateToSearch(searchString);\n this.view.search.setCaseSensitive(caseSensitive);\n this.view.search.setWrappingSearch(wrappingEnabled);\n this.view.search.setRegex(regex);\n }\n this.viewerCanvas.startSearch(searchString, startPage || 1, caseSensitive, wrappingEnabled, regex);\n }\n }\n nextSearchMatch() {\n if (this.viewerCanvas) {\n this.viewerCanvas.nextSearchMatch();\n }\n }\n previousSearchMatch() {\n if (this.viewerCanvas) {\n this.viewerCanvas.previousSearchMatch();\n }\n }\n endSearch() {\n if (this.view) {\n this.view.api.endSearch();\n this.view.search.closeSearch();\n }\n }\n print() {\n var _a;\n (_a = this.viewerCanvas) === null || _a === void 0 ? void 0 : _a.print();\n }\n getSelectedText() {\n var _a, _b;\n return (_b = (_a = this.viewerCanvas) === null || _a === void 0 ? void 0 : _a.getSelectedText()) !== null && _b !== void 0 ? _b : '';\n }\n addEventListener(type, listener) {\n if (this.eventListeners.has(type)) {\n ;\n this.eventListeners.get(type).push(listener);\n }\n else {\n this.eventListeners.set(type, [listener]);\n }\n }\n removeEventListener(type, listener) {\n if (this.eventListeners.has(type)) {\n let listeners = this.eventListeners.get(type);\n listeners = listeners.filter((listenerInArray) => listenerInArray !== listener);\n if (listeners.length !== 0) {\n this.eventListeners.set(type, listeners);\n }\n else {\n this.eventListeners.delete(type);\n }\n }\n }\n dispatchEvent(type, args) {\n if (this.eventListeners.has(type)) {\n const listeners = this.eventListeners.get(type);\n listeners.forEach((listener) => listener(args));\n }\n }\n createView(nextApp) {\n return (state, a, view, element) => {\n a.initialize = () => {\n const loadTranslationPromise = translationManager.loadTranslations(this.options.viewer.general.language || 'en');\n Promise.all([window.PdfToolsPromise, loadTranslationPromise])\n .then(() => {\n var _a;\n (_a = this.view) === null || _a === void 0 ? void 0 : _a.loadScriptsCompleted();\n })\n .catch((err) => {\n this.handleError(err);\n });\n };\n a.createCanvasView = (elm) => {\n try {\n this.viewerCanvas = new PdfViewerCanvas(elm, this.licenseKey, this.options);\n }\n catch (err) {\n this.handleError(err);\n return;\n }\n this.viewerCanvas.addEventListener('appLoaded', this.handleAppLoaded);\n this.viewerCanvas.addEventListener('firstVisiblePage', this.handleFirstVisiblePageChanged);\n this.viewerCanvas.addEventListener('lastVisiblePage', this.handleLastVisiblePageChanged);\n this.viewerCanvas.addEventListener('pageNumber', this.handlePageNumberChanged);\n this.viewerCanvas.addEventListener('zoom', this.handleZoomChanged);\n this.viewerCanvas.addEventListener('fitMode', this.handleFitModeChanged);\n this.viewerCanvas.addEventListener('rotation', this.handleRotationChanged);\n this.viewerCanvas.addEventListener('pageLayoutMode', this.handlePageLayoutModeChanged);\n this.viewerCanvas.addEventListener('busyState', this.handleBusyStateChanged);\n this.viewerCanvas.addEventListener('pageChanged', this.handlePageChanged);\n this.viewerCanvas.addEventListener('textSelected', this.handleTextSelected);\n this.viewerCanvas.addEventListener('error', this.handleError);\n this.viewerCanvas.addEventListener('itemCreated', this.handleAnnotationCreated);\n this.viewerCanvas.addEventListener('itemUpdated', this.handleAnnotationUpdated);\n this.viewerCanvas.addEventListener('itemDeleted', this.handleAnnotationDeleted);\n this.viewerCanvas.addEventListener('itemSelected', this.handleAnnotationSelected);\n this.viewerCanvas.addEventListener('itemDeselected', this.handleAnnotationDeselected);\n const params = new URLSearchParams(location.search);\n if (params) {\n const pdfUrl = params.get('url');\n if (pdfUrl) {\n this.open({ uri: pdfUrl, sourceTag: '' });\n }\n }\n };\n a.removeCanvasView = (elm) => {\n if (this.viewerCanvas) {\n this.viewerCanvas.removeEventListener('firstVisiblePage', this.handleFirstVisiblePageChanged);\n this.viewerCanvas.removeEventListener('lastVisiblePage', this.handleLastVisiblePageChanged);\n this.viewerCanvas.removeEventListener(`pageNumber`, this.handlePageNumberChanged);\n this.viewerCanvas.removeEventListener('zoom', this.handleZoomChanged);\n this.viewerCanvas.removeEventListener('fitMode', this.handleFitModeChanged);\n this.viewerCanvas.removeEventListener('pageLayoutMode', this.handlePageLayoutModeChanged);\n this.viewerCanvas.removeEventListener('busyState', this.handleBusyStateChanged);\n this.viewerCanvas.removeEventListener('error', this.handleError);\n this.viewerCanvas = undefined;\n }\n };\n a.api = {\n open: (args) => {\n if (this.view) {\n this.view.loadDocumentBegin();\n if (this.viewerCanvas) {\n if (!this.beforeOpen(args)) {\n return;\n }\n if (this.viewerCanvas) {\n this.viewerCanvas\n .open(args.pdfFile, args.fdfFiles, args.password, args.viewOptions, args.renderOptions)\n .then(() => {\n this.openResolve(args);\n })\n .catch((error) => {\n this.openReject(args, error);\n });\n }\n }\n }\n },\n close: () => {\n if (this.view && this.viewerCanvas) {\n if (this.showUnconfirmedChangesDialog()) {\n this.view.showConfirmUnsavedChangesDialog(null, this.handleDocumentClosed);\n return;\n }\n this.handleDocumentClosed();\n }\n },\n downloadFile: (saveOptions) => {\n return new Promise((resolve, reject) => {\n if (this.view && this.viewerCanvas) {\n this.view.saveDocumentBegin();\n const viewState = this.view.getState();\n const filename = viewState.pdfDocument.filename;\n const mimetype = viewState.pdfDocument.mimetype;\n this.viewerCanvas\n .save(saveOptions)\n .then((data) => {\n const newBlob = new Blob([data], { type: mimetype });\n const dataUrl = window.URL.createObjectURL(newBlob);\n const link = document.createElement('a');\n link.style.position = 'absolute';\n link.style.left = '-1000px';\n link.href = dataUrl;\n link.download = filename || 'download.pdf';\n this.element.appendChild(link);\n link.click();\n setTimeout(() => {\n var _a;\n this.element.removeChild(link);\n window.URL.revokeObjectURL(dataUrl);\n (_a = this.view) === null || _a === void 0 ? void 0 : _a.saveDocumentFulfilled();\n }, 100);\n resolve();\n })\n .catch((error) => {\n var _a;\n console.error(error);\n (_a = this.view) === null || _a === void 0 ? void 0 : _a.saveDocumentRejected(error);\n });\n }\n });\n },\n hasChanges: () => {\n if (this.viewerCanvas) {\n return this.viewerCanvas.hasChanges();\n }\n return null;\n },\n setZoom: (zoom) => {\n if (this.viewerCanvas) {\n this.viewerCanvas.setZoom(zoom / 100);\n }\n },\n getZoom: () => {\n if (this.viewerCanvas) {\n return this.viewerCanvas.getZoom();\n }\n return null;\n },\n zoomIn: () => {\n if (this.viewerCanvas) {\n this.viewerCanvas.zoomIn();\n }\n },\n zoomOut: () => {\n if (this.viewerCanvas) {\n this.viewerCanvas.zoomOut();\n }\n },\n setPageNumber: (page) => {\n if (this.viewerCanvas) {\n this.viewerCanvas.setPageNumber(page);\n }\n },\n getPageNumber: () => {\n if (this.viewerCanvas) {\n return this.viewerCanvas.getPageNumber();\n }\n return null;\n },\n getPageCount: () => {\n if (this.viewerCanvas) {\n return this.viewerCanvas.getPageCount();\n }\n return null;\n },\n nextPage: () => {\n if (this.viewerCanvas) {\n this.viewerCanvas.nextPage();\n }\n },\n previousPage: () => {\n if (this.viewerCanvas) {\n this.viewerCanvas.previousPage();\n }\n },\n setFitMode: (fitMode) => {\n if (this.viewerCanvas) {\n this.viewerCanvas.setFitMode(fitMode);\n }\n },\n getFitMode: () => {\n if (this.viewerCanvas) {\n return this.viewerCanvas.getFitMode();\n }\n return null;\n },\n setPageLayoutMode: (layoutMode) => {\n if (this.viewerCanvas) {\n this.viewerCanvas.setPageLayoutMode(layoutMode);\n }\n },\n getPageLayoutMode: () => {\n if (this.viewerCanvas) {\n return this.viewerCanvas.getPageLayoutMode();\n }\n return null;\n },\n rotatePage: (pageRotation) => {\n if (this.viewerCanvas) {\n return this.viewerCanvas.rotatePage(pageRotation.page, pageRotation.direction);\n }\n },\n rotate: () => {\n if (this.viewerCanvas) {\n const r = this.viewerCanvas.getRotation();\n const rotation = r >= 270 ? 0 : r + 90;\n this.viewerCanvas.setRotation(rotation);\n }\n },\n setRotation: (rotation) => {\n if (this.viewerCanvas) {\n this.viewerCanvas.setRotation(rotation);\n }\n },\n getRotation: () => {\n if (this.viewerCanvas) {\n return this.viewerCanvas.getRotation();\n }\n return null;\n },\n startSearch: () => {\n if (this.view && this.viewerCanvas) {\n const s = this.view.getState().search;\n this.viewerCanvas.startSearch(s.searchString, 1, s.caseSensitive, s.wrapSearch, s.useRegex);\n }\n },\n nextSearchMatch: () => {\n if (this.viewerCanvas) {\n this.viewerCanvas.nextSearchMatch();\n }\n },\n previousSearchMatch: () => {\n if (this.viewerCanvas) {\n this.viewerCanvas.previousSearchMatch();\n }\n },\n endSearch: () => {\n if (this.viewerCanvas) {\n this.viewerCanvas.endSearch();\n }\n },\n updateCanvasSearchState: (state) => {\n if (this.viewerCanvas) {\n this.viewerCanvas.updateCanvasSearchState(state);\n }\n },\n goTo: (pdfDestination) => {\n if (this.viewerCanvas) {\n this.viewerCanvas.goTo(pdfDestination);\n }\n },\n goToAnnotation: (target) => {\n if (this.viewerCanvas) {\n if (target.annotation.isHidden()) {\n this.handleAnnotationSelected(target.annotation);\n }\n else {\n try {\n this.viewerCanvas.goToAnnotation(target.annotation, target.action);\n }\n catch (err) {\n console.error(err);\n }\n }\n }\n },\n resetViewerMode: (pdfDestination) => {\n if (this.viewerCanvas) {\n this.viewerCanvas.resetViewerMode();\n }\n },\n loadNavigationItems: () => {\n if (this.view) {\n this.loadPageThumbnails();\n this.loadAnnotations();\n const viewState = this.view.getState();\n if (!viewState.navigationPanel.outlineItemsLoaded) {\n this.loadDocumentOutlines();\n }\n }\n },\n addPageRangeToThumbnailsQueue: (pageRange) => {\n this.addPagesToThumbnailsQueue(pageRange.from, pageRange.to);\n },\n print: () => {\n if (this.viewerCanvas) {\n this.viewerCanvas.print();\n }\n },\n activateModule: (moduleName, args) => {\n if (this.viewerCanvas) {\n this.viewerCanvas.activateModule(moduleName, args);\n }\n },\n deactivateModule: (moduleName) => {\n if (this.viewerCanvas) {\n this.viewerCanvas.deactivateModule(moduleName);\n }\n },\n };\n a.initialize();\n return nextApp(state, a, view, element);\n };\n }\n getScreenSize() {\n var _a;\n const widthToScreenSize = (width) => {\n if (width <= ScreenSize.Small) {\n return ScreenSize.Small;\n }\n if (width <= ScreenSize.Medium) {\n return ScreenSize.Medium;\n }\n return ScreenSize.Large;\n };\n const viewerElm = this.element.firstChild;\n if (!this.view || !viewerElm) {\n return widthToScreenSize(this.element.getBoundingClientRect().width);\n }\n if (viewerElm.offsetWidth && viewerElm.offsetHeight && viewerElm.getClientRects().length) {\n return widthToScreenSize(viewerElm.getBoundingClientRect().width);\n }\n return (_a = this.view) === null || _a === void 0 ? void 0 : _a.getState().layout.screenSize;\n }\n handleResize() {\n if (this.view) {\n const screenSize = this.getScreenSize();\n if (this.view.getState().layout.screenSize !== screenSize) {\n this.view.layout.setScreenSize(screenSize);\n }\n }\n }\n handleKeyboardShortcuts(e) {\n var _a, _b, _c;\n const rect = this.element.getBoundingClientRect();\n if (rect.width + rect.height === 0) {\n return;\n }\n const { shortcuts } = this.options;\n if (Object.keys(shortcuts).length > 0) {\n const keyboardCommands = getKeyboardCommands(e, shortcuts);\n if (!keyboardCommands.length) {\n return;\n }\n keyboardCommands.forEach((cmd) => {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;\n switch (cmd[0]) {\n case 'save': {\n const { allowSaveFile } = this.options.viewer.permissions;\n if (allowSaveFile) {\n e.preventDefault();\n if (this.options.viewer.callbacks.onSaveFileButtonClicked) {\n this.options.viewer.onSaveFileButtonClicked();\n }\n else {\n this.downloadFile();\n }\n }\n break;\n }\n case 'print': {\n const { allowPrinting } = this.options.viewer.permissions;\n if (allowPrinting) {\n e.preventDefault();\n (_a = this.viewerCanvas) === null || _a === void 0 ? void 0 : _a.print();\n }\n break;\n }\n case 'cancelPrint': {\n const { allowPrinting } = this.options.viewer.permissions;\n if (allowPrinting) {\n (_b = this.viewerCanvas) === null || _b === void 0 ? void 0 : _b.deactivateModule('PrintServiceModule');\n }\n break;\n }\n case 'search': {\n const { enableSearch } = this.options.viewer.permissions;\n if (enableSearch) {\n e.preventDefault();\n (_c = this.view) === null || _c === void 0 ? void 0 : _c.search.openSearch();\n }\n break;\n }\n case 'searchNext': {\n const { enableSearch } = this.options.viewer.permissions;\n if (enableSearch) {\n const state = (_d = this.view) === null || _d === void 0 ? void 0 : _d.getState();\n if (state && state.search && state.search.showSearch && state.search.searchString) {\n (_e = this.viewerCanvas) === null || _e === void 0 ? void 0 : _e.nextSearchMatch();\n }\n e.preventDefault();\n }\n break;\n }\n case 'searchPrevious': {\n const { enableSearch } = this.options.viewer.permissions;\n if (enableSearch) {\n const state = (_f = this.view) === null || _f === void 0 ? void 0 : _f.getState();\n if (state && state.search && state.search.showSearch && state.search.searchString) {\n (_g = this.viewerCanvas) === null || _g === void 0 ? void 0 : _g.previousSearchMatch();\n }\n e.preventDefault();\n }\n break;\n }\n case 'closeSearch': {\n const { enableSearch } = this.options.viewer.permissions;\n if (enableSearch) {\n e.preventDefault();\n (_h = this.viewerCanvas) === null || _h === void 0 ? void 0 : _h.endSearch();\n (_j = this.view) === null || _j === void 0 ? void 0 : _j.search.closeSearch();\n }\n break;\n }\n case 'toggleSidePane': {\n const { sidebar } = this.options.viewer;\n if (sidebar.annotationNavigation ||\n sidebar.outlineNavigation ||\n sidebar.annotationNavigation) {\n e.preventDefault();\n (_k = this.view) === null || _k === void 0 ? void 0 : _k.navigationPanel.toggleNavigationPanel();\n }\n break;\n }\n case 'showAnnotations': {\n const { sidebar } = this.options.viewer;\n if (sidebar.annotationNavigation) {\n e.preventDefault();\n (_l = this.view) === null || _l === void 0 ? void 0 : _l.navigationPanel.selectNavigation('annotation');\n }\n break;\n }\n case 'showOutline': {\n const { sidebar } = this.options.viewer;\n if (sidebar.outlineNavigation) {\n e.preventDefault();\n (_m = this.view) === null || _m === void 0 ? void 0 : _m.navigationPanel.selectNavigation('outline');\n }\n break;\n }\n case 'showThumbnails': {\n const { sidebar } = this.options.viewer;\n if (sidebar.thumbnailNavigation) {\n e.preventDefault();\n (_o = this.view) === null || _o === void 0 ? void 0 : _o.navigationPanel.selectNavigation('thumbnail');\n }\n break;\n }\n }\n });\n }\n else if (e.key === 'Escape') {\n (_a = this.viewerCanvas) === null || _a === void 0 ? void 0 : _a.deactivateModule('PrintServiceModule');\n (_b = this.viewerCanvas) === null || _b === void 0 ? void 0 : _b.endSearch();\n (_c = this.view) === null || _c === void 0 ? void 0 : _c.search.closeSearch();\n }\n }\n showUnconfirmedChangesDialog() {\n if (this.view && this.viewerCanvas) {\n const currentState = this.view.getState();\n const hasChanges = this.viewerCanvas.hasChanges();\n return (!currentState.unsavedChangesDialogDontSave &&\n currentState.hasDocument &&\n hasChanges &&\n this.options.viewer.general.promptOnUnsavedChange &&\n this.options.viewer.permissions.allowSaveFile);\n }\n }\n beforeOpen(args) {\n if (this.view && this.viewerCanvas) {\n if (this.showUnconfirmedChangesDialog()) {\n this.view.showConfirmUnsavedChangesDialog(args);\n return false;\n }\n this.view.navigationPanel.clear();\n this.view.loadDocumentBegin();\n return true;\n }\n }\n openResolve(fileOpenArgs) {\n if (this.view && this.viewerCanvas) {\n this.view.pdfDocument.setFileInfo(fileOpenArgs.pdfFile);\n this.view.pdfDocument.setHasChanges(false);\n const pageCount = this.viewerCanvas.getPageCount();\n this.view.pdfDocument.setPageCount(pageCount);\n this.handleDocumentOpened();\n this.view.loadDocumentFulfilled();\n this.view.api.loadNavigationItems();\n const inputFile = fileOpenArgs.pdfFile;\n const eventArg = inputFile.uri\n ? inputFile.uri\n : new File([], inputFile.sourceTag, { type: 'application/pdf' });\n this.dispatchEvent('documentLoaded', eventArg);\n }\n }\n openReject(fileOpenArgs, error) {\n if (this.view) {\n if (error.message === 'password required') {\n this.view.loadDocumentPasswordForm(fileOpenArgs);\n }\n else {\n this.view.loadDocumentRejected(error.message);\n }\n }\n }\n handleDocumentOpened() {\n if (this.view && this.viewerCanvas) {\n const pageCount = this.viewerCanvas.getPageCount();\n this.view.navigationPanel.setThumbnailPlaceholders(pageCount);\n const viewerState = this.view.getState();\n this.view.navigationPanel.clearAnnotations();\n if (viewerState.navigationPanel.showNavigation) {\n if (viewerState.navigationPanel.selectedNavigation === 'thumbnail') {\n this.loadPageThumbnails();\n }\n else if (viewerState.navigationPanel.selectedNavigation === 'outline') {\n this.loadDocumentOutlines();\n }\n else {\n this.loadAnnotations();\n }\n }\n }\n }\n loadDocumentOutlines() {\n if (this.viewerCanvas) {\n this.viewerCanvas.getDocumentOutline().then((outlines) => {\n if (this.view) {\n this.view.navigationPanel.setOutlines(outlines);\n }\n });\n }\n }\n loadPageThumbnails() {\n if (this.view && this.viewerCanvas) {\n const state = this.view.getState();\n const fromPage = state.pdfDocument.firstVisiblePage - 5;\n const toPage = state.pdfDocument.lastVisiblePage + 5;\n this.addPagesToThumbnailsQueue(fromPage, toPage);\n }\n }\n addPagesToThumbnailsQueue(fromPage, toPage) {\n if (this.view && this.viewerCanvas) {\n const state = this.view.getState();\n if (fromPage < 1) {\n fromPage = 1;\n }\n if (toPage < fromPage) {\n toPage = state.pdfDocument.firstVisiblePage + 5;\n }\n if (toPage > state.pdfDocument.pageCount) {\n toPage = state.pdfDocument.pageCount;\n }\n const pagesToLoad = state.navigationPanel.pages\n .filter((p) => p.pageNumber >= fromPage &&\n p.pageNumber <= toPage &&\n p.thumbnail === null &&\n p.loading === null)\n .map((p) => p.pageNumber);\n pagesToLoad.forEach((p) => {\n var _a;\n if (this.loadThumbnailsQueue.indexOf(p) < 0) {\n (_a = this.view) === null || _a === void 0 ? void 0 : _a.navigationPanel.updateThumbnail({\n pageNumber: p,\n thumbnail: null,\n loading: true,\n });\n this.loadThumbnailsQueue.push(p);\n }\n });\n const getPageThumbnail = (pageNumber) => {\n this.updatePageThumbnail(pageNumber).then(() => {\n const nextPage = this.loadThumbnailsQueue.shift();\n if (nextPage) {\n getPageThumbnail(nextPage);\n }\n }).catch(() => { });\n };\n const firstPage = this.loadThumbnailsQueue.shift();\n if (firstPage) {\n getPageThumbnail(firstPage);\n }\n }\n }\n updatePageThumbnail(pageNumber) {\n return new Promise((resolve, reject) => {\n if (this.view && this.viewerCanvas) {\n this.viewerCanvas\n .renderPage(pageNumber, 200, 200)\n .then((thumbnail) => {\n var _a;\n const canvasElement = document.createElement('canvas');\n canvasElement.width = thumbnail.imageData.width;\n canvasElement.height = thumbnail.imageData.height;\n const ctx = canvasElement.getContext('2d');\n ctx && ctx.putImageData(thumbnail.imageData, 0, 0);\n const imageData = canvasElement.toDataURL('image/png');\n (_a = this.view) === null || _a === void 0 ? void 0 : _a.navigationPanel.updateThumbnail({\n pageNumber: thumbnail.page,\n thumbnail: imageData,\n loading: false,\n });\n resolve();\n })\n .catch((error) => reject(error));\n }\n else {\n reject();\n }\n });\n }\n loadAnnotations() {\n if (!this.options.viewer.sidebar.annotationNavigation) {\n return;\n }\n if (this.view) {\n const state = this.view.getState();\n if (state.navigationPanel.annotationsLoaded) {\n return;\n }\n this.view.navigationPanel.initAnnotations(state.pdfDocument.pageCount);\n const loadNext = (pages) => {\n if (this.viewerCanvas) {\n const pageNumber = pages.shift();\n if (typeof pageNumber === 'number') {\n this.viewerCanvas\n .getAnnotationsFromPage(pageNumber)\n .then((itemsOnPage) => {\n var _a, _b;\n const selectableItems = itemsOnPage.items.filter((item) => { var _a; return (_a = item.behaviors) === null || _a === void 0 ? void 0 : _a.selectable; });\n if (selectableItems.length) {\n (_a = this.view) === null || _a === void 0 ? void 0 : _a.navigationPanel.setPageAnnotations({\n page: itemsOnPage.page,\n itemCategory: PdfItemCategory.ANNOTATION,\n items: selectableItems,\n });\n }\n if (pages.length > 0) {\n loadNext(pages);\n }\n else {\n (_b = this.view) === null || _b === void 0 ? void 0 : _b.navigationPanel.setAnnotationLoaded();\n }\n });\n }\n }\n };\n const pageCount = this.getPageCount() || 0;\n const pageNumbers = [];\n for (let i = 1; i <= pageCount; i++) {\n pageNumbers.push(i);\n }\n loadNext(pageNumbers);\n }\n }\n handleDocumentClosed() {\n var _a, _b;\n (_a = this.view) === null || _a === void 0 ? void 0 : _a.closeDocument();\n (_b = this.viewerCanvas) === null || _b === void 0 ? void 0 : _b.close();\n this.handleResize();\n this.dispatchEvent('documentClosed', undefined);\n return;\n }\n handleAppLoaded(loaded) {\n if (this.view && this.viewerCanvas) {\n this.view.initializeAppFulfilled({ licenseFeatures: this.viewerCanvas.licenseFeatures });\n const canvasModules = this.viewerCanvas.getModules();\n this.view.setCanvasModules(canvasModules);\n this.dispatchEvent('appLoaded', loaded);\n }\n }\n handleFirstVisiblePageChanged(page) {\n if (this.view) {\n this.visiblePageRange.firstPage = page;\n this.updateVisiblePageRange();\n this.view.pdfDocument.setFirstVisiblePage(page);\n }\n }\n handleLastVisiblePageChanged(page) {\n if (this.view) {\n this.visiblePageRange.lastPage = page;\n this.updateVisiblePageRange();\n this.view.pdfDocument.setLastVisiblePage(page);\n }\n }\n handlePageNumberChanged(page) {\n if (this.view) {\n this.view.pdfDocument.setPageNumber(page);\n const { navigationPanel } = this.view.getState();\n if (navigationPanel.showNavigation && navigationPanel.selectedNavigation === 'thumbnail') {\n const elm = this.element.querySelector(`#pwv-thumbnail-navigation-page_${page}`);\n const container = this.element.querySelector('.pwv-NavigationPanel__Content');\n if (elm && container) {\n const containerBoundingRect = container.getBoundingClientRect();\n const pageBoundingRect = elm.getBoundingClientRect();\n if (pageBoundingRect.top < containerBoundingRect.top ||\n pageBoundingRect.bottom > containerBoundingRect.bottom) {\n elm.scrollIntoView({ behavior: 'smooth', block: 'nearest' });\n }\n }\n }\n this.dispatchEvent('pageNumberChanged', page);\n }\n }\n updateVisiblePageRange() {\n if (this.view) {\n const state = this.view.getState();\n if (state.navigationPanel.showNavigation &&\n state.navigationPanel.selectedNavigation === 'thumbnail') {\n if (this.loadPageThumbnailsTimer) {\n window.clearTimeout(this.loadPageThumbnailsTimer);\n }\n this.loadPageThumbnailsTimer = window.setTimeout(() => {\n this.loadPageThumbnailsTimer = null;\n this.loadPageThumbnails();\n }, 100);\n }\n }\n }\n handleZoomChanged(zoom) {\n if (this.view) {\n this.view.pdfDocument.setZoom(zoom * 100);\n this.dispatchEvent('zoomChanged', zoom);\n }\n }\n handleFitModeChanged(fitMode) {\n if (this.view) {\n this.view.pdfDocument.setFitMode(fitMode);\n }\n this.dispatchEvent('fitModeChanged', fitMode);\n }\n handlePageLayoutModeChanged(layoutMode) {\n if (this.view) {\n this.view.pdfDocument.setPageLayoutMode(layoutMode);\n }\n this.dispatchEvent('pageLayoutModeChanged', layoutMode);\n }\n handleRotationChanged(rotation) {\n this.dispatchEvent('rotationChanged', rotation);\n }\n handleBusyStateChanged(state) {\n this.dispatchEvent('busyState', state);\n }\n handleAnnotationSelected(item) {\n if (this.view) {\n const annotation = item;\n this.view.navigationPanel.selectAnnotation(annotation);\n const { navigationPanel } = this.view.getState();\n if (navigationPanel.showNavigation && navigationPanel.selectedNavigation === 'annotation') {\n const elm = this.element.querySelector(`#pwv-annotation-navigation-item-${annotation.id}`);\n if (elm) {\n elm.scrollIntoView({ behavior: 'smooth' });\n }\n }\n }\n }\n handleAnnotationDeselected(item) {\n if (this.view) {\n this.view.navigationPanel.deselectAnnotation();\n }\n }\n handleAnnotationCreated(item) {\n if (this.view) {\n const annotation = item;\n this.view.navigationPanel.updateAnnotation(annotation);\n const { navigationPanel } = this.view.getState();\n if (navigationPanel.showNavigation && navigationPanel.selectedNavigation === 'annotation') {\n window.setTimeout(() => {\n const elm = this.element.querySelector(`#pwv-annotation-navigation-item-${annotation.id}`);\n if (elm) {\n elm.scrollIntoView({ behavior: 'smooth' });\n }\n }, 10);\n }\n }\n }\n handleAnnotationUpdated(item) {\n if (this.view) {\n const annotation = item;\n this.view.navigationPanel.updateAnnotation(annotation);\n }\n }\n handleAnnotationDeleted(deletedItem) {\n if (this.view) {\n this.view.navigationPanel.deleteAnnotation(deletedItem);\n }\n }\n handlePageChanged(pageNumber) {\n if (this.view) {\n const pageNavigationItem = this.view.getState().navigationPanel.pages[pageNumber - 1];\n if (pageNavigationItem && pageNavigationItem.thumbnail !== null) {\n this.updatePageThumbnail(pageNumber);\n }\n this.dispatchEvent('documentChanged', undefined);\n }\n }\n handleTextSelected(text) {\n this.dispatchEvent('textSelected', text);\n }\n verifyOptions(clientOptions, defaultOptions) {\n if (clientOptions.annotation && clientOptions.annotation.colors) {\n Object.keys(OptionsToVerify).forEach((k) => {\n if (clientOptions.annotation && clientOptions.annotation.colors[k]) {\n if (!this.isContainedInArray(clientOptions.annotation.colors[k], defaultOptions.annotation.colors[OptionsToVerify[k]])) {\n throw new Error(`Invalid ${k}: ${defaultOptions.annotation.colors[k]} has not been found in ${OptionsToVerify[k]}.\\n` +\n `Valid values are: ${defaultOptions.annotation.colors[OptionsToVerify[k]]}`);\n }\n }\n });\n Object.keys(ColorPaletteMap).forEach((k) => {\n if (clientOptions.annotation &&\n clientOptions.annotation.colors[k] &&\n !clientOptions.annotation.colors[ColorPaletteMap[k]]) {\n throw new Error(`Cannot set ${k} without setting ${ColorPaletteMap[k]}. Preset ${ColorPaletteMap[k]} might not be in ${k}`);\n }\n });\n }\n }\n isContainedInArray(item, list) {\n if (!list.find((el) => el === item)) {\n return false;\n }\n return true;\n }\n handleError(error) {\n if (this.view) {\n this.view.setError(error.message);\n }\n this.dispatchEvent('error', error);\n }\n}\n","export class Color {\n constructor(color) {\n this.pR = 0;\n this.pG = 0;\n this.pB = 0;\n this.pA = 0;\n color = color.replace(/\\s+/gi, '');\n if (color === 'transparent') {\n this.pR = 255;\n this.pG = 255;\n this.pB = 255;\n this.pA = 0;\n }\n else if (color.indexOf('#') === 0) {\n if (color.length === 4) {\n this.pR = parseInt(color.substring(1, 2), 16);\n this.pG = parseInt(color.substring(2, 3), 16);\n this.pB = parseInt(color.substring(3, 4), 16);\n this.pA = 255;\n }\n else if (color.length === 5) {\n this.pR = parseInt(color.substring(1, 2), 16);\n this.pG = parseInt(color.substring(2, 3), 16);\n this.pB = parseInt(color.substring(3, 4), 16);\n this.pA = parseInt(color.substring(4, 5), 16);\n }\n else if (color.length === 7) {\n this.pR = parseInt(color.substring(1, 3), 16);\n this.pG = parseInt(color.substring(3, 5), 16);\n this.pB = parseInt(color.substring(5, 7), 16);\n this.pA = 255;\n }\n else if (color.length === 9) {\n this.pR = parseInt(color.substring(1, 3), 16);\n this.pG = parseInt(color.substring(3, 5), 16);\n this.pB = parseInt(color.substring(5, 7), 16);\n this.pA = parseInt(color.substring(7, 9), 16);\n }\n else {\n throw new Error('invalid color string: ' + color);\n }\n }\n else if (color.indexOf('rgb') === 0) {\n const values = color.substring(color.indexOf('(') + 1, color.indexOf(')')).split(',');\n if (values.length < 3 || values.length > 4) {\n throw new Error('invalid color string: ' + color);\n }\n this.pR = parseInt(values[0], 10);\n this.pG = parseInt(values[1], 10);\n this.pB = parseInt(values[2], 10);\n if (values.length === 4) {\n this.pA = Math.floor(parseFloat(values[3]) * 255);\n }\n else {\n this.pA = 255;\n }\n }\n else {\n throw new Error('invalid color string: ' + color);\n }\n }\n isDark() {\n return this.pR * 0.3 + this.pG * 0.59 + this.pB * 0.11 < 127;\n }\n get r() {\n return this.pR;\n }\n set r(r) {\n this.pR = r;\n }\n get g() {\n return this.pG;\n }\n set g(g) {\n this.pG = g;\n }\n get b() {\n return this.pB;\n }\n set b(b) {\n this.pB = b;\n }\n get a() {\n return Math.floor((this.pA / 255) * 1000) / 1000;\n }\n darken(percent) {\n const f = 1 - Math.abs(percent / 100);\n const r = Math.floor(this.pR * f);\n const g = Math.floor(this.pG * f);\n const b = Math.floor(this.pB * f);\n this.pR = r > 255 ? 255 : r;\n this.pG = g > 255 ? 255 : g;\n this.pB = b > 255 ? 255 : b;\n }\n setOpacity(opacity) {\n this.pA = Math.floor(opacity * 255);\n }\n toRgb() {\n return `rgb(${this.pR},${this.pG},${this.pB})`;\n }\n toRgba() {\n return `rgba(${this.pR},${this.pG},${this.pB},${this.a})`;\n }\n toHexRgb() {\n return `#${this.toHex(this.pR)}${this.toHex(this.pG)}${this.toHex(this.pB)}`;\n }\n toHexRgba() {\n return `#${this.toHex(this.pR)}${this.toHex(this.pG)}${this.toHex(this.pB)}${this.toHex(this.pA)}`;\n }\n toHex(value) {\n let h = value.toString(16);\n if (h.length === 1) {\n h = '0' + h;\n }\n return h;\n }\n}\n","import { h } from '../lib/hyperapp';\nimport { classNames } from './classNames';\nimport { Color } from '../common/Color';\nimport { DropdownComponent } from './Dropdown';\nimport { Icon } from './Icon';\nimport { tooltipManager } from './TooltipManager';\nexport const ColorPicker = ({ icon, tooltip, disabled, colors, color, allowRgba = true, mode, onChange, }) => {\n const items = allowRgba ? colors : colors.filter((c) => new Color(c).a >= 1);\n if (mode === 'buttons' && window.innerWidth > 580) {\n return h(ColorPickerButtons, { icon: icon, colors: items, color: color, onChange: onChange });\n }\n else {\n return (h(ColorPickerDropdown, { icon: icon, tooltip: tooltip, disabled: disabled, colors: items, color: color, onChange: onChange }));\n }\n};\nconst ColorPickerDropdown = ({ icon, tooltip, disabled, colors, color, onChange, }) => {\n if (disabled) {\n return (h(\"div\", { class: \"pwv-ColorPicker pwv-Dropdown pwv-ToolbarItem pwv-disabled\" },\n h(\"button\", Object.assign({}, tooltipManager.createTooltip(tooltip), { oncreate: DropdownComponent.create, onremove: DropdownComponent.remove }),\n h(Icon, { icon: icon }),\n h(\"div\", { class: classNames('pwv-ColorPicker__selectedColor'), style: { backgroundColor: color } }))));\n }\n else {\n return (h(\"div\", { class: \"pwv-ColorPicker pwv-Dropdown pwv-ToolbarItem\" },\n h(\"button\", Object.assign({}, tooltipManager.createTooltip(tooltip), { oncreate: DropdownComponent.create, onremove: DropdownComponent.remove }),\n h(Icon, { icon: icon }),\n h(\"div\", { class: classNames('pwv-ColorPicker__selectedColor'), style: { backgroundColor: color } })),\n h(\"div\", { class: classNames('pwv-DropdownPanel', {\n 'pwv-DropdownPanel-wide': colors.length > 6,\n }) }, colors.map((c) => (h(\"button\", { disabled: c.toLowerCase() === color.toLowerCase(), class: classNames('pwv-ColorPicker__Button', {\n 'pwv-selected': c.toLowerCase() === color.toLowerCase(),\n }), onclick: (e) => {\n onChange && onChange(c);\n } },\n h(\"div\", { style: { backgroundColor: c } })))))));\n }\n};\nconst ColorPickerButtons = ({ icon, colors, color, onChange }) => {\n return (h(\"div\", { class: \"pwv-ColorPicker--buttons pwv-ToolbarItem\" }, colors.map((c) => (h(\"button\", { disabled: c.toLowerCase() === color.toLowerCase(), class: classNames('pwv-ColorPicker__Button', {\n 'pwv-selected': c.toLowerCase() === color.toLowerCase(),\n }), onclick: (e) => {\n onChange && onChange(c);\n } },\n h(\"div\", { style: { backgroundColor: c } }))))));\n};\n","import { h } from '../lib/hyperapp';\nconst stopPropagation = (e) => {\n e.stopPropagation();\n};\nexport const Contextbar = ({}, children) => {\n return (h(\"div\", { class: \"pwv-contextbar\", oncreate: (element) => {\n element.addEventListener('click', (e) => {\n e.preventDefault();\n }, { passive: false });\n element.addEventListener('mousedown', stopPropagation, false);\n element.addEventListener('mousemove', stopPropagation, false);\n element.addEventListener('mouseup', stopPropagation, false);\n element.addEventListener('touchstart', stopPropagation, { passive: false });\n element.addEventListener('touchmove', stopPropagation, { passive: true });\n element.addEventListener('touchend', stopPropagation, { passive: true });\n } },\n h(\"div\", { class: \"pwv-contextbar-content\" }, children)));\n};\n","export class DragMoveHandler {\n constructor(element, onDragStart, onDragMove, onDragEnd, onClick, onDblClick) {\n this.lastPosX = 0;\n this.lastPosY = 0;\n this.startPosX = 0;\n this.startPosY = 0;\n this.isSuspended = false;\n this.dragging = false;\n this.clickTimer = null;\n this.dragStartTimer = null;\n this.clickDuration = 250;\n this.dragStartDuration = 300;\n this.dblClickTimer = null;\n this.dblClickDuration = 250;\n this.suspend = this.suspend.bind(this);\n this.resume = this.resume.bind(this);\n this.onMouseDown = this.onMouseDown.bind(this);\n this.onTouchStart = this.onTouchStart.bind(this);\n this.start = this.start.bind(this);\n this.onMouseMove = this.onMouseMove.bind(this);\n this.onTouchMove = this.onTouchMove.bind(this);\n this.move = this.move.bind(this);\n this.onMouseUp = this.onMouseUp.bind(this);\n this.onTouchEnd = this.onTouchEnd.bind(this);\n this.end = this.end.bind(this);\n this.element = element;\n this.onDragStart = onDragStart;\n this.onDragMove = onDragMove;\n this.onDragEnd = onDragEnd;\n this.onClick = onClick;\n this.onDblClick = onDblClick;\n this.disableCanvasEvents = true;\n this.element.addEventListener('mousedown', this.onMouseDown, { passive: true });\n this.element.addEventListener('touchstart', this.onTouchStart, { passive: false });\n }\n suspend() {\n window.removeEventListener('mousemove', this.onMouseMove);\n window.removeEventListener('mouseup', this.onMouseUp);\n window.removeEventListener('touchmove', this.onTouchMove);\n window.removeEventListener('touchend', this.onTouchEnd);\n this.element.removeEventListener('mousedown', this.onMouseDown);\n this.element.removeEventListener('touchstart', this.onTouchStart);\n this.isSuspended = true;\n }\n resume() {\n if (this.isSuspended) {\n this.element.addEventListener('mousedown', this.onMouseDown, { passive: true });\n this.element.addEventListener('touchstart', this.onTouchStart, { passive: false });\n }\n }\n clearClickTimer() {\n if (this.clickTimer !== null) {\n window.clearTimeout(this.clickTimer);\n this.clickTimer = null;\n }\n }\n clearDblClickTimer() {\n if (this.dblClickTimer !== null) {\n window.clearTimeout(this.dblClickTimer);\n this.dblClickTimer = null;\n }\n }\n clearDragStartTimer() {\n if (this.dragStartTimer !== null) {\n window.clearTimeout(this.dragStartTimer);\n this.dragStartTimer = null;\n }\n }\n onMouseDown(e) {\n if (e.buttons === 1) {\n this.start(e.clientX, e.clientY);\n window.addEventListener('mousemove', this.onMouseMove, { passive: true });\n window.addEventListener('mouseup', this.onMouseUp, { passive: true });\n }\n }\n onTouchStart(e) {\n if (e.touches.length === 1) {\n this.start(e.touches[0].clientX, e.touches[0].clientY);\n window.addEventListener('touchmove', this.onTouchMove, { passive: false });\n window.addEventListener('touchend', this.onTouchEnd, { passive: false });\n }\n }\n start(clientX, clientY) {\n if (this.disableCanvasEvents) {\n window.dispatchEvent(new Event('pdfwebviewer.DragMoveHandlerStart'));\n }\n this.startPosX = this.lastPosX = clientX;\n this.startPosY = this.lastPosY = clientY;\n this.dragging = false;\n if (!this.dblClickTimer) {\n this.clickTimer = window.setTimeout(() => {\n this.clickTimer = null;\n }, this.clickDuration);\n this.dragStartTimer = window.setTimeout(() => {\n this.dragging = true;\n this.onDragStart({\n clientX: this.startPosX,\n clientY: this.startPosY,\n movementX: 0,\n movementY: 0,\n element: this.element,\n });\n }, this.dragStartDuration);\n }\n }\n onMouseMove(e) {\n this.move(e.clientX, e.clientY);\n }\n onTouchMove(e) {\n this.move(e.touches[0].clientX, e.touches[0].clientY);\n }\n move(clientX, clientY) {\n let movementX = clientX - this.lastPosX;\n let movementY = clientY - this.lastPosY;\n this.lastPosX = clientX;\n this.lastPosY = clientY;\n if (this.clickTimer || this.dragStartTimer) {\n if (Math.abs(movementX) > 5 || Math.abs(movementY) > 5) {\n this.clearClickTimer();\n this.clearDragStartTimer();\n this.dragging = true;\n this.onDragStart({\n clientX: this.startPosX,\n clientY: this.startPosY,\n movementX: 0,\n movementY: 0,\n element: this.element,\n });\n movementX = clientX - this.startPosX;\n movementY = clientY - this.startPosY;\n }\n }\n if (this.dragging) {\n this.onDragMove({ clientX, clientY, movementX, movementY, element: this.element });\n }\n }\n onMouseUp(e) {\n window.removeEventListener('mousemove', this.onMouseMove);\n window.removeEventListener('mouseup', this.onMouseUp);\n this.end();\n }\n onTouchEnd(e) {\n window.removeEventListener('touchmove', this.onTouchMove);\n window.removeEventListener('touchend', this.onTouchEnd);\n this.end();\n }\n end() {\n const moved = this.startPosX !== this.lastPosX || this.startPosY !== this.lastPosY;\n const clientX = this.lastPosX;\n const clientY = this.lastPosY;\n if (this.disableCanvasEvents) {\n window.dispatchEvent(new Event('pdfwebviewer.DragMoveHandlerEnd'));\n }\n if (this.dblClickTimer !== null) {\n this.clearDblClickTimer();\n if (this.onDblClick) {\n this.onDblClick({ clientX, clientY, movementX: 0, movementY: 0, element: this.element });\n }\n }\n else if (this.clickTimer !== null) {\n if (this.onClick) {\n this.onClick({ clientX, clientY, movementX: 0, movementY: 0, element: this.element });\n }\n this.dblClickTimer = window.setTimeout(() => {\n this.dblClickTimer = null;\n }, this.dblClickDuration);\n }\n if (this.dragging) {\n this.onDragEnd({ clientX, clientY, movementX: 0, movementY: 0, moved, element: this.element });\n }\n this.clearClickTimer();\n this.clearDragStartTimer();\n }\n}\n","import { h } from '../lib/hyperapp';\nimport { tooltipManager } from './TooltipManager';\nimport { Icon, icons } from './Icon';\nimport { classNames } from './classNames';\nexport const Dropdown = ({ disabled, text, icon, name, value, tooltip, width, className, items, align, hideCaret, renderButton, onChange, }) => {\n const selectedItem = items.find((item) => item.value === value);\n if (!text && selectedItem) {\n text = selectedItem.text;\n }\n const style = width\n ? {\n width: width + 'px',\n }\n : {};\n return (h(\"div\", { class: classNames('pwv-Dropdown', { 'pwv-disabled': disabled }, { 'pwv-Dropdown--alignLeft': !align || align === 'left' }, { 'pwv-Dropdown--alignRight': align === 'right' }, { 'pwv-Dropdown--alignCenter': align === 'center' }, className), style: style },\n h(\"button\", Object.assign({ name: name }, tooltipManager.createTooltip(tooltip), { oncreate: DropdownComponent.create, onremove: DropdownComponent.remove, disabled: disabled }),\n renderButton ? (renderButton(value, text)) : (h(\"span\", { class: \"pwv-Dropdown-text\" },\n icon && h(Icon, { icon: icon }),\n text)),\n !hideCaret && (h(\"span\", { class: \"pwv-Dropdown-caret\" },\n h(Icon, { icon: icons.dropdownCaret })))),\n !disabled && (h(\"div\", { class: \"pwv-DropdownPanel\" },\n h(\"ul\", null, items.map((item) => (h(\"li\", { class: \"pwv-DropdownItem\", onclick: () => onChange && onChange(item.value) }, item.renderItem ? (item.renderItem(item)) : (h(\"span\", { class: \"pwv-Dropdown-item-text\" }, item.text))))))))));\n};\nexport class DropdownComponent {\n constructor(btnElement) {\n this.button = btnElement;\n this.element = btnElement.parentElement;\n this.handleOnClick = this.handleOnClick.bind(this);\n this.setMaxPanelHeight = this.setMaxPanelHeight.bind(this);\n this.button.addEventListener('click', this.handleOnClick, false);\n tooltipManager.bindCssTooltip(this.button);\n window.addEventListener('resize', this.setMaxPanelHeight);\n }\n static create(btnElement) {\n ;\n btnElement.parentElement.dropdown = new DropdownComponent(btnElement);\n }\n static remove(btnElement) {\n ;\n btnElement.parentElement.dropdown.unmount();\n }\n unmount() {\n this.button.removeEventListener('click', this.handleOnClick);\n this.button.removeEventListener('resize', this.setMaxPanelHeight);\n }\n setMaxPanelHeight() {\n const dropdownPanel = this.element.querySelector('.pwv-DropdownPanel');\n if (dropdownPanel) {\n const maxHeight = window.innerHeight - dropdownPanel.getBoundingClientRect().top;\n if (dropdownPanel.scrollHeight > maxHeight) {\n dropdownPanel.style.maxHeight = `${maxHeight - 10}px`;\n dropdownPanel.classList.add('pwv-DropdownPanel--scroll');\n }\n else {\n dropdownPanel.style.maxHeight = '';\n dropdownPanel.classList.remove('pwv-DropdownPanel--scroll');\n }\n }\n }\n handleOnClick(e) {\n if (!this.element.classList.contains('pwv-Dropdown--open')) {\n this.element.classList.add('pwv-Dropdown--open');\n this.setMaxPanelHeight();\n const t = new Date().getTime();\n e.openDropdown = t;\n const closeDropdownPanel = (ev) => {\n if (ev.openDropdown !== t) {\n window.removeEventListener('click', closeDropdownPanel);\n this.element.classList.remove('pwv-Dropdown--open');\n }\n };\n window.addEventListener('click', closeDropdownPanel, false);\n }\n }\n}\n","import { h } from '../lib/hyperapp';\nimport { tooltipManager } from './TooltipManager';\nimport { Icon } from './Icon';\nimport { classNames } from './classNames';\nimport { DropdownComponent } from './Dropdown';\nexport const DropdownMenu = ({ icon, className, tooltip }, children) => {\n return (h(\"div\", { class: classNames('pwv-Dropdown', className) },\n h(\"button\", Object.assign({ class: \"pwv-ToolbarButton\" }, tooltipManager.createTooltip(tooltip), { oncreate: DropdownComponent.create, onremove: DropdownComponent.remove }), icon && h(Icon, { icon: icon })),\n h(\"div\", { class: \"pwv-DropdownPanel\" }, children)));\n};\n","import { h } from '../lib/hyperapp';\nexport const DropdownSeparator = ({}) => {\n return (h(\"div\", { class: \"pwv-DropdownSeparator\" },\n h(\"span\", null)));\n};\n","import { h } from '../lib/hyperapp';\nimport { classNames } from './classNames';\nexport * from './icons';\nexport const Icon = ({ icon, className, fill, bg, title }) => (h(\"span\", { class: classNames('pwv-icon', className), title: title },\n h(\"svg\", { viewBox: `0 0 ${icon.width} ${icon.height}` },\n icon.bg && bg && h(\"path\", { d: icon.bg, fill: bg }),\n h(\"path\", { d: icon.path, fill: fill, \"shape-rendering\": \"geometricPrecision\", \"stroke-width\": \"1px\" }))));\n","import { h } from '../lib/hyperapp';\nexport const Loader = ({}) => {\n return (h(\"div\", { class: \"pwv-Loader\" },\n h(\"div\", null)));\n};\n","import { h } from '../lib/hyperapp';\nimport { DropdownComponent } from './Dropdown';\nimport { Icon, icons } from './Icon';\nimport { classNames } from './classNames';\nimport { tooltipManager } from './TooltipManager';\nexport const RangeSlider = ({ min, max, value, icon, className, text, tooltip, label, disabled, onChange, }) => {\n const elmProps = {\n title: tooltip,\n };\n if (disabled) {\n return (h(\"div\", Object.assign({}, tooltipManager.createTooltip(tooltip), { class: classNames('pwv-RangeSlider', 'pwv-ToolbarItem', 'pwv-Dropdown', 'pwv-disabled', className) }),\n label ||\n (icon && (h(\"span\", { class: \"pwv-Dropdown-label\" },\n label,\n icon && h(Icon, { icon: icon })))),\n h(\"span\", { class: \"pwv-Dropdown-text\" }, text),\n h(\"span\", { class: \"pwv-Dropdown-caret\" },\n h(Icon, { icon: icons.dropdownCaret }))));\n }\n else {\n return (h(\"div\", { class: classNames('pwv-RangeSlider', 'pwv-commandbar-item', 'pwv-Dropdown', className) },\n h(\"button\", Object.assign({}, tooltipManager.createTooltip(tooltip), { oncreate: DropdownComponent.create, onremove: DropdownComponent.remove }),\n label ||\n (icon && (h(\"span\", { class: \"pwv-Dropdown-label\" },\n label,\n icon && h(Icon, { icon: icon })))),\n h(\"span\", { class: \"pwv-Dropdown-text\" }, text),\n h(\"span\", { class: \"pwv-Dropdown-caret\" },\n h(Icon, { icon: icons.dropdownCaret }))),\n h(\"div\", { class: \"pwv-DropdownPanel\" },\n h(\"input\", { type: \"range\", min: min, max: max, value: value, oninput: (e) => {\n const input = e.currentTarget;\n const intVal = parseInt(input.value, undefined);\n onChange(intVal);\n }, onchange: (e) => {\n e.preventDefault();\n const input = e.currentTarget;\n window.dispatchEvent(new Event('click'));\n } }))));\n }\n};\n","import { h } from '../lib/hyperapp';\nimport { AnnotationBorderStyle } from '../pdf-viewer-api';\nimport { Dropdown } from './Dropdown';\nconst StrokeItem = ({ value }) => {\n const strokeStyle = value === AnnotationBorderStyle.DASHED ? 'dashed' : 'solid';\n return (h(\"div\", { class: `pwv-stroke-style-picker-item pwv-stroke-style-${strokeStyle}` },\n h(\"span\", null)));\n};\nconst StrokeButton = ({ value }) => {\n const strokeStyle = value === AnnotationBorderStyle.DASHED ? 'dashed' : 'solid';\n return (h(\"div\", { class: `pwv-stroke-style-picker-button pwv-stroke-style-${strokeStyle}` },\n h(\"span\", null)));\n};\nexport const StrokeStylePicker = ({ disabled, value, tooltip, shapeType, onChange, }) => {\n const items = [AnnotationBorderStyle.SOLID, AnnotationBorderStyle.DASHED].map((item) => ({\n value: item,\n renderItem: (i) => h(StrokeItem, { value: item }),\n }));\n return (h(Dropdown, { className: `pwv-stroke-style-picker pwv-stroke-style-picker-${shapeType}`, align: \"right\", disabled: disabled, tooltip: tooltip, items: items, value: value, renderButton: (value) => h(StrokeButton, { value: value }), onChange: onChange }));\n};\n","import { h } from '../lib/hyperapp';\nimport { Dropdown } from './Dropdown';\nconst StrokeItem = ({ value, noneStrokeText }) => {\n if (value === 0) {\n return (h(\"div\", { class: \"pwv-stroke-width-picker-item\" },\n h(\"span\", null, noneStrokeText)));\n }\n return (h(\"div\", { class: \"pwv-stroke-width-picker-item\" },\n h(\"span\", null,\n value,\n \"pt\"),\n h(\"span\", { class: \"pwv-stroke-width\", style: { height: `${value}px` } })));\n};\nexport const StrokeWidthPicker = ({ disabled, noneStrokeText, strokeWidths, value, tooltip, onChange, }) => {\n const items = strokeWidths.map((item) => ({\n value: item,\n renderItem: (i) => h(StrokeItem, { value: i.value, noneStrokeText: noneStrokeText }),\n }));\n return (h(Dropdown, { className: \"pwv-stroke-width-picker\", align: \"right\", tooltip: tooltip, disabled: disabled, items: items, value: value, renderButton: (value) => h(StrokeItem, { value: value, noneStrokeText: noneStrokeText }), onChange: onChange }));\n};\n","import { h } from '../lib/hyperapp';\nimport { classNames } from './classNames';\nexport const Toolbar = ({ className, dense, allowWrap, alignCenter }, children) => {\n return (h(\"div\", { class: classNames('pwv-Toolbar', { 'pwv-Toolbar--center': alignCenter }, { 'pwv-Toolbar--dense': dense }, { 'pwv-Toolbar--wrap': allowWrap }, className) }, children));\n};\n","import { h } from '../lib/hyperapp';\nimport { Icon } from './Icon';\nimport { classNames } from './classNames';\nimport { tooltipManager } from './TooltipManager';\nexport const ToolbarButton = ({ icon, disabled, active, name, onClick, tooltip, className }, children) => {\n if (disabled) {\n return (h(\"button\", Object.assign({ name: name, disabled: disabled, oncreate: tooltipManager.bindCssTooltip }, tooltipManager.createTooltip(tooltip), { class: classNames('pwv-ToolbarButton', 'pwv-ToolbarButton--disabled', className) }),\n icon && h(Icon, { icon: icon }),\n children.length > 0 && h(\"span\", { class: \"pwv-ToolbarButton__Text\" }, children)));\n }\n else {\n return (h(\"button\", Object.assign({ name: name, oncreate: tooltipManager.bindCssTooltip }, tooltipManager.createTooltip(tooltip), { class: classNames('pwv-ToolbarButton', className, {\n 'pwv-ToolbarButton--selected': active,\n }), onclick: (e) => {\n onClick && onClick(e);\n } }),\n icon && h(Icon, { icon: icon }),\n children.length > 0 && h(\"span\", { class: \"pwv-ToolbarButton__Text\" }, children)));\n }\n};\n","import { h } from '../lib/hyperapp';\nimport { Icon } from './Icon';\nimport { classNames } from './classNames';\nimport { tooltipManager } from './TooltipManager';\nexport const ToolbarFileButton = ({ icon, accept, className, tooltip, disabled, name, onFileSelected, }) => {\n if (disabled) {\n return (h(\"div\", Object.assign({ oncreate: tooltipManager.bindCssTooltip }, tooltipManager.createTooltip(tooltip), { class: classNames('pwv-ToolbarButton', 'pwv-ToolbarButton--disabled', className) }),\n h(Icon, { icon: icon })));\n }\n else {\n return (h(\"label\", Object.assign({ name: name, tabindex: \"auto\", oncreate: tooltipManager.bindCssTooltip }, tooltipManager.createTooltip(tooltip), { class: classNames('pwv-ToolbarButton', className) }),\n h(Icon, { icon: icon }),\n h(\"input\", { style: { display: 'none' }, type: \"file\", accept: accept, onchange: (e) => {\n if (onFileSelected && e.currentTarget.files && e.currentTarget.files.length) {\n const file = e.currentTarget.files[0];\n onFileSelected(file);\n e.currentTarget.value = '';\n }\n }, oncreate: (input) => {\n const id = 'fi_' + performance.now();\n input.id = id;\n const label = input.parentElement;\n label.setAttribute('for', id);\n } })));\n }\n};\n","import { h } from '../lib/hyperapp';\nimport { classNames } from './classNames';\nexport const ToolbarItemGroup = ({ className, pushRight }, children) => {\n return (h(\"div\", { class: classNames('pwv-ToolbarItemGroup', className, {\n 'pwv-ToolbarItemGroup--pushRight': pushRight,\n }), oncreate: (element) => {\n if (pushRight) {\n element.parentNode.classList.add('pwv-Toolbar--paddingRight');\n }\n } }, children));\n};\n","import { h } from '../lib/hyperapp';\nexport const ToolbarSeparator = ({}) => {\n return (h(\"div\", { class: \"pwv-ToolbarSeparator\" },\n h(\"span\", null)));\n};\n","import { PdfItemType } from '../pdf-viewer-api/enums';\nexport function convertPdfToCssPixel(pdfPixel) {\n const regex = /(\\d*\\.?\\d+)/.exec(pdfPixel);\n const size = regex && regex.length > 1 ? parseFloat(regex[1]) : 12;\n return roundToTwo((size / 72) * 96) + 'px';\n}\nexport function convertCssToPdfPixel(cssPixel) {\n const regex = /(\\d*\\.?\\d+)/.exec(cssPixel);\n const size = regex && regex.length > 1 ? parseFloat(regex[1]) : 12;\n return roundToTwo((size / 96) * 72) + 'pt';\n}\nexport function roundToTwo(num) {\n return Math.round(num * 100) / 100;\n}\nexport function getColorPalette(type, options) {\n if (type === PdfItemType.INK) {\n return options.annotation.colors.foregroundColors;\n }\n else {\n return options.annotation.colors.highlightColors;\n }\n}\nexport function createPdfTime() {\n const time = new Date();\n const year = time.getFullYear();\n let month = `${time.getMonth() + 1}`;\n month = padString(month, 2, '0');\n let day = `${time.getDate()}`;\n day = padString(day, 2, '0');\n let hour = `${time.getHours()}`;\n hour = padString(hour, 2, '0');\n let minutes = `${time.getMinutes()}`;\n minutes = padString(minutes, 2, '0');\n let seconds = `${time.getSeconds()}`;\n seconds = padString(seconds, 2, '0');\n let offsetString = time.getTimezoneOffset() < 0 ? '+' : '';\n const hourOffset = -1 * Math.floor(time.getTimezoneOffset() / 60);\n offsetString += padString(hourOffset.toString(), 2, '0') + `'`;\n const minuteOffset = -1 * Math.floor(time.getTimezoneOffset() % 60);\n offsetString += padString(minuteOffset.toString(), 2, '0') + `'`;\n const dateString = `(D:${year}${month}${day}${hour}${minutes}${seconds}${offsetString})`;\n return dateString;\n}\nexport const formatDate = (dateStr) => {\n if (dateStr.indexOf('(D:') === 0) {\n return `${dateStr.substring(9, 11)}.${dateStr.substring(7, 11)}.${dateStr.substring(3, 7)} ${dateStr.substring(11, 13)}:${dateStr.substring(13, 15)}`;\n }\n return `${dateStr.substring(8, 10)}.${dateStr.substring(6, 8)}.${dateStr.substring(2, 6)} ${dateStr.substring(10, 12)}:${dateStr.substring(12, 14)}`;\n};\nexport function padString(s, paddingSize, fill) {\n if (s.length < paddingSize) {\n s = `${fill.repeat(paddingSize - s.length)}${s}`;\n }\n return s;\n}\nexport function imageDataUrlToUint8Array(dataUrl) {\n const base64 = dataUrl.replace(/^data:[a-z]+\\/[a-z]+;base64,/i, '');\n const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n const lookup = new Uint8Array(256);\n for (let i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n let bufferLength = base64.length * 0.75;\n if (base64[base64.length - 1] === '=') {\n bufferLength--;\n if (base64[base64.length - 2] === '=') {\n bufferLength--;\n }\n }\n const arraybuffer = new ArrayBuffer(bufferLength);\n const bytes = new Uint8Array(arraybuffer);\n let p = 0;\n let encoded1 = 0;\n let encoded2 = 0;\n let encoded3 = 0;\n let encoded4 = 0;\n for (let i = 0; i < base64.length; i += 4) {\n encoded1 = lookup[base64.charCodeAt(i)];\n encoded2 = lookup[base64.charCodeAt(i + 1)];\n encoded3 = lookup[base64.charCodeAt(i + 2)];\n encoded4 = lookup[base64.charCodeAt(i + 3)];\n bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n }\n return bytes;\n}\n","let tooltipType;\nexport const tooltipManager = {\n setType: (type) => {\n tooltipType = type;\n },\n bindCssTooltip: (element, text) => {\n if (tooltipType !== 'css') {\n return;\n }\n element.onmouseover = (e) => {\n const elm = e.currentTarget;\n let viewerElm = elm.closest('.pwv-ViewerCanvas');\n if (!viewerElm) {\n viewerElm = elm.closest('.pwv-WebViewer');\n }\n if (viewerElm) {\n elm.classList.remove('pwv-tooltip-top', 'pwv-tooltip-left', 'pwv-tooltip-right', 'pwv-tooltip-bottom');\n const elmRect = elm.getBoundingClientRect();\n const viewerRect = viewerElm.getBoundingClientRect();\n const top = elmRect.top - viewerRect.top;\n const left = elmRect.left - viewerRect.left;\n const right = viewerRect.right - elmRect.right;\n const bottom = viewerRect.bottom - elmRect.bottom;\n top < 45\n ? element.classList.add('pwv-tooltip-bottom')\n : element.classList.add('pwv-tooltip-top');\n if (left < 45) {\n element.classList.add('pwv-tooltip-right');\n }\n else if (right < 45) {\n element.classList.add('pwv-tooltip-left');\n }\n }\n };\n },\n createTooltip: (text) => {\n if (!text) {\n return undefined;\n }\n switch (tooltipType) {\n case 'title':\n return {\n title: text,\n };\n case 'css':\n return {\n 'data-pwv-tooltip': text,\n };\n default:\n return undefined;\n }\n },\n};\n","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nlet translations = {};\nlet translationRequested = false;\nexport const translationManager = {\n language: '',\n addTranslations: (res) => {\n translations = Object.assign(Object.assign({}, translations), res);\n },\n getText: (key) => {\n const res = translations[key];\n if (!res) {\n switch (key) {\n case 'applicationError.title':\n return 'Error';\n case 'applicationError.defaultMessage':\n return 'Configuration Error';\n case 'applicationError.reload':\n return '';\n }\n console.warn(`key not found ${key}`);\n return key;\n }\n return res;\n },\n loadTranslations: (language) => __awaiter(void 0, void 0, void 0, function* () {\n if (language !== translationManager.language ||\n (!translationRequested && Object.keys(translations).length === 0)) {\n translationManager.language = language;\n translationRequested = true;\n const translationFileUrl = window.Module.locateFile(`translations.${language}.json`);\n try {\n const res = yield fetch(translationFileUrl);\n if (res.ok) {\n translations = yield res.json();\n }\n else {\n throw new Error(`failed to load translation file '${translationFileUrl}`);\n }\n }\n catch (err) {\n console.error(`**************************************\nFailed to load translations.${language}.js\n\n%cThe PDF Web Viewer failed to load a required script resource. Either the \"Base URL\" (PDFTOOLS_FOURHEIGHTS_PDFVIEWING_BASEURL) is not configured correctly or the static assets have not been copied to the configured location. For more information please consult the documentation.\n\n%cwindow.PDFTOOLS_FOURHEIGHTS_PDFVIEWING_BASEURL=${window.PDFTOOLS_FOURHEIGHTS_PDFVIEWING_BASEURL}\n%c**************************************`, 'color: orange', 'color: gray', 'color: red');\n }\n }\n }),\n};\n","export const classNames = (...args) => {\n const classes = [];\n args.forEach((arg) => {\n if (typeof arg === 'string') {\n classes.push(arg);\n }\n else if (typeof arg === 'object') {\n const keys = Object.keys(arg);\n keys.forEach((k) => {\n if (arg[k]) {\n classes.push(k);\n }\n });\n }\n });\n return classes.join(' ');\n};\n","export const icons = {\n openFile: {\n width: 576,\n height: 512,\n path: 'M527.95 224H480v-48c0-26.51-21.49-48-48-48H272l-64-64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h385.057c28.068 0 54.135-14.733 68.599-38.84l67.453-112.464C588.24 264.812 565.285 224 527.95 224zM48 96h146.745l64 64H432c8.837 0 16 7.163 16 16v48H171.177c-28.068 0-54.135 14.733-68.599 38.84L32 380.47V112c0-8.837 7.163-16 16-16zm493.695 184.232l-67.479 112.464A47.997 47.997 0 0 1 433.057 416H44.823l82.017-136.696A48 48 0 0 1 168 256h359.975c12.437 0 20.119 13.568 13.72 24.232z',\n },\n saveFile: {\n width: 448,\n height: 512,\n path: 'M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM288 64v96H96V64h192zm128 368c0 8.822-7.178 16-16 16H48c-8.822 0-16-7.178-16-16V80c0-8.822 7.178-16 16-16h16v104c0 13.255 10.745 24 24 24h208c13.255 0 24-10.745 24-24V64.491a15.888 15.888 0 0 1 7.432 4.195l83.882 83.882A15.895 15.895 0 0 1 416 163.882V432zM224 232c-48.523 0-88 39.477-88 88s39.477 88 88 88 88-39.477 88-88-39.477-88-88-88zm0 144c-30.879 0-56-25.121-56-56s25.121-56 56-56 56 25.121 56 56-25.121 56-56 56z',\n },\n print: {\n width: 512,\n height: 512,\n path: 'M432 192h-16v-82.75c0-8.49-3.37-16.62-9.37-22.63L329.37 9.37c-6-6-14.14-9.37-22.63-9.37H126.48C109.64 0 96 14.33 96 32v160H80c-44.18 0-80 35.82-80 80v96c0 8.84 7.16 16 16 16h80v112c0 8.84 7.16 16 16 16h288c8.84 0 16-7.16 16-16V384h80c8.84 0 16-7.16 16-16v-96c0-44.18-35.82-80-80-80zM320 45.25L370.75 96H320V45.25zM128.12 32H288v64c0 17.67 14.33 32 32 32h64v64H128.02l.1-160zM384 480H128v-96h256v96zm96-128H32v-80c0-26.47 21.53-48 48-48h352c26.47 0 48 21.53 48 48v80zm-80-88c-13.25 0-24 10.74-24 24 0 13.25 10.75 24 24 24s24-10.75 24-24c0-13.26-10.75-24-24-24z',\n },\n docNavigation: {\n width: 512,\n height: 512,\n path: 'M464 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h416c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zm16 400c0 8.8-7.2 16-16 16H48c-8.8 0-16-7.2-16-16V192h448v240zM32 160V80c0-8.8 7.2-16 16-16h416c8.8 0 16 7.2 16 16v80H32z',\n },\n nextPage: {\n width: 448,\n height: 512,\n path: 'M216.464 36.465l-7.071 7.07c-4.686 4.686-4.686 12.284 0 16.971L387.887 239H12c-6.627 0-12 5.373-12 12v10c0 6.627 5.373 12 12 12h375.887L209.393 451.494c-4.686 4.686-4.686 12.284 0 16.971l7.071 7.07c4.686 4.686 12.284 4.686 16.97 0l211.051-211.05c4.686-4.686 4.686-12.284 0-16.971L233.434 36.465c-4.686-4.687-12.284-4.687-16.97 0z',\n },\n previousPage: {\n width: 448,\n height: 512,\n path: 'M231.536 475.535l7.071-7.07c4.686-4.686 4.686-12.284 0-16.971L60.113 273H436c6.627 0 12-5.373 12-12v-10c0-6.627-5.373-12-12-12H60.113L238.607 60.506c4.686-4.686 4.686-12.284 0-16.971l-7.071-7.07c-4.686-4.686-12.284-4.686-16.97 0L3.515 247.515c-4.686 4.686-4.686 12.284 0 16.971l211.051 211.05c4.686 4.686 12.284 4.686 16.97-.001z',\n },\n zoomIn: {\n width: 512,\n height: 512,\n path: 'M384 250v12c0 6.6-5.4 12-12 12h-98v98c0 6.6-5.4 12-12 12h-12c-6.6 0-12-5.4-12-12v-98h-98c-6.6 0-12-5.4-12-12v-12c0-6.6 5.4-12 12-12h98v-98c0-6.6 5.4-12 12-12h12c6.6 0 12 5.4 12 12v98h98c6.6 0 12 5.4 12 12zm120 6c0 137-111 248-248 248S8 393 8 256 119 8 256 8s248 111 248 248zm-32 0c0-119.9-97.3-216-216-216-119.9 0-216 97.3-216 216 0 119.9 97.3 216 216 216 119.9 0 216-97.3 216-216z',\n },\n zoomOut: {\n width: 512,\n height: 512,\n path: 'M140 274c-6.6 0-12-5.4-12-12v-12c0-6.6 5.4-12 12-12h232c6.6 0 12 5.4 12 12v12c0 6.6-5.4 12-12 12H140zm364-18c0 137-111 248-248 248S8 393 8 256 119 8 256 8s248 111 248 248zm-32 0c0-119.9-97.3-216-216-216-119.9 0-216 97.3-216 216 0 119.9 97.3 216 216 216 119.9 0 216-97.3 216-216z',\n },\n search: {\n width: 512,\n height: 512,\n path: 'M508.5 481.6l-129-129c-2.3-2.3-5.3-3.5-8.5-3.5h-10.3C395 312 416 262.5 416 208 416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c54.5 0 104-21 141.1-55.2V371c0 3.2 1.3 6.2 3.5 8.5l129 129c4.7 4.7 12.3 4.7 17 0l9.9-9.9c4.7-4.7 4.7-12.3 0-17zM208 384c-97.3 0-176-78.7-176-176S110.7 32 208 32s176 78.7 176 176-78.7 176-176 176z',\n },\n fitActualSize: {\n width: 448,\n height: 512,\n path: 'M0 180V56c0-13.3 10.7-24 24-24h124c6.6 0 12 5.4 12 12v8c0 6.6-5.4 12-12 12H32v116c0 6.6-5.4 12-12 12h-8c-6.6 0-12-5.4-12-12zM300 32h124c13.3 0 24 10.7 24 24v124c0 6.6-5.4 12-12 12h-8c-6.6 0-12-5.4-12-12V64H300c-6.6 0-12-5.4-12-12v-8c0-6.6 5.4-12 12-12zm148 300v124c0 13.3-10.7 24-24 24H300c-6.6 0-12-5.4-12-12v-8c0-6.6 5.4-12 12-12h116V332c0-6.6 5.4-12 12-12h8c6.6 0 12 5.4 12 12zM148 480H24c-13.3 0-24-10.7-24-24V332c0-6.6 5.4-12 12-12h8c6.6 0 12 5.4 12 12v116h116c6.6 0 12 5.4 12 12v8c0 6.6-5.4 12-12 12z',\n },\n fitWidth: {\n width: 512,\n height: 512,\n path: 'M399.959 170.585c-4.686 4.686-4.686 12.284 0 16.971L451.887 239H60.113l51.928-51.444c4.686-4.686 4.686-12.284 0-16.971l-7.071-7.07c-4.686-4.686-12.284-4.686-16.97 0l-84.485 84c-4.686 4.686-4.686 12.284 0 16.971l84.485 84c4.686 4.686 12.284 4.686 16.97 0l7.071-7.07c4.686-4.686 4.686-12.284 0-16.971L60.113 273h391.773l-51.928 51.444c-4.686 4.686-4.686 12.284 0 16.971l7.071 7.07c4.686 4.686 12.284 4.686 16.97 0l84.485-84c4.687-4.686 4.687-12.284 0-16.971l-84.485-84c-4.686-4.686-12.284-4.686-16.97 0l-7.07 7.071z',\n },\n fitPage: {\n width: 512,\n height: 512,\n path: 'M337.782 434.704l-73.297 73.782c-4.686 4.686-12.284 4.686-16.971 0l-73.296-73.782c-4.686-4.686-4.686-12.284 0-16.97l7.07-7.07c4.686-4.686 12.284-4.686 16.971 0L239 451.887h1V272H60.113v1l41.224 40.741c4.686 4.686 4.686 12.284 0 16.971l-7.071 7.07c-4.686 4.686-12.284 4.686-16.97 0L3.515 264.485c-4.686-4.686-4.686-12.284 0-16.971l73.782-73.297c4.686-4.686 12.284-4.686 16.971 0l7.071 7.071c4.686 4.686 4.686 12.284 0 16.971L60.113 239v1H240V60.113h-1l-40.741 41.224c-4.686 4.686-12.284 4.686-16.971 0l-7.07-7.071c-4.686-4.686-4.687-12.284 0-16.97l73.297-73.782c4.686-4.686 12.284-4.686 16.971 0l73.297 73.782c4.686 4.686 4.686 12.284 0 16.971l-7.071 7.071c-4.686 4.686-12.284 4.686-16.971 0L273 60.113h-1V240h179.887v-1l-41.224-40.741c-4.686-4.686-4.686-12.284 0-16.971l7.071-7.07c4.686-4.686 12.284-4.686 16.97 0l73.782 73.297c4.687 4.686 4.686 12.284 0 16.971l-73.782 73.297c-4.686 4.686-12.284 4.686-16.97 0l-7.071-7.07c-4.686-4.686-4.686-12.284 0-16.971L451.887 273v-1H272v179.887h1l40.741-41.224c4.686-4.686 12.284-4.686 16.971 0l7.07 7.071c4.686 4.685 4.686 12.283 0 16.97z',\n },\n edit: {\n width: 576,\n height: 512,\n path: 'M417.8 315.5l20-20c3.8-3.8 10.2-1.1 10.2 4.2V464c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V112c0-26.5 21.5-48 48-48h292.3c5.3 0 8 6.5 4.2 10.2l-20 20c-1.1 1.1-2.7 1.8-4.2 1.8H48c-8.8 0-16 7.2-16 16v352c0 8.8 7.2 16 16 16h352c8.8 0 16-7.2 16-16V319.7c0-1.6.6-3.1 1.8-4.2zm145.9-191.2L251.2 436.8l-99.9 11.1c-13.4 1.5-24.7-9.8-23.2-23.2l11.1-99.9L451.7 12.3c16.4-16.4 43-16.4 59.4 0l52.6 52.6c16.4 16.4 16.4 43 0 59.4zm-93.6 48.4L403.4 106 169.8 339.5l-8.3 75.1 75.1-8.3 233.5-233.6zm71-85.2l-52.6-52.6c-3.8-3.8-10.2-4-14.1 0L426 83.3l66.7 66.7 48.4-48.4c3.9-3.8 3.9-10.2 0-14.1z',\n },\n stickyNote: {\n width: 512,\n height: 512,\n path: 'M448 0H64C28.7 0 0 28.7 0 64v288c0 35.3 28.7 64 64 64h96v84c0 7.1 5.8 12 12 12 2.4 0 4.9-.7 7.1-2.4L304 416h144c35.3 0 64-28.7 64-64V64c0-35.3-28.7-64-64-64zm32 352c0 17.6-14.4 32-32 32H293.3l-8.5 6.4L192 460v-76H64c-17.6 0-32-14.4-32-32V64c0-17.6 14.4-32 32-32h384c17.6 0 32 14.4 32 32v288zM280 240H136c-4.4 0-8 3.6-8 8v16c0 4.4 3.6 8 8 8h144c4.4 0 8-3.6 8-8v-16c0-4.4-3.6-8-8-8zm96-96H136c-4.4 0-8 3.6-8 8v16c0 4.4 3.6 8 8 8h240c4.4 0 8-3.6 8-8v-16c0-4.4-3.6-8-8-8z',\n bg: 'M 448,0 H 64 C 28.7,0 0,28.7 0,64 v 288 c 0,35.3 28.7,64 64,64 h 96 v 84 c 0,7.1 5.8,12 12,12 2.4,0 4.9,-0.7 7.1,-2.4 L 304,416 h 144 c 35.3,0 64,-28.7 64,-64 V 64 C 512,28.7 483.3,0 448,0 Z',\n },\n stickyNoteAdd: {\n width: 512,\n height: 512,\n path: 'M448 0H64C28.7 0 0 28.7 0 64v288c0 35.3 28.7 64 64 64h96v84c0 7.1 5.8 12 12 12 2.4 0 4.9-.7 7.1-2.4L304 416h144c35.3 0 64-28.7 64-64V64c0-35.3-28.7-64-64-64zm32 352c0 17.6-14.4 32-32 32H293.3l-8.5 6.4L192 460v-76H64c-17.6 0-32-14.4-32-32V64c0-17.6 14.4-32 32-32h384c17.6 0 32 14.4 32 32v288zM344 192h-72v-72c0-4.4-3.6-8-8-8h-16c-4.4 0-8 3.6-8 8v72h-72c-4.4 0-8 3.6-8 8v16c0 4.4 3.6 8 8 8h72v72c0 4.4 3.6 8 8 8h16c4.4 0 8-3.6 8-8v-72h72c4.4 0 8-3.6 8-8v-16c0-4.4-3.6-8-8-8z',\n },\n stickyNoteEdit: {\n width: 512,\n height: 512,\n path: 'M448 0H64C28.7 0 0 28.7 0 64v288c0 35.3 28.7 64 64 64h96v84c0 7.1 5.8 12 12 12 2.4 0 4.9-.7 7.1-2.4L304 416h144c35.3 0 64-28.7 64-64V64c0-35.3-28.7-64-64-64zm32 352c0 17.6-14.4 32-32 32H293.3l-8.5 6.4L192 460v-76H64c-17.6 0-32-14.4-32-32V64c0-17.6 14.4-32 32-32h384c17.6 0 32 14.4 32 32v288zM336 105.4c-12.5-12.5-32.8-12.5-45.2 0l-126.1 126c-2 2-3.4 4.5-4.2 7.3l-16 61.2c-1.4 5.5.1 11.3 4.2 15.4 3 3 7.1 4.7 11.3 4.7 1.3 0 2.7-.2 4-.5l61.2-16c2.8-.7 5.3-2.2 7.3-4.2l126.1-126.1c12.5-12.5 12.5-32.8 0-45.2L336 105.4zM213 273.6l-30.6 8 8-30.6 75-75 22.6 22.6-75 75zm97.6-97.6L288 153.4l25.4-25.4 22.6 22.6-25.4 25.4z',\n },\n stickyNoteRemove: {\n width: 640,\n height: 512,\n path: 'M637 485.2l-96.7-76.1-22.5-17.7-443.2-349-5.2-4.1L23 1.8C19.6-1 14.5-.4 11.8 3l-10 12.5C-1 19-.4 24 3 26.8l61 48L96 100l360.7 284 15.9 12.5L617 510.2c3.4 2.8 8.5 2.2 11.2-1.2l10-12.5c2.8-3.5 2.2-8.5-1.2-11.3zM368 384h-10.7l-8.5 6.4L256 460v-76H128c-17.6 0-32-14.4-32-32V161.1l-32-25.2V352c0 35.3 28.7 64 64 64h96v84c0 7.1 5.8 12 12 12 2.4 0 4.9-.7 7.1-2.4L368 416h51.7l-40.6-32H368zM512 32c17.6 0 32 14.4 32 32v286.9l28.2 22.2c2.3-6.6 3.8-13.7 3.8-21.1V64c0-35.3-28.7-64-64-64H128c-8.4 0-16.4 1.7-23.7 4.7L139 32h373z',\n },\n nextMatch: {\n width: 448,\n height: 512,\n path: 'M311.03 131.515l-7.071 7.07c-4.686 4.686-4.686 12.284 0 16.971L387.887 239H12c-6.627 0-12 5.373-12 12v10c0 6.627 5.373 12 12 12h375.887l-83.928 83.444c-4.686 4.686-4.686 12.284 0 16.971l7.071 7.07c4.686 4.686 12.284 4.686 16.97 0l116.485-116c4.686-4.686 4.686-12.284 0-16.971L328 131.515c-4.686-4.687-12.284-4.687-16.97 0z',\n },\n previousMatch: {\n width: 448,\n height: 512,\n path: 'M136.97 380.485l7.071-7.07c4.686-4.686 4.686-12.284 0-16.971L60.113 273H436c6.627 0 12-5.373 12-12v-10c0-6.627-5.373-12-12-12H60.113l83.928-83.444c4.686-4.686 4.686-12.284 0-16.971l-7.071-7.07c-4.686-4.686-12.284-4.686-16.97 0l-116.485 116c-4.686 4.686-4.686 12.284 0 16.971l116.485 116c4.686 4.686 12.284 4.686 16.97-.001z',\n },\n outlineOpen: {\n width: 320,\n height: 512,\n path: 'M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z',\n },\n outlineClosed: {\n width: 192,\n height: 512,\n path: 'M0 384.662V127.338c0-17.818 21.543-26.741 34.142-14.142l128.662 128.662c7.81 7.81 7.81 20.474 0 28.284L34.142 398.804C21.543 411.404 0 402.48 0 384.662z',\n },\n dropdownCaret: {\n width: 448,\n height: 512,\n path: 'M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z',\n },\n addLayer: {\n width: 512,\n height: 512,\n path: 'M504 96h-88V8c0-4.42-3.58-8-8-8h-16c-4.42 0-8 3.58-8 8v88h-88c-4.42 0-8 3.58-8 8v16c0 4.42 3.58 8 8 8h88v88c0 4.42 3.58 8 8 8h16c4.42 0 8-3.58 8-8v-88h88c4.42 0 8-3.58 8-8v-16c0-4.42-3.58-8-8-8zm-6.77 270.71l-99.72-42.87 99.72-42.87c8.35-3.6 12.19-13.23 8.58-21.52-3.65-8.29-13.32-12.13-21.74-8.48l-225.32 96.86c-1.81.77-3.74.77-5.48 0L45.23 258.4l193.45-83.16c8.35-3.59 12.19-13.23 8.58-21.52-3.65-8.28-13.26-12.13-21.74-8.48L14.81 235.81C5.81 239.66 0 248.52 0 258.4c0 9.87 5.81 18.74 14.77 22.58l99.73 42.87-99.7 42.85C5.81 370.55 0 379.42 0 389.31c0 9.87 5.81 18.74 14.77 22.58l225.32 96.84c5.06 2.17 10.48 3.28 15.9 3.28s10.84-1.09 15.9-3.28l225.29-96.83c9-3.85 14.81-12.72 14.81-22.59.01-9.89-5.8-18.76-14.76-22.6zM258.74 478.72c-1.81.77-3.74.77-5.48 0L45.23 389.29 156 341.68l84.1 36.15c5.06 2.17 10.48 3.28 15.9 3.28s10.84-1.09 15.9-3.28l84.12-36.16 110.78 47.62-208.06 89.43z',\n },\n eraser: {\n width: 512,\n height: 512,\n path: 'M497.942 273.941c18.745-18.745 18.745-49.137 0-67.882l-160-160c-18.744-18.744-49.136-18.746-67.883 0l-256 256c-18.745 18.745-18.745 49.137 0 67.882l96 96A48 48 0 0 0 144 480h356c6.627 0 12-5.373 12-12v-8c0-6.627-5.373-12-12-12H323.883l174.059-174.059zM292.686 68.687c6.243-6.243 16.374-6.254 22.628-.001l160 160c6.243 6.243 6.253 16.374 0 22.627L358.627 368.001 176 185.373 292.686 68.687zM144 448a15.895 15.895 0 0 1-11.314-4.686l-96-96c-6.243-6.243-6.253-16.374 0-22.627L153.373 208 336 390.628l-52.686 52.686A15.895 15.895 0 0 1 272 448H144z',\n },\n ok: {\n width: 448,\n height: 512,\n path: 'M413.505 91.951L133.49 371.966l-98.995-98.995c-4.686-4.686-12.284-4.686-16.971 0L6.211 284.284c-4.686 4.686-4.686 12.284 0 16.971l118.794 118.794c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-11.314-11.314c-4.686-4.686-12.284-4.686-16.97 0z',\n },\n alignCenter: {\n width: 448,\n height: 512,\n path: 'M352 52v24a6 6 0 0 1-6 6H102a6 6 0 0 1-6-6V52a6 6 0 0 1 6-6h244a6 6 0 0 1 6 6zM6 210h436a6 6 0 0 0 6-6v-24a6 6 0 0 0-6-6H6a6 6 0 0 0-6 6v24a6 6 0 0 0 6 6zm0 256h436a6 6 0 0 0 6-6v-24a6 6 0 0 0-6-6H6a6 6 0 0 0-6 6v24a6 6 0 0 0 6 6zm340-164H102a6 6 0 0 0-6 6v24a6 6 0 0 0 6 6h244a6 6 0 0 0 6-6v-24a6 6 0 0 0-6-6z',\n },\n alignJustify: {\n width: 448,\n height: 512,\n path: 'M0 76V52a6 6 0 0 1 6-6h436a6 6 0 0 1 6 6v24a6 6 0 0 1-6 6H6a6 6 0 0 1-6-6zm6 134h436a6 6 0 0 0 6-6v-24a6 6 0 0 0-6-6H6a6 6 0 0 0-6 6v24a6 6 0 0 0 6 6zm0 256h436a6 6 0 0 0 6-6v-24a6 6 0 0 0-6-6H6a6 6 0 0 0-6 6v24a6 6 0 0 0 6 6zm0-128h436a6 6 0 0 0 6-6v-24a6 6 0 0 0-6-6H6a6 6 0 0 0-6 6v24a6 6 0 0 0 6 6z',\n },\n alignLeft: {\n width: 448,\n height: 512,\n path: 'M288 52v24a6 6 0 0 1-6 6H6a6 6 0 0 1-6-6V52a6 6 0 0 1 6-6h276a6 6 0 0 1 6 6zM6 210h436a6 6 0 0 0 6-6v-24a6 6 0 0 0-6-6H6a6 6 0 0 0-6 6v24a6 6 0 0 0 6 6zm0 256h436a6 6 0 0 0 6-6v-24a6 6 0 0 0-6-6H6a6 6 0 0 0-6 6v24a6 6 0 0 0 6 6zm276-164H6a6 6 0 0 0-6 6v24a6 6 0 0 0 6 6h276a6 6 0 0 0 6-6v-24a6 6 0 0 0-6-6z',\n },\n alignRight: {\n width: 448,\n height: 512,\n path: 'M160 76V52a6 6 0 0 1 6-6h276a6 6 0 0 1 6 6v24a6 6 0 0 1-6 6H166a6 6 0 0 1-6-6zM6 210h436a6 6 0 0 0 6-6v-24a6 6 0 0 0-6-6H6a6 6 0 0 0-6 6v24a6 6 0 0 0 6 6zm0 256h436a6 6 0 0 0 6-6v-24a6 6 0 0 0-6-6H6a6 6 0 0 0-6 6v24a6 6 0 0 0 6 6zm160-128h276a6 6 0 0 0 6-6v-24a6 6 0 0 0-6-6H166a6 6 0 0 0-6 6v24a6 6 0 0 0 6 6z',\n },\n bold: {\n width: 320,\n height: 512,\n path: 'M249.139 242.128c33.922-18.988 53.22-53.503 53.22-95.748 0-42.421-19.499-80.713-49.665-97.55C232.561 37.505 207.478 32 176.01 32H12C5.373 32 0 37.373 0 44v8c0 6.627 5.373 12 12 12h19.95v384H12c-6.627 0-12 5.373-12 12v8c0 6.627 5.373 12 12 12h169.68c19.934 0 45.622-1.177 67.493-10.348C292.198 451.781 320 406.247 320 353.65c0-52.496-28.196-96.372-70.861-111.522zM66.041 64.201H176.01c24.929 0 43.694 4.153 57.357 12.692 21.38 13.439 33.642 38.537 33.642 68.858 0 49.531-32.265 82.81-80.289 82.81H66.041V64.201zm167.194 375.685c-12.585 5.325-29.449 7.914-51.555 7.914H66.041V260.76h124.458c56.314 0 94.151 37.837 94.151 94.151 0 40.208-19.2 71.966-51.415 84.975z',\n },\n italic: {\n width: 256,\n height: 512,\n path: 'M102.791 64h45.215L73.143 448H23.762a12 12 0 0 0-11.764 9.632l-1.61 8C8.892 473.062 14.573 480 22.151 480h128.817a12 12 0 0 0 11.764-9.632l1.61-8c1.495-7.43-4.186-14.368-11.764-14.368h-45.215l74.864-384h50.011a12 12 0 0 0 11.764-9.632l1.61-8C247.108 38.938 241.427 32 233.849 32H104.401a12 12 0 0 0-11.764 9.632l-1.61 8C89.532 57.062 95.213 64 102.791 64z',\n },\n underline: {\n width: 448,\n height: 512,\n path: 'M0 500v-8c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v8c0 6.627-5.373 12-12 12H12c-6.627 0-12-5.373-12-12zM291.142 12v8c0 6.627 5.373 12 12 12h42.72v226.509c0 85.451-46.451 128.726-122.145 128.726-74.322 0-121.569-40.289-121.569-127.572V32h42.721c6.627 0 12-5.373 12-12v-8c0-6.627-5.373-12-12-12H26.659c-6.627 0-12 5.373-12 12v8c0 6.627 5.373 12 12 12H69.38v228.818c0 106.811 63.591 158.094 154.913 158.094 89.287 0 154.337-52.813 154.337-158.094V32h42.721c6.627 0 12-5.373 12-12v-8c0-6.627-5.373-12-12-12H303.142c-6.628 0-12 5.373-12 12z',\n },\n squiggly: {\n width: 448,\n height: 512,\n path: 'M 111.80004,416.25781 -0.09375,473.46875 v 38.51563 l 111.89379,-57.21094 112.14242,57.33789 112.14243,-57.33985 112.14244,57.33985 V 473.59375 L 336.08881,416.25781 223.94246,473.5957 Z M 291.142,12 v 8 c 0,6.627 5.373,12 12,12 h 42.72 v 226.509 c 0,85.451 -46.451,128.726 -122.145,128.726 -74.322,0 -121.569,-40.289 -121.569,-127.572 V 32 h 42.721 c 6.627,0 12,-5.373 12,-12 v -8 c 0,-6.627 -5.373,-12 -12,-12 H 26.659 c -6.627,0 -12,5.373 -12,12 v 8 c 0,6.627 5.373,12 12,12 H 69.38 v 228.818 c 0,106.811 63.591,158.094 154.913,158.094 89.287,0 154.337,-52.813 154.337,-158.094 V 32 h 42.721 c 6.627,0 12,-5.373 12,-12 v -8 c 0,-6.627 -5.373,-12 -12,-12 H 303.142 c -6.628,0 -12,5.373 -12,12 z',\n },\n strikethrough: {\n width: 512,\n height: 512,\n path: 'M500 272H12c-6.627 0-12-5.373-12-12v-8c0-6.627 5.373-12 12-12h488c6.627 0 12 5.373 12 12v8c0 6.627-5.373 12-12 12zm-199.246 16c34.104 17.688 58.216 40.984 58.216 83.01 0 57.657-45.969 87.221-104.86 87.221-43.044 0-101.711-17.734-101.711-60.762V388c0-6.627-5.373-12-12-12h-10.72c-6.627 0-12 5.373-12 12v15.77c0 60.082 76.565 87.291 136.431 87.291 78.593 0 140.211-46.632 140.211-123.832 0-35.712-11.87-60.522-30.603-79.229h-62.964zm-137.387-64h74.348c-43.357-17.896-75.865-37.601-75.865-84.203 0-52.844 43.64-79.03 96.041-79.03 32.008 0 90.37 12.598 90.37 44.38V116c0 6.627 5.373 12 12 12h10.721c6.627 0 12-5.373 12-12V96.327c0-44.421-64.45-68.391-125.091-68.391-72.526 0-131.392 41.225-131.392 115.011 0 38.214 14.813 63.053 36.868 81.053z',\n },\n fontColor: {\n width: 448,\n height: 512,\n path: 'M232.594 32h-17.187a11.998 11.998 0 0 0-11.239 7.796L51.473 448H28c-6.627 0-12 5.373-12 12v8c0 6.627 5.373 12 12 12h88c6.627 0 12-5.373 12-12v-8c0-6.627-5.373-12-12-12H87.913l44.651-120.46h182.253L360.063 448H332c-6.627 0-12 5.373-12 12v8c0 6.627 5.373 12 12 12h88c6.627 0 12-5.373 12-12v-8c0-6.627-5.373-12-12-12h-23.473L243.833 39.796A12 12 0 0 0 232.594 32zm-87.958 263.34l75.696-201.241c1.5-3.857 2.714-7.827 3.668-11.427.95 3.589 2.159 7.544 3.651 11.382l75.098 201.286H144.636z',\n },\n fillColor: {\n width: 576,\n height: 512,\n path: 'M512 320s-64 92.65-64 128c0 35.35 28.66 64 64 64s64-28.65 64-64-64-128-64-128zm0 160c-17.64 0-32-14.36-32-31.96.26-9.78 13.57-37.67 32.01-68.73 18.43 31.04 31.73 58.91 31.99 68.69 0 17.64-14.36 32-32 32zm-9.37-262.94L294.94 9.37C288.69 3.12 280.5 0 272.31 0s-16.38 3.12-22.62 9.37l-92.85 92.85L56.97 2.35c-3.12-3.12-8.19-3.12-11.31 0L34.34 13.66c-3.12 3.12-3.12 8.19 0 11.31l99.88 99.88-106.1 106.1c-37.49 37.49-37.49 98.26 0 135.75l117.19 117.19c18.75 18.74 43.31 28.12 67.87 28.12 24.57 0 49.13-9.37 67.87-28.12l221.57-221.57c12.5-12.5 12.5-32.76.01-45.26zm-244.2 244.2C246.34 473.34 230.27 480 213.18 480s-33.16-6.66-45.24-18.74l-117.2-117.2c-6.88-6.88-11.77-15.14-14.91-24.06h363.85L258.43 461.26zM431.68 288H33.06c2.2-12.96 8.2-24.94 17.69-34.43l106.09-106.11 87.85 87.85c6.25 6.25 16.38 6.25 22.62 0 6.25-6.25 6.25-16.38 0-22.62l-87.85-87.85L272.29 32h.02L480 239.68 431.68 288z',\n },\n drop: {\n width: 352,\n height: 512,\n path: 'M205.22 22.09C201.21 7.53 188.61 0 175.97 0c-12.35 0-24.74 7.2-29.19 22.09C100.01 179.85 0 222.72 0 333.91 0 432.35 78.72 512 176 512s176-79.65 176-178.09c0-111.75-99.79-153.34-146.78-311.82zM176 480c-79.4 0-144-65.54-144-146.09 0-48.36 23-81.32 54.84-126.94 29.18-41.81 65.34-93.63 89.18-170.91 23.83 77.52 60.06 129.31 89.3 171.08C297.06 252.52 320 285.3 320 333.91 320 414.46 255.4 480 176 480zm0-64c-44.12 0-80-35.89-80-80 0-8.84-7.16-16-16-16s-16 7.16-16 16c0 61.75 50.25 112 112 112 8.84 0 16-7.16 16-16s-7.16-16-16-16z',\n },\n checkbox: {\n width: 448,\n height: 512,\n path: 'M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zm16 400c0 8.8-7.2 16-16 16H48c-8.8 0-16-7.2-16-16V80c0-8.8 7.2-16 16-16h352c8.8 0 16 7.2 16 16v352z',\n },\n checkboxChecked: {\n width: 448,\n height: 512,\n path: 'M400 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V80c0-26.51-21.49-48-48-48zm0 32c8.823 0 16 7.178 16 16v352c0 8.822-7.177 16-16 16H48c-8.822 0-16-7.178-16-16V80c0-8.822 7.178-16 16-16h352m-34.301 98.293l-8.451-8.52c-4.667-4.705-12.265-4.736-16.97-.068l-163.441 162.13-68.976-69.533c-4.667-4.705-12.265-4.736-16.97-.068l-8.52 8.451c-4.705 4.667-4.736 12.265-.068 16.97l85.878 86.572c4.667 4.705 12.265 4.736 16.97.068l180.48-179.032c4.704-4.667 4.735-12.265.068-16.97z',\n },\n pageLayoutModeNone: {\n width: 512,\n height: 512,\n path: 'M 404.00446,340.39588 H 307.417 c -8.8907,0 -16.09791,-7.20735 -16.09791,-16.0979 V 226.90563 H 129.53513 c -9.33519,0 -16.90281,7.56764 -16.90281,16.90282 V 508.86602 H 82.046291 V 243.80845 c 0,-26.22737 21.261469,-47.48883 47.488839,-47.48883 h 185.16393 c 13.26225,0 25.94064,5.4538 35.06108,15.08212 l 76.00853,80.24116 c 5.66469,5.9802 8.82181,13.90391 8.82181,22.14106 v 195.63997 h -30.58602 z m -1.01739,-27.15345 -79.47231,-86.3368 h -1.60979 v 86.3368 z M 82.851029,3.1447104 H 113.43705 V 99.732162 c 0,9.335168 7.56762,16.902808 16.90282,16.902808 h 257.56652 c 9.33518,0 16.9028,-7.56764 16.9028,-16.902808 V 3.1447104 h 30.58603 V 99.732162 c 0,26.227348 -21.26147,47.488828 -47.48883,47.488828 H 130.33987 c -26.22737,0 -47.488841,-21.26148 -47.488841,-47.488828 z',\n },\n pageLayoutModeSinglePage: {\n width: 384,\n height: 512,\n path: 'M369.9 97.9L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34zm-22.6 22.7c2.1 2.1 3.5 4.6 4.2 7.4H256V32.5c2.8.7 5.3 2.1 7.4 4.2l83.9 83.9zM336 480H48c-8.8 0-16-7.2-16-16V48c0-8.8 7.2-16 16-16h176v104c0 13.3 10.7 24 24 24h104v304c0 8.8-7.2 16-16 16z',\n },\n warning: {\n width: 576,\n height: 512,\n path: 'M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.054-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.952 83.154 0l239.94 416.028zm-27.658 15.991l-240-416c-6.16-10.678-21.583-10.634-27.718 0l-240 416C27.983 466.678 35.731 480 48 480h480c12.323 0 19.99-13.369 13.859-23.996zM288 372c-15.464 0-28 12.536-28 28s12.536 28 28 28 28-12.536 28-28-12.536-28-28-28zm-11.49-212h22.979c6.823 0 12.274 5.682 11.99 12.5l-7 168c-.268 6.428-5.556 11.5-11.99 11.5h-8.979c-6.433 0-11.722-5.073-11.99-11.5l-7-168c-.283-6.818 5.167-12.5 11.99-12.5zM288 372c-15.464 0-28 12.536-28 28s12.536 28 28 28 28-12.536 28-28-12.536-28-28-28z',\n },\n lock: {\n width: 448,\n height: 512,\n path: 'M224 420c-11 0-20-9-20-20v-64c0-11 9-20 20-20s20 9 20 20v64c0 11-9 20-20 20zm224-148v192c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V272c0-26.5 21.5-48 48-48h16v-64C64 71.6 136-.3 224.5 0 312.9.3 384 73.1 384 161.5V224h16c26.5 0 48 21.5 48 48zM96 224h256v-64c0-70.6-57.4-128-128-128S96 89.4 96 160v64zm320 240V272c0-8.8-7.2-16-16-16H48c-8.8 0-16 7.2-16 16v192c0 8.8 7.2 16 16 16h352c8.8 0 16-7.2 16-16z',\n },\n unlock: {\n width: 640,\n height: 512,\n path: 'M227 417c-11 0-20-9-20-20v-64c0-11 9-20 20-20s20 9 20 20v64c0 11-9 20-20 20zM480.5 0C392-.3 320 71.6 320 160v64H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48h-48v-62.6c0-70.7 56.7-129 127.3-129.4C550.2 31.6 608 89.2 608 160v84c0 6.6 5.4 12 12 12h8c6.6 0 12-5.4 12-12v-82.5C640 73.1 568.9.3 480.5 0zM400 256c8.8 0 16 7.2 16 16v192c0 8.8-7.2 16-16 16H48c-8.8 0-16-7.2-16-16V272c0-8.8 7.2-16 16-16h352z',\n },\n history: {\n width: 512,\n height: 512,\n path: 'M20 24h10c6.627 0 12 5.373 12 12v94.625C85.196 57.047 165.239 7.715 256.793 8.001 393.18 8.428 504.213 120.009 504 256.396 503.786 393.181 392.834 504 256 504c-63.926 0-122.202-24.187-166.178-63.908-5.113-4.618-5.354-12.561-.482-17.433l7.069-7.069c4.503-4.503 11.749-4.714 16.482-.454C150.782 449.238 200.935 470 256 470c117.744 0 214-95.331 214-214 0-117.744-95.331-214-214-214-82.862 0-154.737 47.077-190.289 116H164c6.627 0 12 5.373 12 12v10c0 6.627-5.373 12-12 12H20c-6.627 0-12-5.373-12-12V36c0-6.627 5.373-12 12-12zm321.647 315.235l4.706-6.47c3.898-5.36 2.713-12.865-2.647-16.763L272 263.853V116c0-6.627-5.373-12-12-12h-8c-6.627 0-12 5.373-12 12v164.147l84.884 61.734c5.36 3.899 12.865 2.714 16.763-2.646z',\n },\n error: {\n width: 512,\n height: 512,\n path: 'M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z',\n },\n pdfFile: {\n width: 384,\n height: 512,\n path: 'M369.9 97.9L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34zm-22.6 22.7c2.1 2.1 3.5 4.6 4.2 7.4H256V32.5c2.8.7 5.3 2.1 7.4 4.2l83.9 83.9zM336 480H48c-8.8 0-16-7.2-16-16V48c0-8.8 7.2-16 16-16h176v104c0 13.3 10.7 24 24 24h104v304c0 8.8-7.2 16-16 16zm-48-244v8c0 6.6-5.4 12-12 12H108c-6.6 0-12-5.4-12-12v-8c0-6.6 5.4-12 12-12h168c6.6 0 12 5.4 12 12zm0 64v8c0 6.6-5.4 12-12 12H108c-6.6 0-12-5.4-12-12v-8c0-6.6 5.4-12 12-12h168c6.6 0 12 5.4 12 12zm0 64v8c0 6.6-5.4 12-12 12H108c-6.6 0-12-5.4-12-12v-8c0-6.6 5.4-12 12-12h168c6.6 0 12 5.4 12 12z',\n },\n fileError: {\n width: 384,\n height: 512,\n path: 'M369.9 97.9L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34zm-22.6 22.7c2.1 2.1 3.5 4.6 4.2 7.4H256V32.5c2.8.7 5.3 2.1 7.4 4.2l83.9 83.9zM336 480H48c-8.8 0-16-7.2-16-16V48c0-8.8 7.2-16 16-16h176v104c0 13.3 10.7 24 24 24h104v304c0 8.8-7.2 16-16 16zm-73.3-127.9c4.7 4.7 4.7 12.3 0 17l-5.7 5.7c-4.7 4.7-12.3 4.7-17 0l-48-48.2-48.1 48.1c-4.7 4.7-12.3 4.7-17 0l-5.7-5.7c-4.7-4.7-4.7-12.3 0-17l48.1-48.1-48.1-48.1c-4.7-4.7-4.7-12.3 0-17l5.7-5.7c4.7-4.7 12.3-4.7 17 0l48.1 48.1 48.1-48.1c4.7-4.7 12.3-4.7 17 0l5.7 5.7c4.7 4.7 4.7 12.3 0 17L214.6 304l48.1 48.1z',\n },\n sidePaneThumbnails: {\n width: 512,\n height: 512,\n path: 'M 111.73 0.28125 C 85.231 0.28125 63.73 21.781 63.73 48.281 L 63.73 63.73 L 48.359 63.73 C 21.859 63.73 0.35938 85.231 0.35938 111.73 L 0.35938 463.73 C 0.35938 490.23 21.859 511.73 48.359 511.73 L 400.36 511.73 C 426.86 511.73 448.36 490.23 448.36 463.73 L 448.36 448.28 L 463.73 448.28 C 490.23 448.28 511.73 426.78 511.73 400.28 L 511.73 48.281 C 511.73 21.781 490.23 0.28125 463.73 0.28125 L 111.73 0.28125 z M 111.73 32.281 L 463.73 32.281 C 472.55 32.281 479.73 39.461 479.73 48.281 L 479.73 400.28 C 479.73 409.1 472.55 416.28 463.73 416.28 L 448.36 416.28 L 448.36 111.73 C 448.36 85.231 426.86 63.73 400.36 63.73 L 95.73 63.73 L 95.73 48.281 C 95.73 39.461 102.91 32.281 111.73 32.281 z M 48.359 95.73 L 400.36 95.73 C 409.18 95.73 416.36 102.91 416.36 111.73 L 416.36 463.73 C 416.36 472.55 409.18 479.73 400.36 479.73 L 48.359 479.73 C 39.539 479.73 32.359 472.55 32.359 463.73 L 32.359 111.73 C 32.359 102.91 39.539 95.73 48.359 95.73 z M 104.36 175.73 C 99.938 175.73 96.359 179.31 96.359 183.73 L 96.359 199.73 C 96.359 204.15 99.938 207.73 104.36 207.73 L 248.36 207.73 C 252.78 207.73 256.36 204.15 256.36 199.73 L 256.36 183.73 C 256.36 179.31 252.78 175.73 248.36 175.73 L 104.36 175.73 z M 104.36 271.73 C 99.938 271.73 96.359 275.31 96.359 279.73 L 96.359 295.73 C 96.359 300.15 99.938 303.73 104.36 303.73 L 344.36 303.73 C 348.78 303.73 352.36 300.15 352.36 295.73 L 352.36 279.73 C 352.36 275.31 348.78 271.73 344.36 271.73 L 104.36 271.73 z M 104.36 367.73 C 99.938 367.73 96.359 371.31 96.359 375.73 L 96.359 391.73 C 96.359 396.15 99.938 399.73 104.36 399.73 L 184.36 399.73 C 188.78 399.73 192.36 396.15 192.36 391.73 L 192.36 375.73 C 192.36 371.31 188.78 367.73 184.36 367.73 L 104.36 367.73 z',\n },\n sidePaneAnnotation: {\n width: 512,\n height: 512,\n path: 'M448 0H64C28.7 0 0 28.7 0 64v288c0 35.3 28.7 64 64 64h96v84c0 7.1 5.8 12 12 12 2.4 0 4.9-.7 7.1-2.4L304 416h144c35.3 0 64-28.7 64-64V64c0-35.3-28.7-64-64-64zm32 352c0 17.6-14.4 32-32 32H293.3l-8.5 6.4L192 460v-76H64c-17.6 0-32-14.4-32-32V64c0-17.6 14.4-32 32-32h384c17.6 0 32 14.4 32 32v288zM280 240H136c-4.4 0-8 3.6-8 8v16c0 4.4 3.6 8 8 8h144c4.4 0 8-3.6 8-8v-16c0-4.4-3.6-8-8-8zm96-96H136c-4.4 0-8 3.6-8 8v16c0 4.4 3.6 8 8 8h240c4.4 0 8-3.6 8-8v-16c0-4.4-3.6-8-8-8z',\n },\n sidePaneOutline: {\n width: 512,\n height: 512,\n path: 'M88 56H40a16 16 0 0 0-16 16v48a16 16 0 0 0 16 16h48a16 16 0 0 0 16-16V72a16 16 0 0 0-16-16zm0 160H40a16 16 0 0 0-16 16v48a16 16 0 0 0 16 16h48a16 16 0 0 0 16-16v-48a16 16 0 0 0-16-16zm0 160H40a16 16 0 0 0-16 16v48a16 16 0 0 0 16 16h48a16 16 0 0 0 16-16v-48a16 16 0 0 0-16-16zm416 24H168a8 8 0 0 0-8 8v16a8 8 0 0 0 8 8h336a8 8 0 0 0 8-8v-16a8 8 0 0 0-8-8zm0-320H168a8 8 0 0 0-8 8v16a8 8 0 0 0 8 8h336a8 8 0 0 0 8-8V88a8 8 0 0 0-8-8zm0 160H168a8 8 0 0 0-8 8v16a8 8 0 0 0 8 8h336a8 8 0 0 0 8-8v-16a8 8 0 0 0-8-8z',\n },\n annotation: {\n width: 512,\n height: 512,\n path: 'M256 64c123.5 0 224 79 224 176S379.5 416 256 416c-28.3 0-56.3-4.3-83.2-12.8l-15.2-4.8-13 9.2c-23 16.3-58.5 35.3-102.6 39.6 12-15.1 29.8-40.4 40.8-69.6l7.1-18.7-13.7-14.6C47.3 313.7 32 277.6 32 240c0-97 100.5-176 224-176m0-32C114.6 32 0 125.1 0 240c0 47.6 19.9 91.2 52.9 126.3C38 405.7 7 439.1 6.5 439.5c-6.6 7-8.4 17.2-4.6 26 3.8 8.8 12.4 14.5 22 14.5 61.5 0 110-25.7 139.1-46.3 29 9.1 60.2 14.3 93 14.3 141.4 0 256-93.1 256-208S397.4 32 256 32z',\n bg: 'M 256,32 C 114.6,32 0,125.1 0,240 0,287.6 19.9,331.2 52.9,366.3 38,405.7 7,439.1 6.5,439.5 c -6.6,7 -8.4,17.2 -4.6,26 3.8,8.8 12.4,14.5 22,14.5 61.5,0 110,-25.7 139.1,-46.3 29,9.1 60.2,14.3 93,14.3 141.4,0 256,-93.1 256,-208 C 512,125.1 397.4,32 256,32 Z',\n },\n highlighter: {\n width: 544,\n height: 512,\n path: 'M528.61 75.91l-60.49-60.52C457.91 5.16 444.45 0 430.98 0a52.38 52.38 0 0 0-34.75 13.15L110.59 261.8c-10.29 9.08-14.33 23.35-10.33 36.49l12.49 41.02-36.54 36.56c-6.74 6.75-6.74 17.68 0 24.43l.25.26L0 479.98 99.88 512l43.99-44.01.02.02c6.75 6.75 17.69 6.75 24.44 0l36.46-36.47 40.91 12.53c18.01 5.51 31.41-4.54 36.51-10.32l248.65-285.9c18.35-20.82 17.37-52.32-2.25-71.94zM91.05 475.55l-32.21-10.33 40.26-42.03 22.14 22.15-30.19 30.21zm167.16-62.99c-.63.72-1.4.94-2.32.94-.26 0-.54-.02-.83-.05l-40.91-12.53-18.39-5.63-39.65 39.67-46.85-46.88 39.71-39.72-5.6-18.38-12.49-41.02c-.34-1.13.01-2.36.73-3l44.97-39.15 120.74 120.8-39.11 44.95zm248.51-285.73L318.36 343.4l-117.6-117.66L417.4 37.15c4.5-3.97 17.55-9.68 28.1.88l60.48 60.52c7.65 7.65 8.04 20 .74 28.28z',\n bg: 'M 528.61,75.91 468.12,15.39 C 457.91,5.16 444.45,0 430.98,0 418.17896,-0.01016736 405.81733,4.6676871 396.23,13.15 L 110.59,261.8 c -10.29,9.08 -14.33,23.35 -10.33,36.49 l 12.49,41.02 -36.54,36.56 c -6.74,6.75 -6.74,17.68 0,24.43 l 0.25,0.26 L 0,479.98 99.88,512 l 43.99,-44.01 0.02,0.02 c 6.75,6.75 17.69,6.75 24.44,0 l 36.46,-36.47 40.91,12.53 c 18.01,5.51 31.41,-4.54 36.51,-10.32 l 248.65,-285.9 c 18.35,-20.82 17.37,-52.32 -2.25,-71.94 z',\n },\n rectangularHighlighter: {\n width: 512,\n height: 512,\n path: 'M486.4 128c14.14 0 25.6-11.46 25.6-25.6V25.6C512 11.46 500.54 0 486.4 0h-76.8C395.46 0 384 11.46 384 25.6V48H128V25.6C128 11.46 116.54 0 102.4 0H25.6C11.46 0 0 11.46 0 25.6v76.8C0 116.54 11.46 128 25.6 128H48v256H25.6C11.46 384 0 395.46 0 409.6v76.8C0 500.54 11.46 512 25.6 512h76.8c14.14 0 25.6-11.46 25.6-25.6V464h256v22.4c0 14.14 11.46 25.6 25.6 25.6h76.8c14.14 0 25.6-11.46 25.6-25.6v-76.8c0-14.14-11.46-25.6-25.6-25.6H464V128h22.4zM416 32h64v64h-64V32zM32 96V32h64v64H32zm64 384H32v-64h64v64zm384-64v64h-64v-64h64zm-48-32h-22.4c-14.14 0-25.6 11.46-25.6 25.6V432H128v-22.4c0-14.14-11.46-25.6-25.6-25.6H80V128h22.4c14.14 0 25.6-11.46 25.6-25.6V80h256v22.4c0 14.14 11.46 25.6 25.6 25.6H432v256z',\n },\n pencil: {\n width: 512,\n height: 512,\n path: 'M493.255 56.236l-37.49-37.49c-24.993-24.993-65.515-24.994-90.51 0L12.838 371.162.151 485.346c-1.698 15.286 11.22 28.203 26.504 26.504l114.184-12.687 352.417-352.417c24.992-24.994 24.992-65.517-.001-90.51zm-95.196 140.45L174 420.745V386h-48v-48H91.255l224.059-224.059 82.745 82.745zM126.147 468.598l-58.995 6.555-30.305-30.305 6.555-58.995L63.255 366H98v48h48v34.745l-19.853 19.853zm344.48-344.48l-49.941 49.941-82.745-82.745 49.941-49.941c12.505-12.505 32.748-12.507 45.255 0l37.49 37.49c12.506 12.506 12.507 32.747 0 45.255z',\n bg: 'm 493.255,56.236 -37.49,-37.49 c -24.993,-24.993 -65.515,-24.994 -90.51,0 L 12.838,371.162 0.151,485.346 c -1.698,15.286 11.22,28.203 26.504,26.504 L 140.839,499.163 493.256,146.746 c 24.992,-24.994 24.992,-65.517 -10e-4,-90.51 z',\n },\n freeText: {\n width: 512,\n height: 512,\n path: 'm 460,81 v 72 c 0,4.42 -3.58,8 -8,8 h -16 c -4.42,0 -8,-3.58 -8,-8 V 97 H 272 v 338 h 72 c 4.42,0 8,3.58 8,8 v 16 c 0,4.42 -3.58,8 -8,8 H 168 c -4.42,0 -8,-3.58 -8,-8 v -16 c 0,-4.42 3.58,-8 8,-8 h 72 V 97 H 84 v 56 c 0,4.42 -3.582,8 -8,8 H 60 c -4.418,0 -8,-3.58 -8,-8 V 81 c 0,-8.837 7.163,-16 16,-16 h 376 c 8.84,0 16,7.163 16,16 z',\n bg: 'M512 512H0V0h512v512z',\n },\n stamp: {\n width: 508,\n height: 512,\n path: 'm 333.71644,332.74589 h 121.26625 l 52.08896,87.08726 H 508.009 V 512.0005 H 0 V 419.83315 H 0.80598227 L 54.686486,332.74589 H 178.89175 V 241.68498 C 139.83419,229.2037 120.83357,188.0785 120.83357,122.28502 120.83357,50.03435 163.8049,8.54414 246.15327,0.3862 V 0 h 4.2226 14.81043 v 0.26345 c 83.1756,7.85642 126.58831,49.40078 126.58831,122.02157 0,65.79348 -19.00062,106.91868 -58.05817,119.39996 z m 0,26.85191 v 11.42093 l -0.57524,1.90136 c -7.77664,25.70458 -26.80014,40.76443 -54.91507,44.75071 -3.13022,0.44382 -6.37313,0.75038 -9.72577,0.91907 2e-5,0.0515 5e-5,0.10303 8e-5,0.15469 h -18.12457 -4.2226 c 0,-0.0231 0,-0.0462 0,-0.0693 -34.59286,-1.15044 -57.8689,-16.6105 -66.68629,-45.75514 l -0.57523,-1.90136 V 359.5978 H 70.109423 L 33.186454,419.83315 H 474.69705 l -35.1373,-60.23535 z m -72.20597,-332.75872 -5.41897,-0.0189 -4.95803,0.0158 C 180.53972,32.90225 147.68548,63.8059 147.68548,122.285 c 0,60.26373 16.08094,90.41551 46.87034,95.62098 l 11.18782,1.8915 v 147.12358 c 5.83066,16.85951 19.64352,24.97158 44.63223,24.97158 h 5.92822 5.92822 c 24.9887,0 38.80158,-8.11207 44.63222,-24.97158 V 219.79748 l 11.18782,-1.8915 c 30.7894,-5.20547 46.87035,-35.35725 46.87035,-95.62098 0,-58.46923 -32.84314,-89.37232 -103.41223,-95.44594 z M 26.96748,485.1486 H 481.04152 V 446.68506 H 26.96748 Z',\n bg: 'm 333.71644,332.74589 h 121.26625 l 52.08896,87.08726 H 508.009 V 512.0005 H 0 V 419.83315 H 0.80598227 L 54.686486,332.74589 H 178.89175 V 241.68498 C 139.83419,229.2037 120.83357,188.0785 120.83357,122.28502 120.83357,50.03435 163.8049,8.54414 246.15327,0.3862 V 0 h 4.2226 14.81043 v 0.26345 c 83.1756,7.85642 126.58831,49.40078 126.58831,122.02157 0,65.79348 -19.00062,106.91868 -58.05817,119.39996 z',\n },\n redaction: {\n width: 512,\n height: 512,\n path: 'M 256 341.332031 L 256 426.667969 L 64 426.667969 L 64 341.332031 Z M 448 384 L 448 405.332031 L 298.667969 405.332031 L 298.667969 384 Z M 448 213.332031 L 448 298.667969 L 64 298.667969 L 64 213.332031 Z M 448 85.332031 L 448 170.667969 L 256 170.667969 L 256 85.332031 Z M 213.332031 128 L 213.332031 149.332031 L 64 149.332031 L 64 128 Z M 213.332031 128',\n },\n rotate: {\n width: 512,\n height: 512,\n path: 'M492 8h-10c-6.627 0-12 5.373-12 12v110.625C426.804 57.047 346.761 7.715 255.207 8.001 118.82 8.428 7.787 120.009 8 256.396 8.214 393.181 119.166 504 256 504c63.926 0 122.202-24.187 166.178-63.908 5.113-4.618 5.354-12.561.482-17.433l-7.069-7.069c-4.503-4.503-11.749-4.714-16.482-.454C361.218 449.238 311.065 470 256 470c-117.744 0-214-95.331-214-214 0-117.744 95.331-214 214-214 82.862 0 154.737 47.077 190.289 116H332c-6.627 0-12 5.373-12 12v10c0 6.627 5.373 12 12 12h160c6.627 0 12-5.373 12-12V20c0-6.627-5.373-12-12-12z',\n },\n rotateLeft: {\n width: 512,\n height: 512,\n path: 'M20 8h10c6.627 0 12 5.373 12 12v110.625C85.196 57.047 165.239 7.715 256.793 8.001 393.18 8.428 504.213 120.009 504 256.396 503.786 393.181 392.834 504 256 504c-63.926 0-122.202-24.187-166.178-63.908-5.113-4.618-5.354-12.561-.482-17.433l7.069-7.069c4.503-4.503 11.749-4.714 16.482-.454C150.782 449.238 200.935 470 256 470c117.744 0 214-95.331 214-214 0-117.744-95.331-214-214-214-82.862 0-154.737 47.077-190.289 116H180c6.627 0 12 5.373 12 12v10c0 6.627-5.373 12-12 12H20c-6.627 0-12-5.373-12-12V20c0-6.627 5.373-12 12-12z',\n },\n rotateRight: {\n width: 512,\n height: 512,\n path: 'M492 8h-10c-6.627 0-12 5.373-12 12v110.625C426.804 57.047 346.761 7.715 255.207 8.001 118.82 8.428 7.787 120.009 8 256.396 8.214 393.181 119.166 504 256 504c63.926 0 122.202-24.187 166.178-63.908 5.113-4.618 5.354-12.561.482-17.433l-7.069-7.069c-4.503-4.503-11.749-4.714-16.482-.454C361.218 449.238 311.065 470 256 470c-117.744 0-214-95.331-214-214 0-117.744 95.331-214 214-214 82.862 0 154.737 47.077 190.289 116H332c-6.627 0-12 5.373-12 12v10c0 6.627 5.373 12 12 12h160c6.627 0 12-5.373 12-12V20c0-6.627-5.373-12-12-12z',\n },\n close: {\n width: 320,\n height: 512,\n path: 'M193.94 256L296.5 153.44l21.15-21.15c3.12-3.12 3.12-8.19 0-11.31l-22.63-22.63c-3.12-3.12-8.19-3.12-11.31 0L160 222.06 36.29 98.34c-3.12-3.12-8.19-3.12-11.31 0L2.34 120.97c-3.12 3.12-3.12 8.19 0 11.31L126.06 256 2.34 379.71c-3.12 3.12-3.12 8.19 0 11.31l22.63 22.63c3.12 3.12 8.19 3.12 11.31 0L160 289.94 262.56 392.5l21.15 21.15c3.12 3.12 8.19 3.12 11.31 0l22.63-22.63c3.12-3.12 3.12-8.19 0-11.31L193.94 256z',\n },\n options: {\n width: 512,\n height: 512,\n path: 'M482.696 299.276l-32.61-18.827a195.168 195.168 0 0 0 0-48.899l32.61-18.827c9.576-5.528 14.195-16.902 11.046-27.501-11.214-37.749-31.175-71.728-57.535-99.595-7.634-8.07-19.817-9.836-29.437-4.282l-32.562 18.798a194.125 194.125 0 0 0-42.339-24.48V38.049c0-11.13-7.652-20.804-18.484-23.367-37.644-8.909-77.118-8.91-114.77 0-10.831 2.563-18.484 12.236-18.484 23.367v37.614a194.101 194.101 0 0 0-42.339 24.48L105.23 81.345c-9.621-5.554-21.804-3.788-29.437 4.282-26.36 27.867-46.321 61.847-57.535 99.595-3.149 10.599 1.47 21.972 11.046 27.501l32.61 18.827a195.168 195.168 0 0 0 0 48.899l-32.61 18.827c-9.576 5.528-14.195 16.902-11.046 27.501 11.214 37.748 31.175 71.728 57.535 99.595 7.634 8.07 19.817 9.836 29.437 4.283l32.562-18.798a194.08 194.08 0 0 0 42.339 24.479v37.614c0 11.13 7.652 20.804 18.484 23.367 37.645 8.909 77.118 8.91 114.77 0 10.831-2.563 18.484-12.236 18.484-23.367v-37.614a194.138 194.138 0 0 0 42.339-24.479l32.562 18.798c9.62 5.554 21.803 3.788 29.437-4.283 26.36-27.867 46.321-61.847 57.535-99.595 3.149-10.599-1.47-21.972-11.046-27.501zm-65.479 100.461l-46.309-26.74c-26.988 23.071-36.559 28.876-71.039 41.059v53.479a217.145 217.145 0 0 1-87.738 0v-53.479c-33.621-11.879-43.355-17.395-71.039-41.059l-46.309 26.74c-19.71-22.09-34.689-47.989-43.929-75.958l46.329-26.74c-6.535-35.417-6.538-46.644 0-82.079l-46.329-26.74c9.24-27.969 24.22-53.869 43.929-75.969l46.309 26.76c27.377-23.434 37.063-29.065 71.039-41.069V44.464a216.79 216.79 0 0 1 87.738 0v53.479c33.978 12.005 43.665 17.637 71.039 41.069l46.309-26.76c19.709 22.099 34.689 47.999 43.929 75.969l-46.329 26.74c6.536 35.426 6.538 46.644 0 82.079l46.329 26.74c-9.24 27.968-24.219 53.868-43.929 75.957zM256 160c-52.935 0-96 43.065-96 96s43.065 96 96 96 96-43.065 96-96-43.065-96-96-96zm0 160c-35.29 0-64-28.71-64-64s28.71-64 64-64 64 28.71 64 64-28.71 64-64 64z',\n },\n delete: {\n width: 512,\n height: 512,\n path: 'M368 64l-33.6-44.8C325.3 7.1 311.1 0 296 0h-80c-15.1 0-29.3 7.1-38.4 19.2L144 64H40c-13.3 0-24 10.7-24 24v2c0 3.3 2.7 6 6 6h20.9l33.2 372.3C78.3 493 99 512 123.9 512h264.2c24.9 0 45.6-19 47.8-43.7L469.1 96H490c3.3 0 6-2.7 6-6v-2c0-13.3-10.7-24-24-24H368zM216 32h80c5 0 9.8 2.4 12.8 6.4L328 64H184l19.2-25.6c3-4 7.8-6.4 12.8-6.4zm188 433.4c-.7 8.3-7.6 14.6-15.9 14.6H123.9c-8.3 0-15.2-6.3-15.9-14.6L75 96h362l-33 369.4z',\n },\n copy: {\n width: 448,\n height: 512,\n path: 'M433.941 65.941l-51.882-51.882A48 48 0 0 0 348.118 0H176c-26.51 0-48 21.49-48 48v48H48c-26.51 0-48 21.49-48 48v320c0 26.51 21.49 48 48 48h224c26.51 0 48-21.49 48-48v-48h80c26.51 0 48-21.49 48-48V99.882a48 48 0 0 0-14.059-33.941zM352 32.491a15.88 15.88 0 0 1 7.431 4.195l51.882 51.883A15.885 15.885 0 0 1 415.508 96H352V32.491zM288 464c0 8.822-7.178 16-16 16H48c-8.822 0-16-7.178-16-16V144c0-8.822 7.178-16 16-16h80v240c0 26.51 21.49 48 48 48h112v48zm128-96c0 8.822-7.178 16-16 16H176c-8.822 0-16-7.178-16-16V48c0-8.822 7.178-16 16-16h144v72c0 13.2 10.8 24 24 24h72v240z',\n },\n created: {\n width: 448,\n height: 512,\n path: 'M400 64c8.8 0 16 7.2 16 16v352c0 8.8-7.2 16-16 16H48c-8.8 0-16-7.2-16-16V80c0-8.8 7.2-16 16-16h352m0-32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zm-60 206h-98v-98c0-6.6-5.4-12-12-12h-12c-6.6 0-12 5.4-12 12v98h-98c-6.6 0-12 5.4-12 12v12c0 6.6 5.4 12 12 12h98v98c0 6.6 5.4 12 12 12h12c6.6 0 12-5.4 12-12v-98h98c6.6 0 12-5.4 12-12v-12c0-6.6-5.4-12-12-12z',\n },\n pen: {\n width: 512,\n height: 512,\n path: 'M493.25 56.26l-37.51-37.51C443.25 6.25 426.87 0 410.49 0s-32.76 6.25-45.26 18.74L12.85 371.12.15 485.34C-1.45 499.72 9.88 512 23.95 512c.89 0 1.78-.05 2.69-.15l114.14-12.61 352.48-352.48c24.99-24.99 24.99-65.51-.01-90.5zM126.09 468.68l-93.03 10.31 10.36-93.17 263.89-263.89 82.77 82.77-263.99 263.98zm344.54-344.54l-57.93 57.93-82.77-82.77 57.93-57.93c6.04-6.04 14.08-9.37 22.63-9.37 8.55 0 16.58 3.33 22.63 9.37l37.51 37.51c12.47 12.48 12.47 32.78 0 45.26z',\n },\n rectangle: {\n width: 512,\n height: 512,\n path: 'M480 32v448H32V32h448m32-32H0v512h512V0z',\n bg: 'M 512,0 H 0 v 512 h 512 z',\n },\n circle: {\n width: 512,\n height: 512,\n path: 'M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm216 248c0 118.7-96.1 216-216 216-118.7 0-216-96.1-216-216 0-118.7 96.1-216 216-216 118.7 0 216 96.1 216 216z',\n bg: 'M 256,8 C 119,8 8,119 8,256 8,393 119,504 256,504 393,504 504,393 504,256 504,119 393,8 256,8 Z',\n },\n circleDashed: {\n width: 512,\n height: 512,\n path: 'M 217.9 10.91 C 177.84 17.083 140.95 32.842 109.64 55.766 L 132.58 78.705 C 157.62 61.229 186.56 48.91 217.9 43.344 L 217.9 10.91 z M 294.09 10.91 L 294.09 43.355 C 325.33 48.924 354.3 61.224 379.41 78.725 L 402.36 55.773 C 371.05 32.849 334.16 17.082 294.09 10.91 z M 55.77 109.64 C 32.851 140.96 17.095 177.84 10.922 217.9 L 43.365 217.9 C 48.935 186.67 61.234 157.71 78.729 132.6 L 55.77 109.64 z M 456.24 109.65 L 433.3 132.58 C 450.77 157.62 463.09 186.56 468.66 217.9 L 501.08 217.9 C 494.91 177.84 479.16 140.95 456.24 109.65 z M 10.92 294.09 C 17.096 334.15 32.846 371.05 55.771 402.36 L 78.707 379.43 C 61.228 354.38 48.91 325.43 43.342 294.09 L 10.92 294.09 z M 468.64 294.09 C 463.07 325.33 450.77 354.29 433.27 379.4 L 456.23 402.36 C 479.15 371.04 494.91 334.15 501.08 294.09 L 468.64 294.09 z M 132.6 433.28 L 109.65 456.23 C 140.96 479.15 177.84 494.92 217.9 501.09 L 217.9 468.64 C 186.67 463.07 157.71 450.77 132.6 433.28 z M 379.42 433.29 C 354.38 450.77 325.44 463.09 294.09 468.66 L 294.09 501.09 C 334.15 494.92 371.05 479.16 402.36 456.23 L 379.42 433.29 z',\n },\n shapes: {\n width: 512,\n height: 512,\n path: 'M480 288H320c-17.67 0-32 14.33-32 32v160c0 17.67 14.33 32 32 32h160c17.67 0 32-14.33 32-32V320c0-17.67-14.33-32-32-32zm0 192H320V320h160v160zM128 256C57.31 256 0 313.31 0 384s57.31 128 128 128 128-57.31 128-128-57.31-128-128-128zm0 224c-52.93 0-96-43.07-96-96 0-52.94 43.07-96 96-96 52.94 0 96 43.06 96 96 0 52.93-43.06 96-96 96zm378.98-278.86L400.07 18.29C392.95 6.1 380.47 0 368 0s-24.95 6.1-32.07 18.29L229.02 201.14c-14.26 24.38 3.56 54.86 32.07 54.86h213.82c28.51 0 46.33-30.48 32.07-54.86zm-27.6 20.39c-.94 1.64-2.45 2.47-4.47 2.47H261.09c-2.02 0-3.53-.83-4.47-2.47-1.21-2.12-.35-3.6.02-4.23L363.55 34.44c.95-1.62 2.44-2.44 4.45-2.44s3.5.82 4.45 2.44L479.36 217.3c.37.63 1.24 2.11.02 4.23z',\n },\n image: {\n width: 512,\n height: 512,\n path: 'M464 64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V112c0-26.51-21.49-48-48-48zm16 336c0 8.822-7.178 16-16 16H48c-8.822 0-16-7.178-16-16V112c0-8.822 7.178-16 16-16h416c8.822 0 16 7.178 16 16v288zM112 232c30.928 0 56-25.072 56-56s-25.072-56-56-56-56 25.072-56 56 25.072 56 56 56zm0-80c13.234 0 24 10.766 24 24s-10.766 24-24 24-24-10.766-24-24 10.766-24 24-24zm207.029 23.029L224 270.059l-31.029-31.029c-9.373-9.373-24.569-9.373-33.941 0l-88 88A23.998 23.998 0 0 0 64 344v28c0 6.627 5.373 12 12 12h360c6.627 0 12-5.373 12-12v-92c0-6.365-2.529-12.47-7.029-16.971l-88-88c-9.373-9.372-24.569-9.372-33.942 0zM416 352H96v-4.686l80-80 48 48 112-112 80 80V352z',\n },\n pageLayoutMode0: {\n width: 800,\n height: 512,\n path: 'M 287.48 56 C 266.77 56.079 249.97 72.872 249.97 93.57 L 249.97 418.51 C 249.97 439.21 266.77 456 287.48 456 L 512.52 456 C 533.23 456 550.03 439.21 550.03 418.51 L 550.03 159.1 C 550.03 149.18 546.04 139.58 539.01 132.55 L 473.45 67.016 C 466.42 59.984 456.88 56 446.96 56 L 287.48 56 z M 287.48 81.072 L 425 81.072 L 425 162.31 C 425 172.7 433.36 181.05 443.76 181.05 L 525.03 181.05 L 525.03 418.51 L 525.02 418.51 C 525.02 425.38 519.39 431.01 512.52 431.01 L 287.48 431.01 C 280.6 431.01 274.97 425.38 274.97 418.51 L 274.97 93.57 C 274.97 86.697 280.6 81.072 287.48 81.072 z M 450.01 81.465 C 452.2 82.012 454.15 83.104 455.79 84.744 L 521.35 150.28 C 522.99 151.92 524.09 153.87 524.63 156.06 L 450.01 156.06 L 450.01 81.465 z',\n },\n pageLayoutMode1: {\n width: 800,\n height: 512,\n path: 'M 249.97 -7.6191 L 249.97 162.51 C 249.97 183.21 266.77 200 287.48 200 L 512.52 200 C 533.23 200 550.03 183.21 550.03 162.51 L 550.03 -7.6191 L 525.03 -7.6191 L 525.03 162.51 L 525.02 162.51 C 525.02 169.38 519.4 175.01 512.52 175.01 L 287.48 175.01 C 280.6 175.01 274.98 169.38 274.98 162.51 L 274.98 -7.6191 L 249.97 -7.6191 z M 287.48 312 C 266.77 312.08 249.97 328.87 249.97 349.57 L 249.97 523.16 L 274.98 523.16 L 274.98 349.57 C 274.98 342.7 280.6 337.07 287.48 337.07 L 425.01 337.07 L 425.01 418.31 C 425.01 428.7 433.36 437.05 443.76 437.05 L 525.03 437.05 L 525.03 523.16 L 550.03 523.16 L 550.03 415.1 C 550.03 405.18 546.04 395.58 539.01 388.55 L 473.45 323.01 C 466.42 315.98 456.88 312 446.96 312 L 287.48 312 z M 450.01 337.46 C 452.2 338.01 454.15 339.1 455.79 340.74 L 521.35 406.28 C 522.99 407.92 524.09 409.87 524.63 412.06 L 450.01 412.06 L 450.01 337.46 z',\n },\n pageLayoutMode2: {\n width: 800,\n height: 512,\n path: 'M 49.971 0.5293 L 49.971 162.51 C 49.971 183.21 66.771 200 87.479 200 L 312.52 200 C 333.23 200 350.03 183.21 350.03 162.51 L 350.03 0.5293 L 325.02 0.5293 L 325.02 162.51 C 325.02 169.38 319.39 175.01 312.52 175.01 L 87.479 175.01 C 80.602 175.01 74.975 169.38 74.975 162.51 L 74.975 0.5293 L 49.971 0.5293 z M 449.97 0.53906 L 449.97 162.51 C 449.97 183.21 466.77 200 487.48 200 L 712.52 200 C 733.23 200 750.03 183.21 750.03 162.51 L 750.03 0.53906 L 725.03 0.53906 L 725.03 162.51 L 725.02 162.51 C 725.02 169.38 719.39 175.01 712.52 175.01 L 487.48 175.01 C 480.6 175.01 474.97 169.38 474.97 162.51 L 474.97 0.53906 L 449.97 0.53906 z M 87.479 312 C 66.772 312.08 49.971 328.87 49.971 349.57 L 49.971 511.69 L 74.975 511.69 L 74.975 349.57 C 74.975 342.7 80.602 337.07 87.479 337.07 L 225 337.07 L 225 418.31 C 225 428.7 233.36 437.05 243.76 437.05 L 325.02 437.05 L 325.02 511.69 L 350.03 511.69 L 350.03 415.1 C 350.03 405.18 346.04 395.58 339.01 388.55 L 273.45 323.01 C 266.42 315.98 256.88 312 246.96 312 L 87.479 312 z M 487.48 312 C 466.77 312.08 449.97 328.87 449.97 349.57 L 449.97 511.67 L 474.97 511.67 L 474.97 349.57 C 474.97 342.7 480.6 337.07 487.48 337.07 L 625 337.07 L 625 418.31 C 625 428.7 633.36 437.05 643.76 437.05 L 725.03 437.05 L 725.03 511.67 L 750.03 511.67 L 750.03 415.1 C 750.03 405.18 746.04 395.58 739.01 388.55 L 673.45 323.01 C 666.42 315.98 656.88 312 646.96 312 L 487.48 312 z M 250.01 337.46 C 252.2 338.01 254.15 339.1 255.79 340.74 L 321.35 406.28 C 322.99 407.92 324.09 409.87 324.63 412.06 L 250.01 412.06 L 250.01 337.46 z M 650.01 337.46 C 652.2 338.01 654.15 339.1 655.79 340.74 L 721.35 406.28 C 722.99 407.92 724.09 409.87 724.63 412.06 L 650.01 412.06 L 650.01 337.46 z',\n },\n pageLayoutMode3: {\n width: 800,\n height: 512,\n path: 'M 449.97 0.48047 L 449.97 162.51 C 449.97 183.21 466.77 200 487.48 200 L 712.52 200 C 733.23 200 750.03 183.21 750.03 162.51 L 750.03 0.48047 L 725.03 0.48047 L 725.03 162.51 L 725.02 162.51 C 725.02 169.38 719.39 175.01 712.52 175.01 L 487.48 175.01 C 480.6 175.01 474.97 169.38 474.97 162.51 L 474.97 0.48047 L 449.97 0.48047 z M 87.479 312 C 66.772 312.08 49.971 328.87 49.971 349.57 L 49.971 511.89 L 74.975 511.89 L 74.975 349.57 C 74.975 342.7 80.602 337.07 87.479 337.07 L 225 337.07 L 225 418.31 C 225 428.7 233.36 437.05 243.76 437.05 L 325.02 437.05 L 325.02 511.89 L 350.03 511.89 L 350.03 415.1 C 350.03 405.18 346.04 395.58 339.01 388.55 L 273.45 323.01 C 266.42 315.98 256.88 312 246.96 312 L 87.479 312 z M 487.48 312 C 466.77 312.08 449.97 328.87 449.97 349.57 L 449.97 511.93 L 474.97 511.93 L 474.97 349.57 C 474.97 342.7 480.6 337.07 487.48 337.07 L 625 337.07 L 625 418.31 C 625 428.7 633.36 437.05 643.76 437.05 L 725.03 437.05 L 725.03 511.93 L 750.03 511.93 L 750.03 415.1 C 750.03 405.18 746.04 395.58 739.01 388.55 L 673.45 323.01 C 666.42 315.98 656.88 312 646.96 312 L 487.48 312 z M 250.01 337.46 C 252.2 338.01 254.15 339.1 255.79 340.74 L 321.35 406.28 C 322.99 407.92 324.09 409.87 324.63 412.06 L 250.01 412.06 L 250.01 337.46 z M 650.01 337.46 C 652.2 338.01 654.15 339.1 655.79 340.74 L 721.35 406.28 C 722.99 407.92 724.09 409.87 724.63 412.06 L 650.01 412.06 L 650.01 337.46 z',\n },\n pageLayoutMode4: {\n width: 800,\n height: 512,\n path: 'M 87.479 55.998 C 66.772 56.077 49.971 72.871 49.971 93.57 L 49.971 418.51 C 49.971 439.2 66.771 456 87.479 456 L 312.52 456 C 333.23 456 350.03 439.2 350.03 418.51 L 350.03 159.1 C 350.03 149.18 346.04 139.58 339.01 132.55 L 273.45 67.014 C 266.42 59.983 256.88 55.998 246.96 55.998 L 87.479 55.998 z M 487.48 55.998 C 466.77 56.077 449.97 72.87 449.97 93.568 L 449.97 418.51 C 449.97 439.2 466.77 456 487.48 456 L 712.52 456 C 733.23 456 750.03 439.2 750.03 418.51 L 750.03 159.1 C 750.03 149.18 746.04 139.58 739.01 132.55 L 673.45 67.014 C 666.42 59.983 656.88 55.998 646.96 55.998 L 487.48 55.998 z M 87.479 81.072 L 225 81.072 L 225 162.31 C 225 172.7 233.36 181.05 243.76 181.05 L 325.02 181.05 L 325.02 418.5 C 325.02 425.38 319.39 431.01 312.52 431.01 L 87.479 431.01 C 80.602 431.01 74.975 425.38 74.975 418.51 L 74.975 93.57 C 74.975 86.697 80.602 81.072 87.479 81.072 z M 487.48 81.072 L 625 81.072 L 625 162.31 C 625 172.7 633.36 181.05 643.76 181.05 L 725.03 181.05 L 725.03 418.5 L 725.02 418.5 C 725.02 425.38 719.39 431.01 712.52 431.01 L 487.48 431.01 C 480.6 431.01 474.97 425.38 474.97 418.51 L 474.97 93.57 C 474.97 86.697 480.6 81.072 487.48 81.072 z M 250.01 81.463 C 252.2 82.01 254.15 83.104 255.79 84.744 L 321.35 150.28 C 322.99 151.92 324.09 153.87 324.63 156.06 L 250.01 156.06 L 250.01 81.463 z M 650.01 81.463 C 652.2 82.01 654.15 83.104 655.79 84.744 L 721.35 150.28 C 722.99 151.92 724.09 153.87 724.63 156.06 L 650.01 156.06 L 650.01 81.463 z',\n },\n pageLayoutMode5: {\n width: 800,\n height: 512,\n path: 'M739.01,132.548l-65.561-65.533C666.416,59.983,656.885,56,646.961,56H487.479c-20.707,0.079-37.508,16.872-37.508,37.57 v324.937c0,20.698,16.799,37.494,37.508,37.494h225.043c20.707,0,37.508-16.796,37.508-37.494V159.104 C750.029,149.184,746.041,139.578,739.01,132.548z M650.008,81.464c2.188,0.547,4.143,1.641,5.781,3.281l65.563,65.533 c1.643,1.641,2.734,3.593,3.279,5.779h-74.623V81.464z M725.025,418.505c-0.002,6.878-5.631,12.501-12.506,12.501H487.479 c-6.877,0-12.504-5.623-12.504-12.499V93.57c0-6.873,5.627-12.497,12.504-12.497h137.525v81.233 c0,10.389,8.361,18.745,18.756,18.745h81.266V418.505z',\n },\n closeFile: {\n width: 384,\n height: 512,\n path: 'M369.9,97.9,286,14A48,48,0,0,0,252.1-.1H48A48.16,48.16,0,0,0,0,48V464a48,48,0,0,0,48,48H336a48,48,0,0,0,48-48V131.9A48.23,48.23,0,0,0,369.9,97.9Zm-22.6,22.7a15.73,15.73,0,0,1,4.2,7.4H256V32.5a15.73,15.73,0,0,1,7.4,4.2ZM336,480H48a16,16,0,0,1-16-16V48A16,16,0,0,1,48,32H224V136a23.94,23.94,0,0,0,24,24H352V464A16,16,0,0,1,336,480ZM262.71,369.05l-5.66,5.66a12,12,0,0,1-17,0L192,326.63l-48.08,48.08a12,12,0,0,1-17,0l-5.66-5.66a12,12,0,0,1,0-17L169.37,304l-48.08-48.08a12,12,0,0,1,0-17l5.66-5.66a12,12,0,0,1,17,0L192,281.37l48.08-48.08a12,12,0,0,1,17,0l5.66,5.66a12,12,0,0,1,0,17L214.63,304l48.08,48.08A12,12,0,0,1,262.71,369.05Z',\n },\n bars: {\n width: 448,\n height: 512,\n path: 'M442 114H6a6 6 0 0 1-6-6V84a6 6 0 0 1 6-6h436a6 6 0 0 1 6 6v24a6 6 0 0 1-6 6zm0 160H6a6 6 0 0 1-6-6v-24a6 6 0 0 1 6-6h436a6 6 0 0 1 6 6v24a6 6 0 0 1-6 6zm0 160H6a6 6 0 0 1-6-6v-24a6 6 0 0 1 6-6h436a6 6 0 0 1 6 6v24a6 6 0 0 1-6 6z',\n },\n};\n","export const getKeyboardCommands = (e, shortcuts, excludeNodeTypes = ['INPUT', 'SELECT', 'TEXTAREA']) => {\n if (!shortcuts || excludeNodeTypes.includes(e.target.nodeName)) {\n return [];\n }\n let cmd = [];\n Object.keys(shortcuts).forEach((sc) => {\n const keybinding = shortcuts[sc];\n if (keybinding) {\n const key = e.key.length > 1 ? e.key : e.key.toLowerCase();\n if (key === keybinding.key &&\n e.altKey === Boolean(keybinding.altKey) &&\n e.ctrlKey === Boolean(keybinding.ctrlKey) &&\n e.shiftKey === Boolean(keybinding.shiftKey)) {\n cmd.push([sc, shortcuts[sc].superKey]);\n }\n }\n });\n return cmd;\n};\n","import { createPdfTime } from '../common/Tools';\nexport function addHistoryEntry(annotation, type, author, content, subject) {\n let data = {};\n if (annotation.privateData) {\n data = JSON.parse(annotation.privateData);\n }\n else {\n data = {\n 'PDF Tools AG': {},\n };\n }\n if (!data.hasOwnProperty('PDF Tools AG')) {\n data['PDF Tools AG'] = {};\n }\n if (!data['PDF Tools AG'].hasOwnProperty('Private')) {\n data['PDF Tools AG'].Private = {};\n }\n if (!data['PDF Tools AG'].Private.hasOwnProperty('History')) {\n data['PDF Tools AG'].Private.History = [];\n }\n data['PDF Tools AG'].Private.LastModified = createPdfTime();\n const historyItem = {\n D: createPdfTime(),\n T: `(${author})`,\n };\n if (type === 'create') {\n historyItem.Type = '/Create';\n }\n else if (type === 'edit') {\n historyItem.Type = '/Edit';\n historyItem.params = [];\n if (content !== null && annotation.content !== content) {\n historyItem.params.push('/Contents');\n historyItem.params.push(`(${content})`);\n }\n if (subject !== null && annotation.subject !== subject) {\n historyItem.params.push('/Subj');\n historyItem.params.push(`(${subject})`);\n }\n if (historyItem.params.length === 0) {\n return;\n }\n }\n else if (type === 'lock') {\n historyItem.Type = '/Lock';\n }\n else if (type === 'unlock') {\n historyItem.Type = '/Unlock';\n }\n else if (type === 'delete') {\n historyItem.Type = '/Delete';\n annotation.popup.isOpen = false;\n }\n if (historyItem) {\n data['PDF Tools AG'].Private.History.push(historyItem);\n }\n annotation.privateData = JSON.stringify(data);\n}\n","import { addHistoryEntry } from '../custom/history';\nexport class CanvasLayer {\n constructor(module, name, containerElement, store, pdfApi, pdfViewerCanvas, options) {\n this.canvasContexts = [];\n this.htmlLayers = [];\n this.containerElement = containerElement;\n this.store = store;\n this.pdfApi = pdfApi;\n this.pdfViewerCanvas = pdfViewerCanvas;\n this.options = options;\n this.module = module;\n this.name = name;\n this.remove = this.remove.bind(this);\n this.onAnnotationCreated = this.onAnnotationCreated.bind(this);\n }\n resize(width, height) {\n const tempCanvas = document.createElement('canvas');\n tempCanvas.width = width * devicePixelRatio;\n tempCanvas.height = height * devicePixelRatio;\n const tempContext = tempCanvas.getContext('2d');\n this.canvasContexts.forEach((ctx) => {\n tempContext.drawImage(ctx.canvas, 0, 0);\n ctx.canvas.style.width = width + 'px';\n ctx.canvas.style.height = height + 'px';\n ctx.canvas.width = width * devicePixelRatio;\n ctx.canvas.height = height * devicePixelRatio;\n ctx.drawImage(tempContext.canvas, 0, 0);\n });\n }\n remove() {\n this.module.removeCanvasLayer(this.name);\n }\n createHtmlLayer() {\n const element = document.createElement('div');\n this.htmlLayers.push(element);\n if (this.containerElement) {\n this.containerElement.appendChild(element);\n }\n return element;\n }\n createCanvas() {\n const element = document.createElement('canvas');\n element.style.position = 'absolute';\n element.style.top = '0';\n element.style.left = '0';\n element.style.right = '0';\n element.style.bottom = '0';\n const context = element.getContext('2d');\n this.canvasContexts.push(context);\n if (this.containerElement) {\n this.containerElement.appendChild(element);\n const rect = this.containerElement.getBoundingClientRect();\n context.canvas.width = rect.width * devicePixelRatio;\n context.canvas.height = rect.height * devicePixelRatio;\n context.canvas.style.width = rect.width + 'px';\n context.canvas.style.height = rect.height + 'px';\n }\n return context;\n }\n removeHtmlElements() {\n if (this.containerElement) {\n for (let i = 0; i < this.htmlLayers.length; i++) {\n this.containerElement.removeChild(this.htmlLayers[i]);\n }\n this.htmlLayers = [];\n }\n }\n removeCanvasElements() {\n if (this.containerElement) {\n for (let i = 0; i < this.canvasContexts.length; i++) {\n this.containerElement.removeChild(this.canvasContexts[i].canvas);\n }\n this.canvasContexts = [];\n }\n }\n onAnnotationCreated(annotation) {\n if (this.options.annotation.trackHistory) {\n addHistoryEntry(annotation, 'create', this.options.viewer.general.user);\n return this.pdfApi.updateItem(annotation);\n }\n return new Promise((resolve) => resolve(annotation));\n }\n}\n","export var CanvasModuleType;\n(function (CanvasModuleType) {\n CanvasModuleType[CanvasModuleType[\"Tool\"] = 0] = \"Tool\";\n CanvasModuleType[CanvasModuleType[\"Layer\"] = 1] = \"Layer\";\n})(CanvasModuleType || (CanvasModuleType = {}));\nexport class CanvasModule {\n constructor() {\n this.canvasLayers = {};\n this.store = null;\n this.pdfApi = null;\n this.pdfViewerCanvas = null;\n this.options = null;\n this.name = null;\n this.containerElement = null;\n this.createCanvasLayer = this.createCanvasLayer.bind(this);\n this.removeCanvasLayer = this.removeCanvasLayer.bind(this);\n }\n register(containerElement, store, pdfApi, pdfViewerCanvas, options) {\n this.containerElement = containerElement;\n this.store = store;\n this.pdfApi = pdfApi;\n this.pdfViewerCanvas = pdfViewerCanvas;\n this.options = options;\n return this.onRegister();\n }\n render(timestamp, state) {\n const keys = Object.keys(this.canvasLayers);\n for (let i = 0; i < keys.length; i++) {\n this.canvasLayers[keys[i]].render(timestamp, state);\n }\n }\n deactivate() {\n const keys = Object.keys(this.canvasLayers);\n for (let i = 0; i < keys.length; i++) {\n const name = keys[i];\n this.canvasLayers[name].onRemove();\n delete this.canvasLayers[name];\n }\n }\n resize(width, height) {\n const keys = Object.keys(this.canvasLayers);\n for (let i = 0; i < keys.length; i++) {\n this.canvasLayers[keys[i]].resize(width, height);\n }\n }\n getCanvasSize() {\n const rect = {\n width: 0,\n height: 0,\n };\n if (this.containerElement !== null) {\n const clientRect = this.containerElement.getBoundingClientRect();\n rect.width = clientRect.width;\n rect.height = clientRect.height;\n }\n return rect;\n }\n onSave() {\n const promise = new Promise((resolve, reject) => {\n const keys = Object.keys(this.canvasLayers);\n const promises = [];\n for (let i = 0; i < keys.length; i++) {\n promises.push(this.canvasLayers[keys[i]].onSave());\n }\n Promise.all(promises)\n .then(() => {\n resolve();\n })\n .catch((error) => {\n reject('OnSave failed on a canvas layer: ' + error);\n });\n });\n return promise;\n }\n createCanvasLayer(name, canvasLayer, args) {\n if (this.containerElement &&\n this.store &&\n this.pdfApi &&\n this.pdfViewerCanvas &&\n this.options) {\n if (this.canvasLayers[name]) {\n throw new Error('duplicate canvas layer name');\n }\n const layer = new canvasLayer(this, name, this.containerElement, this.store, this.pdfApi, this.pdfViewerCanvas, this.options);\n this.canvasLayers[name] = layer;\n layer.onCreate(args);\n }\n else {\n throw new Error('canvas layer is not registered');\n }\n }\n removeCanvasLayer(name) {\n if (this.canvasLayers[name]) {\n this.canvasLayers[name].onRemove();\n delete this.canvasLayers[name];\n }\n }\n}\n","import { CanvasLayer } from '../CanvasLayer';\nimport { PdfItemType } from '../../pdf-viewer-api/';\nimport { CursorStyle } from '../../pdf-viewer-canvas/state/viewer';\nimport { createEraserToolbar } from './EraserToolbar';\nconst moduleLayerName = 'EraserTool';\nexport class EraserLayer extends CanvasLayer {\n constructor() {\n super(...arguments);\n this.context = null;\n this.eraserRadius = this.options.annotation.eraserRadius;\n }\n onCreate(args) {\n this.setEraserRadius = this.setEraserRadius.bind(this);\n this.remove = this.remove.bind(this);\n this.context = this.createCanvas();\n const toolbarElement = this.module.toolbarElement;\n createEraserToolbar({\n radius: this.eraserRadius,\n onRadiusChanged: this.setEraserRadius,\n onCancel: this.remove,\n }, toolbarElement);\n this.store.viewer.beginModule(moduleLayerName);\n }\n onRemove() {\n this.removeCanvasElements();\n this.context = null;\n const toolbarElement = this.module.toolbarElement;\n toolbarElement.innerHTML = '';\n this.store.viewer.endModule(moduleLayerName);\n }\n onSave() {\n return new Promise((resolve) => {\n return resolve();\n });\n }\n render(timestamp, state) {\n var _a;\n if (state.viewer.modeChanged && state.viewer.selectedModuleName !== moduleLayerName) {\n this.remove();\n return;\n }\n const pointerPos = {\n x: state.pointer.x.devicePixels,\n y: state.pointer.y.devicePixels,\n };\n const pointerPdfPos = this.pdfApi.transformScreenPointToPdfPoint(pointerPos);\n const cursorStyle = pointerPdfPos.isOnPage ? CursorStyle.NONE : CursorStyle.NOT_ALLOWED;\n this.store.viewer.setCursorStyle(cursorStyle);\n const ctx = this.context;\n if (ctx) {\n ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);\n if (pointerPdfPos.isOnPage) {\n ctx.save();\n ctx.lineWidth = 1;\n if (this.eraserRadius >= 8) {\n ctx.setLineDash([4 * devicePixelRatio, 4 * devicePixelRatio]);\n }\n ctx.beginPath();\n ctx.arc(pointerPos.x, pointerPos.y, (this.eraserRadius * devicePixelRatio) / 2, 0, 2 * Math.PI);\n ctx.stroke();\n ctx.restore();\n }\n }\n if (!pointerPdfPos.isOnPage || state.pointer.action !== 'click') {\n return;\n }\n const inkAnnotations = (_a = this.pdfApi\n .getAnnotationsOnPoint(pointerPos)) === null || _a === void 0 ? void 0 : _a.filter((a) => a.itemType === PdfItemType.INK);\n if (!inkAnnotations) {\n return;\n }\n const annot = this.deleteFirstInkLineCloseToPoint(inkAnnotations, pointerPdfPos.pdfPoint);\n if (annot) {\n this.updateInkAnnotation(annot);\n }\n }\n setEraserRadius(radius) {\n this.options.annotation.eraserRadius = radius;\n this.eraserRadius = radius;\n }\n deleteFirstInkLineCloseToPoint(inkAnnotations, pdfPoint) {\n if (!this.context) {\n return null;\n }\n const ctx = this.context;\n ctx.save();\n for (let inkAnnotation of inkAnnotations) {\n ctx.lineWidth = Math.max(inkAnnotation.border.width, this.eraserRadius * devicePixelRatio);\n ctx.lineCap = 'round';\n for (let inkLine of inkAnnotation.inkList) {\n const path = new Path2D();\n let isFirstPoint = true;\n for (let point of inkLine) {\n if (isFirstPoint) {\n path.moveTo(point.x, point.y);\n isFirstPoint = false;\n }\n else {\n path.lineTo(point.x, point.y);\n }\n }\n const isPointInStroke = ctx.isPointInStroke(path, pdfPoint.pdfX, pdfPoint.pdfY);\n if (isPointInStroke) {\n inkAnnotation.inkList.splice(inkAnnotation.inkList.indexOf(inkLine), 1);\n return inkAnnotation;\n }\n }\n }\n ctx.restore();\n return null;\n }\n updateInkAnnotation(inkAnnotation) {\n return new Promise((resolve, reject) => {\n if (inkAnnotation.inkList.length) {\n this.pdfApi\n .updateItem(inkAnnotation)\n .then((item) => {\n this.store.annotations.updateAnnotation(item);\n resolve();\n })\n .catch((err) => {\n console.error(err);\n reject();\n });\n }\n else {\n const id = inkAnnotation.id;\n this.pdfApi\n .deleteItem(inkAnnotation)\n .then(() => {\n resolve();\n })\n .catch((err) => {\n console.error(err);\n reject();\n });\n }\n });\n }\n}\n","import { CanvasModule, CanvasModuleType } from '../CanvasModule';\nimport { EraserLayer } from './EraserLayer';\nexport class EraserModule extends CanvasModule {\n constructor() {\n super();\n this.toolbarElement = null;\n this.name = EraserModule.moduleInfo.name;\n this.activate = this.activate.bind(this);\n }\n onRegister() {\n this.toolbarElement = document.createElement('div');\n return {\n toolbar: this.toolbarElement,\n };\n }\n activate() {\n if (!this.canvasLayers['add']) {\n this.createCanvasLayer('add', EraserLayer);\n }\n else {\n this.removeCanvasLayer('add');\n }\n }\n}\nEraserModule.moduleInfo = {\n name: 'EraserModule',\n moduleType: CanvasModuleType.Tool,\n requiredFeatures: {\n annotate: true,\n fillFormFields: false,\n },\n translationKey: 'eraser.begin',\n icon: 'eraser',\n};\n","import { app, h } from '../../lib/hyperapp';\nimport { translationManager } from '../../common/TranslationManager';\nimport { Toolbar } from '../../common/Toolbar';\nimport { ToolbarItemGroup } from '../../common/ToolbarItemGroup';\nimport { ToolbarButton } from '../../common/ToolbarButton';\nimport { icons } from '../../common/icons';\nimport { ToolbarSeparator } from '../../common/ToolbarSeparator';\nimport { RangeSlider } from '../../common/RangeSlider';\nexport const createEraserToolbar = (props, element) => {\n const state = {\n radius: props.radius,\n };\n const actions = {\n setRadius: (radius) => ($state) => {\n props.onRadiusChanged(radius);\n return Object.assign(Object.assign({}, $state), { radius });\n },\n setCancel: () => ($state) => {\n return Object.assign({}, $state);\n },\n };\n const App = () => h(EraserToolbar, null);\n const EraserToolbar = ({}) => ($state, $actions) => (h(Toolbar, { allowWrap: true, alignCenter: true },\n h(ToolbarItemGroup, null,\n h(RangeSlider, { tooltip: translationManager.getText('eraser.eraserWidth'), min: 2, max: 50, step: 1, value: $state.radius, text: `${$state.radius}px`, icon: icons.circleDashed, onChange: $actions.setRadius, className: \"pwv-opacityslider\" })),\n h(ToolbarItemGroup, { pushRight: true },\n h(ToolbarSeparator, null),\n h(ToolbarButton, { icon: icons.close, onClick: props.onCancel }))));\n return app(state, actions, App, element);\n};\n","import { WidgetBase } from './WidgetBase';\nexport class CheckBoxWidget extends WidgetBase {\n createFormField() {\n const formField = document.createElement('label');\n formField.classList.add('pwv-formField__CheckBox');\n formField.style.overflow = 'hidden';\n const checkbox = document.createElement('input');\n checkbox.type = 'checkbox';\n checkbox.checked = this.widget.selected;\n checkbox.style.position = 'absolute';\n checkbox.style.top = '-20px';\n checkbox.style.left = '-20px';\n formField.appendChild(checkbox);\n this.handleOnChange = this.handleOnChange.bind(this);\n this.handleOnKeyDown = this.handleOnKeyDown.bind(this);\n this.handleOnBlur = this.handleOnBlur.bind(this);\n formField.addEventListener('change', this.handleOnChange);\n formField.addEventListener('keydown', this.handleOnKeyDown);\n formField.addEventListener('blur', this.handleOnBlur);\n return formField;\n }\n onRemove() {\n this.editorElement.removeEventListener('change', this.handleOnChange);\n this.editorElement.removeEventListener('keydown', this.handleOnKeyDown);\n this.editorElement.removeEventListener('blur', this.handleOnBlur);\n }\n setFocus() {\n this.editorElement.focus();\n }\n handleOnKeyDown(e) {\n if (e.code === 'Tab') {\n this.onTab(e.shiftKey);\n }\n else if (e.code === 'Escape') {\n this.onBlur();\n }\n }\n handleOnBlur(e) {\n this.onBlur();\n }\n handleOnChange(e) {\n this.widget.push();\n this.saveWidget();\n }\n}\n","import { WidgetBase } from './WidgetBase';\nexport class ComboBoxWidget extends WidgetBase {\n constructor() {\n super(...arguments);\n this.btnClearPressed = false;\n this.hasPendingChanges = false;\n this.saveThrottlingTimer = undefined;\n }\n createFormField() {\n this.inputOnFocus = this.inputOnFocus.bind(this);\n this.inputOnBlur = this.inputOnBlur.bind(this);\n this.inputOnInput = this.inputOnInput.bind(this);\n this.inputOnChange = this.inputOnChange.bind(this);\n this.inputOnKeyDown = this.inputOnKeyDown.bind(this);\n this.btnOnClick = this.btnOnClick.bind(this);\n this.btnOnMouseDown = this.btnOnMouseDown.bind(this);\n this.btnOnMouseUp = this.btnOnMouseUp.bind(this);\n const formField = document.createElement('div');\n formField.classList.add('pwv-formField__ComboBox');\n this.dataList = document.createElement('datalist');\n this.dataList.id = Math.random().toString(36).substring(2, 8);\n for (let i = 0; i < this.widget.options.size; i++) {\n const value = this.widget.options.get(i);\n const item = document.createElement('option');\n item.value = value;\n item.textContent = value;\n this.dataList.appendChild(item);\n }\n this.input = document.createElement('input');\n this.input.setAttribute('list', this.dataList.id);\n this.input.style.border = 'none';\n this.input.style.boxSizing = 'border-box';\n this.input.style.width = '100%';\n this.input.style.maxWidth = '100%';\n this.input.value =\n this.widget.chosen !== null\n ? this.widget.options.get(this.widget.chosen)\n : this.widget.customEntry;\n this.input.addEventListener('focus', this.inputOnFocus);\n this.input.addEventListener('blur', this.inputOnBlur);\n this.input.addEventListener('input', this.inputOnInput);\n this.input.addEventListener('change', this.inputOnChange);\n this.input.addEventListener('keydown', this.inputOnKeyDown);\n this.btnClear = document.createElement('button');\n this.btnClear.tabIndex = -1;\n const icon = document.createElement('span');\n icon.classList.add('pwv-icon');\n const iconSvg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n iconSvg.setAttribute('viewBox', '0 0 320 512');\n const iconPath = document.createElementNS('http://www.w3.org/2000/svg', 'path');\n iconPath.setAttribute('d', 'M193.94 256L296.5 153.44l21.15-21.15c3.12-3.12 3.12-8.19 0-11.31l-22.63-22.63c-3.12-3.12-8.19-3.12-11.31 0L160 222.06 36.29 98.34c-3.12-3.12-8.19-3.12-11.31 0L2.34 120.97c-3.12 3.12-3.12 8.19 0 11.31L126.06 256 2.34 379.71c-3.12 3.12-3.12 8.19 0 11.31l22.63 22.63c3.12 3.12 8.19 3.12 11.31 0L160 289.94 262.56 392.5l21.15 21.15c3.12 3.12 8.19 3.12 11.31 0l22.63-22.63c3.12-3.12 3.12-8.19 0-11.31L193.94 256z');\n iconPath.setAttribute('stroke-width', '1px');\n iconPath.setAttribute('shape-rendering', 'optimizeQuality');\n iconSvg.appendChild(iconPath);\n icon.appendChild(iconSvg);\n this.btnClear.appendChild(icon);\n this.btnClear.addEventListener('mousedown', this.btnOnMouseDown);\n this.btnClear.addEventListener('mouseup', this.btnOnMouseUp);\n this.btnClear.addEventListener('mouseleave', this.btnOnMouseUp);\n this.btnClear.addEventListener('click', this.btnOnClick);\n formField.appendChild(this.input);\n formField.appendChild(this.dataList);\n formField.appendChild(this.btnClear);\n return formField;\n }\n onRemove() {\n if (this.saveThrottlingTimer) {\n window.clearTimeout(this.saveThrottlingTimer);\n }\n if (this.hasPendingChanges) {\n this.saveWidget();\n }\n this.input.removeEventListener('focus', this.inputOnFocus);\n this.input.removeEventListener('blur', this.inputOnBlur);\n this.input.removeEventListener('input', this.inputOnInput);\n this.input.removeEventListener('change', this.inputOnChange);\n this.input.removeEventListener('keydown', this.inputOnKeyDown);\n this.btnClear.removeEventListener('mousedown', this.btnOnMouseDown);\n this.btnClear.removeEventListener('mouseup', this.btnOnMouseUp);\n this.btnClear.removeEventListener('mouseleave', this.btnOnMouseUp);\n this.btnClear.removeEventListener('click', this.btnOnClick);\n }\n setFocus() {\n this.input.focus();\n }\n updateBtnVisibility() {\n if (this.btnClear) {\n this.btnClear.style.display = this.input.value === '' ? 'none' : 'flex';\n }\n }\n updateWidget() {\n const { value, list } = this.input;\n const options = list.options;\n const chosen = [...options].findIndex((i) => i.value === value);\n if (chosen >= 0) {\n this.widget.chosen = chosen;\n }\n else {\n this.widget.customEntry = value;\n }\n if (this.saveThrottlingTimer) {\n window.clearTimeout(this.saveThrottlingTimer);\n }\n this.saveThrottlingTimer = window.setTimeout(() => {\n this.saveWidget();\n this.hasPendingChanges = false;\n }, 500);\n }\n inputOnFocus(e) {\n this.updateBtnVisibility();\n }\n inputOnBlur(e) {\n if (!this.btnClearPressed) {\n this.saveWidget();\n this.hasPendingChanges = false;\n this.onBlur();\n }\n }\n inputOnInput(e) {\n this.updateBtnVisibility();\n this.updateWidget();\n }\n inputOnChange(e) {\n this.updateBtnVisibility();\n }\n inputOnKeyDown(e) {\n if (e.code === 'Tab') {\n this.onTab(e.shiftKey);\n }\n else if (e.code === 'Escape') {\n this.input.blur();\n }\n }\n btnOnClick(e) {\n this.input.value = '';\n this.updateWidget();\n this.updateBtnVisibility();\n this.input.focus();\n }\n btnOnMouseDown(e) {\n this.btnClearPressed = true;\n }\n btnOnMouseUp(e) {\n this.input.focus();\n this.btnClearPressed = false;\n }\n}\n","import { CanvasLayer } from '../CanvasLayer';\nimport { PdfItemType, WidgetType } from '../../pdf-viewer-api';\nimport { CheckBoxWidget } from './CheckBoxWidget';\nimport { ComboBoxWidget } from './ComboBoxWidget';\nimport { SelectListWidget } from './SelectListWidget';\nimport { ListBoxWidget } from './ListBoxWidget';\nimport { RadioButtonWidget } from './RadioButtonWidget';\nimport { TextBoxWidget } from './TextBoxWidget';\nconst moduleLayerName = 'EditFormField';\nconst stopPropagation = (e) => {\n e.stopPropagation();\n};\nexport class EditFormFieldLayer extends CanvasLayer {\n constructor() {\n super(...arguments);\n this.widgetAnnotation = null;\n this.formFieldElement = null;\n this.hasFocus = false;\n this.widgetEditor = null;\n }\n onCreate(args) {\n const { annotationId, action } = args;\n this.store.viewer.beginModule(moduleLayerName);\n this.widgetAnnotation = this.pdfApi.getItem(annotationId);\n this.selectNextFormField = this.selectNextFormField.bind(this);\n this.blur = this.blur.bind(this);\n this.formFieldElement = this.createHtmlLayer();\n this.formFieldElement.classList.add('pwv-formField');\n this.formFieldElement.addEventListener('mousedown', stopPropagation, false);\n this.formFieldElement.addEventListener('mousemove', stopPropagation, false);\n this.formFieldElement.addEventListener('mouseup', stopPropagation, false);\n this.formFieldElement.addEventListener('touchstart', stopPropagation, { passive: false });\n this.formFieldElement.addEventListener('touchmove', stopPropagation, { passive: true });\n this.formFieldElement.addEventListener('touchend', stopPropagation, { passive: true });\n this.updateFormFieldElementPosition();\n const widget = this.widgetAnnotation.widget;\n const widgetType = this.widgetAnnotation.widgetType;\n if (action === 'click' &&\n (widgetType === WidgetType.CHECK_BOX || widgetType === WidgetType.RADIO_BUTTON)) {\n widget.push();\n this.widgetAnnotation.pdfDocument.editAnnotation(widget);\n }\n const bb = widget.boundingBox;\n const paddingX = 4;\n const paddingY = 6;\n this.pdfApi.goToRectangle({\n page: bb.pageNumber,\n pdfX: bb.x - paddingX,\n pdfY: bb.y - paddingY,\n pdfW: bb.width + 2 * paddingX,\n pdfH: bb.height + 2 * paddingY,\n });\n const options = {\n widget: widget,\n widgetType: widgetType,\n pdfDocument: this.widgetAnnotation.pdfDocument,\n onTab: (shiftKey) => {\n this.selectNextFormField(shiftKey);\n },\n onBlur: () => {\n if (this.hasFocus) {\n this.blur();\n }\n },\n };\n switch (options.widgetType) {\n case WidgetType.CHECK_BOX:\n this.widgetEditor = new CheckBoxWidget(this.formFieldElement, options);\n break;\n case WidgetType.RADIO_BUTTON:\n this.widgetEditor = new RadioButtonWidget(this.formFieldElement, options);\n break;\n case WidgetType.TEXT_BOX:\n this.widgetEditor = new TextBoxWidget(this.formFieldElement, options);\n break;\n case WidgetType.COMBO_BOX:\n {\n if (widget.customEntryAllowed) {\n this.widgetEditor = new ComboBoxWidget(this.formFieldElement, options);\n }\n else {\n this.widgetEditor = new SelectListWidget(this.formFieldElement, options);\n }\n }\n break;\n case WidgetType.LIST_BOX:\n this.widgetEditor = new ListBoxWidget(this.formFieldElement, options);\n break;\n }\n this.hasFocus = true;\n }\n cancel() {\n this.remove();\n }\n onSave() {\n const promise = new Promise((resolve, reject) => {\n resolve();\n });\n return promise;\n }\n close() {\n this.remove();\n }\n onRemove() {\n var _a;\n this.hasFocus = false;\n (_a = this.widgetEditor) === null || _a === void 0 ? void 0 : _a.onRemove();\n this.removeHtmlElements();\n this.formFieldElement = null;\n this.store.viewer.endModule(moduleLayerName);\n }\n render(timestamp, state) {\n var _a;\n if (state.viewer.modeChanged && state.viewer.selectedModuleName !== moduleLayerName) {\n this.remove();\n return;\n }\n if (this.formFieldElement) {\n if (state.canvas.canvasInvalidated || state.viewer.modeChanged) {\n this.updateFormFieldElementPosition();\n }\n if (state.pointer.action === 'click') {\n const pointerCssPos = {\n x: state.pointer.x.cssPixels,\n y: state.pointer.y.cssPixels,\n };\n const insideHorizontal = pointerCssPos.x > this.formFieldElement.offsetLeft &&\n pointerCssPos.x < this.formFieldElement.offsetLeft + this.formFieldElement.offsetWidth;\n const insideVertical = pointerCssPos.y > this.formFieldElement.offsetTop &&\n pointerCssPos.y < this.formFieldElement.offsetTop + this.formFieldElement.offsetHeight;\n if (!insideHorizontal || !insideVertical) {\n this.blur();\n const annotationsOnPoint = this.pdfApi.getAnnotationsOnPoint({\n x: state.pointer.x.devicePixels,\n y: state.pointer.y.devicePixels,\n });\n if (annotationsOnPoint && annotationsOnPoint.length) {\n for (let i = 0; i < annotationsOnPoint.length; i++) {\n const annotationOnPoint = annotationsOnPoint[i];\n if (annotationOnPoint.itemType === PdfItemType.WIDGET &&\n !annotationOnPoint.widget.readOnly) {\n this.pdfViewerCanvas.activateModule('FormFieldModule', {\n annotationId: annotationOnPoint.id,\n action: 'click',\n });\n }\n }\n }\n return;\n }\n }\n }\n if (state.document.zoomChanged || state.viewer.modeChanged) {\n (_a = this.widgetEditor) === null || _a === void 0 ? void 0 : _a.setZoom(state.document.zoom);\n }\n }\n updateFormFieldElementPosition() {\n if (this.widgetAnnotation && this.formFieldElement) {\n const screenRect = this.pdfApi.transformPdfPageRectToScreenRect(this.widgetAnnotation.pdfRect);\n this.formFieldElement.style.left = `${screenRect.x / devicePixelRatio - 2}px`;\n this.formFieldElement.style.top = `${screenRect.y / devicePixelRatio - 2}px`;\n this.formFieldElement.style.width = `${screenRect.w / devicePixelRatio + 1}px`;\n this.formFieldElement.style.height = `${screenRect.h / devicePixelRatio + 1}px`;\n }\n }\n selectNextFormField(reverse) {\n if (this.widgetAnnotation) {\n const { annotations, document } = this.store.getState();\n const pageCount = this.pdfApi.getPageCount();\n const getNextFormFieldOnPage = (pageNumber, index) => {\n const list = annotations.byPage[pageNumber];\n for (let i = index; i < list.length; i++) {\n const annotId = list[i];\n const annotation = annotations.all[annotId];\n if (annotation.itemType === PdfItemType.WIDGET &&\n !annotation.widget.readOnly) {\n return annotation;\n }\n }\n if (pageCount === 1 && index === 0) {\n return null;\n }\n const nextPage = pageCount > pageNumber ? pageNumber + 1 : 1;\n return getNextFormFieldOnPage(nextPage, 0);\n };\n const getPreviewsFormFieldOnPage = (pageNumber, index) => {\n const list = annotations.byPage[pageNumber];\n const start = index < 0 ? list.length - 1 : index;\n for (let i = start; i >= 0; i--) {\n const annotId = list[i];\n const annotation = annotations.all[annotId];\n if (annotation.itemType === PdfItemType.WIDGET &&\n !annotation.widget.readOnly) {\n return annotation;\n }\n }\n if (pageNumber === 1) {\n return null;\n }\n return getPreviewsFormFieldOnPage(pageNumber - 1, -1);\n };\n const currentWidgetIndex = annotations.byPage[this.widgetAnnotation.page].findIndex((a) => { var _a; return a === ((_a = this.widgetAnnotation) === null || _a === void 0 ? void 0 : _a.id); });\n let currentPage = this.widgetAnnotation.page;\n let nextFormField = null;\n if (reverse) {\n if (currentWidgetIndex === 0) {\n if (currentPage === 1) {\n nextFormField = this.widgetAnnotation;\n }\n else {\n nextFormField = getPreviewsFormFieldOnPage(this.widgetAnnotation.page - 1, -1);\n }\n }\n else {\n nextFormField = getPreviewsFormFieldOnPage(this.widgetAnnotation.page, currentWidgetIndex - 1);\n }\n }\n else {\n nextFormField = getNextFormFieldOnPage(this.widgetAnnotation.page, currentWidgetIndex + 1);\n }\n if (nextFormField) {\n this.blur();\n this.pdfViewerCanvas.activateModule('FormFieldModule', {\n annotationId: nextFormField.id,\n action: 'select',\n });\n }\n }\n }\n blur() {\n if (this.hasFocus) {\n this.hasFocus = false;\n this.remove();\n }\n }\n}\n","import { CanvasModule, CanvasModuleType } from '../CanvasModule';\nimport { EditFormFieldLayer } from './EditFormFieldLayer';\nexport class FormFieldModule extends CanvasModule {\n constructor() {\n super();\n this.name = FormFieldModule.moduleInfo.name;\n }\n onRegister() {\n return {};\n }\n activate(args) {\n if (!this.canvasLayers['edit']) {\n this.onEdit(args);\n }\n }\n onEdit(args) {\n this.createCanvasLayer('edit', EditFormFieldLayer, args);\n }\n}\nFormFieldModule.moduleInfo = {\n name: 'FormFieldModule',\n moduleType: CanvasModuleType.Layer,\n requiredFeatures: {\n annotate: false,\n fillFormFields: true,\n },\n};\n","import { WidgetBase } from './WidgetBase';\nexport class ListBoxWidget extends WidgetBase {\n createFormField() {\n const formField = document.createElement('select');\n formField.setAttribute('required', 'true');\n if (this.widget.multiSelectAllowed) {\n formField.setAttribute('multiple', 'true');\n }\n else {\n formField.setAttribute('size', `${this.widget.options.size}`);\n }\n formField.classList.add('pwv-formField__ListBox');\n const values = Array.from(this.widget.chosen.values());\n for (let i = 0; i < this.widget.options.size; i++) {\n const value = this.widget.options.get(i);\n const item = document.createElement('option');\n item.value = i.toString();\n item.textContent = value;\n formField.appendChild(item);\n item.selected = values.includes(i);\n }\n this.handleOnChange = this.handleOnChange.bind(this);\n this.handleOnKeyDown = this.handleOnKeyDown.bind(this);\n this.handleOnBlur = this.handleOnBlur.bind(this);\n formField.addEventListener('change', this.handleOnChange);\n formField.addEventListener('keydown', this.handleOnKeyDown);\n formField.addEventListener('blur', this.handleOnBlur);\n formField.addEventListener('wheel', (e) => {\n e.stopPropagation();\n });\n return formField;\n }\n onRemove() {\n this.editorElement.removeEventListener('change', this.handleOnChange);\n this.editorElement.removeEventListener('keydown', this.handleOnKeyDown);\n this.editorElement.removeEventListener('blur', this.handleOnBlur);\n }\n setFocus() {\n this.editorElement.focus();\n }\n handleOnKeyDown(e) {\n if (e.code === 'Tab') {\n this.onTab(e.shiftKey);\n }\n else if (e.code === 'Escape') {\n this.onBlur();\n }\n }\n handleOnBlur(e) {\n this.onBlur();\n }\n handleOnChange(e) {\n let selectedOptions = [];\n if (!e.target.value) {\n const value = Array.from(this.widget.chosen.values()).shift();\n selectedOptions = [value];\n e.target.value = value;\n }\n else {\n selectedOptions = [...e.target.options]\n .filter((o) => o.selected)\n .map((o) => parseInt(o.value));\n if (!this.widget.multiSelectAllowed) {\n const value = selectedOptions[0];\n selectedOptions = [value];\n e.target.value = value;\n }\n }\n this.widget.chosen.clear();\n selectedOptions.forEach((o) => this.widget.chosen.add(o));\n this.saveWidget();\n }\n}\n","import { WidgetBase } from './WidgetBase';\nexport class RadioButtonWidget extends WidgetBase {\n createFormField() {\n const formField = document.createElement('label');\n formField.classList.add('pwv-formField__RadioButton');\n formField.style.overflow = 'hidden';\n const radio = document.createElement('input');\n radio.type = 'radio';\n radio.checked = this.widget.selected;\n radio.style.position = 'absolute';\n radio.style.top = '-20px';\n radio.style.left = '-20px';\n formField.appendChild(radio);\n this.handleOnChange = this.handleOnChange.bind(this);\n this.handleOnKeyDown = this.handleOnKeyDown.bind(this);\n this.handleOnBlur = this.handleOnBlur.bind(this);\n formField.addEventListener('change', this.handleOnChange);\n formField.addEventListener('keydown', this.handleOnKeyDown);\n formField.addEventListener('blur', this.handleOnBlur);\n return formField;\n }\n onRemove() {\n this.editorElement.removeEventListener('change', this.handleOnChange);\n this.editorElement.removeEventListener('keydown', this.handleOnKeyDown);\n this.editorElement.removeEventListener('blur', this.handleOnBlur);\n }\n setFocus() {\n this.editorElement.focus();\n }\n handleOnKeyDown(e) {\n if (e.code === 'Tab') {\n this.onTab(e.shiftKey);\n }\n else if (e.code === 'Escape') {\n this.onBlur();\n }\n }\n handleOnBlur(e) {\n this.onBlur();\n }\n handleOnChange(e) {\n this.widget.push();\n this.saveWidget();\n }\n}\n","import { WidgetBase } from './WidgetBase';\nexport class SelectListWidget extends WidgetBase {\n createFormField() {\n const formField = document.createElement('select');\n formField.classList.add('pwv-formField__SelectList');\n for (let i = 0; i < this.widget.options.size; i++) {\n const value = this.widget.options.get(i);\n const item = document.createElement('option');\n item.value = i.toString();\n item.textContent = value;\n formField.appendChild(item);\n }\n formField.value = this.widget.chosen;\n this.handleOnChange = this.handleOnChange.bind(this);\n this.handleOnKeyDown = this.handleOnKeyDown.bind(this);\n this.handleOnBlur = this.handleOnBlur.bind(this);\n formField.addEventListener('change', this.handleOnChange);\n formField.addEventListener('keydown', this.handleOnKeyDown);\n formField.addEventListener('blur', this.handleOnBlur);\n return formField;\n }\n onRemove() {\n }\n setFocus() {\n this.editorElement.focus();\n }\n handleOnKeyDown(e) {\n if (e.code === 'Tab') {\n this.onTab(e.shiftKey);\n }\n else if (e.code === 'Escape') {\n this.onBlur();\n }\n }\n handleOnBlur(e) {\n this.onBlur();\n }\n handleOnChange(e) {\n this.widget.chosen = parseInt(e.target.value);\n this.saveWidget();\n }\n}\n","import { WidgetBase } from './WidgetBase';\nexport class TextBoxWidget extends WidgetBase {\n createFormField() {\n const formField = this.widget.multilineAllowed\n ? document.createElement('textarea')\n : document.createElement('input');\n formField.classList.add('pwv-formField__TextBox');\n if (this.widget.text) {\n formField.value = this.widget.text;\n }\n if (this.widget.maxLength && this.widget.maxLength >= 0) {\n formField.maxLength = this.widget.maxLength;\n }\n if (this.widget.comb) {\n formField.style.letterSpacing = '1em';\n }\n this.handleOnChange = this.handleOnChange.bind(this);\n this.handleOnKeyDown = this.handleOnKeyDown.bind(this);\n this.handleOnBlur = this.handleOnBlur.bind(this);\n formField.addEventListener('input', this.handleOnChange);\n formField.addEventListener('keydown', this.handleOnKeyDown);\n formField.addEventListener('blur', this.handleOnBlur);\n return formField;\n }\n onRemove() {\n }\n setFocus() {\n this.editorElement.focus();\n }\n handleOnKeyDown(e) {\n if (e.code === 'Tab') {\n this.onTab(e.shiftKey);\n }\n else if (e.code === 'Escape') {\n this.onBlur();\n }\n }\n handleOnBlur(e) {\n this.onBlur();\n }\n handleOnChange(e) {\n try {\n this.widget.text = e.target.value;\n }\n catch (err) {\n console.warn(err);\n }\n this.saveWidget();\n }\n}\n","export class WidgetBase {\n constructor(element, options) {\n this.element = element;\n this.widgetType = options.widgetType;\n this.widget = options.widget;\n this.pdfDocument = options.pdfDocument;\n this.onTab = options.onTab;\n this.onBlur = options.onBlur;\n this.editorElement = this.createFormField();\n this.editorElement.classList.add('pwv-formField__Element');\n this.element.appendChild(this.editorElement);\n window.setTimeout(() => {\n this.setFocus();\n }, 1);\n }\n saveWidget() {\n this.pdfDocument\n .editAnnotation(this.widget)\n .then(() => { })\n .catch((err) => {\n console.warn(err);\n });\n }\n setZoom(zoom) {\n this.editorElement.style.transform = `scale(${zoom})`;\n this.editorElement.style.width = this.element.clientWidth / zoom + 'px';\n this.editorElement.style.height = this.element.clientHeight / zoom + 'px';\n }\n}\n","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { CanvasLayer } from '../CanvasLayer';\nimport { PdfItemType, AnnotationBorderStyle, } from '../../pdf-viewer-api';\nimport { CursorStyle } from '../../pdf-viewer-canvas/state/viewer';\nimport { getRectFromSelection } from '../../pdf-viewer-canvas/state/document';\nimport { createAddFreetextAnnotationToolbar } from './AddFreetextAnnotationToolbar';\nconst moduleLayerName = 'AddFreetextAnnotation';\nexport class AddFreetextAnnotationLayer extends CanvasLayer {\n constructor() {\n super(...arguments);\n this.context = null;\n this.colors = [];\n this.selectedColor = '';\n this.borderWidths = [];\n this.pointerDown = false;\n this.startPoint = null;\n this.page = 0;\n }\n onCreate() {\n this.setColor = this.setColor.bind(this);\n this.setBorderWidth = this.setBorderWidth.bind(this);\n this.close = this.close.bind(this);\n this.context = this.createCanvas();\n this.colors = this.options.annotation.colors.backgroundColors;\n this.selectedColor =\n this.options.annotation.colors.freetextBackgroundColor ||\n this.options.annotation.colors.defaultBackgroundColor;\n this.borderWidths = [0, 1, 2, 3, 4];\n const toolbarElement = this.module.toolbarElement;\n createAddFreetextAnnotationToolbar({\n colors: this.colors,\n selectedColor: this.selectedColor,\n borderWidths: this.borderWidths,\n selectedBorderWidth: this.options.annotation.freetextBorderWidth || this.options.annotation.defaultBorderWidth,\n onColorChanged: this.setColor,\n onBorderWidthChanged: this.setBorderWidth,\n onClose: this.close,\n }, toolbarElement);\n this.store.viewer.beginModule(moduleLayerName);\n }\n onSave() {\n const promise = new Promise((resolve, reject) => {\n resolve();\n });\n return promise;\n }\n onRemove() {\n this.removeCanvasElements();\n this.context = null;\n const toolbarElement = this.module.toolbarElement;\n toolbarElement.innerHTML = '';\n this.store.viewer.setCursorStyle(CursorStyle.DEFAULT);\n this.store.viewer.endModule(moduleLayerName);\n }\n render(timestamp, state) {\n if (state.viewer.modeChanged && state.viewer.selectedModuleName !== moduleLayerName) {\n this.remove();\n return;\n }\n if (this.context) {\n const update = state.viewer.modeChanged ||\n state.pointer.positionChanged ||\n state.pointer.action ||\n state.document.zoomChanged;\n if (update) {\n const ctx = this.context;\n ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);\n const pointerPos = { x: state.pointer.x.devicePixels, y: state.pointer.y.devicePixels };\n const pointerPdfPos = this.pdfApi.transformScreenPointToPdfPoint(pointerPos);\n if (pointerPdfPos.isOnPage) {\n this.store.viewer.setCursorStyle(CursorStyle.CROSSHAIR);\n }\n else {\n this.store.viewer.setCursorStyle(CursorStyle.NOT_ALLOWED);\n }\n if (state.pointer.isDown) {\n if (!this.pointerDown) {\n this.startPoint = pointerPos;\n this.pointerDown = true;\n if (this.page === 0 && pointerPdfPos.isOnPage) {\n this.page = pointerPdfPos.pdfPoint.page;\n }\n }\n if (this.startPoint) {\n const rect = getRectFromSelection(state.document, {\n x: this.startPoint.x,\n y: this.startPoint.y,\n }, {\n x: pointerPos.x,\n y: pointerPos.y,\n }, this.page);\n if (rect) {\n const lineWidth = 2 * devicePixelRatio;\n ctx.save();\n ctx.strokeStyle = this.options.viewer.general.textSelectionColor;\n ctx.fillStyle = this.options.viewer.general.textSelectionColor;\n ctx.lineWidth = lineWidth;\n ctx.setLineDash([lineWidth, lineWidth]);\n ctx.strokeRect(rect.x, rect.y, rect.w, rect.h);\n ctx.globalAlpha = 0.33;\n ctx.fillRect(rect.x, rect.y, rect.w, rect.h);\n ctx.restore();\n }\n }\n }\n else if (this.pointerDown && this.startPoint) {\n const rect = getRectFromSelection(state.document, {\n x: this.startPoint.x,\n y: this.startPoint.y,\n }, {\n x: pointerPos.x,\n y: pointerPos.y,\n }, this.page);\n if (rect) {\n this.createFreeTextAnnotation(rect);\n this.pointerDown = false;\n this.startPoint = null;\n this.remove();\n }\n }\n }\n }\n }\n setColor(color) {\n this.selectedColor = color;\n this.options.annotation.colors.freetextBackgroundColor = color;\n }\n setBorderWidth(borderWidth) {\n this.options.annotation.freetextBorderWidth = borderWidth;\n }\n close() {\n this.remove();\n }\n createFreeTextAnnotation(rect) {\n return __awaiter(this, void 0, void 0, function* () {\n const pdfRect = this.pdfApi.transformScreenRectToPdfRect(rect, this.page);\n const { pdfY, pdfH, pdfW, pdfX, page } = pdfRect;\n const pageSize = yield this.pdfApi.getPagePdfSize(page);\n const minWidth = 20;\n const minHeight = 18;\n const isRotated = this.pdfApi.getRotation() % 180 !== 0;\n pdfRect.pdfW = isRotated ? Math.max(minHeight, pdfW) : Math.max(minWidth, pdfW);\n pdfRect.pdfH = isRotated ? Math.max(minWidth, pdfH) : Math.max(minHeight, pdfH);\n pdfRect.pdfX = Math.min(pdfX, pageSize.width - pdfRect.pdfW);\n pdfRect.pdfY = Math.min(pdfY, pageSize.height - pdfRect.pdfH);\n const annotation = {\n itemType: PdfItemType.FREE_TEXT,\n color: this.selectedColor === 'transparent' ? '#00000000' : this.selectedColor,\n author: this.options.viewer.general.user,\n page: pdfRect.page,\n pdfRect,\n border: {\n width: this.options.annotation.freetextBorderWidth || this.options.annotation.defaultBorderWidth,\n style: AnnotationBorderStyle.SOLID,\n },\n richtext: `<?xml version=\"1.0\"?><body xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:xfa=\"http://www.xfa.org/schema/xfa-data/1.0/\" xfa:APIVersion=\"Acrobat:19.12.0\" xfa:spec=\"2.0.2\" style=\"color:${this.options.annotation.colors.freetextFontColor};\"></body>`,\n fontName: 'Arial',\n fontColor: this.options.annotation.fonts.freetextFontColor,\n fontSize: this.options.annotation.fonts.freetextFontSize,\n };\n this.pdfApi.createItem(annotation).then((item) => {\n this.onAnnotationCreated(item).then((item) => {\n const module = this.module;\n module.onEdit(item.id);\n });\n });\n });\n }\n}\n","import { app, h } from '../../lib/hyperapp';\nimport { translationManager } from '../../common/TranslationManager';\nimport { Toolbar } from '../../common/Toolbar';\nimport { ToolbarItemGroup } from '../../common/ToolbarItemGroup';\nimport { ToolbarButton } from '../../common/ToolbarButton';\nimport { icons } from '../../common/icons';\nimport { ToolbarSeparator } from '../../common/ToolbarSeparator';\nimport { ColorPicker } from '../../common/ColorPicker';\nimport { StrokeWidthPicker } from '../../common/StrokeWidthPicker';\nexport const createAddFreetextAnnotationToolbar = (props, element) => {\n const state = {\n colors: props.colors,\n selectedColor: props.selectedColor,\n borderWidths: props.borderWidths,\n selectedBorderWidth: props.selectedBorderWidth,\n };\n const actions = {\n setColor: (color) => ($state) => {\n props.onColorChanged(color);\n return Object.assign(Object.assign({}, $state), { selectedColor: color });\n },\n setBorderWith: (borderWidth) => ($state) => {\n props.onBorderWidthChanged(borderWidth);\n return Object.assign(Object.assign({}, $state), { selectedBorderWidth: borderWidth });\n },\n };\n const App = () => h(AddFreetextAnnotationToolbar, null);\n const AddFreetextAnnotationToolbar = ({}) => ($state, $actions) => (h(Toolbar, { allowWrap: true, alignCenter: true },\n h(ToolbarItemGroup, null,\n h(ColorPicker, { colors: $state.colors, color: $state.selectedColor, icon: icons.fillColor, mode: \"buttons\", onChange: $actions.setColor }),\n h(StrokeWidthPicker, { tooltip: translationManager.getText('annotFreeText.borderWidth'), noneStrokeText: translationManager.getText('border.none'), strokeWidths: $state.borderWidths, value: $state.selectedBorderWidth, onChange: $actions.setBorderWith })),\n h(ToolbarItemGroup, { pushRight: true },\n h(ToolbarSeparator, null),\n h(ToolbarButton, { icon: icons.close, onClick: props.onClose }))));\n return app(state, actions, App, element);\n};\n","import { CanvasLayer } from '../CanvasLayer';\nimport { Color } from '../../common/Color';\nimport { createEditFreetextAnnotationToolbar, } from './EditFreetextAnnotationToolbar';\nimport { RichTextEditor } from './RichTextEditor';\nimport { convertPdfToCssPixel, convertCssToPdfPixel } from '../../common/Tools';\nimport { addHistoryEntry } from '../../custom/history';\nconst moduleLayerName = 'EditFreetextAnnotation';\nexport class EditFreetextAnnotationLayer extends CanvasLayer {\n constructor() {\n super(...arguments);\n this.freetextAnnotation = null;\n this.editorElement = null;\n this.richTextEditor = null;\n this.toolbarView = null;\n this.color = this.options.annotation.fonts.freetextFontColor;\n this.fontSize = `${this.options.annotation.fonts.defaultFontSize}pt`;\n this.borderWidth = 1;\n this.fontSizeCSS = convertPdfToCssPixel(`${this.options.annotation.fonts.defaultFontSize}`);\n this.fontName = this.options.annotation.fonts.freetextFontFamily;\n }\n onCreate(annotationId) {\n this.store.viewer.beginModule(moduleLayerName);\n this.freetextAnnotation = this.pdfApi.getItem(annotationId);\n this.updateFreeTextAnnotation = this.updateFreeTextAnnotation.bind(this);\n this.close = this.close.bind(this);\n this.executeCommand = this.executeCommand.bind(this);\n this.editorElement = this.createHtmlLayer();\n this.editorElement.style.position = 'absolute';\n this.editorElement.style.zIndex = '4';\n const annotationOptions = this.options.annotation;\n this.color = annotationOptions.colors.freetextFontColor;\n this.borderWidth = this.freetextAnnotation.border.width;\n this.fontName = annotationOptions.fonts.freetextFontFamily;\n this.fontSize = `${annotationOptions.fonts.freetextFontSize}`;\n this.fontSizeCSS = convertPdfToCssPixel(`${annotationOptions.fonts.freetextFontSize}`);\n if (this.freetextAnnotation.richText) {\n const colorRes = /.*color:(.*?);/.exec(this.freetextAnnotation.richText);\n const fontNameRes = /.*font-family:(.*?);/.exec(this.freetextAnnotation.richText);\n const fontSizeRes = /.*font-size:(.*?)[;|\\\"]/.exec(this.freetextAnnotation.richText);\n if (colorRes && colorRes.length > 1) {\n this.color = colorRes[1];\n }\n if (fontNameRes && fontNameRes.length > 1) {\n this.fontName = fontNameRes[1];\n }\n if (fontSizeRes && fontSizeRes.length > 1) {\n this.fontSize = fontSizeRes[1];\n this.fontSizeCSS = convertPdfToCssPixel(this.fontSize);\n }\n }\n else {\n this.color = this.freetextAnnotation.color;\n this.fontName = this.freetextAnnotation.fontName;\n this.fontSizeCSS = convertPdfToCssPixel(this.freetextAnnotation.fontSize);\n }\n this.richTextEditor = new RichTextEditor(this.editorElement, {\n content: this.freetextAnnotation.content,\n richText: this.freetextAnnotation.richText,\n backgroundColor: this.freetextAnnotation.color,\n borderWidth: this.freetextAnnotation.border.width,\n fontName: this.fontName,\n fontColor: this.color,\n fontSizeCSS: this.fontSizeCSS,\n });\n const toolbarElement = this.module.toolbarElement;\n this.toolbarView = createEditFreetextAnnotationToolbar({\n annotation: this.freetextAnnotation,\n backgroundColors: [...annotationOptions.colors.backgroundColors],\n borderWidths: [0, 1, 2, 3, 4],\n fontColors: [...annotationOptions.colors.foregroundColors],\n fontFamilies: annotationOptions.fonts.fontFamilies,\n fontSizes: annotationOptions.fonts.fontSizes,\n selectedFont: this.fontName,\n selectedBackgroundColor: this.freetextAnnotation.color,\n selectedFontColor: this.color,\n selectedFontSize: this.fontSize,\n selectedBorderWidth: this.borderWidth,\n allowLockAnnotations: this.options.viewer.permissions.allowLockAnnotations,\n hideAnnotationSubject: this.options.annotation.hideAnnotationSubject || false,\n onCmd: this.executeCommand,\n onClose: this.close,\n }, toolbarElement);\n }\n onSave() {\n return new Promise((resolve, reject) => {\n this.updateFreeTextAnnotation().then(() => {\n this.remove();\n resolve();\n });\n });\n }\n close() {\n this.updateFreeTextAnnotation().then(() => {\n this.remove();\n });\n }\n onRemove() {\n this.removeHtmlElements();\n this.editorElement = null;\n this.freetextAnnotation = null;\n const toolbarElement = this.module.toolbarElement;\n toolbarElement.innerHTML = '';\n this.store.viewer.endModule(moduleLayerName);\n }\n render(timestamp, state) {\n if (state.viewer.modeChanged && state.viewer.selectedModuleName !== moduleLayerName) {\n this.remove();\n return;\n }\n if (this.editorElement && state.pointer.action === 'click') {\n const insideHorizontal = state.pointer.x.cssPixels > this.editorElement.offsetLeft &&\n state.pointer.x.cssPixels < this.editorElement.offsetLeft + this.editorElement.offsetWidth;\n const insideVertical = state.pointer.y.cssPixels > this.editorElement.offsetTop &&\n state.pointer.y.cssPixels < this.editorElement.offsetTop + this.editorElement.offsetHeight;\n if (!insideHorizontal || !insideVertical) {\n this.updateFreeTextAnnotation();\n this.remove();\n return;\n }\n }\n if (this.editorElement && this.freetextAnnotation && this.richTextEditor) {\n const updatePosition = state.canvas.canvasInvalidated || state.viewer.modeChanged;\n if (updatePosition) {\n const screenRect = this.pdfApi.transformPdfPageRectToScreenRect(this.freetextAnnotation.pdfRect);\n this.editorElement.style.left = `${screenRect.x / devicePixelRatio}px`;\n this.editorElement.style.top = `${screenRect.y / devicePixelRatio}px`;\n const width = screenRect.w / devicePixelRatio;\n const height = screenRect.h / devicePixelRatio;\n const rotation = (this.freetextAnnotation.rotation + state.document.rotation) % 360;\n this.editorElement.style.transform = `rotate(${rotation}deg)`;\n if (rotation == 90) {\n this.editorElement.style.width = `${height}px`;\n this.editorElement.style.height = `${width}px`;\n this.editorElement.style.transformOrigin = `${width / 2}px ${width / 2}px`;\n }\n else if (rotation == 180) {\n this.editorElement.style.width = `${width}px`;\n this.editorElement.style.height = `${height}px`;\n this.editorElement.style.transformOrigin = `${width / 2}px ${height / 2}px`;\n }\n else if (rotation == 270) {\n this.editorElement.style.width = `${height}px`;\n this.editorElement.style.height = `${width}px`;\n this.editorElement.style.transformOrigin = `${height / 2}px ${height / 2}px`;\n }\n else {\n this.editorElement.style.width = `${width}px`;\n this.editorElement.style.height = `${height}px`;\n }\n }\n if (state.document.zoomChanged || state.viewer.modeChanged) {\n this.richTextEditor.setZoom(state.document.zoom);\n }\n }\n }\n executeCommand(cmd) {\n var _a;\n switch (cmd.cmd) {\n case 'setFont': {\n this.options.annotation.fonts.freetextFontFamily = cmd.args;\n break;\n }\n case 'setFontSize': {\n this.options.annotation.fonts.freetextFontSize = cmd.args;\n break;\n }\n }\n (_a = this.richTextEditor) === null || _a === void 0 ? void 0 : _a.executeCommand(cmd);\n }\n updateFreeTextAnnotation() {\n const promise = new Promise((resolve, reject) => {\n if (this.richTextEditor && this.freetextAnnotation) {\n const richTextObj = this.richTextEditor.getEditorValues();\n const subject = this.toolbarView\n ? this.toolbarView.getState().updatedSubject\n : this.freetextAnnotation.subject;\n if (this.options.annotation.trackHistory) {\n addHistoryEntry(this.freetextAnnotation, 'edit', this.options.viewer.general.user, richTextObj.content, subject);\n }\n const fontColor = new Color(richTextObj.fontColor);\n const backgroundColor = richTextObj.backgroundColor === ''\n ? null\n : new Color(richTextObj.backgroundColor);\n this.freetextAnnotation.content = richTextObj.content;\n this.freetextAnnotation.subject = subject;\n this.freetextAnnotation.richText = richTextObj.richText;\n this.freetextAnnotation.fontColor = fontColor.toHexRgb();\n this.freetextAnnotation.fontName =\n richTextObj.fontName !== null ? richTextObj.fontName : 'Helvetica';\n this.freetextAnnotation.fontSize = richTextObj.fontSizeCSS\n ? convertCssToPdfPixel(richTextObj.fontSizeCSS)\n : this.freetextAnnotation.fontSize;\n this.freetextAnnotation.color = backgroundColor !== null ? backgroundColor.toRgba() : null;\n this.freetextAnnotation.border.width = richTextObj.borderWidth;\n this.pdfApi\n .updateItem(this.freetextAnnotation)\n .then((item) => {\n this.store.annotations.updateAnnotation(item);\n resolve();\n })\n .catch((err) => {\n console.error(err);\n reject();\n });\n }\n });\n return promise;\n }\n}\n","import { app, h } from '../../lib/hyperapp';\nimport { translationManager } from '../../common/TranslationManager';\nimport { Toolbar } from '../../common/Toolbar';\nimport { ToolbarItemGroup } from '../../common/ToolbarItemGroup';\nimport { ToolbarButton } from '../../common/ToolbarButton';\nimport { Dropdown } from '../../common/Dropdown';\nimport { ColorPicker } from '../../common/ColorPicker';\nimport { icons } from '../../common/icons';\nimport { ToolbarSeparator } from '../../common/ToolbarSeparator';\nimport { StrokeWidthPicker } from '../../common/StrokeWidthPicker';\nexport const createEditFreetextAnnotationToolbar = (props, element) => {\n const state = {\n annotation: props.annotation,\n updatedSubject: props.annotation.subject,\n backgroundColors: props.backgroundColors,\n borderWidths: props.borderWidths,\n selectedBorderWidth: props.selectedBorderWidth,\n fontColors: props.fontColors,\n fontFamilies: props.fontFamilies,\n fontSizes: props.fontSizes,\n selectedFont: props.selectedFont,\n selectedBackgroundColor: props.selectedBackgroundColor,\n selectedFontColor: props.selectedFontColor,\n selectedFontSize: props.selectedFontSize,\n hasRangeSelection: false,\n };\n const actions = {\n getState: () => ($state) => $state,\n setBorderWith: (borderWidth) => ($state) => {\n props.onCmd({ cmd: 'setBorderWidth', args: borderWidth });\n return Object.assign(Object.assign({}, $state), { selectedBorderWidth: borderWidth });\n },\n executeCommand: (cmd) => ($state) => {\n props.onCmd(cmd);\n return $state;\n },\n setFontFamily: (fontName) => ($state) => {\n props.onCmd({ cmd: 'setFont', args: fontName });\n return Object.assign(Object.assign({}, $state), { selectedFont: fontName });\n },\n setFontSize: (fontSize) => ($state) => {\n props.onCmd({ cmd: 'setFontSize', args: fontSize });\n return Object.assign(Object.assign({}, $state), { selectedFontSize: `${fontSize}pt` });\n },\n setFontColor: (color) => ($state) => {\n props.onCmd({ cmd: 'setFontColor', args: color });\n return Object.assign(Object.assign({}, $state), { selectedFontColor: color });\n },\n setBackgroundColor: (color) => ($state) => {\n props.onCmd({ cmd: 'setFillColor', args: color });\n return Object.assign(Object.assign({}, $state), { selectedBackgroundColor: color });\n },\n setSubject: (subject) => ($state) => {\n return Object.assign(Object.assign({}, $state), { annotation: $state.annotation, updatedSubject: subject });\n },\n hasRangeSelectionChanged: (hasRangeSelection) => ($state) => (Object.assign(Object.assign({}, $state), { hasRangeSelection })),\n close: () => ($state) => {\n props.onClose();\n return $state;\n },\n };\n const App = () => (h(EditFreetextAnnotationToolbar, { hideAnnotationSubject: props.hideAnnotationSubject }));\n const EditFreetextAnnotationToolbar = ({ hideAnnotationSubject }) => ($state, $actions) => (h(Toolbar, { allowWrap: true, alignCenter: true },\n h(ToolbarItemGroup, null,\n h(Dropdown, { tooltip: translationManager.getText('annotFreeText.fontFamily'), text: $state.selectedFont, value: $state.selectedFont, width: 150, items: $state.fontFamilies.map((font) => ({\n text: font,\n value: font,\n })), onChange: $actions.setFontFamily }),\n h(Dropdown, { tooltip: translationManager.getText('annotFreeText.fontSize'), text: $state.selectedFontSize, value: $state.selectedFontSize, width: 85, align: \"right\", items: $state.fontSizes.map((size, index) => ({\n text: `${size}pt`,\n value: size,\n })), onChange: $actions.setFontSize }),\n h(ToolbarSeparator, null)),\n h(ToolbarItemGroup, null,\n h(ColorPicker, { tooltip: translationManager.getText('annotFreeText.fontColor'), colors: $state.fontColors, icon: icons.fontColor, color: $state.selectedFontColor, onChange: $actions.setFontColor }),\n h(ColorPicker, { tooltip: translationManager.getText('annotFreeText.bgColor'), colors: $state.backgroundColors, icon: icons.fillColor, color: $state.selectedBackgroundColor, onChange: $actions.setBackgroundColor }),\n h(StrokeWidthPicker, { tooltip: translationManager.getText('annotFreeText.borderWidth'), noneStrokeText: translationManager.getText('border.none'), strokeWidths: $state.borderWidths, value: $state.selectedBorderWidth, onChange: $actions.setBorderWith }),\n h(ToolbarSeparator, null)),\n h(ToolbarItemGroup, null,\n h(ToolbarButton, { tooltip: translationManager.getText('annotFreeText.alignLeft'), icon: icons.alignLeft, onClick: () => {\n $actions.executeCommand({ cmd: 'justifyLeft' });\n } }),\n h(ToolbarButton, { tooltip: translationManager.getText('annotFreeText.alignCenter'), icon: icons.alignCenter, onClick: () => {\n $actions.executeCommand({ cmd: 'justifyCenter' });\n } }),\n h(ToolbarButton, { tooltip: translationManager.getText('annotFreeText.alignRight'), icon: icons.alignRight, onClick: () => {\n $actions.executeCommand({ cmd: 'justifyRight' });\n } }),\n h(ToolbarSeparator, null)),\n h(ToolbarItemGroup, null,\n h(ToolbarButton, { tooltip: translationManager.getText('annotFreeText.bold'), icon: icons.bold, onClick: () => {\n $actions.executeCommand({ cmd: 'bold' });\n } }),\n h(ToolbarButton, { tooltip: translationManager.getText('annotFreeText.italic'), icon: icons.italic, onClick: () => {\n $actions.executeCommand({ cmd: 'italic' });\n } }),\n h(ToolbarButton, { tooltip: translationManager.getText('annotFreeText.underline'), icon: icons.underline, onClick: () => {\n $actions.executeCommand({ cmd: 'underline' });\n } }),\n h(ToolbarSeparator, null)),\n props.allowLockAnnotations && (h(ToolbarItemGroup, null,\n h(ToolbarButton, { tooltip: translationManager.getText($state.annotation.isLocked() ? 'annotFreeText.unlock' : 'annotFreeText.lock'), icon: $state.annotation.isLocked() ? icons.lock : icons.unlock, onClick: () => {\n $state.annotation.setLock(!$state.annotation.isLocked());\n $actions.close();\n } }),\n h(ToolbarSeparator, null))),\n !hideAnnotationSubject && (h(ToolbarItemGroup, null,\n h(\"div\", { class: 'pwv-freetext-subject' },\n h(\"input\", { id: 'pwv-freetext-subject-' + $state.annotation.id, placeholder: translationManager.getText('annotFreeText.subjectPlaceholder'), onchange: (e) => {\n $actions.setSubject(e.currentTarget.value);\n }, value: $state.updatedSubject })))),\n h(ToolbarItemGroup, { pushRight: true },\n h(ToolbarButton, { icon: icons.ok, onClick: $actions.close }))));\n return app(state, actions, App, element);\n};\n","import { CanvasModule, CanvasModuleType } from '../CanvasModule';\nimport { AddFreetextAnnotationLayer } from './AddFreetextAnnotationLayer';\nimport { PdfItemType } from '../../pdf-viewer-api';\nimport { icons } from '../../common/Icon';\nimport { translationManager } from '../../common/TranslationManager';\nimport { EditFreetextAnnotationLayer } from './EditFreetextAnnotationLayer';\nexport class FreetextAnnotationModule extends CanvasModule {\n constructor() {\n super();\n this.annotationbarElement = null;\n this.toolbarElement = null;\n this.name = FreetextAnnotationModule.moduleInfo.name;\n this.onEdit = this.onEdit.bind(this);\n }\n onRegister() {\n this.toolbarElement = document.createElement('div');\n return {\n toolbar: this.toolbarElement,\n contextbar: {\n itemTypes: [PdfItemType.FREE_TEXT],\n icon: icons.edit,\n tooltip: translationManager.getText('annotFreeText.edit'),\n onCmd: (annotationId) => {\n this.onEdit(annotationId);\n },\n },\n };\n }\n activate(annotationId) {\n if (annotationId) {\n this.onEdit(annotationId);\n }\n else {\n if (!this.canvasLayers['add']) {\n if (this.store) {\n this.store.viewer.deselectAnnotation();\n }\n this.createCanvasLayer('add', AddFreetextAnnotationLayer);\n }\n else {\n this.removeCanvasLayer('add');\n }\n }\n }\n onEdit(annotationId) {\n this.createCanvasLayer('edit', EditFreetextAnnotationLayer, annotationId);\n }\n}\nFreetextAnnotationModule.moduleInfo = {\n name: 'FreetextAnnotationModule',\n moduleType: CanvasModuleType.Tool,\n requiredFeatures: {\n annotate: true,\n fillFormFields: false,\n },\n translationKey: 'annotFreeText.add',\n icon: 'freeText',\n};\n","import { Color } from '../../common/Color';\nimport { convertPdfToCssPixel, roundToTwo } from '../../common/Tools';\nexport class RichTextEditor {\n constructor(element, content) {\n this.hasRangeSelection = false;\n this.executeCommand = this.executeCommand.bind(this);\n this.handleOnPaste = this.handleOnPaste.bind(this);\n this.handleSelectionChange = this.handleSelectionChange.bind(this);\n this.content = content;\n this.element = element;\n this.element.style.background = 'white';\n this.element.classList.add('pwv-freetexteditor');\n this.editorElement = document.createElement('iframe');\n this.editorElement.width = '100%';\n this.editorElement.height = '100%';\n this.editorElement.frameBorder = '0';\n this.editorElement.style.transformOrigin = '0 0';\n this.element.appendChild(this.editorElement);\n this.editorDocument = this.editorElement.contentDocument;\n this.editorDocument.open();\n this.editorDocument.close();\n let text = content.richText;\n text = text.replace(/\\&#(10|13|x0A|x0D);/gi, '<br>');\n text = text.replace(/<p\\s*([^>]*)>/gi, '<div $1>');\n text = text.replace(/<\\/p>\\s*<br\\/*>/gi, '</div>');\n text = text.replace(/<br\\/*>\\s*<\\/p>\\s*/gi, '</div>');\n text = text.replace(/<\\/p>/gi, '</div>');\n text = text.replace(/\\r?\\n|\\r/g, '');\n const m = /.*(<body.*<\\/body>).*/gi.exec(text);\n this.editorDocument.body.outerHTML =\n m && m.length > 1\n ? m[1]\n : '<?xml version=\"1.0\"?><body xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:xfa=\"http://www.xfa.org/schema/xfa-data/1.0/\" xfa:APIVersion=\"Acrobat:19.12.0\" xfa:spec=\"2.0.2\"><p></p></body>';\n if (this.editorDocument.body.children.length === 0) {\n if (this.editorDocument.body.childNodes.length === 1 &&\n this.editorDocument.body.childNodes[0].nodeType === Node.TEXT_NODE) {\n this.editorDocument.body.innerHTML = `<p>${this.editorDocument.body.childNodes[0].textContent}</p>`;\n }\n else {\n this.editorDocument.body.innerHTML = '<div><br/></div>';\n }\n }\n else {\n this.editorDocument.body.childNodes.forEach((node) => {\n if (node.nodeName === 'DIV' && node.childNodes.length === 0) {\n const br = document.createElement('br');\n node.appendChild(br);\n }\n });\n }\n this.editorDocument.body.addEventListener('input', (e) => {\n if (this.editorDocument.body.innerHTML === '' ||\n this.editorDocument.body.innerHTML === '<br>') {\n this.editorDocument.body.innerHTML = '<div><br/></div>';\n }\n });\n this.editorDocument.body.addEventListener('keydown', (e) => {\n if (e.key === 'Tab') {\n e.preventDefault();\n }\n else if (e.key === 'Enter') {\n this.editorDocument.execCommand('formatBlock', false, 'div');\n }\n });\n this.editorDocument.head.insertAdjacentHTML('beforeend', `<style>\n body {\n padding: 1px;\n line-height: 1.2;\n margin: 0;\n height: 100%;\n box-sizing: border-box;\n white-space: pre-wrap:\n overflow: hidden;\n } \n p {\n margin: 0;\n }\n </style>`);\n this.editorDocument.body.style.fontFamily = content.fontName;\n this.editorDocument.body.style.color = content.fontColor;\n this.editorDocument.body.style.fontSize = content.fontSizeCSS;\n this.editorDocument.body.style.backgroundColor = content.backgroundColor;\n this.editorDocument.body.style.borderColor = '#000000';\n this.editorDocument.body.style.borderStyle = 'solid';\n this.editorDocument.body.style.borderWidth = `${content.borderWidth}px`;\n this.editorDocument.designMode = 'on';\n this.editorDocument.addEventListener('paste', this.handleOnPaste, false);\n this.editorDocument.addEventListener('selectionchange', this.handleSelectionChange, false);\n this.editorDocument.addEventListener('mousewheel', (e) => {\n e.preventDefault();\n e.cancelBubble = true;\n }, { passive: false });\n this.editorDocument.body.setAttribute('tabindex', '1');\n window.setTimeout(() => {\n var _a;\n let range = this.editorDocument.createRange();\n range.setStart(this.editorDocument.body, 0);\n range.setEnd(this.editorDocument.body, this.editorDocument.body.children.length);\n range.collapse();\n (_a = this.editorDocument.getSelection()) === null || _a === void 0 ? void 0 : _a.addRange(range);\n this.editorDocument.body.focus();\n }, 1);\n }\n setZoom(zoom) {\n this.editorElement.style.transform = `scale(${zoom})`;\n this.editorElement.width = this.element.clientWidth / zoom + 'px';\n this.editorElement.height = this.element.clientHeight / zoom + 'px';\n }\n getEditorValues() {\n const richText = '<?xml version=\"1.0\"?>' + this.cleanupRichText(this.editorDocument.body.outerHTML);\n const pureContent = this.getContent(richText);\n return Object.assign(Object.assign({}, this.content), { content: pureContent ? pureContent : '', backgroundColor: this.editorDocument.body.style.backgroundColor, fontColor: this.editorDocument.body.style.color, fontName: this.editorDocument.body.style.fontFamily, fontSizeCSS: this.editorDocument.body.style.fontSize, richText });\n }\n executeCommand(cmd) {\n switch (cmd.cmd) {\n case 'setFont': {\n this.content.fontName = cmd.args;\n this.editorDocument.body.style.fontFamily = cmd.args;\n break;\n }\n case 'setFontColor': {\n this.content.fontColor = cmd.args;\n this.editorDocument.body.style.color = cmd.args;\n break;\n }\n case 'setBorderWidth': {\n this.content.borderWidth = cmd.args;\n this.editorDocument.body.style.borderWidth = `${cmd.args}px`;\n break;\n }\n case 'setFontSize': {\n const size = convertPdfToCssPixel(cmd.args);\n this.content.fontSizeCSS = size;\n this.editorDocument.body.style.fontSize = size;\n break;\n }\n case 'setFillColor': {\n this.content.backgroundColor = cmd.args;\n this.editorDocument.body.style.backgroundColor = cmd.args;\n break;\n }\n default: {\n this.editorDocument.execCommand(cmd.cmd, false, cmd.args);\n }\n }\n }\n cleanupRichText(richText) {\n let text = richText;\n text = text.replace(/<div><br><\\/div>/gi, ' ');\n text = text.replace(/<div\\s*([^>]*)\\>/gi, '<p $1>');\n text = text.replace(/<\\/div\\>/gi, '</p> ');\n text = text.replace(/<p\\s*>/gi, '<p>');\n text = text.replace(/\\<br\\>/gi, ' ');\n text = text.replace(/(\\n|\\r)/gi, '');\n text = text.replace(/<u>/gi, '<span style=\"text-decoration:underline;\">');\n text = text.replace(/<\\/u>/gi, '</span>');\n text = text.replace(/\\ \\;/gi, ' ');\n text = text.replace(/overflow\\:.*?\\;/gi, '');\n text = text.replace(/background-color\\:.*?\\;/gi, '');\n text = text.replace(/border\\:.*?\\;/gi, '');\n text = text.replace(/border-color\\:.*?\\;/gi, '');\n text = text.replace(/border-style\\:.*?\\;/gi, '');\n text = text.replace(/border-width\\:.*?\\;/gi, '');\n text = text.replace(/font-size\\:\\s*(\\d*\\.?\\d+)px\\s*\\;/gi, (_, size) => {\n size = parseFloat(size);\n size = roundToTwo((size / 96) * 72);\n return 'font-size:' + size + 'pt;';\n });\n text = text.replace(/rgb\\((.+?)\\)/gi, (rgb) => {\n return new Color(rgb).toHexRgb();\n });\n text = text.replace(/style=\"(.*?)\"/gi, (styles) => {\n return styles.replace(/\\s*/gi, '');\n });\n return text;\n }\n getContent(richText) {\n const parser = new DOMParser();\n const node = parser.parseFromString(richText, 'text/html').documentElement;\n let nodes = node ? node.querySelector('*') : null;\n if (nodes) {\n while (true) {\n nodes = nodes.nextSibling;\n if (nodes) {\n if (nodes.nodeName.toLocaleLowerCase() === 'body') {\n return nodes.innerText;\n }\n }\n else {\n break;\n }\n }\n }\n return null;\n }\n handleOnPaste(e) {\n e.preventDefault();\n const text = e.clipboardData.getData('text/plain');\n if (text) {\n this.executeCommand({\n cmd: 'insertText',\n args: text,\n });\n }\n }\n handleSelectionChange(e) { }\n}\n","import { CanvasLayer } from '../CanvasLayer';\nimport { PdfItemType, } from '../../pdf-viewer-api';\nimport { CursorStyle } from '../../pdf-viewer-canvas/state/viewer';\nimport { renderTextSelection } from '../../pdf-viewer-canvas/view-layers/canvasShapes';\nimport { Color } from '../../common/Color';\nimport { createAddHighlightAnnotationToolbar } from './AddHighlightAnnotationToolbar';\nimport { getRectFromSelection } from '../../pdf-viewer-canvas/state/document';\nexport var HighlightTool;\n(function (HighlightTool) {\n HighlightTool[HighlightTool[\"HIGHLIGHT\"] = 0] = \"HIGHLIGHT\";\n HighlightTool[HighlightTool[\"RECTANGULAR_HIGHLIGHT\"] = 1] = \"RECTANGULAR_HIGHLIGHT\";\n HighlightTool[HighlightTool[\"UNDERLINE\"] = 2] = \"UNDERLINE\";\n HighlightTool[HighlightTool[\"SQUIGGLY\"] = 3] = \"SQUIGGLY\";\n HighlightTool[HighlightTool[\"STRIKE_OUT\"] = 4] = \"STRIKE_OUT\";\n})(HighlightTool || (HighlightTool = {}));\nconst moduleLayerName = 'AddHighlightAnnotation';\nexport class AddHighlightAnnotationLayer extends CanvasLayer {\n constructor() {\n super(...arguments);\n this.colors = [];\n this.selectedColor = '';\n this.selectedTool = HighlightTool.HIGHLIGHT;\n this.pdfStartPoint = null;\n this.screenStartPoint = null;\n this.pointerDown = false;\n this.page = 0;\n this.selecting = false;\n this.selection = null;\n }\n onCreate() {\n this.setColor = this.setColor.bind(this);\n this.close = this.close.bind(this);\n this.setTool = this.setTool.bind(this);\n this.context = this.createCanvas();\n const annotationOptions = this.options.annotation;\n this.colors = annotationOptions.colors.highlightColors;\n this.selectedColor = annotationOptions.colors.highlightAnnotationColor;\n const toolbarElement = this.module.toolbarElement;\n createAddHighlightAnnotationToolbar({\n colors: this.colors,\n selectedColor: this.selectedColor,\n selectedTool: this.selectedTool,\n onColorChanged: this.setColor,\n onToolChanged: this.setTool,\n onClose: this.close,\n }, toolbarElement);\n this.store.viewer.beginModule(moduleLayerName);\n }\n onSave() {\n const promise = new Promise((resolve, reject) => {\n resolve();\n });\n return promise;\n }\n onRemove() {\n this.removeCanvasElements();\n this.context = null;\n const toolbarElement = this.module.toolbarElement;\n toolbarElement.innerHTML = '';\n this.store.viewer.endModule(moduleLayerName);\n }\n render(timestamp, state) {\n if (state.viewer.modeChanged && state.viewer.selectedModuleName !== moduleLayerName) {\n this.remove();\n return;\n }\n if (this.context) {\n if (this.selectedTool === HighlightTool.RECTANGULAR_HIGHLIGHT) {\n const ctx = this.context;\n ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);\n const pointerPos = {\n x: state.pointer.x.devicePixels,\n y: state.pointer.y.devicePixels,\n };\n const pointerPdfPos = this.pdfApi.transformScreenPointToPdfPoint(pointerPos);\n if (pointerPdfPos.isOnPage) {\n this.store.viewer.setCursorStyle(CursorStyle.CROSSHAIR);\n }\n else {\n this.store.viewer.setCursorStyle(CursorStyle.NOT_ALLOWED);\n }\n if (state.pointer.isDown) {\n if (!this.pointerDown) {\n this.screenStartPoint = pointerPos;\n this.pointerDown = true;\n if (this.page === 0 && pointerPdfPos.isOnPage) {\n this.page = pointerPdfPos.pdfPoint.page;\n }\n }\n if (this.screenStartPoint) {\n const rect = getRectFromSelection(state.document, {\n x: this.screenStartPoint.x,\n y: this.screenStartPoint.y,\n }, {\n x: pointerPos.x,\n y: pointerPos.y,\n }, this.page);\n if (rect) {\n const lineWidth = 2 * devicePixelRatio;\n ctx.save();\n ctx.strokeStyle = this.options.viewer.general.textSelectionColor;\n ctx.fillStyle = this.options.viewer.general.textSelectionColor;\n ctx.lineWidth = lineWidth;\n ctx.setLineDash([lineWidth, lineWidth]);\n ctx.strokeRect(rect.x, rect.y, rect.w, rect.h);\n ctx.globalAlpha = 0.33;\n ctx.fillRect(rect.x, rect.y, rect.w, rect.h);\n ctx.restore();\n }\n }\n }\n else if (this.pointerDown && this.screenStartPoint) {\n const rect = getRectFromSelection(state.document, {\n x: this.screenStartPoint.x,\n y: this.screenStartPoint.y,\n }, {\n x: pointerPos.x,\n y: pointerPos.y,\n }, this.page);\n if (rect) {\n this.createRectangularHighlightAnnotation(rect);\n this.pointerDown = false;\n this.screenStartPoint = null;\n this.page = 0;\n }\n }\n }\n else {\n let drawSelection = state.canvas.canvasInvalidated;\n if (state.pointer.positionChanged) {\n const pointerPos = {\n x: state.pointer.x.devicePixels,\n y: state.pointer.y.devicePixels,\n };\n const pointerPdfPos = this.pdfApi.transformScreenPointToPdfPoint(pointerPos);\n let currentTextFragment = null;\n if (pointerPdfPos.isOnPage) {\n currentTextFragment = this.pdfApi.getTextFragmentOnPoint(pointerPos);\n if (currentTextFragment) {\n this.store.viewer.setCursorStyle(CursorStyle.TEXT);\n }\n else {\n this.store.viewer.setCursorStyle(CursorStyle.DEFAULT);\n }\n }\n else {\n this.store.viewer.setCursorStyle(CursorStyle.DEFAULT);\n }\n if (state.pointer.stateChanged) {\n if (state.pointer.isDown) {\n if (pointerPdfPos.isOnPage) {\n if (currentTextFragment) {\n const startPdfPos = pointerPdfPos;\n this.selecting = true;\n this.selection = null;\n this.pdfStartPoint = startPdfPos.pdfPoint;\n drawSelection = true;\n }\n }\n }\n else {\n if (this.selecting) {\n const ctx = this.context;\n ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);\n this.createHighlightAnnotation();\n this.selecting = false;\n }\n }\n }\n if (this.selecting &&\n this.pdfStartPoint &&\n this.pdfStartPoint !== pointerPdfPos.pdfPoint) {\n const endPoint = this.pdfApi.getClosestPointOnPdfByScreenPoint(pointerPos);\n this.selection = this.pdfApi.getTextSelection(this.pdfStartPoint, endPoint);\n }\n drawSelection = true;\n }\n if (drawSelection && this.selection) {\n const ctx = this.context;\n ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);\n const screenSelection = [];\n for (let i = 0; i < this.selection.quadrilaterals.length; i++) {\n const path = this.pdfApi.transformQuadrilateralToViewport(this.selection.quadrilaterals[i]);\n screenSelection.push(path);\n }\n renderTextSelection(ctx, devicePixelRatio * state.document.zoom, this.options.viewer.general.textSelectionColor, screenSelection);\n }\n }\n }\n }\n setColor(color) {\n this.selectedColor = color;\n this.options.annotation.colors.highlightAnnotationColor = color;\n }\n setTool(tool) {\n this.selectedTool = tool;\n }\n close() {\n this.remove();\n }\n getPdfItemTypeForTool() {\n switch (this.selectedTool) {\n case HighlightTool.HIGHLIGHT:\n return PdfItemType.HIGHLIGHT;\n case HighlightTool.RECTANGULAR_HIGHLIGHT:\n return PdfItemType.HIGHLIGHT;\n case HighlightTool.UNDERLINE:\n return PdfItemType.UNDERLINE;\n case HighlightTool.SQUIGGLY:\n return PdfItemType.SQUIGGLY;\n case HighlightTool.STRIKE_OUT:\n return PdfItemType.STRIKE_OUT;\n default:\n throw new Error('unknown Highlight tool');\n }\n }\n createRectangularHighlightAnnotation(rect) {\n const pdfRect = this.pdfApi.transformScreenRectToPdfRect(rect, this.page);\n const colorObj = new Color(this.selectedColor);\n colorObj.setOpacity(this.options.annotation.highlightOpacity);\n const color = colorObj.toRgba();\n const quadrilaterals = [];\n quadrilaterals.push({\n pageNumber: this.page,\n bottomLeft: { x: pdfRect.pdfX, y: pdfRect.pdfY },\n bottomRight: { x: pdfRect.pdfX + pdfRect.pdfW, y: pdfRect.pdfY },\n topLeft: { x: pdfRect.pdfX, y: pdfRect.pdfY + pdfRect.pdfH },\n topRight: { x: pdfRect.pdfX + pdfRect.pdfW, y: pdfRect.pdfY + pdfRect.pdfH },\n });\n const args = {\n itemType: PdfItemType.HIGHLIGHT,\n page: this.page,\n pdfRect,\n color,\n author: this.options.viewer.general.user,\n quadrilaterals,\n };\n this.pdfApi.createItem(args).then((item) => {\n this.onAnnotationCreated(item);\n });\n }\n createHighlightAnnotation() {\n if (this.pdfApi && this.store) {\n const pdfItemType = this.getPdfItemTypeForTool();\n const selection = this.selection;\n this.selection = null;\n if (selection) {\n const selByPage = [];\n for (let i = 0; i < selection.quadrilaterals.length; i++) {\n const quadrilateral = selection.quadrilaterals[i];\n if (!selByPage[quadrilateral.pageNumber]) {\n selByPage[quadrilateral.pageNumber] = [];\n }\n selByPage[quadrilateral.pageNumber].push(quadrilateral);\n }\n let color = this.selectedColor;\n if (pdfItemType === PdfItemType.HIGHLIGHT) {\n const colorObj = new Color(color);\n colorObj.setOpacity(this.options.annotation.highlightOpacity);\n color = colorObj.toRgba();\n }\n for (let i = 0; i < selByPage.length; i++) {\n if (selByPage[i]) {\n const quadrilaterals = selByPage[i];\n const args = {\n itemType: pdfItemType,\n page: i,\n pdfRect: {\n pdfX: 0,\n pdfY: 0,\n pdfW: 0,\n pdfH: 0,\n page: i,\n },\n color,\n author: this.options.viewer.general.user,\n quadrilaterals,\n };\n this.pdfApi.createItem(args).then((item) => {\n this.onAnnotationCreated(item);\n });\n }\n }\n }\n }\n }\n}\n","import { app, h } from '../../lib/hyperapp';\nimport { translationManager } from '../../common/TranslationManager';\nimport { Toolbar } from '../../common/Toolbar';\nimport { ToolbarItemGroup } from '../../common/ToolbarItemGroup';\nimport { ToolbarButton } from '../../common/ToolbarButton';\nimport { icons } from '../../common/icons';\nimport { ToolbarSeparator } from '../../common/ToolbarSeparator';\nimport { ColorPicker } from '../../common/ColorPicker';\nimport { HighlightTool } from './AddHighlightAnnotationLayer';\nexport const createAddHighlightAnnotationToolbar = (props, element) => {\n const state = {\n colors: props.colors,\n selectedTool: props.selectedTool,\n selectedColor: props.selectedColor,\n };\n const actions = {\n setColor: (color) => ($state) => {\n props.onColorChanged(color);\n return Object.assign(Object.assign({}, $state), { selectedColor: color });\n },\n setTool: (tool) => ($state) => {\n props.onToolChanged(tool);\n return Object.assign(Object.assign({}, $state), { selectedTool: tool });\n },\n };\n const App = () => h(AddHighlightAnnotationToolbar, null);\n const AddHighlightAnnotationToolbar = ({}) => ($state, $actions) => (h(Toolbar, { allowWrap: true, alignCenter: true },\n h(ToolbarItemGroup, null,\n h(ColorPicker, { colors: $state.colors, color: $state.selectedColor, icon: icons.fillColor, mode: \"buttons\", onChange: $actions.setColor }),\n h(ToolbarSeparator, null)),\n h(ToolbarItemGroup, null,\n h(ToolbarButton, { tooltip: translationManager.getText('annotHighlight.highlight'), icon: icons.highlighter, active: $state.selectedTool === HighlightTool.HIGHLIGHT, onClick: () => {\n $actions.setTool(HighlightTool.HIGHLIGHT);\n } }),\n h(ToolbarButton, { tooltip: translationManager.getText('annotHighlight.underline'), icon: icons.underline, active: $state.selectedTool === HighlightTool.UNDERLINE, onClick: () => {\n $actions.setTool(HighlightTool.UNDERLINE);\n } }),\n h(ToolbarButton, { tooltip: translationManager.getText('annotHighlight.squiggly'), icon: icons.squiggly, active: $state.selectedTool === HighlightTool.SQUIGGLY, onClick: () => {\n $actions.setTool(HighlightTool.SQUIGGLY);\n } }),\n h(ToolbarButton, { tooltip: translationManager.getText('annotHighlight.strikeOut'), icon: icons.strikethrough, active: $state.selectedTool === HighlightTool.STRIKE_OUT, onClick: () => {\n $actions.setTool(HighlightTool.STRIKE_OUT);\n } }),\n h(ToolbarButton, { tooltip: translationManager.getText('annotHighlight.rectangularHighlight'), icon: icons.rectangularHighlighter, active: $state.selectedTool === HighlightTool.RECTANGULAR_HIGHLIGHT, onClick: () => {\n $actions.setTool(HighlightTool.RECTANGULAR_HIGHLIGHT);\n } })),\n h(ToolbarItemGroup, { pushRight: true },\n h(ToolbarSeparator, null),\n h(ToolbarButton, { icon: icons.close, onClick: props.onClose }))));\n return app(state, actions, App, element);\n};\n","import { CanvasLayer } from '../CanvasLayer';\nimport { Color } from '../../common/Color';\nimport { createEditHighlightAnnotationToolbar } from './EditHighlightAnnotationToolbar';\nconst moduleLayerName = 'EditHighlightAnnotation';\nexport class EditHighlightAnnotationLayer extends CanvasLayer {\n constructor() {\n super(...arguments);\n this.highlightAnnotation = null;\n this.colors = [];\n this.selectedColor = '';\n }\n onCreate(annotationId) {\n this.highlightAnnotation = this.pdfApi.getItem(annotationId);\n this.setColor = this.setColor.bind(this);\n this.close = this.close.bind(this);\n this.context = this.createCanvas();\n const annotationOptions = this.options.annotation;\n this.colors = annotationOptions.colors.highlightColors;\n this.selectedColor = annotationOptions.colors.highlightAnnotationColor;\n const toolbarElement = this.module.toolbarElement;\n createEditHighlightAnnotationToolbar({\n colors: this.colors,\n selectedColor: this.selectedColor,\n onColorChanged: this.setColor,\n onClose: this.close,\n }, toolbarElement);\n this.store.viewer.beginModule(moduleLayerName);\n }\n onSave() {\n const promise = new Promise((resolve, reject) => {\n resolve();\n });\n return promise;\n }\n onRemove() {\n this.removeCanvasElements();\n this.context = null;\n const toolbarElement = this.module.toolbarElement;\n toolbarElement.innerHTML = '';\n this.store.viewer.endModule(moduleLayerName);\n }\n render(timestamp, state) {\n var _a;\n if (state.viewer.modeChanged && state.viewer.selectedModuleName !== moduleLayerName) {\n this.close();\n return;\n }\n if (state.pointer.action === 'click' || state.pointer.action === 'dblclick') {\n const highlightAnnotation = (_a = this.pdfApi\n .getAnnotationsOnPoint({\n x: state.pointer.x.devicePixels,\n y: state.pointer.y.devicePixels,\n })) === null || _a === void 0 ? void 0 : _a.find((a) => this.highlightAnnotation && a.id === this.highlightAnnotation.id);\n if (!highlightAnnotation) {\n this.close();\n return;\n }\n }\n if (this.context && this.highlightAnnotation) {\n const ctx = this.context;\n ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);\n const rect = this.pdfApi.transformPdfPageRectToScreenRect(this.highlightAnnotation.pdfRect);\n const lineWidth = 2 * devicePixelRatio;\n ctx.save();\n ctx.strokeStyle = this.options.viewer.general.textSelectionColor;\n ctx.lineWidth = lineWidth;\n ctx.setLineDash([lineWidth, lineWidth]);\n ctx.strokeRect(rect.x - lineWidth, rect.y - lineWidth, rect.w + 2 * lineWidth, rect.h + 2 * lineWidth);\n ctx.restore();\n }\n }\n setColor(color) {\n if (this.highlightAnnotation && this.highlightAnnotation.color) {\n const newColor = new Color(color);\n const currentColor = new Color(this.highlightAnnotation.color);\n newColor.setOpacity(currentColor.a);\n this.highlightAnnotation.color = newColor.toRgba();\n this.updateHighlightAnnotation();\n }\n }\n close() {\n this.remove();\n }\n updateHighlightAnnotation() {\n const promise = new Promise((resolve, reject) => {\n if (this.pdfApi && this.highlightAnnotation) {\n this.pdfApi\n .updateItem(this.highlightAnnotation)\n .then((item) => {\n resolve();\n })\n .catch((error) => {\n console.warn(error);\n });\n }\n else {\n reject();\n }\n });\n return promise;\n }\n}\n","import { app, h } from '../../lib/hyperapp';\nimport { Toolbar } from '../../common/Toolbar';\nimport { ToolbarItemGroup } from '../../common/ToolbarItemGroup';\nimport { ToolbarButton } from '../../common/ToolbarButton';\nimport { icons } from '../../common/icons';\nimport { ToolbarSeparator } from '../../common/ToolbarSeparator';\nimport { ColorPicker } from '../../common/ColorPicker';\nexport const createEditHighlightAnnotationToolbar = (props, element) => {\n const state = {\n colors: props.colors,\n selectedColor: props.selectedColor,\n };\n const actions = {\n setColor: (color) => ($state) => {\n props.onColorChanged(color);\n return Object.assign(Object.assign({}, $state), { selectedColor: color });\n },\n };\n const App = () => h(EditHighlightAnnotationToolbar, null);\n const EditHighlightAnnotationToolbar = ({}) => ($state, $actions) => (h(Toolbar, { allowWrap: true, alignCenter: true },\n h(ToolbarItemGroup, null,\n h(ColorPicker, { colors: $state.colors, color: $state.selectedColor, icon: icons.fillColor, mode: \"buttons\", onChange: $actions.setColor })),\n h(ToolbarItemGroup, { pushRight: true },\n h(ToolbarSeparator, null),\n h(ToolbarButton, { icon: icons.close, onClick: props.onClose }))));\n return app(state, actions, App, element);\n};\n","import { CanvasModule, CanvasModuleType } from '../CanvasModule';\nimport { AddHighlightAnnotationLayer } from './AddHighlightAnnotationLayer';\nimport { PdfItemType } from '../../pdf-viewer-api';\nimport { icons } from '../../common/Icon';\nimport { translationManager } from '../../common/TranslationManager';\nimport { EditHighlightAnnotationLayer } from './EditHighlightAnnotationLayer';\nexport class HighlightAnnotationModule extends CanvasModule {\n constructor() {\n super();\n this.toolbarElement = null;\n this.name = HighlightAnnotationModule.moduleInfo.name;\n this.activate = this.activate.bind(this);\n }\n onRegister() {\n this.toolbarElement = document.createElement('div');\n return {\n toolbar: this.toolbarElement,\n contextbar: {\n itemTypes: [\n PdfItemType.HIGHLIGHT,\n PdfItemType.UNDERLINE,\n PdfItemType.SQUIGGLY,\n PdfItemType.STRIKE_OUT,\n ],\n icon: icons.edit,\n tooltip: translationManager.getText('annotHighlight.edit'),\n onCmd: (annotationId) => {\n this.onEdit(annotationId);\n },\n },\n };\n }\n activate() {\n if (!this.canvasLayers['add']) {\n this.createCanvasLayer('add', AddHighlightAnnotationLayer);\n }\n else {\n this.removeCanvasLayer('add');\n }\n }\n onEdit(annotationId) {\n this.createCanvasLayer('edit', EditHighlightAnnotationLayer, annotationId);\n }\n}\nHighlightAnnotationModule.moduleInfo = {\n name: 'HighlightAnnotationModule',\n moduleType: CanvasModuleType.Tool,\n requiredFeatures: {\n annotate: true,\n fillFormFields: false,\n },\n translationKey: 'annotHighlight.add',\n icon: 'highlighter',\n};\n","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { CanvasModule, CanvasModuleType } from '../CanvasModule';\nimport { PdfItemType } from '../../pdf-viewer-api';\nimport { imageDataUrlToUint8Array } from '../../common/Tools';\nimport { MIN_SIZE } from '../../pdf-viewer-canvas/view-layers/views/AnnotationBorder';\nexport class ImageAnnotationModule extends CanvasModule {\n constructor() {\n super();\n this.toolbarElement = null;\n this.fileInput = null;\n this.name = ImageAnnotationModule.moduleInfo.name;\n this.createImage = this.createImage.bind(this);\n this.onFileSelected = this.onFileSelected.bind(this);\n this.createImageStampAnnotation = this.createImageStampAnnotation.bind(this);\n }\n onRegister() {\n this.toolbarElement = document.createElement('div');\n this.fileInput = document.createElement('input');\n this.fileInput.setAttribute('type', 'file');\n this.fileInput.setAttribute('accept', '.jpg, .jpeg, .jpe, .jif, .jfif, .jfi, .jp2, .j2k, .jpf, .jpm, .jpg2, .j2c, .jpc, .jpx, .mj2 .tif, tiff, .png, .gif, .bmp');\n this.fileInput.style.position = 'absolute';\n this.fileInput.style.left = '-5000px';\n this.fileInput.onchange = (e) => {\n if (e.currentTarget.files && e.currentTarget.files.length) {\n const file = e.currentTarget.files[0];\n this.onFileSelected(file);\n e.currentTarget.value = '';\n }\n };\n this.toolbarElement.append(this.fileInput);\n return {\n toolbar: this.toolbarElement,\n };\n }\n activate(file) {\n if (file) {\n this.onFileSelected(file);\n }\n else if (this.fileInput) {\n this.fileInput.click();\n }\n }\n createImage(dataUrl) {\n const image = new Image();\n image.onload = () => {\n const anyUnderMinSize = image.width < MIN_SIZE || image.width < MIN_SIZE;\n let width = image.width;\n let height = image.height;\n if (anyUnderMinSize && width <= height) {\n height = (MIN_SIZE * height) / width;\n width = MIN_SIZE;\n }\n else if (anyUnderMinSize && height < width) {\n width = (MIN_SIZE * width) / height;\n height = MIN_SIZE;\n }\n const imageInfo = {\n width: width,\n height: height,\n stampImage: imageDataUrlToUint8Array(image.src),\n };\n this.createImageStampAnnotation(imageInfo);\n };\n image.src = dataUrl;\n }\n onFileSelected(file) {\n return __awaiter(this, void 0, void 0, function* () {\n const reader = new FileReader();\n const _this = this;\n reader.onload = function (e) {\n _this.createImage(e.target.result);\n };\n reader.readAsDataURL(file);\n });\n }\n createImageStampAnnotation(imageInfo) {\n if (this.pdfApi !== null && this.store !== null && this.options !== null) {\n const state = this.store.getState();\n const document = state.document;\n const canvasRect = this.getCanvasSize();\n const screenCenter = {\n x: canvasRect.width / 2,\n y: canvasRect.height / 2,\n };\n let page = this.pdfApi.getPageNumber();\n const screenRect = {\n x: 0,\n y: 0,\n w: canvasRect.width,\n h: canvasRect.height,\n };\n const pageScreenRect = this.pdfApi.getPageScreenRect(page);\n const x1 = Math.max(screenRect.x, pageScreenRect.x);\n const y1 = Math.max(screenRect.y, pageScreenRect.y);\n const x2 = Math.min(screenRect.w, pageScreenRect.x + pageScreenRect.w);\n const y2 = Math.min(screenRect.h, pageScreenRect.y + pageScreenRect.h);\n const boundingRect = {\n x: x1,\n y: y1,\n w: x2 - x1,\n h: y2 - y1,\n };\n const pageBoundingBox = this.pdfApi.transformScreenRectToPdfRect(boundingRect, page);\n const imagepPdfRect = {\n pdfX: 0,\n pdfY: 0,\n pdfW: imageInfo.width * 0.24,\n pdfH: imageInfo.height * 0.24,\n page,\n };\n if (imagepPdfRect.pdfW > pageBoundingBox.pdfW) {\n const f = (pageBoundingBox.pdfW / imagepPdfRect.pdfW) * 0.97;\n imagepPdfRect.pdfW = imagepPdfRect.pdfW * f;\n imagepPdfRect.pdfH = imagepPdfRect.pdfH * f;\n }\n if (imagepPdfRect.pdfH > pageBoundingBox.pdfH) {\n const f = (pageBoundingBox.pdfH / imagepPdfRect.pdfH) * 0.97;\n imagepPdfRect.pdfW = imagepPdfRect.pdfW * f;\n imagepPdfRect.pdfH = imagepPdfRect.pdfH * f;\n }\n imagepPdfRect.pdfX = (pageBoundingBox.pdfW - imagepPdfRect.pdfW) / 2 + pageBoundingBox.pdfX;\n imagepPdfRect.pdfY = (pageBoundingBox.pdfH - imagepPdfRect.pdfH) / 2 + pageBoundingBox.pdfY;\n this.pdfApi.registerStampImage(imageInfo.stampImage).then((imageId) => {\n if (this.pdfApi !== null && this.options !== null) {\n const annotation = {\n itemType: PdfItemType.STAMP,\n imageId,\n page,\n color: this.options.annotation.colors.defaultHighlightColor,\n pdfRect: imagepPdfRect,\n author: this.options.viewer.general.user,\n };\n this.pdfApi\n .createItem(annotation)\n .then((annot) => {\n const pdfViewerCanvasApi = this.pdfViewerCanvas;\n pdfViewerCanvasApi.dispatchEvent('itemSelected', annot);\n })\n .catch((err) => {\n console.error(err);\n });\n }\n });\n }\n }\n}\nImageAnnotationModule.moduleInfo = {\n name: 'ImageAnnotationModule',\n moduleType: CanvasModuleType.Tool,\n requiredFeatures: {\n annotate: true,\n fillFormFields: false,\n },\n translationKey: 'annotImage.add',\n icon: 'image',\n};\n","export * from './freetext-annotation/FreetextAnnotationModule';\nexport * from './highlight-annotation/HighlightAnnotationModule';\nexport * from './ink-annotation/InkAnnotationModule';\nexport * from './popup/PopupModule';\nexport * from './stamp-annotation/StampAnnotationModule';\nexport * from './text-annotation/TextAnnotationModule';\nexport * from './image-annotations/ImageAnnotationModule';\nexport * from './shape-annotations/ShapeAnnotationModule';\nexport * from './eraser/EraserModule';\nexport * from './print-service/PrintServiceModule';\nexport * from './form-fields/FormFieldModule';\nexport * from './CanvasLayer';\nexport * from './CanvasModule';\n","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { CanvasLayer } from '../CanvasLayer';\nimport { PdfItemType, AnnotationBorderStyle, } from '../../pdf-viewer-api';\nimport { CursorStyle } from '../../pdf-viewer-canvas/state/viewer';\nimport { createAddInkAnnotationToolbar, } from './AddInkAnnotationToolbar';\nimport { Color } from '../../common/Color';\nconst moduleLayerName = 'AddInkAnnotation';\nexport class AddInkAnnotationLayer extends CanvasLayer {\n constructor() {\n super(...arguments);\n this.context = null;\n this.drawing = false;\n this.lines = [];\n this.page = null;\n this.zoom = null;\n this.inkWidth = 1;\n this.penColors = [];\n this.penWidths = [];\n this.penColor = '';\n this.penOpacity = 1;\n this.boundingBox = null;\n this.toolbar = null;\n this.currentAnnotation = null;\n this.isUpdatingAnnotation = false;\n this.pendingUpdate = false;\n this.handlePointerMove = (e) => {\n if (!e.isPrimary) {\n this.handlePointerUp(e);\n return;\n }\n const x = e.offsetX * devicePixelRatio;\n const y = e.offsetY * devicePixelRatio;\n const pdfPoint = this.pdfApi.getClosestPointOnPdfByScreenPoint({ x, y }, this.page);\n this.lines[this.lines.length - 1].push(pdfPoint);\n if (this.context) {\n const screenPoint = this.pdfApi.transformPdfPointToScreenPoint(pdfPoint);\n this.context.lineTo(screenPoint.x, screenPoint.y);\n this.context.stroke();\n }\n };\n this.handlePointerUp = (e) => {\n if (this.context) {\n const { canvas } = this.context;\n canvas.removeEventListener('pointermove', this.handlePointerMove);\n canvas.removeEventListener('pointerup', this.handlePointerUp);\n canvas.removeEventListener('pointercancel', this.handlePointerUp);\n }\n this.endLine();\n };\n }\n onCreate() {\n this.setPenColor = this.setPenColor.bind(this);\n this.setPenSize = this.setPenSize.bind(this);\n this.setPenOpacity = this.setPenOpacity.bind(this);\n this.add = this.add.bind(this);\n this.undo = this.undo.bind(this);\n this.save = this.save.bind(this);\n const annotationOptions = this.options.annotation;\n this.context = this.createCanvas();\n this.penColors = annotationOptions.colors.foregroundColors;\n this.penWidths = annotationOptions.strokeWidths;\n this.inkWidth = annotationOptions.inkWidth;\n this.setPenColor(annotationOptions.colors.inkColor);\n this.setPenOpacity(annotationOptions.colors.inkOpacity);\n this.currentAnnotation = null;\n this.store.viewer.beginModule(moduleLayerName);\n const toolbarElement = this.module.toolbarElement;\n this.toolbar = createAddInkAnnotationToolbar({\n penColors: this.penColors,\n penWidths: this.penWidths,\n selectedPenColor: annotationOptions.colors.inkColor,\n selectedPenSize: annotationOptions.inkWidth,\n penOpacity: annotationOptions.colors.inkOpacity,\n onPenColorChanged: this.setPenColor,\n onPenSizeChanged: this.setPenSize,\n onPenOpacityChanged: this.setPenOpacity,\n onSave: this.save,\n onUndo: this.undo,\n onAdd: this.add,\n onCancel: this.remove,\n }, toolbarElement);\n }\n onSave() {\n const promise = new Promise((resolve) => {\n this.remove();\n resolve();\n });\n return promise;\n }\n onRemove() {\n this.reset();\n this.removeCanvasElements();\n this.context = null;\n const toolbarElement = this.module.toolbarElement;\n toolbarElement.innerHTML = '';\n this.store.viewer.endModule(moduleLayerName);\n }\n render(timestamp, state) {\n if (this.drawing) {\n return;\n }\n if (state.viewer.modeChanged && state.viewer.selectedModuleName !== moduleLayerName) {\n this.remove();\n return;\n }\n if (this.zoom === null || state.document.zoomChanged) {\n this.zoom = state.document.zoom;\n this.drawLines();\n }\n if (state.scroll.leftPositionChanged || state.scroll.topPositionChanged) {\n this.drawLines();\n }\n const pointerPos = {\n x: state.pointer.x.devicePixels,\n y: state.pointer.y.devicePixels,\n };\n const pdfPoint = this.pdfApi.transformScreenPointToPdfPoint(pointerPos);\n if (state.pointer.stateChanged) {\n if (state.pointer.isDown) {\n const page = pdfPoint.isOnPage ? pdfPoint.pdfPoint.page : null;\n if (this.page === null && page) {\n this.page = page;\n }\n if (typeof this.page === 'number' && this.page === page) {\n const pdfPointRes = this.pdfApi.getClosestPointOnPdfByScreenPoint(pointerPos, this.page);\n if (pdfPointRes) {\n this.startLine(pointerPos, pdfPointRes);\n }\n }\n }\n }\n if (state.pointer.positionChanged) {\n if (pdfPoint.isOnPage && (this.page === null || pdfPoint.pdfPoint.page === this.page)) {\n this.store.viewer.setCursorStyle(CursorStyle.CROSSHAIR);\n }\n else {\n this.store.viewer.setCursorStyle(CursorStyle.NOT_ALLOWED);\n }\n }\n }\n startLine(point, pdfPoint) {\n var _a;\n this.lines.push([pdfPoint]);\n this.pdfViewerCanvas.suspendCanvasEvents();\n this.drawing = true;\n if (this.context) {\n const { canvas } = this.context;\n canvas.addEventListener('pointermove', this.handlePointerMove);\n canvas.addEventListener('pointerup', this.handlePointerUp);\n canvas.addEventListener('pointercancel', this.handlePointerUp);\n this.drawLines();\n const ctx = this.context;\n ctx.save();\n ctx.strokeStyle = this.penColor;\n ctx.lineWidth = this.inkWidth * devicePixelRatio * ((_a = this.zoom) !== null && _a !== void 0 ? _a : 1);\n ctx.lineCap = 'round';\n ctx.lineJoin = 'round';\n ctx.moveTo(point.x, point.y);\n }\n }\n endLine() {\n var _a, _b;\n return __awaiter(this, void 0, void 0, function* () {\n this.drawing = false;\n this.pdfViewerCanvas.resumeCanvasEvents();\n (_a = this.context) === null || _a === void 0 ? void 0 : _a.restore();\n this.drawBoundingBox();\n (_b = this.toolbar) === null || _b === void 0 ? void 0 : _b.setLineCount(this.lines.length);\n try {\n yield this.debouncedRecreateInkAnnotation();\n }\n catch (error) {\n console.warn(error);\n }\n });\n }\n drawLines() {\n if (this.context) {\n const ctx = this.context;\n ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);\n const annotationOptions = this.options.annotation;\n ctx.save();\n ctx.strokeStyle = this.penColor;\n ctx.lineWidth = this.inkWidth * devicePixelRatio * this.zoom;\n ctx.lineCap = 'round';\n ctx.lineJoin = 'round';\n this.lines.forEach((pointList) => {\n ctx.beginPath();\n const p1 = this.pdfApi.transformPdfPointToScreenPoint(pointList[0]);\n ctx.moveTo(p1.x, p1.y);\n for (let i = 0; i < pointList.length; i++) {\n const p = this.pdfApi.transformPdfPointToScreenPoint(pointList[i]);\n ctx.lineTo(p.x, p.y);\n }\n ctx.stroke();\n });\n ctx.restore();\n }\n }\n drawBoundingBox() {\n if (this.context && this.lines && this.lines.length > 0) {\n const pdfRect = {\n pdfX: 0,\n pdfY: 0,\n pdfW: 0,\n pdfH: 0,\n page: this.page ? this.page : 0,\n };\n let x1 = 1000000000;\n let x2 = 0;\n let y1 = 1000000000;\n let y2 = 0;\n this.lines.forEach((pointList) => {\n const line = [];\n for (let i = 0; i < pointList.length; i++) {\n const p = pointList[i];\n if (p.pdfX < x1) {\n x1 = p.pdfX;\n }\n if (p.pdfX > x2) {\n x2 = p.pdfX;\n }\n if (p.pdfY < y1) {\n y1 = p.pdfY;\n }\n if (p.pdfY > y2) {\n y2 = p.pdfY;\n }\n }\n });\n pdfRect.pdfX = x1;\n pdfRect.pdfY = y1;\n pdfRect.pdfW = x2 - x1;\n pdfRect.pdfH = y2 - y1;\n const rect = this.pdfApi.transformPdfPageRectToScreenRect(pdfRect);\n const ctx = this.context;\n ctx.save();\n ctx.strokeStyle = this.options.viewer.general.textSelectionColor;\n ctx.lineWidth = 1 * devicePixelRatio;\n ctx.setLineDash([2 * devicePixelRatio, 3 * devicePixelRatio]);\n const p = this.inkWidth * devicePixelRatio;\n const p2 = p * 2;\n ctx.strokeRect(rect.x - p, rect.y - p, rect.w + p2, rect.h + p2);\n ctx.restore();\n }\n }\n setPenColor(color) {\n return __awaiter(this, void 0, void 0, function* () {\n this.options.annotation.colors.inkColor = color;\n this.penColor = color;\n this.drawLines();\n this.drawBoundingBox();\n if (this.lines.length > 0) {\n yield this.debouncedRecreateInkAnnotation();\n }\n });\n }\n setPenOpacity(opacity) {\n return __awaiter(this, void 0, void 0, function* () {\n this.options.annotation.colors.inkOpacity = opacity;\n this.penOpacity = opacity;\n if (this.context) {\n this.context.canvas.style.opacity = `${opacity / 100}`;\n }\n this.drawLines();\n this.drawBoundingBox();\n if (this.lines.length > 0) {\n yield this.debouncedRecreateInkAnnotation();\n }\n });\n }\n setPenSize(size) {\n return __awaiter(this, void 0, void 0, function* () {\n this.inkWidth = size;\n this.options.annotation.inkWidth = size;\n this.drawLines();\n this.drawBoundingBox();\n if (this.lines.length > 0) {\n yield this.debouncedRecreateInkAnnotation();\n }\n });\n }\n debouncedRecreateInkAnnotation() {\n return __awaiter(this, void 0, void 0, function* () {\n if (this.isUpdatingAnnotation) {\n this.pendingUpdate = true;\n return;\n }\n this.isUpdatingAnnotation = true;\n this.pendingUpdate = false;\n try {\n yield this.recreateInkAnnotation();\n if (this.pendingUpdate) {\n this.pendingUpdate = false;\n yield this.recreateInkAnnotation();\n }\n }\n catch (error) {\n console.warn(error);\n }\n finally {\n this.isUpdatingAnnotation = false;\n }\n });\n }\n reset() {\n this.lines = [];\n this.page = null;\n this.currentAnnotation = null;\n this.boundingBox = null;\n this.isUpdatingAnnotation = false;\n this.pendingUpdate = false;\n if (this.toolbar) {\n this.toolbar.setLineCount(0);\n }\n }\n save() {\n this.reset();\n this.remove();\n }\n add() {\n this.reset();\n this.drawLines();\n }\n undo() {\n return __awaiter(this, void 0, void 0, function* () {\n if (this.lines && this.lines.length > 0) {\n this.lines.pop();\n if (this.lines.length === 0) {\n if (this.currentAnnotation) {\n try {\n yield this.pdfApi.deleteItem(this.currentAnnotation);\n this.currentAnnotation = null;\n }\n catch (error) {\n console.warn(error);\n }\n }\n this.page = null;\n this.boundingBox = null;\n }\n else {\n this.boundingBox = this.getBoundingBox();\n try {\n yield this.recreateInkAnnotation();\n }\n catch (error) {\n console.warn(error);\n }\n }\n if (this.toolbar) {\n this.toolbar.setLineCount(this.lines.length);\n }\n this.store.canvas.setCanvasInvalidated(true);\n this.drawLines();\n this.drawBoundingBox();\n }\n });\n }\n recreateInkAnnotation() {\n const promise = new Promise((resolve, reject) => {\n if (this.pdfApi && this.page && this.lines && this.lines.length > 0) {\n const oldAnnotation = this.currentAnnotation;\n this.createNewInkAnnotation()\n .then(() => {\n if (oldAnnotation) {\n this.pdfApi\n .deleteItem(oldAnnotation)\n .then(() => {\n resolve();\n })\n .catch((error) => {\n resolve();\n });\n }\n else {\n resolve();\n }\n })\n .catch(reject);\n }\n else {\n resolve();\n }\n });\n return promise;\n }\n createNewInkAnnotation() {\n const promise = new Promise((resolve, reject) => {\n if (this.pdfApi && this.page && this.lines && this.lines.length > 0) {\n const inkList = [];\n let x1 = 1000000000;\n let x2 = 0;\n let y1 = 1000000000;\n let y2 = 0;\n this.lines.forEach((pointList) => {\n const line = [];\n for (let i = 0; i < pointList.length; i++) {\n const p = pointList[i];\n if (p.pdfX < x1) {\n x1 = p.pdfX;\n }\n if (p.pdfX > x2) {\n x2 = p.pdfX;\n }\n if (p.pdfY < y1) {\n y1 = p.pdfY;\n }\n if (p.pdfY > y2) {\n y2 = p.pdfY;\n }\n line.push(p.pdfX);\n line.push(p.pdfY);\n }\n inkList.push(line);\n });\n const rgbaColor = new Color(this.options.annotation.colors.inkColor);\n rgbaColor.setOpacity(this.options.annotation.colors.inkOpacity / 100);\n const inkAnnotation = {\n itemType: PdfItemType.INK,\n page: this.page,\n pdfRect: {\n pdfX: x1,\n pdfY: y1,\n pdfW: x2 - x1,\n pdfH: y2 - y1,\n page: this.page,\n },\n color: rgbaColor.toRgba(),\n author: this.options.viewer.general.user,\n border: {\n style: AnnotationBorderStyle.SOLID,\n width: this.options.annotation.inkWidth,\n },\n inkList,\n };\n this.pdfApi\n .createItem(inkAnnotation)\n .then((item) => {\n this.currentAnnotation = item;\n this.onAnnotationCreated(this.currentAnnotation);\n resolve();\n })\n .catch((error) => {\n console.warn(error);\n reject(error);\n });\n }\n else {\n resolve();\n }\n });\n return promise;\n }\n getBoundingBox() {\n const pdfRect = {\n pdfX: 0,\n pdfY: 0,\n pdfW: 0,\n pdfH: 0,\n page: this.page ? this.page : 0,\n };\n if (this.lines && this.lines.length > 0) {\n let x1 = 1000000000;\n let x2 = 0;\n let y1 = 1000000000;\n let y2 = 0;\n this.lines.forEach((pointList) => {\n const line = [];\n for (let i = 0; i < pointList.length; i++) {\n const p = pointList[i];\n if (p.pdfX < x1) {\n x1 = p.pdfX;\n }\n if (p.pdfX > x2) {\n x2 = p.pdfX;\n }\n if (p.pdfY < y1) {\n y1 = p.pdfY;\n }\n if (p.pdfY > y2) {\n y2 = p.pdfY;\n }\n }\n });\n pdfRect.pdfX = x1;\n pdfRect.pdfY = y1;\n pdfRect.pdfW = x2 - x1;\n pdfRect.pdfH = y2 - y1;\n }\n return pdfRect;\n }\n}\n","import { app, h } from '../../lib/hyperapp';\nimport { translationManager } from '../../common/TranslationManager';\nimport { Toolbar } from '../../common/Toolbar';\nimport { ToolbarItemGroup } from '../../common/ToolbarItemGroup';\nimport { ToolbarButton } from '../../common/ToolbarButton';\nimport { icons } from '../../common/icons';\nimport { ToolbarSeparator } from '../../common/ToolbarSeparator';\nimport { StrokeWidthPicker } from '../../common/StrokeWidthPicker';\nimport { RangeSlider } from '../../common/RangeSlider';\nimport { ColorPicker } from '../../common/ColorPicker';\nexport const createAddInkAnnotationToolbar = (props, element) => {\n const state = {\n penColors: props.penColors,\n penWidths: props.penWidths,\n selectedPenColor: props.selectedPenColor,\n selectedPenSize: props.selectedPenSize,\n penOpacity: props.penOpacity,\n lineCount: 0,\n };\n const actions = {\n setPenColor: (color) => ($state) => {\n props.onPenColorChanged(color);\n return Object.assign(Object.assign({}, $state), { selectedPenColor: color });\n },\n setPenSize: (width) => ($state) => {\n props.onPenSizeChanged(width);\n return Object.assign(Object.assign({}, $state), { selectedPenSize: width });\n },\n setPenOpacity: (opacity) => ($state) => {\n props.onPenOpacityChanged(opacity);\n return Object.assign(Object.assign({}, $state), { penOpacity: opacity });\n },\n setLineCount: (lineCount) => ($state) => (Object.assign(Object.assign({}, $state), { lineCount })),\n };\n const App = () => h(AddInkAnnotationToolbar, null);\n const AddInkAnnotationToolbar = ({}) => ($state, $actions) => {\n const strokeWidths = $state.penWidths.filter((w) => w > 0);\n return (h(Toolbar, { allowWrap: true, alignCenter: true },\n h(ToolbarItemGroup, null,\n h(ColorPicker, { colors: $state.penColors, color: $state.selectedPenColor, icon: icons.fillColor, allowRgba: false, mode: \"buttons\", onChange: $actions.setPenColor })),\n h(ToolbarItemGroup, null,\n h(RangeSlider, { tooltip: translationManager.getText('annotFreeDrawing.opacity'), min: 10, max: 100, step: 1, value: $state.penOpacity, text: `${$state.penOpacity}%`, icon: icons.drop, onChange: $actions.setPenOpacity, className: \"pwv-opacityslider\" }),\n h(StrokeWidthPicker, { tooltip: translationManager.getText('annotFreeDrawing.strokeWidth'), noneStrokeText: '', strokeWidths: strokeWidths, value: $state.selectedPenSize, onChange: $actions.setPenSize })),\n h(ToolbarItemGroup, null,\n h(ToolbarSeparator, null),\n h(ToolbarButton, { tooltip: translationManager.getText('annotFreeDrawing.undo'), icon: icons.eraser, onClick: props.onUndo, disabled: $state.lineCount < 1 }),\n h(ToolbarButton, { tooltip: translationManager.getText('annotFreeDrawing.addNew'), icon: icons.addLayer, onClick: props.onAdd, disabled: $state.lineCount < 1 })),\n h(ToolbarItemGroup, { pushRight: true },\n h(ToolbarSeparator, null),\n $state.lineCount < 1 ? (h(ToolbarButton, { icon: icons.close, onClick: props.onCancel })) : (h(ToolbarButton, { icon: icons.ok, onClick: props.onSave })))));\n };\n return app(state, actions, App, element);\n};\n","import { CanvasLayer } from '../CanvasLayer';\nimport { AnnotationBorderStyle } from '../../pdf-viewer-api';\nimport { createEditInkAnnotationToolbar, } from './EditInkAnnotationToolbar';\nimport { Color } from '../../common/Color';\nconst moduleLayerName = 'EditInkAnnotation';\nexport class EditInkAnnotationLayer extends CanvasLayer {\n constructor() {\n super(...arguments);\n this.inkAnnotation = null;\n this.context = null;\n this.penColors = [];\n this.penWidths = [];\n this.toolbar = null;\n this.updatePending = false;\n this.unsavedChanges = false;\n }\n onCreate(annotationId) {\n var _a;\n this.inkAnnotation = this.pdfApi.getItem(annotationId);\n this.setPenColor = this.setPenColor.bind(this);\n this.setPenSize = this.setPenSize.bind(this);\n this.setPenOpacity = this.setPenOpacity.bind(this);\n this.close = this.close.bind(this);\n const annotationOptions = this.options.annotation;\n this.penColors = annotationOptions.colors.foregroundColors;\n this.penWidths = annotationOptions.strokeWidths;\n this.context = this.createCanvas();\n const color = new Color(this.inkAnnotation.color || annotationOptions.colors.inkColor);\n const penSize = ((_a = this.inkAnnotation) === null || _a === void 0 ? void 0 : _a.border.width) || annotationOptions.inkWidth;\n const toolbarElement = this.module.toolbarElement;\n this.toolbar = createEditInkAnnotationToolbar({\n penColors: this.penColors,\n penWidths: this.penWidths,\n selectedPenColor: color.toHexRgb(),\n selectedPenSize: penSize,\n penOpacity: color.a * 100,\n onPenColorChanged: this.setPenColor,\n onPenSizeChanged: this.setPenSize,\n onPenOpacityChanged: this.setPenOpacity,\n onCancel: this.remove,\n }, toolbarElement);\n this.store.viewer.beginModule(moduleLayerName);\n }\n onSave() {\n return new Promise((resolve) => resolve);\n }\n onRemove() {\n this.removeCanvasElements();\n this.context = null;\n const toolbarElement = this.module.toolbarElement;\n toolbarElement.innerHTML = '';\n this.store.viewer.endModule(moduleLayerName);\n }\n render(timestamp, state) {\n var _a;\n if (state.viewer.modeChanged && state.viewer.selectedModuleName !== moduleLayerName) {\n this.remove();\n return;\n }\n if (state.pointer.action === 'click' || state.pointer.action === 'dblclick') {\n const inkAnnotation = (_a = this.pdfApi\n .getAnnotationsOnPoint({\n x: state.pointer.x.devicePixels,\n y: state.pointer.y.devicePixels,\n })) === null || _a === void 0 ? void 0 : _a.find((a) => this.inkAnnotation && a.id === this.inkAnnotation.id);\n if (!inkAnnotation) {\n this.close();\n return;\n }\n }\n if (this.context && this.inkAnnotation) {\n const ctx = this.context;\n ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);\n const rect = this.pdfApi.transformPdfPageRectToScreenRect(this.inkAnnotation.pdfRect);\n const lineWidth = 2 * devicePixelRatio;\n ctx.save();\n ctx.strokeStyle = this.options.viewer.general.textSelectionColor;\n ctx.lineWidth = lineWidth;\n ctx.setLineDash([lineWidth, lineWidth]);\n ctx.strokeRect(rect.x - lineWidth, rect.y - lineWidth, rect.w + 2 * lineWidth, rect.h + 2 * lineWidth);\n ctx.restore();\n }\n }\n close() {\n this.remove();\n }\n setPenColor(color) {\n if (this.inkAnnotation && this.inkAnnotation.color) {\n const newColor = new Color(color);\n const currentColor = new Color(this.inkAnnotation.color);\n newColor.setOpacity(currentColor.a);\n this.inkAnnotation.color = newColor.toHexRgba();\n this.updateInkAnnotation();\n }\n }\n setPenSize(size) {\n if (this.inkAnnotation) {\n this.inkAnnotation.border = {\n style: AnnotationBorderStyle.SOLID,\n width: size,\n };\n this.updateInkAnnotation();\n }\n }\n setPenOpacity(opacity) {\n if (this.inkAnnotation && this.inkAnnotation.color) {\n const rgbaColor = new Color(this.inkAnnotation.color);\n rgbaColor.setOpacity(opacity / 100);\n this.inkAnnotation.color = rgbaColor.toHexRgba();\n this.updateInkAnnotation();\n }\n }\n updateInkAnnotation() {\n if (this.pdfApi && this.inkAnnotation) {\n if (this.updatePending) {\n this.unsavedChanges = true;\n }\n else {\n this.updatePending = true;\n this.pdfApi\n .updateItem(this.inkAnnotation)\n .then((item) => {\n this.updatePending = false;\n if (this.unsavedChanges) {\n this.unsavedChanges = false;\n this.updateInkAnnotation();\n }\n })\n .catch((error) => {\n console.warn(error);\n });\n }\n }\n }\n}\n","import { app, h } from '../../lib/hyperapp';\nimport { translationManager } from '../../common/TranslationManager';\nimport { Toolbar } from '../../common/Toolbar';\nimport { ToolbarItemGroup } from '../../common/ToolbarItemGroup';\nimport { ToolbarButton } from '../../common/ToolbarButton';\nimport { icons } from '../../common/icons';\nimport { ToolbarSeparator } from '../../common/ToolbarSeparator';\nimport { StrokeWidthPicker } from '../../common/StrokeWidthPicker';\nimport { RangeSlider } from '../../common/RangeSlider';\nimport { ColorPicker } from '../../common/ColorPicker';\nexport const createEditInkAnnotationToolbar = (props, element) => {\n const state = {\n penColors: props.penColors,\n penWidths: props.penWidths,\n selectedPenColor: props.selectedPenColor,\n selectedPenSize: props.selectedPenSize,\n penOpacity: props.penOpacity,\n };\n const actions = {\n setPenColor: (color) => ($state) => {\n props.onPenColorChanged(color);\n return Object.assign(Object.assign({}, $state), { selectedPenColor: color });\n },\n setPenSize: (width) => ($state) => {\n props.onPenSizeChanged(width);\n return Object.assign(Object.assign({}, $state), { selectedPenSize: width });\n },\n setPenOpacity: (opacity) => ($state) => {\n props.onPenOpacityChanged(opacity);\n return Object.assign(Object.assign({}, $state), { penOpacity: opacity });\n },\n };\n const App = () => h(EditInkAnnotationToolbar, null);\n const EditInkAnnotationToolbar = ({}) => ($state, $actions) => {\n const strokeWidths = $state.penWidths.filter((w) => w > 0);\n return (h(Toolbar, { allowWrap: true, alignCenter: true },\n h(ToolbarItemGroup, null,\n h(ColorPicker, { colors: $state.penColors, color: $state.selectedPenColor, icon: icons.fillColor, allowRgba: false, mode: \"buttons\", onChange: $actions.setPenColor })),\n h(ToolbarItemGroup, null,\n h(RangeSlider, { tooltip: translationManager.getText('annotFreeDrawing.opacity'), min: 10, max: 100, step: 1, value: $state.penOpacity, text: `${Math.round($state.penOpacity)}%`, icon: icons.drop, onChange: $actions.setPenOpacity, className: \"pwv-opacityslider\" }),\n h(StrokeWidthPicker, { tooltip: translationManager.getText('annotFreeDrawing.strokeWidth'), noneStrokeText: '', strokeWidths: strokeWidths, value: $state.selectedPenSize, onChange: $actions.setPenSize })),\n h(ToolbarItemGroup, { pushRight: true },\n h(ToolbarSeparator, null),\n h(ToolbarButton, { icon: icons.close, onClick: props.onCancel }))));\n };\n return app(state, actions, App, element);\n};\n","import { CanvasModule, CanvasModuleType } from '../CanvasModule';\nimport { AddInkAnnotationLayer } from './AddInkAnnotationLayer';\nimport { EditInkAnnotationLayer } from './EditInkAnnotationLayer';\nimport { PdfItemType } from '../../pdf-viewer-api';\nimport { icons } from '../../common/Icon';\nimport { translationManager } from '../../common/TranslationManager';\nexport class InkAnnotationModule extends CanvasModule {\n constructor() {\n super();\n this.toolbarElement = null;\n this.name = InkAnnotationModule.moduleInfo.name;\n this.activate = this.activate.bind(this);\n this.onEdit = this.onEdit.bind(this);\n }\n onRegister() {\n this.toolbarElement = document.createElement('div');\n return {\n toolbar: this.toolbarElement,\n contextbar: {\n itemTypes: [PdfItemType.INK],\n icon: icons.edit,\n tooltip: translationManager.getText('annotInk.edit'),\n onCmd: (annotationId) => {\n this.onEdit(annotationId);\n },\n },\n };\n }\n activate() {\n if (!this.canvasLayers['add']) {\n this.createCanvasLayer('add', AddInkAnnotationLayer);\n }\n else {\n this.removeCanvasLayer('add');\n }\n }\n onEdit(annotationId) {\n this.createCanvasLayer('edit', EditInkAnnotationLayer, annotationId);\n }\n}\nInkAnnotationModule.moduleInfo = {\n name: 'InkAnnotationModule',\n moduleType: CanvasModuleType.Tool,\n requiredFeatures: {\n annotate: true,\n fillFormFields: false,\n },\n translationKey: 'annotFreeDrawing.add',\n icon: 'pencil',\n};\n","import { h, app } from '../../lib/hyperapp';\nimport { translationManager } from '../../common/TranslationManager';\nimport { Toolbar } from '../../common/Toolbar';\nimport { ToolbarItemGroup } from '../../common/ToolbarItemGroup';\nimport { ToolbarButton } from '../../common/ToolbarButton';\nimport { icons } from '../../common/Icon';\nimport { ColorPicker } from '../../common/ColorPicker';\nimport { classNames } from '../../common/classNames';\nimport { DragMoveHandler } from '../../common/DragMoveHandler';\nimport { PdfItemType } from '../../pdf-viewer-api';\nimport { Color } from '../../common/Color';\nexport const createPopupView = (props, element) => {\n const state = {\n selectedPopup: null,\n openPopups: [],\n maxPopupWidth: props.maxPopupWidth,\n maxPopupHeight: props.maxPopupHeight,\n minPopupWidth: 260,\n minPopupHeight: 200,\n currentUser: props.currentUser,\n hideSubject: props.hideSubject,\n activeContent: null,\n activeSubject: null,\n stateChanged: false,\n clearFocus: false,\n };\n const actions = {\n getState: () => ($state) => $state,\n updateOpenPopups: (openPopups) => ($state) => {\n openPopups.forEach((popup) => {\n const oldPopup = $state.openPopups.find((op) => op.id === popup.id);\n if (oldPopup) {\n popup.selected = oldPopup.selected;\n popup.positionCalculated = oldPopup.positionCalculated;\n }\n });\n return Object.assign(Object.assign({}, $state), { openPopups });\n },\n stateChanged: (hasChanged) => ($state) => {\n return Object.assign(Object.assign({}, $state), { stateChanged: hasChanged });\n },\n setPositionCalculated: (id) => ($state) => {\n const popup = $state.openPopups.find((p) => p.id === id);\n if (popup) {\n popup.positionCalculated = true;\n }\n return Object.assign({}, $state);\n },\n selectPopup: (id) => ($state) => {\n const openPopups = $state.openPopups.map((p) => (Object.assign(Object.assign({}, p), { selected: p.id === id })));\n return Object.assign(Object.assign({}, $state), { openPopups, activeContent: id === $state.selectedPopup ? $state.activeContent : null, activeSubject: id === $state.selectedPopup ? $state.activeSubject : null, selectedPopup: id });\n },\n updateSubjectAndContent: (id) => ($state) => {\n const subject = document.getElementById('pwv-popup-subject-' + id)\n .value;\n const content = document.getElementById('pwv-popup-content-' + id)\n .value;\n return Object.assign(Object.assign({}, $state), { activeContent: content, activeSubject: subject });\n },\n setFocus: (id) => ($state) => {\n const textArea = document.getElementById('pwv-popup-content-' + id);\n if (textArea) {\n textArea.focus();\n }\n return Object.assign(Object.assign({}, $state), { clearFocus: document.activeElement === textArea });\n },\n deselectPopup: () => ($state) => {\n return Object.assign(Object.assign({}, $state), { selectedPopup: null });\n },\n };\n const App = () => h(OpenPopups, null);\n const OpenPopups = ({}) => ($state, $actions) => {\n return (h(\"div\", null, $state.openPopups.map((popup) => (h(Popup, { popup: Object.assign(Object.assign({}, popup), { selected: popup.id === $state.selectedPopup }), colorPalette: popup.colorPalette, hideSubject: props.hideSubject, allowLockAnnotations: props.allowLockAnnotations, allowEditLockedAnnotations: props.allowEditLockedAnnotations, close: props.onClose, remove: props.onDelete, select: props.onSelect, toggleLock: props.onLock, updatePosition: (payload) => {\n props.onUpdatePosition(payload.id, payload.x, payload.y);\n }, updateSize: (payload) => {\n props.onUpdateSize(payload.id, payload.w, payload.h);\n }, updateColor: (payload) => {\n props.onUpdateColor(payload.id, payload.color);\n } })))));\n };\n return app(state, actions, App, element);\n};\nconst Popup = ({ popup, colorPalette, hideSubject, allowLockAnnotations, allowEditLockedAnnotations, updateColor, close, select, remove, toggleLock, updatePosition, updateSize, }) => ($state, $actions) => {\n const styles = {\n backgroundColor: popup.color,\n width: popup.cssWidth < $state.minPopupWidth ? $state.minPopupWidth + 'px' : popup.cssWidth + 'px',\n height: popup.cssHeight < $state.minPopupHeight\n ? $state.minPopupHeight + 'px'\n : popup.cssHeight + 'px',\n };\n let colorString;\n if (popup.color != null) {\n const color = new Color(popup.color);\n styles.backgroundColor = color.toRgb();\n if (color.isDark()) {\n colorString = 'rgba(255, 255, 255, 0.9)';\n }\n else {\n colorString = 'rgba(0, 0, 0, 0.9)';\n }\n }\n const headerStyles = {\n color: colorString,\n };\n if (!popup.positionCalculated) {\n styles.display = 'none';\n }\n const isReadOnly = popup.isReadOnly();\n return (h(\"div\", { class: classNames('pwv-popup', {\n 'pwv-popup-view-only': isReadOnly,\n 'pwv-popup-selected': popup.selected,\n }), key: popup.id, style: styles, \"data-id\": popup.id },\n h(\"div\", { onclick: (e) => {\n if (!e.openDropdown) {\n window.dispatchEvent(new Event('click', e));\n }\n if (!popup.selected) {\n select(popup.id);\n }\n }, onchange: (e) => {\n $actions.stateChanged(true);\n } },\n h(\"div\", { class: \"pwv-popup-header\" },\n h(\"div\", { class: \"pwv-popup-header-info\", style: headerStyles },\n h(\"div\", { class: \"pwv-popup-header-author\" }, popup.author),\n h(\"div\", { class: \"pwv-popup-header-modified\" }, popup.modificationDate)),\n isReadOnly ? (h(Toolbar, null,\n h(ToolbarItemGroup, { pushRight: true },\n h(ToolbarButton, { onClick: (e) => {\n e.stopPropagation();\n if (!popup.selected) {\n select(popup.id);\n }\n close();\n }, icon: icons.close })))) : (h(Toolbar, null,\n h(ToolbarItemGroup, null,\n h(ToolbarButton, { tooltip: translationManager.getText('annotPopup.delete'), icon: icons.delete, onClick: () => {\n remove(popup.id);\n }, disabled: popup.isLocked && !allowEditLockedAnnotations }),\n allowLockAnnotations && (h(ToolbarButton, { tooltip: translationManager.getText(popup.isLocked ? 'annotPopup.unlock' : 'annotPopup.lock'), onClick: (e) => {\n e.stopPropagation();\n if (!popup.selected) {\n select(popup.id);\n }\n toggleLock(popup.id);\n }, icon: popup.isLocked ? icons.lock : icons.unlock })),\n popup.itemType !== PdfItemType.STAMP && (h(ColorPicker, { tooltip: translationManager.getText('annotPopup.color'), colors: colorPalette, icon: icons.fillColor, color: popup.color || 'transparent', onChange: (color) => {\n updateColor({\n id: popup.id,\n color,\n });\n }, disabled: popup.isLocked && !allowEditLockedAnnotations }))),\n h(ToolbarItemGroup, { pushRight: true },\n h(ToolbarButton, { onClick: (e) => {\n e.stopPropagation();\n if (!popup.selected) {\n select(popup.id);\n }\n if (!popup.isLocked || allowEditLockedAnnotations) {\n $actions.updateSubjectAndContent(popup.id);\n }\n close();\n }, icon: icons.close }))))),\n isReadOnly ? (h(\"div\", { class: \"pwv-popup-view-only-content\" },\n !hideSubject && popup.subject && h(\"h4\", null, popup.subject),\n h(\"div\", null, popup.content))) : (h(\"div\", null,\n hideSubject ? (h(\"input\", { id: 'pwv-popup-subject-' + popup.id, type: \"hidden\", value: $state.selectedPopup === popup.id\n ? $state.activeSubject\n ? $state.activeSubject\n : popup.subject\n : popup.subject })) : (h(\"div\", { class: \"pwv-popup-subject\" }, !popup.isLocked || allowEditLockedAnnotations ? (h(\"input\", { id: 'pwv-popup-subject-' + popup.id, placeholder: translationManager.getText('annotPopup.subjectPlaceholder'), onchange: () => {\n $actions.updateSubjectAndContent(popup.id);\n }, value: $state.selectedPopup === popup.id\n ? $state.activeSubject\n ? $state.activeSubject\n : popup.subject\n : popup.subject })) : (h(\"div\", { id: 'pwv-popup-subject-' + popup.id }, popup.subject)))),\n h(\"div\", { class: classNames('pwv-popup-content', {\n 'pwv-popup-content-no-subject': hideSubject,\n }) }, !popup.isLocked || allowEditLockedAnnotations ? (h(\"textarea\", { placeholder: translationManager.getText('annotPopup.contentPlaceholder'), id: 'pwv-popup-content-' + popup.id, onchange: () => {\n $actions.updateSubjectAndContent(popup.id);\n }, oninput: () => {\n $actions.updateSubjectAndContent(popup.id);\n } }, $state.selectedPopup === popup.id\n ? $state.activeContent\n ? $state.activeContent\n : popup.content\n : popup.content)) : (h(\"div\", { id: 'pwv-popup-content-' + popup.id }, popup.content)))))),\n h(\"div\", null,\n h(\"div\", { class: \"pwv-popup-draghandle\" }),\n h(\"div\", { class: \"pwv-popup-resizer\", oncreate: (element) => {\n PopupComponent.create(popup.id, element, $state.minPopupWidth, $state.minPopupHeight, $state.maxPopupWidth, $state.maxPopupHeight, updatePosition, updateSize, select);\n }, onremove: (element, done) => {\n PopupComponent.remove(element);\n done();\n } }))));\n};\nclass PopupComponent {\n constructor(id, resizeHandle, minPopupWidth, minPopupHeight, maxPopupWidth, maxPopupHeight, updatePosition, updateSize, select) {\n this.cancelContentEvents = true;\n this.dragOffsetX = 0;\n this.dragOffsetY = 0;\n this.containerOffsetX = 0;\n this.containerOffsetY = 0;\n this.id = id;\n this.resizeHandle = resizeHandle;\n const parent = resizeHandle.parentElement;\n this.dragHandle = parent.children.item(0);\n this.element = parent.parentElement;\n this.minPopupWidth = 260;\n this.minPopupHeight = 200;\n this.maxPopupWidth = maxPopupWidth > this.minPopupWidth ? maxPopupWidth : this.minPopupWidth;\n this.maxPopupHeight =\n maxPopupHeight > this.minPopupHeight ? maxPopupHeight : this.minPopupHeight;\n this.updatePosition = updatePosition;\n this.updateSize = updateSize;\n this.select = select;\n this.cancelEvent = this.cancelEvent.bind(this);\n this.startMove = this.startMove.bind(this);\n this.moving = this.moving.bind(this);\n this.endMove = this.endMove.bind(this);\n this.onSelect = this.onSelect.bind(this);\n this.startResize = this.startResize.bind(this);\n this.resizing = this.resizing.bind(this);\n this.endResize = this.endResize.bind(this);\n this.handleMouseWheel = this.handleMouseWheel.bind(this);\n new DragMoveHandler(this.dragHandle, this.startMove, this.moving, this.endMove, this.onSelect);\n new DragMoveHandler(this.resizeHandle, this.startResize, this.resizing, this.endResize);\n this.element.addEventListener('mousewheel', this.handleMouseWheel, { passive: true });\n const contentElement = this.element.firstChild;\n contentElement.addEventListener('onclick', this.cancelEvent, false);\n contentElement.addEventListener('keydown', this.cancelEvent, false);\n contentElement.addEventListener('mousedown', this.cancelEvent, false);\n contentElement.addEventListener('mousemove', this.cancelEvent, false);\n contentElement.addEventListener('mouseup', this.cancelEvent, false);\n contentElement.addEventListener('touchstart', this.cancelEvent, { passive: true });\n contentElement.addEventListener('touchmove', this.cancelEvent, { passive: true });\n contentElement.addEventListener('touchend', this.cancelEvent, { passive: true });\n }\n static create(id, resizeHandle, minPopupWidth, minPopupHeight, maxPopupWidth, maxPopupHeight, updatePosition, updateSize, select) {\n ;\n resizeHandle.parentElement.popup = new PopupComponent(id, resizeHandle, minPopupWidth, minPopupHeight, maxPopupWidth, maxPopupHeight, updatePosition, updateSize, select);\n }\n static remove(resizeHandle) {\n ;\n resizeHandle.parentElement.popup.unmount()(resizeHandle.parentElement).popup =\n null;\n }\n unmount() {\n this.element.removeEventListener('mousewheel', this.handleMouseWheel);\n }\n cancelEvent(e) {\n if (this.cancelContentEvents) {\n if (!(e.type === 'mousemove' && e.buttons === 0)) {\n e.cancelBubble = true;\n e.stopPropagation();\n }\n }\n }\n onSelect() {\n this.select(this.id);\n }\n startResize(e) {\n this.cancelContentEvents = false;\n this.element.classList.add('pwv-popup-resizing');\n this.onSelect();\n }\n resizing(e) {\n const rect = this.element.getBoundingClientRect();\n let width = e.clientX - rect.left;\n let height = e.clientY - rect.top;\n width =\n width < this.minPopupWidth\n ? this.minPopupWidth\n : width > this.maxPopupWidth\n ? this.maxPopupWidth\n : width;\n height =\n height < this.minPopupHeight\n ? this.minPopupHeight\n : height > this.maxPopupHeight\n ? this.maxPopupHeight\n : height;\n this.element.style.width = width + 'px';\n this.element.style.height = height + 'px';\n const popupRect = {\n x: parseInt(this.element.style.left, undefined),\n y: parseInt(this.element.style.top, undefined),\n w: width,\n h: height,\n };\n const evtDetail = {\n annotationId: this.id,\n popupRect,\n color: this.element.style.backgroundColor,\n };\n window.dispatchEvent(new CustomEvent('pdfwebviewer.PopupMoved', { detail: evtDetail }));\n }\n endResize(e) {\n if (e.moved) {\n this.updateSize({\n id: this.id,\n w: this.element.clientWidth,\n h: this.element.clientHeight,\n });\n }\n this.cancelContentEvents = true;\n this.element.classList.remove('pwv-popup-resizing');\n }\n startMove(e) {\n const elementRect = this.element.getBoundingClientRect();\n const offsetParent = this.element.offsetParent;\n const offsetParentRect = offsetParent.getBoundingClientRect();\n this.dragOffsetX = e.clientX - elementRect.left;\n this.dragOffsetY = e.clientY - elementRect.top;\n this.containerOffsetX = offsetParentRect.left;\n this.containerOffsetY = offsetParentRect.top;\n this.cancelContentEvents = false;\n this.element.classList.add('pwv-popup-moving');\n this.onSelect();\n }\n moving(e) {\n const popupRect = {\n x: e.clientX - this.containerOffsetX - this.dragOffsetX,\n y: e.clientY - this.containerOffsetY - this.dragOffsetY,\n w: parseInt(this.element.style.width, undefined),\n h: parseInt(this.element.style.height, undefined),\n };\n this.element.style.top = popupRect.y + 'px';\n this.element.style.left = popupRect.x + 'px';\n const evtDetail = {\n annotationId: this.id,\n popupRect,\n color: this.element.style.backgroundColor,\n };\n window.dispatchEvent(new CustomEvent('pdfwebviewer.PopupMoved', { detail: evtDetail }));\n }\n endMove(e) {\n if (e.moved) {\n this.updatePosition({\n id: this.id,\n x: this.element.offsetLeft,\n y: this.element.offsetTop,\n });\n }\n this.cancelContentEvents = true;\n this.element.classList.remove('pwv-popup-moving');\n }\n handleMouseWheel(e) {\n if (this.element.classList.contains('pwv-popup-selected')) {\n e.stopPropagation();\n }\n }\n}\n","import { CanvasLayer } from '../CanvasLayer';\nimport { createPopupView } from './Popup';\nimport { getPopups, getOpenPopups } from '../../pdf-viewer-canvas/state/annotations';\nimport { PdfItemType, } from '../../pdf-viewer-api';\nimport { renderPopupMarker } from '../../pdf-viewer-canvas/view-layers/canvasShapes';\nimport { ViewerMode, CursorStyle } from '../../pdf-viewer-canvas/state/viewer';\nimport { Color } from '../../common/Color';\nimport { getColorPalette } from '../../common/Tools';\nimport { addHistoryEntry } from '../../custom/history';\nexport class PopupLayer extends CanvasLayer {\n constructor() {\n super(...arguments);\n this.popupView = null;\n this.context = null;\n this.maxPopupWidth = window.screen.availWidth < 570 ? 280 : 480;\n this.maxPopupHeight = 320;\n this.minPopupWidth = 260;\n this.minPopupHeight = 200;\n this.zoom = 0;\n this.screenToPdfScale = 0;\n }\n onCreate() {\n this.drawPopupRelation = this.drawPopupRelation.bind(this);\n this.popupMoved = this.popupMoved.bind(this);\n this.selectPopup = this.selectPopup.bind(this);\n this.deselectPopup = this.deselectPopup.bind(this);\n this.openPopup = this.openPopup.bind(this);\n this.closePopup = this.closePopup.bind(this);\n this.deletePopup = this.deletePopup.bind(this);\n this.toggleAnnotationLock = this.toggleAnnotationLock.bind(this);\n this.updateSelectedPopupContent = this.updateSelectedPopupContent.bind(this);\n this.updatePopupPosition = this.updatePopupPosition.bind(this);\n this.updatePopupSize = this.updatePopupSize.bind(this);\n this.updatePopupColor = this.updatePopupColor.bind(this);\n this.context = this.createCanvas();\n this.createPopupView();\n window.addEventListener('pdfwebviewer.PopupMoved', this.popupMoved, false);\n }\n onRemove() { }\n onSave() {\n const promise = new Promise((resolve, reject) => {\n if (this.popupView) {\n const state = this.popupView.getState();\n if (state.stateChanged) {\n this.updateSelectedPopupContent(true).then(() => {\n resolve();\n });\n }\n else {\n resolve();\n }\n }\n });\n return promise;\n }\n render(timestamp, state) {\n if (this.pdfApi && this.popupView && this.popupViewElement) {\n if (state.document.zoomChanged && state.document.zoom !== this.zoom) {\n this.zoom = state.document.zoom;\n this.screenToPdfScale = this.pdfApi.transformPdfLengthToScreenLength(100) / 100 / this.zoom;\n }\n if (state.annotations.openPopupChanged ||\n state.document.firstVisiblePageChanged ||\n state.document.lastVisiblePageChanged ||\n state.viewer.modeChanged) {\n this.updateOpenPopupList(state);\n }\n if (state.viewer.popupFocus) {\n this.popupView.setFocus(state.viewer.popupFocus);\n }\n if (this.popupView.getState().clearFocus) {\n this.store.viewer.clearPopupFocus();\n }\n if (state.viewer.selectedPopupChanged) {\n const selectedPopup = this.popupView.getState().selectedPopup;\n if (state.viewer.selectedPopupId) {\n if (selectedPopup !== state.viewer.selectedPopupId) {\n this.popupView.selectPopup(state.viewer.selectedPopupId);\n }\n }\n }\n const viewerMode = state.viewer.mode;\n if (viewerMode === ViewerMode.POPUP_SELECTED) {\n this.store.viewer.setCursorStyle(CursorStyle.DEFAULT);\n }\n const { openPopups, selectedPopup } = this.popupView.getState();\n const popupsVisible = viewerMode === ViewerMode.DEFAULT || viewerMode === ViewerMode.POPUP_SELECTED;\n if (state.viewer.modeChanged) {\n if (popupsVisible) {\n this.popupViewElement.style.display = 'block';\n }\n else {\n this.popupViewElement.style.display = 'none';\n const ctx = this.context;\n ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);\n if (selectedPopup && state.pointer.action !== 'click') {\n this.updateSelectedPopupContent(true);\n }\n }\n }\n if (viewerMode === ViewerMode.POPUP_SELECTED && state.pointer.action === 'click') {\n this.deselectPopup();\n }\n const updatePopupPosition = state.canvas.canvasInvalidated || openPopups.find((p) => !p.positionCalculated);\n if (openPopups.length > 0 && updatePopupPosition) {\n const popupElements = this.popupViewElement.querySelectorAll('.pwv-popup');\n const canvasWidth = state.canvas.width.cssPixels;\n const canvasHeight = state.canvas.height.cssPixels;\n const zoom = state.document.zoom;\n for (let i = 0; i < popupElements.length; i++) {\n const popupElement = popupElements[i];\n if (!popupElement.classList.contains('pwv-popup-moving')) {\n const id = popupElement.dataset.id;\n const popup = openPopups.find((p) => p.id.toString() === id);\n if (popup) {\n const screenRect = this.pdfApi.transformPdfPageRectToScreenRect(popup.pdfRect);\n let x = screenRect.x / devicePixelRatio;\n let y = screenRect.y / devicePixelRatio;\n const w = parseInt(popupElement.style.width, undefined);\n const h = parseInt(popupElement.style.height, undefined);\n const padding = 8;\n if (x < padding) {\n x = padding;\n }\n else if (x + w + padding * 2 > canvasWidth) {\n x = canvasWidth - (w + padding * 2);\n }\n if (y < padding) {\n y = padding;\n }\n else if (y + h + padding * 2 > canvasHeight) {\n y = canvasHeight - (h + padding * 2);\n }\n popupElement.style.top = `${y}px`;\n popupElement.style.left = `${x}px`;\n if (!popup.positionCalculated) {\n this.popupView.setPositionCalculated(popup.id);\n }\n }\n }\n }\n }\n if ((state.viewer.mode === ViewerMode.POPUP_SELECTED ||\n state.viewer.mode === ViewerMode.DEFAULT) &&\n (state.viewer.selectedPopupChanged ||\n state.canvas.canvasInvalidated ||\n state.pointer.positionChanged ||\n state.annotations.openPopupChanged)) {\n const ctx = this.context;\n ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);\n const scale = state.canvas.pixelRatio * state.document.zoom;\n if (viewerMode !== ViewerMode.POPUP_SELECTED) {\n const popups = getPopups(state.annotations, state.document.firstVisiblePage, state.document.lastVisiblePage);\n if (popups === null) {\n return;\n }\n for (let i = 0; i < popups.length; i++) {\n const popup = popups[i];\n if (popup.itemType !== PdfItemType.TEXT) {\n let pos;\n pos = this.pdfApi.transformPdfPageRectToScreenRect(popup.pdfRect);\n ctx.lineWidth = 1;\n ctx.beginPath();\n const r = 12 * scale;\n const posX = pos.x + r / 2;\n const posY = pos.y - r;\n ctx.arc(posX, posY, r, 0, 2 * Math.PI);\n if (ctx.isPointInPath(state.pointer.x.devicePixels, state.pointer.y.devicePixels)) {\n this.store.viewer.setCursorStyle(CursorStyle.POINTER);\n ctx.globalAlpha = 0.15;\n ctx.fillStyle = this.options.viewer.general.textSelectionColor;\n ctx.fill();\n ctx.globalAlpha = 1;\n if (state.pointer.action === 'click') {\n this.openPopup(popup.id);\n }\n }\n renderPopupMarker(ctx, scale, popup.color || this.options.annotation.colors.defaultHighlightColor, { x: posX, y: posY });\n }\n }\n }\n if (openPopups.length > 0) {\n const popupElements = this.popupViewElement.querySelectorAll('.pwv-popup:hover, .pwv-popup.pwv-popup-selected');\n for (let i = 0; i < popupElements.length; i++) {\n const popupElement = popupElements[i];\n const id = popupElement.dataset.id ? parseInt(popupElement.dataset.id, undefined) : -1;\n this.drawPopupRelation(ctx, id, {\n x: popupElement.offsetLeft,\n y: popupElement.offsetTop,\n w: popupElement.offsetWidth,\n h: popupElement.offsetHeight,\n }, popupElement.style.backgroundColor, id === state.viewer.selectedPopupId);\n }\n }\n }\n }\n }\n updateOpenPopupList(state) {\n if (this.popupView) {\n const openPopups = getOpenPopups(state.annotations, state.document.firstVisiblePage, state.document.lastVisiblePage);\n const zoom = state.document.zoom;\n const popups = openPopups.map((an) => {\n const width = this.pdfApi.transformPdfLengthToScreenLength(an.popup.pdfRect.pdfW) / zoom;\n const height = this.pdfApi.transformPdfLengthToScreenLength(an.popup.pdfRect.pdfH) / zoom;\n return {\n id: an.id,\n colorPalette: getColorPalette(an.itemType, this.options),\n content: an.content,\n subject: an.subject ? an.subject : null,\n modificationDate: an.modificationDate,\n author: an.author,\n color: an.color,\n itemType: an.itemType,\n isLocked: an.isLocked(),\n selected: false,\n positionCalculated: false,\n pdfRect: an.popup.pdfRect,\n cssWidth: width < this.maxPopupWidth ? width : this.maxPopupWidth,\n cssHeight: height < this.maxPopupHeight ? height : this.maxPopupHeight,\n behaviors: an.behaviors,\n isReadOnly: an.isReadOnly,\n };\n });\n this.popupView.updateOpenPopups(popups);\n }\n }\n drawPopupRelation(ctx, annotationId, popupRect, color, selected) {\n const annotation = this.pdfApi.getItem(annotationId);\n if (annotation) {\n const annotationRect = this.pdfApi.transformPdfPageRectToScreenRect(annotation.pdfRect);\n const popupX1 = popupRect.x * devicePixelRatio;\n const popupX2 = popupX1 + popupRect.w * devicePixelRatio;\n const popupXc = popupX1 + (popupRect.w / 2) * devicePixelRatio;\n const popupY1 = popupRect.y * devicePixelRatio;\n const popupY2 = popupY1 + popupRect.h * devicePixelRatio;\n const popupYc = popupY1 + (popupRect.h / 2) * devicePixelRatio;\n const annotationX1 = annotationRect.x;\n const annotationX2 = annotationX1 + annotationRect.w;\n const annotationY1 = annotationRect.y;\n const annotationY2 = annotationY1 + annotationRect.h;\n let popupRelX = popupX1;\n let popupRelY = popupY1;\n let annotationRelX = annotationX1;\n let annotationRelY = annotationY1;\n if (popupX2 <= annotationX1) {\n popupRelX = popupX2;\n annotationRelX = annotationX1;\n }\n if (popupX1 >= annotationX2) {\n popupRelX = popupX1;\n annotationRelX = annotationX2;\n }\n if (popupY2 <= annotationY1) {\n popupRelY = popupY2;\n annotationRelY = annotationY1;\n }\n if (popupY1 >= annotationY2) {\n popupRelY = popupY1;\n annotationRelY = annotationY2;\n }\n if (popupX2 >= annotationX1 && popupX1 <= annotationX2) {\n const x = popupXc < annotationX1 ? annotationX1 : popupXc > annotationX2 ? annotationX2 : popupXc;\n popupRelX = x;\n annotationRelX = x;\n }\n if (popupY2 >= annotationY1 && popupY1 <= annotationY2) {\n const y = popupYc < annotationY1 ? annotationY1 : popupYc > annotationY2 ? annotationY2 : popupYc;\n popupRelY = y;\n annotationRelY = y;\n }\n ctx.save();\n if (!(popupRelX === 0 && popupRelY === 0)) {\n if (color) {\n const rgbColor = new Color(color);\n rgbColor.darken(20);\n if (!selected) {\n rgbColor.setOpacity(0.8);\n }\n ctx.strokeStyle = rgbColor.toRgba();\n ctx.fillStyle = rgbColor.toRgba();\n }\n ctx.lineWidth = 2 * window.devicePixelRatio;\n if (!selected) {\n ctx.setLineDash([ctx.lineWidth]);\n }\n ctx.beginPath();\n ctx.moveTo(annotationRelX, annotationRelY);\n ctx.lineTo(popupRelX, popupRelY);\n ctx.stroke();\n ctx.strokeRect(annotationX1, annotationY1, annotationRect.w, annotationRect.h);\n ctx.restore();\n }\n }\n ctx.restore();\n }\n popupMoved(event) {\n if (this.context !== null && event.detail) {\n this.context.clearRect(0, 0, this.context.canvas.width, this.context.canvas.height);\n this.drawPopupRelation(this.context, event.detail.annotationId, event.detail.popupRect, event.detail.color, true);\n }\n }\n createPopupView() {\n if (this.containerElement) {\n this.popupViewElement = this.createHtmlLayer();\n this.popupView = createPopupView({\n maxPopupWidth: this.maxPopupWidth,\n maxPopupHeight: this.maxPopupHeight,\n minPopupWidth: this.minPopupWidth,\n minPopupHeight: this.minPopupHeight,\n currentUser: this.options.viewer.general.user ? this.options.viewer.general.user : '',\n hideSubject: this.options.annotation.hideAnnotationSubject || false,\n allowLockAnnotations: this.options.viewer.permissions.allowLockAnnotations,\n allowEditLockedAnnotations: this.options.viewer.permissions.allowEditLockedAnnotations,\n onSelect: this.selectPopup,\n onClose: this.closePopup,\n onDelete: this.deletePopup,\n onUpdatePosition: this.updatePopupPosition,\n onUpdateSize: this.updatePopupSize,\n onUpdateColor: this.updatePopupColor,\n onLock: this.toggleAnnotationLock,\n }, this.popupViewElement);\n }\n }\n selectPopup(id) {\n if (this.popupView) {\n if (this.popupView.getState().selectedPopup !== null) {\n this.updateSelectedPopupContent(true);\n }\n this.popupView.selectPopup(id);\n this.store.viewer.selectPopup({ id, focus: false });\n }\n }\n deselectPopup() {\n if (this.popupView) {\n this.updateSelectedPopupContent(true);\n this.popupView.deselectPopup();\n this.store.viewer.selectPopup({ id: null, focus: false });\n }\n }\n openPopup(id) {\n if (this.pdfApi) {\n const annotation = this.pdfApi.getItem(id);\n if (annotation) {\n annotation.popup.isOpen = true;\n this.store.annotations.updateAnnotation(annotation);\n if (this.pdfViewerCanvas.licenseFeatures.annotate) {\n this.pdfApi.updateItem(annotation).then(() => {\n this.selectPopup(annotation.id);\n });\n }\n else {\n this.selectPopup(annotation.id);\n }\n }\n }\n }\n closePopup() {\n this.updateSelectedPopupContent(false).then((annot) => {\n this.store.viewer.deselectPopup();\n if (this.pdfApi) {\n if (annot) {\n annot.popup.isOpen = false;\n this.store.annotations.updateAnnotation(annot);\n if (this.pdfViewerCanvas.licenseFeatures.annotate) {\n this.pdfApi.updateItem(annot);\n }\n }\n }\n });\n }\n deletePopup(id) {\n if (this.pdfApi) {\n if (this.popupView) {\n this.popupView.deselectPopup();\n }\n this.store.viewer.selectPopup({ id: null, focus: false });\n const annotation = this.pdfApi.getItem(id);\n if (annotation) {\n annotation.content = '';\n annotation.subject = '';\n annotation.popup.isOpen = false;\n this.store.annotations.updateAnnotation(annotation);\n if (this.pdfViewerCanvas.licenseFeatures.annotate) {\n this.pdfApi.updateItem(annotation);\n }\n }\n }\n }\n toggleAnnotationLock(id) {\n if (this.pdfApi) {\n this.updateSelectedPopupContent(false).then((annotation) => {\n if (annotation) {\n if (this.options.annotation.trackHistory) {\n addHistoryEntry(annotation, 'lock', this.options.viewer.general.user);\n }\n annotation.setLock(!annotation.isLocked());\n this.store.annotations.updateAnnotation(annotation);\n if (this.pdfViewerCanvas.licenseFeatures.annotate) {\n this.pdfApi.updateItem(annotation);\n }\n }\n });\n }\n }\n updateSelectedPopupContent(syncronize, annotation) {\n const promise = new Promise((resolve, reject) => {\n var _a;\n if (this.pdfApi) {\n if (this.popupView) {\n const state = this.popupView.getState();\n const id = state.selectedPopup;\n if (id) {\n if (!annotation) {\n annotation = this.pdfApi.getItem(id);\n }\n const content = state.activeContent;\n const subject = state.activeSubject;\n if (this.options.annotation.trackHistory) {\n addHistoryEntry(annotation, 'edit', this.options.viewer.general.user, content, subject);\n }\n annotation.content = content !== null ? content : annotation.content;\n annotation.subject = subject !== null ? subject : annotation.subject;\n if (((_a = this.pdfViewerCanvas) === null || _a === void 0 ? void 0 : _a.licenseFeatures.annotate) && syncronize) {\n this.pdfApi\n .updateItem(annotation)\n .then(() => {\n if (this.popupView) {\n this.popupView.stateChanged(false);\n }\n resolve();\n })\n .catch(() => {\n reject();\n });\n }\n else {\n resolve(annotation);\n }\n }\n }\n }\n resolve(null);\n });\n return promise;\n }\n updatePopupPosition(id, x, y) {\n if (this.pdfApi) {\n const annotation = this.pdfApi.getItem(id);\n if (annotation) {\n const newPdfPos = this.pdfApi.transformScreenPointToPdfPoint({\n x: x * window.devicePixelRatio,\n y: y * window.devicePixelRatio,\n }, annotation.pdfRect.page).pdfPoint;\n if (annotation.popup.pdfRect.pdfX !== newPdfPos.pdfX ||\n annotation.popup.pdfRect.pdfY !== newPdfPos.pdfY) {\n annotation.popup.pdfRect.pdfX = newPdfPos.pdfX;\n annotation.popup.pdfRect.pdfY = newPdfPos.pdfY - annotation.popup.pdfRect.pdfH;\n this.store.annotations.updateAnnotation(annotation);\n this.updateSelectedPopupContent(true, annotation);\n }\n }\n }\n }\n updatePopupSize(id, w, h) {\n if (this.pdfApi) {\n const annotation = this.pdfApi.getItem(id);\n if (annotation) {\n const newWidth = w / this.screenToPdfScale;\n const newHeight = h / this.screenToPdfScale;\n if (annotation.popup.pdfRect.pdfW !== newWidth ||\n annotation.popup.pdfRect.pdfH !== newHeight) {\n annotation.popup.pdfRect.pdfW = newWidth;\n annotation.popup.pdfRect.pdfH = newHeight;\n this.store.annotations.updateAnnotation(annotation);\n this.updateSelectedPopupContent(true, annotation);\n }\n }\n }\n }\n updatePopupColor(id, color) {\n if (this.pdfApi) {\n const annotation = this.pdfApi.getItem(id);\n if (annotation) {\n if (annotation.itemType === PdfItemType.TEXT ||\n annotation.itemType === PdfItemType.HIGHLIGHT ||\n annotation.itemType === PdfItemType.SQUIGGLY ||\n annotation.itemType === PdfItemType.UNDERLINE ||\n annotation.itemType === PdfItemType.STRIKE_OUT) {\n ;\n annotation.color = color;\n }\n else if (annotation.itemType === PdfItemType.INK ||\n annotation.itemType === PdfItemType.SQUARE ||\n annotation.itemType === PdfItemType.CIRCLE) {\n const newColor = new Color(color);\n const currentColor = new Color(annotation.color);\n newColor.setOpacity(currentColor.a);\n annotation.color = newColor.toRgba();\n }\n annotation.popup.color = color;\n this.store.annotations.updateAnnotation(annotation);\n this.updateSelectedPopupContent(true, annotation);\n }\n }\n }\n}\n","import { CanvasModule, CanvasModuleType } from '../CanvasModule';\nimport { PopupLayer } from './PopupLayer';\nexport class PopupModule extends CanvasModule {\n constructor() {\n super();\n this.name = PopupModule.moduleInfo.name;\n }\n onRegister() {\n this.createCanvasLayer('popup', PopupLayer);\n return {};\n }\n activate() {\n return;\n }\n}\nPopupModule.moduleInfo = {\n name: 'PopupModule',\n moduleType: CanvasModuleType.Layer,\n requiredFeatures: {\n annotate: false,\n fillFormFields: false,\n },\n translationKey: 'a',\n icon: 'a',\n};\n","import { app, h } from '../../lib/hyperapp';\nimport { icons } from '../../common/icons';\nimport { Icon } from '../../common/Icon';\nimport { Loader } from '../../common/Loader';\nimport { translationManager } from '../../common/TranslationManager';\nexport var PaperFormat;\n(function (PaperFormat) {\n PaperFormat[PaperFormat[\"A4\"] = 0] = \"A4\";\n PaperFormat[PaperFormat[\"LETTER\"] = 1] = \"LETTER\";\n})(PaperFormat || (PaperFormat = {}));\nexport const createPrintServiceDialog = (props, element) => {\n const state = {\n pages: [],\n selectedFormat: PaperFormat.A4,\n radio_selection: 'all',\n printPending: false,\n includeAnnotations: true,\n };\n const actions = {\n setFormat: (format) => ($state) => {\n let selectedFormat = $state.selectedFormat;\n if (format === 0) {\n selectedFormat = PaperFormat.A4;\n }\n else if (format === 1) {\n selectedFormat = PaperFormat.LETTER;\n }\n return Object.assign(Object.assign({}, $state), { selectedFormat });\n },\n setRadioSelection: (sel) => ($state) => {\n return Object.assign(Object.assign({}, $state), { radio_selection: sel });\n },\n setPrintPending: (printPending) => ($state) => {\n return Object.assign(Object.assign({}, $state), { printPending });\n },\n toggleIncludeAnnotations: () => ($state) => {\n return Object.assign(Object.assign({}, $state), { includeAnnotations: !$state.includeAnnotations });\n },\n };\n const App = () => (h(PrintServiceDialog, { print: props.print, cancel: props.cancel, pageCount: props.pageCount, currentPage: props.currentPage, parseRange: props.parseRange, validateRange: props.validateRange }));\n const PrintServiceDialog = ({ print, cancel, parseRange, validateRange }) => ($state, $actions) => (h(\"div\", { class: \"pwv-print-body\", id: \"pwv-print-body\" },\n h(\"div\", { class: \"pwv-print-title\" },\n h(Icon, { className: \"pwv-print-icon\", icon: icons.print, fill: '#008BD2' }),\n translationManager.getText('print.title')),\n $state.printPending ? (h(\"div\", null,\n h(Loader, null),\n h(\"div\", { class: \"pwv-print-bottom pwv-print-bottom-center\" },\n h(\"button\", { class: \"pwv-print-button-cancel\", onclick: () => {\n cancel();\n } }, translationManager.getText('print.cancel'))))) : (h(\"div\", null,\n h(\"div\", { class: \"pwv-print-pages\" },\n h(\"div\", { class: \"pwv-print-option\" },\n h(\"label\", null,\n h(\"input\", { type: \"radio\", id: \"all\", checked: $state.radio_selection === 'all' ? true : false, onclick: () => {\n $actions.setRadioSelection('all');\n } }),\n h(\"span\", { class: \"pwv-print-radio\" }),\n translationManager.getText('print.all'))),\n h(\"div\", { class: \"pwv-print-option\" },\n h(\"label\", null,\n h(\"input\", { type: \"radio\", id: \"current_page\", checked: $state.radio_selection === 'current_page' ? true : false, onclick: () => {\n $actions.setRadioSelection('current_page');\n } }),\n h(\"span\", { class: \"pwv-print-radio\" }),\n translationManager.getText('print.current'))),\n h(\"div\", { class: \"pwv-print-option\" },\n h(\"label\", null,\n h(\"input\", { type: \"radio\", id: \"range\", checked: $state.radio_selection === 'range' ? true : false, onclick: () => {\n $actions.setRadioSelection('range');\n } }),\n h(\"span\", { class: \"pwv-print-radio\" }),\n translationManager.getText('print.range')),\n h(\"input\", { class: \"pwv-print-page-range\", id: \"pwv-print-input-range\", type: \"text\", placeholder: \"e.g. 1,3-5\", onkeydown: (e) => {\n e.stopPropagation();\n }, onkeyup: (e) => {\n if (state.radio_selection !== 'range') {\n $actions.setRadioSelection('range');\n }\n const inputElement = document.getElementById('pwv-print-input-range');\n const errorMessage = document.getElementById('pwv-print-invalid-range-text');\n let bValidInput = false;\n if (validateRange(inputElement.value)) {\n const pages = parseRange(inputElement.value);\n bValidInput = !pages.some((page) => page > props.pageCount || page < 1);\n }\n if (bValidInput) {\n inputElement.classList.remove('pwv-print-invalid-input');\n errorMessage.style.display = 'none';\n }\n else {\n inputElement.classList.add('pwv-print-invalid-input');\n errorMessage.style.display = 'block';\n }\n } })),\n h(\"div\", { class: \"pwv-print-invalid-range-text-container\" },\n h(\"div\", { class: \"pwv-print-invalid-range-text\", id: \"pwv-print-invalid-range-text\" }, translationManager.getText('print.invalid'))),\n h(\"div\", { class: \"pwv-print-option\" },\n h(\"div\", { class: \"pwv-checkbox-btn pwv-print-include-annotations\", onclick: (e) => {\n $actions.toggleIncludeAnnotations();\n } },\n $state.includeAnnotations ? (h(Icon, { icon: icons.checkboxChecked })) : (h(Icon, { icon: icons.checkbox })),\n translationManager.getText('print.includeAnnotations')))),\n h(\"div\", { class: \"pwv-print-bottom\" },\n h(\"button\", { class: \"pwv-print-button-cancel\", onclick: () => {\n cancel();\n } }, translationManager.getText('print.cancel')),\n h(\"button\", { class: \"pwv-print-button-print\", onclick: () => {\n if ($state.radio_selection === 'all') {\n const pages = Array.from({ length: props.pageCount }, (x, i) => i + 1);\n print({\n pages,\n format: $state.selectedFormat,\n includeAnnotations: $state.includeAnnotations,\n });\n }\n if ($state.radio_selection === 'current_page') {\n print({\n pages: [props.currentPage],\n format: $state.selectedFormat,\n includeAnnotations: $state.includeAnnotations,\n });\n }\n if ($state.radio_selection === 'range') {\n const input = document.getElementById('pwv-print-input-range').value;\n const pages = parseRange(input);\n print({\n pages,\n format: $state.selectedFormat,\n includeAnnotations: $state.includeAnnotations,\n });\n }\n } }, translationManager.getText('print.print')))))));\n return app(state, actions, App, element);\n};\n","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { CanvasLayer } from '../CanvasLayer';\nimport { createPrintServiceDialog } from './PrintServiceDialog';\nconst moduleLayerName = 'PrintServiceLayer';\nexport class PrintServiceLayer extends CanvasLayer {\n constructor() {\n super(...arguments);\n this.printDialog = null;\n this.printElement = null;\n this.printIFrame = null;\n this.pageStyle = null;\n this.printPending = false;\n }\n onCreate() {\n this.startPrint = this.startPrint.bind(this);\n this.cancelPrint = this.cancelPrint.bind(this);\n this.validateRange = this.validateRange.bind(this);\n this.parseRange = this.parseRange.bind(this);\n this.stopTouchEventPropagation = this.stopTouchEventPropagation.bind(this);\n this.printElement = this.createHtmlLayer();\n this.printElement.className = 'pwv-print-dialog';\n this.printDialog = createPrintServiceDialog({\n pageCount: this.pdfApi.getPageCount(),\n currentPage: this.store.getState().document.firstVisiblePage,\n print: this.startPrint,\n cancel: this.cancelPrint,\n validateRange: this.validateRange,\n parseRange: this.parseRange,\n }, this.printElement);\n this.store.viewer.beginModule(moduleLayerName);\n this.printElement.addEventListener('touchstart', this.stopTouchEventPropagation);\n this.printElement.addEventListener('touchend', this.stopTouchEventPropagation);\n }\n startPrint({ pages, format, includeAnnotations, }) {\n var _a;\n this.printPending = true;\n if (this.printDialog) {\n this.printDialog.setPrintPending(true);\n }\n if (!this.printIFrame) {\n this.printIFrame = document.createElement('iframe');\n this.printIFrame.style.display = 'none';\n document.body.appendChild(this.printIFrame);\n const doc = this.printIFrame.contentDocument;\n doc.open();\n doc.close();\n if (doc.head) {\n const styleElm = doc.createElement('style');\n styleElm.textContent = `\n @media print {\n @page {size:A4;margin:0;padding:0}\n body {margin:0;padding:0;background-color:white;height:100%;}\n .page {\n width: 210mm;\n height: 297mm;\n overflow: hidden;\n page-break-after: always;\n break-after: always;\n -webkit-region-break-after: always;\n -webkit-column-break-after: always;\n -webkit-page-break-after: always;\n }\n .page:last-child {\n page-break-after: auto;\n break-after: auto;\n -webkit-page-break-after: auto;\n }\n .page img {\n width: 100%;\n height: auto;\n display: block;\n page-break-inside: avoid;\n break-inside: avoid;\n -webkit-region-break-inside: avoid;\n -webkit-column-break-inside: avoid;\n -webkit-page-break-inside: avoid;\n }\n body.is-safari .page {\n width: 100% !important;\n height: 100% !important;\n }\n }\n `;\n doc.head.append(styleElm);\n }\n if (/Safari\\//.test(navigator.userAgent) && !/Chrome\\//.test(navigator.userAgent)) {\n doc.body.classList.add('is-safari');\n }\n (_a = this.printIFrame.contentWindow) === null || _a === void 0 ? void 0 : _a.addEventListener('afterprint', () => {\n this.close();\n });\n }\n const printDocument = this.printIFrame.contentDocument;\n printDocument.body.innerHTML = '';\n const pageList = printDocument.createElement('div');\n printDocument.body.append(pageList);\n const pdfApi = this.pdfApi;\n const dpi = 150;\n const paperSizes = {\n a4: {\n width: 595,\n height: 842,\n },\n };\n const printerPaperSize = paperSizes.a4;\n const paperSize = {\n width: (printerPaperSize.width / 72) * dpi,\n height: (printerPaperSize.height / 72) * dpi,\n };\n const canvas = printDocument.createElement('canvas');\n canvas.width = paperSize.width;\n canvas.height = paperSize.height;\n const ctx = canvas.getContext('2d');\n const renderNextPage = () => __awaiter(this, void 0, void 0, function* () {\n if (!this.printPending) {\n return;\n }\n const page = pages.shift();\n if (page) {\n const pageSize = yield pdfApi.getPagePdfSize(page);\n let pageWidth = (pageSize.width / 72) * dpi;\n let pageHeight = (pageSize.height / 72) * dpi;\n const isLandscape = pageWidth > pageHeight;\n let scale = 1;\n if (isLandscape) {\n scale = Math.min(paperSize.height / pageWidth, paperSize.width / pageHeight);\n }\n else {\n scale = Math.min(paperSize.width / pageWidth, paperSize.height / pageHeight);\n }\n if (scale < 1) {\n pageWidth = pageWidth * scale;\n pageHeight = pageHeight * scale;\n }\n let annotationFilter = includeAnnotations ? undefined : () => false;\n const img = yield pdfApi.renderPage(page, pageWidth, pageHeight, annotationFilter);\n if (ctx) {\n ctx.clearRect(0, 0, paperSize.width, paperSize.height);\n ctx.save();\n if (isLandscape) {\n const tmpCanvas = printDocument.createElement('canvas');\n tmpCanvas.width = img.imageData.width;\n tmpCanvas.height = img.imageData.height;\n const tmpCtx = tmpCanvas.getContext('2d');\n if (tmpCtx) {\n tmpCtx.putImageData(img.imageData, 0, 0);\n }\n const imgPosX = (paperSize.height - img.imageData.width) / 2;\n const imgPosY = (paperSize.width - img.imageData.height) / 2;\n ctx.translate(canvas.width, 0);\n ctx.rotate((90 * Math.PI) / 180);\n ctx.drawImage(tmpCanvas, imgPosX, imgPosY);\n }\n else {\n const imgPosX = (paperSize.width - pageWidth) / 2;\n const imgPosY = (paperSize.height - pageHeight) / 2;\n ctx.putImageData(img.imageData, imgPosX, imgPosY);\n }\n ctx.restore();\n const pageElm = printDocument.createElement('div');\n pageElm.classList.add('page');\n pageList.append(pageElm);\n const imgSrc = canvas.toDataURL('image/png');\n const imgElm = printDocument.createElement('img');\n imgElm.src = imgSrc;\n pageElm.append(imgElm);\n }\n renderNextPage();\n }\n else {\n window.setTimeout(() => {\n this.printPending = false;\n if (this.printDialog) {\n this.printDialog.setPrintPending(false);\n }\n if (this.printIFrame && this.printIFrame.contentWindow) {\n this.printIFrame.contentWindow.print();\n }\n }, 100);\n }\n });\n renderNextPage();\n }\n cancelPrint() {\n this.printPending = false;\n this.remove();\n }\n stopTouchEventPropagation(e) {\n e.stopImmediatePropagation();\n }\n validateRange(range) {\n let regex = range.match(/^[\\d\\,\\-]*$/g);\n if (!regex || (regex && regex.length === 0)) {\n return false;\n }\n regex = range.match(/-{2,}|,{2,}/g);\n if (regex && regex.length > 0) {\n return false;\n }\n return true;\n }\n parseRange(range) {\n let pages = [];\n if (!this.validateRange(range)) {\n return [];\n }\n const splitInput = range.split(',');\n splitInput.forEach((input) => {\n const nDashes = (input.match(/-/g) || []).length;\n if (nDashes === 0) {\n pages.push(parseInt(input, 10));\n }\n if (nDashes === 1) {\n const numbers = input.split('-');\n let firstPage = parseInt(numbers[0], 10);\n let lastPage = parseInt(numbers[1], 10);\n if (lastPage < firstPage) {\n const temp = firstPage;\n firstPage = lastPage;\n lastPage = temp;\n }\n const pageRange = Array.from({ length: lastPage - firstPage + 1 }, (v, k) => k + firstPage);\n pages = pages.concat(pageRange);\n }\n });\n return pages;\n }\n close() {\n this.remove();\n }\n onRemove() {\n var _a, _b;\n (_a = this.printElement) === null || _a === void 0 ? void 0 : _a.removeEventListener('touchstart', this.stopTouchEventPropagation);\n (_b = this.printElement) === null || _b === void 0 ? void 0 : _b.removeEventListener('touchend', this.stopTouchEventPropagation);\n this.removeHtmlElements();\n this.printPending = false;\n this.printElement = null;\n if (this.pageStyle) {\n this.pageStyle.remove();\n }\n if (this.printIFrame) {\n document.body.removeChild(this.printIFrame);\n }\n this.store.viewer.endModule(moduleLayerName);\n }\n render(timestamp, state) {\n if (state.viewer.modeChanged && state.viewer.selectedModuleName !== moduleLayerName) {\n this.remove();\n return;\n }\n if (this.printElement && state.pointer.action === 'click') {\n const insideHorizontal = state.pointer.x.cssPixels > this.printElement.offsetLeft &&\n state.pointer.x.cssPixels < this.printElement.offsetLeft + this.printElement.offsetWidth;\n const insideVertical = state.pointer.y.cssPixels > this.printElement.offsetTop &&\n state.pointer.y.cssPixels < this.printElement.offsetTop + this.printElement.offsetHeight;\n if (!insideHorizontal || !insideVertical) {\n this.remove();\n return;\n }\n }\n }\n onSave() {\n return new Promise((resolve, rejct) => {\n return;\n });\n }\n}\n","import { CanvasModule, CanvasModuleType } from '../CanvasModule';\nimport { PrintServiceLayer } from './PrintServiceLayer';\nexport class PrintServiceModule extends CanvasModule {\n constructor() {\n super();\n this.annotationbarElement = null;\n this.toolbarElement = null;\n this.name = PrintServiceModule.moduleInfo.name;\n this.activate = this.activate.bind(this);\n }\n onRegister() {\n return {};\n }\n activate() {\n if (!this.canvasLayers['add']) {\n this.createCanvasLayer('add', PrintServiceLayer);\n }\n }\n}\nPrintServiceModule.moduleInfo = {\n name: 'PrintServiceModule',\n moduleType: CanvasModuleType.Layer,\n requiredFeatures: {\n annotate: false,\n fillFormFields: false,\n },\n translationKey: 'a',\n icon: 'a',\n};\n","import { CanvasLayer } from '../CanvasLayer';\nimport { PdfItemType, AnnotationBorderStyle, } from '../../pdf-viewer-api';\nimport { CursorStyle } from '../../pdf-viewer-canvas/state/viewer';\nimport { getRectFromSelection } from '../../pdf-viewer-canvas/state/document';\nimport { createAddShapeAnnotationToolbar, } from './AddShapeAnnotationToolbar';\nimport { Color } from '../../common/Color';\nconst moduleLayerName = 'AddShapeAnnotation';\nexport class AddShapeAnnotationLayer extends CanvasLayer {\n constructor() {\n super(...arguments);\n this.context = null;\n this.toolbar = null;\n this.page = 0;\n this.pointerDown = false;\n this.startPoint = null;\n this.itemType = null;\n this.strokeColors = [];\n this.fillColors = [];\n }\n onCreate(itemType) {\n this.setStrokeColor = this.setStrokeColor.bind(this);\n this.setStrokeWidth = this.setStrokeWidth.bind(this);\n this.setStrokeStyle = this.setStrokeStyle.bind(this);\n this.setFillColor = this.setFillColor.bind(this);\n this.setShape = this.setShape.bind(this);\n this.cancel = this.cancel.bind(this);\n this.context = this.createCanvas();\n this.itemType = itemType;\n const annotationOptions = this.options.annotation;\n this.strokeColors = annotationOptions.colors.foregroundColors;\n this.fillColors = annotationOptions.colors.backgroundColors;\n this.store.viewer.beginModule(moduleLayerName);\n const toolbarElement = this.module.toolbarElement;\n this.toolbar = createAddShapeAnnotationToolbar({\n strokeColors: this.strokeColors,\n strokeWidths: annotationOptions.strokeWidths,\n fillColors: this.fillColors,\n selectedStrokeColor: annotationOptions.colors.shapeColor,\n selectedStrokeWidth: annotationOptions.shapeStrokeWidth,\n selectedStrokeStyle: annotationOptions.shapeStrokeStyle,\n selectedFillColor: annotationOptions.colors.shapeFillColor,\n selectedShape: this.itemType,\n onStrokeColorChanged: this.setStrokeColor,\n onStrokeWidthChanged: this.setStrokeWidth,\n onStrokeStyleChanged: this.setStrokeStyle,\n onFillColorChanged: this.setFillColor,\n onShapeChanged: this.setShape,\n onCancel: this.cancel,\n }, toolbarElement);\n }\n cancel() {\n this.remove();\n }\n onSave() {\n const promise = new Promise((resolve, reject) => {\n resolve();\n });\n return promise;\n }\n onRemove() {\n this.removeCanvasElements();\n this.context = null;\n const toolbarElement = this.module.toolbarElement;\n toolbarElement.innerHTML = '';\n this.store.viewer.setCursorStyle(CursorStyle.DEFAULT);\n this.store.viewer.endModule(moduleLayerName);\n }\n render(timestamp, state) {\n if (state.viewer.modeChanged && state.viewer.selectedModuleName !== moduleLayerName) {\n this.remove();\n return;\n }\n if (this.context) {\n const update = state.viewer.modeChanged ||\n state.pointer.positionChanged ||\n state.pointer.action ||\n state.document.zoomChanged;\n if (update) {\n const ctx = this.context;\n ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);\n const pointerPos = {\n x: state.pointer.x.devicePixels,\n y: state.pointer.y.devicePixels,\n };\n const pointerPdfPos = this.pdfApi.transformScreenPointToPdfPoint(pointerPos);\n if (pointerPdfPos.isOnPage) {\n this.store.viewer.setCursorStyle(CursorStyle.CROSSHAIR);\n }\n else {\n this.store.viewer.setCursorStyle(CursorStyle.NOT_ALLOWED);\n }\n if (state.pointer.isDown) {\n if (!this.pointerDown) {\n this.startPoint = pointerPos;\n this.pointerDown = true;\n if (this.page === 0 && pointerPdfPos.isOnPage) {\n this.page = pointerPdfPos.pdfPoint.page;\n }\n }\n if (this.startPoint) {\n const rect = getRectFromSelection(state.document, {\n x: this.startPoint.x,\n y: this.startPoint.y,\n }, {\n x: pointerPos.x,\n y: pointerPos.y,\n }, this.page);\n const annotationOptions = this.options.annotation;\n if (rect) {\n ctx.save();\n const strokeColor = new Color(annotationOptions.colors.shapeColor);\n ctx.strokeStyle = strokeColor.toRgb();\n const fillColor = new Color(annotationOptions.colors.shapeFillColor);\n ctx.fillStyle = fillColor.toRgb();\n const lineWidth = annotationOptions.shapeStrokeWidth * devicePixelRatio * state.document.zoom;\n ctx.lineWidth = lineWidth;\n if (lineWidth) {\n ctx.globalAlpha = strokeColor.a;\n }\n else {\n ctx.globalAlpha = fillColor.a;\n }\n if (this.options.annotation.shapeStrokeStyle === AnnotationBorderStyle.DASHED) {\n ctx.setLineDash([ctx.lineWidth]);\n }\n if (this.itemType === PdfItemType.CIRCLE) {\n const cX = rect.x + rect.w / 2;\n const cY = rect.y + rect.h / 2;\n ctx.beginPath();\n ctx.ellipse(cX, cY, Math.max(rect.w / 2 - ctx.lineWidth / 2, 0), Math.max(rect.h / 2 - ctx.lineWidth / 2, 0), 0, 0, Math.PI * 2);\n if (fillColor.a) {\n ctx.fill();\n }\n if (annotationOptions.shapeStrokeWidth) {\n ctx.stroke();\n }\n }\n else {\n if (fillColor.a) {\n ctx.fillRect(rect.x, rect.y, rect.w, rect.h);\n }\n if (annotationOptions.shapeStrokeWidth) {\n ctx.strokeRect(rect.x + ctx.lineWidth / 2, rect.y + ctx.lineWidth / 2, rect.w - ctx.lineWidth, rect.h - ctx.lineWidth);\n }\n }\n ctx.restore();\n }\n }\n }\n else if (this.pointerDown && this.startPoint) {\n const rect = getRectFromSelection(state.document, {\n x: this.startPoint.x,\n y: this.startPoint.y,\n }, {\n x: pointerPos.x,\n y: pointerPos.y,\n }, this.page);\n if (rect) {\n this.pointerDown = false;\n this.startPoint = null;\n this.createRectangleAnnotation(rect);\n }\n }\n }\n }\n }\n setStrokeColor(color) {\n this.options.annotation.colors.shapeColor = color;\n }\n setShape(shape) {\n this.itemType = shape;\n }\n setStrokeWidth(width) {\n this.options.annotation.shapeStrokeWidth = width;\n }\n setStrokeStyle(style) {\n this.options.annotation.shapeStrokeStyle = style;\n }\n setFillColor(color) {\n this.options.annotation.colors.shapeFillColor = color;\n }\n createRectangleAnnotation(rect) {\n const pdfRect = this.pdfApi.transformScreenRectToPdfRect(rect, this.page);\n const annotationOptions = this.options.annotation;\n const annotation = {\n itemType: this.itemType,\n color: annotationOptions.colors.shapeColor,\n pdfRect,\n page: this.page,\n author: this.options.viewer.general.user,\n fillColor: annotationOptions.colors.shapeFillColor === 'transparent'\n ? null\n : annotationOptions.colors.shapeFillColor,\n border: {\n width: annotationOptions.shapeStrokeWidth,\n style: this.options.annotation.shapeStrokeStyle,\n },\n };\n this.pdfApi\n .createItem(annotation)\n .then(() => {\n this.remove();\n })\n .catch((err) => {\n console.error(err);\n });\n }\n}\n","import { app, h } from '../../lib/hyperapp';\nimport { PdfItemType } from '../../pdf-viewer-api';\nimport { translationManager } from '../../common/TranslationManager';\nimport { Toolbar } from '../../common/Toolbar';\nimport { ToolbarItemGroup } from '../../common/ToolbarItemGroup';\nimport { ToolbarButton } from '../../common/ToolbarButton';\nimport { icons } from '../../common/icons';\nimport { ToolbarSeparator } from '../../common/ToolbarSeparator';\nimport { StrokeWidthPicker } from '../../common/StrokeWidthPicker';\nimport { StrokeStylePicker } from '../../common/StrokeStylePicker';\nimport { ColorPicker } from '../../common/ColorPicker';\nexport const createAddShapeAnnotationToolbar = (props, element) => {\n const state = {\n strokeColors: props.strokeColors,\n strokeWidths: props.strokeWidths,\n fillColors: props.fillColors,\n selectedShape: props.selectedShape,\n selectedStrokeColor: props.selectedStrokeColor,\n selectedStrokeWidth: props.selectedStrokeWidth,\n selectedStrokeStyle: props.selectedStrokeStyle,\n selectedFillColor: props.selectedFillColor,\n };\n const actions = {\n setShape: (shape) => ($state) => {\n props.onShapeChanged(shape);\n return Object.assign(Object.assign({}, $state), { selectedShape: shape });\n },\n setStrokeColor: (color) => ($state) => {\n props.onStrokeColorChanged(color);\n return Object.assign(Object.assign({}, $state), { selectedStrokeColor: color });\n },\n setStrokeWidth: (width) => ($state) => {\n props.onStrokeWidthChanged(width);\n return Object.assign(Object.assign({}, $state), { selectedStrokeWidth: width });\n },\n setStrokeStyle: (style) => ($state) => {\n props.onStrokeStyleChanged(style);\n return Object.assign(Object.assign({}, $state), { selectedStrokeStyle: style });\n },\n setFillColor: (color) => ($state) => {\n props.onFillColorChanged(color);\n return Object.assign(Object.assign({}, $state), { selectedFillColor: color });\n },\n setCancel: () => ($state) => {\n return Object.assign({}, $state);\n },\n };\n const App = () => h(AddShapeAnnotationToolbar, null);\n const AddShapeAnnotationToolbar = ({}) => ($state, $actions) => (h(Toolbar, { allowWrap: true, alignCenter: true },\n h(ToolbarItemGroup, null,\n h(ToolbarButton, { tooltip: translationManager.getText('annotShape.addRectangle'), icon: icons.rectangle, active: $state.selectedShape === PdfItemType.SQUARE, onClick: () => {\n $actions.setShape(PdfItemType.SQUARE);\n } }),\n h(ToolbarButton, { tooltip: translationManager.getText('annotShape.addEllipse'), icon: icons.circle, active: $state.selectedShape === PdfItemType.CIRCLE, onClick: () => {\n $actions.setShape(PdfItemType.CIRCLE);\n } }),\n h(ToolbarSeparator, null)),\n h(ToolbarItemGroup, null,\n h(StrokeWidthPicker, { tooltip: translationManager.getText('annotShape.strokeWidth'), noneStrokeText: translationManager.getText('border.none'), strokeWidths: $state.strokeWidths, value: $state.selectedStrokeWidth, onChange: $actions.setStrokeWidth }),\n h(StrokeStylePicker, { tooltip: translationManager.getText('annotShape.strokeStyle'), value: $state.selectedStrokeStyle, disabled: $state.selectedStrokeWidth === 0, onChange: $actions.setStrokeStyle, shapeType: $state.selectedShape === PdfItemType.CIRCLE ? 'circle' : 'rectangle' }),\n h(ColorPicker, { tooltip: translationManager.getText('annotShape.strokeColor'), colors: $state.strokeColors, color: $state.selectedStrokeColor, disabled: $state.selectedStrokeWidth === 0, icon: icons.pencil, onChange: $actions.setStrokeColor })),\n h(ToolbarItemGroup, null,\n h(ToolbarSeparator, null),\n h(ColorPicker, { tooltip: translationManager.getText('annotShape.bgColor'), colors: $state.fillColors, color: $state.selectedFillColor, icon: icons.fillColor, onChange: $actions.setFillColor })),\n h(ToolbarItemGroup, { pushRight: true },\n h(ToolbarSeparator, null),\n h(ToolbarButton, { icon: icons.close, onClick: props.onCancel }))));\n return app(state, actions, App, element);\n};\n","import { CanvasLayer } from '../CanvasLayer';\nimport { CursorStyle } from '../../pdf-viewer-canvas/state/viewer';\nimport { createEditShapeAnnotationToolbar, } from './EditShapeAnnotationToolbar';\nimport { Color } from '../../common/Color';\nconst moduleLayerName = 'EditShapeAnnotation';\nexport class EditShapeAnnotationLayer extends CanvasLayer {\n constructor() {\n super(...arguments);\n this.shapeAnnotation = null;\n this.context = null;\n this.toolbar = null;\n this.strokeColors = [];\n this.fillColors = [];\n }\n onCreate(annotationId) {\n this.shapeAnnotation = this.pdfApi.getItem(annotationId);\n this.setStrokeColor = this.setStrokeColor.bind(this);\n this.setStrokeWidth = this.setStrokeWidth.bind(this);\n this.setStrokeStyle = this.setStrokeStyle.bind(this);\n this.setFillColor = this.setFillColor.bind(this);\n this.close = this.close.bind(this);\n const annotOptions = this.options.annotation;\n this.strokeColors = annotOptions.colors.foregroundColors;\n this.fillColors = annotOptions.colors.backgroundColors;\n this.context = this.createCanvas();\n const toolbarElement = this.module.toolbarElement;\n this.toolbar = createEditShapeAnnotationToolbar({\n strokeColors: this.strokeColors,\n strokeWidths: annotOptions.strokeWidths,\n fillColors: this.fillColors,\n selectedStrokeColor: this.shapeAnnotation.color\n ? this.shapeAnnotation.color\n : annotOptions.colors.shapeColor,\n selectedStrokeWidth: this.shapeAnnotation.border.width,\n selectedStrokeStyle: this.shapeAnnotation.border.style,\n selectedFillColor: this.shapeAnnotation.fillColor\n ? this.shapeAnnotation.fillColor\n : annotOptions.colors.shapeFillColor,\n itemType: this.shapeAnnotation.itemType,\n onStrokeColorChanged: this.setStrokeColor,\n onStrokeWidthChanged: this.setStrokeWidth,\n onStrokeStyleChanged: this.setStrokeStyle,\n onFillColorChanged: this.setFillColor,\n onCancel: this.close,\n }, toolbarElement);\n this.store.viewer.beginModule(moduleLayerName);\n }\n close() {\n this.remove();\n }\n onSave() {\n return new Promise((resolve, reject) => {\n resolve();\n });\n }\n onRemove() {\n this.removeCanvasElements();\n this.context = null;\n const toolbarElement = this.module.toolbarElement;\n toolbarElement.innerHTML = '';\n this.store.viewer.setCursorStyle(CursorStyle.DEFAULT);\n this.store.viewer.endModule(moduleLayerName);\n }\n render(timestamp, state) {\n var _a;\n if (state.viewer.modeChanged && state.viewer.selectedModuleName !== moduleLayerName) {\n this.remove();\n return;\n }\n if (state.pointer.action === 'click' || state.pointer.action === 'dblclick') {\n const shapeAnnotation = (_a = this.pdfApi\n .getAnnotationsOnPoint({\n x: state.pointer.x.devicePixels,\n y: state.pointer.y.devicePixels,\n })) === null || _a === void 0 ? void 0 : _a.find((a) => this.shapeAnnotation && a.id === this.shapeAnnotation.id);\n if (!shapeAnnotation) {\n this.close();\n return;\n }\n }\n if (this.context && this.shapeAnnotation) {\n const ctx = this.context;\n ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);\n const rect = this.pdfApi.transformPdfPageRectToScreenRect(this.shapeAnnotation.pdfRect);\n const lineWidth = 2 * devicePixelRatio;\n ctx.save();\n ctx.strokeStyle = this.options.viewer.general.textSelectionColor;\n ctx.lineWidth = lineWidth;\n ctx.setLineDash([lineWidth, lineWidth]);\n ctx.strokeRect(rect.x - lineWidth, rect.y - lineWidth, rect.w + 2 * lineWidth, rect.h + 2 * lineWidth);\n ctx.restore();\n }\n }\n setStrokeColor(color) {\n if (this.shapeAnnotation && this.shapeAnnotation.color) {\n const newColor = new Color(color);\n const currentColor = new Color(this.shapeAnnotation.color);\n newColor.setOpacity(currentColor.a);\n this.shapeAnnotation.color = newColor.toRgba();\n this.updateShapeAnnotation();\n }\n }\n setStrokeWidth(width) {\n if (this.shapeAnnotation) {\n this.shapeAnnotation.border = {\n style: this.shapeAnnotation.border.style,\n width: width,\n };\n this.updateShapeAnnotation();\n }\n }\n setStrokeStyle(style) {\n if (this.shapeAnnotation) {\n this.shapeAnnotation.border = {\n style: style,\n width: this.shapeAnnotation.border.width,\n };\n this.updateShapeAnnotation();\n }\n }\n setFillColor(color) {\n if (this.shapeAnnotation) {\n const newColor = new Color(color);\n this.shapeAnnotation.fillColor = newColor.toRgba();\n this.updateShapeAnnotation();\n }\n }\n updateShapeAnnotation() {\n const promise = new Promise((resolve, reject) => {\n if (this.pdfApi && this.shapeAnnotation) {\n this.pdfApi\n .updateItem(this.shapeAnnotation)\n .then((item) => {\n resolve();\n })\n .catch((error) => {\n console.warn(error);\n });\n }\n else {\n reject();\n }\n });\n return promise;\n }\n}\n","import { app, h } from '../../lib/hyperapp';\nimport { PdfItemType } from '../../pdf-viewer-api';\nimport { translationManager } from '../../common/TranslationManager';\nimport { Toolbar } from '../../common/Toolbar';\nimport { ToolbarItemGroup } from '../../common/ToolbarItemGroup';\nimport { ToolbarButton } from '../../common/ToolbarButton';\nimport { icons } from '../../common/icons';\nimport { ToolbarSeparator } from '../../common/ToolbarSeparator';\nimport { StrokeWidthPicker } from '../../common/StrokeWidthPicker';\nimport { StrokeStylePicker } from '../../common/StrokeStylePicker';\nimport { ColorPicker } from '../../common/ColorPicker';\nexport const createEditShapeAnnotationToolbar = (props, element) => {\n const state = {\n strokeColors: props.strokeColors,\n strokeWidths: props.strokeWidths,\n fillColors: props.fillColors,\n selectedStrokeColor: props.selectedStrokeColor,\n selectedStrokeWidth: props.selectedStrokeWidth,\n selectedStrokeStyle: props.selectedStrokeStyle,\n selectedFillColor: props.selectedFillColor,\n itemType: props.itemType,\n };\n const actions = {\n setStrokeColor: (color) => ($state) => {\n props.onStrokeColorChanged(color);\n return Object.assign(Object.assign({}, $state), { selectedStrokeColor: color });\n },\n setStrokeWidth: (width) => ($state) => {\n props.onStrokeWidthChanged(width);\n return Object.assign(Object.assign({}, $state), { selectedStrokeWidth: width });\n },\n setStrokeStyle: (style) => ($state) => {\n props.onStrokeStyleChanged(style);\n return Object.assign(Object.assign({}, $state), { selectedStrokeStyle: style });\n },\n setFillColor: (color) => ($state) => {\n props.onFillColorChanged(color);\n return Object.assign(Object.assign({}, $state), { selectedFillColor: color });\n },\n setCancel: () => ($state) => {\n return Object.assign({}, $state);\n },\n };\n const App = () => h(EditShapeAnnotationToolbar, null);\n const EditShapeAnnotationToolbar = ({}) => ($state, $actions) => (h(Toolbar, { allowWrap: true, alignCenter: true },\n h(ToolbarItemGroup, null,\n h(StrokeWidthPicker, { tooltip: translationManager.getText('annotShape.strokeWidth'), noneStrokeText: translationManager.getText('border.none'), strokeWidths: $state.strokeWidths, value: $state.selectedStrokeWidth, onChange: $actions.setStrokeWidth }),\n h(StrokeStylePicker, { tooltip: translationManager.getText('annotShape.strokeStyle'), value: $state.selectedStrokeStyle, disabled: $state.selectedStrokeWidth === 0, onChange: $actions.setStrokeStyle, shapeType: $state.itemType === PdfItemType.CIRCLE ? 'circle' : 'rectangle' }),\n h(ColorPicker, { tooltip: translationManager.getText('annotShape.strokeColor'), colors: $state.strokeColors, color: $state.selectedStrokeColor, disabled: $state.selectedStrokeWidth === 0, icon: icons.pencil, onChange: $actions.setStrokeColor })),\n h(ToolbarItemGroup, null,\n h(ToolbarSeparator, null),\n h(ColorPicker, { tooltip: translationManager.getText('annotShape.bgColor'), colors: $state.fillColors, color: $state.selectedFillColor, icon: icons.fillColor, onChange: $actions.setFillColor })),\n h(ToolbarItemGroup, { pushRight: true },\n h(ToolbarSeparator, null),\n h(ToolbarButton, { icon: icons.close, onClick: props.onCancel }))));\n return app(state, actions, App, element);\n};\n","import { CanvasModule, CanvasModuleType } from '../CanvasModule';\nimport { AddShapeAnnotationLayer } from './AddShapeAnnotationLayer';\nimport { EditShapeAnnotationLayer } from './EditShapeAnnotationLayer';\nimport { PdfItemType } from '../../pdf-viewer-api';\nimport { icons } from '../../common/Icon';\nimport { translationManager } from '../../common/TranslationManager';\nexport class ShapeAnnotationModule extends CanvasModule {\n constructor() {\n super();\n this.annotationbarElement = null;\n this.toolbarElement = null;\n this.name = ShapeAnnotationModule.moduleInfo.name;\n this.onEdit = this.onEdit.bind(this);\n }\n onRegister() {\n this.toolbarElement = document.createElement('div');\n return {\n toolbar: this.toolbarElement,\n contextbar: {\n itemTypes: [PdfItemType.SQUARE, PdfItemType.CIRCLE],\n icon: icons.edit,\n tooltip: translationManager.getText('annotShape.edit'),\n onCmd: (annotationId) => {\n this.onEdit(annotationId);\n },\n },\n };\n }\n activate() {\n if (!this.canvasLayers['add']) {\n this.createCanvasLayer('add', AddShapeAnnotationLayer, PdfItemType.SQUARE);\n }\n else {\n this.removeCanvasLayer('add');\n }\n }\n onEdit(annotationId) {\n this.createCanvasLayer('edit', EditShapeAnnotationLayer, annotationId);\n }\n}\nShapeAnnotationModule.moduleInfo = {\n name: 'ShapeAnnotationModule',\n moduleType: CanvasModuleType.Tool,\n requiredFeatures: {\n annotate: true,\n fillFormFields: false,\n },\n translationKey: 'annotShape.add',\n icon: 'shapes',\n};\n","import { CanvasLayer } from '../CanvasLayer';\nimport { PdfItemType, StampAnnotationColor, } from '../../pdf-viewer-api';\nimport { CursorStyle } from '../../pdf-viewer-canvas/state/viewer';\nimport { getRectFromSelection } from '../../pdf-viewer-canvas/state/document';\nimport { createAddStampAnnotationToolbar } from './AddStampAnnotationToolbar';\nimport { translationManager } from '../../common/TranslationManager';\nimport { imageDataUrlToUint8Array } from '../../common/Tools';\nconst moduleLayerName = 'AddStampAnnotation';\nexport class AddStampAnnotationLayer extends CanvasLayer {\n constructor() {\n super(...arguments);\n this.context = null;\n this.pointerDown = false;\n this.startPoint = null;\n this.stampRect = null;\n this.page = 0;\n this.screenPageRect = null;\n this.aspectRatio = null;\n this.stamps = [];\n }\n onCreate() {\n this.setStamp = this.setStamp.bind(this);\n this.close = this.close.bind(this);\n this.context = this.createCanvas();\n this.stamps = this.options.annotation.stamps;\n const toolbarElement = this.module.toolbarElement;\n this.setStamp(this.options.annotation.selectedStamp);\n createAddStampAnnotationToolbar({\n selectedStamp: this.options.annotation.selectedStamp,\n stamps: this.stamps,\n onStampChanged: this.setStamp,\n onClose: this.close,\n }, toolbarElement);\n this.store.viewer.beginModule(moduleLayerName);\n }\n onSave() {\n const promise = new Promise((resolve, reject) => {\n resolve();\n });\n return promise;\n }\n onRemove() {\n this.removeCanvasElements();\n this.context = null;\n const toolbarElement = this.module.toolbarElement;\n toolbarElement.innerHTML = '';\n this.store.viewer.setCursorStyle(CursorStyle.DEFAULT);\n this.store.viewer.endModule(moduleLayerName);\n }\n render(timestamp, state) {\n if (state.viewer.modeChanged && state.viewer.selectedModuleName !== moduleLayerName) {\n this.remove();\n return;\n }\n if (!this.aspectRatio) {\n return;\n }\n if (this.context) {\n const update = state.viewer.modeChanged ||\n state.pointer.positionChanged ||\n state.pointer.action ||\n state.document.zoomChanged;\n if (update) {\n const ctx = this.context;\n ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);\n const pointerPos = { x: state.pointer.x.devicePixels, y: state.pointer.y.devicePixels };\n const pointerPdfPos = this.pdfApi.transformScreenPointToPdfPoint(pointerPos);\n if (pointerPdfPos.isOnPage) {\n this.store.viewer.setCursorStyle(CursorStyle.CROSSHAIR);\n }\n else {\n this.store.viewer.setCursorStyle(CursorStyle.NOT_ALLOWED);\n }\n if (state.pointer.isDown) {\n if (!this.pointerDown) {\n if (!pointerPdfPos.isOnPage) {\n return;\n }\n this.startPoint = pointerPos;\n this.page = pointerPdfPos.pdfPoint.page;\n this.pointerDown = true;\n this.screenPageRect = this.pdfApi.getPageScreenRect(this.page);\n }\n if (this.startPoint && this.screenPageRect) {\n this.stampRect = getRectFromSelection(state.document, {\n x: this.startPoint.x,\n y: this.startPoint.y,\n }, {\n x: pointerPos.x,\n y: pointerPos.y,\n });\n if (this.stampRect) {\n this.stampRect.h = this.stampRect.w / this.aspectRatio;\n const lineWidth = 2 * devicePixelRatio;\n ctx.save();\n ctx.strokeStyle = this.options.viewer.general.textSelectionColor;\n ctx.fillStyle = this.options.viewer.general.textSelectionColor;\n ctx.lineWidth = lineWidth;\n ctx.setLineDash([lineWidth, lineWidth]);\n if (this.startPoint.y > pointerPos.y) {\n this.stampRect.y = this.startPoint.y - this.stampRect.h;\n if (this.stampRect.y < this.screenPageRect.y) {\n this.stampRect.y = this.screenPageRect.y;\n this.stampRect.w = this.stampRect.h * this.aspectRatio;\n }\n }\n else {\n if (this.startPoint.y + this.stampRect.h >\n this.screenPageRect.y + this.screenPageRect.h) {\n this.stampRect.h =\n this.screenPageRect.y + this.screenPageRect.h - this.startPoint.y;\n this.stampRect.w = this.stampRect.h * this.aspectRatio;\n }\n }\n ctx.strokeRect(this.stampRect.x, this.stampRect.y, this.stampRect.w, this.stampRect.h);\n ctx.globalAlpha = 0.33;\n ctx.fillRect(this.stampRect.x, this.stampRect.y, this.stampRect.w, this.stampRect.h);\n ctx.restore();\n }\n }\n }\n else if (this.pointerDown && this.startPoint) {\n if (this.stampRect) {\n this.createStampAnnotation(this.stampRect);\n this.pointerDown = false;\n this.startPoint = null;\n this.stampRect = null;\n this.page = 0;\n this.aspectRatio = null;\n this.screenPageRect = null;\n this.remove();\n return;\n }\n }\n }\n }\n }\n close() {\n this.remove();\n }\n setStamp(stampIndex) {\n if (this.stamps.length == 0) {\n return;\n }\n if (stampIndex >= this.stamps.length) {\n stampIndex = 0;\n }\n this.options.annotation.selectedStamp = stampIndex;\n const stamp = this.stamps[stampIndex];\n if (stamp.aspectRatio) {\n this.aspectRatio = stamp.aspectRatio;\n return;\n }\n if (stamp.image) {\n const img = new Image();\n img.onload = () => {\n this.aspectRatio = img.width / img.height;\n };\n img.src = stamp.image;\n return;\n }\n this.pdfApi\n .getTextStampAspectRatio(stamp.text ? stamp.text : translationManager.getText(stamp.translation_key))\n .then((aspectRatio) => {\n this.aspectRatio = aspectRatio;\n });\n }\n createStampAnnotation(rect) {\n const pdfRect = this.pdfApi.transformScreenRectToPdfRect(rect, this.page);\n if (this.aspectRatio && (pdfRect.pdfW < 2 || pdfRect.pdfH < 2)) {\n switch (this.pdfApi.getRotation()) {\n case 0:\n pdfRect.pdfW = this.options.annotation.defaultStampWidth;\n pdfRect.pdfH = pdfRect.pdfW / this.aspectRatio;\n pdfRect.pdfY -= pdfRect.pdfH;\n break;\n case 90:\n pdfRect.pdfH = this.options.annotation.defaultStampWidth;\n pdfRect.pdfW = pdfRect.pdfH / this.aspectRatio;\n break;\n case 180:\n pdfRect.pdfW = this.options.annotation.defaultStampWidth;\n pdfRect.pdfH = pdfRect.pdfW / this.aspectRatio;\n pdfRect.pdfX -= pdfRect.pdfW;\n break;\n case 270:\n pdfRect.pdfH = this.options.annotation.defaultStampWidth;\n pdfRect.pdfW = pdfRect.pdfH / this.aspectRatio;\n pdfRect.pdfX -= pdfRect.pdfW;\n pdfRect.pdfY -= pdfRect.pdfH;\n break;\n default:\n break;\n }\n }\n const stampSetting = this.stamps[this.options.annotation.selectedStamp];\n if (stampSetting.pdfStampFileName) {\n this.pdfApi\n .registerPdfPage(stampSetting.pdfStampFileName, stampSetting.pageNumber)\n .then((imageId) => {\n const annotation = {\n itemType: PdfItemType.STAMP,\n imageId,\n page: pdfRect.page,\n color: this.options.annotation.colors.defaultHighlightColor,\n pdfRect,\n author: this.options.viewer.general.user,\n };\n this.pdfApi.createItem(annotation).then((annot) => {\n this.onAnnotationCreated(annot);\n });\n });\n }\n else if (stampSetting.image) {\n const imgData = imageDataUrlToUint8Array(stampSetting.image);\n this.pdfApi.registerStampImage(imgData).then((imageId) => {\n const annotation = {\n itemType: PdfItemType.STAMP,\n imageId,\n page: pdfRect.page,\n color: this.options.annotation.colors.defaultHighlightColor,\n pdfRect,\n author: this.options.viewer.general.user,\n };\n this.pdfApi.createItem(annotation).then((annot) => {\n this.onAnnotationCreated(annot);\n });\n });\n }\n else {\n let stampColor = null;\n let stampName = null;\n if (stampSetting) {\n stampColor = stampSetting.color;\n stampName = stampSetting.pdfStampName !== undefined ? stampSetting.pdfStampName : null;\n }\n const annotation = {\n itemType: PdfItemType.STAMP,\n color: this.options.annotation.colors.defaultHighlightColor,\n author: this.options.viewer.general.user,\n page: pdfRect.page,\n pdfRect,\n stampName,\n stampText: stampSetting.text\n ? stampSetting.text\n : translationManager.getText(stampSetting.translation_key),\n stampColor: stampColor != null ? stampColor : StampAnnotationColor.GREEN,\n };\n this.pdfApi.createItem(annotation).then((annot) => {\n this.onAnnotationCreated(annot);\n });\n }\n }\n}\n","import { app, h } from '../../lib/hyperapp';\nimport { translationManager } from '../../common/TranslationManager';\nimport { Toolbar } from '../../common/Toolbar';\nimport { ToolbarItemGroup } from '../../common/ToolbarItemGroup';\nimport { ToolbarButton } from '../../common/ToolbarButton';\nimport { icons } from '../../common/icons';\nimport { ToolbarSeparator } from '../../common/ToolbarSeparator';\nimport { Dropdown } from '../../common/Dropdown';\nexport const createAddStampAnnotationToolbar = (props, element) => {\n const state = {\n stamps: props.stamps,\n stampDropdownItems: [],\n selectedStamp: props.selectedStamp,\n };\n const actions = {\n setStamp: (stamp) => ($state) => {\n props.onStampChanged(stamp);\n return Object.assign(Object.assign({}, $state), { selectedStamp: stamp });\n },\n };\n const DropdownStampItem = (item) => {\n const stamp = state.stamps[item.value];\n if (stamp.thumbnail) {\n return (h(\"div\", { title: stamp.title || '' },\n h(\"img\", { src: stamp.thumbnail })));\n }\n if (stamp.name) {\n return h(\"div\", { title: stamp.title || '' }, stamp.name);\n }\n return (h(\"div\", { title: stamp.title || '' }, stamp.image\n ? stamp.name\n : stamp.text\n ? stamp.text\n : translationManager.getText(stamp.translation_key)));\n };\n const DropdownButton = (value) => {\n if (value === -1) {\n return (h(\"div\", { class: \"pwv-Dropdown-text\" }, translationManager.getText('annotStamp.chooseStamp')));\n }\n const stamp = state.stamps[value];\n if (stamp.thumbnail) {\n return (h(\"div\", { class: \"pwv-Dropdown-text\" },\n h(\"img\", { src: stamp.thumbnail })));\n }\n if (stamp.pdfStampFileName) {\n return h(\"div\", { class: \"pwv-Dropdown-text\" }, stamp.name);\n }\n return (h(\"div\", { class: \"pwv-Dropdown-text\" }, stamp.image\n ? stamp.name\n : stamp.text\n ? stamp.text\n : translationManager.getText(stamp.translation_key)));\n };\n const App = () => h(AddStampAnnotationToolbar, null);\n const AddStampAnnotationToolbar = ({}) => ($state, $actions) => (h(Toolbar, { allowWrap: true, alignCenter: true },\n h(ToolbarItemGroup, null,\n h(Dropdown, { className: \"pwv-stampannotation-dropdown\", value: $state.selectedStamp, items: $state.stamps.map((stamp, index) => ({\n value: index,\n renderItem: DropdownStampItem,\n })), onChange: $actions.setStamp, renderButton: DropdownButton })),\n h(ToolbarItemGroup, { pushRight: true },\n h(ToolbarSeparator, null),\n h(ToolbarButton, { icon: icons.close, onClick: props.onClose }))));\n return app(state, actions, App, element);\n};\n","import { CanvasModule, CanvasModuleType } from '../CanvasModule';\nimport { AddStampAnnotationLayer } from './AddStampAnnotationLayer';\nexport class StampAnnotationModule extends CanvasModule {\n constructor() {\n super();\n this.annotationbarElement = null;\n this.toolbarElement = null;\n this.name = StampAnnotationModule.moduleInfo.name;\n this.activate = this.activate.bind(this);\n }\n onRegister() {\n this.toolbarElement = document.createElement('div');\n return {\n toolbar: this.toolbarElement,\n };\n }\n activate() {\n if (!this.canvasLayers['add']) {\n this.createCanvasLayer('add', AddStampAnnotationLayer);\n }\n else {\n this.removeCanvasLayer('add');\n }\n }\n}\nStampAnnotationModule.moduleInfo = {\n name: 'StampAnnotationModule',\n moduleType: CanvasModuleType.Tool,\n requiredFeatures: {\n annotate: true,\n fillFormFields: false,\n },\n translationKey: 'annotStamp.add',\n icon: 'stamp',\n};\n","import { CanvasLayer } from '../CanvasLayer';\nimport { PdfItemType, } from '../../pdf-viewer-api';\nimport { CursorStyle } from '../../pdf-viewer-canvas/state/viewer';\nimport { renderStickyNote } from '../../pdf-viewer-canvas/view-layers/canvasShapes';\nimport { createAddTextAnnotationToolbar } from './AddTextAnnotationToolbar';\nconst moduleLayerName = 'AddTextAnnotation';\nexport class AddTextAnnotationLayer extends CanvasLayer {\n constructor() {\n super(...arguments);\n this.colors = [];\n this.selectedColor = '';\n }\n onCreate() {\n this.setColor = this.setColor.bind(this);\n this.close = this.close.bind(this);\n this.context = this.createCanvas();\n this.colors = this.options.annotation.colors.highlightColors;\n this.selectedColor = this.options.annotation.colors.stickyNoteColor;\n const toolbarElement = this.module.toolbarElement;\n createAddTextAnnotationToolbar({\n colors: this.colors,\n selectedColor: this.selectedColor,\n onColorChanged: this.setColor,\n onClose: this.close,\n }, toolbarElement);\n this.store.viewer.beginModule(moduleLayerName);\n }\n onSave() {\n const promise = new Promise((resolve, reject) => {\n resolve();\n });\n return promise;\n }\n onRemove() {\n this.removeCanvasElements();\n this.context = null;\n const toolbarElement = this.module.toolbarElement;\n toolbarElement.innerHTML = '';\n this.store.viewer.endModule(moduleLayerName);\n }\n render(timestamp, state) {\n if (state.viewer.modeChanged && state.viewer.selectedModuleName !== moduleLayerName) {\n this.remove();\n return;\n }\n if (this.context &&\n (state.viewer.modeChanged ||\n state.pointer.positionChanged ||\n state.pointer.action ||\n state.canvas.canvasInvalidated)) {\n const ctx = this.context;\n ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);\n const scale = state.canvas.pixelRatio * state.document.zoom;\n const s = 6 * scale;\n const h = 22 * scale;\n const rect = {\n w: 26 * scale,\n h,\n x: state.pointer.x.devicePixels - s,\n y: state.pointer.y.devicePixels - h,\n };\n let rectOnPage = false;\n for (const k in state.document.pageRects) {\n if (state.document.pageRects[k]) {\n const p = state.document.pageRects[k];\n const px2 = p.x + p.w;\n const rx2 = rect.x + rect.w;\n const py2 = p.y + p.h;\n const ry2 = rect.y + rect.h;\n if (rect.x >= p.x && rx2 <= px2 && rect.y >= p.y && ry2 <= py2) {\n rectOnPage = true;\n break;\n }\n }\n }\n if (rectOnPage) {\n if (state.pointer.type === 'mouse') {\n renderStickyNote(ctx, scale, rect, this.selectedColor, '#000000');\n this.store.viewer.setCursorStyle(CursorStyle.DEFAULT);\n }\n if (state.pointer.action === 'click') {\n rect.y = rect.y;\n this.createTextAnnotation(rect, this.selectedColor);\n this.remove();\n return;\n }\n }\n else {\n this.store.viewer.setCursorStyle(CursorStyle.NOT_ALLOWED);\n }\n }\n }\n setColor(color) {\n this.selectedColor = color;\n this.options.annotation.colors.stickyNoteColor = color;\n }\n close() {\n this.remove();\n }\n createTextAnnotation(point, color) {\n const pdfPoint = this.pdfApi.transformScreenPointToPdfPoint({\n x: point.x,\n y: point.y,\n }).pdfPoint;\n const annotation = {\n itemType: PdfItemType.TEXT,\n color,\n author: this.options.viewer.general.user,\n page: pdfPoint.page,\n isOpen: true,\n pdfRect: {\n pdfX: pdfPoint.pdfX,\n pdfY: pdfPoint.pdfY,\n pdfW: 0,\n pdfH: 0,\n page: pdfPoint.page,\n },\n };\n this.pdfApi.createItem(annotation).then((item) => {\n const annot = item;\n const annotation = this.pdfApi.getItem(annot.id);\n if (annotation) {\n annotation.popup.isOpen = true;\n this.store.annotations.updateAnnotation(annotation);\n this.store.viewer.selectPopup({ id: annot.id, focus: true });\n }\n this.onAnnotationCreated(annot);\n });\n }\n}\n","import { app, h } from '../../lib/hyperapp';\nimport { Toolbar } from '../../common/Toolbar';\nimport { ToolbarItemGroup } from '../../common/ToolbarItemGroup';\nimport { ToolbarButton } from '../../common/ToolbarButton';\nimport { icons } from '../../common/icons';\nimport { ToolbarSeparator } from '../../common/ToolbarSeparator';\nimport { ColorPicker } from '../../common/ColorPicker';\nexport const createAddTextAnnotationToolbar = (props, element) => {\n const state = {\n colors: props.colors,\n selectedColor: props.selectedColor,\n };\n const actions = {\n setColor: (color) => ($state) => {\n props.onColorChanged(color);\n return Object.assign(Object.assign({}, $state), { selectedColor: color });\n },\n };\n const App = () => h(AddTextAnnotationToolbar, null);\n const AddTextAnnotationToolbar = ({}) => ($state, $actions) => (h(Toolbar, { allowWrap: true, alignCenter: true },\n h(ToolbarItemGroup, null,\n h(ColorPicker, { colors: $state.colors, color: $state.selectedColor, icon: icons.fillColor, mode: \"buttons\", onChange: $actions.setColor })),\n h(ToolbarItemGroup, { pushRight: true },\n h(ToolbarSeparator, null),\n h(ToolbarButton, { icon: icons.close, onClick: props.onClose }))));\n return app(state, actions, App, element);\n};\n","import { CanvasModule, CanvasModuleType } from '../CanvasModule';\nimport { AddTextAnnotationLayer } from './AddTextAnnotationLayer';\nexport class TextAnnotationModule extends CanvasModule {\n constructor() {\n super();\n this.toolbarElement = null;\n this.name = TextAnnotationModule.moduleInfo.name;\n this.activate = this.activate.bind(this);\n }\n onRegister() {\n this.toolbarElement = document.createElement('div');\n return {\n toolbar: this.toolbarElement,\n };\n }\n activate() {\n if (!this.canvasLayers['add']) {\n this.createCanvasLayer('add', AddTextAnnotationLayer);\n }\n else {\n this.removeCanvasLayer('add');\n }\n }\n}\nTextAnnotationModule.moduleInfo = {\n name: 'TextAnnotationModule',\n moduleType: CanvasModuleType.Tool,\n requiredFeatures: {\n annotate: true,\n fillFormFields: false,\n },\n translationKey: 'annotText.add',\n icon: 'stickyNote',\n};\n","const isFirefox = /Firefox/i.test(navigator.userAgent);\nexport class ImageContainer {\n constructor(image) {\n this._imageBitmap = null;\n this._imageData = null;\n this._htmlCanvas = null;\n if (image.bufferView) {\n if (image.hasImageData) {\n this._imageData = new ImageData(new Uint8ClampedArray(image.bufferView), image.width, image.height);\n }\n else {\n throw new Error('Cannot create an image container of image without imageData');\n }\n image.removeImageData();\n if (!isFirefox && typeof window.createImageBitmap === 'function') {\n createImageBitmap(this._imageData).then((imageBitmap) => {\n this._imageBitmap = imageBitmap;\n });\n }\n else {\n this._htmlCanvas = document.createElement('canvas');\n this._htmlCanvas.width = image.width;\n this._htmlCanvas.height = image.height;\n const ctx = this._htmlCanvas.getContext('2d');\n ctx && ctx.putImageData(this._imageData, 0, 0);\n }\n }\n }\n get scaledImage() {\n if (this._imageBitmap) {\n return this._imageBitmap;\n }\n return this._htmlCanvas;\n }\n get imageData() {\n return this._imageData;\n }\n destroy() {\n this._imageBitmap = null;\n this._imageData = null;\n this._htmlCanvas = null;\n }\n}\n","import { PdfViewing } from '../pdf-viewing/PdfViewing';\nimport { PdfItemCategory } from './enums';\nimport { PdfViewingWrapper } from './PdfViewingWrapper';\nconst checkType = (object, typeName, methodName, optional = false) => {\n if (!optional && (object === null || typeof object !== typeName)) {\n throw new TypeError(`Method ${methodName} requires argument of type '${typeName}' but is '${typeof object}'`);\n }\n};\nconst checkLicense = (instance) => {\n if (!instance)\n throw new Error('License is not set.');\n};\nexport class PdfViewerApi {\n constructor(pdfViewerApiOptions) {\n this.eventListeners = new Map();\n this.open = this.open.bind(this);\n this.save = this.save.bind(this);\n this.pdfViewerApiOptions = pdfViewerApiOptions;\n }\n open(pdfFile, fdfFiles, password, viewOptions, renderOptions, viewportSize) {\n checkLicense(this.instance);\n return this.instance.open(pdfFile, fdfFiles, password, viewOptions, renderOptions, viewportSize);\n }\n save(saveOptions) {\n checkLicense(this.instance);\n return this.instance.save(saveOptions);\n }\n close() {\n checkLicense(this.instance);\n return this.instance.close();\n }\n destroy() {\n checkLicense(this.instance);\n this.instance.destroy();\n }\n registerPdfStampFile(pdfStampFileName, data, onStampCreated) {\n checkLicense(this.instance);\n this.instance.registerPdfStampFile(pdfStampFileName, data, onStampCreated);\n }\n forceFlushCache() {\n checkLicense(this.instance);\n this.instance.forceFlushCache();\n }\n getMaxCacheSize() {\n checkLicense(this.instance);\n return this.instance.getMaxCacheSize();\n }\n setMaxCacheSize(cacheSize) {\n checkLicense(this.instance);\n this.instance.setMaxCacheSize(cacheSize);\n }\n getPageCount() {\n checkLicense(this.instance);\n return this.instance.getPageCount();\n }\n getPageNumber() {\n checkLicense(this.instance);\n return this.instance.getPageNumber();\n }\n getLastVisiblePage() {\n checkLicense(this.instance);\n return this.instance.getLastVisiblePage();\n }\n getFirstVisiblePage() {\n checkLicense(this.instance);\n return this.instance.getFirstVisiblePage();\n }\n setPageNumber(pageNumber) {\n checkType(pageNumber, 'number', 'setPageNumber');\n checkLicense(this.instance);\n this.instance.setPageNumber(pageNumber);\n }\n getRotation() {\n checkLicense(this.instance);\n return this.instance.getRotation();\n }\n setRotation(rotation) {\n checkType(rotation, 'number', 'setRotation');\n checkLicense(this.instance);\n this.instance.setRotation(rotation);\n }\n getZoom() {\n checkLicense(this.instance);\n return this.instance.getZoom();\n }\n setZoom(zoom, location) {\n checkType(zoom, 'number', 'setZoom');\n checkLicense(this.instance);\n this.instance.setZoom(zoom, location);\n }\n getScrollMaxPosition() {\n checkLicense(this.instance);\n return this.instance.getScrollMaxPosition();\n }\n getScrollPosition() {\n checkLicense(this.instance);\n return this.instance.getScrollPosition();\n }\n setScrollPosition(pos) {\n checkLicense(this.instance);\n this.instance.setScrollPosition(pos);\n }\n goTo(destination) {\n checkLicense(this.instance);\n this.instance.goTo(destination);\n }\n goToViewerDestination(destination) {\n checkLicense(this.instance);\n this.instance.goTo(destination);\n }\n goToRectangle(rectangle) {\n checkLicense(this.instance);\n this.instance.goToRectangle(rectangle);\n }\n isOpen() {\n checkLicense(this.instance);\n return this.instance.getIsOpen();\n }\n setPageLayoutMode(mode) {\n checkLicense(this.instance);\n this.instance.setPageLayoutMode(mode);\n }\n getPageLayoutMode() {\n checkLicense(this.instance);\n return this.instance.getPageLayoutMode();\n }\n setFitMode(fitMode) {\n checkLicense(this.instance);\n this.instance.setFitMode(fitMode);\n }\n getFitMode() {\n checkLicense(this.instance);\n return this.instance.getFitMode();\n }\n getBorderSize() {\n checkLicense(this.instance);\n return this.instance.getBorderSize();\n }\n setBorderSize(borderSize) {\n checkLicense(this.instance);\n const ret = this.instance.setBorderSize(borderSize);\n if (!ret.ok) {\n throw new Error(ret.message);\n }\n }\n getSlidingWindowSize() {\n checkLicense(this.instance);\n return this.instance.getSlidingWindowSize();\n }\n setSlidingWindowSize(slidingWindowSize) {\n checkType(slidingWindowSize, 'number', 'setSlidingWindowSize');\n checkLicense(this.instance);\n const ret = this.instance.setSlidingWindowSize(slidingWindowSize);\n if (!ret.ok) {\n throw new Error(ret.message);\n }\n }\n suspendDrawing() {\n checkLicense(this.instance);\n this.instance.suspendDrawing();\n }\n resumeDrawing() {\n checkLicense(this.instance);\n this.instance.resumeDrawing();\n }\n renderCanvas(context, options) {\n checkLicense(this.instance);\n this.instance.renderCanvas(context, options);\n }\n renderPage(pageNumber, width, height, annotationFilter) {\n checkLicense(this.instance);\n return this.instance.renderPage(pageNumber, width, height, annotationFilter);\n }\n rotatePage(pageNumber, direction) {\n checkLicense(this.instance);\n return this.instance.rotatePage(pageNumber, direction);\n }\n getPagePdfSize(pageNumber) {\n checkLicense(this.instance);\n return this.instance.getPagePdfSize(pageNumber);\n }\n setIgnoringPreferences(ignore) {\n checkLicense(this.instance);\n this.instance.setIgnoringPreferences(ignore);\n }\n getIgnoringPreferences() {\n checkLicense(this.instance);\n return this.instance.getIgnoringPreferences();\n }\n getProductVersion() {\n return PdfViewing.Sdk.version;\n }\n getOutlines(parent) {\n checkLicense(this.instance);\n return this.instance.getOutlines(parent);\n }\n getTextFragmentOnPoint(point) {\n checkType(point, 'object', 'getTextFragmentOnPoint');\n checkLicense(this.instance);\n return this.instance.getTextFragmentOnPoint(point);\n }\n getWordOnPoint(point) {\n checkType(point, 'object', 'getWordOnPoint');\n checkLicense(this.instance);\n return this.instance.getWordOnPoint(point);\n }\n getTextSelection(startPoint, endPoint) {\n checkLicense(this.instance);\n return this.instance.getTextSelection(startPoint, endPoint);\n }\n getRectangularTextSelection(startPoint, endPoint) {\n checkLicense(this.instance);\n return this.instance.getRectangularTextSelection(startPoint, endPoint);\n }\n getText(startPoint, endPoint) {\n checkLicense(this.instance);\n return this.instance.getText(startPoint, endPoint);\n }\n getTextForRectangularSelection(startPoint, endPoint) {\n checkLicense(this.instance);\n return this.instance.getTextForRectangularSelection(startPoint, endPoint);\n }\n getAnnotationsOnPoint(point, onlySelectable = false) {\n checkLicense(this.instance);\n return this.instance.getAnnotationsOnPoint(point, onlySelectable);\n }\n getOpenPopups(firstPage, lastPage) {\n checkLicense(this.instance);\n return this.instance.getOpenPopups(firstPage, lastPage);\n }\n getItemsFromPage(page, category) {\n checkType(page, 'number', 'getItemsFromPage');\n checkType(category, 'number', 'getItemsFromPage');\n checkLicense(this.instance);\n if (category === PdfItemCategory.ANNOTATION) {\n return this.instance.getItemsFromPage(page, category);\n }\n else {\n return new Promise((resolve, reject) => {\n resolve({});\n });\n }\n }\n createItem(itemArgs) {\n checkType(itemArgs, 'object', 'createItem');\n checkLicense(this.instance);\n return this.instance.createItem(itemArgs);\n }\n getItem(id) {\n checkLicense(this.instance);\n return this.instance.getItem(id);\n }\n getItems(ids) {\n checkLicense(this.instance);\n return this.instance.getItems(ids);\n }\n updateItem(item) {\n checkType(item, 'object', 'updateItem');\n checkLicense(this.instance);\n return this.instance.updateItem(item);\n }\n deleteItem(item) {\n checkType(item, 'object', 'deleteItem');\n checkLicense(this.instance);\n return this.instance.deleteItem(item);\n }\n getStampInfo(args) {\n checkLicense(this.instance);\n return this.instance.getStampInfo(args);\n }\n getTextStampAspectRatio(stampText) {\n checkLicense(this.instance);\n return this.instance.getTextStampAspectRatio(stampText);\n }\n registerStampImage(image) {\n checkType(image, 'object', 'registerStampImage');\n checkLicense(this.instance);\n return this.instance.registerImage(image);\n }\n registerPdfPage(fileName, pageNumber) {\n checkType(fileName, 'string', 'registerPdfStamp');\n checkType(pageNumber, 'number', 'registerPdfStamp');\n checkLicense(this.instance);\n return this.instance.registerPdfPage(fileName, pageNumber);\n }\n hasChanges() {\n checkLicense(this.instance);\n return this.instance.hasChanges();\n }\n getSearchIterator(searchString, startPage, caseSensitive, wrapSearch, useRegex) {\n return this.instance.getSearchIterator(searchString, startPage, caseSensitive, wrapSearch, useRegex);\n }\n setLicenseKey(license) {\n try {\n this.instance = new PdfViewingWrapper(license, this.pdfViewerApiOptions);\n return true;\n }\n catch (error) {\n return false;\n }\n }\n getSupportedFeatures() {\n return this.instance.getSupportedFeatures();\n }\n transformScreenPointToPdfPoint(point, page, guaranteePointIsOnPage) {\n checkType(point.x, 'number', 'x');\n checkType(point.y, 'number', 'y');\n checkLicense(this.instance);\n if (page !== undefined) {\n checkType(page, 'number', 'page');\n }\n if (guaranteePointIsOnPage !== undefined) {\n checkType(guaranteePointIsOnPage, 'boolean', 'transformScreenPointToPdf');\n }\n return this.instance.transformScreenPointToPdfPoint(point, page, guaranteePointIsOnPage);\n }\n getClosestPointOnPdfByScreenPoint(point, padding = 0, page) {\n checkLicense(this.instance);\n return this.instance.getClosestPointOnPdfByScreenPoint(point, page, padding);\n }\n transformPdfPointToScreenPoint(pdfPoint) {\n checkType(pdfPoint.pdfX, 'number', 'pdfX');\n checkType(pdfPoint.pdfY, 'number', 'pdfY');\n checkType(pdfPoint.page, 'number', 'page');\n checkLicense(this.instance);\n return this.instance.transformPdfPointToScreenPoint(pdfPoint);\n }\n transformScreenRectToPdfRect(rect, page) {\n checkType(rect.x, 'number', 'x');\n checkType(rect.y, 'number', 'y');\n checkType(rect.w, 'number', 'w');\n checkType(rect.h, 'number', 'h');\n checkLicense(this.instance);\n return this.instance.transformScreenRectToPdfRect(rect, page);\n }\n transformPdfPageRectToScreenRect(pdfRect) {\n checkType(pdfRect.pdfX, 'number', 'pdfX');\n checkType(pdfRect.pdfY, 'number', 'pdfY');\n checkType(pdfRect.pdfW, 'number', 'pdfW');\n checkType(pdfRect.pdfH, 'number', 'pdfH');\n checkType(pdfRect.page, 'number', 'page');\n checkLicense(this.instance);\n let ret = this.instance.transformPdfPageRectToScreenRect(pdfRect);\n return ret;\n }\n transformPdfLengthToScreenLength(pdfLength) {\n checkType(pdfLength, 'number', 'transformPdfLengthToScreenLength');\n checkLicense(this.instance);\n return this.instance.transformPdfLengthToScreenLength(pdfLength);\n }\n transformScreenLengthToPdfLength(screenLength) {\n checkType(screenLength, 'number', 'transformScreenLengthToPdfLength');\n checkLicense(this.instance);\n return this.instance.transformScreenLengthToPdfLength(screenLength);\n }\n transformQuadrilateralToViewport(quadrilateral) {\n checkLicense(this.instance);\n return this.instance.transformQuadrilateralToViewport(quadrilateral);\n }\n getPageScreenRect(pageNumber) {\n checkLicense(this.instance);\n return this.instance.getPageScreenRect(pageNumber);\n }\n addEventListener(type, listener) {\n checkLicense(this.instance);\n this.instance.addEventListener(type, listener);\n }\n removeEventListener(type, listener) {\n checkLicense(this.instance);\n this.instance.removeEventListener(type, listener);\n }\n}\n","import { PdfItemType } from './enums';\nexport const annotationDefaultBehaviors = {\n [PdfItemType.TEXT]: [true, false, true, true, false, false, false, true, false, false],\n [PdfItemType.LINK]: [false, false, false, true, false, false, false, false, true, false],\n [PdfItemType.FREE_TEXT]: [true, false, true, true, true, true, true, false, false, false],\n [PdfItemType.LINE]: [true, false, true, true, false, true, true, true, false, false],\n [PdfItemType.SQUARE]: [true, false, true, true, false, true, true, true, false, false],\n [PdfItemType.CIRCLE]: [true, false, true, true, false, true, true, true, false, false],\n [PdfItemType.POLYGON]: [true, false, true, true, false, true, true, true, false, false],\n [PdfItemType.POLY_LINE]: [true, false, true, true, false, true, true, true, false, false],\n [PdfItemType.HIGHLIGHT]: [true, false, true, false, false, false, false, true, false, true],\n [PdfItemType.UNDERLINE]: [true, false, true, false, false, false, false, true, false, true],\n [PdfItemType.SQUIGGLY]: [true, false, true, false, false, false, false, true, false, true],\n [PdfItemType.STRIKE_OUT]: [true, false, true, false, false, false, false, true, false, true],\n [PdfItemType.STAMP]: [true, false, true, true, true, true, false, true, false, false],\n [PdfItemType.CARET]: [true, false, true, false, false, false, false, true, false, false],\n [PdfItemType.INK]: [true, false, true, true, false, true, true, true, false, false],\n [PdfItemType.POPUP]: [false, false, false, false, false, false, false, false, false, false],\n [PdfItemType.FILE_ATTACHMENT]: [false, false, false, false, false, false, false, false, false, false],\n [PdfItemType.SOUND]: [false, false, false, false, false, false, false, false, false, false],\n [PdfItemType.MOVIE]: [false, false, false, false, false, false, false, false, false, false],\n [PdfItemType.WIDGET]: [true, false, false, false, false, false, false, false, false, false],\n [PdfItemType.SCREEN]: [false, false, false, false, false, false, false, false, false, false],\n [PdfItemType.PRINTER_MARK]: [false, false, false, false, false, false, false, false, false, false],\n [PdfItemType.TRAP_NET]: [false, false, false, false, false, false, false, false, false, false],\n [PdfItemType.WATERMARK]: [false, false, false, false, false, false, false, false, false, false],\n [PdfItemType.THREED]: [false, false, false, false, false, false, false, false, false, false],\n};\n","export var PdfItemCategory;\n(function (PdfItemCategory) {\n PdfItemCategory[PdfItemCategory[\"ANNOTATION\"] = 1] = \"ANNOTATION\";\n PdfItemCategory[PdfItemCategory[\"TEXT_FRAGMENT\"] = 2] = \"TEXT_FRAGMENT\";\n PdfItemCategory[PdfItemCategory[\"OUTLINE\"] = 3] = \"OUTLINE\";\n PdfItemCategory[PdfItemCategory[\"DESTINATION\"] = 4] = \"DESTINATION\";\n PdfItemCategory[PdfItemCategory[\"CONTENT_ELEMENT\"] = 5] = \"CONTENT_ELEMENT\";\n})(PdfItemCategory || (PdfItemCategory = {}));\nexport var AnnotationBorderStyle;\n(function (AnnotationBorderStyle) {\n AnnotationBorderStyle[AnnotationBorderStyle[\"SOLID\"] = 0] = \"SOLID\";\n AnnotationBorderStyle[AnnotationBorderStyle[\"DASHED\"] = 1] = \"DASHED\";\n AnnotationBorderStyle[AnnotationBorderStyle[\"BEVELED\"] = 2] = \"BEVELED\";\n AnnotationBorderStyle[AnnotationBorderStyle[\"INSET\"] = 3] = \"INSET\";\n AnnotationBorderStyle[AnnotationBorderStyle[\"UNDERLINE\"] = 4] = \"UNDERLINE\";\n})(AnnotationBorderStyle || (AnnotationBorderStyle = {}));\nexport var StampAnnotationColor;\n(function (StampAnnotationColor) {\n StampAnnotationColor[StampAnnotationColor[\"GREEN\"] = 0] = \"GREEN\";\n StampAnnotationColor[StampAnnotationColor[\"RED\"] = 1] = \"RED\";\n StampAnnotationColor[StampAnnotationColor[\"BLUE\"] = 2] = \"BLUE\";\n})(StampAnnotationColor || (StampAnnotationColor = {}));\nexport var WidgetType;\n(function (WidgetType) {\n WidgetType[WidgetType[\"CHECK_BOX\"] = 1] = \"CHECK_BOX\";\n WidgetType[WidgetType[\"RADIO_BUTTON\"] = 2] = \"RADIO_BUTTON\";\n WidgetType[WidgetType[\"TEXT_BOX\"] = 3] = \"TEXT_BOX\";\n WidgetType[WidgetType[\"LIST_BOX\"] = 4] = \"LIST_BOX\";\n WidgetType[WidgetType[\"COMBO_BOX\"] = 5] = \"COMBO_BOX\";\n})(WidgetType || (WidgetType = {}));\nexport var PdfItemType;\n(function (PdfItemType) {\n PdfItemType[PdfItemType[\"UNKNOWN\"] = 0] = \"UNKNOWN\";\n PdfItemType[PdfItemType[\"TEXT\"] = 1] = \"TEXT\";\n PdfItemType[PdfItemType[\"LINK\"] = 2] = \"LINK\";\n PdfItemType[PdfItemType[\"FREE_TEXT\"] = 3] = \"FREE_TEXT\";\n PdfItemType[PdfItemType[\"LINE\"] = 4] = \"LINE\";\n PdfItemType[PdfItemType[\"SQUARE\"] = 5] = \"SQUARE\";\n PdfItemType[PdfItemType[\"CIRCLE\"] = 6] = \"CIRCLE\";\n PdfItemType[PdfItemType[\"POLYGON\"] = 7] = \"POLYGON\";\n PdfItemType[PdfItemType[\"POLY_LINE\"] = 8] = \"POLY_LINE\";\n PdfItemType[PdfItemType[\"HIGHLIGHT\"] = 9] = \"HIGHLIGHT\";\n PdfItemType[PdfItemType[\"UNDERLINE\"] = 10] = \"UNDERLINE\";\n PdfItemType[PdfItemType[\"SQUIGGLY\"] = 11] = \"SQUIGGLY\";\n PdfItemType[PdfItemType[\"STRIKE_OUT\"] = 12] = \"STRIKE_OUT\";\n PdfItemType[PdfItemType[\"STAMP\"] = 13] = \"STAMP\";\n PdfItemType[PdfItemType[\"CARET\"] = 14] = \"CARET\";\n PdfItemType[PdfItemType[\"INK\"] = 15] = \"INK\";\n PdfItemType[PdfItemType[\"POPUP\"] = 16] = \"POPUP\";\n PdfItemType[PdfItemType[\"FILE_ATTACHMENT\"] = 17] = \"FILE_ATTACHMENT\";\n PdfItemType[PdfItemType[\"SOUND\"] = 18] = \"SOUND\";\n PdfItemType[PdfItemType[\"MOVIE\"] = 19] = \"MOVIE\";\n PdfItemType[PdfItemType[\"WIDGET\"] = 20] = \"WIDGET\";\n PdfItemType[PdfItemType[\"SCREEN\"] = 21] = \"SCREEN\";\n PdfItemType[PdfItemType[\"PRINTER_MARK\"] = 22] = \"PRINTER_MARK\";\n PdfItemType[PdfItemType[\"TRAP_NET\"] = 23] = \"TRAP_NET\";\n PdfItemType[PdfItemType[\"WATERMARK\"] = 24] = \"WATERMARK\";\n PdfItemType[PdfItemType[\"THREED\"] = 25] = \"THREED\";\n})(PdfItemType || (PdfItemType = {}));\nexport var PdfDestinationType;\n(function (PdfDestinationType) {\n PdfDestinationType[PdfDestinationType[\"FIT\"] = 1] = \"FIT\";\n PdfDestinationType[PdfDestinationType[\"FITH\"] = 2] = \"FITH\";\n PdfDestinationType[PdfDestinationType[\"FITV\"] = 3] = \"FITV\";\n PdfDestinationType[PdfDestinationType[\"FITR\"] = 4] = \"FITR\";\n PdfDestinationType[PdfDestinationType[\"FITB\"] = 5] = \"FITB\";\n PdfDestinationType[PdfDestinationType[\"FITBH\"] = 6] = \"FITBH\";\n PdfDestinationType[PdfDestinationType[\"FITBV\"] = 7] = \"FITBV\";\n PdfDestinationType[PdfDestinationType[\"XYZ\"] = 8] = \"XYZ\";\n})(PdfDestinationType || (PdfDestinationType = {}));\nexport var PdfFitMode;\n(function (PdfFitMode) {\n PdfFitMode[PdfFitMode[\"NONE\"] = 0] = \"NONE\";\n PdfFitMode[PdfFitMode[\"FIT_WIDTH\"] = 1] = \"FIT_WIDTH\";\n PdfFitMode[PdfFitMode[\"FIT_PAGE\"] = 2] = \"FIT_PAGE\";\n})(PdfFitMode || (PdfFitMode = {}));\nexport var PdfPageLayoutMode;\n(function (PdfPageLayoutMode) {\n PdfPageLayoutMode[PdfPageLayoutMode[\"SINGLE_PAGE\"] = 0] = \"SINGLE_PAGE\";\n PdfPageLayoutMode[PdfPageLayoutMode[\"ONE_COLUMN\"] = 1] = \"ONE_COLUMN\";\n PdfPageLayoutMode[PdfPageLayoutMode[\"TWO_COLUMN_LEFT\"] = 2] = \"TWO_COLUMN_LEFT\";\n PdfPageLayoutMode[PdfPageLayoutMode[\"TWO_COLUMN_RIGHT\"] = 3] = \"TWO_COLUMN_RIGHT\";\n PdfPageLayoutMode[PdfPageLayoutMode[\"TWO_PAGE_LEFT\"] = 4] = \"TWO_PAGE_LEFT\";\n PdfPageLayoutMode[PdfPageLayoutMode[\"TWO_PAGE_RIGHT\"] = 5] = \"TWO_PAGE_RIGHT\";\n})(PdfPageLayoutMode || (PdfPageLayoutMode = {}));\nexport var PdfActionType;\n(function (PdfActionType) {\n PdfActionType[PdfActionType[\"UNKNOWN\"] = 0] = \"UNKNOWN\";\n PdfActionType[PdfActionType[\"GO_TO\"] = 1] = \"GO_TO\";\n PdfActionType[PdfActionType[\"URI\"] = 2] = \"URI\";\n})(PdfActionType || (PdfActionType = {}));\nexport var StampType;\n(function (StampType) {\n StampType[StampType[\"TEXT\"] = 0] = \"TEXT\";\n StampType[StampType[\"IMAGE\"] = 1] = \"IMAGE\";\n})(StampType || (StampType = {}));\nexport var SearchResultType;\n(function (SearchResultType) {\n SearchResultType[SearchResultType[\"OK\"] = 0] = \"OK\";\n SearchResultType[SearchResultType[\"NO_RESULT\"] = 1] = \"NO_RESULT\";\n SearchResultType[SearchResultType[\"END\"] = 2] = \"END\";\n})(SearchResultType || (SearchResultType = {}));\nexport var DocumentChange;\n(function (DocumentChange) {\n DocumentChange[DocumentChange[\"NONE\"] = 0] = \"NONE\";\n DocumentChange[DocumentChange[\"ANNOTATION\"] = 1] = \"ANNOTATION\";\n DocumentChange[DocumentChange[\"CONTENT\"] = 2] = \"CONTENT\";\n})(DocumentChange || (DocumentChange = {}));\nexport var RotationDirection;\n(function (RotationDirection) {\n RotationDirection[RotationDirection[\"CLOCKWISE\"] = 90] = \"CLOCKWISE\";\n RotationDirection[RotationDirection[\"COUNTERCLOCKWISE\"] = 270] = \"COUNTERCLOCKWISE\";\n})(RotationDirection || (RotationDirection = {}));\n","export * from './types';\nexport * from './enums';\nexport * from './PdfViewerApi';\n","export var FileType;\n(function (FileType) {\n FileType[FileType[\"Pdf\"] = 0] = \"Pdf\";\n FileType[FileType[\"Fdf\"] = 1] = \"Fdf\";\n})(FileType || (FileType = {}));\n","export class CanvasEvents {\n constructor(element) {\n this.eventListeners = new Map();\n this.trackEvents = true;\n this.startPosX = 0;\n this.startPosY = 0;\n this.multiTouch = false;\n this.pinch = false;\n this.dragging = false;\n this.lastTouchPosX = 0;\n this.lastTouchPosY = 0;\n this.lastPinchDiv = 0;\n this.lastPinchPosX = 0;\n this.lastPinchPosY = 0;\n this.lastTouchX1 = 0;\n this.lastTouchY1 = 0;\n this.lastTouchX2 = 0;\n this.lastTouchY2 = 0;\n this.clickTimer = null;\n this.clickDuration = 250;\n this.dblClickTimer = null;\n this.dblClickDuration = 250;\n this.longPressTimer = null;\n this.longPressDuration = 750;\n this.onMouseDown = this.onMouseDown.bind(this);\n this.onTouchStart = this.onTouchStart.bind(this);\n this.onStart = this.onStart.bind(this);\n this.onMouseMove = this.onMouseMove.bind(this);\n this.onTouchMove = this.onTouchMove.bind(this);\n this.onMove = this.onMove.bind(this);\n this.onMouseUp = this.onMouseUp.bind(this);\n this.onTouchEnd = this.onTouchEnd.bind(this);\n this.onEnd = this.onEnd.bind(this);\n this.suspend = this.suspend.bind(this);\n this.resume = this.resume.bind(this);\n this.element = element;\n this.element.addEventListener('mousedown', this.onMouseDown, {\n passive: true,\n });\n this.element.addEventListener('mousemove', this.onMouseMove, {\n passive: true,\n });\n this.element.addEventListener('touchstart', this.onTouchStart, {\n passive: false,\n });\n window.addEventListener('pdfwebviewer.DragMoveHandlerStart', () => {\n this.suspend();\n }, { passive: true });\n window.addEventListener('pdfwebviewer.DragMoveHandlerEnd', () => {\n this.resume();\n }, { passive: true });\n }\n addEventListener(type, listener) {\n if (this.eventListeners.has(type)) {\n ;\n this.eventListeners.get(type).push(listener);\n }\n else {\n this.eventListeners.set(type, [listener]);\n }\n }\n removeEventListener(type, listener) {\n if (this.eventListeners.has(type)) {\n let listeners = this.eventListeners.get(type);\n listeners = listeners.filter((listenerInArray) => listenerInArray !== listener);\n if (listeners.length !== 0) {\n this.eventListeners.set(type, listeners);\n }\n else {\n this.eventListeners.delete(type);\n }\n }\n }\n suspend() {\n this.trackEvents = false;\n this.element.removeEventListener('mousemove', this.onMouseMove);\n window.removeEventListener('touchmove', this.onTouchMove);\n }\n resume() {\n if (!this.trackEvents) {\n this.trackEvents = true;\n this.element.addEventListener('mousemove', this.onMouseMove, {\n passive: true,\n });\n }\n }\n dispatchEvent(type, args) {\n if (this.eventListeners.has(type)) {\n const listeners = this.eventListeners.get(type);\n listeners.forEach((listener) => listener(args));\n }\n }\n clearClickTimer() {\n if (this.clickTimer !== null) {\n window.clearTimeout(this.clickTimer);\n this.clickTimer = null;\n }\n }\n clearLongPressTimer() {\n if (this.longPressTimer !== null) {\n window.clearTimeout(this.longPressTimer);\n this.longPressTimer = null;\n }\n }\n clearDblClickTimer() {\n if (this.dblClickTimer !== null) {\n window.clearTimeout(this.dblClickTimer);\n this.dblClickTimer = null;\n }\n }\n mouseToCanvasPointerEvent(e) {\n return {\n clientX: e.clientX,\n clientY: e.clientY,\n movementX: e.movementX,\n movementY: e.movementY,\n buttons: e.buttons,\n type: 'mouse',\n };\n }\n touchToCanvasPointerEvent(e) {\n const event = {\n clientX: e.touches[0].clientX,\n clientY: e.touches[0].clientY,\n movementX: e.touches[0].clientX - this.lastTouchPosX,\n movementY: e.touches[0].clientY - this.lastTouchPosY,\n buttons: e.touches.length === 1 ? 1 : 4,\n type: 'touch',\n };\n this.lastTouchPosX = e.touches[0].clientX;\n this.lastTouchPosY = e.touches[0].clientY;\n return event;\n }\n getPinchPos(e) {\n const x1 = e.touches[0].clientX;\n const y1 = e.touches[0].clientY;\n const x2 = e.touches[1].clientX;\n const y2 = e.touches[1].clientY;\n const vx = Math.abs(x1 - x2);\n const vy = Math.abs(y1 - y2);\n const distance = Math.sqrt(vx * vx + vy * vy);\n const clientX = Math.min(x1, x2) + vx;\n const clientY = Math.min(y1, y2) + vy;\n return {\n clientX,\n clientY,\n distance,\n };\n }\n touchToCanvasPointerPinchEvent(e) {\n const { clientX, clientY, distance } = this.getPinchPos(e);\n const event = {\n clientX,\n clientY,\n movementX: clientX - this.lastPinchPosX,\n movementY: clientY - this.lastPinchPosY,\n distance,\n movementDistance: distance - this.lastPinchDiv,\n buttons: 1,\n type: 'touch',\n };\n this.lastPinchPosX = event.clientX;\n this.lastPinchPosY = event.clientY;\n this.lastPinchDiv = distance;\n return event;\n }\n onMouseDown(e) {\n if (this.trackEvents) {\n const event = this.mouseToCanvasPointerEvent(e);\n this.onStart(event);\n window.addEventListener('mouseup', this.onMouseUp, { passive: true });\n }\n }\n onTouchStart(e) {\n e.preventDefault();\n this.pinch = false;\n if (this.trackEvents) {\n if (e.touches.length === 0) {\n return;\n }\n else if (e.touches.length === 1) {\n this.lastTouchPosX = e.touches[0].clientX;\n this.lastTouchPosY = e.touches[0].clientY;\n const event = this.touchToCanvasPointerEvent(e);\n this.onStart(event);\n window.addEventListener('touchmove', this.onTouchMove, {\n passive: false,\n });\n window.addEventListener('touchend', this.onTouchEnd, { passive: false });\n }\n else if (e.touches.length === 2) {\n this.clearClickTimer();\n this.clearDblClickTimer();\n this.clearLongPressTimer();\n this.multiTouch = true;\n const { clientX, clientY, distance } = this.getPinchPos(e);\n this.lastPinchDiv = distance;\n this.lastPinchPosX = clientX;\n this.lastPinchPosY = clientY;\n this.lastTouchX1 = e.touches[0].clientX;\n this.lastTouchY1 = e.touches[0].clientY;\n this.lastTouchX2 = e.touches[1].clientX;\n this.lastTouchY2 = e.touches[1].clientY;\n window.addEventListener('touchmove', this.onTouchMove, {\n passive: false,\n });\n window.addEventListener('touchend', this.onTouchEnd, { passive: false });\n }\n }\n }\n onStart(e) {\n this.startPosX = e.clientX;\n this.startPosY = e.clientY;\n this.dragging = false;\n if (!this.dblClickTimer) {\n this.clickTimer = window.setTimeout(() => {\n this.clickTimer = null;\n }, this.clickDuration);\n }\n this.longPressTimer = window.setTimeout(() => {\n this.longPressTimer = null;\n this.dispatchEvent('pointerlongpress', e);\n }, this.longPressDuration);\n this.dispatchEvent('pointerdown', e);\n }\n onMouseMove(e) {\n const event = this.mouseToCanvasPointerEvent(e);\n this.onMove(event);\n }\n onTouchMove(e) {\n e.preventDefault();\n e.stopPropagation();\n if (!e.touches) {\n return;\n }\n if (e.touches.length === 1 && !this.multiTouch) {\n const event = this.touchToCanvasPointerEvent(e);\n this.onMove(event);\n }\n else if (e.touches.length === 2) {\n const event = this.touchToCanvasPointerPinchEvent(e);\n const x1 = e.touches[0].clientX;\n const y1 = e.touches[0].clientY;\n const x2 = e.touches[1].clientX;\n const y2 = e.touches[1].clientY;\n const dX1 = x1 - this.lastTouchX1;\n const dY1 = y1 - this.lastTouchY1;\n const dX2 = x2 - this.lastTouchX2;\n const dY2 = y2 - this.lastTouchY2;\n const sX1 = Math.sign(dX1);\n const sY1 = Math.sign(dY1);\n const sX2 = Math.sign(dX2);\n const sY2 = Math.sign(dY2);\n if ((sX1 === sX2 && sY1 === sY2) ||\n ((sX1 === sX2 || dX1 === 0 || dX2 === 0) && (sY1 === sY2 || dY1 === 0 || dY2 === 0)) ||\n Math.max(Math.abs(event.movementX), Math.abs(event.movementY)) >\n Math.abs(event.movementDistance)) {\n event.buttons = 4;\n this.onMove(event);\n this.pinch = false;\n }\n else {\n this.dispatchEvent('pinch', event);\n this.pinch = true;\n }\n this.lastTouchX1 = e.touches[0].clientX;\n this.lastTouchY1 = e.touches[0].clientY;\n this.lastTouchX2 = e.touches[1].clientX;\n this.lastTouchY2 = e.touches[1].clientY;\n }\n }\n onMove(e) {\n this.dispatchEvent('pointermove', e);\n if (this.clickTimer || this.longPressTimer) {\n if (Math.abs(this.startPosX - e.clientX) > 5 || Math.abs(this.startPosY - e.clientY) > 5) {\n this.clearLongPressTimer();\n this.clearClickTimer();\n this.dispatchEvent('pointerstartdrag', e);\n this.dragging = true;\n }\n }\n else if (e.buttons > 0 && !this.dragging) {\n this.dispatchEvent('pointerstartdrag', e);\n this.dragging = true;\n }\n }\n onMouseUp(e) {\n const event = this.mouseToCanvasPointerEvent(e);\n this.onEnd(event);\n window.removeEventListener('mouseup', this.onMouseUp);\n }\n onTouchEnd(e) {\n if (e.touches.length === 0) {\n this.multiTouch = false;\n const event = {\n clientX: this.lastTouchPosX,\n clientY: this.lastTouchPosY,\n movementX: 0,\n movementY: 0,\n buttons: 0,\n type: 'touch',\n };\n this.onEnd(event);\n window.removeEventListener('touchmove', this.onTouchMove);\n window.removeEventListener('touchend', this.onTouchEnd);\n }\n }\n onEnd(e) {\n this.dispatchEvent('pointerup', e);\n if (this.dblClickTimer !== null) {\n this.clearDblClickTimer();\n this.dispatchEvent('pointerdblclick', e);\n }\n else if (this.clickTimer !== null) {\n this.dispatchEvent('pointerclick', {\n clientX: this.startPosX,\n clientY: this.startPosY,\n movementX: e.movementX,\n movementY: e.movementY,\n buttons: e.buttons,\n type: e.type,\n });\n this.dblClickTimer = window.setTimeout(() => {\n this.dblClickTimer = null;\n }, this.dblClickDuration);\n }\n if (this.dragging) {\n this.dispatchEvent('pointerenddrag', e);\n }\n this.lastTouchX1 = 0;\n this.lastTouchY1 = 0;\n this.lastTouchX2 = 0;\n this.lastTouchY2 = 0;\n this.lastTouchPosX = 0;\n this.lastTouchPosY = 0;\n this.lastPinchPosX = 0;\n this.lastPinchPosY = 0;\n this.clearClickTimer();\n this.clearLongPressTimer();\n }\n}\n","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { createStore } from './state/store';\nimport { PdfViewerApi, PdfFitMode, PdfItemCategory, FileType, DocumentChange, } from '../pdf-viewer-api';\nimport { translationManager } from '../common/TranslationManager';\nimport { tooltipManager } from '../common/TooltipManager';\nimport { CanvasEvents } from './CanvasEvents';\nimport { StampAnnotationModule } from '../modules/stamp-annotation/StampAnnotationModule';\nimport { PdfDocumentLayer } from './view-layers/PdfDocumentLayer';\nimport { ScrollLayer } from './view-layers/ScrollLayer';\nimport { BusyStateLayer } from './view-layers/BusyStateLayer';\nimport { AnnotationSelectionLayer } from './view-layers/AnnotationSelectionLayer';\nimport { TextSelectionLayer } from './view-layers/TextSelectionLayer';\nimport { ViewerMode, CursorStyle, copyTextToClipboard } from './state/viewer';\nimport { imageDataUrlToUint8Array } from '../common/Tools';\nimport { PdfViewing } from '../pdf-viewing/PdfViewing';\nimport { getKeyboardCommands } from '../common/utils';\nimport { PopupModule } from '../modules';\nexport class PdfViewerCanvas {\n constructor(containerElement, license, options) {\n var _a;\n this.eventListeners = new Map();\n this.documentLoaded = false;\n this.renderLoopRunning = false;\n if (!containerElement) {\n throw { error: 'PdfViewerCanvas container element is null' };\n }\n this.options = options;\n this.annotTimer = 0;\n this.onResize = this.onResize.bind(this);\n this.startRenderLoop = this.startRenderLoop.bind(this);\n this.updateViewLayerContext = this.updateViewLayerContext.bind(this);\n this.onKeyboardShortcuts = this.onKeyboardShortcuts.bind(this);\n this.dispatchEvent = this.dispatchEvent.bind(this);\n this.onCanvasPointerDown = this.onCanvasPointerDown.bind(this);\n this.onCanvasPointerMove = this.onCanvasPointerMove.bind(this);\n this.onCanvasPointerUp = this.onCanvasPointerUp.bind(this);\n this.onCanvasPointerClick = this.onCanvasPointerClick.bind(this);\n this.onCanvasPointerDblClick = this.onCanvasPointerDblClick.bind(this);\n this.onCanvasPointerLongPress = this.onCanvasPointerLongPress.bind(this);\n this.onCanvasPointerStartDrag = this.onCanvasPointerStartDrag.bind(this);\n this.onCanvasPointerEndDrag = this.onCanvasPointerEndDrag.bind(this);\n this.onCanvasPointerPinch = this.onCanvasPointerPinch.bind(this);\n this.onMouseWheel = this.onMouseWheel.bind(this);\n this.onDocumentOpened = this.onDocumentOpened.bind(this);\n this.onDocumentClosed = this.onDocumentClosed.bind(this);\n this.onCanvasInvalidated = this.onCanvasInvalidated.bind(this);\n this.onFirstVisiblePageChanged = this.onFirstVisiblePageChanged.bind(this);\n this.onLastVisiblePageChanged = this.onLastVisiblePageChanged.bind(this);\n this.onPageNumberChanged = this.onPageNumberChanged.bind(this);\n this.onZoomChanged = this.onZoomChanged.bind(this);\n this.onFitModeChanged = this.onFitModeChanged.bind(this);\n this.onPageLayoutModeChanged = this.onPageLayoutModeChanged.bind(this);\n this.onBusyStateChanged = this.onBusyStateChanged.bind(this);\n this.onRotationChanged = this.onRotationChanged.bind(this);\n this.onItemCreated = this.onItemCreated.bind(this);\n this.onItemUpdated = this.onItemUpdated.bind(this);\n this.onItemDeleted = this.onItemDeleted.bind(this);\n this.onPageChanged = this.onPageChanged.bind(this);\n this.onTextSelected = this.onTextSelected.bind(this);\n this.onHtmlDocumentSelectionChanged = this.onHtmlDocumentSelectionChanged.bind(this);\n this.onApiError = this.onApiError.bind(this);\n this.beforeUnloadCallback = this.beforeUnloadCallback.bind(this);\n this.getAnnotations = this.getAnnotations.bind(this);\n this.openRoutine = this.openRoutine.bind(this);\n this.print = this.print.bind(this);\n this.close = this.close.bind(this);\n this.searchIterator = null;\n this.store = createStore();\n const pdfViewerApiOptions = {\n onlyAuthorCanEdit: (_a = options.annotation.onlyAuthorCanEdit) !== null && _a !== void 0 ? _a : false,\n viewOnly: options.viewer.general.viewOnly,\n user: options.viewer.general.user,\n allowPopups: options.modules.includes(PopupModule),\n annotationPermissionCallback: options.annotation.annotationPermissionCallback,\n };\n this.pdfViewerApi = new PdfViewerApi(pdfViewerApiOptions);\n const licenseIsValid = this.pdfViewerApi.setLicenseKey(license);\n if (!licenseIsValid) {\n throw new Error('Invalid License');\n }\n this.element = containerElement;\n this.element.classList.add('pwv-ViewerCanvas');\n const viewerContainer = document.createElement('div');\n viewerContainer.classList.add('pwv-canvas-container');\n this.element.appendChild(viewerContainer);\n this.toolbarElement = document.createElement('div');\n if (this.licenseFeatures.annotate) {\n this.toolbarElement.classList.add('pwv-canvas-toolbar');\n viewerContainer.appendChild(this.toolbarElement);\n }\n const canvasLayers = document.createElement('div');\n canvasLayers.classList.add('pwv-canvas-layers');\n viewerContainer.appendChild(canvasLayers);\n this.viewLayersElement = document.createElement('div');\n canvasLayers.appendChild(this.viewLayersElement);\n viewerContainer.appendChild(canvasLayers);\n this.viewLayers = [];\n this.modules = [];\n this.resizeObserver = new ResizeObserver(this.onResize);\n this.resizeObserver.observe(canvasLayers);\n this.pdfViewerApi.addEventListener('firstVisiblePage', this.onFirstVisiblePageChanged);\n this.pdfViewerApi.addEventListener('lastVisiblePage', this.onLastVisiblePageChanged);\n this.pdfViewerApi.addEventListener('pageNumber', this.onPageNumberChanged);\n this.pdfViewerApi.addEventListener('zoom', this.onZoomChanged);\n this.pdfViewerApi.addEventListener('fitMode', this.onFitModeChanged);\n this.pdfViewerApi.addEventListener('pageLayoutMode', this.onPageLayoutModeChanged);\n this.pdfViewerApi.addEventListener('busyState', this.onBusyStateChanged);\n this.pdfViewerApi.addEventListener('canvasInvalidated', this.onCanvasInvalidated);\n this.pdfViewerApi.addEventListener('itemCreated', this.onItemCreated);\n this.pdfViewerApi.addEventListener('itemUpdated', this.onItemUpdated);\n this.pdfViewerApi.addEventListener('itemDeleted', this.onItemDeleted);\n this.pdfViewerApi.addEventListener('pageChanged', this.onPageChanged);\n this.pdfViewerApi.addEventListener('rotation', this.onRotationChanged);\n this.pdfViewerApi.addEventListener('error', this.onApiError);\n if (this.options.viewer.general.promptOnUnsavedChange) {\n window.addEventListener('beforeunload', this.beforeUnloadCallback);\n }\n document.addEventListener('selectionchange', this.onHtmlDocumentSelectionChanged);\n this.canvasEvents = new CanvasEvents(canvasLayers);\n this.canvasEvents.suspend();\n this.canvasEvents.addEventListener('pointerdown', this.onCanvasPointerDown);\n this.canvasEvents.addEventListener('pointermove', this.onCanvasPointerMove);\n this.canvasEvents.addEventListener('pointerup', this.onCanvasPointerUp);\n this.canvasEvents.addEventListener('pointerclick', this.onCanvasPointerClick);\n this.canvasEvents.addEventListener('pointerdblclick', this.onCanvasPointerDblClick);\n this.canvasEvents.addEventListener('pointerlongpress', this.onCanvasPointerLongPress);\n this.canvasEvents.addEventListener('pointerstartdrag', this.onCanvasPointerStartDrag);\n this.canvasEvents.addEventListener('pointerenddrag', this.onCanvasPointerEndDrag);\n this.canvasEvents.addEventListener('pinch', this.onCanvasPointerPinch);\n this.viewLayersElement.addEventListener('wheel', this.onMouseWheel, {\n passive: false,\n });\n document.addEventListener('keydown', this.onKeyboardShortcuts, {\n passive: false,\n });\n translationManager.loadTranslations(this.options.viewer.general.language || 'en');\n tooltipManager.setType(this.options.viewer.general.tooltips || 'title');\n if (this.options.modules) {\n if (this.licenseFeatures.annotate &&\n this.options.modules.find((m) => m === StampAnnotationModule) &&\n this.options.annotation.options.pdfStampFiles) {\n this.registerPdfStamps(this.options.annotation.options.pdfStampFiles);\n }\n }\n requestAnimationFrame(() => {\n this.dispatchEvent('appLoaded', true);\n });\n }\n get licenseFeatures() {\n const licenseFeatures = this.pdfViewerApi.getSupportedFeatures();\n return {\n annotate: !this.options.viewer.general.viewOnly &&\n PdfViewing.LicenseFeature.Annotate ===\n (licenseFeatures & PdfViewing.LicenseFeature.Annotate),\n fillFormFields: !this.options.viewer.general.viewOnly &&\n PdfViewing.LicenseFeature.FillFormFields ===\n (licenseFeatures & PdfViewing.LicenseFeature.FillFormFields),\n pageRotation: !this.options.viewer.general.viewOnly &&\n PdfViewing.LicenseFeature.PageRotation ===\n (licenseFeatures & PdfViewing.LicenseFeature.PageRotation),\n };\n }\n open(pdfFile, fdfFiles, password, viewOptions, renderOptions) {\n const _viewOptions = viewOptions ? viewOptions : {};\n const containerRect = this.viewLayersElement.getBoundingClientRect();\n const viewportSize = {\n width: containerRect.width,\n height: containerRect.height,\n };\n return this.openRoutine(this.pdfViewerApi.open, pdfFile, fdfFiles, password, _viewOptions, renderOptions, viewportSize);\n }\n save(saveOptions) {\n const promises = new Array();\n for (let i = 0; i < this.modules.length; i++) {\n promises.push(this.modules[i].onSave());\n }\n const savePromise = new Promise((resolve, reject) => {\n Promise.all(promises).then(() => {\n return this.pdfViewerApi\n .save(saveOptions)\n .then((buffer) => {\n resolve(buffer);\n })\n .catch((err) => {\n reject(err);\n });\n });\n });\n return savePromise;\n }\n openFDF(pdfBuffer, fdfBuffer, password) {\n return this.open({ data: pdfBuffer }, [{ data: fdfBuffer }], password);\n }\n openUri(pdfUri, password, pdfAuthorization) {\n return this.open({ uri: pdfUri }, [], password);\n }\n openFDFUri(pdfUri, fdfUri, password, pdfAuthorization, fdfAuthorization) {\n return this.open({ uri: pdfUri }, [{ uri: pdfUri }], password);\n }\n openBlob(blob, password) {\n return this.open({ data: blob }, [], password);\n }\n openFDFBlob(pdfBlob, fdfBlob, password) {\n return this.open({ data: pdfBlob }, [{ data: fdfBlob }], password);\n }\n saveFile(asFdf) {\n return new Promise((resolve, reject) => {\n const saveOptions = {};\n if (asFdf) {\n saveOptions.fileType = FileType.Fdf;\n }\n this.save(saveOptions).then((blob) => {\n blob.arrayBuffer().then((arrayBuffer) => {\n resolve(new Uint8Array(arrayBuffer));\n });\n });\n });\n }\n close() {\n this.unRegisterModules();\n this.onDocumentClosed();\n if (this.searchIterator) {\n this.searchIterator.close();\n this.searchIterator = null;\n }\n return this.pdfViewerApi.close();\n }\n destroy() {\n this.stopRenderLoop();\n if (this.searchIterator) {\n this.searchIterator.close();\n }\n this.resizeObserver.disconnect();\n if (this.annotTimer) {\n window.clearTimeout(this.annotTimer);\n }\n this.eventListeners.clear();\n document.removeEventListener('keydown', this.onKeyboardShortcuts);\n window.removeEventListener('beforeunload', this.beforeUnloadCallback);\n this.pdfViewerApi.removeEventListener('firstVisiblePage', this.onFirstVisiblePageChanged);\n this.pdfViewerApi.removeEventListener('lastVisiblePage', this.onLastVisiblePageChanged);\n this.pdfViewerApi.removeEventListener('pageNumber', this.onPageNumberChanged);\n this.pdfViewerApi.removeEventListener('zoom', this.onZoomChanged);\n this.pdfViewerApi.removeEventListener('fitMode', this.onFitModeChanged);\n this.pdfViewerApi.removeEventListener('pageLayoutMode', this.onPageLayoutModeChanged);\n this.pdfViewerApi.removeEventListener('busyState', this.onBusyStateChanged);\n this.pdfViewerApi.removeEventListener('canvasInvalidated', this.onCanvasInvalidated);\n this.pdfViewerApi.removeEventListener('itemCreated', this.onItemCreated);\n this.pdfViewerApi.removeEventListener('itemUpdated', this.onItemUpdated);\n this.pdfViewerApi.removeEventListener('itemDeleted', this.onItemDeleted);\n this.pdfViewerApi.removeEventListener('pageChanged', this.onPageChanged);\n this.pdfViewerApi.removeEventListener('rotation', this.onRotationChanged);\n this.pdfViewerApi.removeEventListener('error', this.onApiError);\n this.canvasEvents.suspend();\n this.canvasEvents.removeEventListener('pointerdown', this.onCanvasPointerDown);\n this.canvasEvents.removeEventListener('pointermove', this.onCanvasPointerMove);\n this.canvasEvents.removeEventListener('pointerup', this.onCanvasPointerUp);\n this.canvasEvents.removeEventListener('pointerclick', this.onCanvasPointerClick);\n this.canvasEvents.removeEventListener('pointerdblclick', this.onCanvasPointerDblClick);\n this.canvasEvents.removeEventListener('pointerlongpress', this.onCanvasPointerLongPress);\n this.canvasEvents.removeEventListener('pointerstartdrag', this.onCanvasPointerStartDrag);\n this.canvasEvents.removeEventListener('pointerenddrag', this.onCanvasPointerEndDrag);\n this.canvasEvents.removeEventListener('pinch', this.onCanvasPointerPinch);\n this.viewLayersElement.removeEventListener('wheel', this.onMouseWheel);\n this.pdfViewerApi.destroy();\n this.viewLayers = [];\n this.modules = [];\n while (this.element.firstChild) {\n this.element.removeChild(this.element.firstChild);\n }\n }\n hasChanges() {\n return this.pdfViewerApi.hasChanges();\n }\n getProductVersion() {\n return PdfViewing.Sdk.version;\n }\n getZoom() {\n return this.pdfViewerApi.getZoom();\n }\n setZoom(zoom, location) {\n this.pdfViewerApi.setZoom(zoom, location);\n }\n zoomIn(location) {\n const zoom = this.pdfViewerApi.getZoom();\n this.pdfViewerApi.setZoom(this.getNextZoomInLevel(zoom), location);\n }\n zoomOut(location) {\n const zoom = this.pdfViewerApi.getZoom();\n this.pdfViewerApi.setZoom(this.getNextZoomOutLevel(zoom), location);\n }\n getPageCount() {\n return this.pdfViewerApi.getPageCount();\n }\n getPageNumber() {\n return this.pdfViewerApi.getPageNumber();\n }\n rotatePage(pageNumber, direction) {\n const { textSelection, selectedAnnotationId, selectedModuleName } = this.store.getState().viewer;\n if (textSelection) {\n const textSelectionLayer = this.viewLayers.find((v) => v instanceof TextSelectionLayer);\n if (textSelectionLayer) {\n textSelectionLayer.clearSelection();\n }\n }\n if (selectedAnnotationId) {\n this.store.viewer.deselectAnnotation();\n }\n if (selectedModuleName) {\n this.store.viewer.endModule(selectedModuleName);\n }\n return this.pdfViewerApi.rotatePage(pageNumber, direction);\n }\n setPageNumber(page) {\n if (page < 1) {\n page = 1;\n }\n else {\n const pageCount = this.pdfViewerApi.getPageCount();\n if (page > pageCount) {\n page = pageCount;\n }\n }\n this.pdfViewerApi.setPageNumber(page);\n }\n scrollDown(distance = 100) {\n if (distance === 0) {\n return;\n }\n const pos = this.pdfViewerApi.getScrollPosition();\n pos.y += distance * window.devicePixelRatio;\n this.pdfViewerApi.setScrollPosition(pos);\n }\n scrollUp(distance = 100) {\n if (distance === 0) {\n return;\n }\n const pos = this.pdfViewerApi.getScrollPosition();\n pos.y -= distance * window.devicePixelRatio;\n this.pdfViewerApi.setScrollPosition(pos);\n }\n scrollLeft(distance = 100) {\n if (distance === 0) {\n return;\n }\n const pos = this.pdfViewerApi.getScrollPosition();\n pos.x -= distance * window.devicePixelRatio;\n this.pdfViewerApi.setScrollPosition(pos);\n }\n scrollRight(distance = 100) {\n if (distance === 0) {\n return;\n }\n const pos = this.pdfViewerApi.getScrollPosition();\n pos.x += distance * window.devicePixelRatio;\n this.pdfViewerApi.setScrollPosition(pos);\n }\n scrollMove(distanceVertical = 0, distanceHorizontal = 0) {\n if (distanceVertical === 0 && distanceHorizontal === 0) {\n return;\n }\n const pos = this.pdfViewerApi.getScrollPosition();\n pos.y += distanceVertical * window.devicePixelRatio;\n pos.x += distanceHorizontal * window.devicePixelRatio;\n this.pdfViewerApi.setScrollPosition(pos);\n }\n nextPage() {\n const page = this.pdfViewerApi.getPageNumber();\n const pageCount = this.pdfViewerApi.getPageCount();\n if (page < pageCount) {\n this.pdfViewerApi.setPageNumber(page + 1);\n }\n }\n previousPage() {\n const page = this.pdfViewerApi.getPageNumber();\n if (page > 1) {\n this.pdfViewerApi.setPageNumber(page - 1);\n }\n }\n getFitMode() {\n return this.pdfViewerApi.getFitMode();\n }\n setFitMode(fitMode) {\n this.pdfViewerApi.setFitMode(fitMode);\n }\n getPageLayoutMode() {\n return this.pdfViewerApi.getPageLayoutMode();\n }\n setPageLayoutMode(pageLayoutMode) {\n this.pdfViewerApi.setPageLayoutMode(pageLayoutMode);\n }\n getRotation() {\n return this.pdfViewerApi.getRotation();\n }\n setRotation(rotation) {\n this.pdfViewerApi.setRotation(rotation);\n }\n renderPage(pageNumber, width, height) {\n return this.pdfViewerApi.renderPage(pageNumber, width, height);\n }\n getDocumentOutline() {\n return this.getOutlines(null);\n }\n goTo(pdfDestination) {\n this.pdfViewerApi.goTo(pdfDestination);\n }\n updateCanvasSearchState(state) {\n this.store.search.start({\n caseSensitive: state.caseSensitive,\n searchString: state.searchString,\n reverse: false,\n useRegex: state.useRegex,\n wrapSearch: state.wrapSearch,\n });\n }\n doSearch() {\n const s = this.store.getState().search;\n if (this.searchIterator &&\n this.searchIterator.match instanceof PdfViewing.Pdf.Content.TextSelection) {\n const list = this.searchIterator.match.textArea;\n let page = 1;\n const quadrilateralList = [];\n for (let i = 0; i < list.size; i++) {\n const quad = list.get(i);\n if (quad.pageNumber > page) {\n page = quad.pageNumber;\n }\n quadrilateralList.push(quad);\n }\n this.store.search.updateMatch({\n match: quadrilateralList,\n page,\n });\n const q = list.get(0);\n const { bottomLeft, bottomRight, topRight, topLeft, pageNumber } = q;\n const x = Math.min(bottomLeft.x, bottomRight.x, topRight.x, topLeft.x);\n const y = Math.min(bottomLeft.y, bottomRight.y, topRight.y, topLeft.y);\n const padding = 10;\n const rect = {\n pdfX: x - padding,\n pdfY: y - padding,\n pdfW: Math.max(bottomLeft.x, bottomRight.x, topRight.x, topLeft.x) - x + 2 * padding,\n pdfH: Math.max(bottomLeft.y, bottomRight.y, topRight.y, topLeft.y) - y + 2 * padding,\n page: pageNumber,\n };\n this.pdfViewerApi.goToRectangle(rect);\n }\n }\n startSearch(searchString, startPage, caseSensitive, wrapSearch, useRegex) {\n if (this.searchIterator) {\n this.endSearch();\n }\n this.searchIterator = this.pdfViewerApi.getSearchIterator(searchString, startPage, caseSensitive, wrapSearch, useRegex);\n if (!this.searchIterator) {\n return;\n }\n this.searchIterator.getNext().then((hasResult) => {\n if (hasResult) {\n this.doSearch();\n }\n else {\n this.endSearch();\n }\n });\n }\n nextSearchMatch() {\n if (this.searchIterator) {\n this.searchIterator.getNext().then((hasResult) => {\n if (hasResult) {\n this.doSearch();\n }\n });\n }\n }\n previousSearchMatch() {\n if (this.searchIterator) {\n return this.searchIterator.getPrevious().then((hasResult) => {\n if (hasResult) {\n this.doSearch();\n }\n });\n }\n }\n endSearch() {\n if (this.searchIterator) {\n this.searchIterator.close();\n this.searchIterator = null;\n this.store.search.clear();\n }\n }\n resetViewerMode() {\n this.store.viewer.setDefaultMode();\n }\n getAnnotationsFromPage(page) {\n return new Promise((resolve, reject) => {\n this.pdfViewerApi\n .getItemsFromPage(page, PdfItemCategory.ANNOTATION)\n .then((items) => {\n this.store.annotations.setPageAnnotations(items);\n resolve(items);\n })\n .catch((err) => {\n reject(err);\n });\n });\n }\n goToAnnotation(annotation, action) {\n this.pdfViewerApi.goToRectangle(annotation.pdfRect);\n if (action === 'select') {\n this.dispatchEvent('itemSelected', annotation);\n }\n }\n print() {\n this.activateModule('PrintServiceModule', null);\n }\n getModules() {\n return this.modules;\n }\n activateModule(moduleName, args) {\n const module = this.modules.find((m) => {\n return m.name == moduleName;\n });\n if (module) {\n module.activate(args);\n this.dispatchEvent('moduleActivated', moduleName);\n }\n }\n deactivateModule(moduleName) {\n this.dispatchEvent('moduleActivated', moduleName);\n const module = this.modules.find((m) => {\n return m.name == moduleName;\n });\n if (module) {\n module.deactivate();\n }\n }\n getSelectedText() {\n const { textSelection, textSelectionType } = this.store.getState().viewer;\n let text = undefined;\n if (textSelection) {\n const { startPoint, endPoint } = textSelection;\n text =\n textSelectionType === 'rectangular'\n ? this.pdfViewerApi.getTextForRectangularSelection(startPoint, endPoint)\n : this.pdfViewerApi.getText(startPoint, endPoint);\n }\n return text;\n }\n addEventListener(type, listener) {\n if (this.eventListeners.has(type)) {\n ;\n this.eventListeners.get(type).push(listener);\n }\n else {\n this.eventListeners.set(type, [listener]);\n }\n }\n removeEventListener(type, listener) {\n if (this.eventListeners.has(type)) {\n let listeners = this.eventListeners.get(type);\n listeners = listeners.filter((listenerInArray) => listenerInArray !== listener);\n if (listeners.length !== 0) {\n this.eventListeners.set(type, listeners);\n }\n else {\n this.eventListeners.delete(type);\n }\n }\n }\n suspendCanvasEvents() {\n this.canvasEvents.suspend();\n }\n resumeCanvasEvents() {\n this.canvasEvents.resume();\n }\n dispatchEvent(type, args) {\n if (this.eventListeners.has(type)) {\n const listeners = this.eventListeners.get(type);\n listeners.forEach((listener) => listener(args));\n }\n }\n getOutlines(parent) {\n return __awaiter(this, void 0, void 0, function* () {\n const outlineItems = yield this.pdfViewerApi.getOutlines(parent);\n for (const item of outlineItems) {\n if (item.hasDescendants) {\n const children = yield this.getOutlines(item);\n item.descendants = children;\n }\n }\n return outlineItems;\n });\n }\n openRoutine(openFunction, ...args) {\n return new Promise((resolve, reject) => {\n if (this.pdfViewerApi.isOpen()) {\n this.close();\n }\n requestAnimationFrame(() => {\n openFunction(...args)\n .then(() => {\n this.onDocumentOpened();\n resolve({});\n })\n .catch((error) => {\n if (error.message === 'The authentication failed due to a wrong password.') {\n reject(new Error('password required'));\n }\n else {\n reject(new Error('unsupported file'));\n }\n });\n });\n });\n }\n onDocumentOpened() {\n this.registerModules();\n this.documentLoaded = true;\n this.element.classList.add('pwv-ViewerCanvas--documentLoaded');\n this.dispatchEvent('pageLayoutMode', this.pdfViewerApi.getPageLayoutMode());\n this.dispatchEvent('firstVisiblePage', this.pdfViewerApi.getFirstVisiblePage());\n this.dispatchEvent('lastVisiblePage', this.pdfViewerApi.getLastVisiblePage());\n this.dispatchEvent('pageNumber', this.pdfViewerApi.getPageNumber());\n this.dispatchEvent('zoom', this.pdfViewerApi.getZoom());\n const containerRect = this.viewLayersElement.getBoundingClientRect();\n this.store.canvas.resize({\n cssWidth: containerRect.width,\n cssHeight: containerRect.height,\n });\n this.startRenderLoop();\n const document = this.store.getState().document;\n window.setTimeout(() => {\n this.canvasEvents.resume();\n this.element.classList.add('pwv-ViewerCanvas--documentLoaded');\n }, 100);\n }\n onDocumentClosed() {\n this.canvasEvents.suspend();\n this.documentLoaded = false;\n this.element.classList.remove('pwv-ViewerCanvas--documentLoaded');\n this.stopRenderLoop();\n this.store.loadDefaultState();\n }\n startRenderLoop() {\n const viewLayers = this.viewLayers;\n const modules = this.modules;\n const loop = (timestamp) => {\n const state = this.store.getState();\n if (this.renderLoopRunning) {\n this.store.resetChangedState();\n if (state.viewer.cursorStyleChanged) {\n this.viewLayersElement.style.cursor = state.viewer.cursorStyle;\n }\n for (let i = 0; i < viewLayers.length; i++) {\n const res = viewLayers[i].render(timestamp, state);\n if (res === false) {\n break;\n }\n }\n for (let i = 0; i < modules.length; i++) {\n modules[i].render(timestamp, state);\n }\n requestAnimationFrame(loop);\n }\n };\n this.renderLoopRunning = true;\n requestAnimationFrame(loop);\n }\n stopRenderLoop() {\n this.renderLoopRunning = false;\n }\n registerPdfStamps(pdfStampFiles) {\n const pdfStampConfigs = this.options.annotation.options.stamps.filter((s) => s.pdfStampFileName);\n const pdfStampConfigMap = pdfStampConfigs.reduce(function (acc, obj) {\n let key = obj.pdfStampFileName;\n if (!acc[key]) {\n acc[key] = 0;\n }\n ++acc[key];\n return acc;\n }, {});\n const onStampCreated = (pdfStamp) => {\n if (pdfStampConfigMap.hasOwnProperty(pdfStamp.pdfStampFileName)) {\n const stamp = this.options.annotation.options.stamps.find((s) => s.pdfStampFileName === pdfStamp.pdfStampFileName && s.pageNumber === pdfStamp.pageNumber);\n if (stamp) {\n stamp.thumbnail = pdfStamp.thumbnail;\n stamp.aspectRatio = pdfStamp.aspectRatio;\n }\n }\n else {\n this.options.annotation.options.stamps.push(pdfStamp);\n }\n };\n pdfStampFiles.forEach((stampFile) => {\n const data = imageDataUrlToUint8Array(stampFile.data);\n const pdfStampFileName = stampFile.pdfStampFileName ? stampFile.pdfStampFileName : '';\n this.pdfViewerApi.registerPdfStampFile(pdfStampFileName, data, onStampCreated);\n });\n }\n registerModules() {\n const viewLayers = [\n PdfDocumentLayer,\n BusyStateLayer,\n AnnotationSelectionLayer,\n TextSelectionLayer,\n ScrollLayer,\n ];\n viewLayers.forEach((viewLayerBaseClass) => {\n const viewLayer = new viewLayerBaseClass();\n viewLayer.register(this, this.dispatchEvent);\n this.viewLayers.push(viewLayer);\n });\n const modules = this.options.modules.filter(({ moduleInfo }) => (!moduleInfo.requiredFeatures.annotate ||\n (moduleInfo.requiredFeatures.annotate && this.licenseFeatures.annotate)) &&\n (!moduleInfo.requiredFeatures.fillFormFields ||\n (moduleInfo.requiredFeatures.fillFormFields && this.licenseFeatures.fillFormFields)));\n if (modules) {\n modules.forEach((module) => {\n const m = new module();\n this.modules.push(m);\n const viewerCanvas = this;\n const reg = m.register(this.viewLayersElement, this.store, this.pdfViewerApi, viewerCanvas, this.options);\n if (reg.toolbar && this.toolbarElement) {\n this.toolbarElement.appendChild(reg.toolbar);\n }\n if (reg.contextbar) {\n this.store.viewer.addContextBarItem(reg.contextbar);\n }\n });\n }\n this.updateCanvasSize();\n }\n unRegisterModules() {\n this.viewLayers = [];\n this.store.viewer.clearContextBarItems();\n this.toolbarElement.innerHTML = '';\n this.viewLayersElement.innerHTML = '';\n this.modules.splice(0, this.modules.length);\n }\n updateViewLayerContext() {\n const pixelRatio = window.devicePixelRatio;\n this.store.canvas.setPixelRatio(pixelRatio);\n const rect = this.viewLayersElement.getBoundingClientRect();\n const maxScroll = this.pdfViewerApi.getScrollMaxPosition();\n const scrollPosition = this.pdfViewerApi.getScrollPosition();\n const devicePixelsWidth = rect.width * pixelRatio + (maxScroll.x > 0 ? maxScroll.x : scrollPosition.x * 2);\n const devicePixelsHeight = rect.height * pixelRatio + (maxScroll.y > 0 ? maxScroll.y : scrollPosition.y * 2);\n const zoom = this.pdfViewerApi.getZoom();\n this.store.document.resize({ zoom, devicePixelsHeight, devicePixelsWidth });\n this.store.scroll.scrollChanged({\n cssLeft: scrollPosition.x,\n cssTop: scrollPosition.y,\n });\n const state = this.store.getState();\n const pageRects = {};\n for (let page = this.pdfViewerApi.getFirstVisiblePage(); page <= this.pdfViewerApi.getLastVisiblePage(); page++) {\n pageRects[page] = this.pdfViewerApi.getPageScreenRect(page);\n }\n this.store.document.updatePageRects(pageRects);\n }\n onMouseWheel(e) {\n if (e.deltaY !== 0) {\n if (e.ctrlKey) {\n e.preventDefault();\n e.cancelBubble = true;\n const containerRect = this.viewLayersElement.getBoundingClientRect();\n const x = e.clientX - containerRect.left;\n const y = e.clientY - containerRect.top;\n if (e.deltaY < 0) {\n this.zoomIn({ x, y });\n }\n else {\n this.zoomOut({ x, y });\n }\n }\n else if (e.shiftKey) {\n e.preventDefault();\n e.cancelBubble = true;\n const distance = e.deltaY > 0 ? 100 : -100;\n this.scrollRight(distance);\n }\n else {\n e.preventDefault();\n e.cancelBubble = true;\n const distance = e.deltaY > 0 ? 100 : -100;\n this.scrollDown(distance);\n }\n }\n else if (e.deltaX > 0) {\n this.scrollRight();\n }\n else if (e.deltaX < 0) {\n this.scrollLeft();\n }\n else if (e.deltaZ < 0) {\n this.zoomIn();\n }\n else if (e.deltaZ > 0) {\n this.zoomOut();\n }\n }\n transformPointer(e) {\n const containerRect = this.viewLayersElement.getBoundingClientRect();\n const x = e.clientX - containerRect.left;\n const y = e.clientY - containerRect.top;\n return {\n cssX: x,\n cssY: y,\n isDown: e.buttons === 1,\n type: e.type,\n };\n }\n onCanvasPointerClick(e) {\n const p = this.transformPointer(e);\n this.store.pointer.update(p);\n this.store.pointer.setAction('click');\n }\n onCanvasPointerDblClick(e) {\n const p = this.transformPointer(e);\n this.store.pointer.update(p);\n this.store.pointer.setAction('dblclick');\n }\n onCanvasPointerLongPress(e) {\n const p = this.transformPointer(e);\n this.store.pointer.update(p);\n this.store.pointer.setAction('longpress');\n }\n onCanvasPointerStartDrag(e) {\n this.store.pointer.setAction('startdrag');\n }\n onCanvasPointerEndDrag(e) {\n this.store.pointer.setAction('enddrag');\n }\n onCanvasPointerPinch(e) {\n const containerRect = this.viewLayersElement.getBoundingClientRect();\n const x = (e.clientX - containerRect.left) * devicePixelRatio;\n const y = (e.clientY - containerRect.top) * devicePixelRatio;\n const zoom = this.pdfViewerApi.getZoom();\n const zoomDistance = (e.movementDistance / 200) * zoom;\n let newZoom = zoom + zoomDistance;\n const minZoomLevel = this.options.viewer.general.defaultZoomLevels[0];\n const maxZoomLevel = this.options.viewer.general.defaultZoomLevels[this.options.viewer.general.defaultZoomLevels.length - 1];\n if (newZoom < minZoomLevel) {\n newZoom = minZoomLevel;\n }\n else if (newZoom > maxZoomLevel) {\n newZoom = maxZoomLevel;\n }\n this.setZoom(newZoom, { x, y });\n }\n onCanvasPointerDown(e) {\n const p = this.transformPointer(e);\n this.store.pointer.update(p);\n this.store.startPointer.update(p);\n }\n onCanvasPointerUp(e) {\n const p = this.transformPointer(e);\n this.store.pointer.update(p);\n }\n onCanvasPointerMove(e) {\n if (e.buttons < 2) {\n const p = this.transformPointer(e);\n this.store.pointer.update(p);\n }\n else if (e.buttons === 4) {\n this.scrollMove(e.movementY * -1, e.movementX * -1);\n this.store.viewer.setCursorStyle(CursorStyle.GRABBING);\n }\n }\n onKeyboardShortcuts(e) {\n const rect = this.element.getBoundingClientRect();\n if (rect.width + rect.height === 0) {\n return;\n }\n let metaflag = false;\n if (e.metaKey) {\n metaflag = true;\n }\n const { shortcuts } = this.options;\n if (Object.keys(shortcuts).length > 0) {\n const keyboardCommands = getKeyboardCommands(e, shortcuts);\n if (!keyboardCommands.length) {\n return;\n }\n for (const cmd of keyboardCommands) {\n const isSuperKeyRequired = cmd[1];\n if (isSuperKeyRequired && !metaflag) {\n continue;\n }\n switch (cmd[0]) {\n case 'zoomIn':\n e.preventDefault();\n this.zoomIn();\n break;\n case 'zoomOut':\n e.preventDefault();\n this.zoomOut();\n break;\n case 'nextPage':\n e.preventDefault();\n this.nextPage();\n break;\n case 'previousPage':\n e.preventDefault();\n this.previousPage();\n break;\n case 'scrollDown':\n e.preventDefault();\n this.scrollDown();\n break;\n case 'scrollUp':\n e.preventDefault();\n this.scrollUp();\n break;\n case 'scrollLeft':\n e.preventDefault();\n this.scrollLeft();\n break;\n case 'scrollRight':\n e.preventDefault();\n this.scrollRight();\n break;\n case 'firstPage':\n e.preventDefault();\n this.setPageNumber(1);\n break;\n case 'lastPage':\n e.preventDefault();\n this.setPageNumber(this.getPageCount());\n break;\n case 'releaseSelection':\n const viewerMode = this.store.getState().viewer.mode;\n if (viewerMode === ViewerMode.TEXT_SELECTED) {\n e.preventDefault();\n e.cancelBubble = true;\n this.store.viewer.setTextSelection({ selection: null, type: null });\n this.store.viewer.setTextSelectionState(null);\n break;\n }\n if (viewerMode === ViewerMode.ANNOTATION_SELECTED) {\n e.preventDefault();\n e.cancelBubble = true;\n this.store.viewer.deselectAnnotation();\n break;\n }\n break;\n case 'copy':\n if (this.options.viewer.permissions.allowCopyText) {\n const documentSelection = document.getSelection();\n if ((documentSelection === null || documentSelection === void 0 ? void 0 : documentSelection.type) && ['Caret', 'Range'].includes(documentSelection === null || documentSelection === void 0 ? void 0 : documentSelection.type)) {\n return;\n }\n e.preventDefault();\n e.cancelBubble = true;\n copyTextToClipboard(this.getSelectedText() || '');\n }\n break;\n case 'copyMac':\n if (this.options.viewer.permissions.allowCopyText) {\n const documentSelection = document.getSelection();\n if ((documentSelection === null || documentSelection === void 0 ? void 0 : documentSelection.type) && ['Caret', 'Range'].includes(documentSelection === null || documentSelection === void 0 ? void 0 : documentSelection.type)) {\n return;\n }\n e.preventDefault();\n e.cancelBubble = true;\n copyTextToClipboard(this.getSelectedText() || '');\n }\n break;\n case 'resetZoom':\n e.preventDefault();\n this.setZoom(1);\n break;\n case 'fitToPage':\n e.preventDefault();\n this.setFitMode(PdfFitMode.FIT_PAGE);\n break;\n case 'fitToWidth':\n e.preventDefault();\n this.setFitMode(PdfFitMode.FIT_WIDTH);\n break;\n case 'rotateView':\n if (this.options.viewer.permissions.allowRotateView) {\n e.preventDefault();\n const r = this.getRotation();\n const rotation = r >= 270 ? 0 : r + 90;\n this.setRotation(rotation);\n }\n break;\n case 'cancelEditAnnotation':\n const { selectedModuleName } = this.store.getState().viewer;\n if (selectedModuleName) {\n this.store.viewer.endModule(selectedModuleName);\n e.preventDefault();\n break;\n }\n }\n }\n }\n else if (e.key === 'Escape') {\n const { selectedModuleName, mode } = this.store.getState().viewer;\n if (selectedModuleName) {\n this.store.viewer.endModule(selectedModuleName);\n }\n const viewerMode = mode;\n if (viewerMode === ViewerMode.TEXT_SELECTED) {\n this.store.viewer.setTextSelection({ selection: null, type: null });\n this.store.viewer.setTextSelectionState(null);\n }\n if (viewerMode === ViewerMode.ANNOTATION_SELECTED) {\n this.store.viewer.deselectAnnotation();\n }\n }\n }\n onResize(entries, observer) {\n const containerRect = this.viewLayersElement.getBoundingClientRect();\n if (containerRect.width === 0 || containerRect.height === 0) {\n return;\n }\n this.updateCanvasSize();\n }\n onHtmlDocumentSelectionChanged() {\n const documentSelection = document.getSelection();\n if (documentSelection) {\n const viewerMode = this.store.getState().viewer.mode;\n if (viewerMode === ViewerMode.TEXT_SELECTED) {\n this.store.viewer.setTextSelection({ selection: null, type: null });\n this.store.viewer.setTextSelectionState(null);\n }\n }\n }\n updateCanvasSize() {\n const containerRect = this.viewLayersElement.getBoundingClientRect();\n const pixelRatio = window.devicePixelRatio;\n this.viewLayers.forEach((viewLayer) => {\n viewLayer.resize(containerRect.width, containerRect.height, pixelRatio);\n });\n this.modules.forEach((module) => {\n module.resize(containerRect.width, containerRect.height);\n });\n this.store.canvas.resize({\n cssWidth: containerRect.width,\n cssHeight: containerRect.height,\n });\n this.store.canvas.setCanvasInvalidated(true);\n }\n onCanvasInvalidated() {\n this.store.canvas.setCanvasInvalidated(true);\n this.updateViewLayerContext();\n }\n onFirstVisiblePageChanged(page) {\n this.store.document.fistVisiblePageChanged(page);\n this.maybeGetAnnotations(this.store.getState().document.firstVisiblePage, this.store.getState().document.lastVisiblePage);\n this.dispatchEvent('firstVisiblePage', page);\n }\n onPageNumberChanged(page) {\n this.dispatchEvent('pageNumber', page);\n }\n onTextSelected() {\n var _a;\n this.dispatchEvent('textSelected', (_a = this.getSelectedText()) !== null && _a !== void 0 ? _a : '');\n }\n maybeGetAnnotations(begin, end) {\n if (this.annotTimer) {\n window.clearTimeout(this.annotTimer);\n }\n this.annotTimer = window.setTimeout(() => {\n this.getAnnotations(begin, end);\n }, 100);\n }\n getAnnotations(begin, end) {\n for (let page = begin; page <= end; page++) {\n if (this.store.getState().annotations.byPage[page] === undefined) {\n this.pdfViewerApi\n .getItemsFromPage(page, PdfItemCategory.ANNOTATION)\n .then((itemsOnPage) => {\n this.store.annotations.setPageAnnotations(itemsOnPage);\n })\n .catch((err) => {\n console.warn(err);\n });\n }\n }\n }\n onLastVisiblePageChanged(page) {\n this.store.document.lastVisiblePageChanged(page);\n this.maybeGetAnnotations(this.store.getState().document.firstVisiblePage, this.store.getState().document.lastVisiblePage);\n this.dispatchEvent('lastVisiblePage', page);\n }\n onZoomChanged(zoom) {\n this.dispatchEvent('zoom', zoom);\n }\n onFitModeChanged(fitMode) {\n this.store.document.fitModeChanged(fitMode);\n this.dispatchEvent('fitMode', fitMode);\n }\n onPageLayoutModeChanged(layoutMode) {\n this.store.document.pageLayoutModeChanged(layoutMode);\n this.dispatchEvent('pageLayoutMode', layoutMode);\n }\n onBusyStateChanged(state) {\n this.store.document.busyStateChanged(state);\n if (state) {\n this.element.classList.remove('pwv-ViewerCanvas--documentIdle');\n }\n else {\n this.element.classList.add('pwv-ViewerCanvas--documentIdle');\n }\n this.dispatchEvent('busyState', state);\n }\n onRotationChanged(rotation) {\n this.store.document.rotationChanged(rotation);\n this.dispatchEvent('rotation', rotation);\n }\n onItemCreated(item) {\n if (item.itemCategory === PdfItemCategory.ANNOTATION) {\n this.store.annotations.addAnnotation(item);\n }\n this.dispatchEvent('itemCreated', item);\n }\n onItemUpdated(item) {\n if (item.itemCategory === PdfItemCategory.ANNOTATION) {\n this.store.annotations.updateAnnotation(item);\n }\n this.dispatchEvent('itemUpdated', item);\n }\n onItemDeleted(deletedItem) {\n if (deletedItem.categoryType === PdfItemCategory.ANNOTATION) {\n this.store.annotations.deleteAnnotation(deletedItem.id);\n }\n this.dispatchEvent('itemDeleted', deletedItem);\n }\n onPageChanged(pageNumber) {\n this.pdfViewerApi\n .getItemsFromPage(pageNumber, PdfItemCategory.ANNOTATION)\n .then((itemsOnPage) => {\n itemsOnPage.items.forEach((annotation) => {\n this.store.annotations.updateAnnotation(annotation);\n });\n this.dispatchEvent('pageChanged', pageNumber);\n });\n }\n onApiError(error) {\n console.error('//// PdfViewerApi Error: ', error);\n this.dispatchEvent('error', error);\n }\n beforeUnloadCallback(e) {\n const changes = this.pdfViewerApi.hasChanges();\n if (changes !== null && changes !== DocumentChange.NONE) {\n e.preventDefault();\n e.returnValue = '';\n }\n else {\n return;\n }\n }\n getNextZoomOutLevel(zoomCurrent) {\n for (var i = this.options.viewer.general.defaultZoomLevels.length - 1; i >= 0; i--) {\n if (zoomCurrent > this.options.viewer.general.defaultZoomLevels[i])\n return this.options.viewer.general.defaultZoomLevels[i];\n }\n return this.options.viewer.general.defaultZoomLevels[0];\n }\n getNextZoomInLevel(zoomCurrent) {\n for (var i = 0; i < this.options.viewer.general.defaultZoomLevels.length; i++) {\n if (zoomCurrent < this.options.viewer.general.defaultZoomLevels[i])\n return this.options.viewer.general.defaultZoomLevels[i];\n }\n return this.options.viewer.general.defaultZoomLevels[this.options.viewer.general.defaultZoomLevels.length - 1];\n }\n}\n","import { PdfItemType, } from '../../pdf-viewer-api';\nexport const state = {\n annotationsChanged: false,\n openPopupChanged: false,\n all: [],\n byPage: [],\n popupsByPage: [],\n openPopupsByPage: [],\n};\nexport const annotationHasPopup = (annotation) => {\n if (annotation.itemType === PdfItemType.TEXT) {\n return true;\n }\n if (annotation.itemType === PdfItemType.FREE_TEXT) {\n return false;\n }\n if (!annotation.behaviors) {\n return false;\n }\n return (annotation.behaviors.canHavePopup &&\n (annotation.popup.isOpen === true ||\n (typeof annotation.content === 'string' && annotation.content !== '') ||\n (typeof annotation.subject === 'string' && annotation.subject !== '')));\n};\nexport const actions = {\n setPageAnnotations: (annotationsOnPage) => ($state) => {\n const newState = Object.assign({}, $state);\n const pageNumber = annotationsOnPage.page;\n newState.byPage[pageNumber] = [];\n annotationsOnPage.items.forEach((item) => {\n const annotation = item;\n newState.all[annotation.id] = annotation;\n newState.byPage[pageNumber].push(annotation.id);\n if (annotationHasPopup(annotation)) {\n if (!newState.popupsByPage[pageNumber]) {\n newState.popupsByPage[pageNumber] = [];\n }\n newState.popupsByPage[pageNumber].push(annotation.id);\n if (annotation.popup.isOpen) {\n if (!newState.openPopupsByPage[pageNumber]) {\n newState.openPopupsByPage[pageNumber] = [];\n }\n if (!newState.openPopupsByPage[pageNumber].find((id) => id === annotation.id)) {\n newState.openPopupsByPage[pageNumber].push(annotation.id);\n newState.openPopupChanged = true;\n }\n }\n }\n });\n newState.annotationsChanged = true;\n return newState;\n },\n deleteAnnotation: (id) => ($state) => {\n const newState = Object.assign({}, $state);\n const annotation = $state.all[id];\n const pageNumber = annotation.pdfRect.page;\n delete newState.all[id];\n newState.byPage[pageNumber] = newState.byPage[pageNumber].filter((i) => i !== id);\n if (newState.popupsByPage[pageNumber]) {\n newState.popupsByPage[pageNumber] = newState.popupsByPage[pageNumber].filter((i) => i !== id);\n }\n if (newState.openPopupsByPage[pageNumber]) {\n newState.openPopupChanged = newState.openPopupsByPage[pageNumber].indexOf(id) > -1;\n newState.openPopupsByPage[pageNumber] = newState.openPopupsByPage[pageNumber].filter((i) => i !== id);\n }\n newState.annotationsChanged = true;\n return newState;\n },\n updateAnnotation: (annotation) => ($state) => {\n const newState = Object.assign({}, $state);\n const { behaviors } = annotation;\n const id = annotation.id;\n const pageNumber = annotation.pdfRect.page;\n if (behaviors.canHavePopup) {\n if (annotationHasPopup(annotation)) {\n if (!newState.popupsByPage[pageNumber]) {\n newState.popupsByPage[pageNumber] = [];\n }\n const popupIndex = newState.popupsByPage[pageNumber].indexOf(id);\n if (popupIndex < 0) {\n newState.popupsByPage[pageNumber].push(annotation.id);\n }\n }\n else {\n if (newState.popupsByPage[pageNumber]) {\n newState.popupsByPage[pageNumber] = newState.popupsByPage[pageNumber].filter((i) => i !== id);\n }\n }\n if (annotation.popup.isOpen) {\n if (!newState.openPopupsByPage[pageNumber]) {\n newState.openPopupsByPage[pageNumber] = [];\n }\n if (newState.openPopupsByPage[pageNumber].indexOf(id) < 0) {\n newState.openPopupsByPage[pageNumber].push(id);\n }\n newState.openPopupChanged = true;\n }\n else if (newState.openPopupsByPage[pageNumber]) {\n newState.openPopupsByPage[pageNumber] = newState.openPopupsByPage[pageNumber].filter((i) => i !== id);\n newState.openPopupChanged = true;\n }\n }\n newState.all[annotation.id] = annotation;\n newState.annotationsChanged = true;\n return newState;\n },\n addAnnotation: (annotation) => ($state) => {\n const newState = Object.assign({}, $state);\n const pageNumber = annotation.pdfRect.page;\n const id = annotation.id;\n newState.all[id] = annotation;\n if (!newState.byPage[pageNumber]) {\n newState.byPage[pageNumber] = [];\n }\n newState.byPage[pageNumber].push(id);\n if (annotationHasPopup(annotation)) {\n if (!newState.popupsByPage[pageNumber]) {\n newState.popupsByPage[pageNumber] = [];\n }\n newState.popupsByPage[pageNumber].push(id);\n if (annotation.popup.isOpen) {\n if (!newState.openPopupsByPage[pageNumber]) {\n newState.openPopupsByPage[pageNumber] = [];\n }\n newState.openPopupsByPage[pageNumber].push(id);\n newState.openPopupChanged = true;\n }\n }\n newState.annotationsChanged = true;\n return newState;\n },\n};\nexport const getPopups = ($state, startPage, endPage) => {\n let popups = [];\n for (let page = startPage; page <= endPage; page++) {\n if ($state.popupsByPage[page]) {\n popups = popups\n .concat($state.popupsByPage[page].map((id) => $state.all[id]))\n .filter((annot) => !annot.isHidden());\n }\n }\n return popups;\n};\nexport const getOpenPopups = ($state, startPage, endPage) => {\n let openPopups = [];\n for (let page = startPage; page <= endPage; page++) {\n if ($state.openPopupsByPage[page]) {\n openPopups = openPopups.concat($state.openPopupsByPage[page].map((id) => $state.all[id]));\n }\n }\n return openPopups;\n};\n","export const appState = (state, actions) => {\n const clone = (target, source) => {\n const out = {};\n for (const field of Object.keys(target)) {\n out[field] = target[field];\n }\n if (source) {\n for (const field of Object.keys(source)) {\n out[field] = source[field];\n }\n }\n return out;\n };\n const getPartialState = (path, source) => {\n let i = 0;\n while (i < path.length) {\n source = source[path[i++]];\n }\n return source;\n };\n function setPartialState(path, value, source) {\n const target = {};\n if (path.length) {\n target[path[0]] =\n path.length > 1 ? setPartialState(path.slice(1), value, source[path[0]]) : value;\n return clone(source, target);\n }\n return value;\n }\n const wireStateToActions = (path, wState, wActions) => {\n for (const field of Object.keys(wActions)) {\n if (typeof wActions[field] === 'function') {\n ;\n ((key, action) => {\n wActions[key] = (data) => {\n let result = action(data);\n if (typeof result === 'function') {\n result = result(getPartialState(path, globalState), wActions);\n }\n if (result &&\n result !== (wState = getPartialState(path, globalState)) &&\n !result.then) {\n globalState = setPartialState(path, clone(wState, result), globalState);\n }\n return result;\n };\n })(field, wActions[field]);\n }\n else {\n wireStateToActions(path.concat(field), (wState[field] = clone(wState[field])), (wActions[field] = clone(wActions[field])));\n }\n }\n return wActions;\n };\n let globalState = clone(state);\n const wiredActions = wireStateToActions([], globalState, clone(actions));\n return wiredActions;\n};\n","export const state = {\n widthChanged: true,\n heightChanged: true,\n pixelRatioChanged: true,\n canvasInvalidated: true,\n width: { devicePixels: 0, cssPixels: 0 },\n height: { devicePixels: 0, cssPixels: 0 },\n pixelRatio: 1,\n};\nexport const actions = {\n resize: (payload) => ($state) => {\n const pixelRatio = window.devicePixelRatio;\n const newState = Object.assign({}, $state);\n if ($state.pixelRatio !== pixelRatio) {\n newState.pixelRatio = pixelRatio;\n newState.pixelRatioChanged = true;\n }\n if ($state.width.cssPixels !== payload.cssWidth) {\n newState.width.cssPixels = payload.cssWidth;\n newState.width.devicePixels = payload.cssWidth * pixelRatio;\n newState.widthChanged = true;\n }\n if ($state.height.cssPixels !== payload.cssHeight) {\n newState.height.cssPixels = payload.cssHeight;\n newState.height.devicePixels = payload.cssHeight * pixelRatio;\n newState.heightChanged = true;\n }\n return newState;\n },\n setPixelRatio: (pixelRatio) => ($state) => {\n const newState = Object.assign({}, $state);\n if ($state.pixelRatio !== pixelRatio) {\n newState.pixelRatio = pixelRatio;\n newState.pixelRatioChanged = true;\n }\n return newState;\n },\n setCanvasInvalidated: (canvasInvalidated) => ($state) => (Object.assign(Object.assign({}, $state), { canvasInvalidated })),\n};\n","import { PdfFitMode, PdfPageLayoutMode } from '../../pdf-viewer-api';\nexport const state = {\n busyStateChanged: true,\n heightChanged: true,\n widthChanged: true,\n zoomChanged: true,\n rotationChanged: true,\n firstVisiblePageChanged: true,\n lastVisiblePageChanged: true,\n busyState: false,\n firstVisiblePage: 0,\n lastVisiblePage: 0,\n pageRects: [],\n zoom: 1,\n fitMode: PdfFitMode.NONE,\n pageLayoutMode: PdfPageLayoutMode.SINGLE_PAGE,\n rotation: 0,\n width: { devicePixels: 0, cssPixels: 0 },\n height: { devicePixels: 0, cssPixels: 0 },\n};\nexport const actions = {\n fistVisiblePageChanged: (pageNumber) => ($state) => (Object.assign(Object.assign({}, $state), { firstVisiblePage: pageNumber, firstVisiblePageChanged: true })),\n lastVisiblePageChanged: (pageNumber) => ($state) => (Object.assign(Object.assign({}, $state), { lastVisiblePage: pageNumber, lastVisiblePageChanged: true })),\n resize: (payload) => ($state) => {\n const newState = Object.assign({}, $state);\n const pixelRatio = window.devicePixelRatio;\n if (newState.width.devicePixels !== payload.devicePixelsWidth) {\n newState.width.cssPixels = payload.devicePixelsWidth / pixelRatio;\n newState.width.devicePixels = payload.devicePixelsWidth;\n newState.widthChanged = true;\n }\n if (newState.height.devicePixels !== payload.devicePixelsHeight) {\n newState.height.cssPixels = payload.devicePixelsHeight / pixelRatio;\n newState.height.devicePixels = payload.devicePixelsHeight;\n newState.heightChanged = true;\n }\n if (newState.zoom !== payload.zoom) {\n newState.zoom = payload.zoom;\n newState.zoomChanged = true;\n }\n return newState;\n },\n rotationChanged: (rotation) => ($state) => (Object.assign(Object.assign({}, $state), { rotation, rotationChanged: true })),\n updatePageRects: (pageRects) => ($state) => (Object.assign(Object.assign({}, $state), { pageRects })),\n busyStateChanged: (busyState) => ($state) => (Object.assign(Object.assign({}, $state), { busyState, busyStateChanged: true })),\n fitModeChanged: (fitMode) => ($state) => (Object.assign(Object.assign({}, $state), { fitMode })),\n pageLayoutModeChanged: (pageLayoutMode) => ($state) => (Object.assign(Object.assign({}, $state), { pageLayoutMode })),\n};\nconst getSelectionRectFromPage = ($state, startPoint, endPoint, page, padding = 1) => {\n let rect = null;\n const pageRect = $state.pageRects[page];\n const pX1 = pageRect.x + padding;\n const pX2 = pageRect.x + (pageRect.w - 2 * padding);\n const pY1 = pageRect.y + padding;\n const pY2 = pageRect.y + (pageRect.h - 2 * padding);\n if (startPoint.x >= pX1 && startPoint.x <= pX2 && startPoint.y >= pY1 && startPoint.y <= pY2) {\n endPoint.x = endPoint.x < pX1 ? pX1 : endPoint.x > pX2 ? pX2 : endPoint.x;\n endPoint.y = endPoint.y < pY1 ? pY1 : endPoint.y > pY2 ? pY2 : endPoint.y;\n rect = { x: 0, y: 0, w: 0, h: 0 };\n if (startPoint.x < endPoint.x) {\n rect.x = startPoint.x;\n rect.w = endPoint.x - startPoint.x;\n }\n else {\n rect.x = endPoint.x;\n rect.w = startPoint.x - endPoint.x;\n }\n if (startPoint.y < endPoint.y) {\n rect.y = startPoint.y;\n rect.h = endPoint.y - startPoint.y;\n }\n else {\n rect.y = endPoint.y;\n rect.h = startPoint.y - endPoint.y;\n }\n return rect;\n }\n return rect;\n};\nexport const getRectFromSelection = ($state, startPoint, endPoint, page, padding = 1) => {\n if (page) {\n return getSelectionRectFromPage($state, startPoint, endPoint, page);\n }\n else {\n for (const pNr in $state.pageRects) {\n if ($state.pageRects) {\n const rect = getSelectionRectFromPage($state, startPoint, endPoint, parseInt(pNr, 10), padding);\n if (rect) {\n return rect;\n }\n }\n }\n }\n return null;\n};\n","export const state = {\n positionChanged: true,\n stateChanged: true,\n isDown: false,\n type: 'ontouchstart' in window ? 'touch' : 'mouse',\n action: null,\n x: { devicePixels: 0, cssPixels: 0 },\n y: { devicePixels: 0, cssPixels: 0 },\n};\nexport const actions = {\n setAction: (action) => ($state) => (Object.assign(Object.assign({}, $state), { action })),\n update: (payload) => ($state) => {\n const pixelRatio = window.devicePixelRatio;\n const newState = Object.assign({}, $state);\n newState.type = payload.type;\n if ($state.x.cssPixels !== payload.cssY || $state.x.cssPixels !== payload.cssX) {\n newState.x.cssPixels = payload.cssX;\n newState.x.devicePixels = payload.cssX * pixelRatio;\n newState.y.cssPixels = payload.cssY;\n newState.y.devicePixels = payload.cssY * pixelRatio;\n newState.positionChanged = true;\n }\n if ($state.isDown !== payload.isDown) {\n newState.isDown = payload.isDown;\n newState.stateChanged = true;\n }\n return newState;\n },\n};\n","export const state = {\n topPositionChanged: false,\n leftPositionChanged: false,\n top: { devicePixels: 0, cssPixels: 0 },\n left: { devicePixels: 0, cssPixels: 0 },\n};\nexport const actions = {\n scrollChanged: (payload) => ($state) => {\n const newState = Object.assign({}, $state);\n const pixelRatio = window.devicePixelRatio;\n if ($state.top.devicePixels !== payload.cssTop) {\n newState.top.cssPixels = payload.cssTop / pixelRatio;\n newState.top.devicePixels = payload.cssTop;\n newState.topPositionChanged = true;\n }\n if ($state.left.devicePixels !== payload.cssLeft) {\n newState.left.cssPixels = payload.cssLeft / pixelRatio;\n newState.left.devicePixels = payload.cssLeft;\n newState.leftPositionChanged = true;\n }\n return newState;\n },\n};\n","export const state = {\n searchString: '',\n caseSensitive: false,\n wrapSearch: false,\n useRegex: false,\n page: 1,\n match: null,\n painted: false,\n};\nexport const actions = {\n start: (payload) => ($state) => (Object.assign(Object.assign(Object.assign({}, $state), payload), { match: null, page: 1 })),\n updateMatch: (payload) => ($state) => (Object.assign(Object.assign(Object.assign({}, $state), payload), { painted: false })),\n matchPainted: () => ($state) => {\n return Object.assign(Object.assign({}, $state), { painted: true });\n },\n clear: () => ($state) => ({\n searchString: '',\n caseSensitive: false,\n wrapSearch: false,\n useRegex: false,\n page: 1,\n match: null,\n painted: false,\n }),\n};\n","import { appState } from './appState';\nimport * as Document from './document';\nimport * as Annotations from './annotations';\nimport * as Canvas from './canvas';\nimport * as Scroll from './scroll';\nimport * as Pointer from './pointer';\nimport * as Search from './search';\nimport * as Viewer from './viewer';\nexport const defaultState = {\n document: Document.state,\n annotations: Annotations.state,\n canvas: Canvas.state,\n scroll: Scroll.state,\n pointer: Pointer.state,\n startPointer: Pointer.state,\n search: Search.state,\n viewer: Viewer.state,\n};\nconst deepClone = (state) => {\n return JSON.parse(JSON.stringify(state));\n};\nconst resetSearchResults = (searchState) => {\n searchState.page = 1;\n searchState.match = null;\n return searchState;\n};\nexport const actions = {\n document: Document.actions,\n annotations: Annotations.actions,\n canvas: Canvas.actions,\n scroll: Scroll.actions,\n search: Search.actions,\n pointer: Pointer.actions,\n startPointer: Pointer.actions,\n viewer: Viewer.actions,\n getState: () => ($state) => $state,\n loadDefaultState: () => ($state) => {\n const newState = deepClone(defaultState);\n newState.viewer.contextBarItems = $state.viewer.contextBarItems;\n newState.search = resetSearchResults($state.search);\n return newState;\n },\n resetChangedState: () => ($state) => (Object.assign(Object.assign({}, $state), { changed: false, viewer: Object.assign(Object.assign({}, $state.viewer), { modeChanged: false, cursorStyleChanged: false, selectedAnnotationChanged: false, textSelectionChanged: false, selectedPopupChanged: false, command: null }), annotations: Object.assign(Object.assign({}, $state.annotations), { annotationsChanged: false, openPopupChanged: false }), document: Object.assign(Object.assign({}, $state.document), { busyStateChanged: false, heightChanged: false, widthChanged: false, firstVisiblePageChanged: false, lastVisiblePageChanged: false, rotationChanged: false, zoomChanged: false }), canvas: Object.assign(Object.assign({}, $state.canvas), { canvasInvalidated: false, heightChanged: false, widthChanged: false }), scroll: Object.assign(Object.assign({}, $state.scroll), { leftPositionChanged: false, topPositionChanged: false }), pointer: Object.assign(Object.assign({}, $state.pointer), { positionChanged: false, stateChanged: false, action: null }) })),\n};\nexport const createStore = () => {\n return appState(deepClone(defaultState), actions);\n};\n","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nexport var ViewerMode;\n(function (ViewerMode) {\n ViewerMode[ViewerMode[\"DEFAULT\"] = 0] = \"DEFAULT\";\n ViewerMode[ViewerMode[\"ANNOTATION_SELECTED\"] = 1] = \"ANNOTATION_SELECTED\";\n ViewerMode[ViewerMode[\"TEXT_SELECTED\"] = 2] = \"TEXT_SELECTED\";\n ViewerMode[ViewerMode[\"POPUP_SELECTED\"] = 3] = \"POPUP_SELECTED\";\n ViewerMode[ViewerMode[\"MODULE_SELECTED\"] = 4] = \"MODULE_SELECTED\";\n})(ViewerMode || (ViewerMode = {}));\nexport var CursorStyle;\n(function (CursorStyle) {\n CursorStyle[\"DEFAULT\"] = \"default\";\n CursorStyle[\"TEXT\"] = \"text\";\n CursorStyle[\"NONE\"] = \"none\";\n CursorStyle[\"POINTER\"] = \"pointer\";\n CursorStyle[\"CROSSHAIR\"] = \"crosshair\";\n CursorStyle[\"NOT_ALLOWED\"] = \"not-allowed\";\n CursorStyle[\"WAIT\"] = \"wait\";\n CursorStyle[\"MOVE\"] = \"move\";\n CursorStyle[\"GRAB\"] = \"grab\";\n CursorStyle[\"GRABBING\"] = \"grabbing\";\n CursorStyle[\"COL_RESIZE\"] = \"col-resize\";\n CursorStyle[\"ROW_RESIZE\"] = \"row-resize\";\n CursorStyle[\"NS_RESIZE\"] = \"ns-resize\";\n CursorStyle[\"EW_RESIZE\"] = \"ew-resize\";\n CursorStyle[\"NESW_RESIZE\"] = \"nesw-resize\";\n CursorStyle[\"NWSE_RESIZE\"] = \"nwse-resize\";\n CursorStyle[\"ERASE\"] = \"url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAADwQAAA8EB0Z6ZfgAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAM+SURBVEiJtZRbSBRRGMe/WTd3dmfmzOyZdcaVQlCsl3yK8lIqRAgFIbrubGa6D1IURQ8RhWgPQZC0RRQ99agPQXSDNCPEy67FCqZb6boma7Vq1w0zytvO7PTS0qZ7M+wPw8D3/+b/O+fMzEcEg0HV5/NBtPx+/2273W6D9ZDL5VIBIAwAi1HXkXUJBwDt7/sbAMhdr9BoaVJtbK6sPLwrP9/4XwBX7XbH6YqKG+erqjxHy8uFtQC0c3NzPQBwK17DzWPHzlsKCk5u0Gq1hXl5GwmCGJyX5aLW7u6ZVABEItNRV9dkLys7R5Hkhuj64OTkh3tOZ/G1rq5AMkBaPON6Q8OJ2pKSCzRJpq/0soxGRsC4xsRx9/vHxmbXDGiprT1uKy6+zOr1q8IjElmWZvX6GoamHw6Mj39NGXClvv7QwdLS60aK0iVaGQBAJsdRPEXZkF7f4Z6YCCYFNErSPntJSSumaTJZeBTEICJky+D5jn6v98tK/6/PVKeqwW/z80qq4RHlmM28YtrcZ7UeyV/p/bWDXq93RkSoLwOhap5hkh4RAMCyLMPVVx8VcaeN4hB7QKBRz+jY0PuYgN+QKTPLuniEqk1JIEuhEDhezISFAksaEAToWIE0Yl7KNtIuz8jQVExABCJynDMDIYuJYWK+j5CiQMvzd4pQZE0jNH9OOp0x6QwsL2VnsG7Py8G3cf8Dp9c7bca4Q0RIwgxjiPZkRYFLQ+8UoUhK02hWTxsdY0o3MNiSbebdcQEAAL2jo59Zmn6CaVoSWVYfCXcMTyl8YXXM8GgICcT+hAAAgKc+3ycBoUeYpiWeYQyXhwNhXJA4HABAXvyhwrSnPSkAAMDl832mSbL92XeN1bSzhtZoEj8mLy2oCyOPO5odjdUpAQAA3BMTQQpvahcwL5HGTCpenyovq6Hx7r6mljN7ARIMu1jy+0eCyIAeYA7ZSFZcBVEVWZ0dfDBw7tLZskgt4biOp117LDm7d1ucOHebOVILhxX4+aJzuPniqe0EQaiR+pp2EFFgcmxWWVq+I/LYasBZSFVV+OnpfLll0r1jqySFo3v/CQAAEAi8ngsvh+6KHFMZmvJMi7Pj2+1tbfLKvl/ycBilf3EZ0gAAAABJRU5ErkJggg=='), auto\";\n})(CursorStyle || (CursorStyle = {}));\nexport const state = {\n modeChanged: true,\n mode: ViewerMode.DEFAULT,\n selectedAnnotationId: null,\n selectedAnnotationBehaviors: null,\n selectedAnnotationChanged: true,\n textSelectionChanged: true,\n textSelection: null,\n textSelectionType: null,\n textSelectionState: null,\n textSelectionRects: null,\n selectedPopupId: null,\n selectedPopupChanged: true,\n popupFocus: null,\n selectedModuleName: null,\n cursorStyle: CursorStyle.DEFAULT,\n cursorStyleChanged: true,\n contextBarItems: [],\n};\nexport const actions = {\n setDefaultMode: () => ($state) => ({\n modeChanged: true,\n mode: ViewerMode.DEFAULT,\n selectedAnnotationId: null,\n selectedAnnotationBehaviors: null,\n selectedAnnotationChanged: true,\n textSelectionChanged: true,\n textSelection: null,\n selectedPopupId: null,\n selectedPopupChanged: true,\n selectedModuleName: null,\n cursorStyle: CursorStyle.DEFAULT,\n cursorStyleChanged: true,\n }),\n addContextBarItem: (contextBarItem) => ($state) => {\n const contextBarItems = $state.contextBarItems;\n contextBarItem.itemTypes.forEach((itemType) => {\n if (!contextBarItems[itemType]) {\n contextBarItems[itemType] = [];\n }\n contextBarItems[itemType].push(contextBarItem);\n });\n return Object.assign(Object.assign({}, $state), { contextBarItems });\n },\n clearContextBarItems: () => ($state) => (Object.assign(Object.assign({}, $state), { contextBarItems: [] })),\n setCursorStyle: (cursorStyle) => ($state) => (Object.assign(Object.assign({}, $state), { cursorStyle, cursorStyleChanged: $state.cursorStyle !== cursorStyle })),\n selectAnnotation: (annotation) => ($state) => (Object.assign(Object.assign({}, $state), { selectedAnnotationId: annotation.id, selectedAnnotationBehaviors: annotation.behaviors, selectedAnnotationChanged: true, selectedModuleName: null, selectedPopupId: null, modeChanged: true, mode: ViewerMode.ANNOTATION_SELECTED })),\n deselectAnnotation: () => ($state) => {\n const modeChanged = $state.mode === ViewerMode.ANNOTATION_SELECTED;\n return Object.assign(Object.assign({}, $state), { selectedAnnotationId: null, selectedAnnotationBehaviors: null, selectedModuleName: null, selectedAnnotationChanged: true, modeChanged, mode: modeChanged ? ViewerMode.DEFAULT : $state.mode });\n },\n beginModule: (moduleName) => ($state) => {\n return Object.assign(Object.assign({}, $state), { modeChanged: true, mode: ViewerMode.MODULE_SELECTED, selectedAnnotationId: null, selectedAnnotationBehaviors: null, selectedAnnotationChanged: true, textSelectionChanged: true, textSelection: null, selectedModuleName: moduleName, selectedPopupId: null, selectedPopupChanged: true });\n },\n endModule: (moduleName) => ($state) => {\n const selectedModuleName = $state.selectedModuleName === moduleName ? null : $state.selectedModuleName;\n const mode = selectedModuleName !== null ? ViewerMode.MODULE_SELECTED : ViewerMode.DEFAULT;\n return Object.assign(Object.assign({}, $state), { modeChanged: true, selectedModuleName,\n mode });\n },\n setTextSelectionState: (textSelectionState) => ($state) => {\n return Object.assign(Object.assign({}, $state), { textSelectionState });\n },\n setTextSelection: (args) => ($state) => {\n const { selection, type } = args;\n const mode = selection ? ViewerMode.TEXT_SELECTED : ViewerMode.DEFAULT;\n const modeChanged = $state.mode !== mode;\n const textSelectionRects = selection ? {} : null;\n if (selection && textSelectionRects) {\n const pageRects = {};\n selection.quadrilaterals.forEach((q) => {\n const { bottomLeft, bottomRight, topRight, topLeft, pageNumber } = q;\n if (!pageRects[pageNumber]) {\n pageRects[pageNumber] = {\n x1: Number.MAX_SAFE_INTEGER,\n y1: Number.MAX_SAFE_INTEGER,\n x2: Number.MIN_SAFE_INTEGER,\n y2: Number.MIN_SAFE_INTEGER,\n };\n }\n pageRects[pageNumber] = {\n x1: Math.min(pageRects[pageNumber].x1, bottomLeft.x, bottomRight.x, topRight.x, topLeft.x),\n y1: Math.min(pageRects[pageNumber].y1, bottomLeft.y, bottomRight.y, topRight.y, topLeft.y),\n x2: Math.max(pageRects[pageNumber].x2, bottomLeft.x, bottomRight.x, topRight.x, topLeft.x),\n y2: Math.max(pageRects[pageNumber].y2, bottomLeft.y, bottomRight.y, topRight.y, topLeft.y),\n };\n });\n Object.keys(pageRects).forEach((pageNumber) => {\n textSelectionRects[pageNumber] = {\n pdfX: pageRects[pageNumber].x1,\n pdfY: pageRects[pageNumber].y1,\n pdfW: pageRects[pageNumber].x2 - pageRects[pageNumber].x1,\n pdfH: pageRects[pageNumber].y2 - pageRects[pageNumber].y1,\n page: parseInt(pageNumber),\n };\n });\n }\n return Object.assign(Object.assign({}, $state), { mode,\n modeChanged, textSelectionChanged: true, textSelection: selection, textSelectionType: type, textSelectionRects });\n },\n selectPopup: (args) => ($state) => {\n const mode = args.id !== null ? ViewerMode.POPUP_SELECTED : ViewerMode.DEFAULT;\n const modeChanged = $state.mode !== mode;\n return Object.assign(Object.assign({}, $state), { mode,\n modeChanged, selectedPopupChanged: args.id !== $state.selectedPopupId, selectedPopupId: args.id, popupFocus: args.focus ? args.id : null });\n },\n clearPopupFocus: () => ($state) => {\n return Object.assign(Object.assign({}, $state), { popupFocus: null });\n },\n deselectPopup: () => ($state) => {\n const mode = ViewerMode.DEFAULT;\n const modeChanged = mode !== $state.mode;\n return Object.assign(Object.assign({}, $state), { mode,\n modeChanged });\n },\n};\nexport const copyTextToClipboard = (text) => __awaiter(void 0, void 0, void 0, function* () {\n try {\n yield navigator.clipboard.writeText(text);\n }\n catch (err) {\n var textArea = document.createElement('textarea');\n textArea.value = text;\n textArea.style.top = '0';\n textArea.style.left = '0';\n textArea.style.position = 'fixed';\n document.body.appendChild(textArea);\n textArea.focus();\n textArea.select();\n document.execCommand('copy');\n document.body.removeChild(textArea);\n }\n});\n","import { PdfItemType, PdfItemCategory, PdfPageLayoutMode, } from '../../pdf-viewer-api';\nimport { ViewLayerBase } from './ViewLayerBase';\nimport { ViewerMode, copyTextToClipboard, CursorStyle } from '../state/viewer';\nimport { createAnnotationContextBar } from './views/AnnotationContextBar';\nimport { AnnotationBorder } from './views/AnnotationBorder';\nimport { addHistoryEntry } from '../../custom/history';\nexport class AnnotationSelectionLayer extends ViewLayerBase {\n constructor() {\n super();\n this.context = null;\n this.selectedAnnotation = null;\n this.selectionElement = null;\n this.barAtTop = true;\n this.contextBar = null;\n this.annotationBorder = null;\n this.deleteAnnotation = this.deleteAnnotation.bind(this);\n this.rotateAnnotation = this.rotateAnnotation.bind(this);\n this.copyAnnotationText = this.copyAnnotationText.bind(this);\n this.createPopup = this.createPopup.bind(this);\n this.openPopup = this.openPopup.bind(this);\n this.deletePopup = this.deletePopup.bind(this);\n this.moveAnnotation = this.moveAnnotation.bind(this);\n this.toggleLock = this.toggleLock.bind(this);\n this.resizeAnnotation = this.resizeAnnotation.bind(this);\n this.onItemSelected = this.onItemSelected.bind(this);\n this.onItemDblClick = this.onItemDblClick.bind(this);\n }\n create() {\n var _a, _b;\n if (this.viewerCanvas) {\n this.viewerCanvas.addEventListener('itemSelected', this.onItemSelected);\n }\n this.selectAnnotation = this.selectAnnotation.bind(this);\n this.deselectAnnotation = this.deselectAnnotation.bind(this);\n this.deleteAnnotation = this.deleteAnnotation.bind(this);\n this.createPopup = this.createPopup.bind(this);\n this.deletePopup = this.deletePopup.bind(this);\n this.openPopup = this.openPopup.bind(this);\n this.context = this.createCanvas('pwv-annotation-selection-layers');\n this.context.canvas.style.display = 'none';\n this.selectionElement = this.createHtmlLayer();\n this.selectionElement.style.display = 'none';\n this.selectionElement.style.position = 'absolute';\n this.selectionElement.classList.add('pwv-annotation-selection');\n this.selectionElement.classList.add('pwv-contextbar-top');\n this.selectionElement.addEventListener('click', (e) => {\n e.preventDefault();\n e.cancelBubble = true;\n }, false);\n if ((_a = this.viewerCanvas) === null || _a === void 0 ? void 0 : _a.licenseFeatures.annotate) {\n this.contextBar = createAnnotationContextBar({\n allowCopyText: this.options.viewer.permissions.allowCopyText,\n allowLockAnnotations: this.options.viewer.permissions.allowLockAnnotations,\n allowEditLockedAnnotations: this.options.viewer.permissions.allowEditLockedAnnotations,\n onDeleteAnnotation: this.deleteAnnotation,\n onRotateAnnotation: this.rotateAnnotation,\n onCopy: this.copyAnnotationText,\n onCreatePopup: this.createPopup,\n onOpenPopup: this.openPopup,\n onDeletePopup: this.deletePopup,\n onToggleLock: this.toggleLock,\n }, this.selectionElement);\n }\n this.annotationBorder = new AnnotationBorder(this.selectionElement, this.moveAnnotation, this.resizeAnnotation, this.onItemDblClick, this.options, this.store, !((_b = this.viewerCanvas) === null || _b === void 0 ? void 0 : _b.licenseFeatures.annotate) || false);\n }\n render(timestamp, state) {\n const mode = state.viewer.mode;\n if (this.selectedAnnotation && mode !== ViewerMode.ANNOTATION_SELECTED) {\n this.deselectAnnotation();\n }\n const { pageLayoutMode } = state.document;\n if ((pageLayoutMode === PdfPageLayoutMode.SINGLE_PAGE ||\n pageLayoutMode === PdfPageLayoutMode.TWO_PAGE_LEFT ||\n pageLayoutMode === PdfPageLayoutMode.TWO_PAGE_RIGHT) &&\n this.selectedAnnotation &&\n state.document.firstVisiblePageChanged) {\n this.deselectAnnotation();\n this.store.canvas.setCanvasInvalidated(true);\n return false;\n }\n if ((state.pointer.action === 'click' || state.pointer.action === 'dblclick') &&\n (mode === ViewerMode.DEFAULT ||\n mode === ViewerMode.ANNOTATION_SELECTED ||\n mode === ViewerMode.POPUP_SELECTED)) {\n const annotationsOnPoint = this.pdfViewerApi.getAnnotationsOnPoint({\n x: state.pointer.x.devicePixels,\n y: state.pointer.y.devicePixels,\n });\n let breakRenderLoop = false;\n if (annotationsOnPoint && annotationsOnPoint.length) {\n for (let i = annotationsOnPoint.length - 1; i >= 0; i--) {\n const annotationOnPoint = annotationsOnPoint[i];\n if (annotationOnPoint.behaviors.selectable) {\n if (state.pointer.action === 'click') {\n if (annotationOnPoint.itemType === PdfItemType.WIDGET) {\n if (this.viewerCanvas && !annotationOnPoint.widget.readOnly) {\n this.viewerCanvas.activateModule('FormFieldModule', {\n annotationId: annotationOnPoint.id,\n action: 'click',\n });\n breakRenderLoop = true;\n break;\n }\n }\n else if (annotationOnPoint.id !== state.viewer.selectedAnnotationId) {\n if (state.viewer.selectedAnnotationId) {\n this.deselectAnnotation();\n }\n if (!annotationOnPoint.isHidden()) {\n this.selectAnnotation(annotationOnPoint);\n breakRenderLoop = true;\n break;\n }\n }\n }\n else if (state.pointer.action === 'dblclick') {\n this.onItemDblClick(annotationOnPoint.id);\n break;\n }\n }\n }\n }\n else if (state.viewer.selectedAnnotationId) {\n this.deselectAnnotation();\n breakRenderLoop = true;\n }\n if (breakRenderLoop) {\n this.store.canvas.setCanvasInvalidated(true);\n return false;\n }\n }\n if (mode === ViewerMode.ANNOTATION_SELECTED && state.viewer.selectedAnnotationId) {\n const annotation = state.annotations.all[state.viewer.selectedAnnotationId];\n if (this.selectedAnnotation === null) {\n this.selectAnnotation(annotation);\n }\n if (this.annotationBorder && state.canvas.canvasInvalidated) {\n const pageRect = state.document.pageRects[annotation.pdfRect.page];\n if (pageRect) {\n this.annotationBorder.updatePageRect(pageRect);\n }\n }\n if (state.viewer.selectedAnnotationChanged || state.canvas.canvasInvalidated) {\n this.updateSelectionElementPosition(annotation);\n }\n }\n }\n updateSelectionElementPosition(annotation) {\n if (this.selectionElement) {\n const rect = this.pdfViewerApi.transformPdfPageRectToScreenRect(annotation.pdfRect);\n const annotationY = rect.y / devicePixelRatio;\n const annotationX = rect.x / devicePixelRatio;\n const annotationW = rect.w / devicePixelRatio;\n const annotationH = rect.h / devicePixelRatio;\n const newBarAtTop = annotationY > 80;\n this.selectionElement.style.top = annotationY + 'px';\n this.selectionElement.style.left = annotationX + 'px';\n this.selectionElement.style.width = annotationW + 'px';\n this.selectionElement.style.height = annotationH + 'px';\n if (this.barAtTop !== newBarAtTop) {\n this.barAtTop = newBarAtTop;\n if (this.barAtTop) {\n this.selectionElement.classList.remove('pwv-contextbar-bottom');\n this.selectionElement.classList.add('pwv-contextbar-top');\n }\n else {\n this.selectionElement.classList.remove('pwv-contextbar-top');\n this.selectionElement.classList.add('pwv-contextbar-bottom');\n }\n }\n const contextbarElement = this.selectionElement.lastChild;\n if (contextbarElement && contextbarElement.nodeType === 1) {\n const state = this.store.getState();\n const canvasWidth = state.canvas.width.cssPixels;\n const barWidth = contextbarElement.offsetWidth;\n const barCenter = barWidth / 2;\n const padding = 4;\n let left = 0;\n if (barWidth > annotationW) {\n left = (barWidth - annotationW) / -2;\n }\n else {\n left = (annotationW - barWidth) / 2;\n }\n if (annotationX + left + padding < 0) {\n left = annotationX * -1 + padding;\n if (annotationX + annotationW < barCenter) {\n left = annotationW - barCenter;\n }\n }\n if (annotationX + left + barWidth + padding > canvasWidth) {\n left = canvasWidth - annotationX - barWidth - padding;\n if (left * -1 > barCenter) {\n left = barCenter * -1;\n }\n }\n contextbarElement.style.left = left + 'px';\n }\n }\n }\n selectAnnotation(annotation, preventEvent) {\n var _a, _b;\n if (this.selectionElement && this.context && this.annotationBorder) {\n this.selectedAnnotation = annotation;\n const pageRect = this.store.getState().document.pageRects[annotation.pdfRect.page];\n this.annotationBorder.deselectAnnotation();\n this.annotationBorder.setAnnotation(annotation, pageRect);\n const state = this.store.getState();\n if (((_a = this.viewerCanvas) === null || _a === void 0 ? void 0 : _a.licenseFeatures.annotate) && this.contextBar) {\n const commands = (_b = state.viewer.contextBarItems[annotation.itemType]) !== null && _b !== void 0 ? _b : [];\n this.contextBar.setAnnotation({ annotation, commands });\n }\n this.context.canvas.style.display = 'none';\n this.selectionElement.style.display = 'block';\n this.barAtTop = true;\n this.selectionElement.classList.remove('pwv-contextbar-bottom');\n this.selectionElement.classList.add('pwv-contextbar-top');\n this.updateSelectionElementPosition(annotation);\n this.store.viewer.selectAnnotation(annotation);\n this.store.viewer.setCursorStyle(CursorStyle.DEFAULT);\n if (this.viewerCanvas && !preventEvent) {\n this.dispatchEvent('itemSelected', annotation);\n }\n }\n }\n deselectAnnotation() {\n if (this.context && this.selectionElement && this.annotationBorder) {\n const annot = this.selectedAnnotation;\n this.selectedAnnotation = null;\n this.context.clearRect(0, 0, this.context.canvas.width, this.context.canvas.height);\n this.annotationBorder.deselectAnnotation();\n this.context.canvas.style.display = 'none';\n this.selectionElement.style.display = 'none';\n this.store.viewer.deselectAnnotation();\n if (this.viewerCanvas && annot !== null) {\n this.dispatchEvent('itemDeselected', annot);\n }\n }\n }\n rotateAnnotation(id) {\n if (this.pdfViewerApi) {\n const item = this.pdfViewerApi.getItem(id);\n item.rotation = (item.rotation + 90) % 360;\n this.pdfViewerApi.updateItem(item).then((item) => {\n if (this.annotationBorder) {\n const annotation = item;\n const pageRect = this.store.getState().document.pageRects[annotation.pdfRect.page];\n this.annotationBorder.setAnnotation(annotation, pageRect);\n }\n });\n }\n }\n moveAnnotation(id, point) {\n var _a;\n if (this.pdfViewerApi) {\n const item = this.pdfViewerApi.getItem(id);\n const newItemPos = this.pdfViewerApi.transformScreenPointToPdfPoint({\n x: point.x * window.devicePixelRatio,\n y: point.y * window.devicePixelRatio,\n }, item.page, true);\n if (newItemPos.pdfPoint.page === item.pdfRect.page) {\n switch (this.pdfViewerApi.getRotation()) {\n case 0:\n item.pdfRect.pdfX = newItemPos.pdfPoint.pdfX;\n item.pdfRect.pdfY = newItemPos.pdfPoint.pdfY;\n break;\n case 90:\n item.pdfRect.pdfX = newItemPos.pdfPoint.pdfX - item.pdfRect.pdfW;\n item.pdfRect.pdfY = newItemPos.pdfPoint.pdfY;\n break;\n case 180:\n item.pdfRect.pdfX = newItemPos.pdfPoint.pdfX - item.pdfRect.pdfW;\n item.pdfRect.pdfY = newItemPos.pdfPoint.pdfY - item.pdfRect.pdfH;\n break;\n case 270:\n item.pdfRect.pdfX = newItemPos.pdfPoint.pdfX;\n item.pdfRect.pdfY = newItemPos.pdfPoint.pdfY - item.pdfRect.pdfH;\n break;\n }\n }\n this.store.annotations.updateAnnotation(item);\n this.store.canvas.setCanvasInvalidated(true);\n if ((_a = this.viewerCanvas) === null || _a === void 0 ? void 0 : _a.licenseFeatures.annotate) {\n this.pdfViewerApi.updateItem(item);\n }\n }\n }\n resizeAnnotation(id, rect) {\n var _a;\n if (this.pdfViewerApi) {\n const item = this.pdfViewerApi.getItem(id);\n const newItemRect = this.pdfViewerApi.transformScreenRectToPdfRect({\n x: rect.x * window.devicePixelRatio,\n y: rect.y * window.devicePixelRatio,\n w: rect.w * window.devicePixelRatio,\n h: rect.h * window.devicePixelRatio,\n }, item.pdfRect.page);\n if (newItemRect.page === item.pdfRect.page) {\n item.pdfRect = newItemRect;\n }\n this.store.annotations.updateAnnotation(item);\n this.store.canvas.setCanvasInvalidated(true);\n if ((_a = this.viewerCanvas) === null || _a === void 0 ? void 0 : _a.licenseFeatures.annotate) {\n this.pdfViewerApi.updateItem(item);\n }\n }\n }\n copyAnnotationText(id) {\n if (this.pdfViewerApi) {\n const item = this.pdfViewerApi.getItem(id);\n if (item.itemType === PdfItemType.HIGHLIGHT ||\n item.itemType === PdfItemType.UNDERLINE ||\n item.itemType === PdfItemType.SQUIGGLY ||\n item.itemType === PdfItemType.STRIKE_OUT) {\n const quadPointAnnotation = item;\n const firstRect = quadPointAnnotation.quadrilaterals[0];\n const lastRect = quadPointAnnotation.quadrilaterals[quadPointAnnotation.quadrilaterals.length - 1];\n const startPoint = {\n pdfX: firstRect.topLeft.x,\n pdfY: firstRect.topLeft.y,\n page: firstRect.pageNumber,\n };\n const endPoint = {\n pdfX: lastRect.bottomRight.x,\n pdfY: lastRect.bottomRight.y,\n page: lastRect.pageNumber,\n };\n const text = this.pdfViewerApi.getText(startPoint, endPoint);\n copyTextToClipboard(text || '');\n }\n }\n }\n toggleLock(id) {\n var _a;\n if (((_a = this.viewerCanvas) === null || _a === void 0 ? void 0 : _a.licenseFeatures.annotate) && this.pdfViewerApi) {\n const annot = this.pdfViewerApi.getItem(id);\n if (this.options.annotation.trackHistory) {\n addHistoryEntry(annot, annot.isLocked() ? 'unlock' : 'lock', this.options.viewer.general.user);\n }\n annot.setLock(!annot.isLocked());\n if (this.annotationBorder) {\n this.annotationBorder.deselectAnnotation();\n const pageRect = this.store.getState().document.pageRects[annot.pdfRect.page];\n this.annotationBorder.setAnnotation(annot, pageRect);\n }\n this.store.annotations.updateAnnotation(annot);\n this.pdfViewerApi.updateItem(annot);\n }\n }\n deleteAnnotation(id) {\n var _a;\n if (((_a = this.viewerCanvas) === null || _a === void 0 ? void 0 : _a.licenseFeatures.annotate) && this.pdfViewerApi) {\n const item = this.pdfViewerApi.getItem(id);\n if (this.options.annotation.hideOnDelete) {\n item.setHidden(true);\n item.popup.isOpen = false;\n if (this.options.annotation.trackHistory) {\n addHistoryEntry(item, 'delete', this.options.viewer.general.user);\n }\n this.store.annotations.updateAnnotation(item);\n this.pdfViewerApi.updateItem(item);\n this.deselectAnnotation();\n }\n else {\n this.pdfViewerApi\n .deleteItem(item)\n .then(() => {\n this.deselectAnnotation();\n })\n .catch((error) => {\n console.error(error);\n });\n }\n }\n }\n deletePopup(id) {\n var _a;\n if (((_a = this.viewerCanvas) === null || _a === void 0 ? void 0 : _a.licenseFeatures.annotate) && this.pdfViewerApi) {\n const item = this.pdfViewerApi.getItem(id);\n item.content = null;\n item.popup.isOpen = false;\n this.store.annotations.updateAnnotation(item);\n this.store.canvas.setCanvasInvalidated(true);\n this.pdfViewerApi.updateItem(item);\n }\n }\n createPopup(id) {\n var _a;\n if (((_a = this.viewerCanvas) === null || _a === void 0 ? void 0 : _a.licenseFeatures.annotate) && this.pdfViewerApi) {\n const item = this.pdfViewerApi.getItem(id);\n item.content = '';\n item.popup.isOpen = true;\n item.popup.pdfRect.pdfX = item.pdfRect.pdfX;\n item.popup.pdfRect.pdfY = item.pdfRect.pdfY - (item.popup.pdfRect.pdfH + 10);\n this.store.annotations.updateAnnotation(item);\n this.store.canvas.setCanvasInvalidated(true);\n this.pdfViewerApi.updateItem(item).then(() => {\n this.store.viewer.selectPopup({ id: item.id, focus: true });\n });\n this.deselectAnnotation();\n }\n }\n openPopup(id) {\n var _a, _b;\n if (this.pdfViewerApi) {\n const item = this.pdfViewerApi.getItem(id);\n if (!((_a = this.viewerCanvas) === null || _a === void 0 ? void 0 : _a.licenseFeatures.annotate) && (!item.content || !item.content)) {\n return;\n }\n if (!item.popup) {\n return;\n }\n item.popup.isOpen = true;\n this.store.annotations.updateAnnotation(item);\n this.store.canvas.setCanvasInvalidated(true);\n if ((_b = this.viewerCanvas) === null || _b === void 0 ? void 0 : _b.licenseFeatures.annotate) {\n this.pdfViewerApi.updateItem(item).then(() => {\n this.store.viewer.selectPopup({ id: item.id, focus: true });\n });\n }\n else {\n this.deselectAnnotation();\n this.store.viewer.selectPopup({ id: item.id, focus: true });\n }\n }\n }\n onItemDblClick(id) {\n if (this.pdfViewerApi) {\n const item = this.pdfViewerApi.getItem(id);\n const { behaviors } = item;\n if (item.isHidden()) {\n return;\n }\n if (item.itemType === PdfItemType.FREE_TEXT && !item.isReadOnly() && !item.isLocked()) {\n if (this.viewerCanvas) {\n this.viewerCanvas.activateModule('FreetextAnnotationModule', item.id);\n }\n }\n else if (behaviors.canHavePopup && !item.isHidden()) {\n this.openPopup(id);\n }\n }\n }\n onItemSelected(item) {\n if (item.itemCategory === PdfItemCategory.ANNOTATION) {\n this.selectAnnotation(item, true);\n }\n }\n}\n","import { ViewLayerBase } from './ViewLayerBase';\nexport class BusyStateLayer extends ViewLayerBase {\n constructor() {\n super();\n }\n create() {\n this.busyStateView = this.createHtmlLayer();\n this.busyStateView.classList.add('pwv-BusyLoader');\n this.busyStateView.style.display = 'none';\n const ct = document.createElement('div');\n this.busyStateView.appendChild(ct);\n const rects = ['rect-1', 'rect-2', 'rect-3', 'rect-4', 'rect-5'];\n rects.forEach((rect) => {\n const rectElement = document.createElement('div');\n rectElement.classList.add(rect);\n ct.appendChild(rectElement);\n });\n }\n render(timestamp, state) {\n if (this.busyStateView && state.document.busyStateChanged) {\n this.busyStateView.style.display = state.document.busyState ? 'block' : 'none';\n }\n }\n}\n","import { PdfItemType, PdfActionType, } from '../../pdf-viewer-api';\nimport { ViewLayerBase } from './ViewLayerBase';\nimport { ViewerMode, CursorStyle } from '../state/viewer';\nimport { renderTextSelection } from './canvasShapes';\nexport class PdfDocumentLayer extends ViewLayerBase {\n constructor() {\n super();\n }\n create() {\n this.context = this.createCanvas();\n this.canvas = this.context.canvas;\n }\n render(timestamp, state) {\n if (this.pdfViewerApi) {\n const draw = state.canvas.canvasInvalidated ||\n state.canvas.widthChanged ||\n state.canvas.heightChanged ||\n state.viewer.modeChanged ||\n state.viewer.textSelectionChanged ||\n state.pointer.stateChanged ||\n !state.search.painted;\n const defaultState = state.viewer.mode === ViewerMode.DEFAULT;\n if (defaultState && (state.pointer.positionChanged || state.pointer.stateChanged)) {\n const pointerPos = {\n x: state.pointer.x.devicePixels,\n y: state.pointer.y.devicePixels,\n };\n const pointerPdfPos = this.pdfViewerApi.transformScreenPointToPdfPoint(pointerPos);\n this.store.viewer.setCursorStyle(CursorStyle.DEFAULT);\n if (pointerPdfPos.isOnPage) {\n const annotationsOnPoint = this.pdfViewerApi.getAnnotationsOnPoint(pointerPos);\n const annotationOnPoint = annotationsOnPoint\n ? annotationsOnPoint[annotationsOnPoint.length - 1]\n : null;\n if (annotationOnPoint) {\n const itemType = annotationOnPoint.itemType;\n if ((itemType === PdfItemType.HIGHLIGHT ||\n itemType === PdfItemType.SQUIGGLY ||\n itemType === PdfItemType.STRIKE_OUT) &&\n this.pdfViewerApi.getTextFragmentOnPoint(pointerPos) !== null) {\n this.store.viewer.setCursorStyle(CursorStyle.TEXT);\n }\n else if (itemType === PdfItemType.LINK) {\n const link = annotationOnPoint;\n if ((link.destination && link.actionType === PdfActionType.GO_TO) ||\n (link.uri &&\n link.actionType === PdfActionType.URI &&\n this.options.viewer.permissions.allowExternalLinks)) {\n this.store.viewer.setCursorStyle(CursorStyle.POINTER);\n }\n if (state.pointer.action === 'click') {\n if (link.destination && link.actionType === PdfActionType.GO_TO) {\n this.pdfViewerApi.goTo(link.destination);\n }\n else if (link.uri &&\n link.actionType === PdfActionType.URI &&\n this.options.viewer.permissions.allowExternalLinks) {\n window.open(link.uri, undefined, 'noreferrer');\n }\n }\n }\n }\n else {\n const textFragmentOnPoint = this.pdfViewerApi.getTextFragmentOnPoint(pointerPos);\n if (textFragmentOnPoint) {\n this.store.viewer.setCursorStyle(CursorStyle.TEXT);\n }\n }\n }\n }\n if (draw) {\n const ctx = this.context;\n ctx.save();\n const { pageShadow, currentPageShadow } = this.options.viewer.general;\n if (state.viewer.mode === ViewerMode.MODULE_SELECTED) {\n ctx.globalAlpha = 0.75;\n this.pdfViewerApi.renderCanvas(ctx, { pageShadow, currentPageShadow });\n ctx.globalAlpha = 1;\n ctx.fillStyle = 'rgb(255,255,255)';\n ctx.globalCompositeOperation = 'destination-over';\n for (const k in state.document.pageRects) {\n if (state.document.pageRects[k]) {\n const pageRect = state.document.pageRects[k];\n ctx.fillRect(pageRect.x, pageRect.y, pageRect.w, pageRect.h);\n }\n }\n }\n else {\n this.pdfViewerApi.renderCanvas(ctx, { pageShadow, currentPageShadow });\n }\n ctx.restore();\n if (state.search.match) {\n ctx.save();\n ctx.globalCompositeOperation = 'multiply';\n ctx.fillStyle = this.options.viewer.general.searchMatchColor;\n ctx.globalAlpha = 0.9;\n ctx.beginPath();\n state.search.match.forEach((match) => {\n if (match.pageNumber >= state.document.firstVisiblePage &&\n match.pageNumber <= state.document.lastVisiblePage) {\n const path = this.pdfViewerApi.transformQuadrilateralToViewport(match);\n for (let k = 0; k < path.length; k++) {\n const point = path[k];\n if (k === 0) {\n ctx.moveTo(point.x, point.y);\n }\n else {\n ctx.lineTo(point.x, point.y);\n }\n }\n }\n });\n ctx.closePath();\n ctx.fill();\n ctx.restore();\n }\n this.store.search.matchPainted();\n if (state.viewer.textSelection) {\n ctx.save();\n const selection = state.viewer.textSelection;\n const screenSelection = [];\n for (let i = 0; i < selection.quadrilaterals.length; i++) {\n const path = this.pdfViewerApi.transformQuadrilateralToViewport(selection.quadrilaterals[i]);\n screenSelection.push(path);\n }\n renderTextSelection(ctx, devicePixelRatio * state.document.zoom, this.options.viewer.general.textSelectionColor, screenSelection);\n ctx.restore();\n if (state.pointer.isDown &&\n state.viewer.textSelectionState === 'selecting' &&\n state.viewer.textSelectionType === 'rectangular') {\n const { textSelection } = state.viewer;\n const startPoint = this.pdfViewerApi.transformPdfPointToScreenPoint(textSelection.startPoint);\n const endPoint = this.pdfViewerApi.transformPdfPointToScreenPoint(textSelection.endPoint);\n ctx.save();\n const lineWidth = 2 * devicePixelRatio;\n ctx.lineWidth = lineWidth;\n ctx.setLineDash([lineWidth, lineWidth]);\n ctx.strokeStyle = this.options.viewer.general.textSelectionColor;\n ctx.strokeRect(startPoint.x, startPoint.y, endPoint.x - startPoint.x, endPoint.y - startPoint.y);\n ctx.restore();\n }\n }\n }\n }\n }\n}\n","import { ViewLayerBase } from './ViewLayerBase';\nimport { DragMoveHandler } from '../../common/DragMoveHandler';\nimport { ViewerMode } from '../state/viewer';\nexport class ScrollLayer extends ViewLayerBase {\n constructor() {\n super();\n this.horizontalScrollEnabled = false;\n this.horizontalScrollBarVisible = false;\n this.horizontalScrollRatio = 0;\n this.horizontalScrollBarSize = 0;\n this.horizontalScrollHandleSize = 0;\n this.horizontalScrollHandlePos = 0;\n this.horizontalScrollTimer = 0;\n this.horizontalScrollExpanded = false;\n this.verticalScrollEnabled = false;\n this.verticalScrollBarVisible = false;\n this.verticalScrollRatio = 0;\n this.verticalScrollBarSize = 0;\n this.verticalScrollHandleSize = 0;\n this.verticalScrollHandlePos = 0;\n this.verticalScrollTimer = 0;\n this.verticalScrollExpanded = false;\n this.canScrollDown = false;\n this.canScrollUp = false;\n this.canScrollRight = false;\n this.canScrollLeft = false;\n this.isTouchScrolling = false;\n this.recentTouchPos = [];\n this.touchScrollAxis = null;\n this.autoscrollLastTimestamp = 0;\n this.autoscrollDist = 0;\n this.autoscrollDistTime = 0;\n this.autoscrollDx = 0;\n this.startVerticalScroll = this.startVerticalScroll.bind(this);\n this.verticalScroll = this.verticalScroll.bind(this);\n this.endVerticalScroll = this.endVerticalScroll.bind(this);\n this.startHorizontalScroll = this.startHorizontalScroll.bind(this);\n this.horizontalScroll = this.horizontalScroll.bind(this);\n this.endHorizontalScroll = this.endHorizontalScroll.bind(this);\n this.horizontalScrollBar = document.createElement('div');\n this.horizontalScrollBar.style.display = 'none';\n this.horizontalScrollBar.classList.add('pwv-horizontal-scrollbar');\n this.horizontalScrollHandle = document.createElement('div');\n this.horizontalScrollHandle.classList.add('pwv-scrollbar-handle');\n this.horizontalScrollBar.appendChild(this.horizontalScrollHandle);\n this.verticalScrollBar = document.createElement('div');\n this.verticalScrollBar.style.display = 'none';\n this.verticalScrollBar.classList.add('pwv-vertical-scrollbar');\n this.verticalScrollHandle = document.createElement('div');\n this.verticalScrollHandle.classList.add('pwv-scrollbar-handle');\n this.verticalScrollBar.appendChild(this.verticalScrollHandle);\n new DragMoveHandler(this.verticalScrollHandle, this.startVerticalScroll, this.verticalScroll, this.endVerticalScroll);\n new DragMoveHandler(this.horizontalScrollHandle, this.startHorizontalScroll, this.horizontalScroll, this.endHorizontalScroll);\n }\n create() {\n this.htmlLayerElement = this.createHtmlLayer();\n this.htmlLayerElement.appendChild(this.horizontalScrollBar);\n this.htmlLayerElement.appendChild(this.verticalScrollBar);\n }\n render(timestamp, state) {\n const canvasHeight = state.canvas.height.cssPixels;\n const documentHeight = state.document.height.cssPixels;\n if (state.document.heightChanged || state.canvas.heightChanged) {\n this.verticalScrollEnabled = documentHeight > canvasHeight;\n if (this.verticalScrollEnabled !== this.verticalScrollBarVisible) {\n this.verticalScrollBar.style.display = this.verticalScrollEnabled ? 'block' : 'none';\n this.verticalScrollBarVisible = this.verticalScrollEnabled;\n }\n if (this.verticalScrollEnabled) {\n this.verticalScrollBarSize = this.verticalScrollBar.clientHeight;\n this.verticalScrollHandleSize = (this.verticalScrollBarSize * canvasHeight) / documentHeight;\n if (this.verticalScrollHandleSize < 50) {\n this.verticalScrollHandleSize = 50;\n }\n this.verticalScrollHandle.style.height = this.verticalScrollHandleSize + 'px';\n this.verticalScrollRatio =\n (this.verticalScrollBarSize - this.verticalScrollHandleSize) /\n (documentHeight - canvasHeight);\n }\n this.updateCanScrollVertical(state);\n }\n if (state.scroll.topPositionChanged) {\n this.verticalScrollHandlePos = state.scroll.top.cssPixels * this.verticalScrollRatio;\n this.verticalScrollHandle.style.top = this.verticalScrollHandlePos + 'px';\n if (this.verticalScrollTimer) {\n clearTimeout(this.verticalScrollTimer);\n }\n else {\n this.verticalScrollBar.classList.add('pwv-scrollbar-scrolling');\n }\n this.verticalScrollTimer = window.setTimeout(() => {\n this.verticalScrollTimer = 0;\n this.verticalScrollBar.classList.remove('pwv-scrollbar-scrolling');\n }, 500);\n this.updateCanScrollVertical(state);\n }\n const canvasWidth = state.canvas.width.cssPixels;\n const documentWidth = state.document.width.cssPixels;\n if (state.document.widthChanged || state.canvas.widthChanged) {\n this.horizontalScrollEnabled = documentWidth > canvasWidth;\n if (this.horizontalScrollEnabled !== this.horizontalScrollBarVisible) {\n this.horizontalScrollBar.style.display = this.horizontalScrollEnabled ? 'block' : 'none';\n this.horizontalScrollBarVisible = this.horizontalScrollEnabled;\n }\n if (this.horizontalScrollEnabled) {\n this.horizontalScrollBarSize = this.horizontalScrollBar.clientWidth;\n this.horizontalScrollHandleSize =\n (this.horizontalScrollBarSize * canvasWidth) / documentWidth;\n if (this.horizontalScrollHandleSize < 50) {\n this.horizontalScrollHandleSize = 50;\n }\n this.horizontalScrollHandle.style.width = this.horizontalScrollHandleSize + 'px';\n this.horizontalScrollRatio =\n (this.horizontalScrollBarSize - this.horizontalScrollHandleSize) /\n (documentWidth - canvasWidth);\n }\n this.updateCanScrollHorizontal(state);\n }\n if (state.scroll.leftPositionChanged) {\n this.horizontalScrollHandlePos = state.scroll.left.cssPixels * this.horizontalScrollRatio;\n this.horizontalScrollHandle.style.left = this.horizontalScrollHandlePos + 'px';\n if (this.horizontalScrollTimer) {\n clearTimeout(this.horizontalScrollTimer);\n }\n else {\n this.horizontalScrollBar.classList.add('pwv-scrollbar-scrolling');\n }\n this.horizontalScrollTimer = window.setTimeout(() => {\n this.horizontalScrollTimer = 0;\n this.horizontalScrollBar.classList.remove('pwv-scrollbar-scrolling');\n }, 500);\n this.updateCanScrollHorizontal(state);\n }\n if (state.pointer.positionChanged) {\n const pointerX = state.pointer.x.cssPixels;\n const pointerY = state.pointer.y.cssPixels;\n const xPos = canvasWidth - 40;\n const yPos = canvasHeight - 40;\n if (!this.verticalScrollExpanded && pointerX > xPos && pointerY < yPos) {\n this.verticalScrollBar.classList.add('pwv-scrollbar-hover');\n this.verticalScrollExpanded = true;\n }\n else if (this.verticalScrollExpanded && (pointerX < xPos || pointerY > yPos)) {\n this.verticalScrollBar.classList.remove('pwv-scrollbar-hover');\n this.verticalScrollExpanded = false;\n }\n if (!this.horizontalScrollExpanded && pointerY > yPos && pointerX < xPos) {\n this.horizontalScrollBar.classList.add('pwv-scrollbar-hover');\n this.horizontalScrollExpanded = true;\n }\n else if (this.horizontalScrollExpanded && (pointerY < yPos || pointerX > xPos)) {\n this.horizontalScrollBar.classList.remove('pwv-scrollbar-hover');\n this.horizontalScrollExpanded = false;\n }\n }\n const pointer = state.pointer;\n const touchScrollEnabled = pointer.type === 'touch' &&\n (state.viewer.mode === ViewerMode.DEFAULT ||\n state.viewer.mode === ViewerMode.ANNOTATION_SELECTED);\n if (touchScrollEnabled && this.viewerCanvas) {\n if (state.pointer.isDown) {\n if (!this.isTouchScrolling) {\n this.isTouchScrolling = true;\n this.autoscrollDx = 0;\n this.touchScrollAxis = null;\n this.recentTouchPos = [];\n this.recentTouchPos.unshift({\n x: pointer.x.cssPixels,\n y: pointer.y.cssPixels,\n time: timestamp,\n });\n }\n else if (pointer.positionChanged) {\n this.recentTouchPos.unshift({\n x: pointer.x.cssPixels,\n y: pointer.y.cssPixels,\n time: timestamp,\n });\n if (this.recentTouchPos.length > 3) {\n this.recentTouchPos.pop();\n }\n const diffX = this.recentTouchPos[1].x - this.recentTouchPos[0].x;\n const diffY = this.recentTouchPos[1].y - this.recentTouchPos[0].y;\n const diffXabs = Math.abs(diffX);\n const diffYabs = Math.abs(diffY);\n const scrollAxis = this.touchScrollAxis !== null\n ? this.touchScrollAxis\n : diffYabs > diffXabs\n ? 'y'\n : diffXabs > diffYabs\n ? 'x'\n : null;\n if (this.verticalScrollEnabled && scrollAxis === 'y') {\n if ((diffY > 0 && this.canScrollDown) || (diffY < 0 && this.canScrollUp)) {\n this.viewerCanvas.scrollDown(diffY);\n }\n }\n else if (this.horizontalScrollEnabled && this.touchScrollAxis === 'x') {\n if ((diffX > 0 && this.canScrollRight) || (diffX < 0 && this.canScrollLeft)) {\n this.viewerCanvas.scrollRight(diffX);\n }\n }\n if (this.touchScrollAxis === null && this.recentTouchPos.length >= 3) {\n this.touchScrollAxis = diffYabs > diffXabs ? 'y' : diffXabs > diffYabs ? 'x' : null;\n }\n }\n }\n else if (this.isTouchScrolling) {\n this.isTouchScrolling = false;\n if (this.touchScrollAxis === 'x') {\n this.autoscrollDist = this.recentTouchPos[2].x - this.recentTouchPos[0].x;\n this.autoscrollDistTime = this.recentTouchPos[0].time - this.recentTouchPos[2].time;\n this.autoscrollDx = Math.abs(this.autoscrollDist / this.autoscrollDistTime);\n this.autoscrollLastTimestamp = timestamp;\n }\n else if (this.touchScrollAxis === 'y') {\n this.autoscrollDist = this.recentTouchPos[2].y - this.recentTouchPos[0].y;\n this.autoscrollDistTime = this.recentTouchPos[0].time - this.recentTouchPos[2].time;\n this.autoscrollDx = Math.abs(this.autoscrollDist / this.autoscrollDistTime);\n this.autoscrollLastTimestamp = timestamp;\n }\n }\n }\n if (this.viewerCanvas && this.autoscrollDx !== 0) {\n const time = timestamp - this.autoscrollLastTimestamp;\n if (time > 1000 / 70) {\n if (this.autoscrollDx > 3) {\n this.autoscrollDx = 3;\n }\n if (this.touchScrollAxis === 'y' &&\n ((this.autoscrollDist > 0 && !this.canScrollDown) ||\n (this.autoscrollDist < 0 && !this.canScrollUp))) {\n this.autoscrollDx = 0;\n }\n else if (this.touchScrollAxis === 'x' &&\n ((this.autoscrollDist > 0 && !this.canScrollRight) ||\n (this.autoscrollDist < 0 && !this.canScrollLeft))) {\n this.autoscrollDx = 0;\n }\n else {\n const direction = Math.sign(this.autoscrollDist);\n const distance = Math.abs(this.autoscrollDist);\n const timeFactor = time / this.autoscrollDistTime;\n const diff = Math.min(100, distance * this.autoscrollDx) * timeFactor;\n const scrollDiff = diff * direction;\n if (Math.abs(scrollDiff) < 1) {\n this.autoscrollDx = 0;\n }\n else {\n if (this.touchScrollAxis === 'y') {\n this.viewerCanvas.scrollDown(scrollDiff);\n }\n else {\n this.viewerCanvas.scrollRight(scrollDiff);\n }\n }\n const throttleDiff = this.autoscrollDx * 0.08 * timeFactor;\n this.autoscrollDx = this.autoscrollDx - throttleDiff;\n this.autoscrollLastTimestamp = timestamp;\n }\n }\n }\n }\n updateCanScrollVertical(state) {\n this.canScrollUp = state.scroll.top.cssPixels > 0;\n this.canScrollDown =\n state.scroll.top.cssPixels + state.canvas.height.cssPixels <\n state.document.height.cssPixels - 1;\n }\n updateCanScrollHorizontal(state) {\n this.canScrollLeft = state.scroll.left.cssPixels > 0;\n this.canScrollRight =\n state.scroll.left.cssPixels + state.canvas.width.cssPixels <\n state.document.width.cssPixels - 1;\n }\n startVerticalScroll(e) {\n this.verticalScrollBar.classList.add('pwv-scrollbar-dragging');\n }\n verticalScroll(e) {\n if (this.viewerCanvas) {\n const scrollDiv = e.movementY / this.verticalScrollRatio;\n this.viewerCanvas.scrollDown(scrollDiv);\n }\n }\n endVerticalScroll(e) {\n this.verticalScrollBar.classList.remove('pwv-scrollbar-dragging');\n }\n startHorizontalScroll(e) {\n this.horizontalScrollBar.classList.add('pwv-scrollbar-dragging');\n }\n horizontalScroll(e) {\n if (this.viewerCanvas) {\n const scrollDiv = e.movementX / this.horizontalScrollRatio;\n this.viewerCanvas.scrollRight(scrollDiv);\n }\n }\n endHorizontalScroll(e) {\n this.horizontalScrollBar.classList.remove('pwv-scrollbar-dragging');\n }\n}\n","import { ViewLayerBase } from './ViewLayerBase';\nimport { PdfItemType, } from '../../pdf-viewer-api';\nimport { createTextSelectionContextBar } from './views/TextSelectionContextBar';\nimport { Color } from '../../common/Color';\nimport { ViewerMode, CursorStyle, copyTextToClipboard } from '../state/viewer';\nimport { addHistoryEntry } from '../../custom/history';\nexport class TextSelectionLayer extends ViewLayerBase {\n constructor() {\n super();\n this.startPoint = null;\n this.selecting = false;\n this.contextBarElement = null;\n this.selectionType = null;\n this.createAnnotation = this.createAnnotation.bind(this);\n this.copyTextSelection = this.copyTextSelection.bind(this);\n }\n create() { }\n render(timestamp, state) {\n var _a;\n if (state.viewer.mode !== ViewerMode.TEXT_SELECTED) {\n if (this.contextBarElement) {\n this.removeHtmlElements();\n this.contextBarElement = null;\n }\n }\n if (state.viewer.mode === ViewerMode.MODULE_SELECTED) {\n return;\n }\n let updateContextBarPos = true;\n if (state.pointer.action === 'click') {\n this.endSelection();\n }\n else if (state.pointer.action === 'dblclick') {\n const clickPos = this.pdfViewerApi.transformScreenPointToPdfPoint({\n x: state.pointer.x.devicePixels,\n y: state.pointer.y.devicePixels,\n });\n const wordSelection = this.pdfViewerApi.getWordOnPoint(clickPos.pdfPoint);\n this.store.viewer.setTextSelection({ selection: wordSelection, type: 'normal' });\n this.selectionCreated();\n }\n else if (state.viewer.mode === ViewerMode.DEFAULT &&\n !this.selecting &&\n ((state.pointer.type === 'mouse' && state.pointer.action === 'startdrag') ||\n state.pointer.action === 'longpress')) {\n const screenPos = {\n x: state.startPointer.x.devicePixels,\n y: state.startPointer.y.devicePixels,\n };\n const startPos = this.pdfViewerApi.transformScreenPointToPdfPoint(screenPos);\n const textOnPoint = this.pdfViewerApi.getTextFragmentOnPoint(screenPos);\n if (this.options.viewer.general.rectangularTextSelection === 'automatic') {\n this.selectionType = textOnPoint ? 'normal' : 'rectangular';\n this.startSelection(startPos.pdfPoint);\n }\n else {\n if (textOnPoint) {\n this.startSelection(startPos.pdfPoint);\n }\n }\n }\n else if (this.selecting) {\n if (state.pointer.isDown) {\n if (state.pointer.positionChanged) {\n const mousePos = this.pdfViewerApi.getClosestPointOnPdfByScreenPoint({\n x: state.pointer.x.devicePixels,\n y: state.pointer.y.devicePixels,\n });\n if (this.startPoint) {\n const textSelection = this.selectionType === 'rectangular'\n ? this.pdfViewerApi.getRectangularTextSelection(this.startPoint, mousePos)\n : this.pdfViewerApi.getTextSelection(this.startPoint, mousePos);\n this.store.viewer.setTextSelection({\n selection: textSelection,\n type: this.selectionType,\n });\n this.store.viewer.setTextSelectionState('selecting');\n }\n }\n }\n else {\n if ((_a = state.viewer.textSelection) === null || _a === void 0 ? void 0 : _a.quadrilaterals.length) {\n this.selectionCreated();\n }\n else {\n this.endSelection();\n }\n }\n }\n if (this.selecting && state.pointer.y.devicePixels > -1) {\n const padding = 30;\n const dxScroll = 20;\n if (state.pointer.y.devicePixels > state.canvas.height.devicePixels - padding) {\n this.pdfViewerApi.setScrollPosition({\n x: state.scroll.left.devicePixels,\n y: state.scroll.top.devicePixels + dxScroll,\n });\n }\n else if (state.pointer.y.devicePixels < padding) {\n this.pdfViewerApi.setScrollPosition({\n x: state.scroll.left.devicePixels,\n y: state.scroll.top.devicePixels - dxScroll,\n });\n }\n else if (state.pointer.x.devicePixels > state.canvas.width.devicePixels - padding) {\n this.pdfViewerApi.setScrollPosition({\n x: state.scroll.left.devicePixels + dxScroll,\n y: state.scroll.top.devicePixels,\n });\n }\n else if (state.pointer.x.devicePixels < padding) {\n this.pdfViewerApi.setScrollPosition({\n x: state.scroll.left.devicePixels - dxScroll,\n y: state.scroll.top.devicePixels,\n });\n }\n }\n if (updateContextBarPos && this.contextBarElement && state.viewer.textSelectionRects) {\n const padding = 25;\n let barTopPos = padding;\n let barLeftPos = 0;\n let isTopPos = false;\n let isBottomPos = false;\n let screenRect = null;\n const { firstVisiblePage, lastVisiblePage } = state.document;\n Object.keys(state.viewer.textSelectionRects).forEach((page) => {\n const pageNumber = parseInt(page);\n if (pageNumber >= firstVisiblePage && pageNumber <= lastVisiblePage) {\n if (state.viewer.textSelectionRects) {\n const pageScreenRect = this.pdfViewerApi.transformPdfPageRectToScreenRect(state.viewer.textSelectionRects[page]);\n if (pageScreenRect) {\n screenRect = {\n x1: pageScreenRect.x / devicePixelRatio,\n y1: pageScreenRect.y / devicePixelRatio,\n x2: pageScreenRect.x / devicePixelRatio + pageScreenRect.w / devicePixelRatio,\n y2: pageScreenRect.y / devicePixelRatio + pageScreenRect.h / devicePixelRatio,\n };\n }\n }\n }\n });\n if (screenRect) {\n const { x1, y1, x2, y2 } = screenRect;\n if (y1 > 90) {\n barTopPos = y1 - 65;\n isTopPos = true;\n }\n else if (state.canvas.height.cssPixels / 2 > y2) {\n barTopPos = y2 + 15;\n isBottomPos = true;\n }\n const barWidth = this.contextBarElement.clientWidth;\n barLeftPos = x1 + (x2 - x1 - barWidth) / 2;\n if (barLeftPos < 0) {\n barLeftPos = 0;\n }\n }\n else {\n barTopPos = -90;\n }\n this.contextBarElement.style.top = barTopPos + 'px';\n this.contextBarElement.style.left = barLeftPos + 'px';\n if (isTopPos) {\n this.contextBarElement.classList.add('pwv-contextbar-top');\n }\n else {\n this.contextBarElement.classList.remove('pwv-contextbar-top');\n }\n if (isBottomPos) {\n this.contextBarElement.classList.add('pwv-contextbar-bottom');\n }\n else {\n this.contextBarElement.classList.remove('pwv-contextbar-bottom');\n }\n }\n }\n clearSelection() {\n this.endSelection();\n }\n clearHtmlDocumentSelection() {\n const documentSelection = document.getSelection();\n if (documentSelection) {\n documentSelection.empty();\n }\n }\n startSelection(startPoint) {\n this.clearHtmlDocumentSelection();\n this.removeHtmlElements();\n this.contextBarElement = null;\n this.selecting = true;\n if (this.startPoint === null) {\n this.startPoint = startPoint;\n }\n this.store.viewer.setCursorStyle(CursorStyle.TEXT);\n }\n endSelection() {\n this.removeHtmlElements();\n this.contextBarElement = null;\n this.selecting = false;\n this.startPoint = null;\n this.clearHtmlDocumentSelection();\n window.setTimeout(() => {\n this.selectionType = null;\n this.store.viewer.setTextSelection({ selection: null, type: null });\n this.store.viewer.setTextSelectionState(null);\n }, 50);\n }\n selectionCreated() {\n var _a;\n this.selecting = false;\n if (this.contextBarElement) {\n this.removeHtmlElements();\n }\n this.store.viewer.setCursorStyle(CursorStyle.DEFAULT);\n this.store.viewer.setTextSelectionState('textSelected');\n const isViewOnly = !((_a = this.viewerCanvas) === null || _a === void 0 ? void 0 : _a.licenseFeatures.annotate);\n const allowCopyText = this.options.viewer.permissions.allowCopyText;\n if (isViewOnly && !allowCopyText) {\n return;\n }\n this.contextBarElement = this.createHtmlLayer();\n this.contextBarElement.classList.add('pwv-textselection-contextbar');\n this.contextBarElement.classList.add('pwv-contextbar-top');\n createTextSelectionContextBar({\n highlightColors: this.options.annotation.colors.highlightColors,\n onCreateAnnotation: this.createAnnotation,\n onCopyText: this.copyTextSelection,\n isViewOnly,\n allowCopyText,\n }, this.contextBarElement);\n this.viewerCanvas.onTextSelected();\n }\n createAnnotation(itemType, color) {\n if (this.pdfViewerApi && this.store) {\n const selection = this.store.getState().viewer.textSelection;\n if (selection) {\n const selectionByPage = [];\n for (let i = 0; i < selection.quadrilaterals.length; i++) {\n const quadrilateral = selection.quadrilaterals[i];\n if (!selectionByPage[quadrilateral.pageNumber]) {\n selectionByPage[quadrilateral.pageNumber] = [];\n }\n selectionByPage[quadrilateral.pageNumber].push(quadrilateral);\n }\n if (itemType === PdfItemType.HIGHLIGHT) {\n const colorObj = new Color(color);\n colorObj.setOpacity(this.options.annotation.highlightOpacity);\n color = colorObj.toRgba();\n }\n for (let i = 0; i < selectionByPage.length; i++) {\n if (selectionByPage[i]) {\n const quadrilaterals = selectionByPage[i];\n const args = {\n itemType,\n page: i,\n pdfRect: {\n pdfX: 0,\n pdfY: 0,\n pdfW: 0,\n pdfH: 0,\n page: i,\n },\n color,\n author: this.options.viewer.general.user,\n quadrilaterals,\n };\n this.pdfViewerApi.createItem(args).then((annotation) => {\n if (this.options.annotation.trackHistory) {\n addHistoryEntry(annotation, 'create', this.options.viewer.general.user);\n this.pdfViewerApi.updateItem(annotation);\n }\n });\n this.endSelection();\n }\n }\n }\n }\n }\n copyTextSelection() {\n var _a;\n const selectedText = (_a = this.viewerCanvas) === null || _a === void 0 ? void 0 : _a.getSelectedText();\n copyTextToClipboard(selectedText || '');\n }\n}\n","import { addHistoryEntry } from '../../custom/history';\nexport class ViewLayerBase {\n constructor() {\n this.canvasContexts = [];\n this.htmlLayers = [];\n }\n get pdfViewerApi() {\n if (!this.pPdfViewerApi) {\n this.pPdfViewerApi = this.viewerCanvas.pdfViewerApi;\n if (!this.pPdfViewerApi) {\n throw new Error('pdfViewerApi in undefined');\n }\n }\n return this.pPdfViewerApi;\n }\n get store() {\n if (!this.pStore) {\n this.pStore = this.viewerCanvas.store;\n if (!this.pStore) {\n throw new Error('pStore in undefined');\n }\n }\n return this.pStore;\n }\n get options() {\n if (!this.pOptions) {\n this.pOptions = this.viewerCanvas.options;\n if (!this.pOptions) {\n throw new Error('options in undefined');\n }\n }\n return this.pOptions;\n }\n resize(width, height, pixelRatio) {\n try {\n const tempCanvas = document.createElement('canvas');\n tempCanvas.width = width * pixelRatio;\n tempCanvas.height = height * pixelRatio;\n const tempContext = tempCanvas.getContext('2d');\n this.canvasContexts.forEach((ctx) => {\n tempContext.drawImage(ctx.canvas, 0, 0);\n ctx.canvas.style.width = width + 'px';\n ctx.canvas.style.height = height + 'px';\n ctx.canvas.width = width * pixelRatio;\n ctx.canvas.height = height * pixelRatio;\n ctx.drawImage(tempContext.canvas, 0, 0);\n });\n }\n catch (err) {\n console.warn(err);\n }\n }\n register(viewerCanvas, dispatchEvent) {\n this.viewerCanvas = viewerCanvas;\n this.dispatchEvent = dispatchEvent;\n this.containerElement = this.viewerCanvas.viewLayersElement;\n this.create();\n }\n createHtmlLayer() {\n const element = document.createElement('div');\n this.htmlLayers.push(element);\n if (this.containerElement) {\n this.containerElement.appendChild(element);\n }\n return element;\n }\n createCanvas(className) {\n const element = document.createElement('canvas');\n element.style.position = 'absolute';\n element.style.top = '0';\n element.style.left = '0';\n element.style.right = '0';\n element.style.bottom = '0';\n if (className) {\n element.classList.add(className);\n }\n const context = element.getContext('2d');\n this.canvasContexts.push(context);\n if (this.containerElement) {\n this.containerElement.appendChild(element);\n const rect = this.containerElement.getBoundingClientRect();\n context.canvas.width = rect.width * devicePixelRatio;\n context.canvas.height = rect.height * devicePixelRatio;\n }\n return context;\n }\n removeHtmlElements() {\n if (this.containerElement) {\n for (let i = 0; i < this.htmlLayers.length; i++) {\n this.containerElement.removeChild(this.htmlLayers[i]);\n }\n this.htmlLayers = [];\n }\n }\n removeCanvasElements() {\n if (this.containerElement) {\n for (let i = 0; i < this.canvasContexts.length; i++) {\n this.containerElement.removeChild(this.canvasContexts[i].canvas);\n }\n this.canvasContexts = [];\n }\n }\n addDeleteHistory(annotation) {\n addHistoryEntry(annotation, 'delete', this.options.viewer.general.user);\n }\n}\n","export const renderAnnotationSelection = (ctx, scale, color, rect, resizable) => {\n const handle = 10 * scale;\n const handleOffset = handle / 2;\n const padding = 4 * scale;\n const x = rect.x - padding;\n const y = rect.y - padding;\n const w = rect.w + 2 * padding;\n const h = rect.h + 2 * padding;\n ctx.lineWidth = 2 * scale;\n ctx.strokeStyle = color;\n ctx.fillStyle = color;\n if (resizable) {\n const x1 = x - handleOffset;\n const x2 = x1 + w;\n const y1 = y - handleOffset;\n const y2 = y1 + h;\n ctx.fillRect(x1, y1, handle, handle);\n ctx.fillRect(x1, y2, handle, handle);\n ctx.fillRect(x2, y1, handle, handle);\n ctx.fillRect(x2, y2, handle, handle);\n }\n ctx.strokeRect(x, y, w, h);\n};\nexport const renderTextMarker = (ctx, scale, type, color, rect) => {\n ctx.save();\n const startType = type === 'start';\n const lineWidth = 2 * scale;\n const p = 3 * scale;\n const x = startType ? rect.x - lineWidth / 2 : rect.x + rect.w + lineWidth / 2;\n const y1 = startType ? rect.y - p : rect.y + rect.h + p;\n const y2 = startType ? rect.y + rect.h : rect.y;\n ctx.strokeStyle = color;\n ctx.fillStyle = color;\n ctx.lineWidth = lineWidth;\n ctx.globalAlpha = 0.8;\n ctx.beginPath();\n ctx.moveTo(x, y1);\n ctx.lineTo(x, y2);\n ctx.closePath();\n ctx.stroke();\n ctx.restore();\n};\nexport const renderTextSelection = (ctx, scale, color, selection) => {\n ctx.save();\n ctx.globalCompositeOperation = 'multiply';\n ctx.globalAlpha = 0.3;\n ctx.fillStyle = color;\n if (selection.length) {\n ctx.beginPath();\n for (let i = 0; i < selection.length; i++) {\n const path = selection[i];\n for (let k = 0; k < path.length; k++) {\n const point = path[k];\n if (k === 0) {\n ctx.moveTo(point.x, point.y);\n }\n else {\n ctx.lineTo(point.x, point.y);\n }\n }\n }\n ctx.closePath();\n ctx.fill();\n }\n ctx.restore();\n};\nexport const renderPopupMarker = (ctx, scale, color, pos) => {\n const posX = pos.x;\n const posY = pos.y;\n ctx.beginPath();\n ctx.moveTo(posX - 5 * scale, posY - 5 * scale);\n ctx.lineTo(posX + 6 * scale, posY - 5 * scale);\n ctx.lineTo(posX + 6 * scale, posY + 3 * scale);\n ctx.lineTo(posX + 3 * scale, posY + 3 * scale);\n ctx.lineTo(posX, posY + 6 * scale);\n ctx.lineTo(posX - 3 * scale, posY + 3 * scale);\n ctx.lineTo(posX - 5 * scale, posY + 3 * scale);\n ctx.closePath();\n ctx.stroke();\n ctx.globalAlpha = 0.5;\n ctx.fillStyle = color;\n ctx.fill();\n ctx.globalAlpha = 1;\n};\nexport const renderStickyNote = (ctx, scale, rect, fillColor, strokeColor) => {\n const w = rect.w;\n const h1 = rect.h * 0.8;\n const h2 = rect.h;\n const r = rect.w / 6;\n const s = rect.w / 10;\n const x1 = rect.x;\n const y1 = rect.y;\n const x1r = x1 + r;\n const y1r = y1 + r;\n const x2 = x1 + w;\n const y2 = y1 + h1;\n const x2r = x2 - r;\n const y2r = y2 - r;\n const xs1 = x1r + r;\n const xs2 = xs1 + r;\n const xs3 = x1r + s;\n const ys3 = y1 + h2;\n ctx.beginPath();\n ctx.moveTo(x1r, y1);\n ctx.lineTo(x2r, y1);\n ctx.arcTo(x2, y1, x2, y1r, r);\n ctx.lineTo(x2, y2r);\n ctx.arcTo(x2, y2, x2r, y2, r);\n ctx.lineTo(xs2, y2);\n ctx.lineTo(xs3, ys3);\n ctx.lineTo(xs1, y2);\n ctx.lineTo(x1r, y2);\n ctx.arcTo(x1, y2, x1, y2r, r);\n ctx.lineTo(x1, y1r);\n ctx.arcTo(x1, y1, x1r, y1, r);\n ctx.closePath();\n ctx.lineWidth = 0.75 * scale;\n ctx.fillStyle = fillColor;\n ctx.strokeStyle = strokeColor;\n ctx.fill();\n ctx.stroke();\n const x1l = x1r + 1 * scale;\n const x2l = x2r - 1 * scale;\n const x3l = x2r - r;\n const y1l = y1r + 1 * scale;\n const y3l = y2r - 1 * scale;\n const y2l = y1l + (y3l - y1l) / 2;\n ctx.beginPath();\n ctx.moveTo(x1l, y1l);\n ctx.lineTo(x2l, y1l);\n ctx.closePath();\n ctx.stroke();\n ctx.beginPath();\n ctx.moveTo(x1l, y2l);\n ctx.lineTo(x2l, y2l);\n ctx.closePath();\n ctx.stroke();\n ctx.beginPath();\n ctx.moveTo(x1l, y3l);\n ctx.lineTo(x3l, y3l);\n ctx.closePath();\n ctx.stroke();\n};\n","import { DragMoveHandler } from '../../../common/DragMoveHandler';\nvar ResizeDir;\n(function (ResizeDir) {\n ResizeDir[ResizeDir[\"NW\"] = 1] = \"NW\";\n ResizeDir[ResizeDir[\"NE\"] = 2] = \"NE\";\n ResizeDir[ResizeDir[\"SW\"] = 3] = \"SW\";\n ResizeDir[ResizeDir[\"SE\"] = 4] = \"SE\";\n})(ResizeDir || (ResizeDir = {}));\nexport const MIN_SIZE = 10;\nexport class AnnotationBorder {\n constructor(element, onMoved, onResized, onDblClick, options, store, isViewOnly) {\n this.annotationId = null;\n this.movable = false;\n this.resizable = false;\n this.aspectRatio = null;\n this.pageRect = null;\n this.dragOffsetX = 0;\n this.dragOffsetY = 0;\n this.containerOffsetX = 0;\n this.containerOffsetY = 0;\n this.resizeDir = null;\n this.minSize = MIN_SIZE;\n this.startMove = this.startMove.bind(this);\n this.moving = this.moving.bind(this);\n this.endMove = this.endMove.bind(this);\n this.click = this.click.bind(this);\n this.dblClick = this.dblClick.bind(this);\n this.setAnnotation = this.setAnnotation.bind(this);\n this.deselectAnnotation = this.deselectAnnotation.bind(this);\n this.startResize = this.startResize.bind(this);\n this.resizing = this.resizing.bind(this);\n this.resizeNoAspectRatio = this.resizeNoAspectRatio.bind(this);\n this.resizeWithAspectRatio = this.resizeWithAspectRatio.bind(this);\n this.endResize = this.endResize.bind(this);\n this.dragElement = document.createElement('div');\n this.border = document.createElement('div');\n this.resizeElementNw = document.createElement('div');\n this.resizeElementNe = document.createElement('div');\n this.resizeElementSw = document.createElement('div');\n this.resizeElementSe = document.createElement('div');\n this.isViewOnly = isViewOnly;\n this.onMoved = onMoved;\n this.onResized = onResized;\n this.onDblClick = onDblClick;\n this.element = element;\n this.options = options;\n this.store = store;\n this.element.appendChild(this.dragElement);\n this.dragElement.classList.add('pwv-annotation-border-draghandle');\n this.dragElement.style.display = 'none';\n this.dragHandler = new DragMoveHandler(this.dragElement, this.startMove, this.moving, this.endMove, this.click, this.dblClick);\n this.dragHandler.suspend();\n this.element.appendChild(this.border);\n this.border.classList.add('pwv-annotation-border');\n this.element.appendChild(this.resizeElementNw);\n this.resizeElementNw.classList.add('pwv-annotation-border-resizehandle-nw');\n this.resizeElementNw.style.display = 'none';\n this.resizeHandlerNw = new DragMoveHandler(this.resizeElementNw, this.startResize, this.resizing, this.endResize);\n this.resizeHandlerNw.suspend();\n this.element.appendChild(this.resizeElementNe);\n this.resizeElementNe.classList.add('pwv-annotation-border-resizehandle-ne');\n this.resizeElementNe.style.display = 'none';\n this.resizeHandlerNe = new DragMoveHandler(this.resizeElementNe, this.startResize, this.resizing, this.endResize);\n this.resizeHandlerNe.suspend();\n this.element.appendChild(this.resizeElementSw);\n this.resizeElementSw.classList.add('pwv-annotation-border-resizehandle-sw');\n this.resizeElementSw.style.display = 'none';\n this.resizeHandlerSw = new DragMoveHandler(this.resizeElementSw, this.startResize, this.resizing, this.endResize);\n this.resizeHandlerSw.suspend();\n this.element.appendChild(this.resizeElementSe);\n this.resizeElementSe.classList.add('pwv-annotation-border-resizehandle-se');\n this.resizeElementSe.style.display = 'none';\n this.resizeHandlerSe = new DragMoveHandler(this.resizeElementSe, this.startResize, this.resizing, this.endResize);\n this.resizeHandlerSe.suspend();\n }\n setAnnotation(annotation, pageRect) {\n const { behaviors } = annotation;\n const isReadOnly = annotation.isReadOnly();\n const isLocked = annotation.isLocked() && !this.options.viewer.permissions.allowEditLockedAnnotations;\n this.annotationId = annotation.id;\n this.movable = behaviors.movable && !isLocked && !isReadOnly;\n this.resizable = behaviors.resizable && !isLocked && !isReadOnly;\n this.aspectRatio = behaviors.aspectRatioChangeable\n ? null\n : annotation.pdfRect.pdfW / annotation.pdfRect.pdfH;\n this.pageRect = pageRect;\n if (this.movable) {\n this.dragElement.style.display = 'block';\n }\n if (this.resizable) {\n this.resizeElementNw.style.display = 'block';\n this.resizeElementNe.style.display = 'block';\n this.resizeElementSw.style.display = 'block';\n this.resizeElementSe.style.display = 'block';\n }\n window.setTimeout(() => {\n if (this.movable) {\n this.dragHandler.resume();\n }\n if (this.resizable) {\n this.resizeHandlerNw.resume();\n this.resizeHandlerNe.resume();\n this.resizeHandlerSw.resume();\n this.resizeHandlerSe.resume();\n }\n }, 100);\n }\n deselectAnnotation() {\n this.annotationId = null;\n this.movable = false;\n this.resizable = false;\n this.aspectRatio = 0;\n this.pageRect = null;\n this.dragHandler.suspend();\n this.resizeHandlerNw.suspend();\n this.resizeHandlerNe.suspend();\n this.resizeHandlerSw.suspend();\n this.resizeHandlerSe.suspend();\n this.dragElement.style.display = 'none';\n this.resizeElementNw.style.display = 'none';\n this.resizeElementNe.style.display = 'none';\n this.resizeElementSw.style.display = 'none';\n this.resizeElementSe.style.display = 'none';\n }\n updatePageRect(pageRect) {\n this.pageRect = pageRect;\n }\n click() { }\n dblClick() {\n if (this.annotationId) {\n this.onDblClick(this.annotationId);\n }\n }\n startResize(e) {\n if (e.element.classList.contains('pwv-annotation-border-resizehandle-nw')) {\n this.resizeDir = ResizeDir.NW;\n }\n else if (e.element.classList.contains('pwv-annotation-border-resizehandle-ne')) {\n this.resizeDir = ResizeDir.NE;\n }\n else if (e.element.classList.contains('pwv-annotation-border-resizehandle-sw')) {\n this.resizeDir = ResizeDir.SW;\n }\n else if (e.element.classList.contains('pwv-annotation-border-resizehandle-se')) {\n this.resizeDir = ResizeDir.SE;\n }\n this.element.classList.add('pwv-annotation-resizing');\n }\n resizing(e) {\n if (this.aspectRatio !== null) {\n this.resizeWithAspectRatio(e.clientX, e.clientY);\n }\n else {\n this.resizeNoAspectRatio(e.clientX, e.clientY);\n }\n }\n updateMinSize() {\n const { document } = this.store.getState();\n this.minSize = MIN_SIZE;\n }\n resizeNoAspectRatio(clientX, clientY) {\n if (this.element && this.element.offsetParent && this.pageRect) {\n this.updateMinSize();\n const offsetRect = this.element.offsetParent.getBoundingClientRect();\n const elementRect = this.element.getBoundingClientRect();\n const minLeft = this.pageRect.x / window.devicePixelRatio;\n const maxLeft = minLeft + this.pageRect.w / window.devicePixelRatio;\n const minTop = this.pageRect.y / window.devicePixelRatio;\n const maxTop = minTop + this.pageRect.h / window.devicePixelRatio;\n let pointerX = clientX - offsetRect.left;\n if (pointerX < minLeft) {\n pointerX = minLeft;\n }\n else if (pointerX > maxLeft) {\n pointerX = maxLeft;\n }\n let pointerY = clientY - offsetRect.top;\n if (pointerY < minTop) {\n pointerY = minTop;\n }\n else if (pointerY > maxTop) {\n pointerY = maxTop;\n }\n let topPos = elementRect.top - offsetRect.top;\n let leftPos = elementRect.left - offsetRect.left;\n let width = elementRect.width;\n let height = elementRect.height;\n if (this.resizeDir === ResizeDir.NE || this.resizeDir === ResizeDir.SE) {\n width = pointerX - leftPos;\n if (width < this.minSize) {\n width = this.minSize;\n }\n }\n if (this.resizeDir === ResizeDir.NW || this.resizeDir === ResizeDir.SW) {\n width = leftPos + width - pointerX;\n if (width < this.minSize) {\n width = this.minSize;\n leftPos = elementRect.left - offsetRect.left + elementRect.width - width;\n }\n else {\n leftPos = pointerX;\n }\n }\n if (this.resizeDir === ResizeDir.SE || this.resizeDir === ResizeDir.SW) {\n height = pointerY - topPos;\n if (height < this.minSize) {\n height = this.minSize;\n }\n }\n if (this.resizeDir === ResizeDir.NE || this.resizeDir === ResizeDir.NW) {\n height = topPos + height - pointerY;\n if (height < this.minSize) {\n height = this.minSize;\n topPos = elementRect.top - offsetRect.top + elementRect.height - height;\n }\n else {\n topPos = pointerY;\n }\n }\n this.element.style.top = topPos + 'px';\n this.element.style.left = leftPos + 'px';\n this.element.style.width = width + 'px';\n this.element.style.height = height + 'px';\n }\n }\n resizeWithAspectRatio(clientX, clientY) {\n if (this.pageRect && this.aspectRatio !== null && this.element && this.element.offsetParent) {\n this.updateMinSize();\n const offsetRect = this.element.offsetParent.getBoundingClientRect();\n const elementRect = this.element.getBoundingClientRect();\n const minLeft = this.pageRect.x / window.devicePixelRatio;\n const maxLeft = minLeft + this.pageRect.w / window.devicePixelRatio;\n const minTop = this.pageRect.y / window.devicePixelRatio;\n const maxTop = minTop + this.pageRect.h / window.devicePixelRatio;\n let pointerX = clientX - offsetRect.left;\n if (pointerX < minLeft) {\n pointerX = minLeft;\n }\n else if (pointerX > maxLeft) {\n pointerX = maxLeft;\n }\n let pointerY = clientY - offsetRect.top;\n if (pointerY < minTop) {\n pointerY = minTop;\n }\n else if (pointerY > maxTop) {\n pointerY = maxTop;\n }\n let topPos = elementRect.top - offsetRect.top;\n let leftPos = elementRect.left - offsetRect.left;\n let width = elementRect.width;\n let height = elementRect.height;\n const calcSize = (w, h, r) => {\n if (this.store.getState().document.rotation % 180 !== 0)\n r = 1 / r;\n const size = { w, h };\n if (w / h < r) {\n size.w = Math.max(w, this.minSize);\n size.h = size.w / r;\n if (size.h < this.minSize) {\n size.h = this.minSize;\n size.w = size.h * r;\n }\n }\n else {\n size.h = Math.max(h, this.minSize);\n size.w = size.h * r;\n if (size.w < this.minSize) {\n size.w = this.minSize;\n size.h = size.w * r;\n }\n }\n return size;\n };\n if (this.resizeDir === ResizeDir.NW) {\n const w = leftPos + width - pointerX;\n const h = topPos + height - pointerY;\n const size = calcSize(w, h, this.aspectRatio);\n leftPos = leftPos + width - size.w;\n topPos = topPos + height - size.h;\n width = size.w;\n height = size.h;\n }\n if (this.resizeDir === ResizeDir.NE) {\n const w = pointerX - leftPos;\n const h = topPos + height - pointerY;\n const size = calcSize(w, h, this.aspectRatio);\n topPos = topPos + height - size.h;\n width = size.w;\n height = size.h;\n }\n if (this.resizeDir === ResizeDir.SW) {\n const w = leftPos + width - pointerX;\n const h = pointerY - topPos;\n const size = calcSize(w, h, this.aspectRatio);\n leftPos = leftPos + width - size.w;\n width = size.w;\n height = size.h;\n }\n if (this.resizeDir === ResizeDir.SE) {\n const w = pointerX - leftPos;\n const h = pointerY - topPos;\n const size = calcSize(w, h, this.aspectRatio);\n width = size.w;\n height = size.h;\n }\n this.element.style.top = topPos + 'px';\n this.element.style.left = leftPos + 'px';\n this.element.style.width = width + 'px';\n this.element.style.height = height + 'px';\n }\n }\n endResize(e) {\n if (e.moved && this.annotationId) {\n this.onResized(this.annotationId, {\n x: this.element.offsetLeft,\n y: this.element.offsetTop,\n w: this.element.offsetWidth,\n h: this.element.offsetHeight,\n });\n }\n this.element.classList.remove('pwv-annotation-resizing');\n }\n startMove(e) {\n const elementRect = this.element.getBoundingClientRect();\n const offsetParent = this.element.offsetParent;\n const offsetParentRect = offsetParent.getBoundingClientRect();\n this.dragOffsetX = e.clientX - elementRect.left;\n this.dragOffsetY = e.clientY - elementRect.top;\n this.containerOffsetX = offsetParentRect.left;\n this.containerOffsetY = offsetParentRect.top;\n this.element.classList.add('pwv-annotation-moving');\n }\n moving(e) {\n if (this.pageRect) {\n const minLeft = this.pageRect.x / devicePixelRatio;\n const maxLeft = minLeft + this.pageRect.w / devicePixelRatio - this.element.offsetWidth;\n const minTop = this.pageRect.y / devicePixelRatio;\n const maxTop = minTop + this.pageRect.h / devicePixelRatio - this.element.offsetHeight;\n let topPos = e.clientY - this.containerOffsetY - this.dragOffsetY;\n let leftPos = e.clientX - this.containerOffsetX - this.dragOffsetX;\n if (topPos < minTop) {\n topPos = minTop;\n }\n else if (topPos > maxTop) {\n topPos = maxTop;\n }\n if (leftPos < minLeft) {\n leftPos = minLeft;\n }\n else if (leftPos > maxLeft) {\n leftPos = maxLeft;\n }\n this.element.style.top = topPos + 'px';\n this.element.style.left = leftPos + 'px';\n }\n }\n endMove(e) {\n if (e.moved && this.annotationId) {\n this.onMoved(this.annotationId, {\n x: this.element.offsetLeft,\n y: this.element.offsetTop + this.element.offsetHeight,\n });\n }\n this.element.classList.remove('pwv-annotation-moving');\n }\n}\n","import { h, app } from '../../../lib/hyperapp';\nimport { PdfItemType } from '../../../pdf-viewer-api';\nimport { translationManager } from '../../../common/TranslationManager';\nimport { Toolbar } from '../../../common/Toolbar';\nimport { ToolbarItemGroup } from '../../../common/ToolbarItemGroup';\nimport { ToolbarButton } from '../../../common/ToolbarButton';\nimport { Contextbar } from '../../../common/Contextbar';\nimport { icons } from '../../../common/icons';\nimport { annotationHasPopup } from '../../state/annotations';\nexport const createAnnotationContextBar = (props, element) => {\n const state = {\n annotation: null,\n isReadOnly: false,\n hasPopup: false,\n canRotate: false,\n deletable: false,\n canCopy: false,\n isLocked: false,\n canHavePopup: false,\n canDeletePopup: true,\n showConfirmDelete: false,\n commands: [],\n };\n const actions = {\n setAnnotation: (payload) => ($state) => {\n const { annotation, commands } = payload;\n const { behaviors } = annotation;\n const isReadOnly = annotation.isReadOnly();\n return Object.assign(Object.assign({}, $state), { showConfirmDelete: false, commands, annotation: annotation, isReadOnly, hasPopup: annotationHasPopup(annotation), canRotate: behaviors.rotatable, deletable: behaviors.deletable, canCopy: behaviors.text && props.allowCopyText, isLocked: annotation.isLocked(), canHavePopup: behaviors.canHavePopup, canDeletePopup: annotationHasPopup(annotation) && annotation.itemType !== PdfItemType.TEXT });\n },\n startDelete: () => ($state) => {\n return Object.assign(Object.assign({}, $state), { showConfirmDelete: true });\n },\n cancelDelete: () => ($state) => {\n return Object.assign(Object.assign({}, $state), { showConfirmDelete: false });\n },\n delete: () => ($state) => {\n props.onDeleteAnnotation($state.annotation ? $state.annotation.id : 0);\n return Object.assign({}, $state);\n },\n rotate: () => ($state) => {\n props.onRotateAnnotation($state.annotation ? $state.annotation.id : 0);\n return Object.assign({}, $state);\n },\n copyText: () => ($state) => {\n props.onCopy($state.annotation ? $state.annotation.id : 0);\n return Object.assign({}, $state);\n },\n addPopup: () => ($state) => {\n props.onCreatePopup($state.annotation ? $state.annotation.id : 0);\n return Object.assign(Object.assign({}, $state), { hasPopup: true });\n },\n editPopup: () => ($state) => {\n props.onOpenPopup($state.annotation ? $state.annotation.id : 0);\n return Object.assign({}, $state);\n },\n deletePopup: () => ($state) => {\n props.onDeletePopup($state.annotation ? $state.annotation.id : 0);\n return Object.assign(Object.assign({}, $state), { hasPopup: false });\n },\n toggleLock: () => ($state) => {\n props.onToggleLock($state.annotation ? $state.annotation.id : 0);\n return Object.assign(Object.assign({}, $state), { isLocked: !$state.isLocked });\n },\n };\n const App = () => h(ContextBar, null);\n const ContextBar = ({}) => ($state, $actions) => {\n if ($state.isReadOnly) {\n if ($state.canCopy || ($state.canHavePopup && $state.hasPopup)) {\n return (h(Contextbar, null,\n h(Toolbar, null,\n $state.canCopy && (h(ToolbarButton, { tooltip: translationManager.getText('contextbar.copyText'), icon: icons.copy, onClick: $actions.copyText })),\n $state.canHavePopup && $state.hasPopup && (h(ToolbarButton, { tooltip: translationManager.getText('contextbar.openPopup'), icon: icons.stickyNote, onClick: $actions.editPopup })))));\n }\n return null;\n }\n return (h(Contextbar, null,\n h(Toolbar, null, $state.showConfirmDelete ? (h(ToolbarItemGroup, null,\n h(ToolbarButton, { onClick: $actions.delete }, translationManager.getText('contextbar.confirmDelete')),\n h(ToolbarButton, { onClick: $actions.cancelDelete }, translationManager.getText('contextbar.cancelDelete')))) : (h(ToolbarItemGroup, null,\n !$state.isReadOnly &&\n $state.commands.map((cmd) => (h(ToolbarButton, { icon: cmd.icon, tooltip: cmd.tooltip, onClick: () => {\n cmd.onCmd($state.annotation ? $state.annotation.id : 0);\n }, disabled: ($state.isLocked && !props.allowEditLockedAnnotations) || $state.isReadOnly }))),\n $state.canCopy && (h(ToolbarButton, { tooltip: translationManager.getText('contextbar.copyText'), icon: icons.copy, onClick: $actions.copyText })),\n $state.canRotate && (h(ToolbarButton, { tooltip: translationManager.getText('contextbar.rotate'), icon: icons.rotate, onClick: $actions.rotate, disabled: ($state.isLocked && !props.allowEditLockedAnnotations) || $state.isReadOnly })),\n $state.canHavePopup &&\n !$state.isReadOnly &&\n !($state.isLocked && !props.allowEditLockedAnnotations) &&\n !$state.hasPopup && (h(ToolbarButton, { tooltip: translationManager.getText('contextbar.addPopup'), icon: icons.stickyNoteAdd, onClick: $actions.addPopup, disabled: ($state.isLocked && !props.allowEditLockedAnnotations) || $state.isReadOnly })),\n $state.canHavePopup && $state.hasPopup && (h(ToolbarButton, { tooltip: translationManager.getText(($state.isLocked && !props.allowEditLockedAnnotations) || $state.isReadOnly\n ? 'contextbar.openPopup'\n : 'contextbar.editPopup'), icon: ($state.isLocked && !props.allowEditLockedAnnotations) || $state.isReadOnly\n ? icons.stickyNote\n : icons.stickyNoteEdit, onClick: $actions.editPopup })),\n $state.canDeletePopup && $state.hasPopup && (h(ToolbarButton, { tooltip: translationManager.getText('contextbar.deletePopup'), icon: icons.stickyNoteRemove, onClick: $actions.deletePopup, disabled: ($state.isLocked && !props.allowEditLockedAnnotations) || $state.isReadOnly })),\n !$state.isReadOnly && props.allowLockAnnotations && (h(ToolbarButton, { tooltip: translationManager.getText($state.isLocked ? 'contextbar.unlock' : 'contextbar.lock'), icon: $state.isLocked ? icons.lock : icons.unlock, onClick: $actions.toggleLock, disabled: $state.isReadOnly })),\n $state.deletable && (h(ToolbarButton, { tooltip: translationManager.getText('contextbar.delete'), icon: icons.delete, onClick: $actions.startDelete, disabled: ($state.isLocked && !props.allowEditLockedAnnotations) || $state.isReadOnly })))))));\n };\n return app(state, actions, App, element);\n};\n","import { app, h } from '../../../lib/hyperapp';\nimport { PdfItemType } from '../../../pdf-viewer-api';\nimport { translationManager } from '../../../common/TranslationManager';\nimport { Toolbar } from '../../../common/Toolbar';\nimport { ToolbarItemGroup } from '../../../common/ToolbarItemGroup';\nimport { ToolbarButton } from '../../../common/ToolbarButton';\nimport { ColorPicker } from '../../../common/ColorPicker';\nimport { Contextbar } from '../../../common/Contextbar';\nimport { icons } from '../../../common/icons';\nexport const createTextSelectionContextBar = (props, element) => {\n const state = {\n highlightColors: props.highlightColors,\n };\n const actions = {};\n const App = () => h(ContextBar, null);\n const ContextBar = ({}) => ($state) => {\n return (h(Contextbar, null,\n h(Toolbar, null, props.isViewOnly ? (h(ToolbarItemGroup, null,\n h(ToolbarButton, { tooltip: translationManager.getText('contextbar.copyText'), icon: icons.copy, onClick: props.onCopyText }))) : (h(ToolbarItemGroup, null,\n props.allowCopyText && (h(ToolbarButton, { tooltip: translationManager.getText('contextbar.copyText'), icon: icons.copy, onClick: props.onCopyText })),\n h(ColorPicker, { tooltip: translationManager.getText('contextbar.highlightText'), colors: $state.highlightColors, icon: icons.highlighter, color: \"#000000ff\", onChange: (color) => {\n props.onCreateAnnotation(PdfItemType.HIGHLIGHT, color);\n } }),\n h(ColorPicker, { tooltip: translationManager.getText('contextbar.underlineText'), colors: $state.highlightColors, icon: icons.underline, color: \"#000000ff\", onChange: (color) => {\n props.onCreateAnnotation(PdfItemType.UNDERLINE, color);\n } }),\n h(ColorPicker, { tooltip: translationManager.getText('contextbar.squigglyText'), colors: $state.highlightColors, icon: icons.squiggly, color: \"#000000ff\", onChange: (color) => {\n props.onCreateAnnotation(PdfItemType.SQUIGGLY, color);\n } }),\n h(ColorPicker, { tooltip: translationManager.getText('contextbar.strikeOutText'), colors: $state.highlightColors, icon: icons.strikethrough, color: \"#000000ff\", onChange: (color) => {\n props.onCreateAnnotation(PdfItemType.STRIKE_OUT, color);\n } }))))));\n };\n return app(state, actions, App, element);\n};\n","if (window.PdfToolsPromise === undefined) {\n window.Module = {};\n Module['locateFile'] = (path, prefix) => {\n const pdfviewingBaseUrl = window.PDFTOOLS_FOURHEIGHTS_PDFVIEWING_BASEURL;\n return pdfviewingBaseUrl\n ? pdfviewingBaseUrl + (pdfviewingBaseUrl.endsWith('/') ? '' : '/') + path\n : path;\n };\n window.PdfToolsPromise = new Promise((resolve, reject) => {\n window.Module['onRuntimeInitialized'] = () => {\n if (typeof Module.ViewingInitialize !== 'function') {\n const errorMsg = `**************************************\nCould not find method Module.ViewingInitialize\n\n%cYou may be using a mismatched version of the 4-Heights® PDF Viewing SDK. Please make sure you have updated all files to the same version.\n%c**************************************`;\n console.error(errorMsg, 'color: orange', 'color: gray', 'color: red');\n reject(errorMsg);\n }\n Module.ViewingInitialize();\n resolve();\n };\n const scriptElm = document.createElement('script');\n const scriptSrc = window.Module.locateFile('PdfViewing_Main.js');\n scriptElm.onerror = function (err) {\n console.error(`**************************************\nFailed to load PdfViewing_Main.js \n\n%cThe 4-Heights® PDF Viewing SDK failed to load a required script resource. Either the \"Base URL\" (PDFTOOLS_FOURHEIGHTS_PDFVIEWING_BASEURL) is not configured correctly or the static assets have not been copied to the configured location. For more information please consult the documentation.\n\n%cwindow.PDFTOOLS_FOURHEIGHTS_PDFVIEWING_BASEURL=>${window.PDFTOOLS_FOURHEIGHTS_PDFVIEWING_BASEURL}\n%c**************************************`, 'color: orange', 'color: gray', 'color: red');\n reject('failed to load PdfViewing_Main.js');\n };\n scriptElm.src = scriptSrc;\n document.head.appendChild(scriptElm);\n });\n}\nexport var PdfViewing;\n(function (PdfViewing) {\n var _a;\n let Internal;\n (function (Internal) {\n class NativeBase {\n static throwLastError(allowSuccess = true) {\n let exception = this.createLastError(this.lastErrorCode, this.lastErrorMessage, allowSuccess);\n if (exception === null)\n return;\n else\n throw exception;\n }\n static createLastError(errorCode, errorMessage, allowSuccess = true) {\n switch (errorCode) {\n case 0:\n if (allowSuccess)\n return null;\n else\n return new PdfViewing.PdfViewingError('An unexpected error occurred');\n case 10:\n return new PdfViewing.GenericError(errorMessage);\n case 11:\n return new PdfViewing.FatalError(errorMessage);\n case 12:\n return new PdfViewing.LicenseError(errorMessage);\n case 15:\n return new PdfViewing.UnknownFormatError(errorMessage);\n case 16:\n return new PdfViewing.CorruptError(errorMessage);\n case 17:\n return new PdfViewing.PasswordError(errorMessage);\n case 18:\n return new PdfViewing.ConformanceError(errorMessage);\n case 19:\n return new PdfViewing.UnsupportedFeatureError(errorMessage);\n case 20:\n return new PdfViewing.InfrastructureError(errorMessage);\n case 21:\n return new PdfViewing.ProcessingError(errorMessage);\n case 22:\n return new PdfViewing.ExistsError(errorMessage);\n case 23:\n return new PdfViewing.UpdateFailedError(errorMessage);\n case 1:\n return new PdfViewing.NotSupportedError(errorMessage);\n case 2:\n return new PdfViewing.InvalidOperationError(errorMessage);\n case 3:\n return new PdfViewing.ArgumentError(errorMessage);\n case 5:\n return new PdfViewing.NotFoundError(errorMessage);\n case 4:\n return new PdfViewing.IOError(errorMessage);\n default:\n return null;\n }\n }\n static get lastErrorMessage() {\n return Module.ViewingGetLastErrorMessage();\n }\n static get lastErrorCode() {\n return Module.ViewingGetLastError();\n }\n }\n Internal.NativeBase = NativeBase;\n class NativeObject extends NativeBase {\n constructor(handle) {\n super();\n this._handle = handle;\n }\n get handle() {\n if (this._handle === 0) {\n throw new Error('NULL Pointer');\n }\n return this._handle;\n }\n set handle(handle) {\n this._handle = handle;\n }\n equals(obj) {\n if (obj instanceof NativeObject) {\n if (this._handle === 0 || obj._handle === 0)\n return false;\n return Module.ViewingEquals(this._handle, obj._handle);\n }\n return false;\n }\n getHashCode() {\n return this._handle === 0 ? 0 : Module.ViewingGetHashCode(this._handle);\n }\n static checkReturnHandleErrorCode(handle) {\n if (handle === 0) {\n NativeBase.throwLastError(false);\n }\n return handle;\n }\n }\n Internal.NativeObject = NativeObject;\n })(Internal = PdfViewing.Internal || (PdfViewing.Internal = {}));\n class PdfViewingError extends Error {\n constructor(message) {\n super(message);\n const actualProto = new.target.prototype;\n Object.setPrototypeOf(this, actualProto);\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(this, actualProto);\n }\n else {\n ;\n this.__proto__ = actualProto;\n }\n }\n }\n PdfViewing.PdfViewingError = PdfViewingError;\n let LicenseFeature;\n (function (LicenseFeature) {\n LicenseFeature[LicenseFeature[\"Annotate\"] = 1] = \"Annotate\";\n LicenseFeature[LicenseFeature[\"FillFormFields\"] = 2] = \"FillFormFields\";\n LicenseFeature[LicenseFeature[\"PageRotation\"] = 4] = \"PageRotation\";\n })(LicenseFeature = PdfViewing.LicenseFeature || (PdfViewing.LicenseFeature = {}));\n class ViewerController extends Internal.NativeObject {\n constructor() {\n if (arguments[0] && typeof arguments[0].__handle === `number`)\n super(arguments[0].__handle);\n else {\n super(Internal.NativeObject.checkReturnHandleErrorCode(Module.ViewingNewViewerController()));\n }\n this.eventListeners = new Map();\n }\n addEventListener(type, listener) {\n if (typeof listener !== 'function')\n throw new PdfViewing.ArgumentError(\"Argument 'listener' must be a function.\");\n var eventObj;\n if (this.eventListeners.has(type)) {\n if (!this.eventListeners.get(type).has(listener)) {\n if (type === 'busyChanged') {\n eventObj = new BusyChangedNativeClass(listener);\n let context = Module.ViewingViewerControllerAddBusyChangedHandler(this.handle, eventObj);\n if (context == 0)\n Internal.NativeBase.throwLastError();\n else\n eventObj.context = context;\n this.eventListeners.get(type).set(listener, eventObj);\n }\n }\n if (!this.eventListeners.get(type).has(listener)) {\n if (type === 'errorOccured') {\n eventObj = new ErrorOccuredNativeClass(listener);\n let context = Module.ViewingViewerControllerAddErrorOccuredHandler(this.handle, eventObj);\n if (context == 0)\n Internal.NativeBase.throwLastError();\n else\n eventObj.context = context;\n this.eventListeners.get(type).set(listener, eventObj);\n }\n }\n }\n else {\n if (type === 'busyChanged') {\n eventObj = new BusyChangedNativeClass(listener);\n let context = Module.ViewingViewerControllerAddBusyChangedHandler(this.handle, eventObj);\n if (context == 0)\n Internal.NativeBase.throwLastError();\n else\n eventObj.context = context;\n let mapItem = new Map();\n mapItem.set(listener, eventObj);\n this.eventListeners.set(type, mapItem);\n }\n if (type === 'errorOccured') {\n eventObj = new ErrorOccuredNativeClass(listener);\n let context = Module.ViewingViewerControllerAddErrorOccuredHandler(this.handle, eventObj);\n if (context == 0)\n Internal.NativeBase.throwLastError();\n else\n eventObj.context = context;\n let mapItem = new Map();\n mapItem.set(listener, eventObj);\n this.eventListeners.set(type, mapItem);\n }\n }\n }\n removeEventListener(type, listener) {\n if (this.eventListeners.has(type)) {\n if (type === 'busyChanged') {\n let listeners = this.eventListeners.get(type);\n if (listeners.has(listener)) {\n let eventObj = listeners.get(listener);\n try {\n if (!Module.ViewingViewerControllerRemoveBusyChangedHandler(this.handle, eventObj === null || eventObj === void 0 ? void 0 : eventObj.context))\n Internal.NativeBase.throwLastError();\n }\n catch (err) {\n if (err instanceof NotFoundError)\n throw err;\n }\n listeners.delete(listener);\n if (listeners.size === 0)\n this.eventListeners.delete('busyChanged');\n }\n }\n if (type === 'errorOccured') {\n let listeners = this.eventListeners.get(type);\n if (listeners.has(listener)) {\n let eventObj = listeners.get(listener);\n try {\n if (!Module.ViewingViewerControllerRemoveErrorOccuredHandler(this.handle, eventObj === null || eventObj === void 0 ? void 0 : eventObj.context))\n Internal.NativeBase.throwLastError();\n }\n catch (err) {\n if (err instanceof NotFoundError)\n throw err;\n }\n listeners.delete(listener);\n if (listeners.size === 0)\n this.eventListeners.delete('errorOccured');\n }\n }\n }\n }\n static createDynamicObject(handle) {\n return new ViewerController({ __handle: handle });\n }\n close() {\n if (!Module.ViewingViewerControllerClose(this.handle))\n Internal.NativeBase.throwLastError();\n }\n open(pdfFile, fdfFiles = null, password = null) {\n if (!(pdfFile instanceof PdfViewing.IO.InputDocument))\n throw new PdfViewing.ArgumentError(\"Argument 'pdfFile' must be of type PdfViewing.IO.InputDocument and must not be null or undefined.\");\n if (fdfFiles !== null &&\n fdfFiles !== undefined &&\n !(fdfFiles instanceof PdfViewing.IO.InputDocumentList))\n throw new PdfViewing.ArgumentError(\"Argument 'fdfFiles' must be of type PdfViewing.IO.InputDocumentList or can be null or undefined.\");\n if (password !== null && password !== undefined && typeof password !== 'string')\n throw new PdfViewing.ArgumentError(\"Argument 'password' must be of type string or can be null or undefined.\");\n var thisHandle = this;\n return new Promise(function (resolved, rejected) {\n if (!Module.ViewingViewerControllerOpen(thisHandle.handle, { thisHandle, resolved, rejected }, pdfFile.handle, fdfFiles !== null && fdfFiles !== undefined ? fdfFiles.handle : 0, password))\n rejected(Module.ViewingGetLastErrorMessage());\n });\n }\n openCallback(context, retVal, errorCode, errorMessage) {\n let error = null;\n if (retVal === 0)\n error = Internal.NativeBase.createLastError(errorCode, errorMessage, false);\n if (error === null) {\n context.resolved(PdfViewing.Pdf.Document.createDynamicObject(retVal));\n }\n else\n context.rejected(error);\n }\n openMem(pdf, fdf, password) {\n if (!(pdf instanceof Uint8Array))\n throw new PdfViewing.ArgumentError(\"Argument 'pdf' must be of type Uint8Array and must not be null or undefined.\");\n if (fdf !== null && fdf !== undefined && !(fdf instanceof Uint8Array))\n throw new PdfViewing.ArgumentError(\"Argument 'fdf' must be of type Uint8Array or can be null or undefined.\");\n if (password !== null && password !== undefined && typeof password !== 'string')\n throw new PdfViewing.ArgumentError(\"Argument 'password' must be of type string or can be null or undefined.\");\n var thisHandle = this;\n return new Promise(function (resolved, rejected) {\n if (!Module.ViewingViewerControllerOpenMem(thisHandle.handle, { thisHandle, resolved, rejected }, pdf, fdf, password))\n rejected(Module.ViewingGetLastErrorMessage());\n });\n }\n openMemCallback(context, retVal, errorCode, errorMessage) {\n let error = null;\n if (retVal === 0)\n error = Internal.NativeBase.createLastError(errorCode, errorMessage, false);\n if (error === null) {\n context.resolved(PdfViewing.Pdf.Document.createDynamicObject(retVal));\n }\n else\n context.rejected(error);\n }\n openUri(pdfUri, fdfUri, password, pdfAuthorization, fdfAuthorization) {\n if (typeof pdfUri !== 'string')\n throw new PdfViewing.ArgumentError(\"Argument 'pdfUri' must be of type string and must not be null or undefined.\");\n if (fdfUri !== null && fdfUri !== undefined && typeof fdfUri !== 'string')\n throw new PdfViewing.ArgumentError(\"Argument 'fdfUri' must be of type string or can be null or undefined.\");\n if (password !== null && password !== undefined && typeof password !== 'string')\n throw new PdfViewing.ArgumentError(\"Argument 'password' must be of type string or can be null or undefined.\");\n if (pdfAuthorization !== null &&\n pdfAuthorization !== undefined &&\n typeof pdfAuthorization !== 'string')\n throw new PdfViewing.ArgumentError(\"Argument 'pdfAuthorization' must be of type string or can be null or undefined.\");\n if (fdfAuthorization !== null &&\n fdfAuthorization !== undefined &&\n typeof fdfAuthorization !== 'string')\n throw new PdfViewing.ArgumentError(\"Argument 'fdfAuthorization' must be of type string or can be null or undefined.\");\n var thisHandle = this;\n return new Promise(function (resolved, rejected) {\n if (!Module.ViewingViewerControllerOpenUri(thisHandle.handle, { thisHandle, resolved, rejected }, pdfUri, fdfUri, password, pdfAuthorization, fdfAuthorization))\n rejected(Module.ViewingGetLastErrorMessage());\n });\n }\n openUriCallback(context, retVal, errorCode, errorMessage) {\n let error = null;\n if (retVal === 0)\n error = Internal.NativeBase.createLastError(errorCode, errorMessage, false);\n if (error === null) {\n context.resolved(PdfViewing.Pdf.Document.createDynamicObject(retVal));\n }\n else\n context.rejected(error);\n }\n merge(first, second, firstDocumentPassword = null, secondDocumentPassword = null, mergeOptions = null) {\n if (!(first instanceof PdfViewing.IO.InputDocument))\n throw new PdfViewing.ArgumentError(\"Argument 'first' must be of type PdfViewing.IO.InputDocument and must not be null or undefined.\");\n if (!(second instanceof PdfViewing.IO.InputDocument))\n throw new PdfViewing.ArgumentError(\"Argument 'second' must be of type PdfViewing.IO.InputDocument and must not be null or undefined.\");\n if (firstDocumentPassword !== null &&\n firstDocumentPassword !== undefined &&\n typeof firstDocumentPassword !== 'string')\n throw new PdfViewing.ArgumentError(\"Argument 'firstDocumentPassword' must be of type string or can be null or undefined.\");\n if (secondDocumentPassword !== null &&\n secondDocumentPassword !== undefined &&\n typeof secondDocumentPassword !== 'string')\n throw new PdfViewing.ArgumentError(\"Argument 'secondDocumentPassword' must be of type string or can be null or undefined.\");\n if (mergeOptions !== null &&\n mergeOptions !== undefined &&\n !(mergeOptions instanceof PdfViewing.IO.MergeOptions))\n throw new PdfViewing.ArgumentError(\"Argument 'mergeOptions' must be of type PdfViewing.IO.MergeOptions or can be null or undefined.\");\n var thisHandle = this;\n return new Promise(function (resolved, rejected) {\n if (!Module.ViewingViewerControllerMerge(thisHandle.handle, { thisHandle, resolved, rejected }, first.handle, second.handle, firstDocumentPassword, secondDocumentPassword, mergeOptions !== null && mergeOptions !== undefined ? mergeOptions.handle : 0))\n rejected(Module.ViewingGetLastErrorMessage());\n });\n }\n mergeCallback(context, retVal, errorCode, errorMessage) {\n let error = null;\n if (retVal === 0)\n error = Internal.NativeBase.createLastError(errorCode, errorMessage, false);\n if (error === null) {\n context.resolved(PdfViewing.Pdf.Content.BinaryBuffer.createDynamicObject(retVal));\n }\n else\n context.rejected(error);\n }\n get isBusy() {\n let retVal = Module.ViewingViewerControllerGetIsBusy(this.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n set formsHighlightColor(formsHighlightColor) {\n if (typeof formsHighlightColor !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'formsHighlightColor' must be of type PdfViewing.Pdf.Annotations.Color and must not be null or undefined.\");\n let retVal = Module.ViewingViewerControllerSetFormsHighlightColor(this.handle, formsHighlightColor);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n set formsHighlightRequiredColor(formsHighlightRequiredColor) {\n if (typeof formsHighlightRequiredColor !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'formsHighlightRequiredColor' must be of type PdfViewing.Pdf.Annotations.Color and must not be null or undefined.\");\n let retVal = Module.ViewingViewerControllerSetFormsHighlightRequiredColor(this.handle, formsHighlightRequiredColor);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n }\n PdfViewing.ViewerController = ViewerController;\n class EventViewerControllerNativeBase {\n constructor(listener) {\n this.listener = listener;\n }\n }\n class BusyChangedNativeClass extends EventViewerControllerNativeBase {\n constructor(listener) {\n super(listener);\n }\n dispatchEventBusyChanged(busy) {\n this.listener(busy);\n }\n }\n class ErrorOccuredNativeClass extends EventViewerControllerNativeBase {\n constructor(listener) {\n super(listener);\n }\n dispatchEventErrorOccured() {\n this.listener(undefined);\n }\n }\n class Sdk extends Internal.NativeObject {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n return new Sdk(handle);\n }\n static initialize(license, producerSuffix) {\n if (typeof license !== 'string')\n throw new PdfViewing.ArgumentError(\"Argument 'license' must be of type string and must not be null or undefined.\");\n if (producerSuffix !== null &&\n producerSuffix !== undefined &&\n typeof producerSuffix !== 'string')\n throw new PdfViewing.ArgumentError(\"Argument 'producerSuffix' must be of type string or can be null or undefined.\");\n let retVal = Module.ViewingSdkInitialize(license, producerSuffix);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n static get version() {\n let retVal = Module.ViewingSdkGetVersion();\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return retVal;\n }\n static get producerFullName() {\n let retVal = Module.ViewingSdkGetProducerFullName();\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return retVal;\n }\n static get supportedFeatures() {\n let retVal = Module.ViewingSdkGetSupportedFeatures();\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n }\n PdfViewing.Sdk = Sdk;\n class IntegerSet extends Internal.NativeObject {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n return new IntegerSet(handle);\n }\n nativeGet(value) {\n let it = Module.ViewingIntegerSetGet(this.handle, value);\n if (it === -1 && Module.ViewingGetLastError() !== 5)\n Internal.NativeBase.throwLastError(false);\n return it;\n }\n [Symbol.iterator]() {\n return new IntegerSetIterator(this);\n }\n clear() {\n if (!Module.ViewingIntegerSetClear(this.handle))\n Internal.NativeBase.throwLastError(false);\n }\n delete(value) {\n if (typeof value !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'value' must be of type number and must not be null or undefined.\");\n let it = this.nativeGet(value);\n if (it == -1)\n return false;\n var retVal = Module.ViewingIntegerSetRemove(this.handle, this.nativeGet(value));\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n return retVal;\n }\n forEach(callbackfn, thisArg) {\n for (const value of this.entries()) {\n callbackfn(value[1], value[0], this);\n }\n }\n has(value) {\n if (typeof value !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'value' must be of type number and must not be null or undefined.\");\n return this.nativeGet(value) !== -1;\n }\n add(value) {\n if (typeof value !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'value' must be of type number and must not be null or undefined.\");\n if (!Module.ViewingIntegerSetAdd(this.handle, value))\n Internal.NativeBase.throwLastError(false);\n return this;\n }\n get size() {\n let size = Module.ViewingIntegerSetGetSize(this.handle);\n if (size < 0)\n Internal.NativeBase.throwLastError(false);\n return size;\n }\n entries() {\n return new IntegerSetEntryIterator(this);\n }\n keys() {\n return new IntegerSetIterator(this);\n }\n values() {\n return new IntegerSetIterator(this);\n }\n }\n Symbol.toStringTag;\n PdfViewing.IntegerSet = IntegerSet;\n class IntegerSetIteratorBase {\n constructor(set) {\n this.set = set;\n this.index = Module.ViewingIntegerSetGetBegin(set.handle);\n if (this.index === -1)\n Internal.NativeBase.throwLastError(false);\n this.end = Module.ViewingIntegerSetGetEnd(set.handle);\n if (this.end === -1)\n Internal.NativeBase.throwLastError(false);\n }\n getNextIndex() {\n let nextIndex = Module.ViewingIntegerSetGetNext(this.set.handle, this.index);\n if (nextIndex === -1)\n Internal.NativeBase.throwLastError(false);\n return nextIndex;\n }\n getValueFromIndex(index) {\n let retVal = Module.ViewingIntegerSetGetValue(this.set.handle, index);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n }\n class IntegerSetEntryIterator extends IntegerSetIteratorBase {\n constructor(set) {\n super(set);\n }\n next() {\n if (this.index === this.end)\n return { done: true, value: null };\n let element = this.getValueFromIndex(this.index);\n this.index = this.getNextIndex();\n return { done: false, value: [element, element] };\n }\n [Symbol.iterator]() {\n return new IntegerSetEntryIterator(this.set);\n }\n }\n class IntegerSetIterator extends IntegerSetIteratorBase {\n constructor(set) {\n super(set);\n }\n next() {\n if (this.index === this.end)\n return { done: true, value: null };\n let element = this.getValueFromIndex(this.index);\n this.index = this.getNextIndex();\n return { done: false, value: element };\n }\n [Symbol.iterator]() {\n return new IntegerSetIterator(this.set);\n }\n }\n class StringList extends Internal.NativeObject {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n return new StringList(handle);\n }\n remove(element) {\n throw new Error('Method not implemented.');\n }\n add(element) {\n throw new Error('Method not implemented.');\n }\n addRange(inputList) {\n throw new Error('Method not implemented.');\n }\n set(index, element) {\n throw new Error('Method not implemented.');\n }\n clear() {\n throw new Error('Method not implemented.');\n }\n get(index) {\n let retVal = Module.ViewingStringListGet(this.handle, index);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return retVal;\n }\n getRange(index, count) {\n throw new Error('Method not implemented.');\n }\n get size() {\n let retVal = Module.ViewingStringListGetCount(this.handle);\n if (retVal === -1)\n Internal.NativeBase.throwLastError(false);\n return retVal;\n }\n [Symbol.iterator]() {\n return new ListIterator(this);\n }\n }\n PdfViewing.StringList = StringList;\n class StringMap extends Internal.NativeObject {\n constructor(handle) {\n super(handle);\n this[_a] = 'StringMap';\n }\n static createDynamicObject(handle) {\n return new StringMap(handle);\n }\n nativeGet(key) {\n let it = Module.ViewingStringMapGet(this.handle, key);\n if (it === -1 && Module.ViewingGetLastError() !== 5)\n Internal.NativeBase.throwLastError();\n return it;\n }\n [Symbol.iterator]() {\n return new StringMapKeyValueIterator(this);\n }\n clear() {\n if (!Module.ViewingStringMapClear(this.handle))\n Internal.NativeBase.throwLastError(false);\n }\n delete(key) {\n if (typeof key !== 'string')\n throw new PdfViewing.ArgumentError(\"Argument 'key' must be of type string and must not be null or undefined.\");\n let it = this.nativeGet(key);\n if (it == -1)\n return false;\n var retVal = Module.ViewingStringMapRemove(this.handle, it);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n return true;\n }\n forEach(callbackfn, thisArg) {\n for (const keyValue of this.entries()) {\n callbackfn(keyValue[1], keyValue[0], this);\n }\n }\n get(key) {\n if (typeof key !== 'string')\n throw new PdfViewing.ArgumentError(\"Argument 'key' must be of type string and must not be null or undefined.\");\n let it = Module.ViewingStringMapGet(this.handle, key);\n if (it === -1)\n Internal.NativeBase.throwLastError(false);\n let retVal = Module.ViewingStringMapGetValue(this.handle, it);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return retVal;\n }\n has(key) {\n if (typeof key !== 'string')\n throw new PdfViewing.ArgumentError(\"Argument 'key' must be of type string and must not be null or undefined.\");\n return this.nativeGet(key) !== -1;\n }\n set(key, value) {\n if (typeof key !== 'string')\n throw new PdfViewing.ArgumentError(\"Argument 'key' must be of type string and must not be null or undefined.\");\n if (typeof value !== 'string')\n throw new PdfViewing.ArgumentError(\"Argument 'value' must be of type string and must not be null or undefined.\");\n if (!Module.ViewingStringMapSet(this.handle, key, value))\n Internal.NativeBase.throwLastError(false);\n return this;\n }\n get size() {\n let size = Module.ViewingStringMapGetSize(this.handle);\n if (size < 0)\n Internal.NativeBase.throwLastError(false);\n return size;\n }\n entries() {\n return new StringMapKeyValueIterator(this);\n }\n keys() {\n return new StringMapKeyIterator(this);\n }\n values() {\n return new StringMapValueIterator(this);\n }\n }\n _a = Symbol.toStringTag;\n PdfViewing.StringMap = StringMap;\n class StringMapIteratorBase extends Internal.NativeBase {\n constructor(map) {\n super();\n this.map = map;\n this.index = Module.ViewingStringMapGetBegin(map.handle);\n if (this.index === -1)\n Internal.NativeBase.throwLastError(false);\n this.end = Module.ViewingStringMapGetEnd(map.handle);\n if (this.end === -1)\n Internal.NativeBase.throwLastError(false);\n }\n getNextIndex() {\n let nextIndex = Module.ViewingStringMapGetNext(this.map.handle, this.index);\n if (nextIndex === -1)\n Internal.NativeBase.throwLastError(false);\n return nextIndex;\n }\n getKeyFromIndex(index) {\n let key = Module.ViewingStringMapGetKey(this.map.handle, index);\n if (key === null)\n Internal.NativeBase.throwLastError(false);\n return key;\n }\n getValueFromIndex(index) {\n let retVal = Module.ViewingStringMapGetValue(this.map.handle, index);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return retVal;\n }\n }\n class StringMapKeyValueIterator extends StringMapIteratorBase {\n constructor(map) {\n super(map);\n }\n next() {\n if (this.index === this.end)\n return { done: true, value: null };\n let key = this.getKeyFromIndex(this.index);\n let element = this.getValueFromIndex(this.index);\n this.index = this.getNextIndex();\n return { done: false, value: [key, element] };\n }\n [Symbol.iterator]() {\n return new StringMapKeyValueIterator(this.map);\n }\n }\n class StringMapKeyIterator extends StringMapIteratorBase {\n constructor(map) {\n super(map);\n }\n next() {\n if (this.index === this.end)\n return { done: true, value: null };\n let key = this.getKeyFromIndex(this.index);\n this.index = this.getNextIndex();\n return { done: false, value: key };\n }\n [Symbol.iterator]() {\n return new StringMapKeyIterator(this.map);\n }\n }\n class StringMapValueIterator extends StringMapIteratorBase {\n constructor(map) {\n super(map);\n }\n next() {\n if (this.index === this.end)\n return { done: true, value: null };\n let element = this.getValueFromIndex(this.index);\n this.index = this.getNextIndex();\n return { done: false, value: element };\n }\n [Symbol.iterator]() {\n return new StringMapValueIterator(this.map);\n }\n }\n let IO;\n (function (IO) {\n let FileType;\n (function (FileType) {\n FileType[FileType[\"Pdf\"] = 0] = \"Pdf\";\n FileType[FileType[\"Fdf\"] = 1] = \"Fdf\";\n })(FileType = IO.FileType || (IO.FileType = {}));\n class InputDocument extends Internal.NativeObject {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n let type = Module.ViewingIOInputDocumentGetType(handle);\n switch (type) {\n case 0:\n return new InputDocument(handle);\n case 1:\n return PdfViewing.IO.InputUri.createDynamicObject(handle);\n case 2:\n return PdfViewing.IO.InputFile.createDynamicObject(handle);\n default:\n return new InputDocument(handle);\n }\n }\n get sourceTag() {\n let retVal = Module.ViewingIOInputDocumentGetSourceTag(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n }\n IO.InputDocument = InputDocument;\n class InputUri extends PdfViewing.IO.InputDocument {\n constructor(uri, httpOptions = null, sourceTag = null) {\n if (arguments[0] && typeof arguments[0].__handle === `number`)\n super(arguments[0].__handle);\n else {\n if (typeof uri !== 'string')\n throw new PdfViewing.ArgumentError(\"Argument 'uri' must be of type string and must not be null or undefined.\");\n if (httpOptions !== null &&\n httpOptions !== undefined &&\n !(httpOptions instanceof PdfViewing.IO.HttpOptions))\n throw new PdfViewing.ArgumentError(\"Argument 'httpOptions' must be of type PdfViewing.IO.HttpOptions or can be null or undefined.\");\n if (sourceTag !== null && sourceTag !== undefined && typeof sourceTag !== 'string')\n throw new PdfViewing.ArgumentError(\"Argument 'sourceTag' must be of type string or can be null or undefined.\");\n super(Internal.NativeObject.checkReturnHandleErrorCode(Module.ViewingIONewInputUri(uri, httpOptions !== null && httpOptions !== undefined ? httpOptions.handle : 0, sourceTag)));\n }\n }\n static createDynamicObject(handle) {\n return new InputUri({ __handle: handle });\n }\n get uri() {\n let retVal = Module.ViewingIOInputUriGetUri(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return retVal;\n }\n }\n IO.InputUri = InputUri;\n class InputFile extends PdfViewing.IO.InputDocument {\n constructor(data, sourceTag = null) {\n if (arguments[0] && typeof arguments[0].__handle === `number`)\n super(arguments[0].__handle);\n else {\n if (!(data instanceof Uint8Array))\n throw new PdfViewing.ArgumentError(\"Argument 'data' must be of type Uint8Array and must not be null or undefined.\");\n if (sourceTag !== null && sourceTag !== undefined && typeof sourceTag !== 'string')\n throw new PdfViewing.ArgumentError(\"Argument 'sourceTag' must be of type string or can be null or undefined.\");\n super(Internal.NativeObject.checkReturnHandleErrorCode(Module.ViewingIONewInputFile(data, sourceTag)));\n }\n }\n static createDynamicObject(handle) {\n return new InputFile({ __handle: handle });\n }\n get data() {\n let retVal = Module.ViewingIOInputFileGetData(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return new Uint8Array(retVal);\n }\n }\n IO.InputFile = InputFile;\n class InputDocumentList extends Internal.NativeObject {\n constructor() {\n if (arguments[0] && typeof arguments[0].__handle === `number`)\n super(arguments[0].__handle);\n else {\n super(Internal.NativeObject.checkReturnHandleErrorCode(Module.ViewingIONewInputDocumentList()));\n }\n }\n static createDynamicObject(handle) {\n return new InputDocumentList({ __handle: handle });\n }\n indexOf(element) {\n for (var i = 0; i < this.size; i++) {\n if (element.equals(this.get(i)))\n return i;\n }\n return -1;\n }\n remove(element) {\n if (!(element instanceof PdfViewing.IO.InputDocument))\n throw new PdfViewing.ArgumentError(\"Argument 'element' must be of type PdfViewing.IO.InputDocument and must not be null or undefined.\");\n let index = this.indexOf(element);\n if (index == -1)\n return false;\n let retVal = Module.ViewingIOInputDocumentListRemove(this.handle, index);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n return true;\n }\n add(element) {\n if (!(element instanceof PdfViewing.IO.InputDocument))\n throw new PdfViewing.ArgumentError(\"Argument 'element' must be of type PdfViewing.IO.InputDocument and must not be null or undefined.\");\n let retVal = Module.ViewingIOInputDocumentListAdd(this.handle, element.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n return true;\n }\n addRange(inputList) {\n throw new Error('Method not implemented.');\n }\n set(index, element) {\n if (!(element instanceof PdfViewing.IO.InputDocument))\n throw new PdfViewing.ArgumentError(\"Argument 'element' must be of type PdfViewing.IO.InputDocument and must not be null or undefined.\");\n let retVal = Module.ViewingIOInputDocumentListSet(this.handle, index, element.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n clear() {\n let retVal = Module.ViewingIOInputDocumentListClear(this.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get(index) {\n let retVal = Module.ViewingIOInputDocumentListGet(this.handle, index);\n if (retVal === 0)\n Internal.NativeBase.throwLastError(false);\n return PdfViewing.IO.InputDocument.createDynamicObject(retVal);\n }\n getRange(index, count) {\n throw new Error('Method not implemented.');\n }\n get size() {\n let retVal = Module.ViewingIOInputDocumentListGetCount(this.handle);\n if (retVal === -1)\n Internal.NativeBase.throwLastError(false);\n return retVal;\n }\n [Symbol.iterator]() {\n return new ListIterator(this);\n }\n }\n IO.InputDocumentList = InputDocumentList;\n class HttpOptions extends Internal.NativeObject {\n constructor() {\n if (arguments[0] && typeof arguments[0].__handle === `number`)\n super(arguments[0].__handle);\n else {\n super(Internal.NativeObject.checkReturnHandleErrorCode(Module.ViewingIONewHttpOptions()));\n }\n }\n static createDynamicObject(handle) {\n return new HttpOptions({ __handle: handle });\n }\n get mode() {\n let retVal = Module.ViewingIOHttpOptionsGetMode(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n set mode(mode) {\n if (mode !== null && mode !== undefined && typeof mode !== 'string')\n throw new PdfViewing.ArgumentError(\"Argument 'mode' must be of type string or can be null or undefined.\");\n let retVal = Module.ViewingIOHttpOptionsSetMode(this.handle, mode);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get cache() {\n let retVal = Module.ViewingIOHttpOptionsGetCache(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n set cache(cache) {\n if (cache !== null && cache !== undefined && typeof cache !== 'string')\n throw new PdfViewing.ArgumentError(\"Argument 'cache' must be of type string or can be null or undefined.\");\n let retVal = Module.ViewingIOHttpOptionsSetCache(this.handle, cache);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get credentials() {\n let retVal = Module.ViewingIOHttpOptionsGetCredentials(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n set credentials(credentials) {\n if (credentials !== null && credentials !== undefined && typeof credentials !== 'string')\n throw new PdfViewing.ArgumentError(\"Argument 'credentials' must be of type string or can be null or undefined.\");\n let retVal = Module.ViewingIOHttpOptionsSetCredentials(this.handle, credentials);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get redirect() {\n let retVal = Module.ViewingIOHttpOptionsGetRedirect(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n set redirect(redirect) {\n if (redirect !== null && redirect !== undefined && typeof redirect !== 'string')\n throw new PdfViewing.ArgumentError(\"Argument 'redirect' must be of type string or can be null or undefined.\");\n let retVal = Module.ViewingIOHttpOptionsSetRedirect(this.handle, redirect);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get referrerPolicy() {\n let retVal = Module.ViewingIOHttpOptionsGetReferrerPolicy(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n set referrerPolicy(referrerPolicy) {\n if (referrerPolicy !== null &&\n referrerPolicy !== undefined &&\n typeof referrerPolicy !== 'string')\n throw new PdfViewing.ArgumentError(\"Argument 'referrerPolicy' must be of type string or can be null or undefined.\");\n let retVal = Module.ViewingIOHttpOptionsSetReferrerPolicy(this.handle, referrerPolicy);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get headers() {\n let retVal = Module.ViewingIOHttpOptionsGetHeaders(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError(false);\n return PdfViewing.StringMap.createDynamicObject(retVal);\n }\n }\n IO.HttpOptions = HttpOptions;\n class MergeOptions extends Internal.NativeObject {\n constructor() {\n if (arguments[0] && typeof arguments[0].__handle === `number`)\n super(arguments[0].__handle);\n else {\n super(Internal.NativeObject.checkReturnHandleErrorCode(Module.ViewingIONewMergeOptions()));\n }\n }\n static createDynamicObject(handle) {\n return new MergeOptions({ __handle: handle });\n }\n get copyLinks() {\n let retVal = Module.ViewingIOMergeOptionsGetCopyLinks(this.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n set copyLinks(copyLinks) {\n if (typeof copyLinks !== 'boolean')\n throw new PdfViewing.ArgumentError(\"Argument 'copyLinks' must be of type boolean and must not be null or undefined.\");\n let retVal = Module.ViewingIOMergeOptionsSetCopyLinks(this.handle, copyLinks);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get copyAnnotations() {\n let retVal = Module.ViewingIOMergeOptionsGetCopyAnnotations(this.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n set copyAnnotations(copyAnnotations) {\n if (typeof copyAnnotations !== 'boolean')\n throw new PdfViewing.ArgumentError(\"Argument 'copyAnnotations' must be of type boolean and must not be null or undefined.\");\n let retVal = Module.ViewingIOMergeOptionsSetCopyAnnotations(this.handle, copyAnnotations);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get copyFormFields() {\n let retVal = Module.ViewingIOMergeOptionsGetCopyFormFields(this.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n set copyFormFields(copyFormFields) {\n if (typeof copyFormFields !== 'boolean')\n throw new PdfViewing.ArgumentError(\"Argument 'copyFormFields' must be of type boolean and must not be null or undefined.\");\n let retVal = Module.ViewingIOMergeOptionsSetCopyFormFields(this.handle, copyFormFields);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get copyOutlines() {\n let retVal = Module.ViewingIOMergeOptionsGetCopyOutlines(this.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n set copyOutlines(copyOutlines) {\n if (typeof copyOutlines !== 'boolean')\n throw new PdfViewing.ArgumentError(\"Argument 'copyOutlines' must be of type boolean and must not be null or undefined.\");\n let retVal = Module.ViewingIOMergeOptionsSetCopyOutlines(this.handle, copyOutlines);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get copyLogicalStructure() {\n let retVal = Module.ViewingIOMergeOptionsGetCopyLogicalStructure(this.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n set copyLogicalStructure(copyLogicalStructure) {\n if (typeof copyLogicalStructure !== 'boolean')\n throw new PdfViewing.ArgumentError(\"Argument 'copyLogicalStructure' must be of type boolean and must not be null or undefined.\");\n let retVal = Module.ViewingIOMergeOptionsSetCopyLogicalStructure(this.handle, copyLogicalStructure);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get copyNamedDestinations() {\n let retVal = Module.ViewingIOMergeOptionsGetCopyNamedDestinations(this.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n set copyNamedDestinations(copyNamedDestinations) {\n if (typeof copyNamedDestinations !== 'boolean')\n throw new PdfViewing.ArgumentError(\"Argument 'copyNamedDestinations' must be of type boolean and must not be null or undefined.\");\n let retVal = Module.ViewingIOMergeOptionsSetCopyNamedDestinations(this.handle, copyNamedDestinations);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get copyUnsignedSignatures() {\n let retVal = Module.ViewingIOMergeOptionsGetCopyUnsignedSignatures(this.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n set copyUnsignedSignatures(copyUnsignedSignatures) {\n if (typeof copyUnsignedSignatures !== 'boolean')\n throw new PdfViewing.ArgumentError(\"Argument 'copyUnsignedSignatures' must be of type boolean and must not be null or undefined.\");\n let retVal = Module.ViewingIOMergeOptionsSetCopyUnsignedSignatures(this.handle, copyUnsignedSignatures);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n }\n IO.MergeOptions = MergeOptions;\n })(IO = PdfViewing.IO || (PdfViewing.IO = {}));\n let Pdf;\n (function (Pdf) {\n let DocumentChange;\n (function (DocumentChange) {\n DocumentChange[DocumentChange[\"NoChange\"] = 0] = \"NoChange\";\n DocumentChange[DocumentChange[\"Annotation\"] = 1] = \"Annotation\";\n DocumentChange[DocumentChange[\"Content\"] = 2] = \"Content\";\n })(DocumentChange = Pdf.DocumentChange || (Pdf.DocumentChange = {}));\n let Compliance;\n (function (Compliance) {\n Compliance[Compliance[\"Unknown\"] = 0] = \"Unknown\";\n Compliance[Compliance[\"Pdf10\"] = 1] = \"Pdf10\";\n Compliance[Compliance[\"Pdf11\"] = 2] = \"Pdf11\";\n Compliance[Compliance[\"Pdf12\"] = 3] = \"Pdf12\";\n Compliance[Compliance[\"Pdf13\"] = 4] = \"Pdf13\";\n Compliance[Compliance[\"Pdf14\"] = 5] = \"Pdf14\";\n Compliance[Compliance[\"Pdf15\"] = 6] = \"Pdf15\";\n Compliance[Compliance[\"Pdf16\"] = 7] = \"Pdf16\";\n Compliance[Compliance[\"Pdf17\"] = 8] = \"Pdf17\";\n Compliance[Compliance[\"Pdf20\"] = 9] = \"Pdf20\";\n Compliance[Compliance[\"PdfA1b\"] = 10] = \"PdfA1b\";\n Compliance[Compliance[\"PdfA1a\"] = 11] = \"PdfA1a\";\n Compliance[Compliance[\"PdfA2b\"] = 12] = \"PdfA2b\";\n Compliance[Compliance[\"PdfA2u\"] = 13] = \"PdfA2u\";\n Compliance[Compliance[\"PdfA2a\"] = 14] = \"PdfA2a\";\n Compliance[Compliance[\"PdfA3b\"] = 15] = \"PdfA3b\";\n Compliance[Compliance[\"PdfA3u\"] = 16] = \"PdfA3u\";\n Compliance[Compliance[\"PdfA3a\"] = 17] = \"PdfA3a\";\n })(Compliance = Pdf.Compliance || (Pdf.Compliance = {}));\n let OutputMedium;\n (function (OutputMedium) {\n OutputMedium[OutputMedium[\"Display\"] = 0] = \"Display\";\n OutputMedium[OutputMedium[\"Print\"] = 1] = \"Print\";\n })(OutputMedium = Pdf.OutputMedium || (Pdf.OutputMedium = {}));\n class RenderOptions extends Internal.NativeObject {\n constructor() {\n if (arguments[0] && typeof arguments[0].__handle === `number`)\n super(arguments[0].__handle);\n else {\n super(Internal.NativeObject.checkReturnHandleErrorCode(Module.ViewingPdfNewRenderOptions()));\n }\n }\n static createDynamicObject(handle) {\n return new RenderOptions({ __handle: handle });\n }\n get formFieldHighlightColor() {\n let retVal = Module.ViewingPdfRenderOptionsGetFormFieldHighlightColor(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return new PdfViewing.Pdf.Annotations.Color(retVal.red, retVal.green, retVal.blue, retVal.alpha);\n }\n set formFieldHighlightColor(formFieldHighlightColor) {\n if (typeof formFieldHighlightColor !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'formFieldHighlightColor' must be of type PdfViewing.Pdf.Annotations.Color and must not be null or undefined.\");\n let retVal = Module.ViewingPdfRenderOptionsSetFormFieldHighlightColor(this.handle, formFieldHighlightColor);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get formFieldRequiredHighlightColor() {\n let retVal = Module.ViewingPdfRenderOptionsGetFormFieldRequiredHighlightColor(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return new PdfViewing.Pdf.Annotations.Color(retVal.red, retVal.green, retVal.blue, retVal.alpha);\n }\n set formFieldRequiredHighlightColor(formFieldRequiredHighlightColor) {\n if (typeof formFieldRequiredHighlightColor !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'formFieldRequiredHighlightColor' must be of type PdfViewing.Pdf.Annotations.Color and must not be null or undefined.\");\n let retVal = Module.ViewingPdfRenderOptionsSetFormFieldRequiredHighlightColor(this.handle, formFieldRequiredHighlightColor);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n set annotationFilter(annotationFilter) {\n if (annotationFilter !== null &&\n annotationFilter !== undefined &&\n typeof annotationFilter !== 'function')\n throw new PdfViewing.ArgumentError(\"Argument 'annotationFilter' must be of type PdfViewing.Pdf.Annotations.AnnotationFilter or can be null or undefined.\");\n let retVal = Module.ViewingPdfRenderOptionsSetAnnotationFilter(this.handle, annotationFilter !== null && annotationFilter !== undefined\n ? new AnnotationFilterWrapper(annotationFilter)\n : null);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get outputMedium() {\n let retVal = Module.ViewingPdfRenderOptionsGetOutputMedium(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n set outputMedium(outputMedium) {\n if (typeof outputMedium !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'outputMedium' must be of type PdfViewing.Pdf.OutputMedium and must not be null or undefined.\");\n let retVal = Module.ViewingPdfRenderOptionsSetOutputMedium(this.handle, outputMedium);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n }\n Pdf.RenderOptions = RenderOptions;\n class ViewOptions extends Internal.NativeObject {\n constructor() {\n if (arguments[0] && typeof arguments[0].__handle === `number`)\n super(arguments[0].__handle);\n else {\n super(Internal.NativeObject.checkReturnHandleErrorCode(Module.ViewingPdfNewViewOptions()));\n }\n }\n static createDynamicObject(handle) {\n return new ViewOptions({ __handle: handle });\n }\n get initialDestination() {\n let retVal = Module.ViewingPdfViewOptionsGetInitialDestination(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal !== 0\n ? PdfViewing.Pdf.Navigation.Destination.createDynamicObject(retVal)\n : null;\n }\n set initialDestination(initialDestination) {\n if (initialDestination !== null &&\n initialDestination !== undefined &&\n !(initialDestination instanceof PdfViewing.Pdf.Navigation.Destination))\n throw new PdfViewing.ArgumentError(\"Argument 'initialDestination' must be of type PdfViewing.Pdf.Navigation.Destination or can be null or undefined.\");\n let retVal = Module.ViewingPdfViewOptionsSetInitialDestination(this.handle, initialDestination !== null && initialDestination !== undefined\n ? initialDestination.handle\n : 0);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get initialFitMode() {\n let retVal = Module.ViewingPdfViewOptionsGetInitialFitMode(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n set initialFitMode(initialFitMode) {\n if (initialFitMode !== null &&\n initialFitMode !== undefined &&\n typeof initialFitMode !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'initialFitMode' must be of type PdfViewing.Pdf.Navigation.FitMode or can be null or undefined.\");\n let retVal = Module.ViewingPdfViewOptionsSetInitialFitMode(this.handle, initialFitMode);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get initialPageLayoutMode() {\n let retVal = Module.ViewingPdfViewOptionsGetInitialPageLayoutMode(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n set initialPageLayoutMode(initialPageLayoutMode) {\n if (initialPageLayoutMode !== null &&\n initialPageLayoutMode !== undefined &&\n typeof initialPageLayoutMode !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'initialPageLayoutMode' must be of type PdfViewing.Pdf.Navigation.PageLayoutMode or can be null or undefined.\");\n let retVal = Module.ViewingPdfViewOptionsSetInitialPageLayoutMode(this.handle, initialPageLayoutMode);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get viewportSize() {\n let retVal = Module.ViewingPdfViewOptionsGetViewportSize(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return new PdfViewing.Pdf.Geometry.Integer.Size(retVal.width, retVal.height);\n }\n set viewportSize(viewportSize) {\n if (typeof viewportSize !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'viewportSize' must be of type PdfViewing.Pdf.Geometry.Integer.Size and must not be null or undefined.\");\n let retVal = Module.ViewingPdfViewOptionsSetViewportSize(this.handle, viewportSize);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get viewDPI() {\n let retVal = Module.ViewingPdfViewOptionsGetViewDPI(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n set viewDPI(viewDPI) {\n if (typeof viewDPI !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'viewDPI' must be of type number and must not be null or undefined.\");\n let retVal = Module.ViewingPdfViewOptionsSetViewDPI(this.handle, viewDPI);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n }\n Pdf.ViewOptions = ViewOptions;\n class SaveOptions extends Internal.NativeObject {\n constructor() {\n if (arguments[0] && typeof arguments[0].__handle === `number`)\n super(arguments[0].__handle);\n else {\n super(Internal.NativeObject.checkReturnHandleErrorCode(Module.ViewingPdfNewSaveOptions()));\n }\n }\n static createDynamicObject(handle) {\n return new SaveOptions({ __handle: handle });\n }\n get fileType() {\n let retVal = Module.ViewingPdfSaveOptionsGetFileType(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n set fileType(fileType) {\n if (typeof fileType !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'fileType' must be of type PdfViewing.IO.FileType and must not be null or undefined.\");\n let retVal = Module.ViewingPdfSaveOptionsSetFileType(this.handle, fileType);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n set annotationFilter(annotationFilter) {\n if (annotationFilter !== null &&\n annotationFilter !== undefined &&\n typeof annotationFilter !== 'function')\n throw new PdfViewing.ArgumentError(\"Argument 'annotationFilter' must be of type PdfViewing.Pdf.Annotations.AnnotationFilter or can be null or undefined.\");\n let retVal = Module.ViewingPdfSaveOptionsSetAnnotationFilter(this.handle, annotationFilter !== null && annotationFilter !== undefined\n ? new AnnotationFilterWrapper(annotationFilter)\n : null);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n set password(password) {\n if (password !== null &&\n password !== undefined &&\n typeof password !== 'string')\n throw new PdfViewing.ArgumentError(\"Argument 'password' must be of type string or can be null or undefined.\");\n let retVal = Module.ViewingPdfSaveOptionsSetPassword(this.handle, password);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n }\n Pdf.SaveOptions = SaveOptions;\n class Page extends Internal.NativeObject {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n return new Page(handle);\n }\n close() {\n if (!Module.ViewingPdfPageClose(this.handle))\n Internal.NativeBase.throwLastError();\n }\n rotatePage(rotateBy) {\n if (typeof rotateBy !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'rotateBy' must be of type PdfViewing.Pdf.Geometry.Rotation and must not be null or undefined.\");\n let retVal = Module.ViewingPdfPageRotatePage(this.handle, rotateBy);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n }\n Pdf.Page = Page;\n class PageList extends Internal.NativeObject {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n return new PageList(handle);\n }\n close() {\n if (!Module.ViewingPdfPageListClose(this.handle))\n Internal.NativeBase.throwLastError();\n }\n remove(element) {\n throw new Error('Method not implemented.');\n }\n add(element) {\n throw new Error('Method not implemented.');\n }\n addRange(inputList) {\n throw new Error('Method not implemented.');\n }\n set(index, element) {\n throw new Error('Method not implemented.');\n }\n clear() {\n throw new Error('Method not implemented.');\n }\n get(index) {\n let retVal = Module.ViewingPdfPageListGet(this.handle, index);\n if (retVal === 0)\n Internal.NativeBase.throwLastError(false);\n return PdfViewing.Pdf.Page.createDynamicObject(retVal);\n }\n getRange(index, count) {\n throw new Error('Method not implemented.');\n }\n get size() {\n let retVal = Module.ViewingPdfPageListGetCount(this.handle);\n if (retVal === -1)\n Internal.NativeBase.throwLastError(false);\n return retVal;\n }\n [Symbol.iterator]() {\n return new ListIterator(this);\n }\n }\n Pdf.PageList = PageList;\n class Document extends Internal.NativeObject {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n return new Document(handle);\n }\n close() {\n if (!Module.ViewingPdfDocumentClose(this.handle))\n Internal.NativeBase.throwLastError();\n }\n saveFile(asFdf) {\n if (typeof asFdf !== 'boolean')\n throw new PdfViewing.ArgumentError(\"Argument 'asFdf' must be of type boolean and must not be null or undefined.\");\n var thisHandle = this;\n return new Promise(function (resolved, rejected) {\n if (!Module.ViewingPdfDocumentSaveFile(thisHandle.handle, { thisHandle, resolved, rejected }, asFdf))\n rejected(Module.ViewingGetLastErrorMessage());\n });\n }\n saveFileCallback(context, retVal, errorCode, errorMessage) {\n let error = null;\n if (retVal === 0)\n error = Internal.NativeBase.createLastError(errorCode, errorMessage, false);\n if (error === null) {\n context.resolved(PdfViewing.Pdf.Content.BinaryBuffer.createDynamicObject(retVal));\n }\n else\n context.rejected(error);\n }\n save(saveOptions = null) {\n if (saveOptions !== null &&\n saveOptions !== undefined &&\n !(saveOptions instanceof PdfViewing.Pdf.SaveOptions))\n throw new PdfViewing.ArgumentError(\"Argument 'saveOptions' must be of type PdfViewing.Pdf.SaveOptions or can be null or undefined.\");\n var thisHandle = this;\n return new Promise(function (resolved, rejected) {\n if (!Module.ViewingPdfDocumentSave(thisHandle.handle, { thisHandle, resolved, rejected }, saveOptions !== null && saveOptions !== undefined ? saveOptions.handle : 0))\n rejected(Module.ViewingGetLastErrorMessage());\n });\n }\n saveCallback(context, retVal, errorCode, errorMessage) {\n let error = null;\n if (retVal === 0)\n error = Internal.NativeBase.createLastError(errorCode, errorMessage, false);\n if (error === null) {\n context.resolved(PdfViewing.Pdf.Content.BinaryBuffer.createDynamicObject(retVal));\n }\n else\n context.rejected(error);\n }\n searchText(text, startPage, isCaseSensitive, isWrappingEnabled, isRegex) {\n if (typeof text !== 'string')\n throw new PdfViewing.ArgumentError(\"Argument 'text' must be of type string and must not be null or undefined.\");\n if (typeof startPage !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'startPage' must be of type number and must not be null or undefined.\");\n if (typeof isCaseSensitive !== 'boolean')\n throw new PdfViewing.ArgumentError(\"Argument 'isCaseSensitive' must be of type boolean and must not be null or undefined.\");\n if (typeof isWrappingEnabled !== 'boolean')\n throw new PdfViewing.ArgumentError(\"Argument 'isWrappingEnabled' must be of type boolean and must not be null or undefined.\");\n if (typeof isRegex !== 'boolean')\n throw new PdfViewing.ArgumentError(\"Argument 'isRegex' must be of type boolean and must not be null or undefined.\");\n let retVal = Module.ViewingPdfDocumentSearchText(this.handle, text, startPage, isCaseSensitive, isWrappingEnabled, isRegex);\n if (retVal === 0)\n Internal.NativeBase.throwLastError(false);\n return PdfViewing.Pdf.Content.TextSearchIterator.createDynamicObject(retVal);\n }\n createAnnotation(annotation) {\n if (!(annotation instanceof PdfViewing.Pdf.Annotations.Annotation))\n throw new PdfViewing.ArgumentError(\"Argument 'annotation' must be of type PdfViewing.Pdf.Annotations.Annotation and must not be null or undefined.\");\n var thisHandle = this;\n return new Promise(function (resolved, rejected) {\n if (!Module.ViewingPdfDocumentCreateAnnotation(thisHandle.handle, { thisHandle, resolved, rejected }, annotation.handle))\n rejected(Module.ViewingGetLastErrorMessage());\n });\n }\n createAnnotationCallback(context, retVal, errorCode, errorMessage) {\n let error = null;\n if (!retVal)\n error = Internal.NativeBase.createLastError(errorCode, errorMessage, false);\n if (error === null) {\n context.resolved();\n }\n else\n context.rejected(error);\n }\n deleteAnnotation(annotation) {\n if (!(annotation instanceof PdfViewing.Pdf.Annotations.Annotation))\n throw new PdfViewing.ArgumentError(\"Argument 'annotation' must be of type PdfViewing.Pdf.Annotations.Annotation and must not be null or undefined.\");\n var thisHandle = this;\n return new Promise(function (resolved, rejected) {\n if (!Module.ViewingPdfDocumentDeleteAnnotation(thisHandle.handle, { thisHandle, resolved, rejected }, annotation.handle))\n rejected(Module.ViewingGetLastErrorMessage());\n });\n }\n deleteAnnotationCallback(context, retVal, errorCode, errorMessage) {\n let error = null;\n if (!retVal)\n error = Internal.NativeBase.createLastError(errorCode, errorMessage, false);\n if (error === null) {\n context.resolved();\n }\n else\n context.rejected(error);\n }\n editAnnotation(annotation) {\n if (!(annotation instanceof PdfViewing.Pdf.Annotations.Annotation))\n throw new PdfViewing.ArgumentError(\"Argument 'annotation' must be of type PdfViewing.Pdf.Annotations.Annotation and must not be null or undefined.\");\n var thisHandle = this;\n return new Promise(function (resolved, rejected) {\n if (!Module.ViewingPdfDocumentEditAnnotation(thisHandle.handle, { thisHandle, resolved, rejected }, annotation.handle))\n rejected(Module.ViewingGetLastErrorMessage());\n });\n }\n editAnnotationCallback(context, retVal, errorCode, errorMessage) {\n let error = null;\n if (!retVal)\n error = Internal.NativeBase.createLastError(errorCode, errorMessage, false);\n if (error === null) {\n context.resolved();\n }\n else\n context.rejected(error);\n }\n getAnnotations(pageNumber) {\n if (typeof pageNumber !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'pageNumber' must be of type number and must not be null or undefined.\");\n var thisHandle = this;\n return new Promise(function (resolved, rejected) {\n if (!Module.ViewingPdfDocumentGetAnnotations(thisHandle.handle, { thisHandle, resolved, rejected }, pageNumber))\n rejected(Module.ViewingGetLastErrorMessage());\n });\n }\n getAnnotationsCallback(context, retVal, errorCode, errorMessage) {\n let error = null;\n if (retVal === 0)\n error = Internal.NativeBase.createLastError(errorCode, errorMessage, false);\n if (error === null) {\n context.resolved(PdfViewing.Pdf.Annotations.AnnotationList.createDynamicObject(retVal));\n }\n else\n context.rejected(error);\n }\n getTextFragments(pageNumber) {\n if (typeof pageNumber !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'pageNumber' must be of type number and must not be null or undefined.\");\n var thisHandle = this;\n return new Promise(function (resolved, rejected) {\n if (!Module.ViewingPdfDocumentGetTextFragments(thisHandle.handle, { thisHandle, resolved, rejected }, pageNumber))\n rejected(Module.ViewingGetLastErrorMessage());\n });\n }\n getTextFragmentsCallback(context, retVal, errorCode, errorMessage) {\n let error = null;\n if (retVal === 0)\n error = Internal.NativeBase.createLastError(errorCode, errorMessage, false);\n if (error === null) {\n context.resolved(PdfViewing.Pdf.Content.TextFragmentList.createDynamicObject(retVal));\n }\n else\n context.rejected(error);\n }\n registerPdfPage(otherDocument, pageNumber) {\n if (!(otherDocument instanceof PdfViewing.Pdf.Document))\n throw new PdfViewing.ArgumentError(\"Argument 'otherDocument' must be of type PdfViewing.Pdf.Document and must not be null or undefined.\");\n if (typeof pageNumber !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'pageNumber' must be of type number and must not be null or undefined.\");\n var thisHandle = this;\n return new Promise(function (resolved, rejected) {\n if (!Module.ViewingPdfDocumentRegisterPdfPage(thisHandle.handle, { thisHandle, resolved, rejected }, otherDocument.handle, pageNumber))\n rejected(Module.ViewingGetLastErrorMessage());\n });\n }\n registerPdfPageCallback(context, retVal, errorCode, errorMessage) {\n let error = null;\n if (retVal === 0)\n error = Internal.NativeBase.createLastError(errorCode, errorMessage);\n if (error === null) {\n context.resolved(retVal);\n }\n else\n context.rejected(error);\n }\n getOutlines(parentOutline) {\n if (parentOutline !== null &&\n parentOutline !== undefined &&\n !(parentOutline instanceof PdfViewing.Pdf.Navigation.OutlineItem))\n throw new PdfViewing.ArgumentError(\"Argument 'parentOutline' must be of type PdfViewing.Pdf.Navigation.OutlineItem or can be null or undefined.\");\n var thisHandle = this;\n return new Promise(function (resolved, rejected) {\n if (!Module.ViewingPdfDocumentGetOutlines(thisHandle.handle, { thisHandle, resolved, rejected }, parentOutline !== null && parentOutline !== undefined ? parentOutline.handle : 0))\n rejected(Module.ViewingGetLastErrorMessage());\n });\n }\n getOutlinesCallback(context, retVal, errorCode, errorMessage) {\n let error = null;\n if (retVal === 0)\n error = Internal.NativeBase.createLastError(errorCode, errorMessage, false);\n if (error === null) {\n context.resolved(PdfViewing.Pdf.Navigation.OutlineItemList.createDynamicObject(retVal));\n }\n else\n context.rejected(error);\n }\n renderPage(pageNumber, width, height, rotate, renderOptions = null) {\n if (typeof pageNumber !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'pageNumber' must be of type number and must not be null or undefined.\");\n if (typeof width !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'width' must be of type number and must not be null or undefined.\");\n if (typeof height !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'height' must be of type number and must not be null or undefined.\");\n if (typeof rotate !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'rotate' must be of type PdfViewing.Pdf.Geometry.Rotation and must not be null or undefined.\");\n if (renderOptions !== null &&\n renderOptions !== undefined &&\n !(renderOptions instanceof PdfViewing.Pdf.RenderOptions))\n throw new PdfViewing.ArgumentError(\"Argument 'renderOptions' must be of type PdfViewing.Pdf.RenderOptions or can be null or undefined.\");\n var thisHandle = this;\n return new Promise(function (resolved, rejected) {\n if (!Module.ViewingPdfDocumentRenderPage(thisHandle.handle, { thisHandle, resolved, rejected }, pageNumber, width, height, rotate, renderOptions !== null && renderOptions !== undefined ? renderOptions.handle : 0))\n rejected(Module.ViewingGetLastErrorMessage());\n });\n }\n renderPageCallback(context, retVal, errorCode, errorMessage) {\n let error = null;\n if (retVal === 0)\n error = Internal.NativeBase.createLastError(errorCode, errorMessage, false);\n if (error === null) {\n context.resolved(PdfViewing.Pdf.Content.Image.createDynamicObject(retVal));\n }\n else\n context.rejected(error);\n }\n getPageSize(page, guess) {\n if (typeof page !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'page' must be of type number and must not be null or undefined.\");\n if (typeof guess !== 'boolean')\n throw new PdfViewing.ArgumentError(\"Argument 'guess' must be of type boolean and must not be null or undefined.\");\n let retVal = Module.ViewingPdfDocumentGetPageSize(this.handle, page, guess);\n if (retVal === null)\n Internal.NativeBase.throwLastError();\n return retVal !== null\n ? new PdfViewing.Pdf.Geometry.Real.Size(retVal.width, retVal.height)\n : null;\n }\n getPagePdfSize(pageNumber) {\n if (typeof pageNumber !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'pageNumber' must be of type number and must not be null or undefined.\");\n var thisHandle = this;\n return new Promise(function (resolved, rejected) {\n if (!Module.ViewingPdfDocumentGetPagePdfSize(thisHandle.handle, { thisHandle, resolved, rejected }, pageNumber))\n rejected(Module.ViewingGetLastErrorMessage());\n });\n }\n getPagePdfSizeCallback(context, retVal, errorCode, errorMessage) {\n let error = null;\n if (retVal === null)\n error = Internal.NativeBase.createLastError(errorCode, errorMessage, false);\n if (error === null) {\n context.resolved(new PdfViewing.Pdf.Geometry.Real.Size(retVal.width, retVal.height));\n }\n else\n context.rejected(error);\n }\n getTextStampAspectRatio(stampText) {\n if (typeof stampText !== 'string')\n throw new PdfViewing.ArgumentError(\"Argument 'stampText' must be of type string and must not be null or undefined.\");\n var thisHandle = this;\n return new Promise(function (resolved, rejected) {\n if (!Module.ViewingPdfDocumentGetTextStampAspectRatio(thisHandle.handle, { thisHandle, resolved, rejected }, stampText))\n rejected(Module.ViewingGetLastErrorMessage());\n });\n }\n getTextStampAspectRatioCallback(context, retVal, errorCode, errorMessage) {\n let error = null;\n if (retVal === 0)\n error = Internal.NativeBase.createLastError(errorCode, errorMessage);\n if (error === null) {\n context.resolved(retVal);\n }\n else\n context.rejected(error);\n }\n registerImage(image) {\n if (!(image instanceof Uint8Array))\n throw new PdfViewing.ArgumentError(\"Argument 'image' must be of type Uint8Array and must not be null or undefined.\");\n var thisHandle = this;\n return new Promise(function (resolved, rejected) {\n if (!Module.ViewingPdfDocumentRegisterImage(thisHandle.handle, { thisHandle, resolved, rejected }, image))\n rejected(Module.ViewingGetLastErrorMessage());\n });\n }\n registerImageCallback(context, retVal, errorCode, errorMessage) {\n let error = null;\n if (retVal === 0)\n error = Internal.NativeBase.createLastError(errorCode, errorMessage);\n if (error === null) {\n context.resolved(retVal);\n }\n else\n context.rejected(error);\n }\n registerImageUri(imageUri, authorization) {\n if (typeof imageUri !== 'string')\n throw new PdfViewing.ArgumentError(\"Argument 'imageUri' must be of type string and must not be null or undefined.\");\n if (authorization !== null &&\n authorization !== undefined &&\n typeof authorization !== 'string')\n throw new PdfViewing.ArgumentError(\"Argument 'authorization' must be of type string or can be null or undefined.\");\n var thisHandle = this;\n return new Promise(function (resolved, rejected) {\n if (!Module.ViewingPdfDocumentRegisterImageUri(thisHandle.handle, { thisHandle, resolved, rejected }, imageUri, authorization))\n rejected(Module.ViewingGetLastErrorMessage());\n });\n }\n registerImageUriCallback(context, retVal, errorCode, errorMessage) {\n let error = null;\n if (retVal === 0)\n error = Internal.NativeBase.createLastError(errorCode, errorMessage);\n if (error === null) {\n context.resolved(retVal);\n }\n else\n context.rejected(error);\n }\n mergeWith(other, mergeOptions = null) {\n if (!(other instanceof PdfViewing.Pdf.Document))\n throw new PdfViewing.ArgumentError(\"Argument 'other' must be of type PdfViewing.Pdf.Document and must not be null or undefined.\");\n if (mergeOptions !== null &&\n mergeOptions !== undefined &&\n !(mergeOptions instanceof PdfViewing.IO.MergeOptions))\n throw new PdfViewing.ArgumentError(\"Argument 'mergeOptions' must be of type PdfViewing.IO.MergeOptions or can be null or undefined.\");\n var thisHandle = this;\n return new Promise(function (resolved, rejected) {\n if (!Module.ViewingPdfDocumentMergeWith(thisHandle.handle, { thisHandle, resolved, rejected }, other.handle, mergeOptions !== null && mergeOptions !== undefined ? mergeOptions.handle : 0))\n rejected(Module.ViewingGetLastErrorMessage());\n });\n }\n mergeWithCallback(context, retVal, errorCode, errorMessage) {\n let error = null;\n if (retVal === 0)\n error = Internal.NativeBase.createLastError(errorCode, errorMessage, false);\n if (error === null) {\n context.resolved(PdfViewing.Pdf.Content.BinaryBuffer.createDynamicObject(retVal));\n }\n else\n context.rejected(error);\n }\n get initialDestination() {\n let retVal = Module.ViewingPdfDocumentGetInitialDestination(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal !== 0\n ? PdfViewing.Pdf.Navigation.Destination.createDynamicObject(retVal)\n : null;\n }\n get hasChanges() {\n let retVal = Module.ViewingPdfDocumentGetHasChanges(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n get pageCount() {\n let retVal = Module.ViewingPdfDocumentGetPageCount(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n get initialPageLayoutMode() {\n let retVal = Module.ViewingPdfDocumentGetInitialPageLayoutMode(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n get compliance() {\n let retVal = Module.ViewingPdfDocumentGetCompliance(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n get pages() {\n let retVal = Module.ViewingPdfDocumentGetPages(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError(false);\n return PdfViewing.Pdf.PageList.createDynamicObject(retVal);\n }\n }\n Pdf.Document = Document;\n class View extends Internal.NativeObject {\n constructor(document, ignoreEmbeddedPreferences) {\n if (arguments[0] && typeof arguments[0].__handle === `number`)\n super(arguments[0].__handle);\n else {\n if (!(document instanceof PdfViewing.Pdf.Document))\n throw new PdfViewing.ArgumentError(\"Argument 'document' must be of type PdfViewing.Pdf.Document and must not be null or undefined.\");\n if (typeof ignoreEmbeddedPreferences !== 'boolean')\n throw new PdfViewing.ArgumentError(\"Argument 'ignoreEmbeddedPreferences' must be of type boolean and must not be null or undefined.\");\n super(Internal.NativeObject.checkReturnHandleErrorCode(Module.ViewingPdfNewView(document.handle, ignoreEmbeddedPreferences)));\n }\n this.eventListeners = new Map();\n }\n addEventListener(type, listener) {\n if (typeof listener !== 'function')\n throw new PdfViewing.ArgumentError(\"Argument 'listener' must be a function.\");\n var eventObj;\n if (this.eventListeners.has(type)) {\n if (!this.eventListeners.get(type).has(listener)) {\n if (type === 'viewUpdated') {\n eventObj = new ViewUpdatedNativeClass(listener);\n let context = Module.ViewingPdfViewAddViewUpdatedHandler(this.handle, eventObj);\n if (context == 0)\n Internal.NativeBase.throwLastError();\n else\n eventObj.context = context;\n this.eventListeners.get(type).set(listener, eventObj);\n }\n }\n if (!this.eventListeners.get(type).has(listener)) {\n if (type === 'imageCreated') {\n eventObj = new ImageCreatedNativeClass(listener);\n let context = Module.ViewingPdfViewAddImageCreatedHandler(this.handle, eventObj);\n if (context == 0)\n Internal.NativeBase.throwLastError();\n else\n eventObj.context = context;\n this.eventListeners.get(type).set(listener, eventObj);\n }\n }\n if (!this.eventListeners.get(type).has(listener)) {\n if (type === 'imageRemovedFromCache') {\n eventObj = new ImageRemovedFromCacheNativeClass(listener);\n let context = Module.ViewingPdfViewAddImageRemovedFromCacheHandler(this.handle, eventObj);\n if (context == 0)\n Internal.NativeBase.throwLastError();\n else\n eventObj.context = context;\n this.eventListeners.get(type).set(listener, eventObj);\n }\n }\n }\n else {\n if (type === 'viewUpdated') {\n eventObj = new ViewUpdatedNativeClass(listener);\n let context = Module.ViewingPdfViewAddViewUpdatedHandler(this.handle, eventObj);\n if (context == 0)\n Internal.NativeBase.throwLastError();\n else\n eventObj.context = context;\n let mapItem = new Map();\n mapItem.set(listener, eventObj);\n this.eventListeners.set(type, mapItem);\n }\n if (type === 'imageCreated') {\n eventObj = new ImageCreatedNativeClass(listener);\n let context = Module.ViewingPdfViewAddImageCreatedHandler(this.handle, eventObj);\n if (context == 0)\n Internal.NativeBase.throwLastError();\n else\n eventObj.context = context;\n let mapItem = new Map();\n mapItem.set(listener, eventObj);\n this.eventListeners.set(type, mapItem);\n }\n if (type === 'imageRemovedFromCache') {\n eventObj = new ImageRemovedFromCacheNativeClass(listener);\n let context = Module.ViewingPdfViewAddImageRemovedFromCacheHandler(this.handle, eventObj);\n if (context == 0)\n Internal.NativeBase.throwLastError();\n else\n eventObj.context = context;\n let mapItem = new Map();\n mapItem.set(listener, eventObj);\n this.eventListeners.set(type, mapItem);\n }\n }\n }\n removeEventListener(type, listener) {\n if (this.eventListeners.has(type)) {\n if (type === 'viewUpdated') {\n let listeners = this.eventListeners.get(type);\n if (listeners.has(listener)) {\n let eventObj = listeners.get(listener);\n try {\n if (!Module.ViewingPdfViewRemoveViewUpdatedHandler(this.handle, eventObj === null || eventObj === void 0 ? void 0 : eventObj.context))\n Internal.NativeBase.throwLastError();\n }\n catch (err) {\n if (err instanceof NotFoundError)\n throw err;\n }\n listeners.delete(listener);\n if (listeners.size === 0)\n this.eventListeners.delete('viewUpdated');\n }\n }\n if (type === 'imageCreated') {\n let listeners = this.eventListeners.get(type);\n if (listeners.has(listener)) {\n let eventObj = listeners.get(listener);\n try {\n if (!Module.ViewingPdfViewRemoveImageCreatedHandler(this.handle, eventObj === null || eventObj === void 0 ? void 0 : eventObj.context))\n Internal.NativeBase.throwLastError();\n }\n catch (err) {\n if (err instanceof NotFoundError)\n throw err;\n }\n listeners.delete(listener);\n if (listeners.size === 0)\n this.eventListeners.delete('imageCreated');\n }\n }\n if (type === 'imageRemovedFromCache') {\n let listeners = this.eventListeners.get(type);\n if (listeners.has(listener)) {\n let eventObj = listeners.get(listener);\n try {\n if (!Module.ViewingPdfViewRemoveImageRemovedFromCacheHandler(this.handle, eventObj === null || eventObj === void 0 ? void 0 : eventObj.context))\n Internal.NativeBase.throwLastError();\n }\n catch (err) {\n if (err instanceof NotFoundError)\n throw err;\n }\n listeners.delete(listener);\n if (listeners.size === 0)\n this.eventListeners.delete('imageRemovedFromCache');\n }\n }\n }\n }\n static createDynamicObject(handle) {\n return new View({ __handle: handle });\n }\n close() {\n if (!Module.ViewingPdfViewClose(this.handle))\n Internal.NativeBase.throwLastError();\n }\n static create(document, renderOptions, viewOptions) {\n if (!(document instanceof PdfViewing.Pdf.Document))\n throw new PdfViewing.ArgumentError(\"Argument 'document' must be of type PdfViewing.Pdf.Document and must not be null or undefined.\");\n if (renderOptions !== null &&\n renderOptions !== undefined &&\n !(renderOptions instanceof PdfViewing.Pdf.RenderOptions))\n throw new PdfViewing.ArgumentError(\"Argument 'renderOptions' must be of type PdfViewing.Pdf.RenderOptions or can be null or undefined.\");\n if (viewOptions !== null &&\n viewOptions !== undefined &&\n !(viewOptions instanceof PdfViewing.Pdf.ViewOptions))\n throw new PdfViewing.ArgumentError(\"Argument 'viewOptions' must be of type PdfViewing.Pdf.ViewOptions or can be null or undefined.\");\n let retVal = Module.ViewingPdfViewCreate(document.handle, renderOptions !== null && renderOptions !== undefined ? renderOptions.handle : 0, viewOptions !== null && viewOptions !== undefined ? viewOptions.handle : 0);\n if (retVal === 0)\n Internal.NativeBase.throwLastError(false);\n return PdfViewing.Pdf.View.createDynamicObject(retVal);\n }\n suspendDrawing() {\n let retVal = Module.ViewingPdfViewSuspendDrawing(this.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n resumeDrawing() {\n let retVal = Module.ViewingPdfViewResumeDrawing(this.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n goToDestination(destination) {\n if (!(destination instanceof PdfViewing.Pdf.Navigation.Destination))\n throw new PdfViewing.ArgumentError(\"Argument 'destination' must be of type PdfViewing.Pdf.Navigation.Destination and must not be null or undefined.\");\n let retVal = Module.ViewingPdfViewGoToDestination(this.handle, destination.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n goToRectangle(rectangle) {\n if (typeof rectangle !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'rectangle' must be of type PdfViewing.Pdf.Geometry.Real.RectangleOnPage and must not be null or undefined.\");\n let retVal = Module.ViewingPdfViewGoToRectangle(this.handle, rectangle);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n getTextFragmentsOnPoint(point) {\n if (typeof point !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'point' must be of type PdfViewing.Pdf.Geometry.Integer.Point and must not be null or undefined.\");\n let retVal = Module.ViewingPdfViewGetTextFragmentsOnPoint(this.handle, point);\n if (retVal === 0)\n Internal.NativeBase.throwLastError(false);\n return PdfViewing.Pdf.Content.TextFragmentList.createDynamicObject(retVal);\n }\n getTextFragments(pageNumber) {\n if (typeof pageNumber !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'pageNumber' must be of type number and must not be null or undefined.\");\n let retVal = Module.ViewingPdfViewGetTextFragments(this.handle, pageNumber);\n if (retVal === 0)\n Internal.NativeBase.throwLastError(false);\n return PdfViewing.Pdf.Content.TextFragmentList.createDynamicObject(retVal);\n }\n getRectangularTextSelection(startPoint, endPoint) {\n if (typeof startPoint !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'startPoint' must be of type PdfViewing.Pdf.Geometry.Real.PointOnPage and must not be null or undefined.\");\n if (typeof endPoint !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'endPoint' must be of type PdfViewing.Pdf.Geometry.Real.PointOnPage and must not be null or undefined.\");\n let retVal = Module.ViewingPdfViewGetRectangularTextSelection(this.handle, startPoint, endPoint);\n if (retVal === 0)\n Internal.NativeBase.throwLastError(false);\n return PdfViewing.Pdf.Content.TextSelection.createDynamicObject(retVal);\n }\n getTextSelection(startPoint, endPoint) {\n if (typeof startPoint !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'startPoint' must be of type PdfViewing.Pdf.Geometry.Real.PointOnPage and must not be null or undefined.\");\n if (typeof endPoint !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'endPoint' must be of type PdfViewing.Pdf.Geometry.Real.PointOnPage and must not be null or undefined.\");\n let retVal = Module.ViewingPdfViewGetTextSelection(this.handle, startPoint, endPoint);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal !== 0\n ? PdfViewing.Pdf.Content.TextSelection.createDynamicObject(retVal)\n : null;\n }\n getWordOnPoint(point) {\n if (typeof point !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'point' must be of type PdfViewing.Pdf.Geometry.Real.PointOnPage and must not be null or undefined.\");\n let retVal = Module.ViewingPdfViewGetWordOnPoint(this.handle, point);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal !== 0\n ? PdfViewing.Pdf.Content.TextSelection.createDynamicObject(retVal)\n : null;\n }\n getAnnotationsOnPoint(point, onlySelectable) {\n if (typeof point !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'point' must be of type PdfViewing.Pdf.Geometry.Integer.Point and must not be null or undefined.\");\n if (typeof onlySelectable !== 'boolean')\n throw new PdfViewing.ArgumentError(\"Argument 'onlySelectable' must be of type boolean and must not be null or undefined.\");\n let retVal = Module.ViewingPdfViewGetAnnotationsOnPoint(this.handle, point, onlySelectable);\n if (retVal === 0)\n Internal.NativeBase.throwLastError(false);\n return PdfViewing.Pdf.Annotations.AnnotationList.createDynamicObject(retVal);\n }\n getRenderedResults() {\n let retVal = Module.ViewingPdfViewGetRenderedResults(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError(false);\n return PdfViewing.Pdf.Content.RenderResults.createDynamicObject(retVal);\n }\n transformPointFromViewportToPage(pointOnViewport, snapToPage) {\n if (typeof pointOnViewport !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'pointOnViewport' must be of type PdfViewing.Pdf.Geometry.Integer.Point and must not be null or undefined.\");\n if (typeof snapToPage !== 'boolean')\n throw new PdfViewing.ArgumentError(\"Argument 'snapToPage' must be of type boolean and must not be null or undefined.\");\n let retVal = Module.ViewingPdfViewTransformPointFromViewportToPage(this.handle, pointOnViewport, snapToPage);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return new PdfViewing.Pdf.Geometry.Real.PointOnPage(retVal.pageNumber, retVal.x, retVal.y);\n }\n transformPointFromViewportToSpecificPage(pointOnViewport, pageNumber, snapToPage) {\n if (typeof pointOnViewport !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'pointOnViewport' must be of type PdfViewing.Pdf.Geometry.Integer.Point and must not be null or undefined.\");\n if (typeof pageNumber !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'pageNumber' must be of type number and must not be null or undefined.\");\n if (typeof snapToPage !== 'boolean')\n throw new PdfViewing.ArgumentError(\"Argument 'snapToPage' must be of type boolean and must not be null or undefined.\");\n let retVal = Module.ViewingPdfViewTransformPointFromViewportToSpecificPage(this.handle, pointOnViewport, pageNumber, snapToPage);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return new PdfViewing.Pdf.Geometry.Real.PointOnPage(retVal.pageNumber, retVal.x, retVal.y);\n }\n transformRectangleFromViewportToSpecificPage(rectangleOnViewport, pageNumber) {\n if (typeof rectangleOnViewport !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'rectangleOnViewport' must be of type PdfViewing.Pdf.Geometry.Integer.Rectangle and must not be null or undefined.\");\n if (typeof pageNumber !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'pageNumber' must be of type number and must not be null or undefined.\");\n let retVal = Module.ViewingPdfViewTransformRectangleFromViewportToSpecificPage(this.handle, rectangleOnViewport, pageNumber);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return new PdfViewing.Pdf.Geometry.Real.RectangleOnPage(retVal.pageNumber, retVal.x, retVal.y, retVal.width, retVal.height);\n }\n transformPointFromPageToViewport(pointOnPage) {\n if (typeof pointOnPage !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'pointOnPage' must be of type PdfViewing.Pdf.Geometry.Real.PointOnPage and must not be null or undefined.\");\n let retVal = Module.ViewingPdfViewTransformPointFromPageToViewport(this.handle, pointOnPage);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return new PdfViewing.Pdf.Geometry.Integer.Point(retVal.x, retVal.y);\n }\n transformRectangleFromPageToViewport(rectangleOnPage) {\n if (typeof rectangleOnPage !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'rectangleOnPage' must be of type PdfViewing.Pdf.Geometry.Real.RectangleOnPage and must not be null or undefined.\");\n let retVal = Module.ViewingPdfViewTransformRectangleFromPageToViewport(this.handle, rectangleOnPage);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return new PdfViewing.Pdf.Geometry.Integer.Rectangle(retVal.x, retVal.y, retVal.width, retVal.height);\n }\n getPageRectangleOnViewport(pageNumber) {\n if (typeof pageNumber !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'pageNumber' must be of type number and must not be null or undefined.\");\n let retVal = Module.ViewingPdfViewGetPageRectangleOnViewport(this.handle, pageNumber);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return new PdfViewing.Pdf.Geometry.Integer.Rectangle(retVal.x, retVal.y, retVal.width, retVal.height);\n }\n transformPdfLengthToViewportLength(pdfLength) {\n if (typeof pdfLength !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'pdfLength' must be of type number and must not be null or undefined.\");\n let retVal = Module.ViewingPdfViewTransformPdfLengthToViewportLength(this.handle, pdfLength);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n transformViewportLengthToPdfLength(screenLength) {\n if (typeof screenLength !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'screenLength' must be of type number and must not be null or undefined.\");\n let retVal = Module.ViewingPdfViewTransformViewportLengthToPdfLength(this.handle, screenLength);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n zoomOnLocation(zoom, location) {\n if (typeof zoom !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'zoom' must be of type number and must not be null or undefined.\");\n if (typeof location !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'location' must be of type PdfViewing.Pdf.Geometry.Integer.Point and must not be null or undefined.\");\n let retVal = Module.ViewingPdfViewZoomOnLocation(this.handle, zoom, location);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get pageNumber() {\n let retVal = Module.ViewingPdfViewGetPageNumber(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n set pageNumber(pageNumber) {\n if (typeof pageNumber !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'pageNumber' must be of type number and must not be null or undefined.\");\n let retVal = Module.ViewingPdfViewSetPageNumber(this.handle, pageNumber);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get firstVisiblePage() {\n let retVal = Module.ViewingPdfViewGetFirstVisiblePage(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n get lastVisiblePage() {\n let retVal = Module.ViewingPdfViewGetLastVisiblePage(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n get zoom() {\n let retVal = Module.ViewingPdfViewGetZoom(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n set zoom(zoom) {\n if (typeof zoom !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'zoom' must be of type number and must not be null or undefined.\");\n let retVal = Module.ViewingPdfViewSetZoom(this.handle, zoom);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get scrollPosition() {\n let retVal = Module.ViewingPdfViewGetScrollPosition(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return new PdfViewing.Pdf.Geometry.Integer.ScrollPosition(retVal.x, retVal.y);\n }\n set scrollPosition(scrollPosition) {\n if (typeof scrollPosition !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'scrollPosition' must be of type PdfViewing.Pdf.Geometry.Integer.ScrollPosition and must not be null or undefined.\");\n let retVal = Module.ViewingPdfViewSetScrollPosition(this.handle, scrollPosition);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get scrollMaxPosition() {\n let retVal = Module.ViewingPdfViewGetScrollMaxPosition(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return new PdfViewing.Pdf.Geometry.Integer.ScrollPosition(retVal.x, retVal.y);\n }\n get viewRotation() {\n let retVal = Module.ViewingPdfViewGetViewRotation(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n set viewRotation(viewRotation) {\n if (typeof viewRotation !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'viewRotation' must be of type PdfViewing.Pdf.Geometry.Rotation and must not be null or undefined.\");\n let retVal = Module.ViewingPdfViewSetViewRotation(this.handle, viewRotation);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get fitMode() {\n let retVal = Module.ViewingPdfViewGetFitMode(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n set fitMode(fitMode) {\n if (typeof fitMode !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'fitMode' must be of type PdfViewing.Pdf.Navigation.FitMode and must not be null or undefined.\");\n let retVal = Module.ViewingPdfViewSetFitMode(this.handle, fitMode);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get pageLayoutMode() {\n let retVal = Module.ViewingPdfViewGetPageLayoutMode(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n set pageLayoutMode(pageLayoutMode) {\n if (typeof pageLayoutMode !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'pageLayoutMode' must be of type PdfViewing.Pdf.Navigation.PageLayoutMode and must not be null or undefined.\");\n let retVal = Module.ViewingPdfViewSetPageLayoutMode(this.handle, pageLayoutMode);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get borderSize() {\n let retVal = Module.ViewingPdfViewGetBorderSize(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n set borderSize(borderSize) {\n if (typeof borderSize !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'borderSize' must be of type number and must not be null or undefined.\");\n let retVal = Module.ViewingPdfViewSetBorderSize(this.handle, borderSize);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get canvasMargin() {\n let retVal = Module.ViewingPdfViewGetCanvasMargin(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return new PdfViewing.Pdf.Geometry.Integer.Padding(retVal.left, retVal.right, retVal.top, retVal.bottom);\n }\n set canvasMargin(canvasMargin) {\n if (typeof canvasMargin !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'canvasMargin' must be of type PdfViewing.Pdf.Geometry.Integer.Padding and must not be null or undefined.\");\n let retVal = Module.ViewingPdfViewSetCanvasMargin(this.handle, canvasMargin);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get screenDPI() {\n let retVal = Module.ViewingPdfViewGetScreenDPI(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n set screenDPI(screenDPI) {\n if (typeof screenDPI !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'screenDPI' must be of type number and must not be null or undefined.\");\n let retVal = Module.ViewingPdfViewSetScreenDPI(this.handle, screenDPI);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get byteorder() {\n let retVal = Module.ViewingPdfViewGetByteorder(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n set byteorder(byteorder) {\n if (typeof byteorder !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'byteorder' must be of type PdfViewing.Pdf.Content.Byteorder and must not be null or undefined.\");\n let retVal = Module.ViewingPdfViewSetByteorder(this.handle, byteorder);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get viewportSize() {\n let retVal = Module.ViewingPdfViewGetViewportSize(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return new PdfViewing.Pdf.Geometry.Integer.Size(retVal.width, retVal.height);\n }\n set viewportSize(viewportSize) {\n if (typeof viewportSize !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'viewportSize' must be of type PdfViewing.Pdf.Geometry.Integer.Size and must not be null or undefined.\");\n let retVal = Module.ViewingPdfViewSetViewportSize(this.handle, viewportSize);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n }\n Pdf.View = View;\n class EventViewNativeBase {\n constructor(listener) {\n this.listener = listener;\n }\n }\n class ViewUpdatedNativeClass extends EventViewNativeBase {\n constructor(listener) {\n super(listener);\n }\n dispatchEventViewUpdated(visisblePageRangeChanged, pageNumberChanged, zoomChanged, fitmodeChanged, pageLayoutModeChanged, viewRotationChanged, scrollMaxPositionChanged, pageSizeUpdated, bitmapsUpdated) {\n this.listener({\n visisblePageRangeChanged,\n pageNumberChanged,\n zoomChanged,\n fitmodeChanged,\n pageLayoutModeChanged,\n viewRotationChanged,\n scrollMaxPositionChanged,\n pageSizeUpdated,\n bitmapsUpdated,\n });\n }\n }\n class ImageCreatedNativeClass extends EventViewNativeBase {\n constructor(listener) {\n super(listener);\n }\n dispatchEventImageCreated(image) {\n this.listener(PdfViewing.Pdf.Content.Image.createDynamicObject(image));\n }\n }\n class ImageRemovedFromCacheNativeClass extends EventViewNativeBase {\n constructor(listener) {\n super(listener);\n }\n dispatchEventImageRemovedFromCache(Id) {\n this.listener(Id);\n }\n }\n let Annotations;\n (function (Annotations) {\n class Color extends Internal.NativeBase {\n constructor(red, green, blue, alpha) {\n super();\n if (typeof red !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'red' must be of type number and must not be null or undefined.\");\n if (typeof green !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'green' must be of type number and must not be null or undefined.\");\n if (typeof blue !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'blue' must be of type number and must not be null or undefined.\");\n if (typeof alpha !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'alpha' must be of type number and must not be null or undefined.\");\n this.red = red;\n this.green = green;\n this.blue = blue;\n this.alpha = alpha;\n }\n equals(obj) {\n if (obj === null)\n return false;\n if (this.red !== obj.red)\n return false;\n if (this.green !== obj.green)\n return false;\n if (this.blue !== obj.blue)\n return false;\n if (this.alpha !== obj.alpha)\n return false;\n return true;\n }\n }\n Annotations.Color = Color;\n let TextStampType;\n (function (TextStampType) {\n TextStampType[TextStampType[\"Approved\"] = 0] = \"Approved\";\n TextStampType[TextStampType[\"Experimental\"] = 1] = \"Experimental\";\n TextStampType[TextStampType[\"NotApproved\"] = 2] = \"NotApproved\";\n TextStampType[TextStampType[\"AsIs\"] = 3] = \"AsIs\";\n TextStampType[TextStampType[\"Expired\"] = 4] = \"Expired\";\n TextStampType[TextStampType[\"NotForPublicRelease\"] = 5] = \"NotForPublicRelease\";\n TextStampType[TextStampType[\"Confidential\"] = 6] = \"Confidential\";\n TextStampType[TextStampType[\"Final\"] = 7] = \"Final\";\n TextStampType[TextStampType[\"Sold\"] = 8] = \"Sold\";\n TextStampType[TextStampType[\"Departmental\"] = 9] = \"Departmental\";\n TextStampType[TextStampType[\"ForComment\"] = 10] = \"ForComment\";\n TextStampType[TextStampType[\"TopSecret\"] = 11] = \"TopSecret\";\n TextStampType[TextStampType[\"Draft\"] = 12] = \"Draft\";\n TextStampType[TextStampType[\"ForPublicRelease\"] = 13] = \"ForPublicRelease\";\n })(TextStampType = Annotations.TextStampType || (Annotations.TextStampType = {}));\n let StampColor;\n (function (StampColor) {\n StampColor[StampColor[\"Green\"] = 0] = \"Green\";\n StampColor[StampColor[\"Red\"] = 1] = \"Red\";\n StampColor[StampColor[\"Blue\"] = 2] = \"Blue\";\n })(StampColor = Annotations.StampColor || (Annotations.StampColor = {}));\n let FileAttachmentIcon;\n (function (FileAttachmentIcon) {\n FileAttachmentIcon[FileAttachmentIcon[\"Graph\"] = 0] = \"Graph\";\n FileAttachmentIcon[FileAttachmentIcon[\"PushPin\"] = 1] = \"PushPin\";\n FileAttachmentIcon[FileAttachmentIcon[\"Paperclip\"] = 2] = \"Paperclip\";\n FileAttachmentIcon[FileAttachmentIcon[\"Tag\"] = 3] = \"Tag\";\n FileAttachmentIcon[FileAttachmentIcon[\"CustomIcon\"] = 127] = \"CustomIcon\";\n })(FileAttachmentIcon = Annotations.FileAttachmentIcon || (Annotations.FileAttachmentIcon = {}));\n let BorderStyleType;\n (function (BorderStyleType) {\n BorderStyleType[BorderStyleType[\"Lined\"] = 0] = \"Lined\";\n BorderStyleType[BorderStyleType[\"Beveled\"] = 1] = \"Beveled\";\n BorderStyleType[BorderStyleType[\"Inset\"] = 2] = \"Inset\";\n BorderStyleType[BorderStyleType[\"Underline\"] = 3] = \"Underline\";\n })(BorderStyleType = Annotations.BorderStyleType || (Annotations.BorderStyleType = {}));\n let LineEnding;\n (function (LineEnding) {\n LineEnding[LineEnding[\"None\"] = 0] = \"None\";\n LineEnding[LineEnding[\"OpenArrow\"] = 1] = \"OpenArrow\";\n LineEnding[LineEnding[\"ClosedArrow\"] = 2] = \"ClosedArrow\";\n LineEnding[LineEnding[\"rectangle\"] = 3] = \"rectangle\";\n LineEnding[LineEnding[\"Circle\"] = 4] = \"Circle\";\n LineEnding[LineEnding[\"Diamond\"] = 5] = \"Diamond\";\n LineEnding[LineEnding[\"Butt\"] = 6] = \"Butt\";\n LineEnding[LineEnding[\"ReversedOpenArrow\"] = 7] = \"ReversedOpenArrow\";\n LineEnding[LineEnding[\"ReversedClosedArrow\"] = 8] = \"ReversedClosedArrow\";\n LineEnding[LineEnding[\"Slash\"] = 9] = \"Slash\";\n })(LineEnding = Annotations.LineEnding || (Annotations.LineEnding = {}));\n class Annotation extends Internal.NativeObject {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n let type = Module.ViewingPdfAnnotsAnnotationGetType(handle);\n switch (type) {\n case 0:\n return new Annotation(handle);\n case 1:\n return PdfViewing.Pdf.Annotations.MarkupAnnotation.createDynamicObject(handle);\n case 2:\n return PdfViewing.Pdf.Annotations.StickyNote.createDynamicObject(handle);\n case 3:\n return PdfViewing.Pdf.Annotations.FileAttachment.createDynamicObject(handle);\n case 4:\n return PdfViewing.Pdf.Annotations.Stamp.createDynamicObject(handle);\n case 5:\n return PdfViewing.Pdf.Annotations.TextStamp.createDynamicObject(handle);\n case 6:\n return PdfViewing.Pdf.Annotations.CustomTextStamp.createDynamicObject(handle);\n case 7:\n return PdfViewing.Pdf.Annotations.CustomImageStamp.createDynamicObject(handle);\n case 8:\n return PdfViewing.Pdf.Annotations.FreeText.createDynamicObject(handle);\n case 9:\n return PdfViewing.Pdf.Annotations.DrawingAnnotation.createDynamicObject(handle);\n case 10:\n return PdfViewing.Pdf.Annotations.LineAnnotation.createDynamicObject(handle);\n case 11:\n return PdfViewing.Pdf.Annotations.InkAnnotation.createDynamicObject(handle);\n case 12:\n return PdfViewing.Pdf.Annotations.PolyLineAnnotation.createDynamicObject(handle);\n case 13:\n return PdfViewing.Pdf.Annotations.PolygonAnnotation.createDynamicObject(handle);\n case 14:\n return PdfViewing.Pdf.Annotations.RectangleAnnotation.createDynamicObject(handle);\n case 15:\n return PdfViewing.Pdf.Annotations.EllipseAnnotation.createDynamicObject(handle);\n case 16:\n return PdfViewing.Pdf.Annotations.TextMarkup.createDynamicObject(handle);\n case 17:\n return PdfViewing.Pdf.Annotations.Highlight.createDynamicObject(handle);\n case 18:\n return PdfViewing.Pdf.Annotations.Underline.createDynamicObject(handle);\n case 19:\n return PdfViewing.Pdf.Annotations.StrikeThrough.createDynamicObject(handle);\n case 20:\n return PdfViewing.Pdf.Annotations.Squiggly.createDynamicObject(handle);\n case 21:\n return PdfViewing.Pdf.Annotations.TextInsert.createDynamicObject(handle);\n case 22:\n return PdfViewing.Pdf.Annotations.Link.createDynamicObject(handle);\n case 23:\n return PdfViewing.Pdf.Annotations.InternalLink.createDynamicObject(handle);\n case 24:\n return PdfViewing.Pdf.Annotations.WebLink.createDynamicObject(handle);\n case 25:\n return PdfViewing.Pdf.Annotations.EmbeddedPdfLink.createDynamicObject(handle);\n case 26:\n return PdfViewing.Pdf.Forms.Widget.createDynamicObject(handle);\n case 27:\n return PdfViewing.Pdf.Forms.CheckBox.createDynamicObject(handle);\n case 28:\n return PdfViewing.Pdf.Forms.RadioButton.createDynamicObject(handle);\n case 29:\n return PdfViewing.Pdf.Forms.TextBox.createDynamicObject(handle);\n case 30:\n return PdfViewing.Pdf.Forms.ListBox.createDynamicObject(handle);\n case 31:\n return PdfViewing.Pdf.Forms.ComboBox.createDynamicObject(handle);\n default:\n return new Annotation(handle);\n }\n }\n close() {\n if (!Module.ViewingPdfAnnotsAnnotationClose(this.handle))\n Internal.NativeBase.throwLastError();\n }\n get boundingBox() {\n let retVal = Module.ViewingPdfAnnotsAnnotationGetBoundingBox(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return new PdfViewing.Pdf.Geometry.Real.RectangleOnPage(retVal.pageNumber, retVal.x, retVal.y, retVal.width, retVal.height);\n }\n set boundingBox(boundingBox) {\n if (typeof boundingBox !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'boundingBox' must be of type PdfViewing.Pdf.Geometry.Real.RectangleOnPage and must not be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsAnnotationSetBoundingBox(this.handle, boundingBox);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get hidden() {\n let retVal = Module.ViewingPdfAnnotsAnnotationGetHidden(this.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n set hidden(hidden) {\n if (typeof hidden !== 'boolean')\n throw new PdfViewing.ArgumentError(\"Argument 'hidden' must be of type boolean and must not be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsAnnotationSetHidden(this.handle, hidden);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get noPrint() {\n let retVal = Module.ViewingPdfAnnotsAnnotationGetNoPrint(this.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n set noPrint(noPrint) {\n if (typeof noPrint !== 'boolean')\n throw new PdfViewing.ArgumentError(\"Argument 'noPrint' must be of type boolean and must not be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsAnnotationSetNoPrint(this.handle, noPrint);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get noZoom() {\n let retVal = Module.ViewingPdfAnnotsAnnotationGetNoZoom(this.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n get noRotate() {\n let retVal = Module.ViewingPdfAnnotsAnnotationGetNoRotate(this.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n set noRotate(noRotate) {\n if (typeof noRotate !== 'boolean')\n throw new PdfViewing.ArgumentError(\"Argument 'noRotate' must be of type boolean and must not be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsAnnotationSetNoRotate(this.handle, noRotate);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get name() {\n let retVal = Module.ViewingPdfAnnotsAnnotationGetName(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return retVal;\n }\n get privateData() {\n let retVal = Module.ViewingPdfAnnotsAnnotationGetPrivateData(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return retVal;\n }\n set privateData(privateData) {\n if (typeof privateData !== 'string')\n throw new PdfViewing.ArgumentError(\"Argument 'privateData' must be of type string and must not be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsAnnotationSetPrivateData(this.handle, privateData);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get sourceTag() {\n let retVal = Module.ViewingPdfAnnotsAnnotationGetSourceTag(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n }\n Annotations.Annotation = Annotation;\n class MarkupInfo extends Internal.NativeObject {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n return new MarkupInfo(handle);\n }\n close() {\n if (!Module.ViewingPdfAnnotsMarkupInfoClose(this.handle))\n Internal.NativeBase.throwLastError();\n }\n get creationDate() {\n let retVal = Module.ViewingPdfAnnotsMarkupInfoGetCreationDate(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n get modificationDate() {\n let retVal = Module.ViewingPdfAnnotsMarkupInfoGetModificationDate(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n get locked() {\n let retVal = Module.ViewingPdfAnnotsMarkupInfoGetLocked(this.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n set locked(locked) {\n if (typeof locked !== 'boolean')\n throw new PdfViewing.ArgumentError(\"Argument 'locked' must be of type boolean and must not be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsMarkupInfoSetLocked(this.handle, locked);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get author() {\n let retVal = Module.ViewingPdfAnnotsMarkupInfoGetAuthor(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return retVal;\n }\n set author(author) {\n if (typeof author !== 'string')\n throw new PdfViewing.ArgumentError(\"Argument 'author' must be of type string and must not be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsMarkupInfoSetAuthor(this.handle, author);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get subject() {\n let retVal = Module.ViewingPdfAnnotsMarkupInfoGetSubject(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return retVal;\n }\n set subject(subject) {\n if (typeof subject !== 'string')\n throw new PdfViewing.ArgumentError(\"Argument 'subject' must be of type string and must not be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsMarkupInfoSetSubject(this.handle, subject);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get content() {\n let retVal = Module.ViewingPdfAnnotsMarkupInfoGetContent(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return retVal;\n }\n set content(content) {\n if (typeof content !== 'string')\n throw new PdfViewing.ArgumentError(\"Argument 'content' must be of type string and must not be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsMarkupInfoSetContent(this.handle, content);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n }\n Annotations.MarkupInfo = MarkupInfo;\n class MarkupInfoList extends Internal.NativeObject {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n return new MarkupInfoList(handle);\n }\n close() {\n if (!Module.ViewingPdfAnnotsMarkupInfoListClose(this.handle))\n Internal.NativeBase.throwLastError();\n }\n remove(element) {\n throw new Error('Method not implemented.');\n }\n add(element) {\n throw new Error('Method not implemented.');\n }\n addRange(inputList) {\n throw new Error('Method not implemented.');\n }\n set(index, element) {\n throw new Error('Method not implemented.');\n }\n clear() {\n throw new Error('Method not implemented.');\n }\n get(index) {\n let retVal = Module.ViewingPdfAnnotsMarkupInfoListGet(this.handle, index);\n if (retVal === 0)\n Internal.NativeBase.throwLastError(false);\n return PdfViewing.Pdf.Annotations.MarkupInfo.createDynamicObject(retVal);\n }\n getRange(index, count) {\n throw new Error('Method not implemented.');\n }\n get size() {\n let retVal = Module.ViewingPdfAnnotsMarkupInfoListGetCount(this.handle);\n if (retVal === -1)\n Internal.NativeBase.throwLastError(false);\n return retVal;\n }\n [Symbol.iterator]() {\n return new ListIterator(this);\n }\n }\n Annotations.MarkupInfoList = MarkupInfoList;\n class Popup extends Internal.NativeObject {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n return new Popup(handle);\n }\n close() {\n if (!Module.ViewingPdfAnnotsPopupClose(this.handle))\n Internal.NativeBase.throwLastError();\n }\n get isOpen() {\n let retVal = Module.ViewingPdfAnnotsPopupGetIsOpen(this.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n set isOpen(isOpen) {\n if (typeof isOpen !== 'boolean')\n throw new PdfViewing.ArgumentError(\"Argument 'isOpen' must be of type boolean and must not be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsPopupSetIsOpen(this.handle, isOpen);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get boundingBox() {\n let retVal = Module.ViewingPdfAnnotsPopupGetBoundingBox(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return new PdfViewing.Pdf.Geometry.Real.RectangleOnPage(retVal.pageNumber, retVal.x, retVal.y, retVal.width, retVal.height);\n }\n set boundingBox(boundingBox) {\n if (typeof boundingBox !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'boundingBox' must be of type PdfViewing.Pdf.Geometry.Real.RectangleOnPage and must not be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsPopupSetBoundingBox(this.handle, boundingBox);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n }\n Annotations.Popup = Popup;\n class MarkupAnnotation extends PdfViewing.Pdf.Annotations.Annotation {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n let type = Module.ViewingPdfAnnotsMarkupAnnotationGetType(handle);\n switch (type) {\n case 0:\n return new MarkupAnnotation(handle);\n case 1:\n return PdfViewing.Pdf.Annotations.StickyNote.createDynamicObject(handle);\n case 2:\n return PdfViewing.Pdf.Annotations.FileAttachment.createDynamicObject(handle);\n case 3:\n return PdfViewing.Pdf.Annotations.Stamp.createDynamicObject(handle);\n case 4:\n return PdfViewing.Pdf.Annotations.TextStamp.createDynamicObject(handle);\n case 5:\n return PdfViewing.Pdf.Annotations.CustomTextStamp.createDynamicObject(handle);\n case 6:\n return PdfViewing.Pdf.Annotations.CustomImageStamp.createDynamicObject(handle);\n case 7:\n return PdfViewing.Pdf.Annotations.FreeText.createDynamicObject(handle);\n case 8:\n return PdfViewing.Pdf.Annotations.DrawingAnnotation.createDynamicObject(handle);\n case 9:\n return PdfViewing.Pdf.Annotations.LineAnnotation.createDynamicObject(handle);\n case 10:\n return PdfViewing.Pdf.Annotations.InkAnnotation.createDynamicObject(handle);\n case 11:\n return PdfViewing.Pdf.Annotations.PolyLineAnnotation.createDynamicObject(handle);\n case 12:\n return PdfViewing.Pdf.Annotations.PolygonAnnotation.createDynamicObject(handle);\n case 13:\n return PdfViewing.Pdf.Annotations.RectangleAnnotation.createDynamicObject(handle);\n case 14:\n return PdfViewing.Pdf.Annotations.EllipseAnnotation.createDynamicObject(handle);\n case 15:\n return PdfViewing.Pdf.Annotations.TextMarkup.createDynamicObject(handle);\n case 16:\n return PdfViewing.Pdf.Annotations.Highlight.createDynamicObject(handle);\n case 17:\n return PdfViewing.Pdf.Annotations.Underline.createDynamicObject(handle);\n case 18:\n return PdfViewing.Pdf.Annotations.StrikeThrough.createDynamicObject(handle);\n case 19:\n return PdfViewing.Pdf.Annotations.Squiggly.createDynamicObject(handle);\n case 20:\n return PdfViewing.Pdf.Annotations.TextInsert.createDynamicObject(handle);\n default:\n return new MarkupAnnotation(handle);\n }\n }\n get locked() {\n let retVal = Module.ViewingPdfAnnotsMarkupAnnotationGetLocked(this.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n get info() {\n let retVal = Module.ViewingPdfAnnotsMarkupAnnotationGetInfo(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError(false);\n return PdfViewing.Pdf.Annotations.MarkupInfo.createDynamicObject(retVal);\n }\n get replies() {\n let retVal = Module.ViewingPdfAnnotsMarkupAnnotationGetReplies(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError(false);\n return PdfViewing.Pdf.Annotations.MarkupInfoList.createDynamicObject(retVal);\n }\n }\n Annotations.MarkupAnnotation = MarkupAnnotation;\n class StickyNote extends PdfViewing.Pdf.Annotations.MarkupAnnotation {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n return new StickyNote(handle);\n }\n static create(topLeft, content, color) {\n if (typeof topLeft !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'topLeft' must be of type PdfViewing.Pdf.Geometry.Real.PointOnPage and must not be null or undefined.\");\n if (typeof content !== 'string')\n throw new PdfViewing.ArgumentError(\"Argument 'content' must be of type string and must not be null or undefined.\");\n if (typeof color !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'color' must be of type PdfViewing.Pdf.Annotations.Color and must not be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsStickyNoteCreate(topLeft, content, color);\n if (retVal === 0)\n Internal.NativeBase.throwLastError(false);\n return PdfViewing.Pdf.Annotations.StickyNote.createDynamicObject(retVal);\n }\n get color() {\n let retVal = Module.ViewingPdfAnnotsStickyNoteGetColor(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return new PdfViewing.Pdf.Annotations.Color(retVal.red, retVal.green, retVal.blue, retVal.alpha);\n }\n set color(color) {\n if (typeof color !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'color' must be of type PdfViewing.Pdf.Annotations.Color and must not be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsStickyNoteSetColor(this.handle, color);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get popup() {\n let retVal = Module.ViewingPdfAnnotsStickyNoteGetPopup(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal !== 0 ? PdfViewing.Pdf.Annotations.Popup.createDynamicObject(retVal) : null;\n }\n }\n Annotations.StickyNote = StickyNote;\n class FileAttachment extends PdfViewing.Pdf.Annotations.MarkupAnnotation {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n return new FileAttachment(handle);\n }\n get icon() {\n let retVal = Module.ViewingPdfAnnotsFileAttachmentGetIcon(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n get color() {\n let retVal = Module.ViewingPdfAnnotsFileAttachmentGetColor(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return new PdfViewing.Pdf.Annotations.Color(retVal.red, retVal.green, retVal.blue, retVal.alpha);\n }\n set color(color) {\n if (typeof color !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'color' must be of type PdfViewing.Pdf.Annotations.Color and must not be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsFileAttachmentSetColor(this.handle, color);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get popup() {\n let retVal = Module.ViewingPdfAnnotsFileAttachmentGetPopup(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal !== 0 ? PdfViewing.Pdf.Annotations.Popup.createDynamicObject(retVal) : null;\n }\n }\n Annotations.FileAttachment = FileAttachment;\n class Stamp extends PdfViewing.Pdf.Annotations.MarkupAnnotation {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n let type = Module.ViewingPdfAnnotsStampGetType(handle);\n switch (type) {\n case 0:\n return new Stamp(handle);\n case 1:\n return PdfViewing.Pdf.Annotations.TextStamp.createDynamicObject(handle);\n case 2:\n return PdfViewing.Pdf.Annotations.CustomTextStamp.createDynamicObject(handle);\n case 3:\n return PdfViewing.Pdf.Annotations.CustomImageStamp.createDynamicObject(handle);\n default:\n return new Stamp(handle);\n }\n }\n get popup() {\n let retVal = Module.ViewingPdfAnnotsStampGetPopup(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal !== 0 ? PdfViewing.Pdf.Annotations.Popup.createDynamicObject(retVal) : null;\n }\n get color() {\n let retVal = Module.ViewingPdfAnnotsStampGetColor(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return new PdfViewing.Pdf.Annotations.Color(retVal.red, retVal.green, retVal.blue, retVal.alpha);\n }\n set color(color) {\n if (typeof color !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'color' must be of type PdfViewing.Pdf.Annotations.Color and must not be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsStampSetColor(this.handle, color);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get rotation() {\n let retVal = Module.ViewingPdfAnnotsStampGetRotation(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n set rotation(rotation) {\n if (typeof rotation !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'rotation' must be of type PdfViewing.Pdf.Geometry.Rotation and must not be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsStampSetRotation(this.handle, rotation);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n }\n Annotations.Stamp = Stamp;\n class TextStamp extends PdfViewing.Pdf.Annotations.Stamp {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n return new TextStamp(handle);\n }\n static createRaw(topLeft, height, textType, text, rotation) {\n if (typeof topLeft !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'topLeft' must be of type PdfViewing.Pdf.Geometry.Real.PointOnPage and must not be null or undefined.\");\n if (height !== null && height !== undefined && typeof height !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'height' must be of type number or can be null or undefined.\");\n if (typeof textType !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'textType' must be of type PdfViewing.Pdf.Annotations.TextStampType and must not be null or undefined.\");\n if (typeof text !== 'string')\n throw new PdfViewing.ArgumentError(\"Argument 'text' must be of type string and must not be null or undefined.\");\n if (typeof rotation !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'rotation' must be of type PdfViewing.Pdf.Geometry.Rotation and must not be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsTextStampCreateRaw(topLeft, height, textType, text, rotation);\n if (retVal === 0)\n Internal.NativeBase.throwLastError(false);\n return PdfViewing.Pdf.Annotations.TextStamp.createDynamicObject(retVal);\n }\n get textType() {\n let retVal = Module.ViewingPdfAnnotsTextStampGetTextType(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n }\n Annotations.TextStamp = TextStamp;\n class CustomTextStamp extends PdfViewing.Pdf.Annotations.Stamp {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n return new CustomTextStamp(handle);\n }\n static create(boundingBox, stampText, stampColor, rotation) {\n if (typeof boundingBox !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'boundingBox' must be of type PdfViewing.Pdf.Geometry.Real.RectangleOnPage and must not be null or undefined.\");\n if (typeof stampText !== 'string')\n throw new PdfViewing.ArgumentError(\"Argument 'stampText' must be of type string and must not be null or undefined.\");\n if (typeof stampColor !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'stampColor' must be of type PdfViewing.Pdf.Annotations.StampColor and must not be null or undefined.\");\n if (typeof rotation !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'rotation' must be of type PdfViewing.Pdf.Geometry.Rotation and must not be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsCustomTextStampCreate(boundingBox, stampText, stampColor, rotation);\n if (retVal === 0)\n Internal.NativeBase.throwLastError(false);\n return PdfViewing.Pdf.Annotations.CustomTextStamp.createDynamicObject(retVal);\n }\n }\n Annotations.CustomTextStamp = CustomTextStamp;\n class CustomImageStamp extends PdfViewing.Pdf.Annotations.Stamp {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n return new CustomImageStamp(handle);\n }\n static create(boundingBox, imageId, rotation) {\n if (typeof boundingBox !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'boundingBox' must be of type PdfViewing.Pdf.Geometry.Real.RectangleOnPage and must not be null or undefined.\");\n if (typeof imageId !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'imageId' must be of type number and must not be null or undefined.\");\n if (typeof rotation !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'rotation' must be of type PdfViewing.Pdf.Geometry.Rotation and must not be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsCustomImageStampCreate(boundingBox, imageId, rotation);\n if (retVal === 0)\n Internal.NativeBase.throwLastError(false);\n return PdfViewing.Pdf.Annotations.CustomImageStamp.createDynamicObject(retVal);\n }\n }\n Annotations.CustomImageStamp = CustomImageStamp;\n class FreeText extends PdfViewing.Pdf.Annotations.MarkupAnnotation {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n return new FreeText(handle);\n }\n static create(boundingBox, richText, backgroundColor, annotationStroke, viewRotation) {\n if (typeof boundingBox !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'boundingBox' must be of type PdfViewing.Pdf.Geometry.Real.RectangleOnPage and must not be null or undefined.\");\n if (typeof richText !== 'string')\n throw new PdfViewing.ArgumentError(\"Argument 'richText' must be of type string and must not be null or undefined.\");\n if (backgroundColor !== null &&\n backgroundColor !== undefined &&\n typeof backgroundColor !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'backgroundColor' must be of type PdfViewing.Pdf.Annotations.Color or can be null or undefined.\");\n if (!(annotationStroke instanceof PdfViewing.Pdf.Annotations.AnnotationStroke))\n throw new PdfViewing.ArgumentError(\"Argument 'annotationStroke' must be of type PdfViewing.Pdf.Annotations.AnnotationStroke and must not be null or undefined.\");\n if (typeof viewRotation !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'viewRotation' must be of type PdfViewing.Pdf.Geometry.Rotation and must not be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsFreeTextCreate(boundingBox, richText, backgroundColor, annotationStroke.handle, viewRotation);\n if (retVal === 0)\n Internal.NativeBase.throwLastError(false);\n return PdfViewing.Pdf.Annotations.FreeText.createDynamicObject(retVal);\n }\n get annotationStroke() {\n let retVal = Module.ViewingPdfAnnotsFreeTextGetAnnotationStroke(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError(false);\n return PdfViewing.Pdf.Annotations.AnnotationStroke.createDynamicObject(retVal);\n }\n set annotationStroke(annotationStroke) {\n if (!(annotationStroke instanceof PdfViewing.Pdf.Annotations.AnnotationStroke))\n throw new PdfViewing.ArgumentError(\"Argument 'annotationStroke' must be of type PdfViewing.Pdf.Annotations.AnnotationStroke and must not be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsFreeTextSetAnnotationStroke(this.handle, annotationStroke.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get richText() {\n let retVal = Module.ViewingPdfAnnotsFreeTextGetRichText(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return retVal;\n }\n set richText(richText) {\n if (typeof richText !== 'string')\n throw new PdfViewing.ArgumentError(\"Argument 'richText' must be of type string and must not be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsFreeTextSetRichText(this.handle, richText);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get backgroundColor() {\n let retVal = Module.ViewingPdfAnnotsFreeTextGetBackgroundColor(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError();\n return retVal !== null\n ? new PdfViewing.Pdf.Annotations.Color(retVal.red, retVal.green, retVal.blue, retVal.alpha)\n : null;\n }\n set backgroundColor(backgroundColor) {\n if (backgroundColor !== null &&\n backgroundColor !== undefined &&\n typeof backgroundColor !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'backgroundColor' must be of type PdfViewing.Pdf.Annotations.Color or can be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsFreeTextSetBackgroundColor(this.handle, backgroundColor);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get rotation() {\n let retVal = Module.ViewingPdfAnnotsFreeTextGetRotation(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n set rotation(rotation) {\n if (typeof rotation !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'rotation' must be of type PdfViewing.Pdf.Geometry.Rotation and must not be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsFreeTextSetRotation(this.handle, rotation);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n }\n Annotations.FreeText = FreeText;\n class DrawingAnnotation extends PdfViewing.Pdf.Annotations.MarkupAnnotation {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n let type = Module.ViewingPdfAnnotsDrawingAnnotationGetType(handle);\n switch (type) {\n case 0:\n return new DrawingAnnotation(handle);\n case 1:\n return PdfViewing.Pdf.Annotations.LineAnnotation.createDynamicObject(handle);\n case 2:\n return PdfViewing.Pdf.Annotations.InkAnnotation.createDynamicObject(handle);\n case 3:\n return PdfViewing.Pdf.Annotations.PolyLineAnnotation.createDynamicObject(handle);\n case 4:\n return PdfViewing.Pdf.Annotations.PolygonAnnotation.createDynamicObject(handle);\n case 5:\n return PdfViewing.Pdf.Annotations.RectangleAnnotation.createDynamicObject(handle);\n case 6:\n return PdfViewing.Pdf.Annotations.EllipseAnnotation.createDynamicObject(handle);\n default:\n return new DrawingAnnotation(handle);\n }\n }\n get strokeColor() {\n let retVal = Module.ViewingPdfAnnotsDrawingAnnotationGetStrokeColor(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError();\n return retVal !== null\n ? new PdfViewing.Pdf.Annotations.Color(retVal.red, retVal.green, retVal.blue, retVal.alpha)\n : null;\n }\n set strokeColor(strokeColor) {\n if (strokeColor !== null && strokeColor !== undefined && typeof strokeColor !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'strokeColor' must be of type PdfViewing.Pdf.Annotations.Color or can be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsDrawingAnnotationSetStrokeColor(this.handle, strokeColor);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get annotationStroke() {\n let retVal = Module.ViewingPdfAnnotsDrawingAnnotationGetAnnotationStroke(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal !== 0\n ? PdfViewing.Pdf.Annotations.AnnotationStroke.createDynamicObject(retVal)\n : null;\n }\n set annotationStroke(annotationStroke) {\n if (annotationStroke !== null &&\n annotationStroke !== undefined &&\n !(annotationStroke instanceof PdfViewing.Pdf.Annotations.AnnotationStroke))\n throw new PdfViewing.ArgumentError(\"Argument 'annotationStroke' must be of type PdfViewing.Pdf.Annotations.AnnotationStroke or can be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsDrawingAnnotationSetAnnotationStroke(this.handle, annotationStroke !== null && annotationStroke !== undefined\n ? annotationStroke.handle\n : 0);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get popup() {\n let retVal = Module.ViewingPdfAnnotsDrawingAnnotationGetPopup(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal !== 0 ? PdfViewing.Pdf.Annotations.Popup.createDynamicObject(retVal) : null;\n }\n get path() {\n let retVal = Module.ViewingPdfAnnotsDrawingAnnotationGetPath(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError(false);\n return PdfViewing.Pdf.Geometry.Real.Path.createDynamicObject(retVal);\n }\n }\n Annotations.DrawingAnnotation = DrawingAnnotation;\n class LineAnnotation extends PdfViewing.Pdf.Annotations.DrawingAnnotation {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n return new LineAnnotation(handle);\n }\n static create(start, end, strokeColor, annotationStroke) {\n if (typeof start !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'start' must be of type PdfViewing.Pdf.Geometry.Real.PointOnPage and must not be null or undefined.\");\n if (typeof end !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'end' must be of type PdfViewing.Pdf.Geometry.Real.PointOnPage and must not be null or undefined.\");\n if (strokeColor !== null && strokeColor !== undefined && typeof strokeColor !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'strokeColor' must be of type PdfViewing.Pdf.Annotations.Color or can be null or undefined.\");\n if (!(annotationStroke instanceof PdfViewing.Pdf.Annotations.AnnotationStroke))\n throw new PdfViewing.ArgumentError(\"Argument 'annotationStroke' must be of type PdfViewing.Pdf.Annotations.AnnotationStroke and must not be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsLineAnnotationCreate(start, end, strokeColor, annotationStroke.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError(false);\n return PdfViewing.Pdf.Annotations.LineAnnotation.createDynamicObject(retVal);\n }\n get start() {\n let retVal = Module.ViewingPdfAnnotsLineAnnotationGetStart(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return new PdfViewing.Pdf.Geometry.Real.PointOnPage(retVal.pageNumber, retVal.x, retVal.y);\n }\n get end() {\n let retVal = Module.ViewingPdfAnnotsLineAnnotationGetEnd(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return new PdfViewing.Pdf.Geometry.Real.PointOnPage(retVal.pageNumber, retVal.x, retVal.y);\n }\n get startStyle() {\n let retVal = Module.ViewingPdfAnnotsLineAnnotationGetStartStyle(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n get endStyle() {\n let retVal = Module.ViewingPdfAnnotsLineAnnotationGetEndStyle(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n get lineEndingFill() {\n let retVal = Module.ViewingPdfAnnotsLineAnnotationGetLineEndingFill(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return new PdfViewing.Pdf.Annotations.Color(retVal.red, retVal.green, retVal.blue, retVal.alpha);\n }\n }\n Annotations.LineAnnotation = LineAnnotation;\n class InkAnnotation extends PdfViewing.Pdf.Annotations.DrawingAnnotation {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n return new InkAnnotation(handle);\n }\n static create(pageNumber, path, strokeColor, annotationStroke) {\n if (typeof pageNumber !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'pageNumber' must be of type number and must not be null or undefined.\");\n if (!(path instanceof PdfViewing.Pdf.Geometry.Real.Path))\n throw new PdfViewing.ArgumentError(\"Argument 'path' must be of type PdfViewing.Pdf.Geometry.Real.Path and must not be null or undefined.\");\n if (typeof strokeColor !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'strokeColor' must be of type PdfViewing.Pdf.Annotations.Color and must not be null or undefined.\");\n if (!(annotationStroke instanceof PdfViewing.Pdf.Annotations.AnnotationStroke))\n throw new PdfViewing.ArgumentError(\"Argument 'annotationStroke' must be of type PdfViewing.Pdf.Annotations.AnnotationStroke and must not be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsInkAnnotationCreate(pageNumber, path.handle, strokeColor, annotationStroke.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError(false);\n return PdfViewing.Pdf.Annotations.InkAnnotation.createDynamicObject(retVal);\n }\n setPath(path) {\n if (!(path instanceof PdfViewing.Pdf.Geometry.Real.Path))\n throw new PdfViewing.ArgumentError(\"Argument 'path' must be of type PdfViewing.Pdf.Geometry.Real.Path and must not be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsInkAnnotationSetPath(this.handle, path.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n }\n Annotations.InkAnnotation = InkAnnotation;\n class PolyLineAnnotation extends PdfViewing.Pdf.Annotations.DrawingAnnotation {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n return new PolyLineAnnotation(handle);\n }\n static create(pageNumber, path, strokeColor, annotationStroke) {\n if (typeof pageNumber !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'pageNumber' must be of type number and must not be null or undefined.\");\n if (!(path instanceof PdfViewing.Pdf.Geometry.Real.Path))\n throw new PdfViewing.ArgumentError(\"Argument 'path' must be of type PdfViewing.Pdf.Geometry.Real.Path and must not be null or undefined.\");\n if (typeof strokeColor !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'strokeColor' must be of type PdfViewing.Pdf.Annotations.Color and must not be null or undefined.\");\n if (!(annotationStroke instanceof PdfViewing.Pdf.Annotations.AnnotationStroke))\n throw new PdfViewing.ArgumentError(\"Argument 'annotationStroke' must be of type PdfViewing.Pdf.Annotations.AnnotationStroke and must not be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsPolyLineAnnotationCreate(pageNumber, path.handle, strokeColor, annotationStroke.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError(false);\n return PdfViewing.Pdf.Annotations.PolyLineAnnotation.createDynamicObject(retVal);\n }\n get startStyle() {\n let retVal = Module.ViewingPdfAnnotsPolyLineAnnotationGetStartStyle(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n get endStyle() {\n let retVal = Module.ViewingPdfAnnotsPolyLineAnnotationGetEndStyle(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n get lineEndingFill() {\n let retVal = Module.ViewingPdfAnnotsPolyLineAnnotationGetLineEndingFill(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return new PdfViewing.Pdf.Annotations.Color(retVal.red, retVal.green, retVal.blue, retVal.alpha);\n }\n }\n Annotations.PolyLineAnnotation = PolyLineAnnotation;\n class PolygonAnnotation extends PdfViewing.Pdf.Annotations.DrawingAnnotation {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n return new PolygonAnnotation(handle);\n }\n static create(pageNumber, path, strokeColor, annotationStroke, borderStyleType, fillColor) {\n if (typeof pageNumber !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'pageNumber' must be of type number and must not be null or undefined.\");\n if (!(path instanceof PdfViewing.Pdf.Geometry.Real.Path))\n throw new PdfViewing.ArgumentError(\"Argument 'path' must be of type PdfViewing.Pdf.Geometry.Real.Path and must not be null or undefined.\");\n if (strokeColor !== null && strokeColor !== undefined && typeof strokeColor !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'strokeColor' must be of type PdfViewing.Pdf.Annotations.Color or can be null or undefined.\");\n if (!(annotationStroke instanceof PdfViewing.Pdf.Annotations.AnnotationStroke))\n throw new PdfViewing.ArgumentError(\"Argument 'annotationStroke' must be of type PdfViewing.Pdf.Annotations.AnnotationStroke and must not be null or undefined.\");\n if (typeof borderStyleType !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'borderStyleType' must be of type PdfViewing.Pdf.Annotations.BorderStyleType and must not be null or undefined.\");\n if (fillColor !== null && fillColor !== undefined && typeof fillColor !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'fillColor' must be of type PdfViewing.Pdf.Annotations.Color or can be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsPolygonAnnotationCreate(pageNumber, path.handle, strokeColor, annotationStroke.handle, borderStyleType, fillColor);\n if (retVal === 0)\n Internal.NativeBase.throwLastError(false);\n return PdfViewing.Pdf.Annotations.PolygonAnnotation.createDynamicObject(retVal);\n }\n get borderStyleType() {\n let retVal = Module.ViewingPdfAnnotsPolygonAnnotationGetBorderStyleType(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n set borderStyleType(borderStyleType) {\n if (typeof borderStyleType !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'borderStyleType' must be of type PdfViewing.Pdf.Annotations.BorderStyleType and must not be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsPolygonAnnotationSetBorderStyleType(this.handle, borderStyleType);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get fillColor() {\n let retVal = Module.ViewingPdfAnnotsPolygonAnnotationGetFillColor(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError();\n return retVal !== null\n ? new PdfViewing.Pdf.Annotations.Color(retVal.red, retVal.green, retVal.blue, retVal.alpha)\n : null;\n }\n set fillColor(fillColor) {\n if (fillColor !== null && fillColor !== undefined && typeof fillColor !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'fillColor' must be of type PdfViewing.Pdf.Annotations.Color or can be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsPolygonAnnotationSetFillColor(this.handle, fillColor);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n }\n Annotations.PolygonAnnotation = PolygonAnnotation;\n class RectangleAnnotation extends PdfViewing.Pdf.Annotations.DrawingAnnotation {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n return new RectangleAnnotation(handle);\n }\n static create(boundingBox, strokeColor, annotationStroke, borderStyleType, fillColor) {\n if (typeof boundingBox !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'boundingBox' must be of type PdfViewing.Pdf.Geometry.Real.RectangleOnPage and must not be null or undefined.\");\n if (strokeColor !== null && strokeColor !== undefined && typeof strokeColor !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'strokeColor' must be of type PdfViewing.Pdf.Annotations.Color or can be null or undefined.\");\n if (!(annotationStroke instanceof PdfViewing.Pdf.Annotations.AnnotationStroke))\n throw new PdfViewing.ArgumentError(\"Argument 'annotationStroke' must be of type PdfViewing.Pdf.Annotations.AnnotationStroke and must not be null or undefined.\");\n if (typeof borderStyleType !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'borderStyleType' must be of type PdfViewing.Pdf.Annotations.BorderStyleType and must not be null or undefined.\");\n if (fillColor !== null && fillColor !== undefined && typeof fillColor !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'fillColor' must be of type PdfViewing.Pdf.Annotations.Color or can be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsRectangleAnnotationCreate(boundingBox, strokeColor, annotationStroke.handle, borderStyleType, fillColor);\n if (retVal === 0)\n Internal.NativeBase.throwLastError(false);\n return PdfViewing.Pdf.Annotations.RectangleAnnotation.createDynamicObject(retVal);\n }\n get borderStyleType() {\n let retVal = Module.ViewingPdfAnnotsRectangleAnnotationGetBorderStyleType(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n set borderStyleType(borderStyleType) {\n if (typeof borderStyleType !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'borderStyleType' must be of type PdfViewing.Pdf.Annotations.BorderStyleType and must not be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsRectangleAnnotationSetBorderStyleType(this.handle, borderStyleType);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get fillColor() {\n let retVal = Module.ViewingPdfAnnotsRectangleAnnotationGetFillColor(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError();\n return retVal !== null\n ? new PdfViewing.Pdf.Annotations.Color(retVal.red, retVal.green, retVal.blue, retVal.alpha)\n : null;\n }\n set fillColor(fillColor) {\n if (fillColor !== null && fillColor !== undefined && typeof fillColor !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'fillColor' must be of type PdfViewing.Pdf.Annotations.Color or can be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsRectangleAnnotationSetFillColor(this.handle, fillColor);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n }\n Annotations.RectangleAnnotation = RectangleAnnotation;\n class EllipseAnnotation extends PdfViewing.Pdf.Annotations.DrawingAnnotation {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n return new EllipseAnnotation(handle);\n }\n static create(boundingBox, strokeColor, annotationStroke, borderStyleType, fillColor) {\n if (typeof boundingBox !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'boundingBox' must be of type PdfViewing.Pdf.Geometry.Real.RectangleOnPage and must not be null or undefined.\");\n if (strokeColor !== null && strokeColor !== undefined && typeof strokeColor !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'strokeColor' must be of type PdfViewing.Pdf.Annotations.Color or can be null or undefined.\");\n if (!(annotationStroke instanceof PdfViewing.Pdf.Annotations.AnnotationStroke))\n throw new PdfViewing.ArgumentError(\"Argument 'annotationStroke' must be of type PdfViewing.Pdf.Annotations.AnnotationStroke and must not be null or undefined.\");\n if (typeof borderStyleType !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'borderStyleType' must be of type PdfViewing.Pdf.Annotations.BorderStyleType and must not be null or undefined.\");\n if (fillColor !== null && fillColor !== undefined && typeof fillColor !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'fillColor' must be of type PdfViewing.Pdf.Annotations.Color or can be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsEllipseAnnotationCreate(boundingBox, strokeColor, annotationStroke.handle, borderStyleType, fillColor);\n if (retVal === 0)\n Internal.NativeBase.throwLastError(false);\n return PdfViewing.Pdf.Annotations.EllipseAnnotation.createDynamicObject(retVal);\n }\n get borderStyleType() {\n let retVal = Module.ViewingPdfAnnotsEllipseAnnotationGetBorderStyleType(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n set borderStyleType(borderStyleType) {\n if (typeof borderStyleType !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'borderStyleType' must be of type PdfViewing.Pdf.Annotations.BorderStyleType and must not be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsEllipseAnnotationSetBorderStyleType(this.handle, borderStyleType);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get fillColor() {\n let retVal = Module.ViewingPdfAnnotsEllipseAnnotationGetFillColor(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError();\n return retVal !== null\n ? new PdfViewing.Pdf.Annotations.Color(retVal.red, retVal.green, retVal.blue, retVal.alpha)\n : null;\n }\n set fillColor(fillColor) {\n if (fillColor !== null && fillColor !== undefined && typeof fillColor !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'fillColor' must be of type PdfViewing.Pdf.Annotations.Color or can be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsEllipseAnnotationSetFillColor(this.handle, fillColor);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n }\n Annotations.EllipseAnnotation = EllipseAnnotation;\n class TextMarkup extends PdfViewing.Pdf.Annotations.MarkupAnnotation {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n let type = Module.ViewingPdfAnnotsTextMarkupGetType(handle);\n switch (type) {\n case 0:\n return new TextMarkup(handle);\n case 1:\n return PdfViewing.Pdf.Annotations.Highlight.createDynamicObject(handle);\n case 2:\n return PdfViewing.Pdf.Annotations.Underline.createDynamicObject(handle);\n case 3:\n return PdfViewing.Pdf.Annotations.StrikeThrough.createDynamicObject(handle);\n case 4:\n return PdfViewing.Pdf.Annotations.Squiggly.createDynamicObject(handle);\n default:\n return new TextMarkup(handle);\n }\n }\n get color() {\n let retVal = Module.ViewingPdfAnnotsTextMarkupGetColor(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return new PdfViewing.Pdf.Annotations.Color(retVal.red, retVal.green, retVal.blue, retVal.alpha);\n }\n set color(color) {\n if (typeof color !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'color' must be of type PdfViewing.Pdf.Annotations.Color and must not be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsTextMarkupSetColor(this.handle, color);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get popup() {\n let retVal = Module.ViewingPdfAnnotsTextMarkupGetPopup(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal !== 0 ? PdfViewing.Pdf.Annotations.Popup.createDynamicObject(retVal) : null;\n }\n get markupArea() {\n let retVal = Module.ViewingPdfAnnotsTextMarkupGetMarkupArea(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError(false);\n return PdfViewing.Pdf.Geometry.Real.QuadrilateralList.createDynamicObject(retVal);\n }\n set markupArea(markupArea) {\n if (!(markupArea instanceof PdfViewing.Pdf.Geometry.Real.QuadrilateralList))\n throw new PdfViewing.ArgumentError(\"Argument 'markupArea' must be of type PdfViewing.Pdf.Geometry.Real.QuadrilateralList and must not be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsTextMarkupSetMarkupArea(this.handle, markupArea.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get markedText() {\n let retVal = Module.ViewingPdfAnnotsTextMarkupGetMarkedText(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return retVal;\n }\n }\n Annotations.TextMarkup = TextMarkup;\n class Highlight extends PdfViewing.Pdf.Annotations.TextMarkup {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n return new Highlight(handle);\n }\n static create(markupArea, color) {\n if (!(markupArea instanceof PdfViewing.Pdf.Geometry.Real.QuadrilateralList))\n throw new PdfViewing.ArgumentError(\"Argument 'markupArea' must be of type PdfViewing.Pdf.Geometry.Real.QuadrilateralList and must not be null or undefined.\");\n if (typeof color !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'color' must be of type PdfViewing.Pdf.Annotations.Color and must not be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsHighlightCreate(markupArea.handle, color);\n if (retVal === 0)\n Internal.NativeBase.throwLastError(false);\n return PdfViewing.Pdf.Annotations.Highlight.createDynamicObject(retVal);\n }\n }\n Annotations.Highlight = Highlight;\n class Underline extends PdfViewing.Pdf.Annotations.TextMarkup {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n return new Underline(handle);\n }\n static create(markupArea, color) {\n if (!(markupArea instanceof PdfViewing.Pdf.Geometry.Real.QuadrilateralList))\n throw new PdfViewing.ArgumentError(\"Argument 'markupArea' must be of type PdfViewing.Pdf.Geometry.Real.QuadrilateralList and must not be null or undefined.\");\n if (typeof color !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'color' must be of type PdfViewing.Pdf.Annotations.Color and must not be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsUnderlineCreate(markupArea.handle, color);\n if (retVal === 0)\n Internal.NativeBase.throwLastError(false);\n return PdfViewing.Pdf.Annotations.Underline.createDynamicObject(retVal);\n }\n }\n Annotations.Underline = Underline;\n class StrikeThrough extends PdfViewing.Pdf.Annotations.TextMarkup {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n return new StrikeThrough(handle);\n }\n static create(markupArea, color) {\n if (!(markupArea instanceof PdfViewing.Pdf.Geometry.Real.QuadrilateralList))\n throw new PdfViewing.ArgumentError(\"Argument 'markupArea' must be of type PdfViewing.Pdf.Geometry.Real.QuadrilateralList and must not be null or undefined.\");\n if (typeof color !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'color' must be of type PdfViewing.Pdf.Annotations.Color and must not be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsStrikeThroughCreate(markupArea.handle, color);\n if (retVal === 0)\n Internal.NativeBase.throwLastError(false);\n return PdfViewing.Pdf.Annotations.StrikeThrough.createDynamicObject(retVal);\n }\n }\n Annotations.StrikeThrough = StrikeThrough;\n class Squiggly extends PdfViewing.Pdf.Annotations.TextMarkup {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n return new Squiggly(handle);\n }\n static create(markupArea, color) {\n if (!(markupArea instanceof PdfViewing.Pdf.Geometry.Real.QuadrilateralList))\n throw new PdfViewing.ArgumentError(\"Argument 'markupArea' must be of type PdfViewing.Pdf.Geometry.Real.QuadrilateralList and must not be null or undefined.\");\n if (typeof color !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'color' must be of type PdfViewing.Pdf.Annotations.Color and must not be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsSquigglyCreate(markupArea.handle, color);\n if (retVal === 0)\n Internal.NativeBase.throwLastError(false);\n return PdfViewing.Pdf.Annotations.Squiggly.createDynamicObject(retVal);\n }\n }\n Annotations.Squiggly = Squiggly;\n class TextInsert extends PdfViewing.Pdf.Annotations.MarkupAnnotation {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n return new TextInsert(handle);\n }\n get color() {\n let retVal = Module.ViewingPdfAnnotsTextInsertGetColor(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return new PdfViewing.Pdf.Annotations.Color(retVal.red, retVal.green, retVal.blue, retVal.alpha);\n }\n set color(color) {\n if (typeof color !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'color' must be of type PdfViewing.Pdf.Annotations.Color and must not be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsTextInsertSetColor(this.handle, color);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get popup() {\n let retVal = Module.ViewingPdfAnnotsTextInsertGetPopup(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal !== 0 ? PdfViewing.Pdf.Annotations.Popup.createDynamicObject(retVal) : null;\n }\n }\n Annotations.TextInsert = TextInsert;\n class Link extends PdfViewing.Pdf.Annotations.Annotation {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n let type = Module.ViewingPdfAnnotsLinkGetType(handle);\n switch (type) {\n case 0:\n return new Link(handle);\n case 1:\n return PdfViewing.Pdf.Annotations.InternalLink.createDynamicObject(handle);\n case 2:\n return PdfViewing.Pdf.Annotations.WebLink.createDynamicObject(handle);\n case 3:\n return PdfViewing.Pdf.Annotations.EmbeddedPdfLink.createDynamicObject(handle);\n default:\n return new Link(handle);\n }\n }\n set annotationStroke(annotationStroke) {\n if (!(annotationStroke instanceof PdfViewing.Pdf.Annotations.AnnotationStroke))\n throw new PdfViewing.ArgumentError(\"Argument 'annotationStroke' must be of type PdfViewing.Pdf.Annotations.AnnotationStroke and must not be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsLinkSetAnnotationStroke(this.handle, annotationStroke.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get color() {\n let retVal = Module.ViewingPdfAnnotsLinkGetColor(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return new PdfViewing.Pdf.Annotations.Color(retVal.red, retVal.green, retVal.blue, retVal.alpha);\n }\n set color(color) {\n if (typeof color !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'color' must be of type PdfViewing.Pdf.Annotations.Color and must not be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsLinkSetColor(this.handle, color);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get activeArea() {\n let retVal = Module.ViewingPdfAnnotsLinkGetActiveArea(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError(false);\n return PdfViewing.Pdf.Geometry.Real.QuadrilateralList.createDynamicObject(retVal);\n }\n set activeArea(activeArea) {\n if (!(activeArea instanceof PdfViewing.Pdf.Geometry.Real.QuadrilateralList))\n throw new PdfViewing.ArgumentError(\"Argument 'activeArea' must be of type PdfViewing.Pdf.Geometry.Real.QuadrilateralList and must not be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsLinkSetActiveArea(this.handle, activeArea.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n }\n Annotations.Link = Link;\n class InternalLink extends PdfViewing.Pdf.Annotations.Link {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n return new InternalLink(handle);\n }\n get destination() {\n let retVal = Module.ViewingPdfAnnotsInternalLinkGetDestination(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal !== 0\n ? PdfViewing.Pdf.Navigation.Destination.createDynamicObject(retVal)\n : null;\n }\n }\n Annotations.InternalLink = InternalLink;\n class WebLink extends PdfViewing.Pdf.Annotations.Link {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n return new WebLink(handle);\n }\n static create(boundingBox, annotationStroke, uri) {\n if (typeof boundingBox !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'boundingBox' must be of type PdfViewing.Pdf.Geometry.Real.RectangleOnPage and must not be null or undefined.\");\n if (!(annotationStroke instanceof PdfViewing.Pdf.Annotations.AnnotationStroke))\n throw new PdfViewing.ArgumentError(\"Argument 'annotationStroke' must be of type PdfViewing.Pdf.Annotations.AnnotationStroke and must not be null or undefined.\");\n if (typeof uri !== 'string')\n throw new PdfViewing.ArgumentError(\"Argument 'uri' must be of type string and must not be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsWebLinkCreate(boundingBox, annotationStroke.handle, uri);\n if (retVal === 0)\n Internal.NativeBase.throwLastError(false);\n return PdfViewing.Pdf.Annotations.WebLink.createDynamicObject(retVal);\n }\n get uri() {\n let retVal = Module.ViewingPdfAnnotsWebLinkGetUri(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return retVal;\n }\n set uri(uri) {\n if (typeof uri !== 'string')\n throw new PdfViewing.ArgumentError(\"Argument 'uri' must be of type string and must not be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsWebLinkSetUri(this.handle, uri);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n }\n Annotations.WebLink = WebLink;\n class EmbeddedPdfLink extends PdfViewing.Pdf.Annotations.Link {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n return new EmbeddedPdfLink(handle);\n }\n get newWindow() {\n let retVal = Module.ViewingPdfAnnotsEmbeddedPdfLinkGetNewWindow(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n set newWindow(newWindow) {\n if (newWindow !== null && newWindow !== undefined && typeof newWindow !== 'boolean')\n throw new PdfViewing.ArgumentError(\"Argument 'newWindow' must be of type boolean or can be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsEmbeddedPdfLinkSetNewWindow(this.handle, newWindow);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n }\n Annotations.EmbeddedPdfLink = EmbeddedPdfLink;\n class AnnotationStroke extends Internal.NativeObject {\n constructor() {\n if (arguments[0] && typeof arguments[0].__handle === `number`)\n super(arguments[0].__handle);\n else {\n super(Internal.NativeObject.checkReturnHandleErrorCode(Module.ViewingPdfAnnotsNewAnnotationStroke()));\n }\n }\n static createDynamicObject(handle) {\n return new AnnotationStroke({ __handle: handle });\n }\n close() {\n if (!Module.ViewingPdfAnnotsAnnotationStrokeClose(this.handle))\n Internal.NativeBase.throwLastError();\n }\n get lineWidth() {\n let retVal = Module.ViewingPdfAnnotsAnnotationStrokeGetLineWidth(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n set lineWidth(lineWidth) {\n if (typeof lineWidth !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'lineWidth' must be of type number and must not be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsAnnotationStrokeSetLineWidth(this.handle, lineWidth);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get dashArray() {\n let retVal = Module.ViewingPdfAnnotsAnnotationStrokeGetDashArray(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return retVal;\n }\n set dashArray(dashArray) {\n if (!Array.isArray(dashArray))\n throw new PdfViewing.ArgumentError(\"Argument 'dashArray' must be of type number and must not be null or undefined.\");\n let retVal = Module.ViewingPdfAnnotsAnnotationStrokeSetDashArray(this.handle, dashArray);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n }\n Annotations.AnnotationStroke = AnnotationStroke;\n class AnnotationList extends Internal.NativeObject {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n return new AnnotationList(handle);\n }\n close() {\n if (!Module.ViewingPdfAnnotsAnnotationListClose(this.handle))\n Internal.NativeBase.throwLastError();\n }\n remove(element) {\n throw new Error('Method not implemented.');\n }\n add(element) {\n throw new Error('Method not implemented.');\n }\n addRange(inputList) {\n throw new Error('Method not implemented.');\n }\n set(index, element) {\n throw new Error('Method not implemented.');\n }\n clear() {\n throw new Error('Method not implemented.');\n }\n get(index) {\n let retVal = Module.ViewingPdfAnnotsAnnotationListGet(this.handle, index);\n if (retVal === 0)\n Internal.NativeBase.throwLastError(false);\n return PdfViewing.Pdf.Annotations.Annotation.createDynamicObject(retVal);\n }\n getRange(index, count) {\n throw new Error('Method not implemented.');\n }\n get size() {\n let retVal = Module.ViewingPdfAnnotsAnnotationListGetCount(this.handle);\n if (retVal === -1)\n Internal.NativeBase.throwLastError(false);\n return retVal;\n }\n [Symbol.iterator]() {\n return new ListIterator(this);\n }\n }\n Annotations.AnnotationList = AnnotationList;\n })(Annotations = Pdf.Annotations || (Pdf.Annotations = {}));\n let Forms;\n (function (Forms) {\n class Widget extends PdfViewing.Pdf.Annotations.Annotation {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n let type = Module.ViewingPdfFormsWidgetGetType(handle);\n switch (type) {\n case 0:\n return new Widget(handle);\n case 1:\n return PdfViewing.Pdf.Forms.CheckBox.createDynamicObject(handle);\n case 2:\n return PdfViewing.Pdf.Forms.RadioButton.createDynamicObject(handle);\n case 3:\n return PdfViewing.Pdf.Forms.TextBox.createDynamicObject(handle);\n case 4:\n return PdfViewing.Pdf.Forms.ListBox.createDynamicObject(handle);\n case 5:\n return PdfViewing.Pdf.Forms.ComboBox.createDynamicObject(handle);\n default:\n return new Widget(handle);\n }\n }\n get readOnly() {\n let retVal = Module.ViewingPdfFormsWidgetGetReadOnly(this.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n get required() {\n let retVal = Module.ViewingPdfFormsWidgetGetRequired(this.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n }\n Forms.Widget = Widget;\n class CheckBox extends PdfViewing.Pdf.Forms.Widget {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n return new CheckBox(handle);\n }\n push() {\n let retVal = Module.ViewingPdfFormsCheckBoxpush(this.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get isChecked() {\n let retVal = Module.ViewingPdfFormsCheckBoxGetIsChecked(this.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n }\n Forms.CheckBox = CheckBox;\n class RadioButton extends PdfViewing.Pdf.Forms.Widget {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n return new RadioButton(handle);\n }\n push() {\n let retVal = Module.ViewingPdfFormsRadioButtonpush(this.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get noSelectionAllowed() {\n let retVal = Module.ViewingPdfFormsRadioButtonGetNoSelectionAllowed(this.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n get selected() {\n let retVal = Module.ViewingPdfFormsRadioButtonGetSelected(this.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n }\n Forms.RadioButton = RadioButton;\n class TextBox extends PdfViewing.Pdf.Forms.Widget {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n return new TextBox(handle);\n }\n get scrollAllowed() {\n let retVal = Module.ViewingPdfFormsTextBoxGetScrollAllowed(this.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n get multilineAllowed() {\n let retVal = Module.ViewingPdfFormsTextBoxGetMultilineAllowed(this.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n get textIsRichText() {\n let retVal = Module.ViewingPdfFormsTextBoxGetTextIsRichText(this.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n get comb() {\n let retVal = Module.ViewingPdfFormsTextBoxGetComb(this.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n get maxLength() {\n let retVal = Module.ViewingPdfFormsTextBoxGetMaxLength(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n get text() {\n let retVal = Module.ViewingPdfFormsTextBoxGetText(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return retVal;\n }\n set text(text) {\n if (typeof text !== 'string')\n throw new PdfViewing.ArgumentError(\"Argument 'text' must be of type string and must not be null or undefined.\");\n let retVal = Module.ViewingPdfFormsTextBoxSetText(this.handle, text);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n }\n Forms.TextBox = TextBox;\n class ListBox extends PdfViewing.Pdf.Forms.Widget {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n return new ListBox(handle);\n }\n get multiSelectAllowed() {\n let retVal = Module.ViewingPdfFormsListBoxGetMultiSelectAllowed(this.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n get options() {\n let retVal = Module.ViewingPdfFormsListBoxGetOptions(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError(false);\n return PdfViewing.StringList.createDynamicObject(retVal);\n }\n get chosen() {\n let retVal = Module.ViewingPdfFormsListBoxGetChosen(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError(false);\n return PdfViewing.IntegerSet.createDynamicObject(retVal);\n }\n set chosen(chosen) {\n if (!(chosen instanceof PdfViewing.IntegerSet))\n throw new PdfViewing.ArgumentError(\"Argument 'chosen' must be of type PdfViewing.IntegerSet and must not be null or undefined.\");\n let retVal = Module.ViewingPdfFormsListBoxSetChosen(this.handle, chosen.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n }\n Forms.ListBox = ListBox;\n class ComboBox extends PdfViewing.Pdf.Forms.Widget {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n return new ComboBox(handle);\n }\n get customEntryAllowed() {\n let retVal = Module.ViewingPdfFormsComboBoxGetCustomEntryAllowed(this.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n get customEntry() {\n let retVal = Module.ViewingPdfFormsComboBoxGetCustomEntry(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n set customEntry(customEntry) {\n if (customEntry !== null && customEntry !== undefined && typeof customEntry !== 'string')\n throw new PdfViewing.ArgumentError(\"Argument 'customEntry' must be of type string or can be null or undefined.\");\n let retVal = Module.ViewingPdfFormsComboBoxSetCustomEntry(this.handle, customEntry);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get options() {\n let retVal = Module.ViewingPdfFormsComboBoxGetOptions(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError(false);\n return PdfViewing.StringList.createDynamicObject(retVal);\n }\n get chosen() {\n let retVal = Module.ViewingPdfFormsComboBoxGetChosen(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n set chosen(chosen) {\n if (chosen !== null && chosen !== undefined && typeof chosen !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'chosen' must be of type number or can be null or undefined.\");\n let retVal = Module.ViewingPdfFormsComboBoxSetChosen(this.handle, chosen);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n }\n Forms.ComboBox = ComboBox;\n })(Forms = Pdf.Forms || (Pdf.Forms = {}));\n let Geometry;\n (function (Geometry) {\n let Rotation;\n (function (Rotation) {\n Rotation[Rotation[\"NoRotation\"] = 0] = \"NoRotation\";\n Rotation[Rotation[\"Clockwise\"] = 90] = \"Clockwise\";\n Rotation[Rotation[\"UpsideDown\"] = 180] = \"UpsideDown\";\n Rotation[Rotation[\"CounterClockwise\"] = 270] = \"CounterClockwise\";\n })(Rotation = Geometry.Rotation || (Geometry.Rotation = {}));\n let Real;\n (function (Real) {\n class Size extends Internal.NativeBase {\n constructor(width, height) {\n super();\n if (typeof width !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'width' must be of type number and must not be null or undefined.\");\n if (typeof height !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'height' must be of type number and must not be null or undefined.\");\n this.width = width;\n this.height = height;\n }\n equals(obj) {\n if (obj === null)\n return false;\n if (this.width !== obj.width)\n return false;\n if (this.height !== obj.height)\n return false;\n return true;\n }\n }\n Real.Size = Size;\n class Point extends Internal.NativeBase {\n constructor(x, y) {\n super();\n if (typeof x !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'x' must be of type number and must not be null or undefined.\");\n if (typeof y !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'y' must be of type number and must not be null or undefined.\");\n this.x = x;\n this.y = y;\n }\n equals(obj) {\n if (obj === null)\n return false;\n if (this.x !== obj.x)\n return false;\n if (this.y !== obj.y)\n return false;\n return true;\n }\n }\n Real.Point = Point;\n class PointOnPage extends Internal.NativeBase {\n constructor(pageNumber, x, y) {\n super();\n if (typeof pageNumber !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'pageNumber' must be of type number and must not be null or undefined.\");\n if (typeof x !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'x' must be of type number and must not be null or undefined.\");\n if (typeof y !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'y' must be of type number and must not be null or undefined.\");\n this.pageNumber = pageNumber;\n this.x = x;\n this.y = y;\n }\n equals(obj) {\n if (obj === null)\n return false;\n if (this.pageNumber !== obj.pageNumber)\n return false;\n if (this.x !== obj.x)\n return false;\n if (this.y !== obj.y)\n return false;\n return true;\n }\n }\n Real.PointOnPage = PointOnPage;\n class QuadrilateralOnPage extends Internal.NativeBase {\n constructor(pageNumber, bottomLeft, bottomRight, topRight, topLeft) {\n super();\n if (typeof pageNumber !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'pageNumber' must be of type number and must not be null or undefined.\");\n if (typeof bottomLeft !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'bottomLeft' must be of type PdfViewing.Pdf.Geometry.Real.Point and must not be null or undefined.\");\n if (typeof bottomRight !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'bottomRight' must be of type PdfViewing.Pdf.Geometry.Real.Point and must not be null or undefined.\");\n if (typeof topRight !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'topRight' must be of type PdfViewing.Pdf.Geometry.Real.Point and must not be null or undefined.\");\n if (typeof topLeft !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'topLeft' must be of type PdfViewing.Pdf.Geometry.Real.Point and must not be null or undefined.\");\n this.pageNumber = pageNumber;\n this.bottomLeft = bottomLeft;\n this.bottomRight = bottomRight;\n this.topRight = topRight;\n this.topLeft = topLeft;\n }\n equals(obj) {\n if (obj === null)\n return false;\n if (this.pageNumber !== obj.pageNumber)\n return false;\n if (!this.bottomLeft.equals(obj.bottomLeft))\n return false;\n if (!this.bottomRight.equals(obj.bottomRight))\n return false;\n if (!this.topRight.equals(obj.topRight))\n return false;\n if (!this.topLeft.equals(obj.topLeft))\n return false;\n return true;\n }\n }\n Real.QuadrilateralOnPage = QuadrilateralOnPage;\n class RectangleOnPage extends Internal.NativeBase {\n constructor(pageNumber, x, y, width, height) {\n super();\n if (typeof pageNumber !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'pageNumber' must be of type number and must not be null or undefined.\");\n if (typeof x !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'x' must be of type number and must not be null or undefined.\");\n if (typeof y !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'y' must be of type number and must not be null or undefined.\");\n if (typeof width !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'width' must be of type number and must not be null or undefined.\");\n if (typeof height !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'height' must be of type number and must not be null or undefined.\");\n this.pageNumber = pageNumber;\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n }\n equals(obj) {\n if (obj === null)\n return false;\n if (this.pageNumber !== obj.pageNumber)\n return false;\n if (this.x !== obj.x)\n return false;\n if (this.y !== obj.y)\n return false;\n if (this.width !== obj.width)\n return false;\n if (this.height !== obj.height)\n return false;\n return true;\n }\n }\n Real.RectangleOnPage = RectangleOnPage;\n class Vertex extends Internal.NativeBase {\n constructor(pageNumber, x, y, operator) {\n super();\n if (typeof pageNumber !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'pageNumber' must be of type number and must not be null or undefined.\");\n if (typeof x !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'x' must be of type number and must not be null or undefined.\");\n if (typeof y !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'y' must be of type number and must not be null or undefined.\");\n if (typeof operator !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'operator' must be of type PdfViewing.Pdf.Geometry.Real.PathOperation and must not be null or undefined.\");\n this.pageNumber = pageNumber;\n this.x = x;\n this.y = y;\n this.operator = operator;\n }\n equals(obj) {\n if (obj === null)\n return false;\n if (this.pageNumber !== obj.pageNumber)\n return false;\n if (this.x !== obj.x)\n return false;\n if (this.y !== obj.y)\n return false;\n if (this.operator !== obj.operator)\n return false;\n return true;\n }\n }\n Real.Vertex = Vertex;\n let PathOperation;\n (function (PathOperation) {\n PathOperation[PathOperation[\"MoveTo\"] = 0] = \"MoveTo\";\n PathOperation[PathOperation[\"LineTo\"] = 1] = \"LineTo\";\n })(PathOperation = Real.PathOperation || (Real.PathOperation = {}));\n class RectangleOnPageList extends Internal.NativeObject {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n return new RectangleOnPageList(handle);\n }\n close() {\n if (!Module.ViewingPdfGeomRealRectangleOnPageListClose(this.handle))\n Internal.NativeBase.throwLastError();\n }\n remove(element) {\n throw new Error('Method not implemented.');\n }\n add(element) {\n throw new Error('Method not implemented.');\n }\n addRange(inputList) {\n throw new Error('Method not implemented.');\n }\n set(index, element) {\n throw new Error('Method not implemented.');\n }\n clear() {\n throw new Error('Method not implemented.');\n }\n get(index) {\n let retVal = Module.ViewingPdfGeomRealRectangleOnPageListGet(this.handle, index);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return new PdfViewing.Pdf.Geometry.Real.RectangleOnPage(retVal.pageNumber, retVal.x, retVal.y, retVal.width, retVal.height);\n }\n getRange(index, count) {\n throw new Error('Method not implemented.');\n }\n get size() {\n let retVal = Module.ViewingPdfGeomRealRectangleOnPageListGetCount(this.handle);\n if (retVal === -1)\n Internal.NativeBase.throwLastError(false);\n return retVal;\n }\n [Symbol.iterator]() {\n return new ListIterator(this);\n }\n }\n Real.RectangleOnPageList = RectangleOnPageList;\n class Path extends Internal.NativeObject {\n constructor() {\n if (arguments[0] && typeof arguments[0].__handle === `number`)\n super(arguments[0].__handle);\n else {\n super(Internal.NativeObject.checkReturnHandleErrorCode(Module.ViewingPdfGeomRealNewPath()));\n }\n }\n static createDynamicObject(handle) {\n return new Path({ __handle: handle });\n }\n get vertices() {\n let retVal = Module.ViewingPdfGeomRealPathGetVertices(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError(false);\n return PdfViewing.Pdf.Geometry.Real.VertexList.createDynamicObject(retVal);\n }\n set vertices(vertices) {\n if (!(vertices instanceof PdfViewing.Pdf.Geometry.Real.VertexList))\n throw new PdfViewing.ArgumentError(\"Argument 'vertices' must be of type PdfViewing.Pdf.Geometry.Real.VertexList and must not be null or undefined.\");\n let retVal = Module.ViewingPdfGeomRealPathSetVertices(this.handle, vertices.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n }\n Real.Path = Path;\n class PathGenerator extends Internal.NativeObject {\n constructor(path) {\n if (arguments[0] && typeof arguments[0].__handle === `number`)\n super(arguments[0].__handle);\n else {\n if (!(path instanceof PdfViewing.Pdf.Geometry.Real.Path))\n throw new PdfViewing.ArgumentError(\"Argument 'path' must be of type PdfViewing.Pdf.Geometry.Real.Path and must not be null or undefined.\");\n super(Internal.NativeObject.checkReturnHandleErrorCode(Module.ViewingPdfGeomRealNewPathGenerator(path.handle)));\n }\n }\n static createDynamicObject(handle) {\n return new PathGenerator({ __handle: handle });\n }\n close() {\n if (!Module.ViewingPdfGeomRealPathGeneratorClose(this.handle))\n Internal.NativeBase.throwLastError();\n }\n moveTo(target) {\n if (typeof target !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'target' must be of type PdfViewing.Pdf.Geometry.Real.Point and must not be null or undefined.\");\n let retVal = Module.ViewingPdfGeomRealPathGeneratorMoveTo(this.handle, target);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n lineTo(target) {\n if (typeof target !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'target' must be of type PdfViewing.Pdf.Geometry.Real.Point and must not be null or undefined.\");\n let retVal = Module.ViewingPdfGeomRealPathGeneratorLineTo(this.handle, target);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n bezierTo(ctrl1, ctrl2, target) {\n if (typeof ctrl1 !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'ctrl1' must be of type PdfViewing.Pdf.Geometry.Real.Point and must not be null or undefined.\");\n if (typeof ctrl2 !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'ctrl2' must be of type PdfViewing.Pdf.Geometry.Real.Point and must not be null or undefined.\");\n if (typeof target !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'target' must be of type PdfViewing.Pdf.Geometry.Real.Point and must not be null or undefined.\");\n let retVal = Module.ViewingPdfGeomRealPathGeneratorBezierTo(this.handle, ctrl1, ctrl2, target);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n closeSubpath() {\n let retVal = Module.ViewingPdfGeomRealPathGeneratorCloseSubpath(this.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n addRectangle(rect) {\n if (typeof rect !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'rect' must be of type PdfViewing.Pdf.Geometry.Real.RectangleOnPage and must not be null or undefined.\");\n let retVal = Module.ViewingPdfGeomRealPathGeneratorAddRectangle(this.handle, rect);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n }\n Real.PathGenerator = PathGenerator;\n class QuadrilateralList extends Internal.NativeObject {\n constructor() {\n if (arguments[0] && typeof arguments[0].__handle === `number`)\n super(arguments[0].__handle);\n else {\n super(Internal.NativeObject.checkReturnHandleErrorCode(Module.ViewingPdfGeomRealNewQuadrilateralList()));\n }\n }\n static createDynamicObject(handle) {\n return new QuadrilateralList({ __handle: handle });\n }\n close() {\n if (!Module.ViewingPdfGeomRealQuadrilateralListClose(this.handle))\n Internal.NativeBase.throwLastError();\n }\n contains(pointOnPage) {\n if (typeof pointOnPage !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'pointOnPage' must be of type PdfViewing.Pdf.Geometry.Real.PointOnPage and must not be null or undefined.\");\n let retVal = Module.ViewingPdfGeomRealQuadrilateralListContains(this.handle, pointOnPage);\n if (!retVal)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n get boundingBox() {\n let retVal = Module.ViewingPdfGeomRealQuadrilateralListGetBoundingBox(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return new PdfViewing.Pdf.Geometry.Real.RectangleOnPage(retVal.pageNumber, retVal.x, retVal.y, retVal.width, retVal.height);\n }\n remove(element) {\n throw new Error('Method not implemented.');\n }\n add(element) {\n if (typeof element !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'element' must be of type PdfViewing.Pdf.Geometry.Real.QuadrilateralOnPage and must not be null or undefined.\");\n let retVal = Module.ViewingPdfGeomRealQuadrilateralListAdd(this.handle, element);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n return true;\n }\n addRange(inputList) {\n throw new Error('Method not implemented.');\n }\n set(index, element) {\n throw new Error('Method not implemented.');\n }\n clear() {\n throw new Error('Method not implemented.');\n }\n get(index) {\n let retVal = Module.ViewingPdfGeomRealQuadrilateralListGet(this.handle, index);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return new PdfViewing.Pdf.Geometry.Real.QuadrilateralOnPage(retVal.pageNumber, retVal.bottomLeft, retVal.bottomRight, retVal.topRight, retVal.topLeft);\n }\n getRange(index, count) {\n throw new Error('Method not implemented.');\n }\n get size() {\n let retVal = Module.ViewingPdfGeomRealQuadrilateralListGetCount(this.handle);\n if (retVal === -1)\n Internal.NativeBase.throwLastError(false);\n return retVal;\n }\n [Symbol.iterator]() {\n return new ListIterator(this);\n }\n }\n Real.QuadrilateralList = QuadrilateralList;\n class VertexList extends Internal.NativeObject {\n constructor() {\n if (arguments[0] && typeof arguments[0].__handle === `number`)\n super(arguments[0].__handle);\n else {\n super(Internal.NativeObject.checkReturnHandleErrorCode(Module.ViewingPdfGeomRealNewVertexList()));\n }\n }\n static createDynamicObject(handle) {\n return new VertexList({ __handle: handle });\n }\n indexOf(element) {\n for (var i = 0; i < this.size; i++) {\n if (element.equals(this.get(i)))\n return i;\n }\n return -1;\n }\n remove(element) {\n if (typeof element !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'element' must be of type PdfViewing.Pdf.Geometry.Real.Vertex and must not be null or undefined.\");\n let index = this.indexOf(element);\n if (index == -1)\n return false;\n let retVal = Module.ViewingPdfGeomRealVertexListRemove(this.handle, index);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n return true;\n }\n add(element) {\n if (typeof element !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'element' must be of type PdfViewing.Pdf.Geometry.Real.Vertex and must not be null or undefined.\");\n let retVal = Module.ViewingPdfGeomRealVertexListAdd(this.handle, element);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n return true;\n }\n addRange(inputList) {\n if (!(inputList instanceof PdfViewing.Pdf.Geometry.Real.VertexList))\n throw new PdfViewing.ArgumentError(\"Argument 'inputList' must be of type PdfViewing.Pdf.Geometry.Real.VertexList and must not be null or undefined.\");\n if (inputList.size == 0)\n return false;\n let retVal = Module.ViewingPdfGeomRealVertexListAddRange(this.handle, inputList);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n return true;\n }\n set(index, element) {\n if (typeof element !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'element' must be of type PdfViewing.Pdf.Geometry.Real.Vertex and must not be null or undefined.\");\n let retVal = Module.ViewingPdfGeomRealVertexListSet(this.handle, index, element);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n clear() {\n let retVal = Module.ViewingPdfGeomRealVertexListClear(this.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get(index) {\n let retVal = Module.ViewingPdfGeomRealVertexListGet(this.handle, index);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return new PdfViewing.Pdf.Geometry.Real.Vertex(retVal.pageNumber, retVal.x, retVal.y, retVal.operator);\n }\n getRange(index, count) {\n let retVal = Module.ViewingPdfGeomRealVertexListGetRange(this.handle, index, count);\n if (retVal == 0)\n Internal.NativeBase.throwLastError(false);\n return VertexList.createDynamicObject(retVal);\n }\n get size() {\n let retVal = Module.ViewingPdfGeomRealVertexListGetCount(this.handle);\n if (retVal === -1)\n Internal.NativeBase.throwLastError(false);\n return retVal;\n }\n [Symbol.iterator]() {\n return new ListIterator(this);\n }\n }\n Real.VertexList = VertexList;\n })(Real = Geometry.Real || (Geometry.Real = {}));\n let Integer;\n (function (Integer) {\n class Size extends Internal.NativeBase {\n constructor(width, height) {\n super();\n if (typeof width !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'width' must be of type number and must not be null or undefined.\");\n if (typeof height !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'height' must be of type number and must not be null or undefined.\");\n this.width = width;\n this.height = height;\n }\n equals(obj) {\n if (obj === null)\n return false;\n if (this.width !== obj.width)\n return false;\n if (this.height !== obj.height)\n return false;\n return true;\n }\n }\n Integer.Size = Size;\n class ScrollPosition extends Internal.NativeBase {\n constructor(x, y) {\n super();\n if (typeof x !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'x' must be of type number and must not be null or undefined.\");\n if (typeof y !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'y' must be of type number and must not be null or undefined.\");\n this.x = x;\n this.y = y;\n }\n equals(obj) {\n if (obj === null)\n return false;\n if (this.x !== obj.x)\n return false;\n if (this.y !== obj.y)\n return false;\n return true;\n }\n }\n Integer.ScrollPosition = ScrollPosition;\n class Point extends Internal.NativeBase {\n constructor(x, y) {\n super();\n if (typeof x !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'x' must be of type number and must not be null or undefined.\");\n if (typeof y !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'y' must be of type number and must not be null or undefined.\");\n this.x = x;\n this.y = y;\n }\n equals(obj) {\n if (obj === null)\n return false;\n if (this.x !== obj.x)\n return false;\n if (this.y !== obj.y)\n return false;\n return true;\n }\n }\n Integer.Point = Point;\n class Rectangle extends Internal.NativeBase {\n constructor(x, y, width, height) {\n super();\n if (typeof x !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'x' must be of type number and must not be null or undefined.\");\n if (typeof y !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'y' must be of type number and must not be null or undefined.\");\n if (typeof width !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'width' must be of type number and must not be null or undefined.\");\n if (typeof height !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'height' must be of type number and must not be null or undefined.\");\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n }\n equals(obj) {\n if (obj === null)\n return false;\n if (this.x !== obj.x)\n return false;\n if (this.y !== obj.y)\n return false;\n if (this.width !== obj.width)\n return false;\n if (this.height !== obj.height)\n return false;\n return true;\n }\n }\n Integer.Rectangle = Rectangle;\n class Padding extends Internal.NativeBase {\n constructor(left, right, top, bottom) {\n super();\n if (typeof left !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'left' must be of type number and must not be null or undefined.\");\n if (typeof right !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'right' must be of type number and must not be null or undefined.\");\n if (typeof top !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'top' must be of type number and must not be null or undefined.\");\n if (typeof bottom !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'bottom' must be of type number and must not be null or undefined.\");\n this.left = left;\n this.right = right;\n this.top = top;\n this.bottom = bottom;\n }\n equals(obj) {\n if (obj === null)\n return false;\n if (this.left !== obj.left)\n return false;\n if (this.right !== obj.right)\n return false;\n if (this.top !== obj.top)\n return false;\n if (this.bottom !== obj.bottom)\n return false;\n return true;\n }\n }\n Integer.Padding = Padding;\n })(Integer = Geometry.Integer || (Geometry.Integer = {}));\n })(Geometry = Pdf.Geometry || (Pdf.Geometry = {}));\n let Content;\n (function (Content) {\n let Byteorder;\n (function (Byteorder) {\n Byteorder[Byteorder[\"Invalid\"] = 0] = \"Invalid\";\n })(Byteorder = Content.Byteorder || (Content.Byteorder = {}));\n class TextFragmentList extends Internal.NativeObject {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n return new TextFragmentList(handle);\n }\n close() {\n if (!Module.ViewingPdfContentTextFragmentListClose(this.handle))\n Internal.NativeBase.throwLastError();\n }\n remove(element) {\n throw new Error('Method not implemented.');\n }\n add(element) {\n throw new Error('Method not implemented.');\n }\n addRange(inputList) {\n throw new Error('Method not implemented.');\n }\n set(index, element) {\n throw new Error('Method not implemented.');\n }\n clear() {\n throw new Error('Method not implemented.');\n }\n get(index) {\n let retVal = Module.ViewingPdfContentTextFragmentListGet(this.handle, index);\n if (retVal === 0)\n Internal.NativeBase.throwLastError(false);\n return PdfViewing.Pdf.Content.TextFragment.createDynamicObject(retVal);\n }\n getRange(index, count) {\n throw new Error('Method not implemented.');\n }\n get size() {\n let retVal = Module.ViewingPdfContentTextFragmentListGetCount(this.handle);\n if (retVal === -1)\n Internal.NativeBase.throwLastError(false);\n return retVal;\n }\n [Symbol.iterator]() {\n return new ListIterator(this);\n }\n }\n Content.TextFragmentList = TextFragmentList;\n class TextSearchIterator extends Internal.NativeObject {\n constructor(handle) {\n super(handle);\n this.eventListeners = new Map();\n }\n addEventListener(type, listener) {\n if (typeof listener !== 'function')\n throw new PdfViewing.ArgumentError(\"Argument 'listener' must be a function.\");\n var eventObj;\n if (this.eventListeners.has(type)) {\n if (!this.eventListeners.get(type).has(listener)) {\n if (type === 'matchChanged') {\n eventObj = new MatchChangedNativeClass(listener);\n let context = Module.ViewingPdfContentTextSearchIteratorAddMatchChangedHandler(this.handle, eventObj);\n if (context == 0)\n Internal.NativeBase.throwLastError();\n else\n eventObj.context = context;\n this.eventListeners.get(type).set(listener, eventObj);\n }\n }\n if (!this.eventListeners.get(type).has(listener)) {\n if (type === 'totalMatchesChanged') {\n eventObj = new TotalMatchesChangedNativeClass(listener);\n let context = Module.ViewingPdfContentTextSearchIteratorAddTotalMatchesChangedHandler(this.handle, eventObj);\n if (context == 0)\n Internal.NativeBase.throwLastError();\n else\n eventObj.context = context;\n this.eventListeners.get(type).set(listener, eventObj);\n }\n }\n }\n else {\n if (type === 'matchChanged') {\n eventObj = new MatchChangedNativeClass(listener);\n let context = Module.ViewingPdfContentTextSearchIteratorAddMatchChangedHandler(this.handle, eventObj);\n if (context == 0)\n Internal.NativeBase.throwLastError();\n else\n eventObj.context = context;\n let mapItem = new Map();\n mapItem.set(listener, eventObj);\n this.eventListeners.set(type, mapItem);\n }\n if (type === 'totalMatchesChanged') {\n eventObj = new TotalMatchesChangedNativeClass(listener);\n let context = Module.ViewingPdfContentTextSearchIteratorAddTotalMatchesChangedHandler(this.handle, eventObj);\n if (context == 0)\n Internal.NativeBase.throwLastError();\n else\n eventObj.context = context;\n let mapItem = new Map();\n mapItem.set(listener, eventObj);\n this.eventListeners.set(type, mapItem);\n }\n }\n }\n removeEventListener(type, listener) {\n if (this.eventListeners.has(type)) {\n if (type === 'matchChanged') {\n let listeners = this.eventListeners.get(type);\n if (listeners.has(listener)) {\n let eventObj = listeners.get(listener);\n try {\n if (!Module.ViewingPdfContentTextSearchIteratorRemoveMatchChangedHandler(this.handle, eventObj === null || eventObj === void 0 ? void 0 : eventObj.context))\n Internal.NativeBase.throwLastError();\n }\n catch (err) {\n if (err instanceof NotFoundError)\n throw err;\n }\n listeners.delete(listener);\n if (listeners.size === 0)\n this.eventListeners.delete('matchChanged');\n }\n }\n if (type === 'totalMatchesChanged') {\n let listeners = this.eventListeners.get(type);\n if (listeners.has(listener)) {\n let eventObj = listeners.get(listener);\n try {\n if (!Module.ViewingPdfContentTextSearchIteratorRemoveTotalMatchesChangedHandler(this.handle, eventObj === null || eventObj === void 0 ? void 0 : eventObj.context))\n Internal.NativeBase.throwLastError();\n }\n catch (err) {\n if (err instanceof NotFoundError)\n throw err;\n }\n listeners.delete(listener);\n if (listeners.size === 0)\n this.eventListeners.delete('totalMatchesChanged');\n }\n }\n }\n }\n static createDynamicObject(handle) {\n return new TextSearchIterator(handle);\n }\n close() {\n if (!Module.ViewingPdfContentTextSearchIteratorClose(this.handle))\n Internal.NativeBase.throwLastError();\n }\n getNext() {\n var thisHandle = this;\n return new Promise(function (resolved, rejected) {\n if (!Module.ViewingPdfContentTextSearchIteratorGetNext(thisHandle.handle, {\n thisHandle,\n resolved,\n rejected,\n }))\n rejected(Module.ViewingGetLastErrorMessage());\n });\n }\n getNextCallback(context, retVal, errorCode, errorMessage) {\n let error = null;\n if (!retVal)\n error = Internal.NativeBase.createLastError(errorCode, errorMessage);\n if (error === null) {\n context.resolved(retVal);\n }\n else\n context.rejected(error);\n }\n getPrevious() {\n var thisHandle = this;\n return new Promise(function (resolved, rejected) {\n if (!Module.ViewingPdfContentTextSearchIteratorGetPrevious(thisHandle.handle, {\n thisHandle,\n resolved,\n rejected,\n }))\n rejected(Module.ViewingGetLastErrorMessage());\n });\n }\n getPreviousCallback(context, retVal, errorCode, errorMessage) {\n let error = null;\n if (!retVal)\n error = Internal.NativeBase.createLastError(errorCode, errorMessage);\n if (error === null) {\n context.resolved(retVal);\n }\n else\n context.rejected(error);\n }\n loadAllMatches() {\n var thisHandle = this;\n return new Promise(function (resolved, rejected) {\n if (!Module.ViewingPdfContentTextSearchIteratorLoadAllMatches(thisHandle.handle, {\n thisHandle,\n resolved,\n rejected,\n }))\n rejected(Module.ViewingGetLastErrorMessage());\n });\n }\n loadAllMatchesCallback(context, retVal, errorCode, errorMessage) {\n let error = null;\n if (!retVal)\n error = Internal.NativeBase.createLastError(errorCode, errorMessage, false);\n if (error === null) {\n context.resolved();\n }\n else\n context.rejected(error);\n }\n get match() {\n let retVal = Module.ViewingPdfContentTextSearchIteratorGetMatch(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError(false);\n return PdfViewing.Pdf.Content.Selection.createDynamicObject(retVal);\n }\n get matchIndex() {\n let retVal = Module.ViewingPdfContentTextSearchIteratorGetMatchIndex(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n get totalMatches() {\n let retVal = Module.ViewingPdfContentTextSearchIteratorGetTotalMatches(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n get wrapping() {\n let retVal = Module.ViewingPdfContentTextSearchIteratorGetWrapping(this.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n set wrapping(wrapping) {\n if (typeof wrapping !== 'boolean')\n throw new PdfViewing.ArgumentError(\"Argument 'wrapping' must be of type boolean and must not be null or undefined.\");\n let retVal = Module.ViewingPdfContentTextSearchIteratorSetWrapping(this.handle, wrapping);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n }\n Content.TextSearchIterator = TextSearchIterator;\n class EventTextSearchIteratorNativeBase {\n constructor(listener) {\n this.listener = listener;\n }\n }\n class MatchChangedNativeClass extends EventTextSearchIteratorNativeBase {\n constructor(listener) {\n super(listener);\n }\n dispatchEventMatchChanged(Match) {\n this.listener(PdfViewing.Pdf.Content.TextSelection.createDynamicObject(Match));\n }\n }\n class TotalMatchesChangedNativeClass extends EventTextSearchIteratorNativeBase {\n constructor(listener) {\n super(listener);\n }\n dispatchEventTotalMatchesChanged() {\n this.listener(undefined);\n }\n }\n class Image extends Internal.NativeObject {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n let type = Module.ViewingPdfContentImageGetType(handle);\n switch (type) {\n case 0:\n return new Image(handle);\n case 1:\n return PdfViewing.Pdf.Content.PlacedImage.createDynamicObject(handle);\n default:\n return new Image(handle);\n }\n }\n close() {\n if (!Module.ViewingPdfContentImageClose(this.handle))\n Internal.NativeBase.throwLastError();\n }\n removeImageData() {\n let retVal = Module.ViewingPdfContentImageRemoveImageData(this.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError(false);\n }\n get hasImageData() {\n let retVal = Module.ViewingPdfContentImageGetHasImageData(this.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n get id() {\n let retVal = Module.ViewingPdfContentImageGetId(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n get width() {\n let retVal = Module.ViewingPdfContentImageGetWidth(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n get height() {\n let retVal = Module.ViewingPdfContentImageGetHeight(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n get bytePerPixel() {\n let retVal = Module.ViewingPdfContentImageGetBytePerPixel(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n get samples() {\n let retVal = Module.ViewingPdfContentImageGetSamples(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return new Uint8Array(retVal);\n }\n get bufferView() {\n let retVal = Module.ViewingPdfContentImageGetBufferView(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n }\n Content.Image = Image;\n class PlacedImage extends PdfViewing.Pdf.Content.Image {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n return new PlacedImage(handle);\n }\n get imageRectangle() {\n let retVal = Module.ViewingPdfContentPlacedImageGetImageRectangle(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return new PdfViewing.Pdf.Geometry.Integer.Rectangle(retVal.x, retVal.y, retVal.width, retVal.height);\n }\n }\n Content.PlacedImage = PlacedImage;\n class TextFragment extends Internal.NativeObject {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n return new TextFragment(handle);\n }\n close() {\n if (!Module.ViewingPdfContentTextFragmentClose(this.handle))\n Internal.NativeBase.throwLastError();\n }\n get rectangleOnPage() {\n let retVal = Module.ViewingPdfContentTextFragmentGetRectangleOnPage(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return new PdfViewing.Pdf.Geometry.Real.RectangleOnPage(retVal.pageNumber, retVal.x, retVal.y, retVal.width, retVal.height);\n }\n get textArea() {\n let retVal = Module.ViewingPdfContentTextFragmentGetTextArea(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return new PdfViewing.Pdf.Geometry.Real.QuadrilateralOnPage(retVal.pageNumber, retVal.bottomLeft, retVal.bottomRight, retVal.topRight, retVal.topLeft);\n }\n get text() {\n let retVal = Module.ViewingPdfContentTextFragmentGetText(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return retVal;\n }\n get glyphOffsets() {\n let retVal = Module.ViewingPdfContentTextFragmentGetGlyphOffsets(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return retVal;\n }\n }\n Content.TextFragment = TextFragment;\n class Selection extends Internal.NativeObject {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n let type = Module.ViewingPdfContentSelectionGetType(handle);\n switch (type) {\n case 0:\n return new Selection(handle);\n case 1:\n return PdfViewing.Pdf.Content.TextSelection.createDynamicObject(handle);\n default:\n return new Selection(handle);\n }\n }\n close() {\n if (!Module.ViewingPdfContentSelectionClose(this.handle))\n Internal.NativeBase.throwLastError();\n }\n get text() {\n let retVal = Module.ViewingPdfContentSelectionGetText(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n }\n Content.Selection = Selection;\n class TextSelection extends PdfViewing.Pdf.Content.Selection {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n return new TextSelection(handle);\n }\n get textArea() {\n let retVal = Module.ViewingPdfContentTextSelectionGetTextArea(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError(false);\n return PdfViewing.Pdf.Geometry.Real.QuadrilateralList.createDynamicObject(retVal);\n }\n }\n Content.TextSelection = TextSelection;\n class BinaryBuffer extends Internal.NativeObject {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n return new BinaryBuffer(handle);\n }\n close() {\n if (!Module.ViewingPdfContentBinaryBufferClose(this.handle))\n Internal.NativeBase.throwLastError();\n }\n get bufferData() {\n let retVal = Module.ViewingPdfContentBinaryBufferGetBufferData(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return new Uint8Array(retVal);\n }\n get bufferView() {\n let retVal = Module.ViewingPdfContentBinaryBufferGetBufferView(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n }\n Content.BinaryBuffer = BinaryBuffer;\n class RenderedPage extends Internal.NativeObject {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n return new RenderedPage(handle);\n }\n close() {\n if (!Module.ViewingPdfContentRenderedPageClose(this.handle))\n Internal.NativeBase.throwLastError();\n }\n get pageRect() {\n let retVal = Module.ViewingPdfContentRenderedPageGetPageRect(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return new PdfViewing.Pdf.Geometry.Integer.Rectangle(retVal.x, retVal.y, retVal.width, retVal.height);\n }\n get image() {\n let retVal = Module.ViewingPdfContentRenderedPageGetImage(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal !== 0\n ? PdfViewing.Pdf.Content.PlacedImage.createDynamicObject(retVal)\n : null;\n }\n get pageNumber() {\n let retVal = Module.ViewingPdfContentRenderedPageGetPageNumber(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n }\n Content.RenderedPage = RenderedPage;\n class RenderedPageList extends Internal.NativeObject {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n return new RenderedPageList(handle);\n }\n close() {\n if (!Module.ViewingPdfContentRenderedPageListClose(this.handle))\n Internal.NativeBase.throwLastError();\n }\n remove(element) {\n throw new Error('Method not implemented.');\n }\n add(element) {\n throw new Error('Method not implemented.');\n }\n addRange(inputList) {\n throw new Error('Method not implemented.');\n }\n set(index, element) {\n throw new Error('Method not implemented.');\n }\n clear() {\n throw new Error('Method not implemented.');\n }\n get(index) {\n let retVal = Module.ViewingPdfContentRenderedPageListGet(this.handle, index);\n if (retVal === 0)\n Internal.NativeBase.throwLastError(false);\n return PdfViewing.Pdf.Content.RenderedPage.createDynamicObject(retVal);\n }\n getRange(index, count) {\n throw new Error('Method not implemented.');\n }\n get size() {\n let retVal = Module.ViewingPdfContentRenderedPageListGetCount(this.handle);\n if (retVal === -1)\n Internal.NativeBase.throwLastError(false);\n return retVal;\n }\n [Symbol.iterator]() {\n return new ListIterator(this);\n }\n }\n Content.RenderedPageList = RenderedPageList;\n class RenderResults extends Internal.NativeObject {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n return new RenderResults(handle);\n }\n close() {\n if (!Module.ViewingPdfContentRenderResultsClose(this.handle))\n Internal.NativeBase.throwLastError();\n }\n get visiblePages() {\n let retVal = Module.ViewingPdfContentRenderResultsGetVisiblePages(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError(false);\n return PdfViewing.Pdf.Content.RenderedPageList.createDynamicObject(retVal);\n }\n }\n Content.RenderResults = RenderResults;\n })(Content = Pdf.Content || (Pdf.Content = {}));\n let Navigation;\n (function (Navigation) {\n let FitMode;\n (function (FitMode) {\n FitMode[FitMode[\"None\"] = 0] = \"None\";\n FitMode[FitMode[\"FitWidth\"] = 1] = \"FitWidth\";\n FitMode[FitMode[\"FitPage\"] = 2] = \"FitPage\";\n })(FitMode = Navigation.FitMode || (Navigation.FitMode = {}));\n let PageLayoutMode;\n (function (PageLayoutMode) {\n PageLayoutMode[PageLayoutMode[\"SinglePage\"] = 0] = \"SinglePage\";\n PageLayoutMode[PageLayoutMode[\"OneColumn\"] = 1] = \"OneColumn\";\n PageLayoutMode[PageLayoutMode[\"TwoColumnLeft\"] = 2] = \"TwoColumnLeft\";\n PageLayoutMode[PageLayoutMode[\"TwoColumnRight\"] = 3] = \"TwoColumnRight\";\n PageLayoutMode[PageLayoutMode[\"TwoPageLeft\"] = 4] = \"TwoPageLeft\";\n PageLayoutMode[PageLayoutMode[\"TwoPageRight\"] = 5] = \"TwoPageRight\";\n })(PageLayoutMode = Navigation.PageLayoutMode || (Navigation.PageLayoutMode = {}));\n class OutlineItemList extends Internal.NativeObject {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n return new OutlineItemList(handle);\n }\n close() {\n if (!Module.ViewingPdfNavOutlineItemListClose(this.handle))\n Internal.NativeBase.throwLastError();\n }\n remove(element) {\n throw new Error('Method not implemented.');\n }\n add(element) {\n throw new Error('Method not implemented.');\n }\n addRange(inputList) {\n throw new Error('Method not implemented.');\n }\n set(index, element) {\n throw new Error('Method not implemented.');\n }\n clear() {\n throw new Error('Method not implemented.');\n }\n get(index) {\n let retVal = Module.ViewingPdfNavOutlineItemListGet(this.handle, index);\n if (retVal === 0)\n Internal.NativeBase.throwLastError(false);\n return PdfViewing.Pdf.Navigation.OutlineItem.createDynamicObject(retVal);\n }\n getRange(index, count) {\n throw new Error('Method not implemented.');\n }\n get size() {\n let retVal = Module.ViewingPdfNavOutlineItemListGetCount(this.handle);\n if (retVal === -1)\n Internal.NativeBase.throwLastError(false);\n return retVal;\n }\n [Symbol.iterator]() {\n return new ListIterator(this);\n }\n }\n Navigation.OutlineItemList = OutlineItemList;\n class Destination extends Internal.NativeObject {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n let type = Module.ViewingPdfNavDestinationGetType(handle);\n switch (type) {\n case 0:\n return new Destination(handle);\n case 1:\n return PdfViewing.Pdf.Navigation.NamedDestination.createDynamicObject(handle);\n case 2:\n return PdfViewing.Pdf.Navigation.DirectDestination.createDynamicObject(handle);\n case 3:\n return PdfViewing.Pdf.Navigation.LocationZoomDestination.createDynamicObject(handle);\n case 4:\n return PdfViewing.Pdf.Navigation.FitPageDestination.createDynamicObject(handle);\n case 5:\n return PdfViewing.Pdf.Navigation.FitWidthDestination.createDynamicObject(handle);\n case 6:\n return PdfViewing.Pdf.Navigation.FitHeightDestination.createDynamicObject(handle);\n case 7:\n return PdfViewing.Pdf.Navigation.FitRectangleDestination.createDynamicObject(handle);\n default:\n return new Destination(handle);\n }\n }\n close() {\n if (!Module.ViewingPdfNavDestinationClose(this.handle))\n Internal.NativeBase.throwLastError();\n }\n get target() {\n let retVal = Module.ViewingPdfNavDestinationGetTarget(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError(false);\n return PdfViewing.Pdf.Navigation.DirectDestination.createDynamicObject(retVal);\n }\n }\n Navigation.Destination = Destination;\n class NamedDestination extends PdfViewing.Pdf.Navigation.Destination {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n return new NamedDestination(handle);\n }\n get name() {\n let retVal = Module.ViewingPdfNavNamedDestinationGetName(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return retVal;\n }\n }\n Navigation.NamedDestination = NamedDestination;\n class DirectDestination extends PdfViewing.Pdf.Navigation.Destination {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n let type = Module.ViewingPdfNavDirectDestinationGetType(handle);\n switch (type) {\n case 0:\n return new DirectDestination(handle);\n case 1:\n return PdfViewing.Pdf.Navigation.LocationZoomDestination.createDynamicObject(handle);\n case 2:\n return PdfViewing.Pdf.Navigation.FitPageDestination.createDynamicObject(handle);\n case 3:\n return PdfViewing.Pdf.Navigation.FitWidthDestination.createDynamicObject(handle);\n case 4:\n return PdfViewing.Pdf.Navigation.FitHeightDestination.createDynamicObject(handle);\n case 5:\n return PdfViewing.Pdf.Navigation.FitRectangleDestination.createDynamicObject(handle);\n default:\n return new DirectDestination(handle);\n }\n }\n get pageNumber() {\n let retVal = Module.ViewingPdfNavDirectDestinationGetPageNumber(this.handle);\n if (retVal === -1)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n }\n Navigation.DirectDestination = DirectDestination;\n class LocationZoomDestination extends PdfViewing.Pdf.Navigation.DirectDestination {\n constructor(pageNumber, left, top, zoom) {\n if (arguments[0] && typeof arguments[0].__handle === `number`)\n super(arguments[0].__handle);\n else {\n if (typeof pageNumber !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'pageNumber' must be of type number and must not be null or undefined.\");\n if (left !== null && left !== undefined && typeof left !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'left' must be of type number or can be null or undefined.\");\n if (top !== null && top !== undefined && typeof top !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'top' must be of type number or can be null or undefined.\");\n if (zoom !== null && zoom !== undefined && typeof zoom !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'zoom' must be of type number or can be null or undefined.\");\n super(Internal.NativeObject.checkReturnHandleErrorCode(Module.ViewingPdfNavNewLocationZoomDestination(pageNumber, left, top, zoom)));\n }\n }\n static createDynamicObject(handle) {\n return new LocationZoomDestination({ __handle: handle });\n }\n get left() {\n let retVal = Module.ViewingPdfNavLocationZoomDestinationGetLeft(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n get top() {\n let retVal = Module.ViewingPdfNavLocationZoomDestinationGetTop(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n get zoom() {\n let retVal = Module.ViewingPdfNavLocationZoomDestinationGetZoom(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n }\n Navigation.LocationZoomDestination = LocationZoomDestination;\n class FitPageDestination extends PdfViewing.Pdf.Navigation.DirectDestination {\n constructor(pageNumber, fitActualContent) {\n if (arguments[0] && typeof arguments[0].__handle === `number`)\n super(arguments[0].__handle);\n else {\n if (typeof pageNumber !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'pageNumber' must be of type number and must not be null or undefined.\");\n if (typeof fitActualContent !== 'boolean')\n throw new PdfViewing.ArgumentError(\"Argument 'fitActualContent' must be of type boolean and must not be null or undefined.\");\n super(Internal.NativeObject.checkReturnHandleErrorCode(Module.ViewingPdfNavNewFitPageDestination(pageNumber, fitActualContent)));\n }\n }\n static createDynamicObject(handle) {\n return new FitPageDestination({ __handle: handle });\n }\n get fitActualContent() {\n let retVal = Module.ViewingPdfNavFitPageDestinationGetFitActualContent(this.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n }\n Navigation.FitPageDestination = FitPageDestination;\n class FitWidthDestination extends PdfViewing.Pdf.Navigation.DirectDestination {\n constructor(pageNumber, top, fitActualContent) {\n if (arguments[0] && typeof arguments[0].__handle === `number`)\n super(arguments[0].__handle);\n else {\n if (typeof pageNumber !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'pageNumber' must be of type number and must not be null or undefined.\");\n if (top !== null && top !== undefined && typeof top !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'top' must be of type number or can be null or undefined.\");\n if (typeof fitActualContent !== 'boolean')\n throw new PdfViewing.ArgumentError(\"Argument 'fitActualContent' must be of type boolean and must not be null or undefined.\");\n super(Internal.NativeObject.checkReturnHandleErrorCode(Module.ViewingPdfNavNewFitWidthDestination(pageNumber, top, fitActualContent)));\n }\n }\n static createDynamicObject(handle) {\n return new FitWidthDestination({ __handle: handle });\n }\n get fitActualContent() {\n let retVal = Module.ViewingPdfNavFitWidthDestinationGetFitActualContent(this.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n get top() {\n let retVal = Module.ViewingPdfNavFitWidthDestinationGetTop(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n }\n Navigation.FitWidthDestination = FitWidthDestination;\n class FitHeightDestination extends PdfViewing.Pdf.Navigation.DirectDestination {\n constructor(pageNumber, left, fitActualContent) {\n if (arguments[0] && typeof arguments[0].__handle === `number`)\n super(arguments[0].__handle);\n else {\n if (typeof pageNumber !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'pageNumber' must be of type number and must not be null or undefined.\");\n if (left !== null && left !== undefined && typeof left !== 'number')\n throw new PdfViewing.ArgumentError(\"Argument 'left' must be of type number or can be null or undefined.\");\n if (typeof fitActualContent !== 'boolean')\n throw new PdfViewing.ArgumentError(\"Argument 'fitActualContent' must be of type boolean and must not be null or undefined.\");\n super(Internal.NativeObject.checkReturnHandleErrorCode(Module.ViewingPdfNavNewFitHeightDestination(pageNumber, left, fitActualContent)));\n }\n }\n static createDynamicObject(handle) {\n return new FitHeightDestination({ __handle: handle });\n }\n get fitActualContent() {\n let retVal = Module.ViewingPdfNavFitHeightDestinationGetFitActualContent(this.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n get left() {\n let retVal = Module.ViewingPdfNavFitHeightDestinationGetLeft(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n }\n Navigation.FitHeightDestination = FitHeightDestination;\n class FitRectangleDestination extends PdfViewing.Pdf.Navigation.DirectDestination {\n constructor(rectangleOnPage) {\n if (arguments[0] && typeof arguments[0].__handle === `number`)\n super(arguments[0].__handle);\n else {\n if (typeof rectangleOnPage !== 'object')\n throw new PdfViewing.ArgumentError(\"Argument 'rectangleOnPage' must be of type PdfViewing.Pdf.Geometry.Real.RectangleOnPage and must not be null or undefined.\");\n super(Internal.NativeObject.checkReturnHandleErrorCode(Module.ViewingPdfNavNewFitRectangleDestination(rectangleOnPage)));\n }\n }\n static createDynamicObject(handle) {\n return new FitRectangleDestination({ __handle: handle });\n }\n get rectangle() {\n let retVal = Module.ViewingPdfNavFitRectangleDestinationGetRectangle(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return new PdfViewing.Pdf.Geometry.Real.RectangleOnPage(retVal.pageNumber, retVal.x, retVal.y, retVal.width, retVal.height);\n }\n }\n Navigation.FitRectangleDestination = FitRectangleDestination;\n class OutlineItem extends Internal.NativeObject {\n constructor(handle) {\n super(handle);\n }\n static createDynamicObject(handle) {\n return new OutlineItem(handle);\n }\n close() {\n if (!Module.ViewingPdfNavOutlineItemClose(this.handle))\n Internal.NativeBase.throwLastError();\n }\n get title() {\n let retVal = Module.ViewingPdfNavOutlineItemGetTitle(this.handle);\n if (retVal === null)\n Internal.NativeBase.throwLastError(false);\n return retVal;\n }\n get bold() {\n let retVal = Module.ViewingPdfNavOutlineItemGetBold(this.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n get italic() {\n let retVal = Module.ViewingPdfNavOutlineItemGetItalic(this.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n get destination() {\n let retVal = Module.ViewingPdfNavOutlineItemGetDestination(this.handle);\n if (retVal === 0)\n Internal.NativeBase.throwLastError();\n return retVal !== 0\n ? PdfViewing.Pdf.Navigation.Destination.createDynamicObject(retVal)\n : null;\n }\n get isOpen() {\n let retVal = Module.ViewingPdfNavOutlineItemGetIsOpen(this.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n get hasChildren() {\n let retVal = Module.ViewingPdfNavOutlineItemGetHasChildren(this.handle);\n if (!retVal)\n Internal.NativeBase.throwLastError();\n return retVal;\n }\n }\n Navigation.OutlineItem = OutlineItem;\n })(Navigation = Pdf.Navigation || (Pdf.Navigation = {}));\n })(Pdf = PdfViewing.Pdf || (PdfViewing.Pdf = {}));\n class GenericError extends PdfViewingError {\n constructor(message) {\n super(message);\n }\n }\n PdfViewing.GenericError = GenericError;\n class FatalError extends PdfViewingError {\n constructor(message) {\n super(message);\n }\n }\n PdfViewing.FatalError = FatalError;\n class LicenseError extends PdfViewingError {\n constructor(message) {\n super(message);\n }\n }\n PdfViewing.LicenseError = LicenseError;\n class UnknownFormatError extends PdfViewingError {\n constructor(message) {\n super(message);\n }\n }\n PdfViewing.UnknownFormatError = UnknownFormatError;\n class CorruptError extends PdfViewingError {\n constructor(message) {\n super(message);\n }\n }\n PdfViewing.CorruptError = CorruptError;\n class PasswordError extends PdfViewingError {\n constructor(message) {\n super(message);\n }\n }\n PdfViewing.PasswordError = PasswordError;\n class ConformanceError extends PdfViewingError {\n constructor(message) {\n super(message);\n }\n }\n PdfViewing.ConformanceError = ConformanceError;\n class UnsupportedFeatureError extends PdfViewingError {\n constructor(message) {\n super(message);\n }\n }\n PdfViewing.UnsupportedFeatureError = UnsupportedFeatureError;\n class InfrastructureError extends PdfViewingError {\n constructor(message) {\n super(message);\n }\n }\n PdfViewing.InfrastructureError = InfrastructureError;\n class ProcessingError extends PdfViewingError {\n constructor(message) {\n super(message);\n }\n }\n PdfViewing.ProcessingError = ProcessingError;\n class ExistsError extends PdfViewingError {\n constructor(message) {\n super(message);\n }\n }\n PdfViewing.ExistsError = ExistsError;\n class UpdateFailedError extends PdfViewingError {\n constructor(message) {\n super(message);\n }\n }\n PdfViewing.UpdateFailedError = UpdateFailedError;\n class NotSupportedError extends PdfViewingError {\n constructor(message) {\n super(message);\n }\n }\n PdfViewing.NotSupportedError = NotSupportedError;\n class InvalidOperationError extends PdfViewingError {\n constructor(message) {\n super(message);\n }\n }\n PdfViewing.InvalidOperationError = InvalidOperationError;\n class ArgumentError extends PdfViewingError {\n constructor(message) {\n super(message);\n }\n }\n PdfViewing.ArgumentError = ArgumentError;\n class NotFoundError extends PdfViewingError {\n constructor(message) {\n super(message);\n }\n }\n PdfViewing.NotFoundError = NotFoundError;\n class IOError extends PdfViewingError {\n constructor(message) {\n super(message);\n }\n }\n PdfViewing.IOError = IOError;\n let Sys;\n (function (Sys) {\n class StreamObject {\n constructor() {\n this._parameter = new Uint8Array(0);\n this.currPos = 0;\n }\n get parameter() {\n return this._parameter;\n }\n set parameter(value) {\n if (value instanceof Blob)\n this._parameter = new Uint8Array(new FileReaderSync().readAsArrayBuffer(value));\n else if (value instanceof Uint8Array)\n this._parameter = value;\n else\n throw new TypeError('Not allowed type for parameter in StreamObject. Allowed types are Uint8Array and Blob.');\n }\n getLength() {\n return this._parameter.byteLength;\n }\n seek(position) {\n if (position > this.getLength())\n return false;\n if (position === -1)\n this.currPos = this.getLength();\n else\n this.currPos = position;\n return true;\n }\n tell() {\n return this.currPos;\n }\n read(bufoffset, size) {\n size = Math.min(size, this._parameter.byteLength - this.currPos);\n if (size !== 0) {\n let writearr = new Uint8Array(Module.HEAP8.buffer, bufoffset, size);\n writearr.set(this._parameter.subarray(this.currPos, this.currPos + size));\n this.currPos = this.currPos + size;\n return writearr.length;\n }\n return 0;\n }\n write(bufoffset, size) {\n let requiredLength = this.currPos + size;\n if (requiredLength > this._parameter.byteLength) {\n if (requiredLength > this._parameter.buffer.byteLength - this._parameter.byteOffset) {\n if (requiredLength > Number.MAX_SAFE_INTEGER)\n throw new IOError('Reached maximum array size.');\n let newLength = 8096;\n while (newLength < requiredLength)\n newLength *= 2;\n newLength = Math.min(newLength, Number.MAX_SAFE_INTEGER);\n let uint8ArrayTemp = new Uint8Array(new ArrayBuffer(newLength));\n uint8ArrayTemp.set(this._parameter);\n this._parameter = uint8ArrayTemp;\n }\n this._parameter = new Uint8Array(this._parameter.buffer, this._parameter.byteOffset, requiredLength);\n }\n let readarr = new Uint8Array(Module.HEAP8.buffer, bufoffset, size);\n this._parameter.subarray(this.currPos, this.currPos + size).set(readarr);\n this.currPos = this.currPos + size;\n return size;\n }\n }\n Sys.StreamObject = StreamObject;\n })(Sys = PdfViewing.Sys || (PdfViewing.Sys = {}));\n class ListIterator {\n constructor(list) {\n this.index = 0;\n this.list = list;\n }\n next() {\n if (this.index === this.list.size)\n return { done: true, value: null };\n let element = this.list.get(this.index);\n this.index++;\n return { done: element === null, value: element };\n }\n }\n class AnnotationFilterWrapper {\n constructor(callback) {\n this.callback = callback;\n }\n annotationFilter(annotation) {\n try {\n let retVal = this.callback(PdfViewing.Pdf.Annotations.Annotation.createDynamicObject(annotation));\n Module.ViewingSetLastError(0, null);\n return retVal;\n }\n catch (err) {\n if (err instanceof Error)\n setLastErrorFromCallback(err);\n return false;\n }\n }\n }\n function setLastErrorFromCallback(err) {\n if (err instanceof PdfViewing.GenericError)\n Module.ViewingSetLastError(10, err.message);\n else if (err instanceof PdfViewing.FatalError)\n Module.ViewingSetLastError(11, err.message);\n else if (err instanceof PdfViewing.LicenseError)\n Module.ViewingSetLastError(12, err.message);\n else if (err instanceof PdfViewing.UnknownFormatError)\n Module.ViewingSetLastError(15, err.message);\n else if (err instanceof PdfViewing.CorruptError)\n Module.ViewingSetLastError(16, err.message);\n else if (err instanceof PdfViewing.PasswordError)\n Module.ViewingSetLastError(17, err.message);\n else if (err instanceof PdfViewing.ConformanceError)\n Module.ViewingSetLastError(18, err.message);\n else if (err instanceof PdfViewing.UnsupportedFeatureError)\n Module.ViewingSetLastError(19, err.message);\n else if (err instanceof PdfViewing.InfrastructureError)\n Module.ViewingSetLastError(20, err.message);\n else if (err instanceof PdfViewing.ProcessingError)\n Module.ViewingSetLastError(21, err.message);\n else if (err instanceof PdfViewing.ExistsError)\n Module.ViewingSetLastError(22, err.message);\n else if (err instanceof PdfViewing.UpdateFailedError)\n Module.ViewingSetLastError(23, err.message);\n else if (err instanceof PdfViewing.NotSupportedError)\n Module.ViewingSetLastError(1, err.message);\n else if (err instanceof PdfViewing.InvalidOperationError)\n Module.ViewingSetLastError(2, err.message);\n else if (err instanceof PdfViewing.ArgumentError)\n Module.ViewingSetLastError(3, err.message);\n else if (err instanceof PdfViewing.NotFoundError)\n Module.ViewingSetLastError(5, err.message);\n else if (err instanceof PdfViewing.IOError)\n Module.ViewingSetLastError(4, err.message);\n else\n Module.ViewingSetLastError(6, err.message);\n }\n})(PdfViewing || (PdfViewing = {}));\n","export class UserSettings {\n constructor() {\n this.localStorageAccessible = false;\n let settingsStr = null;\n try {\n settingsStr = localStorage.getItem('PDFToolsAG.ViewerSettings');\n this.localStorageAccessible = true;\n }\n catch (err) {\n console.warn('local storage not accessible');\n }\n try {\n this.toolSettings = settingsStr ? JSON.parse(settingsStr) : {};\n }\n catch (_a) {\n this.toolSettings = {};\n }\n this.save = this.save.bind(this);\n this.getItem = this.getItem.bind(this);\n this.setItem = this.setItem.bind(this);\n }\n save() {\n if (this.localStorageAccessible) {\n const settings = JSON.stringify(this.toolSettings);\n localStorage.setItem('PDFToolsAG.ViewerSettings', settings);\n }\n }\n getItem(key, defaultValue) {\n if (this.localStorageAccessible && this.toolSettings.hasOwnProperty(key)) {\n return this.toolSettings[key];\n }\n return defaultValue;\n }\n setItem(key, value) {\n if (this.localStorageAccessible) {\n this.toolSettings[key] = value;\n this.save();\n }\n }\n}\n","import { UserSettings } from './UserSettings';\nimport { FreetextAnnotationModule, HighlightAnnotationModule, ImageAnnotationModule, InkAnnotationModule, PopupModule, ShapeAnnotationModule, StampAnnotationModule, TextAnnotationModule, PrintServiceModule, EraserModule, FormFieldModule, } from '../modules';\nimport { PdfPageLayoutMode, StampAnnotationColor, } from '../pdf-viewer-api';\nexport const defaultAnnotationColorOptions = {\n highlightColors: ['#2ADB1A', '#FFEA02', '#FF7F1F', '#FF2882', '#008AD1'],\n foregroundColors: ['#323232', '#FFFFFF', '#FFEA02', '#2ADB1A', '#0066CC', '#D82F32'],\n backgroundColors: ['#FFFFFF', '#FCF5E2', '#323232', '#FFEA02', '#D82F32', '#0066CC'],\n defaultHighlightColor: '#FFEA02',\n defaultBackgroundColor: '#FCF5E2',\n defaultForegroundColor: '#323232',\n};\nexport const defaultAnnotationFontOptions = {\n fontFamilies: ['Helvetica', 'Times', 'Courier', 'Symbol', 'ZapfDingbats'],\n fontSizes: [9, 10, 12, 14, 16, 18, 20, 24],\n defaultFontFamily: 'Helvetica',\n defaultFontSize: 12,\n};\nexport const defaultAnnotationStamps = [\n { translation_key: 'stamptext.approved', color: StampAnnotationColor.GREEN },\n { translation_key: 'stamptext.notApproved', color: StampAnnotationColor.RED },\n { translation_key: 'stamptext.draft', color: StampAnnotationColor.BLUE },\n { translation_key: 'stamptext.final', color: StampAnnotationColor.GREEN },\n { translation_key: 'stamptext.completed', color: StampAnnotationColor.GREEN },\n {\n translation_key: 'stamptext.confidential',\n color: StampAnnotationColor.BLUE,\n },\n { translation_key: 'stamptext.forPublic', color: StampAnnotationColor.BLUE },\n {\n translation_key: 'stamptext.notForPublic',\n color: StampAnnotationColor.BLUE,\n },\n { translation_key: 'stamptext.void', color: StampAnnotationColor.RED },\n { translation_key: 'stamptext.forComment', color: StampAnnotationColor.BLUE },\n {\n translation_key: 'stamptext.preliminaryResults',\n color: StampAnnotationColor.BLUE,\n },\n {\n translation_key: 'stamptext.informationOnly',\n color: StampAnnotationColor.BLUE,\n },\n];\nexport const defaultAnnotationOptions = {\n colors: defaultAnnotationColorOptions,\n stamps: defaultAnnotationStamps,\n fonts: defaultAnnotationFontOptions,\n highlightOpacity: 0.5,\n strokeWidths: [0, 1, 2, 3, 5, 8, 13, 21],\n defaultStampWidth: 120,\n defaultBorderWidth: 1,\n eraserRadius: 5,\n hideAnnotationSubject: false,\n trackHistory: false,\n onlyAuthorCanEdit: false,\n hideOnDelete: false,\n selectedStamp: 0,\n};\nexport const defaultGeneralOptions = {\n user: '',\n language: 'en',\n annotationBarPosition: 'left',\n promptOnUnsavedChange: true,\n searchMatchColor: '#3ABCFF',\n textSelectionColor: '#006395',\n rectangularTextSelection: 'none',\n pageShadow: {\n shadowBlur: 4,\n shadowColor: 'rgba(90,90,90,0.2)',\n shadowOffsetX: 0,\n shadowOffsetY: 0,\n },\n pageLayoutModes: [\n PdfPageLayoutMode.ONE_COLUMN,\n PdfPageLayoutMode.SINGLE_PAGE,\n PdfPageLayoutMode.TWO_COLUMN_LEFT,\n PdfPageLayoutMode.TWO_COLUMN_RIGHT,\n PdfPageLayoutMode.TWO_PAGE_LEFT,\n PdfPageLayoutMode.TWO_PAGE_RIGHT,\n ],\n defaultZoomLevels: [\n 0.1, 0.15, 0.2, 0.25, 0.35, 0.4, 0.5, 0.65, 0.8, 1, 1.25, 1.5, 2.0, 2.5, 3.0, 4.0,\n ],\n tooltips: 'title',\n viewOnly: false,\n disableMainToolbar: false,\n disableAnnotationToolbar: false,\n hidePasswordFormCancelButton: false,\n};\nexport const defaultKeyboardShortcuts = {\n zoomIn: { key: '+' },\n zoomOut: { key: '-' },\n nextPage: { key: 'PageDown' },\n previousPage: { key: 'PageUp' },\n firstPage: { key: 'Home' },\n lastPage: { key: 'End' },\n scrollUp: { key: 'ArrowUp' },\n scrollDown: { key: 'ArrowDown' },\n scrollLeft: { key: 'ArrowLeft' },\n scrollRight: { key: 'ArrowRight' },\n releaseSelection: { key: 'Escape' },\n copy: {\n key: 'c',\n ctrlKey: true,\n },\n copyMac: {\n key: 'c',\n superKey: true,\n },\n print: {\n key: 'p',\n ctrlKey: true,\n },\n cancelPrint: {\n key: 'Escape',\n },\n resetZoom: {\n key: 'z',\n altKey: true,\n },\n fitToPage: {\n key: 'p',\n altKey: true,\n },\n fitToWidth: {\n key: 'w',\n altKey: true,\n },\n rotateView: {\n key: 'r',\n altKey: true,\n },\n save: {\n key: 's',\n ctrlKey: true,\n },\n search: {\n key: 'f',\n ctrlKey: true,\n },\n searchNext: { key: 'F3' },\n searchPrevious: {\n key: 'F3',\n shiftKey: true,\n },\n closeSearch: { key: 'Escape' },\n toggleSidePane: {\n key: 's',\n altKey: true,\n },\n showAnnotations: {\n key: 'a',\n altKey: true,\n },\n showOutline: {\n key: 'o',\n altKey: true,\n },\n showThumbnails: {\n key: 't',\n altKey: true,\n },\n cancelEditAnnotation: { key: 'Escape' },\n};\nexport const defaultSidebarOptions = {\n annotationNavigation: true,\n thumbnailNavigation: true,\n outlineNavigation: true,\n};\nexport const defaultFormsOptions = {\n enabled: true,\n};\nexport const defaultPermissions = {\n allowOpenFile: true,\n allowCloseFile: false,\n allowFileDrop: true,\n allowPrinting: false,\n allowSaveFile: true,\n allowCopyText: true,\n allowRotateView: true,\n allowLockAnnotations: true,\n allowEditLockedAnnotations: false,\n allowRotatePages: true,\n allowExternalLinks: true,\n enablePageLayoutMode: true,\n enableSearch: true,\n};\nexport const defaultViewerOptions = {\n general: defaultGeneralOptions,\n sidebar: defaultSidebarOptions,\n permissions: defaultPermissions,\n callbacks: {},\n customButtons: {\n annotationbar: [],\n documentbar: [],\n informationbar: [],\n },\n};\nexport const defaultViewerModules = [\n PopupModule,\n TextAnnotationModule,\n InkAnnotationModule,\n EraserModule,\n FreetextAnnotationModule,\n HighlightAnnotationModule,\n StampAnnotationModule,\n ShapeAnnotationModule,\n ImageAnnotationModule,\n];\nexport const defaultWebViewerOptions = {\n viewer: defaultViewerOptions,\n modules: defaultViewerModules,\n annotation: defaultAnnotationOptions,\n forms: defaultFormsOptions,\n shortcuts: defaultKeyboardShortcuts,\n};\nexport const OptionsToVerify = {\n defaultHighlightAnnotationColor: 'highlightColors',\n defaultFreetextBgColor: 'backgroundColors',\n defaultFreetextFontColor: 'foregroundColors',\n defaultFreetextFontFamily: 'fontFamilies',\n defaultFreetextFontSize: 'fontSizes',\n defaultInkColor: 'foregroundColors',\n defaultStickyNoteColor: 'highlightColors',\n defaultBackgroundColor: 'backgroundColors',\n defaultForegroundColor: 'foregroundColors',\n defaultHighlightColor: 'highlightColors',\n defaultFontSize: 'fontSizes',\n};\nexport const ColorPaletteMap = {\n highlightColors: 'defaultHighlightColor',\n backgroundColors: 'defaultBackgroundColor',\n foregroundColors: 'defaultForegroundColor',\n};\nclass StorageClass {\n constructor() {\n this.internalStorage = new UserSettings();\n }\n get storage() {\n return this.internalStorage;\n }\n}\nexport class GeneralOptions extends StorageClass {\n constructor(_options) {\n super();\n this.options = Object.assign(Object.assign({}, defaultGeneralOptions), _options);\n }\n get user() {\n return this.options.user;\n }\n get language() {\n return this.options.language;\n }\n get annotationBarPosition() {\n return this.options.annotationBarPosition;\n }\n set annotationBarPosition(position) {\n this.storage.setItem('annotationBarPosition', position);\n }\n get promptOnUnsavedChange() {\n return this.options.promptOnUnsavedChange;\n }\n get textSelectionColor() {\n return this.options.textSelectionColor;\n }\n get rectangularTextSelection() {\n return this.options.rectangularTextSelection;\n }\n get searchMatchColor() {\n return this.options.searchMatchColor;\n }\n get pageLayoutModes() {\n return this.options.pageLayoutModes;\n }\n get defaultZoomLevels() {\n return this.options.defaultZoomLevels;\n }\n get pageShadow() {\n return this.options.pageShadow;\n }\n get currentPageShadow() {\n return this.options.currentPageShadow;\n }\n get viewOnly() {\n return this.options.viewOnly;\n }\n get tooltips() {\n return this.options.tooltips;\n }\n get disableMainToolbar() {\n return this.options.disableMainToolbar;\n }\n get disableAnnotationToolbar() {\n return this.options.disableAnnotationToolbar;\n }\n get hidePasswordFormCancelButton() {\n return this.options.hidePasswordFormCancelButton;\n }\n}\nexport class SidebarOptions {\n constructor(_options) {\n this.options = Object.assign(Object.assign({}, defaultSidebarOptions), _options);\n }\n get thumbnailNavigation() {\n return this.options.thumbnailNavigation;\n }\n get outlineNavigation() {\n return this.options.outlineNavigation;\n }\n get annotationNavigation() {\n return this.options.annotationNavigation;\n }\n}\nexport class FormsOptions {\n constructor(_options) {\n this.options = Object.assign(Object.assign({}, defaultFormsOptions), _options);\n }\n get enabled() {\n return this.options.enabled;\n }\n}\nexport class ViewerOptions {\n constructor(_options) {\n var _a, _b, _c, _d, _e, _f;\n this.options = {\n general: Object.assign(Object.assign({}, defaultViewerOptions.general), _options === null || _options === void 0 ? void 0 : _options.general),\n sidebar: Object.assign(Object.assign({}, defaultViewerOptions.sidebar), _options === null || _options === void 0 ? void 0 : _options.sidebar),\n permissions: Object.assign(Object.assign({}, defaultViewerOptions.permissions), _options === null || _options === void 0 ? void 0 : _options.permissions),\n callbacks: Object.assign(Object.assign({}, defaultViewerOptions.callbacks), _options === null || _options === void 0 ? void 0 : _options.callbacks),\n customButtons: {\n annotationbar: ((_a = _options === null || _options === void 0 ? void 0 : _options.customButtons) === null || _a === void 0 ? void 0 : _a.annotationbar)\n ? (_b = _options === null || _options === void 0 ? void 0 : _options.customButtons) === null || _b === void 0 ? void 0 : _b.annotationbar\n : [],\n documentbar: ((_c = _options === null || _options === void 0 ? void 0 : _options.customButtons) === null || _c === void 0 ? void 0 : _c.documentbar)\n ? (_d = _options === null || _options === void 0 ? void 0 : _options.customButtons) === null || _d === void 0 ? void 0 : _d.documentbar\n : [],\n informationbar: ((_e = _options === null || _options === void 0 ? void 0 : _options.customButtons) === null || _e === void 0 ? void 0 : _e.informationbar)\n ? (_f = _options === null || _options === void 0 ? void 0 : _options.customButtons) === null || _f === void 0 ? void 0 : _f.informationbar\n : [],\n },\n };\n this.generalOptions = new GeneralOptions(_options === null || _options === void 0 ? void 0 : _options.general);\n }\n get general() {\n return this.generalOptions;\n }\n get sidebar() {\n return this.options.sidebar;\n }\n get permissions() {\n return this.options.permissions;\n }\n get callbacks() {\n return this.options.callbacks;\n }\n get customButtons() {\n return this.options.customButtons;\n }\n}\nexport class AnnotationColorOptions extends StorageClass {\n constructor(_options) {\n super();\n this.options = Object.assign(Object.assign({}, defaultAnnotationColorOptions), _options);\n }\n get highlightColors() {\n return this.options.highlightColors;\n }\n get foregroundColors() {\n return this.options.foregroundColors;\n }\n get backgroundColors() {\n return this.options.backgroundColors;\n }\n get defaultHighlightColor() {\n return this.options.defaultHighlightColor;\n }\n get defaultForegroundColor() {\n return this.options.defaultForegroundColor;\n }\n get defaultBackgroundColor() {\n return this.options.defaultBackgroundColor;\n }\n get highlightAnnotationColor() {\n return this.storage.getItem('highlightAnnotationColor', this.defaultHighlightColor);\n }\n set highlightAnnotationColor(color) {\n this.storage.setItem('highlightAnnotationColor', color);\n }\n get stickyNoteColor() {\n return this.storage.getItem('stickyNoteColor', this.options.defaultHighlightColor);\n }\n set stickyNoteColor(color) {\n this.storage.setItem('stickyNoteColor', color);\n }\n get freetextBackgroundColor() {\n return this.storage.getItem('freetextBackgroundColor', this.defaultBackgroundColor);\n }\n set freetextBackgroundColor(color) {\n this.storage.setItem('freetextBackgroundColor', color);\n }\n set freetextFontColor(color) {\n this.storage.setItem('freetextFontColor', color);\n }\n get freetextFontColor() {\n return this.storage.getItem('freetextFontColor', this.options.defaultForegroundColor);\n }\n get inkColor() {\n return this.storage.getItem('inkColor', this.options.defaultForegroundColor);\n }\n set inkColor(color) {\n this.storage.setItem('inkColor', color);\n }\n get inkOpacity() {\n return this.storage.getItem('inkOpacity', 100);\n }\n set inkOpacity(opacity) {\n this.storage.setItem('inkOpacity', opacity);\n }\n set shapeColor(color) {\n this.storage.setItem('shapeAnnotationColor', color);\n }\n get shapeColor() {\n return this.storage.getItem('shapeAnnotationColor', this.options.defaultForegroundColor);\n }\n set shapeFillColor(color) {\n this.storage.setItem('shapeFillColor', color);\n }\n get shapeFillColor() {\n return this.storage.getItem('shapeFillColor', this.defaultHighlightColor);\n }\n}\nexport class AnnotationFontOptions extends StorageClass {\n constructor(_options) {\n super();\n this.options = Object.assign(Object.assign({}, defaultAnnotationFontOptions), _options);\n }\n get fontFamilies() {\n return this.options.fontFamilies;\n }\n get fontSizes() {\n return this.options.fontSizes;\n }\n get defaultFontFamily() {\n return this.options.defaultFontFamily;\n }\n get defaultFontSize() {\n return this.options.defaultFontSize;\n }\n get freetextFontSize() {\n return this.storage.getItem('freetextFontSize', this.defaultFontSize);\n }\n set freetextFontSize(size) {\n this.storage.setItem('freetextFontSize', size);\n }\n get freetextFontFamily() {\n return this.storage.getItem('freetextFontFamily', this.defaultFontFamily);\n }\n set freetextFontFamily(fontFamily) {\n this.storage.setItem('freetextFontFamily', fontFamily);\n }\n}\nexport class AnnotationOptions extends StorageClass {\n constructor(_options) {\n super();\n this.options = Object.assign(Object.assign({}, defaultAnnotationOptions), _options);\n this.colorOptions = new AnnotationColorOptions(_options === null || _options === void 0 ? void 0 : _options.colors);\n this.fontOptions = new AnnotationFontOptions(_options === null || _options === void 0 ? void 0 : _options.fonts);\n }\n get stamps() {\n return this.options.stamps;\n }\n get colors() {\n return this.colorOptions;\n }\n get fonts() {\n return this.fontOptions;\n }\n get highlightOpacity() {\n return this.options.highlightOpacity;\n }\n get strokeWidths() {\n return this.options.strokeWidths;\n }\n set shapeStrokeWidth(width) {\n this.storage.setItem('shapeStrokeWidth', width);\n }\n get shapeStrokeWidth() {\n return this.storage.getItem('shapeStrokeWidth', this.options.defaultBorderWidth);\n }\n set shapeStrokeStyle(style) {\n this.storage.setItem('shapeStrokeStyle', style);\n }\n get shapeStrokeStyle() {\n return this.storage.getItem('shapeStrokeStyle', 0);\n }\n set inkWidth(width) {\n this.storage.setItem('inkWidth', width);\n }\n get inkWidth() {\n return this.storage.getItem('inkWidth', this.options.defaultBorderWidth);\n }\n set freetextBorderWidth(width) {\n this.storage.setItem('freetextBorderWidth', width);\n }\n get freetextBorderWidth() {\n return this.storage.getItem('freetextBorderWidth', this.options.defaultBorderWidth);\n }\n get defaultBorderWidth() {\n return this.options.defaultBorderWidth;\n }\n get defaultStampWidth() {\n return this.options.defaultStampWidth;\n }\n get hideOnDelete() {\n return this.options.hideOnDelete;\n }\n get trackHistory() {\n return this.options.trackHistory;\n }\n get hideAnnotationSubject() {\n return this.options.hideAnnotationSubject;\n }\n get onlyAuthorCanEdit() {\n return this.options.onlyAuthorCanEdit;\n }\n get annotationPermissionCallback() {\n return this.options.annotationPermissionCallback;\n }\n get selectedStamp() {\n return this.storage.getItem('selectedStamp', 0);\n }\n set selectedStamp(stampNumber) {\n this.storage.setItem('selectedStamp', stampNumber);\n }\n set eraserRadius(width) {\n this.storage.setItem('eraserRadius', width);\n }\n get eraserRadius() {\n return this.storage.getItem('eraserRadius', 5);\n }\n}\nexport class WebViewerOptions {\n constructor(_options) {\n var _a, _b, _c;\n const mergedOptions = Object.assign(Object.assign({}, defaultWebViewerOptions), _options);\n if (!mergedOptions.modules.find((m) => m === PrintServiceModule)) {\n (_a = mergedOptions.modules) === null || _a === void 0 ? void 0 : _a.push(PrintServiceModule);\n }\n if (((_b = mergedOptions.forms) === null || _b === void 0 ? void 0 : _b.enabled) && !mergedOptions.modules.find((m) => m === FormFieldModule)) {\n (_c = mergedOptions.modules) === null || _c === void 0 ? void 0 : _c.push(FormFieldModule);\n }\n if ((_options === null || _options === void 0 ? void 0 : _options.shortcuts) === null) {\n ;\n mergedOptions.shortcuts = {};\n }\n else {\n mergedOptions.shortcuts = Object.assign(Object.assign({}, defaultWebViewerOptions.shortcuts), _options === null || _options === void 0 ? void 0 : _options.shortcuts);\n }\n this.options = mergedOptions;\n this.viewerOptions = new ViewerOptions(mergedOptions ? mergedOptions.viewer : mergedOptions);\n this.annotationOptions = new AnnotationOptions(mergedOptions ? mergedOptions.annotation : mergedOptions);\n this.formsOptions = new FormsOptions(mergedOptions ? mergedOptions.forms : mergedOptions);\n }\n get viewer() {\n return this.viewerOptions;\n }\n get annotation() {\n return this.annotationOptions;\n }\n get forms() {\n return this.formsOptions;\n }\n get modules() {\n return this.options.modules;\n }\n set modules(modules) {\n this.options.modules = modules;\n }\n get shortcuts() {\n return this.options.shortcuts;\n }\n}\n","import * as Layout from './layout';\nimport * as PasswordForm from './passwordForm';\nimport * as NavigationPanel from './navigationPanel';\nimport * as PdfDocument from './pdfDocument';\nimport * as Search from './search';\nimport { defaultWebViewerOptions } from '../WebViewerOptions';\nconst defaultState = {\n licenseFeatures: {\n annotate: false,\n fillFormFields: false,\n pageRotation: false,\n },\n scriptsLoaded: false,\n appInitialized: false,\n fileDropEnabled: false,\n hasDocument: false,\n showPasswordForm: false,\n passwordDialogTempPdfFile: null,\n passwordDialogTempFdfFile: null,\n showOpenFileErrorDialog: false,\n showUnsavedChangesDialog: false,\n fileOpenArgs: null,\n unsavedChangesDialogDontSave: false,\n showLoadingIndicator: false,\n showSaveIndicator: false,\n hasError: false,\n errorMessage: '',\n layout: Layout.state,\n passwordForm: PasswordForm.state,\n navigationPanel: NavigationPanel.state,\n pdfDocument: PdfDocument.state,\n search: Search.state,\n options: defaultWebViewerOptions,\n canvasModules: [],\n closeCallback: undefined,\n};\nexport const createState = (options) => {\n const state = Object.assign(Object.assign({}, JSON.parse(JSON.stringify(defaultState))), { options });\n const { sidebar } = options.viewer;\n if (sidebar.selectedNavigation) {\n state.navigationPanel.selectedNavigation = sidebar.selectedNavigation;\n state.navigationPanel.showNavigation = true;\n }\n else if (!sidebar.thumbnailNavigation) {\n state.navigationPanel.selectedNavigation = sidebar.outlineNavigation ? 'outline' : 'annotation';\n }\n return state;\n};\nexport const actions = {\n layout: Layout.actions,\n passwordForm: PasswordForm.actions,\n navigationPanel: NavigationPanel.actions,\n pdfDocument: PdfDocument.actions,\n search: Search.actions,\n loadScriptsCompleted: () => ($state) => (Object.assign(Object.assign({}, $state), { scriptsLoaded: true })),\n initializeAppFulfilled: (settings) => ($state) => (Object.assign(Object.assign({}, $state), { licenseFeatures: settings.licenseFeatures, appInitialized: true, fileDropEnabled: true })),\n initializeAppRejected: (error) => ($state) => (Object.assign(Object.assign({}, $state), { hasError: true, errorMessage: error, appInitialized: true })),\n setCanvasModules: (canvasModules) => ($state) => (Object.assign(Object.assign({}, $state), { canvasModules: canvasModules })),\n loadDocumentBegin: () => ($state) => {\n return Object.assign(Object.assign({}, $state), { fileDropEnabled: false, showLoadingIndicator: true, unsavedChangesDialogDontSave: false });\n },\n loadDocumentFulfilled: () => ($state) => {\n return Object.assign(Object.assign({}, $state), { hasDocument: true, fileDropEnabled: true, showPasswordForm: false, passwordDialogTempPdfFile: null, showLoadingIndicator: false });\n },\n loadDocumentCancel: () => ($state) => (Object.assign(Object.assign({}, $state), { hasDocument: false, fileDropEnabled: true, showPasswordForm: false, passwordDialogTempPdfFile: null, showLoadingIndicator: false })),\n loadDocumentRejected: (error) => ($state) => (Object.assign(Object.assign({}, $state), { fileDropEnabled: false, passwordDialogTempPdfFile: null, showPasswordForm: false, showLoadingIndicator: false, showOpenFileErrorDialog: true })),\n loadDocumentConfirmRejected: () => ($state) => (Object.assign(Object.assign({}, $state), { fileDropEnabled: true, showOpenFileErrorDialog: false })),\n loadDocumentPasswordForm: (fileOpenArgs) => ($state) => {\n $state.passwordForm.invalidPasswordError =\n !!fileOpenArgs.password && fileOpenArgs.password.length > 0;\n return Object.assign(Object.assign({}, $state), { fileOpenArgs, showPasswordForm: true, showLoadingIndicator: false });\n },\n closeDocument: () => ($state) => (Object.assign(Object.assign({}, JSON.parse(JSON.stringify(defaultState))), { appInitialized: true, scriptsLoaded: true, fileDropEnabled: true, options: $state.options, licenseFeatures: $state.licenseFeatures })),\n showConfirmUnsavedChangesDialog: (fileOpenArgs, closeCallback) => ($state) => {\n return Object.assign(Object.assign({}, $state), { fileOpenArgs,\n closeCallback, showUnsavedChangesDialog: true });\n },\n unsavedChangesDialogCancel: () => ($state) => {\n return Object.assign(Object.assign({}, $state), { showUnsavedChangesDialog: false, showLoadingIndicator: false, hasDocument: true, closeCallback: undefined });\n },\n unsavedChangesDialogFileSaved: () => ($state) => {\n return Object.assign(Object.assign({}, $state), { unsavedChangesDialogTempPdfFile: null, unsavedChangesDialogTempFdfFile: null, showUnsavedChangesDialog: false, closeCallback: undefined });\n },\n unsavedChangesDialogDontSave: () => ($state) => {\n return Object.assign(Object.assign({}, $state), { unsavedChangesDialogDontSave: false, showUnsavedChangesDialog: false, hasDocument: false });\n },\n saveDocumentBegin: (error) => ($state) => (Object.assign(Object.assign({}, $state), { showSaveIndicator: true })),\n saveDocumentFulfilled: (error) => ($state) => (Object.assign(Object.assign({}, $state), { showSaveIndicator: false })),\n saveDocumentRejected: (error) => ($state) => (Object.assign(Object.assign({}, $state), { hasError: true, errorMessage: error, appInitialized: true, showSaveIndicator: false })),\n setError: (error) => ($state) => (Object.assign(Object.assign({}, $state), { hasError: true, errorMessage: error })),\n getState: () => ($state) => {\n return Object.assign({}, $state);\n },\n open: (file) => ($state) => (Object.assign({}, $state)),\n};\n","export var DeviceType;\n(function (DeviceType) {\n DeviceType[DeviceType[\"Mobile\"] = 0] = \"Mobile\";\n DeviceType[DeviceType[\"Desktop\"] = 1] = \"Desktop\";\n})(DeviceType || (DeviceType = {}));\nexport var ScreenSize;\n(function (ScreenSize) {\n ScreenSize[ScreenSize[\"Small\"] = 600] = \"Small\";\n ScreenSize[ScreenSize[\"Medium\"] = 900] = \"Medium\";\n ScreenSize[ScreenSize[\"Large\"] = 1200] = \"Large\";\n})(ScreenSize || (ScreenSize = {}));\nexport const state = {\n screenSize: ScreenSize.Medium,\n deviceType: DeviceType.Desktop,\n};\nexport const actions = {\n setScreenSize: (screenSize) => ($state) => (Object.assign(Object.assign({}, $state), { screenSize })),\n setDeviceType: (deviceType) => ($state) => (Object.assign(Object.assign({}, $state), { deviceType })),\n};\n","export const state = {\n showNavigation: false,\n selectedNavigation: 'thumbnail',\n outlineItemsLoaded: false,\n annotationsLoaded: false,\n pages: [],\n outlines: [],\n annotations: {},\n};\nexport const actions = {\n clear: () => ($state) => (Object.assign(Object.assign({}, $state), { outlineItemsLoaded: false, pages: [], outlines: [], annotations: [] })),\n setThumbnailPlaceholders: (pageCount) => ($state) => {\n const pages = [];\n for (let i = 0; i < pageCount; i++) {\n pages.push({\n thumbnail: null,\n loading: null,\n pageNumber: i + 1,\n });\n }\n return Object.assign(Object.assign({}, $state), { pages });\n },\n updateThumbnail: (newThumbnail) => ($state) => (Object.assign(Object.assign({}, $state), { pages: $state.pages.map((p) => (p.pageNumber === newThumbnail.pageNumber ? newThumbnail : p)) })),\n setOutlines: (outlines) => ($state) => (Object.assign(Object.assign({}, $state), { outlineItemsLoaded: true, outlines })),\n toggleNavigationPanel: () => ($state) => (Object.assign(Object.assign({}, $state), { showNavigation: !$state.showNavigation })),\n showNavigationPanel: () => ($state) => (Object.assign(Object.assign({}, $state), { showNavigation: true })),\n hideNavigationPanel: () => ($state) => (Object.assign(Object.assign({}, $state), { showNavigation: false })),\n selectNavigation: (navigation) => ($state) => (Object.assign(Object.assign({}, $state), { showNavigation: true, selectedNavigation: navigation })),\n toggleOutlineItem: (path) => ($state) => {\n const newState = Object.assign({}, $state);\n let currentItem = { descendants: newState.outlines, open: false };\n path.forEach((id) => {\n const nextItem = currentItem.descendants.find((item) => item.id.toString() === id);\n if (nextItem) {\n currentItem = nextItem;\n }\n });\n currentItem.open = !currentItem.open;\n return newState;\n },\n clearAnnotations: () => ($state) => (Object.assign(Object.assign({}, $state), { annotations: {}, selectedAnnotation: undefined, annotationsLoaded: false })),\n setAnnotationLoaded: () => ($state) => (Object.assign(Object.assign({}, $state), { annotationsLoaded: true })),\n initAnnotations: (pageCount) => ($state) => {\n const annotations = {};\n for (let i = 1; i <= pageCount; i++) {\n annotations[i] = {};\n }\n return Object.assign(Object.assign({}, $state), { annotations });\n },\n setPageAnnotations: (itemsOnPage) => ($state) => {\n const itemState = {};\n itemsOnPage.items.forEach((an) => {\n const annotation = an;\n itemState[annotation.id] = annotation;\n });\n return Object.assign(Object.assign({}, $state), { annotations: Object.assign(Object.assign({}, $state.annotations), { [itemsOnPage.page]: itemState }) });\n },\n updateAnnotation: (annotation) => ($state) => {\n const page = annotation.pdfRect.page;\n const id = annotation.id;\n const itemsOnPage = $state.annotations[page] ? Object.assign({}, $state.annotations[page]) : {};\n itemsOnPage[id] = annotation;\n return Object.assign(Object.assign({}, $state), { annotations: Object.assign(Object.assign({}, $state.annotations), { [page]: itemsOnPage }) });\n },\n deleteAnnotation: (deletedItem) => ($state) => {\n const page = deletedItem.page;\n const id = deletedItem.id;\n const itemsOnPage = $state.annotations[page];\n if (!itemsOnPage) {\n return Object.assign({}, $state);\n }\n delete itemsOnPage[id];\n return Object.assign(Object.assign({}, $state), { annotations: Object.assign(Object.assign({}, $state.annotations), { [page]: itemsOnPage }) });\n },\n selectAnnotation: (annotation) => ($state) => {\n return Object.assign(Object.assign({}, $state), { selectedAnnotation: {\n page: annotation.pdfRect.page,\n annotationId: annotation.id,\n } });\n },\n deselectAnnotation: () => ($state) => (Object.assign(Object.assign({}, $state), { selectedAnnotation: undefined })),\n};\n","export const state = {\n password: '',\n passwordRequiredError: false,\n invalidPasswordError: false,\n};\nexport const actions = {\n clear: () => ($state) => ({\n password: '',\n passwordRequiredError: false,\n invalidPasswordError: false,\n }),\n updatePassword: (password) => ($state) => {\n return Object.assign(Object.assign({}, $state), { password });\n },\n validateForm: () => ($state) => {\n return Object.assign(Object.assign({}, $state), { invalidPasswordError: false, passwordRequiredError: $state.password === '' });\n },\n setInvalidPasswordError: () => ($state) => (Object.assign(Object.assign({}, $state), { invalidPasswordError: true })),\n};\n","import { PdfFitMode, PdfPageLayoutMode, } from '../../pdf-viewer-api';\nexport const state = {\n filename: '',\n mimetype: '',\n hasChanges: false,\n zoom: 100,\n fitMode: PdfFitMode.NONE,\n pageLayoutMode: PdfPageLayoutMode.ONE_COLUMN,\n firstVisiblePage: 0,\n lastVisiblePage: 0,\n pageNumber: 0,\n pageCount: 0,\n};\nexport const actions = {\n setZoom: (zoom) => ($state) => (Object.assign(Object.assign({}, $state), { zoom })),\n setFitMode: (fitMode) => ($state) => (Object.assign(Object.assign({}, $state), { fitMode })),\n setPageLayoutMode: (pageLayoutMode) => ($state) => (Object.assign(Object.assign({}, $state), { pageLayoutMode })),\n setHasChanges: (hasChanges) => ($state) => (Object.assign(Object.assign({}, $state), { hasChanges })),\n setFirstVisiblePage: (page) => ($state) => {\n const firstVisiblePage = page <= 1 ? 1 : page < $state.pageCount ? page : $state.pageCount;\n return Object.assign(Object.assign({}, $state), { firstVisiblePage });\n },\n setLastVisiblePage: (page) => ($state) => {\n const lastVisiblePage = page <= 1 ? 1 : page < $state.pageCount ? page : $state.pageCount;\n return Object.assign(Object.assign({}, $state), { lastVisiblePage });\n },\n setPageNumber: (page) => ($state) => {\n let pageNumber;\n if ($state.pageCount === 0)\n pageNumber = page;\n else\n pageNumber = page = page <= 1 ? 1 : page < $state.pageCount ? page : $state.pageCount;\n return Object.assign(Object.assign({}, $state), { pageNumber });\n },\n setPageCount: (pageCount) => ($state) => {\n return Object.assign(Object.assign({}, $state), { pageCount });\n },\n setFileInfo: (inputDocument) => ($state) => (Object.assign(Object.assign({}, $state), { filename: inputDocument.sourceTag, mimetype: 'application/pdf' })),\n};\n","export const state = {\n showSearch: false,\n searchString: '',\n caseSensitive: false,\n wrapSearch: false,\n useRegex: false,\n page: 1,\n match: null,\n painted: false,\n};\nexport const actions = {\n updateToSearch: (searchString) => ($state) => (Object.assign(Object.assign({}, $state), { searchString })),\n openSearch: () => ($state) => (Object.assign(Object.assign({}, $state), { showSearch: true })),\n closeSearch: () => ($state) => (Object.assign(Object.assign({}, $state), { searchString: '', showSearch: false })),\n toggleCaseSensitive: () => ($state) => (Object.assign(Object.assign({}, $state), { caseSensitive: !$state.caseSensitive })),\n toggleWrappingSearch: () => ($state) => (Object.assign(Object.assign({}, $state), { wrapSearch: !$state.wrapSearch })),\n toggleRegex: () => ($state) => (Object.assign(Object.assign({}, $state), { useRegex: !$state.useRegex })),\n setCaseSensitive: (enabled) => ($state) => (Object.assign(Object.assign({}, $state), { caseSensitive: enabled })),\n setWrappingSearch: (enabled) => ($state) => (Object.assign(Object.assign({}, $state), { wrapSearch: enabled })),\n setRegex: (enabled) => ($state) => (Object.assign(Object.assign({}, $state), { useRegex: enabled })),\n};\n","import { h } from '../../lib/hyperapp';\nimport { classNames } from '../../common/classNames';\nimport { ScreenSize } from '../state/layout';\nimport { Layout } from './Layout';\nimport { DropZone } from './DropZone';\nimport { Modal } from './modal/Modal';\nexport const App = () => (state, actions) => {\n const sizeCssClassName = state.layout.screenSize === ScreenSize.Small\n ? 'sm'\n : state.layout.screenSize === ScreenSize.Medium\n ? 'md'\n : 'lg';\n return (h(DropZone, { className: classNames('pwv-WebViewer', `pwv-WebViewer--${sizeCssClassName}`), enabled: state.options.viewer.permissions.allowFileDrop &&\n state.fileDropEnabled &&\n state.options.viewer.permissions.allowOpenFile, onFileSelected: (file) => actions.api.open({ pdfFile: { data: file, sourceTag: file.name } }) },\n state.scriptsLoaded && h(Layout, null),\n h(Modal, null)));\n};\n","import { h } from '../../lib/hyperapp';\nimport { tooltipManager } from '../../common/TooltipManager';\nexport const CustomButtons = ({ location, style }) => (state, actions) => {\n const { customButtons } = state.options.viewer;\n if (!customButtons ||\n !customButtons.hasOwnProperty(location) ||\n !customButtons[location].length) {\n return null;\n }\n const buttons = customButtons[location];\n return style === 'button' ? (h(\"div\", { class: \"pwv-CustomButtons\" }, buttons.map((ca) => (h(\"button\", Object.assign({ oncreate: tooltipManager.bindCssTooltip }, tooltipManager.createTooltip(ca.text), { class: \"pwv-ToolbarButton\", onclick: ca.onClick }),\n h(\"span\", { class: \"pwv-icon\" },\n h(\"img\", { src: ca.icon }))))))) : (h(\"div\", null, buttons.map((ca) => (h(\"button\", { class: \"pwv-DropdownItem\", onclick: ca.onClick },\n h(\"span\", { class: \"pwv-icon\" },\n h(\"img\", { src: ca.icon })),\n ca.text)))));\n};\n","import { h } from '../../lib/hyperapp';\nimport { classNames } from '../../common/classNames';\nlet allowDropTimer = 0;\nexport const DropZone = ({ className, enabled, onFileSelected }, children) => {\n const handleDragOver = (e) => {\n e.preventDefault();\n if (!enabled) {\n return;\n }\n if (e.dataTransfer) {\n const dropContainer = e.currentTarget;\n const items = e.dataTransfer.items;\n if (items && items.length === 1 && items[0].type === 'application/pdf') {\n dropContainer.classList.add('pwv-dropzone-dragover');\n clearTimeout(allowDropTimer);\n allowDropTimer = window.setTimeout(() => {\n dropContainer.classList.remove('pwv-dropzone-dragover');\n }, 150);\n }\n }\n };\n const handleDrop = (e) => {\n e.preventDefault();\n if (e.dataTransfer) {\n let pdfFile = null;\n if (e.dataTransfer.items) {\n for (let i = 0; i < e.dataTransfer.items.length; i++) {\n const item = e.dataTransfer.items[i];\n if (item.kind === 'file' && item.type === 'application/pdf') {\n pdfFile = item.getAsFile();\n break;\n }\n }\n }\n else {\n for (let i = 0; i < e.dataTransfer.files.length; i++) {\n const file = e.dataTransfer.files[i];\n if (file.type === 'application/pdf') {\n pdfFile = file;\n break;\n }\n }\n }\n if (enabled && pdfFile !== null) {\n onFileSelected(pdfFile);\n }\n }\n };\n return (h(\"div\", { class: classNames(className, 'pwv-dropzone'), ondragover: handleDragOver, ondrop: handleDrop }, children));\n};\n","import { h } from '../../lib/hyperapp';\nimport { classNames } from '../../common/classNames';\nimport { AppBar } from './appbar/AppBar';\nimport { Annotationbar } from './annotationbar/Annotationbar';\nimport { NavigationPanel } from './navigation/NavigationPanel';\nexport const Layout = ({}) => (state, actions) => {\n const { disableAnnotationToolbar, annotationBarPosition } = state.options.viewer.general;\n return (h(\"div\", { class: classNames('pwv-Viewer', {\n 'pwv-Viewer--loadFile': state.showLoadingIndicator,\n 'pwv-Viewer--saveFile': state.showSaveIndicator,\n }) },\n h(AppBar, null),\n h(\"div\", { class: \"pwv-ViewerContent\" },\n h(\"div\", { class: classNames('pwv-document-view', `pwv-annotationbar-${annotationBarPosition}`) },\n h(\"div\", { oncreate: (element) => {\n const a = actions;\n a.createCanvasView(element);\n } }),\n !disableAnnotationToolbar && h(Annotationbar, null)),\n h(NavigationPanel, null))));\n};\n","import { h } from '../../../lib/hyperapp';\nimport { ScreenSize } from '../../state/layout';\nimport { translationManager } from '../../../common/TranslationManager';\nimport { ToolbarButton } from '../../../common/ToolbarButton';\nimport { classNames } from '../../../common/classNames';\nimport { icons } from '../../../common/icons';\nimport { CustomButtons } from '../CustomButtons';\nexport const Annotationbar = ({}) => (state, actions) => {\n const smallScreen = state.layout.screenSize === ScreenSize.Small;\n if (smallScreen || !state.licenseFeatures.annotate) {\n return null;\n }\n return (h(\"div\", { class: classNames('pwv-annotationbar', `pwv-annotationbar-${state.options.viewer.general.annotationBarPosition}`) },\n state.options.modules\n .filter(({ moduleInfo }) => moduleInfo.requiredFeatures.annotate)\n .map((m) => (h(ToolbarButton, { icon: icons[m.moduleInfo.icon], tooltip: translationManager.getText(m.moduleInfo.translationKey), onClick: () => {\n actions.api.activateModule(m.moduleInfo.name, undefined);\n } }))),\n h(CustomButtons, { location: \"annotationbar\", style: \"button\" })));\n};\n","import { h } from '../../../lib/hyperapp';\nimport { ScreenSize } from '../../state/layout';\nimport { translationManager } from '../../../common/TranslationManager';\nimport { icons } from '../../../common/icons';\nimport { ToolbarItemGroup } from '../../../common/ToolbarItemGroup';\nimport { ToolbarButton } from '../../../common/ToolbarButton';\nimport { AnnotationsMenu } from './AnnotationsMenu';\nimport { CustomButtons } from '../CustomButtons';\nexport const AddonsToolbar = ({}) => (state, actions) => {\n const smallScreen = state.layout.screenSize === ScreenSize.Small;\n const mediumScreen = state.layout.screenSize <= ScreenSize.Medium;\n const { sidebar } = state.options.viewer;\n const { disableAnnotationToolbar } = state.options.viewer.general;\n return (h(ToolbarItemGroup, { className: \"pwv-AddonsBar\" },\n !disableAnnotationToolbar && smallScreen && h(AnnotationsMenu, null),\n state.options.viewer.permissions.enableSearch && (h(ToolbarButton, { name: \"toggleSearch\", tooltip: translationManager.getText('toolbar.search'), icon: icons.search, onClick: () => {\n if (!state.search.showSearch) {\n actions.api.resetViewerMode();\n actions.search.openSearch();\n }\n else {\n actions.api.endSearch();\n actions.search.closeSearch();\n }\n }, active: state.search.showSearch })),\n !smallScreen &&\n (sidebar.thumbnailNavigation ||\n sidebar.outlineNavigation ||\n sidebar.annotationNavigation) && (h(ToolbarButton, { name: \"toggleSidePane\", tooltip: translationManager.getText('toolbar.toggleSidePane'), icon: icons.docNavigation, onClick: () => {\n actions.api.loadNavigationItems();\n actions.navigationPanel.toggleNavigationPanel();\n }, active: state.navigationPanel.showNavigation })),\n h(CustomButtons, { location: \"informationbar\", style: \"button\" })));\n};\n","import { h } from '../../../lib/hyperapp';\nimport { translationManager } from '../../../common/TranslationManager';\nimport { Icon, icons } from '../../../common/Icon';\nimport { DropdownMenu } from '../../../common/DropdownMenu';\nimport { CustomButtons } from '../CustomButtons';\nexport const AnnotationsMenu = ({}) => (state, actions) => {\n if (!state.licenseFeatures.annotate) {\n return null;\n }\n return (h(DropdownMenu, { className: \"pwv-LgHidden pwv-AnnotationMenu\", tooltip: translationManager.getText('toolbar.annotationsMenuButton'), icon: icons.edit },\n h(\"div\", null,\n state.options.modules\n .filter((m) => m.moduleInfo.requiredFeatures.annotate)\n .map((m) => (h(\"button\", { class: \"pwv-DropdownItem\", onclick: () => {\n actions.api.activateModule(m.moduleInfo.name, undefined);\n } },\n h(Icon, { icon: icons[m.moduleInfo.icon] }),\n ' ',\n translationManager.getText(m.moduleInfo.translationKey)))),\n h(CustomButtons, { location: \"annotationbar\", style: \"listItem\" }))));\n};\n","import { h } from '../../../lib/hyperapp';\nimport { ScreenSize } from '../../state/layout';\nimport { Toolbar } from '../../../common/Toolbar';\nimport { ToolbarSeparator } from '../../../common/ToolbarSeparator';\nimport { Menu } from './Menu';\nimport { DocumentBar } from './DocumentBar';\nimport { NavigationBar } from './NavigationBar';\nimport { ZoomBar } from './ZoomBar';\nimport { SearchBar } from './SearchBar';\nimport { ViewBar } from './ViewBar';\nimport { AddonsToolbar } from './AddonsToolbar';\nexport const AppBar = ({}) => (state, actions) => {\n const mediumScreen = state.layout.screenSize <= ScreenSize.Medium;\n const { disableMainToolbar } = state.options.viewer.general;\n return (h(\"div\", { class: \"pwv-AppBar\" },\n !state.options.viewer.general.disableMainToolbar && (h(Toolbar, { allowWrap: true },\n mediumScreen ? h(Menu, null) : h(DocumentBar, null),\n h(NavigationBar, null),\n h(ToolbarSeparator, null),\n h(ZoomBar, null),\n h(ToolbarSeparator, null),\n h(ViewBar, null),\n h(AddonsToolbar, null))),\n state.search.showSearch && state.options.viewer.permissions.enableSearch && h(SearchBar, null)));\n};\n","import { h } from '../../../lib/hyperapp';\nimport { translationManager } from '../../../common/TranslationManager';\nimport { ToolbarItemGroup } from '../../../common/ToolbarItemGroup';\nimport { ToolbarButton } from '../../../common/ToolbarButton';\nimport { icons } from '../../../common/Icon';\nimport { ToolbarFileButton } from '../../../common/ToolbarFileButton';\nimport { CustomButtons } from '../CustomButtons';\nexport const DocumentBar = ({}) => (state, actions) => {\n const { permissions, callbacks } = state.options.viewer;\n const onSaveFileButtonClicked = () => {\n var _a;\n if (callbacks.onSaveFileButtonClicked) {\n callbacks.onSaveFileButtonClicked();\n }\n else {\n const password = (_a = state.passwordForm) === null || _a === void 0 ? void 0 : _a.password;\n actions.api.downloadFile(password ? { password } : undefined);\n }\n };\n const onCloseFileButtonClicked = () => {\n if (callbacks.onCloseFileButtonClicked) {\n callbacks.onCloseFileButtonClicked();\n }\n else {\n actions.api.close();\n }\n };\n return (h(ToolbarItemGroup, { className: \"pwv-DocumentBar\" },\n permissions.allowOpenFile && !callbacks.onOpenFileButtonClicked && (h(ToolbarFileButton, { name: \"openDocument\", className: \"pwv-MdHidden pwv-SmHidden\", icon: icons.openFile, accept: \".pdf\", tooltip: translationManager.getText('toolbar.openDocument'), onFileSelected: (file) => actions.api.open({ pdfFile: { data: file } }) })),\n permissions.allowOpenFile && callbacks.onOpenFileButtonClicked && (h(ToolbarButton, { name: \"openDocument\", className: \"pwv-MdHidden pwv-SmHidden\", icon: icons.openFile, tooltip: translationManager.getText('toolbar.openDocument'), onClick: callbacks.onOpenFileButtonClicked })),\n permissions.allowSaveFile && (h(ToolbarButton, { name: \"saveDocument\", className: \"pwv-MdHidden pwv-SmHidden\", icon: icons.saveFile, tooltip: translationManager.getText('toolbar.saveDocument'), onClick: onSaveFileButtonClicked })),\n permissions.allowCloseFile && (h(ToolbarButton, { name: \"closeDocument\", className: \"pwv-MdHidden pwv-SmHidden\", icon: icons.closeFile, tooltip: translationManager.getText('toolbar.closeDocument'), onClick: onCloseFileButtonClicked })),\n permissions.allowPrinting && (h(ToolbarButton, { name: \"print\", className: \"pwv-MdHidden pwv-SmHidden\", icon: icons.print, tooltip: translationManager.getText('toolbar.print'), onClick: actions.api.print })),\n h(CustomButtons, { location: \"documentbar\", style: \"button\" })));\n};\n","import { h } from '../../../lib/hyperapp';\nimport { ScreenSize } from '../../state/layout';\nimport { translationManager } from '../../../common/TranslationManager';\nimport { ToolbarItemGroup } from '../../../common/ToolbarItemGroup';\nimport { Icon, icons } from '../../../common/Icon';\nimport { DropdownMenu } from '../../../common/DropdownMenu';\nimport { DropdownSeparator } from '../../../common/DropdownSeparator';\nimport { CustomButtons } from '../CustomButtons';\nexport const Menu = ({}) => (state, actions) => {\n const { permissions, callbacks } = state.options.viewer;\n const { outlineNavigation, annotationNavigation } = state.options.viewer.sidebar;\n const { screenSize } = state.layout;\n const onSaveFileButtonClicked = () => {\n if (callbacks.onSaveFileButtonClicked) {\n callbacks.onSaveFileButtonClicked();\n }\n else {\n actions.api.downloadFile();\n }\n };\n const onCloseFileButtonClicked = () => {\n if (callbacks.onCloseFileButtonClicked) {\n callbacks.onCloseFileButtonClicked();\n }\n else {\n actions.api.close();\n }\n };\n return (h(ToolbarItemGroup, { className: \"pwv-DocumentBar\" },\n h(DropdownMenu, { className: \"pwv-LgHidden\", icon: icons.bars },\n h(\"div\", null,\n permissions.allowOpenFile && !callbacks.onOpenFileButtonClicked && (h(\"label\", { class: \"pwv-DropdownItem\" },\n h(Icon, { icon: icons.openFile }),\n \" \",\n translationManager.getText('toolbar.openDocument'),\n h(\"input\", { accept: \".pdf\", type: \"file\", onchange: (e) => {\n if (e.currentTarget.files && e.currentTarget.files.length) {\n const file = e.currentTarget.files[0];\n actions.api.open({ pdfFile: { data: file } });\n }\n }, style: { display: 'none' } }))),\n permissions.allowOpenFile && callbacks.onOpenFileButtonClicked && (h(\"button\", { class: \"pwv-DropdownItem\", onclick: callbacks.onOpenFileButtonClicked },\n h(Icon, { icon: icons.openFile }),\n \" \",\n translationManager.getText('toolbar.openDocument'))),\n permissions.allowSaveFile && (h(\"button\", { class: \"pwv-DropdownItem\", onclick: onSaveFileButtonClicked },\n h(Icon, { icon: icons.saveFile }),\n \" \",\n translationManager.getText('toolbar.saveDocument'))),\n permissions.allowCloseFile && (h(\"button\", { class: \"pwv-DropdownItem\", onclick: onCloseFileButtonClicked },\n h(Icon, { icon: icons.closeFile }),\n ' ',\n translationManager.getText('toolbar.closeDocument'))),\n permissions.allowPrinting && (h(\"button\", { class: \"pwv-DropdownItem\", onclick: actions.api.print },\n h(Icon, { icon: icons.print }),\n \" \",\n translationManager.getText('toolbar.print'))),\n h(CustomButtons, { location: \"documentbar\", style: \"listItem\" }),\n permissions.allowRotateView && h(DropdownSeparator, null),\n permissions.allowRotateView && (h(\"button\", { class: \"pwv-DropdownItem\", onclick: actions.api.rotate },\n h(Icon, { icon: icons.rotate }),\n \" \",\n translationManager.getText('toolbar.rotateView'))),\n screenSize === ScreenSize.Small && (outlineNavigation || annotationNavigation) && (h(DropdownSeparator, null)),\n screenSize === ScreenSize.Small && outlineNavigation && (h(\"button\", { class: \"pwv-DropdownItem\", onclick: () => {\n actions.api.loadNavigationItems();\n actions.navigationPanel.selectNavigation('outline');\n } },\n h(Icon, { icon: icons.sidePaneOutline }),\n ' ',\n translationManager.getText('sideNavigation.outline'))),\n screenSize === ScreenSize.Small && annotationNavigation && (h(\"button\", { class: \"pwv-DropdownItem\", onclick: () => {\n actions.api.loadNavigationItems();\n actions.navigationPanel.selectNavigation('annotation');\n } },\n h(Icon, { icon: icons.sidePaneAnnotation }),\n ' ',\n translationManager.getText('sideNavigation.annotation')))))));\n};\n","import { h } from '../../../lib/hyperapp';\nimport { translationManager } from '../../../common/TranslationManager';\nimport { ToolbarItemGroup } from '../../../common/ToolbarItemGroup';\nimport { ToolbarButton } from '../../../common/ToolbarButton';\nimport { icons } from '../../../common/icons';\nconst resizeObserver = new ResizeObserver((e) => {\n if (e.length) {\n e.forEach((elm) => {\n if (elm.target && elm.target.parentElement) {\n const input = elm.target.parentElement.querySelector('input');\n if (input) {\n input.style.minWidth = `${elm.contentRect.width + 4}px`;\n }\n }\n });\n }\n});\nexport const NavigationBar = ({}) => (state, actions) => {\n const { pdfDocument } = state;\n return (h(ToolbarItemGroup, { className: \"pwv-NavigationBar\" },\n h(ToolbarButton, { name: \"previewsPage\", tooltip: translationManager.getText('toolbar.previewsPage'), icon: icons.previousPage, onClick: () => actions.api.previousPage(), disabled: pdfDocument.pageNumber <= 1 }),\n h(\"div\", { class: \"pwv-ToolbarItem pwv-navigation-toolbar-pageinput\" },\n h(\"input\", { name: \"pageNumber\", value: pdfDocument.pageNumber, onkeydown: (e) => {\n if (e.key === 'ArrowDown') {\n actions.api.nextPage();\n }\n else if (e.key === 'ArrowUp') {\n actions.api.previousPage();\n }\n else if (e.key === 'Enter') {\n const input = e.currentTarget;\n if (input && input.value) {\n actions.api.setPageNumber(parseInt(input.value, undefined));\n }\n }\n else if ((e.key.charCodeAt(0) >= 48 && e.key.charCodeAt(0) <= 57) ||\n e.key === 'Delete' ||\n e.key === 'Backspace' ||\n e.key === 'ArrowLeft' ||\n e.key === 'ArrowRight' ||\n e.key === 'Tab') {\n }\n else {\n e.preventDefault();\n }\n e.stopPropagation();\n }, onblur: (e) => {\n let page = parseInt(e.target.value, undefined);\n if (Number.isNaN(page)) {\n page = actions.api.getPageNumber();\n }\n else if (page < 1) {\n page = 1;\n }\n else {\n const pageCount = actions.api.getPageCount();\n if (page > pageCount) {\n page = pageCount;\n }\n }\n ;\n e.target.value = page.toString();\n actions.api.setPageNumber(page);\n }, disabled: pdfDocument.pageCount < 1 }),\n h(\"span\", null, translationManager.getText('toolbar.pageOf')),\n h(\"label\", { oncreate: (label) => {\n resizeObserver.observe(label);\n }, onremove: (label) => {\n resizeObserver.unobserve(label);\n } }, pdfDocument.pageCount)),\n h(ToolbarButton, { name: \"nextPage\", tooltip: translationManager.getText('toolbar.nextPage'), icon: icons.nextPage, onClick: () => actions.api.nextPage(), disabled: pdfDocument.pageNumber === pdfDocument.pageCount })));\n};\n","import { h } from '../../../lib/hyperapp';\nimport { translationManager } from '../../../common/TranslationManager';\nimport { Toolbar } from '../../../common/Toolbar';\nimport { ToolbarItemGroup } from '../../../common/ToolbarItemGroup';\nimport { ToolbarButton } from '../../../common/ToolbarButton';\nimport { ToolbarSeparator } from '../../../common/ToolbarSeparator';\nimport { icons } from '../../../common/icons';\nimport { getKeyboardCommands } from '../../../common/utils';\nimport { SearchOptions } from './SearchOptions';\nexport const SearchBar = ({}) => (state, actions) => (h(Toolbar, { className: \"pwv-SearchBar\" },\n h(ToolbarItemGroup, null,\n h(\"div\", { class: \"pwv-ToolbarItem pwv-searchbar-input\" },\n h(\"input\", { value: state.search.searchString, class: \"pwv-SearchInputField\", oncreate: (element) => {\n element.focus();\n element.addEventListener('keydown', (e) => {\n e.cancelBubble = true;\n const { shortcuts } = state.options;\n const cmd = getKeyboardCommands(e, shortcuts, []);\n if ((cmd === null || cmd === void 0 ? void 0 : cmd.length) &&\n (cmd.some(el => el[0] === 'searchNext') ||\n cmd.some(el => el[0] === 'searchPrevious') ||\n cmd.some(el => el[0] === 'closeSearch'))) {\n e.preventDefault();\n }\n }, false);\n element.addEventListener('input', (e) => {\n const inputValue = e.currentTarget.value;\n actions.search.updateToSearch(inputValue);\n if (inputValue !== '') {\n actions.api.startSearch();\n }\n else {\n actions.api.endSearch();\n }\n });\n element.addEventListener('keyup', (e) => {\n e.cancelBubble = true;\n const inputValue = e.currentTarget.value;\n const { shortcuts } = state.options;\n const cmd = getKeyboardCommands(e, shortcuts, []);\n if (cmd === null || cmd === void 0 ? void 0 : cmd.some(el => el[0] === 'searchNext')) {\n e.preventDefault();\n actions.api.nextSearchMatch();\n }\n else if (cmd === null || cmd === void 0 ? void 0 : cmd.some(el => el[0] === 'searchPrevious')) {\n e.preventDefault();\n actions.api.previousSearchMatch();\n }\n else if (cmd === null || cmd === void 0 ? void 0 : cmd.some(el => el[0] === 'closeSearch')) {\n e.preventDefault();\n actions.api.endSearch();\n actions.search.closeSearch();\n }\n else if (e.key === 'Enter' || e.key === 'ArrowDown') {\n if (inputValue !== '') {\n actions.api.nextSearchMatch();\n }\n }\n else if (e.key === 'ArrowUp') {\n if (inputValue !== '') {\n actions.api.previousSearchMatch();\n }\n }\n else if (e.key === 'Escape') {\n actions.api.endSearch();\n actions.search.closeSearch();\n }\n }, false);\n } })),\n h(ToolbarButton, { tooltip: translationManager.getText('search.previousMatch'), icon: icons.previousPage, disabled: state.search.searchString === '', onClick: actions.api.previousSearchMatch }),\n h(ToolbarButton, { tooltip: translationManager.getText('search.nextMatch'), icon: icons.nextPage, disabled: state.search.searchString === '', onClick: actions.api.nextSearchMatch }),\n h(SearchOptions, null),\n h(ToolbarSeparator, null)),\n h(ToolbarItemGroup, { pushRight: true },\n h(ToolbarButton, { icon: icons.close, onClick: () => {\n actions.api.endSearch();\n actions.search.closeSearch();\n } }))));\n","import { h } from '../../../lib/hyperapp';\nimport { translationManager } from '../../../common/TranslationManager';\nimport { DropdownComponent } from '../../../common/Dropdown';\nimport { Icon, icons } from '../../../common/Icon';\nimport { tooltipManager } from '../../../common/TooltipManager';\nexport const SearchOptions = (props) => ($state, actions) => {\n if (props.disabled) {\n return (h(\"div\", { title: translationManager.getText('search.options'), class: \"pwv-Dropdown pwv-searchoptions pwv-disabled pwv-Dropdown--alignRight\" },\n h(\"span\", { class: \"pwv-Dropdown-text\" },\n h(Icon, { icon: icons.options })),\n h(\"span\", { class: \"pwv-Dropdown-caret\" },\n h(Icon, { icon: icons.dropdownCaret }))));\n }\n else {\n return (h(\"div\", { class: \"pwv-Dropdown pwv-searchoptions pwv-Dropdown--alignRight\" },\n h(\"button\", Object.assign({}, tooltipManager.createTooltip(translationManager.getText('search.options')), { oncreate: DropdownComponent.create, onremove: DropdownComponent.remove }),\n h(\"span\", { class: \"pwv-Dropdown-text\" },\n h(Icon, { icon: icons.options })),\n h(\"span\", { class: \"pwv-Dropdown-caret\" },\n h(Icon, { icon: icons.dropdownCaret }))),\n h(\"div\", { class: \"pwv-DropdownPanel\" },\n h(\"ul\", null,\n h(\"li\", { class: \"pwv-checkbox-btn\", onclick: (e) => {\n const s = actions.search.toggleCaseSensitive();\n e.preventDefault();\n e.cancelBubble = true;\n if (s.searchString !== '') {\n actions.api.startSearch();\n }\n } },\n $state.search.caseSensitive ? (h(Icon, { icon: icons.checkboxChecked })) : (h(Icon, { icon: icons.checkbox })),\n translationManager.getText('search.optionCaseSensitive')),\n h(\"li\", { class: \"pwv-checkbox-btn\", onclick: (e) => {\n const s = actions.search.toggleWrappingSearch();\n e.preventDefault();\n e.cancelBubble = true;\n if (s.searchString !== '') {\n actions.api.startSearch();\n }\n } },\n $state.search.wrapSearch ? (h(Icon, { icon: icons.checkboxChecked })) : (h(Icon, { icon: icons.checkbox })),\n translationManager.getText('search.optionWrap')),\n h(\"li\", { class: \"pwv-checkbox-btn\", onclick: (e) => {\n const s = actions.search.toggleRegex();\n e.preventDefault();\n e.cancelBubble = true;\n if (s.searchString !== '') {\n actions.api.startSearch();\n }\n } },\n $state.search.useRegex ? (h(Icon, { icon: icons.checkboxChecked })) : (h(Icon, { icon: icons.checkbox })),\n translationManager.getText('search.optionRegularExpression'))))));\n }\n};\n","import { h } from '../../../lib/hyperapp';\nimport { PdfFitMode, PdfPageLayoutMode } from '../../../pdf-viewer-api';\nimport { ScreenSize } from '../../state/layout';\nimport { translationManager } from '../../../common/TranslationManager';\nimport { ToolbarItemGroup } from '../../../common/ToolbarItemGroup';\nimport { ToolbarButton } from '../../../common/ToolbarButton';\nimport { Dropdown } from '../../../common/Dropdown';\nimport { Icon } from '../../../common/Icon';\nimport { icons } from '../../../common/icons';\nfunction getPageLayoutModeTranslation(layoutMode) {\n switch (layoutMode) {\n case PdfPageLayoutMode.ONE_COLUMN:\n return translationManager.getText('pageLayoutMode.oneColumn');\n case PdfPageLayoutMode.SINGLE_PAGE:\n return translationManager.getText('pageLayoutMode.singlePage');\n case PdfPageLayoutMode.TWO_COLUMN_LEFT:\n return translationManager.getText('pageLayoutMode.twoColumnLeft');\n case PdfPageLayoutMode.TWO_COLUMN_RIGHT:\n return translationManager.getText('pageLayoutMode.twoColumnRight');\n case PdfPageLayoutMode.TWO_PAGE_LEFT:\n return translationManager.getText('pageLayoutMode.twoPageLeft');\n case PdfPageLayoutMode.TWO_PAGE_RIGHT:\n return translationManager.getText('pageLayoutMode.twoPageRight');\n }\n}\nexport const ViewBar = ({}) => (state, actions) => {\n const { pdfDocument } = state;\n const { screenSize } = state.layout;\n const layoutModeItems = state.options.viewer.general.pageLayoutModes.map((m) => ({\n text: getPageLayoutModeTranslation(m),\n value: m,\n renderItem: (i) => (h(\"span\", { className: \"pwv-page-layout-mode-item\" },\n h(Icon, { icon: icons[`pageLayoutMode${i.value}`], className: \"pwv-page-layout-mode-icon\" }),\n i.text)),\n }));\n return (h(ToolbarItemGroup, { className: \"pwv-ViewBar\" },\n pdfDocument.fitMode === PdfFitMode.NONE && (h(ToolbarButton, { name: \"fitMode\", tooltip: translationManager.getText('fitMode.none'), icon: icons.fitActualSize, onClick: () => {\n actions.api.setFitMode(PdfFitMode.FIT_PAGE);\n } })),\n pdfDocument.fitMode === PdfFitMode.FIT_PAGE && (h(ToolbarButton, { name: \"fitMode\", tooltip: translationManager.getText('fitMode.page'), icon: icons.fitPage, onClick: () => {\n actions.api.setFitMode(PdfFitMode.FIT_WIDTH);\n } })),\n pdfDocument.fitMode === PdfFitMode.FIT_WIDTH && (h(ToolbarButton, { name: \"fitMode\", tooltip: translationManager.getText('fitMode.width'), icon: icons.fitWidth, onClick: () => {\n actions.api.setFitMode(PdfFitMode.NONE);\n actions.api.setZoom(100);\n } })),\n state.options.viewer.permissions.enablePageLayoutMode && (h(Dropdown, { name: \"pageLayoutMode\", tooltip: getPageLayoutModeTranslation(pdfDocument.pageLayoutMode), items: layoutModeItems, value: pdfDocument.pageLayoutMode, className: \"pwv-page-layout-mode\", renderButton: (i, text) => (h(Icon, { icon: icons[`pageLayoutMode${i}`], className: \"pwv-page-layout-mode-icon\" })), onChange: (value) => {\n actions.api.setPageLayoutMode(value);\n } })),\n state.options.viewer.permissions.allowRotateView && screenSize === ScreenSize.Large && (h(ToolbarButton, { name: \"rotateView\", tooltip: translationManager.getText('toolbar.rotateView'), icon: icons.rotate, onClick: actions.api.rotate }))));\n};\n","import { h } from '../../../lib/hyperapp';\nimport { translationManager } from '../../../common/TranslationManager';\nimport { icons } from '../../../common/icons';\nimport { ToolbarItemGroup } from '../../../common/ToolbarItemGroup';\nimport { ToolbarButton } from '../../../common/ToolbarButton';\nimport { Dropdown } from '../../../common/Dropdown';\nexport const ZoomBar = ({}) => (state, actions) => {\n const { defaultZoomLevels } = state.options.viewer.general;\n const { zoom } = state.pdfDocument;\n return (h(ToolbarItemGroup, { className: \"pwv-ZoomBar\" },\n h(ToolbarButton, { name: \"zoomIn\", tooltip: translationManager.getText('toolbar.zoomIn'), className: \"pwv-MdHidden pwv-SmHidden\", icon: icons.zoomIn, disabled: zoom >= defaultZoomLevels[defaultZoomLevels.length - 1] * 100, onClick: () => actions.api.zoomIn() }),\n h(ToolbarButton, { name: \"zoomOut\", tooltip: translationManager.getText('toolbar.zoomOut'), className: \"pwv-MdHidden pwv-SmHidden\", icon: icons.zoomOut, disabled: zoom <= defaultZoomLevels[0] * 100, onClick: () => actions.api.zoomOut() }),\n h(Dropdown, { name: \"zoom\", tooltip: translationManager.getText('toolbar.zoom'), className: \"pwv-Dropdown-zoom\", items: defaultZoomLevels.map((zoom) => ({\n value: zoom * 100,\n text: Math.floor(zoom * 100) + '%',\n })), value: zoom, text: Math.floor(zoom) + '%', align: \"right\", onChange: (zoom) => actions.api.setZoom(zoom) })));\n};\n","import { h } from '../../../lib/hyperapp';\nimport { Icon, icons } from '../../../common/Icon';\nimport { translationManager } from '../../../common/TranslationManager';\nexport const ApplicationError = ({}) => (state, actions) => {\n let message = translationManager.getText('applicationError.defaultMessage');\n switch (state.errorMessage) {\n case 'Invalid License':\n message = translationManager.getText('applicationError.invalidLicense');\n break;\n }\n const btnText = translationManager.getText('applicationError.reload');\n return (h(\"div\", { class: \"pwv-modal pwv-modal--applicationError\" },\n h(\"div\", { class: \"pwv-modal-dialog\" },\n h(\"div\", { class: \"pwv-modal-header\" },\n h(Icon, { icon: icons.error }),\n h(\"h2\", null, translationManager.getText('applicationError.title'))),\n h(\"div\", { class: \"pwv-modal-body\" },\n h(\"div\", { class: \"pwv-modal-message\" },\n h(\"p\", null, message)),\n btnText && (h(\"div\", { class: \"pwv-btn-row\" },\n h(\"button\", { class: \"pwv-btn\", onclick: () => {\n document.location && document.location.reload();\n } }, btnText)))))));\n};\n","import { h } from '../../../lib/hyperapp';\nimport { Loader } from '../../../common/Loader';\nexport const LoadApplication = ({}) => (h(\"div\", { class: \"pwv-modal pwv-modal--loadApplication\" },\n h(\"div\", { class: \"pwv-modal-body-noborder\" },\n h(Loader, null))));\n","import { h } from '../../../lib/hyperapp';\nimport { translationManager } from '../../../common/TranslationManager';\nimport { Loader } from '../../../common/Loader';\nexport const LoadFile = ({}) => (h(\"div\", { class: \"pwv-modal pwv-modal--loadFile\" },\n h(\"div\", { class: \"pwv-modal-dialog\" },\n h(\"div\", { class: \"pwv-modal-body\" },\n h(\"div\", { class: \"pwv-modal-message\" },\n h(\"h2\", null, translationManager.getText('loadFile.title')),\n h(Loader, null))))));\n","import { h } from '../../../lib/hyperapp';\nimport { OpenFile } from './OpenFile';\nimport { OpenFileError } from './OpenFileError';\nimport { UnsavedChanges } from './UnsavedChanges';\nimport { PasswordForm } from './PasswordForm';\nimport { LoadApplication } from './LoadApplication';\nimport { ApplicationError } from './ApplicationError';\nimport { LoadFile } from './LoadFile';\nimport { SaveFile } from './SaveFile';\nexport const Modal = ({}) => (state, actions) => {\n if (state.hasError) {\n return h(ApplicationError, null);\n }\n else if (!state.scriptsLoaded && !state.appInitialized) {\n return h(LoadApplication, null);\n }\n else if (state.showOpenFileErrorDialog) {\n return h(OpenFileError, null);\n }\n else if (state.showPasswordForm) {\n return h(PasswordForm, null);\n }\n else if (state.showUnsavedChangesDialog) {\n return h(UnsavedChanges, null);\n }\n else if (state.showLoadingIndicator) {\n return h(LoadFile, null);\n }\n else if (state.showSaveIndicator) {\n return h(SaveFile, null);\n }\n else if (!state.hasDocument) {\n return h(OpenFile, null);\n }\n else {\n return null;\n }\n};\n","import { h } from '../../../lib/hyperapp';\nimport { Icon, icons } from '../../../common/Icon';\nimport { translationManager } from '../../../common/TranslationManager';\nimport { DeviceType } from '../../state/layout';\nexport const OpenFile = ({}) => (state, actions) => {\n const handleFileSelected = (e) => {\n if (e.currentTarget.files &&\n e.currentTarget.files.length &&\n e.currentTarget.files.length > 0) {\n const file = e.currentTarget.files[0];\n if (file.type === 'application/pdf') {\n actions.api.open({ pdfFile: { data: file, sourceTag: file.name } });\n }\n }\n };\n const { permissions, callbacks } = state.options.viewer;\n const { deviceType } = state.layout;\n return (h(\"div\", { class: \"pwv-modal pwv-openfile pwv-modal--openFile\" },\n h(\"div\", { class: \"pwv-modal-dialog\" },\n h(\"div\", { class: \"pwv-modal-header\" },\n h(Icon, { icon: icons.pdfFile })),\n h(\"div\", { class: \"pwv-modal-body\" },\n h(\"div\", { class: \"pwv-modal-message\" }, deviceType === DeviceType.Desktop &&\n permissions.allowFileDrop &&\n permissions.allowOpenFile ? (h(\"h2\", null, translationManager.getText('openFile.dropFileHere'))) : permissions.allowOpenFile ? (h(\"h2\", null, translationManager.getText('openFile.openDocument'))) : (h(\"h2\", null, translationManager.getText('openFile.openFileDisabled')))),\n h(\"div\", { class: \"pwv-btn-row\" }, permissions.allowOpenFile ? (callbacks.onOpenFileButtonClicked ? (h(\"button\", { class: \"pwv-btn\", onclick: callbacks.onOpenFileButtonClicked }, translationManager.getText('openFile.selectFile'))) : (h(\"label\", { class: \"pwv-btn\" },\n translationManager.getText('openFile.selectFile'),\n h(\"input\", { type: \"file\", onchange: handleFileSelected, style: { display: 'none' } })))) : (h(\"div\", null)))))));\n};\n","import { h } from '../../../lib/hyperapp';\nimport { Icon, icons } from '../../../common/Icon';\nimport { translationManager } from '../../../common/TranslationManager';\nexport const OpenFileError = ({}) => (state, actions) => (h(\"div\", { class: \"pwv-modal pwv-modal--openFileError\" },\n h(\"div\", { class: \"pwv-modal-dialog\" },\n h(\"div\", { class: \"pwv-modal-header\" },\n h(Icon, { icon: icons.fileError })),\n h(\"div\", { class: \"pwv-modal-body\" },\n h(\"div\", { class: \"pwv-modal-message\" },\n h(\"p\", null, translationManager.getText('openFileError.description'))),\n h(\"div\", { class: \"pwv-btn-row\" },\n h(\"button\", { class: \"pwv-btn\", onclick: actions.loadDocumentConfirmRejected }, translationManager.getText('openFileError.ok')))))));\n","import { h } from '../../../lib/hyperapp';\nimport { Icon, icons } from '../../../common/Icon';\nimport { classNames } from '../../../common/classNames';\nimport { translationManager } from '../../../common/TranslationManager';\nexport const PasswordForm = ({}) => (state, actions) => {\n const formIsValid = !state.passwordForm.passwordRequiredError &&\n !state.passwordForm.invalidPasswordError &&\n state.passwordForm.password !== '';\n const shouldShowCancelButton = !state.options.viewer.general.hidePasswordFormCancelButton;\n return (h(\"div\", { class: \"pwv-modal pwv-modal--passwordForm\" },\n h(\"div\", { class: \"pwv-modal-dialog\" },\n h(\"div\", { class: \"pwv-modal-header\" },\n h(Icon, { icon: icons.unlock })),\n h(\"div\", { class: \"pwv-modal-body\" },\n h(\"form\", { onsubmit: (e) => {\n e.preventDefault();\n const data = new FormData(e.currentTarget);\n const password = data.get('password');\n if (password) {\n if (!state.fileOpenArgs) {\n actions.loadDocumentRejected('error');\n return;\n }\n if (state.fileOpenArgs) {\n actions.api.open(Object.assign(Object.assign({}, state.fileOpenArgs), { password }));\n }\n }\n } },\n h(\"div\", { class: \"pwv-modal-message\" },\n h(\"p\", null, translationManager.getText('passwordForm.description'))),\n h(\"div\", { class: \"pwv-form-row\" },\n h(\"div\", { class: \"pwv-form-field pwv-form-has-error-x\" },\n h(\"input\", { type: \"password\", class: \"pwv-input\", name: \"password\", onkeyup: (e) => {\n const inputValue = e.currentTarget.value;\n if (inputValue === state.passwordForm.password)\n return;\n actions.passwordForm.updatePassword(inputValue);\n actions.passwordForm.validateForm();\n }, oncreate: (element) => {\n element.focus();\n } }),\n state.passwordForm.invalidPasswordError && (h(\"div\", { class: \"pwv-form-error\" },\n h(Icon, { icon: icons.warning }),\n h(\"span\", null, translationManager.getText('passwordForm.invalidPasswordError')))),\n state.passwordForm.passwordRequiredError && (h(\"div\", { class: \"pwv-form-error\" },\n h(Icon, { icon: icons.warning }),\n h(\"span\", null, translationManager.getText('passwordForm.passwordRequiredError')))))),\n h(\"div\", { class: \"pwv-btn-row\" },\n h(\"button\", { class: classNames('pwv-btn', {\n 'pwv-disabled': !formIsValid,\n }), type: \"submit\", disabled: !formIsValid }, translationManager.getText('passwordForm.ok')),\n shouldShowCancelButton && (h(\"button\", { class: \"pwv-btn\", type: \"button\", onclick: actions.loadDocumentCancel }, translationManager.getText('passwordForm.cancel')))))))));\n};\n","import { h } from '../../../lib/hyperapp';\nimport { translationManager } from '../../../common/TranslationManager';\nimport { Loader } from '../../../common/Loader';\nexport const SaveFile = ({}) => (state, actions) => (h(\"div\", { class: \"pwv-modal pwv-modal--saveFile\" },\n h(\"div\", { class: \"pwv-modal-dialog\" },\n h(\"div\", { class: \"pwv-modal-body\" },\n h(\"div\", { class: \"pwv-modal-message\" },\n h(\"h2\", null, translationManager.getText('saveFile.title')),\n h(Loader, null))))));\n","import { h } from '../../../lib/hyperapp';\nimport { Icon, icons } from '../../../common/Icon';\nimport { translationManager } from '../../../common/TranslationManager';\nexport const UnsavedChanges = ({}) => ($state, $actions) => (h(\"div\", { class: \"pwv-modal pwv-modal--unsavedChanges\" },\n h(\"div\", { class: \"pwv-modal-dialog\" },\n h(\"div\", { class: \"pwv-modal-header\" },\n h(Icon, { icon: icons.warning })),\n h(\"div\", { class: \"pwv-modal-body\" },\n h(\"div\", { class: \"pwv-modal-message\" },\n h(\"p\", null, translationManager.getText('unsavedChanges.description'))),\n h(\"div\", { class: \"pwv-btn-row\" },\n h(\"button\", { class: \"pwv-btn\", onclick: () => {\n $actions.api.downloadFile().then(() => {\n if ($state.closeCallback) {\n $state.closeCallback();\n }\n else {\n $actions.unsavedChangesDialogFileSaved();\n }\n if ($state.fileOpenArgs) {\n $actions.api.open($state.fileOpenArgs);\n }\n });\n } }, translationManager.getText('unsavedChanges.save')),\n h(\"button\", { class: \"pwv-btn\", onclick: () => {\n $actions.unsavedChangesDialogDontSave();\n if ($state.fileOpenArgs) {\n $actions.api.open($state.fileOpenArgs);\n }\n } }, translationManager.getText('unsavedChanges.dontSave')),\n h(\"button\", { class: \"pwv-btn\", onclick: $actions.unsavedChangesDialogCancel }, translationManager.getText('unsavedChanges.cancel')))))));\n","import { PdfItemType } from '../../../pdf-viewer-api/enums';\nimport { h } from '../../../lib/hyperapp';\nimport { AnnotationListItem } from './AnnotationListItem';\nimport { translationManager } from '../../../common/TranslationManager';\nexport const AnnotationList = (props) => (state, actions) => {\n const { pageNumber } = props;\n const annotationsObj = state.navigationPanel.annotations[pageNumber];\n const selectedAnnotation = state.navigationPanel.selectedAnnotation;\n const annotations = Object.keys(annotationsObj).map((k) => annotationsObj[k]);\n const showHiddenAnnotations = state.options.annotation.hideOnDelete && state.options.annotation.trackHistory;\n const sortedAnnotations = annotations\n .filter((a) => a.itemType !== PdfItemType.WIDGET && (showHiddenAnnotations || a.isHidden() === false))\n .sort((f, s) => s.pdfRect.pdfY - f.pdfRect.pdfY);\n if (sortedAnnotations.length < 1) {\n return null;\n }\n return (h(\"div\", null,\n h(\"h4\", null,\n translationManager.getText('sideNavigation.annotation.page'),\n \" \",\n pageNumber),\n h(\"ul\", null, sortedAnnotations.map((annotation) => (h(AnnotationListItem, { annotation: annotation, selected: selectedAnnotation !== undefined &&\n selectedAnnotation.page === annotation.pdfRect.page &&\n selectedAnnotation.annotationId === annotation.id }))))));\n};\n","import { h } from '../../../lib/hyperapp';\nimport { translationManager } from '../../../common/TranslationManager';\nimport { PdfItemType } from '../../../pdf-viewer-api/enums';\nimport { Icon, icons } from '../../../common/Icon';\nimport { classNames } from '../../../common/classNames';\nimport { formatDate } from '../../../common/Tools';\nconst AnnotationIcon = ({ annotaion }) => (state, actions) => {\n const { itemType, color } = annotaion;\n const bg = color ? color : undefined;\n switch (itemType) {\n case PdfItemType.HIGHLIGHT:\n case PdfItemType.SQUIGGLY:\n case PdfItemType.UNDERLINE:\n case PdfItemType.STRIKE_OUT:\n return h(Icon, { icon: icons.highlighter, bg: bg });\n case PdfItemType.STAMP:\n return h(Icon, { icon: icons.stamp, bg: bg });\n case PdfItemType.FREE_TEXT:\n return h(Icon, { icon: icons.freeText, bg: bg });\n case PdfItemType.POPUP:\n case PdfItemType.TEXT:\n return h(Icon, { icon: icons.stickyNote, bg: bg });\n case PdfItemType.INK:\n return h(Icon, { icon: icons.pencil, bg: bg });\n case PdfItemType.SQUARE: {\n const fill = annotaion.fillColor;\n return h(Icon, { icon: icons.rectangle, bg: fill });\n }\n case PdfItemType.CIRCLE: {\n const fill = annotaion.fillColor;\n return h(Icon, { icon: icons.circle, bg: fill });\n }\n default:\n return h(Icon, { icon: icons.annotation, bg: bg });\n }\n};\nconst HistoryItem = ({ item }) => (state, actions) => {\n switch (item.Type) {\n case '/Create':\n return (h(\"li\", null,\n h(\"div\", null,\n h(Icon, { icon: icons.addLayer }),\n item.T && h(\"span\", { class: \"pwv-author\" }, item.T),\n h(\"time\", null, formatDate(item.D)))));\n case '/Edit':\n const params = {};\n if (item.Parms) {\n for (let i = 0; i < item.Parms.length; i += 2) {\n const key = item.Parms[i];\n let value = item.Parms[i + 1];\n value = removeParentheses(value);\n params[key] = value ? value : '';\n }\n }\n return (h(\"li\", null,\n h(\"div\", null,\n h(Icon, { icon: icons.pen }),\n item.T && h(\"span\", { class: \"pwv-author\" }, item.T),\n h(\"time\", null, formatDate(item.D))),\n h(\"div\", { class: \"pwv-ms-custom-history-content\" },\n params['/Subj'] && h(\"h5\", null, params['/Subj']),\n params['/Contents'] && h(\"p\", null, params['/Contents']))));\n case '/Lock':\n return (h(\"li\", null,\n h(\"div\", null,\n h(Icon, { icon: icons.lock }),\n item.T && h(\"span\", { class: \"pwv-author\" }, item.T),\n h(\"time\", null, formatDate(item.D)))));\n case '/Unlock':\n return (h(\"li\", null,\n h(\"div\", null,\n h(Icon, { icon: icons.unlock }),\n item.T && h(\"span\", { class: \"pwv-author\" }, item.T),\n h(\"time\", null, formatDate(item.D)))));\n case '/Delete':\n return (h(\"li\", null,\n h(\"div\", null,\n h(Icon, { icon: icons.delete }),\n item.T && h(\"span\", { class: \"pwv-author\" }, item.T),\n h(\"time\", null, formatDate(item.D)))));\n default:\n return h(\"li\", null, \"...\");\n }\n};\nconst TextMarkupPreview = ({ annotaion }) => (state, actions) => {\n const { markedText, itemType, color } = annotaion;\n switch (itemType) {\n case PdfItemType.HIGHLIGHT:\n return h(\"span\", { style: { backgroundColor: color } }, markedText);\n case PdfItemType.SQUIGGLY:\n return (h(\"span\", { style: {\n textDecoration: 'underline',\n textDecorationStyle: 'wavy',\n textDecorationColor: color,\n } }, markedText));\n case PdfItemType.UNDERLINE:\n return (h(\"span\", { style: {\n textDecoration: 'underline',\n textDecorationColor: color,\n } }, markedText));\n case PdfItemType.STRIKE_OUT:\n return (h(\"span\", { style: { textDecoration: 'line-through', textDecorationColor: color } }, markedText));\n default:\n return null;\n }\n};\nlet dblClickTimer;\nexport const AnnotationListItem = ({ annotation, selected }) => (state, actions) => {\n var _a, _b, _c, _d, _e;\n const isTextMarkupAnnotation = annotation.itemType === PdfItemType.HIGHLIGHT ||\n annotation.itemType === PdfItemType.SQUIGGLY ||\n annotation.itemType === PdfItemType.UNDERLINE ||\n annotation.itemType === PdfItemType.STRIKE_OUT;\n const { annotationNavigation } = state.options.viewer.sidebar;\n const textMarkupPreview = typeof annotationNavigation === 'object' && ((_a = annotationNavigation.textMarkup) === null || _a === void 0 ? void 0 : _a.preview)\n ? annotationNavigation.textMarkup.preview\n : 'none';\n return (h(\"li\", { class: classNames('pwv-annotation-navigation-item', {\n 'pwv-selected': selected,\n 'pwv-deleted': annotation.isHidden(),\n }), id: `pwv-annotation-navigation-item-${annotation.id}`, onclick: () => {\n if (dblClickTimer) {\n window.clearTimeout(dblClickTimer);\n dblClickTimer = undefined;\n }\n else {\n dblClickTimer = window.setTimeout(() => {\n actions.api.goToAnnotation({ annotation, action: 'select' });\n dblClickTimer = undefined;\n }, 250);\n }\n }, ondblclick: () => {\n actions.api.goToAnnotation({ annotation, action: 'edit' });\n dblClickTimer = undefined;\n } },\n h(\"div\", null,\n h(AnnotationIcon, { annotaion: annotation }),\n annotation.author && h(\"span\", { class: \"pwv-author\" }, annotation.author),\n h(\"time\", null, (_b = annotation.modificationDate) === null || _b === void 0 ? void 0 : _b.toLocaleString())),\n isTextMarkupAnnotation && textMarkupPreview === 'short' && (h(\"div\", { class: \"pwv-overflow-ellipsis\" },\n h(TextMarkupPreview, { annotaion: annotation }))),\n h(\"div\", null,\n !state.options.annotation.hideAnnotationSubject && h(\"h5\", null, annotation.subject),\n annotation.content && h(\"p\", null, annotation.content),\n !!annotation.isLocked() && h(Icon, { icon: icons.lock, className: \"pwv-locked-icon\" })),\n selected && annotation.privateData && annotation.privateData.length > 0 && (h(\"div\", { class: \"pwv-ms-custom-history-list\" },\n h(\"h5\", null, translationManager.getText('sideNavigation.annotation.history')),\n h(\"ul\", null, (_e = (_d = (_c = JSON.parse(annotation.privateData)['PDF Tools AG']) === null || _c === void 0 ? void 0 : _c.Private) === null || _d === void 0 ? void 0 : _d.History) === null || _e === void 0 ? void 0 : _e.map((history) => (h(HistoryItem, { item: history }))))))));\n};\nfunction removeParentheses(value) {\n if (value === null) {\n return value;\n }\n return value.slice(1, value.length - 1);\n}\n","import { h } from '../../../lib/hyperapp';\nimport { AnnotationList } from './AnnotationList';\nimport { translationManager } from '../../../common/TranslationManager';\nexport const AnnotationNavigation = ({}) => (state, actions) => {\n const { annotations, annotationsLoaded } = state.navigationPanel;\n const pageNumbers = Object.keys(annotations).filter((pageNumber) => Object.keys(annotations[pageNumber]).length > 0);\n return (h(\"div\", { class: \"pwv-annotation-navigation\" },\n pageNumbers.length > 0 ? (pageNumbers.map((pageNumber) => h(AnnotationList, { pageNumber: pageNumber }))) : annotationsLoaded ? (h(\"div\", { class: \"pwv-NavigationPanel__NoItems\" }, translationManager.getText('sideNavigation.noAnnotations'))) : (''),\n !annotationsLoaded && h(\"div\", { class: \"pwv-ItemLoader\" })));\n};\n","import { h } from '../../../lib/hyperapp';\nimport { ScreenSize } from '../../state/layout';\nimport { translationManager } from '../../../common/TranslationManager';\nimport { classNames } from '../../../common/classNames';\nimport { icons } from '../../../common/Icon';\nimport { Toolbar } from '../../../common/Toolbar';\nimport { ToolbarItemGroup } from '../../../common/ToolbarItemGroup';\nimport { ToolbarButton } from '../../../common/ToolbarButton';\nimport { ThumbnailNavigation } from './ThumbnailNavigation';\nimport { OutlineNavigation } from './OutlineNavigation';\nimport { AnnotationNavigation } from './AnnotationNavigation';\nlet scrollTimer = null;\nexport const NavigationPanel = ({}) => (state, actions) => {\n const { thumbnailNavigation, outlineNavigation, annotationNavigation } = state.options.viewer.sidebar;\n const tabCount = (thumbnailNavigation ? 1 : 0) + (outlineNavigation ? 1 : 0) + (annotationNavigation ? 1 : 0);\n const allowRotatePages = state.options.viewer.permissions.allowRotatePages && state.licenseFeatures.pageRotation;\n const { selectedNavigation, showNavigation } = state.navigationPanel;\n const useMobileLayout = state.layout.screenSize === ScreenSize.Small;\n return (h(\"div\", { class: classNames('pwv-NavigationPanel', { 'pwv-NavigationPanel--open': showNavigation }) },\n h(\"div\", { class: \"pwv-NavigationPanel__Box\" },\n tabCount > 1 && (h(Toolbar, null,\n !useMobileLayout && (h(ToolbarItemGroup, null,\n thumbnailNavigation && (h(ToolbarButton, { icon: icons.sidePaneThumbnails, tooltip: translationManager.getText('sideNavigation.thumbnails'), active: selectedNavigation === 'thumbnail', disabled: !showNavigation, onClick: () => actions.navigationPanel.selectNavigation('thumbnail') })),\n outlineNavigation && (h(ToolbarButton, { icon: icons.sidePaneOutline, tooltip: translationManager.getText('sideNavigation.outline'), active: selectedNavigation === 'outline', disabled: !showNavigation, onClick: () => actions.navigationPanel.selectNavigation('outline') })),\n annotationNavigation && (h(ToolbarButton, { icon: icons.sidePaneAnnotation, tooltip: translationManager.getText('sideNavigation.annotation'), active: selectedNavigation === 'annotation', disabled: !showNavigation, onClick: () => actions.navigationPanel.selectNavigation('annotation') })))),\n h(ToolbarItemGroup, { pushRight: true },\n h(ToolbarButton, { icon: icons.close, disabled: !showNavigation, onClick: actions.navigationPanel.toggleNavigationPanel })))),\n h(\"div\", { class: \"pwv-NavigationPanel__Content\", oncreate: (elm) => {\n elm.addEventListener('scroll', () => {\n if (scrollTimer) {\n window.clearTimeout(scrollTimer);\n }\n scrollTimer = window.setTimeout(() => {\n const fromPage = Math.floor(elm.scrollTop / 225) - 4;\n const toPage = fromPage + Math.floor(elm.clientHeight / 225) + 8;\n actions.api.addPageRangeToThumbnailsQueue({\n from: fromPage,\n to: toPage,\n });\n }, 100);\n });\n } },\n selectedNavigation === 'thumbnail' && thumbnailNavigation && (h(\"div\", null,\n h(ThumbnailNavigation, { pages: state.navigationPanel.pages, selectedPage: state.pdfDocument.pageNumber, currentPage: state.pdfDocument.pageNumber, allowRotatePages: allowRotatePages, onPageSelected: actions.api.setPageNumber, onRotatePage: actions.api.rotatePage }))),\n outlineNavigation && selectedNavigation === 'outline' && (h(\"div\", null,\n h(OutlineNavigation, null))),\n annotationNavigation && selectedNavigation === 'annotation' && (h(\"div\", null,\n h(AnnotationNavigation, null)))))));\n};\n","import { h } from '../../../lib/hyperapp';\nimport { classNames } from '../../../common/classNames';\nimport { Icon, icons } from '../../../common/Icon';\nexport const OutlineList = ({ items, path, onToggleItem, onOutlineItemSelected, }) => (h(\"ul\", null, items.map((item) => (h(OutlineListItem, { item: item, path: path, onToggleItem: onToggleItem, onOutlineItemSelected: onOutlineItemSelected })))));\nconst OutlineListItem = ({ item, path, onToggleItem, onOutlineItemSelected, }) => {\n const childPath = path.filter((c) => true);\n childPath.push(item.id.toString());\n return (h(\"li\", null,\n h(\"div\", null,\n item.hasDescendants ? (h(\"span\", { class: classNames({ 'pwv-outline-tree-btn-expand': !item.open }, { 'pwv-outline-tree-btn-collapse': item.open }), onclick: () => {\n onToggleItem(childPath);\n } },\n h(Icon, { icon: item.open ? icons.outlineOpen : icons.outlineClosed }))) : (h(\"span\", { class: \"pwv-outline-tree-indent\" })),\n h(\"span\", { onclick: () => {\n onOutlineItemSelected(item.destination);\n }, class: \"pwv-outline-tree-lnk\" }, item.title)),\n item.open && item.descendants && (h(OutlineList, { items: item.descendants, path: childPath, onToggleItem: onToggleItem, onOutlineItemSelected: onOutlineItemSelected }))));\n};\n","import { h } from '../../../lib/hyperapp';\nimport { OutlineList } from './OutlineList';\nimport { translationManager } from '../../../common/TranslationManager';\nexport const OutlineNavigation = ({}) => (state, actions) => {\n const { outlines, outlineItemsLoaded } = state.navigationPanel;\n return (h(\"div\", { class: \"pwv-outline-navigation\" },\n outlines.length > 0 ? (h(OutlineList, { items: outlines, path: [], onToggleItem: actions.navigationPanel.toggleOutlineItem, onOutlineItemSelected: actions.api.goTo })) : outlineItemsLoaded ? (h(\"div\", { class: \"pwv-NavigationPanel__NoItems\" }, translationManager.getText('sideNavigation.noOutline'))) : (''),\n !outlineItemsLoaded && h(\"div\", { class: \"pwv-ItemLoader\" })));\n};\n","import { h } from '../../../lib/hyperapp';\nimport { classNames } from '../../../common/classNames';\nimport { icons } from '../../../common/Icon';\nimport { RotationDirection } from '../../../pdf-viewer-api/enums';\nimport { ToolbarButton } from '../../../common/ToolbarButton';\nimport { translationManager } from '../../../common/TranslationManager';\nexport const ThumbnailNavigation = ({ pages, currentPage, allowRotatePages, onPageSelected, onRotatePage }, children) => (h(\"div\", { class: \"pwv-thumbnail-navigation\" },\n h(\"ul\", null, pages.map((page) => (h(\"li\", { id: `pwv-thumbnail-navigation-page_${page.pageNumber}`, key: page.pageNumber, class: classNames('pwv-thumbnail-navigation-page', {\n 'pwv-selected': page.pageNumber === currentPage,\n }) },\n h(\"div\", { class: \"pwv-thumbnail-navigation-img-container\" }, page.thumbnail !== null ? (h(\"img\", { src: page.thumbnail, onclick: () => {\n onPageSelected(page.pageNumber);\n } })) : (h(\"div\", { class: \"pwv-page-placeholder\", onclick: () => {\n onPageSelected(page.pageNumber);\n } }, page.loading === true && h(\"div\", { class: \"pwv-ItemLoader\" })))),\n h(\"div\", { class: \"pwv-page-nr\" },\n allowRotatePages && page.pageNumber === currentPage && (h(\"div\", { class: \"pwv-page-rotation pwv-ToolbarItemGroup\" },\n h(ToolbarButton, { icon: icons.rotateLeft, tooltip: translationManager.getText('rotatePage.counterclockwise'), onClick: () => {\n onRotatePage({\n page: page.pageNumber,\n direction: RotationDirection.COUNTERCLOCKWISE,\n });\n } }),\n h(ToolbarButton, { icon: icons.rotateRight, tooltip: translationManager.getText('rotatePage.clockwise'), onClick: () => {\n onRotatePage({\n page: page.pageNumber,\n direction: RotationDirection.CLOCKWISE,\n });\n } }))),\n h(\"span\", null, page.pageNumber))))))));\n","export function h(name, attributes) {\n var rest = []\n var children = []\n var length = arguments.length\n\n while (length-- > 2) rest.push(arguments[length])\n\n while (rest.length) {\n var node = rest.pop()\n if (node && node.pop) {\n for (length = node.length; length--; ) {\n rest.push(node[length])\n }\n } else if (node != null && node !== true && node !== false) {\n children.push(node)\n }\n }\n\n return typeof name === \"function\"\n ? name(attributes || {}, children)\n : {\n nodeName: name,\n attributes: attributes || {},\n children: children,\n key: attributes && attributes.key\n }\n}\n\nexport function app(state, actions, view, container) {\n var map = [].map\n var rootElement = (container && container.children[0]) || null\n var oldNode = rootElement && recycleElement(rootElement)\n var lifecycle = []\n var skipRender\n var isRecycling = true\n var globalState = clone(state)\n var wiredActions = wireStateToActions([], globalState, clone(actions))\n\n scheduleRender()\n\n return wiredActions\n\n function recycleElement(element) {\n return {\n nodeName: element.nodeName.toLowerCase(),\n attributes: {},\n children: map.call(element.childNodes, function(element) {\n return element.nodeType === 3 // Node.TEXT_NODE\n ? element.nodeValue\n : recycleElement(element)\n })\n }\n }\n\n function resolveNode(node) {\n return typeof node === \"function\"\n ? resolveNode(node(globalState, wiredActions))\n : node != null\n ? node\n : \"\"\n }\n\n function render() {\n skipRender = !skipRender\n\n var node = resolveNode(view)\n\n if (container && !skipRender) {\n rootElement = patch(container, rootElement, oldNode, (oldNode = node))\n }\n\n isRecycling = false\n\n while (lifecycle.length) lifecycle.pop()()\n }\n\n function scheduleRender() {\n if (!skipRender) {\n skipRender = true\n setTimeout(render)\n }\n }\n\n function clone(target, source) {\n var out = {}\n\n for (var i in target) out[i] = target[i]\n for (var i in source) out[i] = source[i]\n\n return out\n }\n\n function setPartialState(path, value, source) {\n var target = {}\n if (path.length) {\n target[path[0]] =\n path.length > 1\n ? setPartialState(path.slice(1), value, source[path[0]])\n : value\n return clone(source, target)\n }\n return value\n }\n\n function getPartialState(path, source) {\n var i = 0\n while (i < path.length) {\n source = source[path[i++]]\n }\n return source\n }\n\n function wireStateToActions(path, state, actions) {\n for (var key in actions) {\n typeof actions[key] === \"function\"\n ? (function(key, action) {\n actions[key] = function(data) {\n var result = action(data)\n\n if (typeof result === \"function\") {\n result = result(getPartialState(path, globalState), actions)\n }\n\n if (\n result &&\n result !== (state = getPartialState(path, globalState)) &&\n !result.then // !isPromise\n ) {\n scheduleRender(\n (globalState = setPartialState(\n path,\n clone(state, result),\n globalState\n ))\n )\n }\n\n return result\n }\n })(key, actions[key])\n : wireStateToActions(\n path.concat(key),\n (state[key] = clone(state[key])),\n (actions[key] = clone(actions[key]))\n )\n }\n\n return actions\n }\n\n function getKey(node) {\n return node ? node.key : null\n }\n\n function eventListener(event) {\n return event.currentTarget.events[event.type](event)\n }\n\n function updateAttribute(element, name, value, oldValue, isSvg) {\n if (name === \"key\") {\n } else if (name === \"style\") {\n if (typeof value === \"string\") {\n element.style.cssText = value\n } else {\n if (typeof oldValue === \"string\") oldValue = element.style.cssText = \"\"\n for (var i in clone(oldValue, value)) {\n var style = value == null || value[i] == null ? \"\" : value[i]\n if (i[0] === \"-\") {\n element.style.setProperty(i, style)\n } else {\n element.style[i] = style\n }\n }\n }\n } else {\n if (name[0] === \"o\" && name[1] === \"n\") {\n name = name.slice(2)\n\n if (element.events) {\n if (!oldValue) oldValue = element.events[name]\n } else {\n element.events = {}\n }\n\n element.events[name] = value\n\n if (value) {\n if (!oldValue) {\n element.addEventListener(name, eventListener)\n }\n } else {\n element.removeEventListener(name, eventListener)\n }\n } else if (\n name in element &&\n name !== \"list\" &&\n name !== \"type\" &&\n name !== \"draggable\" &&\n name !== \"spellcheck\" &&\n name !== \"translate\" &&\n !isSvg\n ) {\n element[name] = value == null ? \"\" : value\n } else if (value != null && value !== false) {\n element.setAttribute(name, value)\n }\n\n if (value == null || value === false) {\n element.removeAttribute(name)\n }\n }\n }\n\n function createElement(node, isSvg) {\n var element =\n typeof node === \"string\" || typeof node === \"number\"\n ? document.createTextNode(node)\n : (isSvg = isSvg || node.nodeName === \"svg\")\n ? document.createElementNS(\n \"http://www.w3.org/2000/svg\",\n node.nodeName\n )\n : document.createElement(node.nodeName)\n\n var attributes = node.attributes\n if (attributes) {\n if (attributes.oncreate) {\n lifecycle.push(function() {\n attributes.oncreate(element)\n })\n }\n\n for (var i = 0; i < node.children.length; i++) {\n element.appendChild(\n createElement(\n (node.children[i] = resolveNode(node.children[i])),\n isSvg\n )\n )\n }\n\n for (var name in attributes) {\n updateAttribute(element, name, attributes[name], null, isSvg)\n }\n }\n\n return element\n }\n\n function updateElement(element, oldAttributes, attributes, isSvg) {\n for (var name in clone(oldAttributes, attributes)) {\n if (\n attributes[name] !==\n (name === \"value\" || name === \"checked\"\n ? element[name]\n : oldAttributes[name])\n ) {\n updateAttribute(\n element,\n name,\n attributes[name],\n oldAttributes[name],\n isSvg\n )\n }\n }\n\n var cb = isRecycling ? attributes.oncreate : attributes.onupdate\n if (cb) {\n lifecycle.push(function() {\n cb(element, oldAttributes)\n })\n }\n }\n\n function removeChildren(element, node) {\n var attributes = node.attributes\n if (attributes) {\n for (var i = 0; i < node.children.length; i++) {\n removeChildren(element.childNodes[i], node.children[i])\n }\n\n if (attributes.ondestroy) {\n attributes.ondestroy(element)\n }\n }\n return element\n }\n\n function removeElement(parent, element, node) {\n function done() {\n parent.removeChild(removeChildren(element, node))\n }\n\n var cb = node.attributes && node.attributes.onremove\n if (cb) {\n cb(element, done)\n } else {\n done()\n }\n }\n\n function patch(parent, element, oldNode, node, isSvg) {\n if (node === oldNode) {\n } else if (oldNode == null || oldNode.nodeName !== node.nodeName) {\n var newElement = createElement(node, isSvg)\n parent.insertBefore(newElement, element)\n\n if (oldNode != null) {\n removeElement(parent, element, oldNode)\n }\n\n element = newElement\n } else if (oldNode.nodeName == null) {\n element.nodeValue = node\n } else {\n updateElement(\n element,\n oldNode.attributes,\n node.attributes,\n (isSvg = isSvg || node.nodeName === \"svg\")\n )\n\n var oldKeyed = {}\n var newKeyed = {}\n var oldElements = []\n var oldChildren = oldNode.children\n var children = node.children\n\n for (var i = 0; i < oldChildren.length; i++) {\n oldElements[i] = element.childNodes[i]\n\n var oldKey = getKey(oldChildren[i])\n if (oldKey != null) {\n oldKeyed[oldKey] = [oldElements[i], oldChildren[i]]\n }\n }\n\n var i = 0\n var k = 0\n\n while (k < children.length) {\n var oldKey = getKey(oldChildren[i])\n var newKey = getKey((children[k] = resolveNode(children[k])))\n\n if (newKeyed[oldKey]) {\n i++\n continue\n }\n\n if (newKey != null && newKey === getKey(oldChildren[i + 1])) {\n if (oldKey == null) {\n removeElement(element, oldElements[i], oldChildren[i])\n }\n i++\n continue\n }\n\n if (newKey == null || isRecycling) {\n if (oldKey == null) {\n patch(element, oldElements[i], oldChildren[i], children[k], isSvg)\n k++\n }\n i++\n } else {\n var keyedNode = oldKeyed[newKey] || []\n\n if (oldKey === newKey) {\n patch(element, keyedNode[0], keyedNode[1], children[k], isSvg)\n i++\n } else if (keyedNode[0]) {\n patch(\n element,\n element.insertBefore(keyedNode[0], oldElements[i]),\n keyedNode[1],\n children[k],\n isSvg\n )\n } else {\n patch(element, oldElements[i], null, children[k], isSvg)\n }\n\n newKeyed[newKey] = children[k]\n k++\n }\n }\n\n while (i < oldChildren.length) {\n if (getKey(oldChildren[i]) == null) {\n removeElement(element, oldElements[i], oldChildren[i])\n }\n i++\n }\n\n for (var i in oldKeyed) {\n if (!newKeyed[i]) {\n removeElement(element, oldKeyed[i][0], oldKeyed[i][1])\n }\n }\n }\n return element\n }\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export * from './pdf-web-viewer/PdfWebViewer';\nexport * from './pdf-web-viewer/WebViewerOptions';\nexport * from './pdf-viewer-canvas/PdfViewerCanvas';\nexport * from './pdf-viewer-api';\nexport * from './modules';\n"],"names":[],"sourceRoot":""}
|