ngx-doc-viewer 21.0.0 → 21.0.1

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/README.md CHANGED
@@ -6,7 +6,7 @@ Documents that are publicly available can be shown in an iframe using the google
6
6
 
7
7
  Pdf files and word document that are not publicly available can be shown using the mammoth viewer or pdf viewer by passing an objectUrl.
8
8
 
9
- <a href="https://angular-doc-viewer.firebaseapp.com/">View demo</a>
9
+ <a href="https://angular-doc-viewer.web.app/">View demo</a>
10
10
 
11
11
  <a href="https://github.com/Marcelh1983/document-viewer/blob/main/packages/ngx-doc-viewer/changelog.md">Changes</a>
12
12
 
@@ -54,7 +54,7 @@ Input:
54
54
  - all: adds an overlay to the whole iframe, which makes nothing in the document clickable/selectable
55
55
  - popout: adds an overlay over googles popout button or office popout and menu which disables just this button/menu but keeps giving the possibility to select text. The popout button is still visible (for google during a few seconds) but not clickable.
56
56
  - popout-hide: see popup, instead of an transparent overlay a white one. This really hides the button but you'll see a white block while loading for the google viewer.
57
- - overrideLocalhost: documents from the assets folder are not publicly available and therefor won't show in an external viewer (google, office). If the site is already published to public server, then pass that url and if will replace localhost by the other url. Like: overrideLocalhost="https://angular-doc-viewer.firebaseapp.com/"
57
+ - overrideLocalhost: documents from the assets folder are not publicly available and therefor won't show in an external viewer (google, office). If the site is already published to public server, then pass that url and if will replace localhost by the other url. Like: overrideLocalhost="https://angular-doc-viewer.web.app/"
58
58
  - loadingText: fallback text shown in the built-in loading overlay. Defaults to `Loading document...`
59
59
  - errorTextOverride: fallback text shown in the built-in error overlay. Defaults to the runtime error message.
60
60
  - retryButtonText: text used by the built-in retry button in the default error overlay. Defaults to `Retry`
@@ -170,9 +170,8 @@ Google Drive viewer helps you preview over 15 different file types, listed below
170
170
  - PostScript (.EPS, .PS)
171
171
  - TrueType (.TTF)
172
172
  - XML Paper Specification (.XPS)
173
- - Archive file types (.ZIP and .RAR)
174
173
 
175
- <a href="https://gist.githubusercontent.com/tzmartin/1cf85dc3d975f94cfddc04bc0dd399be/raw/d4263c8faf7b68f4bbfd33b386ec33ed2bc11e7d/embedded-file-viewer.md">Source</a>
174
+ > **Note:** Archive files (.ZIP, .RAR) are **not** supported by the Google Docs embedded viewer despite some community sources claiming otherwise. For the current official list of supported formats, see the [Google Drive Help Center](https://support.google.com/drive/answer/2423485).
176
175
 
177
176
  #### url
178
177
 
@@ -428,11 +428,11 @@ class NgxDocViewerComponent {
428
428
  }
429
429
  }
430
430
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: NgxDocViewerComponent, deps: [{ token: i1.DomSanitizer }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
431
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.4", type: NgxDocViewerComponent, isStandalone: true, selector: "ngx-doc-viewer", inputs: { url: "url", queryParams: "queryParams", viewerUrl: "viewerUrl", googleCheckInterval: "googleCheckInterval", googleMaxChecks: "googleMaxChecks", googleFinalRetryDelay: "googleFinalRetryDelay", disableContent: "disableContent", googleCheckContentLoaded: "googleCheckContentLoaded", viewer: "viewer", overrideLocalhost: "overrideLocalhost", loadingText: "loadingText", errorTextOverride: "errorTextOverride", retryButtonText: "retryButtonText", officeAutoRetry: "officeAutoRetry", officeRetryDelay: "officeRetryDelay", officeReloadButtonText: "officeReloadButtonText", officeReloadButtonTitle: "officeReloadButtonTitle", secondaryActionText: "secondaryActionText", secondaryActionMode: "secondaryActionMode" }, outputs: { loaded: "loaded", loading: "loading", error: "error", phaseChange: "phaseChange" }, queries: [{ propertyName: "loadingTemplate", first: true, predicate: ["loadingContent"], descendants: true, read: TemplateRef }, { propertyName: "errorTemplate", first: true, predicate: ["errorContent"], descendants: true, read: TemplateRef }, { propertyName: "errorActionsTemplate", first: true, predicate: ["errorActions"], descendants: true, read: TemplateRef }, { propertyName: "officeReloadTemplate", first: true, predicate: ["officeReloadContent"], descendants: true, read: TemplateRef }], viewQueries: [{ propertyName: "iframes", predicate: ["iframe"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"container\">\n <div *ngIf=\"renderPhase === 'loading'\" class=\"loading-overlay\">\n <ng-container *ngIf=\"loadingTemplate; else defaultLoadingTemplate\">\n <ng-container *ngTemplateOutlet=\"loadingTemplate; context: loadingTemplateContext\"></ng-container>\n </ng-container>\n <ng-template #defaultLoadingTemplate>{{ loadingText }}</ng-template>\n </div>\n <div *ngIf=\"renderPhase === 'error'\" class=\"error-overlay\">\n <ng-container *ngIf=\"errorTemplate; else defaultErrorTemplate\">\n <ng-container *ngTemplateOutlet=\"errorTemplate; context: errorTemplateContext\"></ng-container>\n </ng-container>\n <ng-template #defaultErrorTemplate>\n <div>\n <div>{{ displayedErrorText }}</div>\n <div *ngIf=\"configuredViewer\" style=\"margin-top: 8px; color: #475569;\">\n Viewer: {{ configuredViewer }}\n </div>\n <div *ngIf=\"failedUrl\" style=\"margin-top: 4px; color: #64748b; font-size: 12px; word-break: break-word;\">\n {{ failedUrl }}\n </div>\n <ng-container *ngIf=\"errorActionsTemplate; else defaultErrorActions\">\n <ng-container *ngTemplateOutlet=\"errorActionsTemplate; context: errorTemplateContext\"></ng-container>\n </ng-container>\n <ng-template #defaultErrorActions>\n <div style=\"margin-top: 14px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;\">\n <button\n type=\"button\"\n (click)=\"retryLoad()\"\n style=\"border: 1px solid #fecaca; background: #fff; color: #991b1b; border-radius: 999px; padding: 8px 14px; font: inherit; cursor: pointer;\"\n >\n {{ retryButtonText }}\n </button>\n <a\n *ngIf=\"secondaryActionText && failedUrl\"\n [href]=\"failedUrl\"\n [attr.target]=\"secondaryActionMode === 'open' ? '_blank' : null\"\n [attr.rel]=\"secondaryActionMode === 'open' ? 'noreferrer' : null\"\n [attr.download]=\"secondaryActionMode === 'download' ? '' : null\"\n style=\"border: 1px solid #cbd5e1; background: #fff; color: #334155; border-radius: 999px; padding: 8px 14px; text-decoration: none; font: inherit;\"\n >\n {{ secondaryActionText }}\n </a>\n </div>\n </ng-template>\n </div>\n </ng-template>\n </div>\n\n <ng-container *ngIf=\"!externalViewer\">\n <div *ngIf=\"configuredViewer !== 'pdf'\" class=\"inline-document-shell\">\n <div class=\"inline-document-page\" [innerHTML]=\"docHtml\"></div>\n </div>\n <object\n (load)=\"objectLoaded()\"\n *ngIf=\"fullUrl && configuredViewer === 'pdf'\"\n [data]=\"fullUrl\"\n type=\"application/pdf\"\n width=\"100%\"\n height=\"100%\"\n >\n <p>\n Your browser does not support PDFs.\n <a [href]=\"fullUrl\">Download the PDF</a>.\n </p>\n </object>\n </ng-container>\n\n <button\n *ngIf=\"configuredViewer === 'office' && renderPhase === 'ready'\"\n class=\"office-reload-btn\"\n type=\"button\"\n [attr.title]=\"officeReloadButtonTitle\"\n (click)=\"retryLoad()\"\n >\n <ng-container *ngIf=\"officeReloadTemplate; else defaultOfficeReloadTemplate\">\n <ng-container *ngTemplateOutlet=\"officeReloadTemplate; context: errorTemplateContext\"></ng-container>\n </ng-container>\n <ng-template #defaultOfficeReloadTemplate>{{ officeReloadButtonText }}</ng-template>\n </button>\n\n <ng-container *ngIf=\"externalViewer\">\n <iframe\n (load)=\"iframeLoaded()\"\n *ngIf=\"fullUrl && showIframe && disableContent === 'none'\"\n #iframe\n id=\"iframe-doc-viewer\"\n frameBorder=\"0\"\n [src]=\"fullUrl\"\n ></iframe>\n <div class=\"container\" *ngIf=\"disableContent !== 'none'\">\n <div\n [class.overlay-full]=\"disableContent === 'all'\"\n [class.overlay-popout-google]=\"\n configuredViewer === 'google' &&\n (disableContent === 'popout' || disableContent === 'popout-hide')\n \"\n [class.overlay-popout-office]=\"\n configuredViewer === 'office' &&\n (disableContent === 'popout' || disableContent === 'popout-hide')\n \"\n [style.background-color]=\"\n disableContent === 'popout-hide' ? '#fff' : 'transparent'\n \"\n ></div>\n <iframe\n (load)=\"iframeLoaded()\"\n *ngIf=\"fullUrl && showIframe\"\n #iframe\n id=\"iframe\"\n frameBorder=\"0\"\n [src]=\"fullUrl\"\n ></iframe>\n </div>\n </ng-container>\n</div>\n", styles: [":host{display:block}.container{width:100%;height:100%;position:relative}.inline-document-shell{width:100%;height:100%;overflow:auto;background:linear-gradient(180deg,#eef2f7,#f8fafc);padding:24px}.inline-document-page{max-width:900px;min-height:100%;margin:0 auto;background:#fff;border:1px solid #dbe4f0;border-radius:18px;box-shadow:0 18px 40px -24px #0f172a4d,0 6px 18px -10px #0f172a2e;padding:40px 48px}.inline-document-page,.inline-document-page *{box-sizing:border-box}.inline-document-page{color:#1e293b;font-family:Georgia,Cambria,Times New Roman,Times,serif;font-size:18px;line-height:1.7}.inline-document-page p,.inline-document-page ul,.inline-document-page ol,.inline-document-page blockquote,.inline-document-page table{margin:0 0 1.1em}.inline-document-page h1,.inline-document-page h2,.inline-document-page h3,.inline-document-page h4,.inline-document-page h5,.inline-document-page h6{margin:1.4em 0 .65em;color:#0f172a;line-height:1.25}.inline-document-page h1:first-child,.inline-document-page h2:first-child,.inline-document-page h3:first-child,.inline-document-page p:first-child{margin-top:0}.inline-document-page table{width:100%;border-collapse:collapse}.inline-document-page td,.inline-document-page th{padding:6px 10px;vertical-align:top}.inline-document-page img{max-width:100%;height:auto}.inline-document-page hr{border:0;border-top:1px solid #dbe4f0;margin:1.5em 0}.loading-overlay{position:absolute;inset:0;z-index:1001;display:flex;align-items:center;justify-content:center;background:#ffffffe0;color:#475569;font-size:14px;font-weight:600;letter-spacing:.02em;text-align:center;padding:16px}.error-overlay{position:absolute;inset:0;z-index:1001;display:flex;align-items:center;justify-content:center;background:#fffffff0;color:#991b1b;font-size:14px;font-weight:600;letter-spacing:.02em;text-align:center;padding:16px}.overlay-popout-google{width:40px;height:40px;right:26px;top:11.5px;position:absolute;z-index:1000}.overlay-popout-office{width:100px;height:20px;right:0;bottom:0;position:absolute;z-index:1000}.office-reload-btn{position:absolute;top:8px;right:8px;z-index:1001;width:32px;height:32px;border-radius:50%;border:1px solid rgba(0,0,0,.12);background:#ffffffd9;color:#475569;font-size:16px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;opacity:.5;transition:opacity .15s;padding:0}.office-reload-btn:hover{opacity:1}.overlay-full{width:100%;height:100%;right:0;top:0;position:absolute;z-index:1000}iframe{width:100%;height:100%}@media(max-width:768px){.inline-document-shell{padding:12px}.inline-document-page{border-radius:12px;padding:22px 18px}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
431
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.4", type: NgxDocViewerComponent, isStandalone: true, selector: "ngx-doc-viewer", inputs: { url: "url", queryParams: "queryParams", viewerUrl: "viewerUrl", googleCheckInterval: "googleCheckInterval", googleMaxChecks: "googleMaxChecks", googleFinalRetryDelay: "googleFinalRetryDelay", disableContent: "disableContent", googleCheckContentLoaded: "googleCheckContentLoaded", viewer: "viewer", overrideLocalhost: "overrideLocalhost", loadingText: "loadingText", errorTextOverride: "errorTextOverride", retryButtonText: "retryButtonText", officeAutoRetry: "officeAutoRetry", officeRetryDelay: "officeRetryDelay", officeReloadButtonText: "officeReloadButtonText", officeReloadButtonTitle: "officeReloadButtonTitle", secondaryActionText: "secondaryActionText", secondaryActionMode: "secondaryActionMode" }, outputs: { loaded: "loaded", loading: "loading", error: "error", phaseChange: "phaseChange" }, queries: [{ propertyName: "loadingTemplate", first: true, predicate: ["loadingContent"], descendants: true, read: TemplateRef }, { propertyName: "errorTemplate", first: true, predicate: ["errorContent"], descendants: true, read: TemplateRef }, { propertyName: "errorActionsTemplate", first: true, predicate: ["errorActions"], descendants: true, read: TemplateRef }, { propertyName: "officeReloadTemplate", first: true, predicate: ["officeReloadContent"], descendants: true, read: TemplateRef }], viewQueries: [{ propertyName: "iframes", predicate: ["iframe"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"container\">\n <div *ngIf=\"renderPhase === 'loading'\" class=\"loading-overlay\">\n <ng-container *ngIf=\"loadingTemplate; else defaultLoadingTemplate\">\n <ng-container *ngTemplateOutlet=\"loadingTemplate; context: loadingTemplateContext\"></ng-container>\n </ng-container>\n <ng-template #defaultLoadingTemplate>{{ loadingText }}</ng-template>\n </div>\n <div *ngIf=\"renderPhase === 'error'\" class=\"error-overlay\">\n <ng-container *ngIf=\"errorTemplate; else defaultErrorTemplate\">\n <ng-container *ngTemplateOutlet=\"errorTemplate; context: errorTemplateContext\"></ng-container>\n </ng-container>\n <ng-template #defaultErrorTemplate>\n <div>\n <div>{{ displayedErrorText }}</div>\n <div *ngIf=\"configuredViewer\" style=\"margin-top: 8px; color: #475569;\">\n Viewer: {{ configuredViewer }}\n </div>\n <div *ngIf=\"failedUrl\" style=\"margin-top: 4px; color: #64748b; font-size: 12px; word-break: break-word;\">\n {{ failedUrl }}\n </div>\n <ng-container *ngIf=\"errorActionsTemplate; else defaultErrorActions\">\n <ng-container *ngTemplateOutlet=\"errorActionsTemplate; context: errorTemplateContext\"></ng-container>\n </ng-container>\n <ng-template #defaultErrorActions>\n <div style=\"margin-top: 14px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;\">\n <button\n type=\"button\"\n (click)=\"retryLoad()\"\n style=\"border: 1px solid #fecaca; background: #fff; color: #991b1b; border-radius: 999px; padding: 8px 14px; font: inherit; cursor: pointer;\"\n >\n {{ retryButtonText }}\n </button>\n <a\n *ngIf=\"secondaryActionText && failedUrl\"\n [href]=\"failedUrl\"\n [attr.target]=\"secondaryActionMode === 'open' ? '_blank' : null\"\n [attr.rel]=\"secondaryActionMode === 'open' ? 'noreferrer' : null\"\n [attr.download]=\"secondaryActionMode === 'download' ? '' : null\"\n style=\"border: 1px solid #cbd5e1; background: #fff; color: #334155; border-radius: 999px; padding: 8px 14px; text-decoration: none; font: inherit;\"\n >\n {{ secondaryActionText }}\n </a>\n </div>\n </ng-template>\n </div>\n </ng-template>\n </div>\n\n <ng-container *ngIf=\"!externalViewer\">\n <div *ngIf=\"configuredViewer !== 'pdf'\" class=\"inline-document-shell\">\n <div class=\"inline-document-page\" [innerHTML]=\"docHtml\"></div>\n </div>\n <object\n (load)=\"objectLoaded()\"\n *ngIf=\"fullUrl && configuredViewer === 'pdf'\"\n [data]=\"fullUrl\"\n type=\"application/pdf\"\n width=\"100%\"\n height=\"100%\"\n >\n <p>\n Your browser does not support PDFs.\n <a [href]=\"fullUrl\">Download the PDF</a>.\n </p>\n </object>\n </ng-container>\n\n <button\n *ngIf=\"configuredViewer === 'office' && renderPhase === 'ready'\"\n class=\"office-reload-btn\"\n type=\"button\"\n [attr.title]=\"officeReloadButtonTitle\"\n (click)=\"retryLoad()\"\n >\n <ng-container *ngIf=\"officeReloadTemplate; else defaultOfficeReloadTemplate\">\n <ng-container *ngTemplateOutlet=\"officeReloadTemplate; context: errorTemplateContext\"></ng-container>\n </ng-container>\n <ng-template #defaultOfficeReloadTemplate>{{ officeReloadButtonText }}</ng-template>\n </button>\n\n <ng-container *ngIf=\"externalViewer\">\n <iframe\n (load)=\"iframeLoaded()\"\n *ngIf=\"fullUrl && showIframe && disableContent === 'none'\"\n #iframe\n id=\"iframe-doc-viewer\"\n frameBorder=\"0\"\n allow=\"clipboard-read; clipboard-write\"\n [src]=\"fullUrl\"\n ></iframe>\n <div class=\"container\" *ngIf=\"disableContent !== 'none'\">\n <div\n [class.overlay-full]=\"disableContent === 'all'\"\n [class.overlay-popout-google]=\"\n configuredViewer === 'google' &&\n (disableContent === 'popout' || disableContent === 'popout-hide')\n \"\n [class.overlay-popout-office]=\"\n configuredViewer === 'office' &&\n (disableContent === 'popout' || disableContent === 'popout-hide')\n \"\n [style.background-color]=\"\n disableContent === 'popout-hide' ? '#fff' : 'transparent'\n \"\n ></div>\n <iframe\n (load)=\"iframeLoaded()\"\n *ngIf=\"fullUrl && showIframe\"\n #iframe\n id=\"iframe\"\n frameBorder=\"0\"\n allow=\"clipboard-read; clipboard-write\"\n [src]=\"fullUrl\"\n ></iframe>\n </div>\n </ng-container>\n</div>\n", styles: [":host{display:block}.container{width:100%;height:100%;position:relative}.inline-document-shell{width:100%;height:100%;overflow:auto;background:linear-gradient(180deg,#eef2f7,#f8fafc);padding:24px}.inline-document-page{max-width:900px;min-height:100%;margin:0 auto;background:#fff;border:1px solid #dbe4f0;border-radius:18px;box-shadow:0 18px 40px -24px #0f172a4d,0 6px 18px -10px #0f172a2e;padding:40px 48px}.inline-document-page,.inline-document-page *{box-sizing:border-box}.inline-document-page{color:#1e293b;font-family:Georgia,Cambria,Times New Roman,Times,serif;font-size:18px;line-height:1.7}.inline-document-page p,.inline-document-page ul,.inline-document-page ol,.inline-document-page blockquote,.inline-document-page table{margin:0 0 1.1em}.inline-document-page h1,.inline-document-page h2,.inline-document-page h3,.inline-document-page h4,.inline-document-page h5,.inline-document-page h6{margin:1.4em 0 .65em;color:#0f172a;line-height:1.25}.inline-document-page h1:first-child,.inline-document-page h2:first-child,.inline-document-page h3:first-child,.inline-document-page p:first-child{margin-top:0}.inline-document-page table{width:100%;border-collapse:collapse}.inline-document-page td,.inline-document-page th{padding:6px 10px;vertical-align:top}.inline-document-page img{max-width:100%;height:auto}.inline-document-page hr{border:0;border-top:1px solid #dbe4f0;margin:1.5em 0}.loading-overlay{position:absolute;inset:0;z-index:1001;display:flex;align-items:center;justify-content:center;background:#ffffffe0;color:#475569;font-size:14px;font-weight:600;letter-spacing:.02em;text-align:center;padding:16px}.error-overlay{position:absolute;inset:0;z-index:1001;display:flex;align-items:center;justify-content:center;background:#fffffff0;color:#991b1b;font-size:14px;font-weight:600;letter-spacing:.02em;text-align:center;padding:16px}.overlay-popout-google{width:40px;height:40px;right:26px;top:11.5px;position:absolute;z-index:1000}.overlay-popout-office{width:100px;height:20px;right:0;bottom:0;position:absolute;z-index:1000}.office-reload-btn{position:absolute;top:8px;right:8px;z-index:1001;width:32px;height:32px;border-radius:50%;border:1px solid rgba(0,0,0,.12);background:#ffffffd9;color:#475569;font-size:16px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;opacity:.5;transition:opacity .15s;padding:0}.office-reload-btn:hover{opacity:1}.overlay-full{width:100%;height:100%;right:0;top:0;position:absolute;z-index:1000}iframe{width:100%;height:100%}@media(max-width:768px){.inline-document-shell{padding:12px}.inline-document-page{border-radius:12px;padding:22px 18px}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
432
432
  }
433
433
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: NgxDocViewerComponent, decorators: [{
434
434
  type: Component,
435
- args: [{ selector: 'ngx-doc-viewer', standalone: true, imports: [CommonModule], template: "<div class=\"container\">\n <div *ngIf=\"renderPhase === 'loading'\" class=\"loading-overlay\">\n <ng-container *ngIf=\"loadingTemplate; else defaultLoadingTemplate\">\n <ng-container *ngTemplateOutlet=\"loadingTemplate; context: loadingTemplateContext\"></ng-container>\n </ng-container>\n <ng-template #defaultLoadingTemplate>{{ loadingText }}</ng-template>\n </div>\n <div *ngIf=\"renderPhase === 'error'\" class=\"error-overlay\">\n <ng-container *ngIf=\"errorTemplate; else defaultErrorTemplate\">\n <ng-container *ngTemplateOutlet=\"errorTemplate; context: errorTemplateContext\"></ng-container>\n </ng-container>\n <ng-template #defaultErrorTemplate>\n <div>\n <div>{{ displayedErrorText }}</div>\n <div *ngIf=\"configuredViewer\" style=\"margin-top: 8px; color: #475569;\">\n Viewer: {{ configuredViewer }}\n </div>\n <div *ngIf=\"failedUrl\" style=\"margin-top: 4px; color: #64748b; font-size: 12px; word-break: break-word;\">\n {{ failedUrl }}\n </div>\n <ng-container *ngIf=\"errorActionsTemplate; else defaultErrorActions\">\n <ng-container *ngTemplateOutlet=\"errorActionsTemplate; context: errorTemplateContext\"></ng-container>\n </ng-container>\n <ng-template #defaultErrorActions>\n <div style=\"margin-top: 14px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;\">\n <button\n type=\"button\"\n (click)=\"retryLoad()\"\n style=\"border: 1px solid #fecaca; background: #fff; color: #991b1b; border-radius: 999px; padding: 8px 14px; font: inherit; cursor: pointer;\"\n >\n {{ retryButtonText }}\n </button>\n <a\n *ngIf=\"secondaryActionText && failedUrl\"\n [href]=\"failedUrl\"\n [attr.target]=\"secondaryActionMode === 'open' ? '_blank' : null\"\n [attr.rel]=\"secondaryActionMode === 'open' ? 'noreferrer' : null\"\n [attr.download]=\"secondaryActionMode === 'download' ? '' : null\"\n style=\"border: 1px solid #cbd5e1; background: #fff; color: #334155; border-radius: 999px; padding: 8px 14px; text-decoration: none; font: inherit;\"\n >\n {{ secondaryActionText }}\n </a>\n </div>\n </ng-template>\n </div>\n </ng-template>\n </div>\n\n <ng-container *ngIf=\"!externalViewer\">\n <div *ngIf=\"configuredViewer !== 'pdf'\" class=\"inline-document-shell\">\n <div class=\"inline-document-page\" [innerHTML]=\"docHtml\"></div>\n </div>\n <object\n (load)=\"objectLoaded()\"\n *ngIf=\"fullUrl && configuredViewer === 'pdf'\"\n [data]=\"fullUrl\"\n type=\"application/pdf\"\n width=\"100%\"\n height=\"100%\"\n >\n <p>\n Your browser does not support PDFs.\n <a [href]=\"fullUrl\">Download the PDF</a>.\n </p>\n </object>\n </ng-container>\n\n <button\n *ngIf=\"configuredViewer === 'office' && renderPhase === 'ready'\"\n class=\"office-reload-btn\"\n type=\"button\"\n [attr.title]=\"officeReloadButtonTitle\"\n (click)=\"retryLoad()\"\n >\n <ng-container *ngIf=\"officeReloadTemplate; else defaultOfficeReloadTemplate\">\n <ng-container *ngTemplateOutlet=\"officeReloadTemplate; context: errorTemplateContext\"></ng-container>\n </ng-container>\n <ng-template #defaultOfficeReloadTemplate>{{ officeReloadButtonText }}</ng-template>\n </button>\n\n <ng-container *ngIf=\"externalViewer\">\n <iframe\n (load)=\"iframeLoaded()\"\n *ngIf=\"fullUrl && showIframe && disableContent === 'none'\"\n #iframe\n id=\"iframe-doc-viewer\"\n frameBorder=\"0\"\n [src]=\"fullUrl\"\n ></iframe>\n <div class=\"container\" *ngIf=\"disableContent !== 'none'\">\n <div\n [class.overlay-full]=\"disableContent === 'all'\"\n [class.overlay-popout-google]=\"\n configuredViewer === 'google' &&\n (disableContent === 'popout' || disableContent === 'popout-hide')\n \"\n [class.overlay-popout-office]=\"\n configuredViewer === 'office' &&\n (disableContent === 'popout' || disableContent === 'popout-hide')\n \"\n [style.background-color]=\"\n disableContent === 'popout-hide' ? '#fff' : 'transparent'\n \"\n ></div>\n <iframe\n (load)=\"iframeLoaded()\"\n *ngIf=\"fullUrl && showIframe\"\n #iframe\n id=\"iframe\"\n frameBorder=\"0\"\n [src]=\"fullUrl\"\n ></iframe>\n </div>\n </ng-container>\n</div>\n", styles: [":host{display:block}.container{width:100%;height:100%;position:relative}.inline-document-shell{width:100%;height:100%;overflow:auto;background:linear-gradient(180deg,#eef2f7,#f8fafc);padding:24px}.inline-document-page{max-width:900px;min-height:100%;margin:0 auto;background:#fff;border:1px solid #dbe4f0;border-radius:18px;box-shadow:0 18px 40px -24px #0f172a4d,0 6px 18px -10px #0f172a2e;padding:40px 48px}.inline-document-page,.inline-document-page *{box-sizing:border-box}.inline-document-page{color:#1e293b;font-family:Georgia,Cambria,Times New Roman,Times,serif;font-size:18px;line-height:1.7}.inline-document-page p,.inline-document-page ul,.inline-document-page ol,.inline-document-page blockquote,.inline-document-page table{margin:0 0 1.1em}.inline-document-page h1,.inline-document-page h2,.inline-document-page h3,.inline-document-page h4,.inline-document-page h5,.inline-document-page h6{margin:1.4em 0 .65em;color:#0f172a;line-height:1.25}.inline-document-page h1:first-child,.inline-document-page h2:first-child,.inline-document-page h3:first-child,.inline-document-page p:first-child{margin-top:0}.inline-document-page table{width:100%;border-collapse:collapse}.inline-document-page td,.inline-document-page th{padding:6px 10px;vertical-align:top}.inline-document-page img{max-width:100%;height:auto}.inline-document-page hr{border:0;border-top:1px solid #dbe4f0;margin:1.5em 0}.loading-overlay{position:absolute;inset:0;z-index:1001;display:flex;align-items:center;justify-content:center;background:#ffffffe0;color:#475569;font-size:14px;font-weight:600;letter-spacing:.02em;text-align:center;padding:16px}.error-overlay{position:absolute;inset:0;z-index:1001;display:flex;align-items:center;justify-content:center;background:#fffffff0;color:#991b1b;font-size:14px;font-weight:600;letter-spacing:.02em;text-align:center;padding:16px}.overlay-popout-google{width:40px;height:40px;right:26px;top:11.5px;position:absolute;z-index:1000}.overlay-popout-office{width:100px;height:20px;right:0;bottom:0;position:absolute;z-index:1000}.office-reload-btn{position:absolute;top:8px;right:8px;z-index:1001;width:32px;height:32px;border-radius:50%;border:1px solid rgba(0,0,0,.12);background:#ffffffd9;color:#475569;font-size:16px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;opacity:.5;transition:opacity .15s;padding:0}.office-reload-btn:hover{opacity:1}.overlay-full{width:100%;height:100%;right:0;top:0;position:absolute;z-index:1000}iframe{width:100%;height:100%}@media(max-width:768px){.inline-document-shell{padding:12px}.inline-document-page{border-radius:12px;padding:22px 18px}}\n"] }]
435
+ args: [{ selector: 'ngx-doc-viewer', standalone: true, imports: [CommonModule], template: "<div class=\"container\">\n <div *ngIf=\"renderPhase === 'loading'\" class=\"loading-overlay\">\n <ng-container *ngIf=\"loadingTemplate; else defaultLoadingTemplate\">\n <ng-container *ngTemplateOutlet=\"loadingTemplate; context: loadingTemplateContext\"></ng-container>\n </ng-container>\n <ng-template #defaultLoadingTemplate>{{ loadingText }}</ng-template>\n </div>\n <div *ngIf=\"renderPhase === 'error'\" class=\"error-overlay\">\n <ng-container *ngIf=\"errorTemplate; else defaultErrorTemplate\">\n <ng-container *ngTemplateOutlet=\"errorTemplate; context: errorTemplateContext\"></ng-container>\n </ng-container>\n <ng-template #defaultErrorTemplate>\n <div>\n <div>{{ displayedErrorText }}</div>\n <div *ngIf=\"configuredViewer\" style=\"margin-top: 8px; color: #475569;\">\n Viewer: {{ configuredViewer }}\n </div>\n <div *ngIf=\"failedUrl\" style=\"margin-top: 4px; color: #64748b; font-size: 12px; word-break: break-word;\">\n {{ failedUrl }}\n </div>\n <ng-container *ngIf=\"errorActionsTemplate; else defaultErrorActions\">\n <ng-container *ngTemplateOutlet=\"errorActionsTemplate; context: errorTemplateContext\"></ng-container>\n </ng-container>\n <ng-template #defaultErrorActions>\n <div style=\"margin-top: 14px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;\">\n <button\n type=\"button\"\n (click)=\"retryLoad()\"\n style=\"border: 1px solid #fecaca; background: #fff; color: #991b1b; border-radius: 999px; padding: 8px 14px; font: inherit; cursor: pointer;\"\n >\n {{ retryButtonText }}\n </button>\n <a\n *ngIf=\"secondaryActionText && failedUrl\"\n [href]=\"failedUrl\"\n [attr.target]=\"secondaryActionMode === 'open' ? '_blank' : null\"\n [attr.rel]=\"secondaryActionMode === 'open' ? 'noreferrer' : null\"\n [attr.download]=\"secondaryActionMode === 'download' ? '' : null\"\n style=\"border: 1px solid #cbd5e1; background: #fff; color: #334155; border-radius: 999px; padding: 8px 14px; text-decoration: none; font: inherit;\"\n >\n {{ secondaryActionText }}\n </a>\n </div>\n </ng-template>\n </div>\n </ng-template>\n </div>\n\n <ng-container *ngIf=\"!externalViewer\">\n <div *ngIf=\"configuredViewer !== 'pdf'\" class=\"inline-document-shell\">\n <div class=\"inline-document-page\" [innerHTML]=\"docHtml\"></div>\n </div>\n <object\n (load)=\"objectLoaded()\"\n *ngIf=\"fullUrl && configuredViewer === 'pdf'\"\n [data]=\"fullUrl\"\n type=\"application/pdf\"\n width=\"100%\"\n height=\"100%\"\n >\n <p>\n Your browser does not support PDFs.\n <a [href]=\"fullUrl\">Download the PDF</a>.\n </p>\n </object>\n </ng-container>\n\n <button\n *ngIf=\"configuredViewer === 'office' && renderPhase === 'ready'\"\n class=\"office-reload-btn\"\n type=\"button\"\n [attr.title]=\"officeReloadButtonTitle\"\n (click)=\"retryLoad()\"\n >\n <ng-container *ngIf=\"officeReloadTemplate; else defaultOfficeReloadTemplate\">\n <ng-container *ngTemplateOutlet=\"officeReloadTemplate; context: errorTemplateContext\"></ng-container>\n </ng-container>\n <ng-template #defaultOfficeReloadTemplate>{{ officeReloadButtonText }}</ng-template>\n </button>\n\n <ng-container *ngIf=\"externalViewer\">\n <iframe\n (load)=\"iframeLoaded()\"\n *ngIf=\"fullUrl && showIframe && disableContent === 'none'\"\n #iframe\n id=\"iframe-doc-viewer\"\n frameBorder=\"0\"\n allow=\"clipboard-read; clipboard-write\"\n [src]=\"fullUrl\"\n ></iframe>\n <div class=\"container\" *ngIf=\"disableContent !== 'none'\">\n <div\n [class.overlay-full]=\"disableContent === 'all'\"\n [class.overlay-popout-google]=\"\n configuredViewer === 'google' &&\n (disableContent === 'popout' || disableContent === 'popout-hide')\n \"\n [class.overlay-popout-office]=\"\n configuredViewer === 'office' &&\n (disableContent === 'popout' || disableContent === 'popout-hide')\n \"\n [style.background-color]=\"\n disableContent === 'popout-hide' ? '#fff' : 'transparent'\n \"\n ></div>\n <iframe\n (load)=\"iframeLoaded()\"\n *ngIf=\"fullUrl && showIframe\"\n #iframe\n id=\"iframe\"\n frameBorder=\"0\"\n allow=\"clipboard-read; clipboard-write\"\n [src]=\"fullUrl\"\n ></iframe>\n </div>\n </ng-container>\n</div>\n", styles: [":host{display:block}.container{width:100%;height:100%;position:relative}.inline-document-shell{width:100%;height:100%;overflow:auto;background:linear-gradient(180deg,#eef2f7,#f8fafc);padding:24px}.inline-document-page{max-width:900px;min-height:100%;margin:0 auto;background:#fff;border:1px solid #dbe4f0;border-radius:18px;box-shadow:0 18px 40px -24px #0f172a4d,0 6px 18px -10px #0f172a2e;padding:40px 48px}.inline-document-page,.inline-document-page *{box-sizing:border-box}.inline-document-page{color:#1e293b;font-family:Georgia,Cambria,Times New Roman,Times,serif;font-size:18px;line-height:1.7}.inline-document-page p,.inline-document-page ul,.inline-document-page ol,.inline-document-page blockquote,.inline-document-page table{margin:0 0 1.1em}.inline-document-page h1,.inline-document-page h2,.inline-document-page h3,.inline-document-page h4,.inline-document-page h5,.inline-document-page h6{margin:1.4em 0 .65em;color:#0f172a;line-height:1.25}.inline-document-page h1:first-child,.inline-document-page h2:first-child,.inline-document-page h3:first-child,.inline-document-page p:first-child{margin-top:0}.inline-document-page table{width:100%;border-collapse:collapse}.inline-document-page td,.inline-document-page th{padding:6px 10px;vertical-align:top}.inline-document-page img{max-width:100%;height:auto}.inline-document-page hr{border:0;border-top:1px solid #dbe4f0;margin:1.5em 0}.loading-overlay{position:absolute;inset:0;z-index:1001;display:flex;align-items:center;justify-content:center;background:#ffffffe0;color:#475569;font-size:14px;font-weight:600;letter-spacing:.02em;text-align:center;padding:16px}.error-overlay{position:absolute;inset:0;z-index:1001;display:flex;align-items:center;justify-content:center;background:#fffffff0;color:#991b1b;font-size:14px;font-weight:600;letter-spacing:.02em;text-align:center;padding:16px}.overlay-popout-google{width:40px;height:40px;right:26px;top:11.5px;position:absolute;z-index:1000}.overlay-popout-office{width:100px;height:20px;right:0;bottom:0;position:absolute;z-index:1000}.office-reload-btn{position:absolute;top:8px;right:8px;z-index:1001;width:32px;height:32px;border-radius:50%;border:1px solid rgba(0,0,0,.12);background:#ffffffd9;color:#475569;font-size:16px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;opacity:.5;transition:opacity .15s;padding:0}.office-reload-btn:hover{opacity:1}.overlay-full{width:100%;height:100%;right:0;top:0;position:absolute;z-index:1000}iframe{width:100%;height:100%}@media(max-width:768px){.inline-document-shell{padding:12px}.inline-document-page{border-radius:12px;padding:22px 18px}}\n"] }]
436
436
  }], ctorParameters: () => [{ type: i1.DomSanitizer }, { type: i0.NgZone }, { type: i0.ChangeDetectorRef }], propDecorators: { loaded: [{
437
437
  type: Output
438
438
  }], loading: [{
@@ -1 +1 @@
1
- {"version":3,"file":"ngx-doc-viewer.mjs","sources":["../../../../packages/ngx-doc-viewer/src/lib/document-viewer.component.ts","../../../../packages/ngx-doc-viewer/src/lib/document-viewer.component.html","../../../../packages/ngx-doc-viewer/src/lib/document-viewer.module.ts","../../../../packages/ngx-doc-viewer/src/ngx-doc-viewer.ts"],"sourcesContent":["import {\n Component,\n Input,\n NgZone,\n OnDestroy,\n OnChanges,\n SimpleChanges,\n Output,\n ViewChildren,\n QueryList,\n ElementRef,\n ChangeDetectorRef,\n ContentChild,\n TemplateRef,\n} from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';\nimport { EventEmitter } from '@angular/core';\nimport {\n getDocxToHtml,\n getViewerDetails,\n getViewerRecoveryPlan,\n googleCheckSubscription,\n iframeIsLoaded,\n isLocalFile,\n replaceLocalUrl,\n IFrameReloader,\n} from 'docviewhelper';\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport type viewerType = 'google' | 'office' | 'mammoth' | 'pdf' | 'url';\ntype ViewerRenderPhase = 'idle' | 'loading' | 'ready' | 'error';\ninterface ViewerTemplateContext {\n $implicit: ViewerStateContext;\n state: ViewerStateContext;\n}\nexport interface ViewerStateContext {\n viewer: viewerType;\n url: string;\n phase: ViewerRenderPhase;\n errorText: string;\n retry: () => void;\n actionUrl: string;\n}\n@Component({\n selector: 'ngx-doc-viewer',\n standalone: true,\n imports: [CommonModule],\n templateUrl: 'document-viewer.component.html',\n styles: [\n `\n :host {\n display: block;\n }\n .container {\n width: 100%;\n height: 100%;\n position: relative;\n }\n .inline-document-shell {\n width: 100%;\n height: 100%;\n overflow: auto;\n background:\n linear-gradient(180deg, #eef2f7 0%, #f8fafc 100%);\n padding: 24px;\n }\n .inline-document-page {\n max-width: 900px;\n min-height: 100%;\n margin: 0 auto;\n background: #fff;\n border: 1px solid #dbe4f0;\n border-radius: 18px;\n box-shadow:\n 0 18px 40px -24px rgba(15, 23, 42, 0.3),\n 0 6px 18px -10px rgba(15, 23, 42, 0.18);\n padding: 40px 48px;\n }\n .inline-document-page,\n .inline-document-page * {\n box-sizing: border-box;\n }\n .inline-document-page {\n color: #1e293b;\n font-family:\n Georgia, Cambria, 'Times New Roman', Times, serif;\n font-size: 18px;\n line-height: 1.7;\n }\n .inline-document-page p,\n .inline-document-page ul,\n .inline-document-page ol,\n .inline-document-page blockquote,\n .inline-document-page table {\n margin: 0 0 1.1em;\n }\n .inline-document-page h1,\n .inline-document-page h2,\n .inline-document-page h3,\n .inline-document-page h4,\n .inline-document-page h5,\n .inline-document-page h6 {\n margin: 1.4em 0 0.65em;\n color: #0f172a;\n line-height: 1.25;\n }\n .inline-document-page h1:first-child,\n .inline-document-page h2:first-child,\n .inline-document-page h3:first-child,\n .inline-document-page p:first-child {\n margin-top: 0;\n }\n .inline-document-page table {\n width: 100%;\n border-collapse: collapse;\n }\n .inline-document-page td,\n .inline-document-page th {\n padding: 6px 10px;\n vertical-align: top;\n }\n .inline-document-page img {\n max-width: 100%;\n height: auto;\n }\n .inline-document-page hr {\n border: 0;\n border-top: 1px solid #dbe4f0;\n margin: 1.5em 0;\n }\n .loading-overlay {\n position: absolute;\n inset: 0;\n z-index: 1001;\n display: flex;\n align-items: center;\n justify-content: center;\n background: rgba(255, 255, 255, 0.88);\n color: #475569;\n font-size: 14px;\n font-weight: 600;\n letter-spacing: 0.02em;\n text-align: center;\n padding: 16px;\n }\n .error-overlay {\n position: absolute;\n inset: 0;\n z-index: 1001;\n display: flex;\n align-items: center;\n justify-content: center;\n background: rgba(255, 255, 255, 0.94);\n color: #991b1b;\n font-size: 14px;\n font-weight: 600;\n letter-spacing: 0.02em;\n text-align: center;\n padding: 16px;\n }\n .overlay-popout-google {\n width: 40px;\n height: 40px;\n right: 26px;\n top: 11.5px;\n position: absolute;\n z-index: 1000;\n }\n .overlay-popout-office {\n width: 100px;\n height: 20px;\n right: 0;\n bottom: 0;\n position: absolute;\n z-index: 1000;\n }\n .office-reload-btn {\n position: absolute;\n top: 8px;\n right: 8px;\n z-index: 1001;\n width: 32px;\n height: 32px;\n border-radius: 50%;\n border: 1px solid rgba(0, 0, 0, 0.12);\n background: rgba(255, 255, 255, 0.85);\n color: #475569;\n font-size: 16px;\n line-height: 1;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0.5;\n transition: opacity 0.15s;\n padding: 0;\n }\n .office-reload-btn:hover {\n opacity: 1;\n }\n .overlay-full {\n width: 100%;\n height: 100%;\n right: 0;\n top: 0;\n position: absolute;\n z-index: 1000;\n }\n iframe {\n width: 100%;\n height: 100%;\n }\n @media (max-width: 768px) {\n .inline-document-shell {\n padding: 12px;\n }\n .inline-document-page {\n border-radius: 12px;\n padding: 22px 18px;\n }\n }\n `,\n ],\n})\nexport class NgxDocViewerComponent\n implements OnChanges, OnDestroy\n{\n @Output() loaded: EventEmitter<void> = new EventEmitter();\n @Output() loading: EventEmitter<ViewerStateContext> = new EventEmitter();\n @Output() error: EventEmitter<ViewerStateContext> = new EventEmitter();\n @Output() phaseChange: EventEmitter<ViewerStateContext> = new EventEmitter();\n @Input() url = '';\n @Input() queryParams = '';\n @Input() viewerUrl = '';\n @Input() googleCheckInterval = 3000;\n @Input() googleMaxChecks = 5;\n @Input() googleFinalRetryDelay = 0;\n @Input() disableContent: 'none' | 'all' | 'popout' | 'popout-hide' = 'none';\n @Input() googleCheckContentLoaded = true;\n @Input() viewer: viewerType = 'google';\n @Input() overrideLocalhost = '';\n @Input() loadingText = 'Loading document...';\n @Input() errorTextOverride = '';\n @Input() retryButtonText = 'Retry';\n @Input() officeAutoRetry = false;\n @Input() officeRetryDelay = 3000;\n @Input() officeReloadButtonText = '↻';\n @Input() officeReloadButtonTitle = 'Reload document';\n @Input() secondaryActionText = '';\n @Input() secondaryActionMode: 'open' | 'download' = 'open';\n @ContentChild('loadingContent', { read: TemplateRef })\n loadingTemplate?: TemplateRef<unknown>;\n @ContentChild('errorContent', { read: TemplateRef })\n errorTemplate?: TemplateRef<unknown>;\n @ContentChild('errorActions', { read: TemplateRef })\n errorActionsTemplate?: TemplateRef<unknown>;\n @ContentChild('officeReloadContent', { read: TemplateRef })\n officeReloadTemplate?: TemplateRef<unknown>;\n @ViewChildren('iframe') iframes?: QueryList<ElementRef> = undefined;\n\n public fullUrl?: SafeResourceUrl = undefined;\n public externalViewer = false;\n public docHtml = '';\n public configuredViewer: viewerType = 'google';\n public showIframe = true;\n public renderPhase: ViewerRenderPhase = 'idle';\n public errorText = '';\n public failedUrl = '';\n public retryNonce = 0;\n public loadingTemplateContext: ViewerTemplateContext = this.createTemplateContext();\n public errorTemplateContext: ViewerTemplateContext = this.createTemplateContext();\n private checkIFrameSubscription?: IFrameReloader = undefined;\n private loadVersion = 0;\n private externalLoadTimeoutId?: number = undefined;\n private googleFinalRetryTimeoutId?: number = undefined;\n private googleFinalRetriedSourceKey?: string = undefined;\n private currentGoogleSourceKey?: string = undefined;\n private officeRetryTimeoutId?: number = undefined;\n private officeAutoRetriedSourceKey?: string = undefined;\n private currentOfficeSourceKey?: string = undefined;\n private lastEmittedPhase?: ViewerRenderPhase = undefined;\n\n constructor(\n private domSanitizer: DomSanitizer,\n private ngZone: NgZone,\n private cdr: ChangeDetectorRef,\n ) {}\n\n ngOnDestroy(): void {\n this.clearExternalLoadTimeout();\n this.clearGoogleFinalRetry();\n this.clearOfficeRetry();\n if (this.checkIFrameSubscription) {\n this.checkIFrameSubscription.unsubscribe();\n }\n }\n\n async ngOnChanges(changes: SimpleChanges): Promise<void> {\n if (\n changes &&\n changes['retryNonce'] &&\n changes['retryNonce'].firstChange\n ) {\n return;\n }\n if (\n changes &&\n changes['viewer'] &&\n (changes['viewer'].firstChange ||\n changes['viewer'].currentValue !== changes['viewer'].previousValue)\n ) {\n if (\n this.viewer !== 'google' &&\n this.viewer !== 'office' &&\n this.viewer !== 'mammoth' &&\n this.viewer !== 'pdf' &&\n this.viewer !== 'url'\n ) {\n console.error(\n `Unsupported viewer: '${this.viewer}'. Supported viewers: google, office, mammoth and pdf`,\n );\n }\n this.configuredViewer = this.viewer;\n this.updateTemplateContexts();\n }\n\n if (\n (changes['url'] &&\n changes['url'].currentValue !== changes['url'].previousValue) ||\n (changes['viewer'] &&\n changes['viewer'].currentValue !== changes['viewer'].previousValue) ||\n (changes['viewerUrl'] &&\n changes['viewerUrl'].currentValue !==\n changes['viewerUrl'].previousValue)\n ) {\n let viewerDetails = getViewerDetails(\n this.url,\n this.configuredViewer,\n this.queryParams,\n this.viewerUrl,\n );\n const loadVersion = ++this.loadVersion;\n this.clearExternalLoadTimeout();\n this.externalViewer = viewerDetails.externalViewer;\n if (\n viewerDetails.externalViewer &&\n this.overrideLocalhost &&\n isLocalFile(this.url)\n ) {\n const newUrl = replaceLocalUrl(this.url, this.overrideLocalhost);\n viewerDetails = getViewerDetails(\n newUrl,\n this.configuredViewer,\n this.queryParams,\n this.viewerUrl,\n );\n }\n const officeSourceKey =\n this.configuredViewer === 'office' ? viewerDetails.url : undefined;\n if (officeSourceKey !== this.currentOfficeSourceKey) {\n this.officeAutoRetriedSourceKey = undefined;\n }\n this.currentOfficeSourceKey = officeSourceKey;\n const googleSourceKey =\n this.configuredViewer === 'google' ? viewerDetails.url : undefined;\n if (googleSourceKey !== this.currentGoogleSourceKey) {\n this.googleFinalRetriedSourceKey = undefined;\n }\n this.currentGoogleSourceKey = googleSourceKey;\n this.docHtml = '';\n this.errorText = '';\n this.failedUrl = this.url;\n this.clearGoogleFinalRetry();\n this.clearOfficeRetry();\n this.updateTemplateContexts();\n if (this.checkIFrameSubscription) {\n this.checkIFrameSubscription.unsubscribe();\n }\n if (!this.url) {\n this.fullUrl = undefined;\n this.showIframe = false;\n this.externalViewer = false;\n this.setRenderPhase('idle');\n this.updateTemplateContexts();\n } else if (\n viewerDetails.externalViewer ||\n this.configuredViewer === 'url' ||\n this.configuredViewer === 'pdf'\n ) {\n this.setRenderPhase('loading');\n const iframeUrl = this.domSanitizer.bypassSecurityTrustResourceUrl(\n viewerDetails.url,\n );\n this.fullUrl = undefined;\n this.showIframe = false;\n this.cdr.detectChanges();\n this.fullUrl = iframeUrl;\n this.showIframe = true;\n this.updateTemplateContexts();\n this.scheduleExternalLoadTimeout(loadVersion);\n this.cdr.detectChanges();\n this.scheduleViewerRecovery();\n } else if (this.configuredViewer === 'mammoth') {\n this.setRenderPhase('loading');\n this.externalViewer = false;\n this.fullUrl = undefined;\n this.showIframe = false;\n try {\n const docHtml = await getDocxToHtml(this.url);\n if (loadVersion !== this.loadVersion) {\n return;\n }\n this.ngZone.run(() => {\n this.docHtml = docHtml;\n this.setRenderPhase('ready');\n this.updateTemplateContexts();\n this.cdr.detectChanges();\n });\n } catch (error) {\n if (loadVersion !== this.loadVersion) {\n return;\n }\n this.ngZone.run(() => {\n this.errorText =\n error instanceof Error ? error.message : 'Unable to load document.';\n this.setRenderPhase('error');\n this.updateTemplateContexts();\n this.cdr.detectChanges();\n });\n }\n }\n }\n }\n\n retryLoad() {\n this.retryNonce += 1;\n const retryVersion = ++this.loadVersion;\n this.clearExternalLoadTimeout();\n this.clearGoogleFinalRetry();\n this.clearOfficeRetry();\n this.errorText = '';\n this.setRenderPhase(this.url ? 'loading' : 'idle');\n this.updateTemplateContexts();\n\n if (!this.url) {\n return;\n }\n\n if (this.configuredViewer === 'mammoth') {\n this.docHtml = '';\n void this.reloadMammoth(retryVersion);\n return;\n }\n\n if (\n this.configuredViewer === 'google' ||\n this.configuredViewer === 'office' ||\n this.configuredViewer === 'url' ||\n this.configuredViewer === 'pdf'\n ) {\n const details = getViewerDetails(\n this.url,\n this.configuredViewer,\n this.queryParams,\n this.viewerUrl,\n );\n const finalUrl =\n details.externalViewer && this.overrideLocalhost && isLocalFile(this.url)\n ? getViewerDetails(\n replaceLocalUrl(this.url, this.overrideLocalhost),\n this.configuredViewer,\n this.queryParams,\n this.viewerUrl,\n ).url\n : details.url;\n\n this.fullUrl = undefined;\n this.showIframe = false;\n this.cdr.detectChanges();\n this.fullUrl =\n this.domSanitizer.bypassSecurityTrustResourceUrl(finalUrl);\n this.showIframe = true;\n this.scheduleExternalLoadTimeout(retryVersion);\n this.scheduleViewerRecovery();\n this.updateTemplateContexts();\n this.cdr.detectChanges();\n }\n }\n\n private reloadIframe(iframe: HTMLIFrameElement) {\n this.checkIFrameSubscription = googleCheckSubscription();\n this.checkIFrameSubscription.subscribe(\n iframe,\n this.googleCheckInterval,\n this.googleMaxChecks,\n );\n }\n\n private scheduleViewerRecovery() {\n const recoveryPlan = getViewerRecoveryPlan({\n viewer: this.configuredViewer,\n googleCheckContentLoaded: this.googleCheckContentLoaded,\n googleFinalRetryDelay: this.googleFinalRetryDelay,\n officeAutoRetry: this.officeAutoRetry,\n });\n for (const mode of recoveryPlan.modes) {\n if (mode === 'google-probe') {\n this.scheduleGoogleRecovery();\n }\n if (mode === 'google-final-retry') {\n continue;\n }\n if (mode === 'office-auto-retry') {\n this.scheduleOfficeRetry();\n }\n }\n }\n\n private scheduleGoogleRecovery() {\n if (\n this.configuredViewer !== 'google' ||\n !this.googleCheckContentLoaded\n ) {\n return;\n }\n // see:\n // https://stackoverflow.com/questions/40414039/google-docs-viewer-returning-204-responses-no-longer-working-alternatives\n // hack to reload iframe if it's not loaded.\n this.ngZone.runOutsideAngular(() => {\n window.setTimeout(() => {\n const iframe = this.iframes?.first?.nativeElement as HTMLIFrameElement;\n if (iframe) {\n this.reloadIframe(iframe);\n }\n }, 0);\n });\n }\n\n iframeLoaded() {\n const iframe = this.iframes?.first?.nativeElement as HTMLIFrameElement;\n if (iframe && iframeIsLoaded(iframe)) {\n this.clearExternalLoadTimeout();\n this.clearGoogleFinalRetry();\n this.clearOfficeRetry();\n this.setRenderPhase('ready');\n this.updateTemplateContexts();\n this.loaded.emit(undefined);\n if (this.checkIFrameSubscription) {\n this.checkIFrameSubscription.unsubscribe();\n }\n }\n }\n\n objectLoaded() {\n this.clearExternalLoadTimeout();\n this.clearGoogleFinalRetry();\n this.clearOfficeRetry();\n this.setRenderPhase('ready');\n this.updateTemplateContexts();\n }\n\n private async reloadMammoth(loadVersion: number) {\n this.externalViewer = false;\n this.fullUrl = undefined;\n this.showIframe = false;\n try {\n const docHtml = await getDocxToHtml(this.url);\n if (loadVersion !== this.loadVersion) {\n return;\n }\n this.ngZone.run(() => {\n this.docHtml = docHtml;\n this.setRenderPhase('ready');\n this.updateTemplateContexts();\n this.cdr.detectChanges();\n });\n } catch (error) {\n if (loadVersion !== this.loadVersion) {\n return;\n }\n this.ngZone.run(() => {\n this.errorText =\n error instanceof Error ? error.message : 'Unable to load document.';\n this.setRenderPhase('error');\n this.updateTemplateContexts();\n this.cdr.detectChanges();\n });\n }\n }\n\n private scheduleExternalLoadTimeout(loadVersion: number) {\n this.clearExternalLoadTimeout();\n const timeoutMs =\n this.configuredViewer === 'google'\n ? Math.max(this.googleCheckInterval * this.googleMaxChecks + 2000, 15000)\n : 15000;\n this.externalLoadTimeoutId = window.setTimeout(() => {\n if (loadVersion !== this.loadVersion || this.renderPhase !== 'loading') {\n return;\n }\n if (this.scheduleGoogleFinalRetry()) {\n return;\n }\n this.ngZone.run(() => {\n this.errorText = `The ${this.configuredViewer} viewer did not finish loading in time.`;\n this.setRenderPhase('error');\n this.updateTemplateContexts();\n this.cdr.detectChanges();\n });\n }, timeoutMs);\n }\n\n private clearExternalLoadTimeout() {\n if (this.externalLoadTimeoutId) {\n window.clearTimeout(this.externalLoadTimeoutId);\n this.externalLoadTimeoutId = undefined;\n }\n }\n\n private clearGoogleFinalRetry() {\n if (this.googleFinalRetryTimeoutId) {\n window.clearTimeout(this.googleFinalRetryTimeoutId);\n this.googleFinalRetryTimeoutId = undefined;\n }\n }\n\n private clearOfficeRetry() {\n if (this.officeRetryTimeoutId) {\n window.clearTimeout(this.officeRetryTimeoutId);\n this.officeRetryTimeoutId = undefined;\n }\n }\n\n private scheduleOfficeRetry() {\n if (\n this.configuredViewer !== 'office' ||\n !this.officeAutoRetry ||\n !this.currentOfficeSourceKey ||\n this.officeAutoRetriedSourceKey === this.currentOfficeSourceKey\n ) {\n return;\n }\n this.clearOfficeRetry();\n this.officeRetryTimeoutId = window.setTimeout(() => {\n if (\n !this.currentOfficeSourceKey ||\n this.officeAutoRetriedSourceKey === this.currentOfficeSourceKey\n ) {\n return;\n }\n this.officeAutoRetriedSourceKey = this.currentOfficeSourceKey;\n this.ngZone.run(() => this.retryLoad());\n }, this.officeRetryDelay);\n }\n\n private scheduleGoogleFinalRetry() {\n const recoveryPlan = getViewerRecoveryPlan({\n viewer: this.configuredViewer,\n googleCheckContentLoaded: this.googleCheckContentLoaded,\n googleFinalRetryDelay: this.googleFinalRetryDelay,\n officeAutoRetry: this.officeAutoRetry,\n });\n if (\n !recoveryPlan.modes.includes('google-final-retry') ||\n !this.currentGoogleSourceKey ||\n this.googleFinalRetriedSourceKey === this.currentGoogleSourceKey\n ) {\n return false;\n }\n this.clearGoogleFinalRetry();\n this.googleFinalRetryTimeoutId = window.setTimeout(() => {\n if (\n !this.currentGoogleSourceKey ||\n this.googleFinalRetriedSourceKey === this.currentGoogleSourceKey\n ) {\n return;\n }\n this.googleFinalRetriedSourceKey = this.currentGoogleSourceKey;\n this.ngZone.run(() => this.retryLoad());\n }, this.googleFinalRetryDelay);\n return true;\n }\n\n get displayedErrorText() {\n return this.errorTextOverride || this.errorText || 'Unable to load document.';\n }\n\n private updateTemplateContexts() {\n const state = this.createStateContext();\n this.loadingTemplateContext = { $implicit: state, state };\n this.errorTemplateContext = { $implicit: state, state };\n }\n\n private createTemplateContext(): ViewerTemplateContext {\n const state = this.createStateContext();\n return { $implicit: state, state };\n }\n\n private createStateContext(): ViewerStateContext {\n return {\n viewer: this.configuredViewer,\n url: this.failedUrl || this.url,\n phase: this.renderPhase,\n errorText: this.displayedErrorText,\n retry: () => this.retryLoad(),\n actionUrl: this.failedUrl || this.url,\n };\n }\n\n private setRenderPhase(phase: ViewerRenderPhase) {\n this.renderPhase = phase;\n this.emitLifecycleIfNeeded();\n }\n\n private emitLifecycleIfNeeded() {\n if (this.lastEmittedPhase === this.renderPhase) {\n return;\n }\n this.lastEmittedPhase = this.renderPhase;\n const state = this.createStateContext();\n this.phaseChange.emit(state);\n if (this.renderPhase === 'loading') {\n this.loading.emit(state);\n }\n if (this.renderPhase === 'error') {\n this.error.emit(state);\n }\n }\n}\n","<div class=\"container\">\n <div *ngIf=\"renderPhase === 'loading'\" class=\"loading-overlay\">\n <ng-container *ngIf=\"loadingTemplate; else defaultLoadingTemplate\">\n <ng-container *ngTemplateOutlet=\"loadingTemplate; context: loadingTemplateContext\"></ng-container>\n </ng-container>\n <ng-template #defaultLoadingTemplate>{{ loadingText }}</ng-template>\n </div>\n <div *ngIf=\"renderPhase === 'error'\" class=\"error-overlay\">\n <ng-container *ngIf=\"errorTemplate; else defaultErrorTemplate\">\n <ng-container *ngTemplateOutlet=\"errorTemplate; context: errorTemplateContext\"></ng-container>\n </ng-container>\n <ng-template #defaultErrorTemplate>\n <div>\n <div>{{ displayedErrorText }}</div>\n <div *ngIf=\"configuredViewer\" style=\"margin-top: 8px; color: #475569;\">\n Viewer: {{ configuredViewer }}\n </div>\n <div *ngIf=\"failedUrl\" style=\"margin-top: 4px; color: #64748b; font-size: 12px; word-break: break-word;\">\n {{ failedUrl }}\n </div>\n <ng-container *ngIf=\"errorActionsTemplate; else defaultErrorActions\">\n <ng-container *ngTemplateOutlet=\"errorActionsTemplate; context: errorTemplateContext\"></ng-container>\n </ng-container>\n <ng-template #defaultErrorActions>\n <div style=\"margin-top: 14px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;\">\n <button\n type=\"button\"\n (click)=\"retryLoad()\"\n style=\"border: 1px solid #fecaca; background: #fff; color: #991b1b; border-radius: 999px; padding: 8px 14px; font: inherit; cursor: pointer;\"\n >\n {{ retryButtonText }}\n </button>\n <a\n *ngIf=\"secondaryActionText && failedUrl\"\n [href]=\"failedUrl\"\n [attr.target]=\"secondaryActionMode === 'open' ? '_blank' : null\"\n [attr.rel]=\"secondaryActionMode === 'open' ? 'noreferrer' : null\"\n [attr.download]=\"secondaryActionMode === 'download' ? '' : null\"\n style=\"border: 1px solid #cbd5e1; background: #fff; color: #334155; border-radius: 999px; padding: 8px 14px; text-decoration: none; font: inherit;\"\n >\n {{ secondaryActionText }}\n </a>\n </div>\n </ng-template>\n </div>\n </ng-template>\n </div>\n\n <ng-container *ngIf=\"!externalViewer\">\n <div *ngIf=\"configuredViewer !== 'pdf'\" class=\"inline-document-shell\">\n <div class=\"inline-document-page\" [innerHTML]=\"docHtml\"></div>\n </div>\n <object\n (load)=\"objectLoaded()\"\n *ngIf=\"fullUrl && configuredViewer === 'pdf'\"\n [data]=\"fullUrl\"\n type=\"application/pdf\"\n width=\"100%\"\n height=\"100%\"\n >\n <p>\n Your browser does not support PDFs.\n <a [href]=\"fullUrl\">Download the PDF</a>.\n </p>\n </object>\n </ng-container>\n\n <button\n *ngIf=\"configuredViewer === 'office' && renderPhase === 'ready'\"\n class=\"office-reload-btn\"\n type=\"button\"\n [attr.title]=\"officeReloadButtonTitle\"\n (click)=\"retryLoad()\"\n >\n <ng-container *ngIf=\"officeReloadTemplate; else defaultOfficeReloadTemplate\">\n <ng-container *ngTemplateOutlet=\"officeReloadTemplate; context: errorTemplateContext\"></ng-container>\n </ng-container>\n <ng-template #defaultOfficeReloadTemplate>{{ officeReloadButtonText }}</ng-template>\n </button>\n\n <ng-container *ngIf=\"externalViewer\">\n <iframe\n (load)=\"iframeLoaded()\"\n *ngIf=\"fullUrl && showIframe && disableContent === 'none'\"\n #iframe\n id=\"iframe-doc-viewer\"\n frameBorder=\"0\"\n [src]=\"fullUrl\"\n ></iframe>\n <div class=\"container\" *ngIf=\"disableContent !== 'none'\">\n <div\n [class.overlay-full]=\"disableContent === 'all'\"\n [class.overlay-popout-google]=\"\n configuredViewer === 'google' &&\n (disableContent === 'popout' || disableContent === 'popout-hide')\n \"\n [class.overlay-popout-office]=\"\n configuredViewer === 'office' &&\n (disableContent === 'popout' || disableContent === 'popout-hide')\n \"\n [style.background-color]=\"\n disableContent === 'popout-hide' ? '#fff' : 'transparent'\n \"\n ></div>\n <iframe\n (load)=\"iframeLoaded()\"\n *ngIf=\"fullUrl && showIframe\"\n #iframe\n id=\"iframe\"\n frameBorder=\"0\"\n [src]=\"fullUrl\"\n ></iframe>\n </div>\n </ng-container>\n</div>\n","import { NgxDocViewerComponent } from './document-viewer.component';\nimport { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\n@NgModule({\n imports: [CommonModule, NgxDocViewerComponent],\n exports: [NgxDocViewerComponent],\n})\nexport class NgxDocViewerModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;MAiOa,qBAAqB,CAAA;AA2DtB,IAAA,YAAA;AACA,IAAA,MAAA;AACA,IAAA,GAAA;AA1DA,IAAA,MAAM,GAAuB,IAAI,YAAY,EAAE;AAC/C,IAAA,OAAO,GAAqC,IAAI,YAAY,EAAE;AAC9D,IAAA,KAAK,GAAqC,IAAI,YAAY,EAAE;AAC5D,IAAA,WAAW,GAAqC,IAAI,YAAY,EAAE;IACnE,GAAG,GAAG,EAAE;IACR,WAAW,GAAG,EAAE;IAChB,SAAS,GAAG,EAAE;IACd,mBAAmB,GAAG,IAAI;IAC1B,eAAe,GAAG,CAAC;IACnB,qBAAqB,GAAG,CAAC;IACzB,cAAc,GAA8C,MAAM;IAClE,wBAAwB,GAAG,IAAI;IAC/B,MAAM,GAAe,QAAQ;IAC7B,iBAAiB,GAAG,EAAE;IACtB,WAAW,GAAG,qBAAqB;IACnC,iBAAiB,GAAG,EAAE;IACtB,eAAe,GAAG,OAAO;IACzB,eAAe,GAAG,KAAK;IACvB,gBAAgB,GAAG,IAAI;IACvB,sBAAsB,GAAG,GAAG;IAC5B,uBAAuB,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src/lib/document-viewer.component.html","../../../../packages/ngx-doc-viewer/src/lib/document-viewer.module.ts","../../../../packages/ngx-doc-viewer/src/ngx-doc-viewer.ts"],"sourcesContent":["import {\n Component,\n Input,\n NgZone,\n OnDestroy,\n OnChanges,\n SimpleChanges,\n Output,\n ViewChildren,\n QueryList,\n ElementRef,\n ChangeDetectorRef,\n ContentChild,\n TemplateRef,\n} from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';\nimport { EventEmitter } from '@angular/core';\nimport {\n getDocxToHtml,\n getViewerDetails,\n getViewerRecoveryPlan,\n googleCheckSubscription,\n iframeIsLoaded,\n isLocalFile,\n replaceLocalUrl,\n IFrameReloader,\n} from 'docviewhelper';\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport type viewerType = 'google' | 'office' | 'mammoth' | 'pdf' | 'url';\ntype ViewerRenderPhase = 'idle' | 'loading' | 'ready' | 'error';\ninterface ViewerTemplateContext {\n $implicit: ViewerStateContext;\n state: ViewerStateContext;\n}\nexport interface ViewerStateContext {\n viewer: viewerType;\n url: string;\n phase: ViewerRenderPhase;\n errorText: string;\n retry: () => void;\n actionUrl: string;\n}\n@Component({\n selector: 'ngx-doc-viewer',\n standalone: true,\n imports: [CommonModule],\n templateUrl: 'document-viewer.component.html',\n styles: [\n `\n :host {\n display: block;\n }\n .container {\n width: 100%;\n height: 100%;\n position: relative;\n }\n .inline-document-shell {\n width: 100%;\n height: 100%;\n overflow: auto;\n background:\n linear-gradient(180deg, #eef2f7 0%, #f8fafc 100%);\n padding: 24px;\n }\n .inline-document-page {\n max-width: 900px;\n min-height: 100%;\n margin: 0 auto;\n background: #fff;\n border: 1px solid #dbe4f0;\n border-radius: 18px;\n box-shadow:\n 0 18px 40px -24px rgba(15, 23, 42, 0.3),\n 0 6px 18px -10px rgba(15, 23, 42, 0.18);\n padding: 40px 48px;\n }\n .inline-document-page,\n .inline-document-page * {\n box-sizing: border-box;\n }\n .inline-document-page {\n color: #1e293b;\n font-family:\n Georgia, Cambria, 'Times New Roman', Times, serif;\n font-size: 18px;\n line-height: 1.7;\n }\n .inline-document-page p,\n .inline-document-page ul,\n .inline-document-page ol,\n .inline-document-page blockquote,\n .inline-document-page table {\n margin: 0 0 1.1em;\n }\n .inline-document-page h1,\n .inline-document-page h2,\n .inline-document-page h3,\n .inline-document-page h4,\n .inline-document-page h5,\n .inline-document-page h6 {\n margin: 1.4em 0 0.65em;\n color: #0f172a;\n line-height: 1.25;\n }\n .inline-document-page h1:first-child,\n .inline-document-page h2:first-child,\n .inline-document-page h3:first-child,\n .inline-document-page p:first-child {\n margin-top: 0;\n }\n .inline-document-page table {\n width: 100%;\n border-collapse: collapse;\n }\n .inline-document-page td,\n .inline-document-page th {\n padding: 6px 10px;\n vertical-align: top;\n }\n .inline-document-page img {\n max-width: 100%;\n height: auto;\n }\n .inline-document-page hr {\n border: 0;\n border-top: 1px solid #dbe4f0;\n margin: 1.5em 0;\n }\n .loading-overlay {\n position: absolute;\n inset: 0;\n z-index: 1001;\n display: flex;\n align-items: center;\n justify-content: center;\n background: rgba(255, 255, 255, 0.88);\n color: #475569;\n font-size: 14px;\n font-weight: 600;\n letter-spacing: 0.02em;\n text-align: center;\n padding: 16px;\n }\n .error-overlay {\n position: absolute;\n inset: 0;\n z-index: 1001;\n display: flex;\n align-items: center;\n justify-content: center;\n background: rgba(255, 255, 255, 0.94);\n color: #991b1b;\n font-size: 14px;\n font-weight: 600;\n letter-spacing: 0.02em;\n text-align: center;\n padding: 16px;\n }\n .overlay-popout-google {\n width: 40px;\n height: 40px;\n right: 26px;\n top: 11.5px;\n position: absolute;\n z-index: 1000;\n }\n .overlay-popout-office {\n width: 100px;\n height: 20px;\n right: 0;\n bottom: 0;\n position: absolute;\n z-index: 1000;\n }\n .office-reload-btn {\n position: absolute;\n top: 8px;\n right: 8px;\n z-index: 1001;\n width: 32px;\n height: 32px;\n border-radius: 50%;\n border: 1px solid rgba(0, 0, 0, 0.12);\n background: rgba(255, 255, 255, 0.85);\n color: #475569;\n font-size: 16px;\n line-height: 1;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0.5;\n transition: opacity 0.15s;\n padding: 0;\n }\n .office-reload-btn:hover {\n opacity: 1;\n }\n .overlay-full {\n width: 100%;\n height: 100%;\n right: 0;\n top: 0;\n position: absolute;\n z-index: 1000;\n }\n iframe {\n width: 100%;\n height: 100%;\n }\n @media (max-width: 768px) {\n .inline-document-shell {\n padding: 12px;\n }\n .inline-document-page {\n border-radius: 12px;\n padding: 22px 18px;\n }\n }\n `,\n ],\n})\nexport class NgxDocViewerComponent\n implements OnChanges, OnDestroy\n{\n @Output() loaded: EventEmitter<void> = new EventEmitter();\n @Output() loading: EventEmitter<ViewerStateContext> = new EventEmitter();\n @Output() error: EventEmitter<ViewerStateContext> = new EventEmitter();\n @Output() phaseChange: EventEmitter<ViewerStateContext> = new EventEmitter();\n @Input() url = '';\n @Input() queryParams = '';\n @Input() viewerUrl = '';\n @Input() googleCheckInterval = 3000;\n @Input() googleMaxChecks = 5;\n @Input() googleFinalRetryDelay = 0;\n @Input() disableContent: 'none' | 'all' | 'popout' | 'popout-hide' = 'none';\n @Input() googleCheckContentLoaded = true;\n @Input() viewer: viewerType = 'google';\n @Input() overrideLocalhost = '';\n @Input() loadingText = 'Loading document...';\n @Input() errorTextOverride = '';\n @Input() retryButtonText = 'Retry';\n @Input() officeAutoRetry = false;\n @Input() officeRetryDelay = 3000;\n @Input() officeReloadButtonText = '↻';\n @Input() officeReloadButtonTitle = 'Reload document';\n @Input() secondaryActionText = '';\n @Input() secondaryActionMode: 'open' | 'download' = 'open';\n @ContentChild('loadingContent', { read: TemplateRef })\n loadingTemplate?: TemplateRef<unknown>;\n @ContentChild('errorContent', { read: TemplateRef })\n errorTemplate?: TemplateRef<unknown>;\n @ContentChild('errorActions', { read: TemplateRef })\n errorActionsTemplate?: TemplateRef<unknown>;\n @ContentChild('officeReloadContent', { read: TemplateRef })\n officeReloadTemplate?: TemplateRef<unknown>;\n @ViewChildren('iframe') iframes?: QueryList<ElementRef> = undefined;\n\n public fullUrl?: SafeResourceUrl = undefined;\n public externalViewer = false;\n public docHtml = '';\n public configuredViewer: viewerType = 'google';\n public showIframe = true;\n public renderPhase: ViewerRenderPhase = 'idle';\n public errorText = '';\n public failedUrl = '';\n public retryNonce = 0;\n public loadingTemplateContext: ViewerTemplateContext = this.createTemplateContext();\n public errorTemplateContext: ViewerTemplateContext = this.createTemplateContext();\n private checkIFrameSubscription?: IFrameReloader = undefined;\n private loadVersion = 0;\n private externalLoadTimeoutId?: number = undefined;\n private googleFinalRetryTimeoutId?: number = undefined;\n private googleFinalRetriedSourceKey?: string = undefined;\n private currentGoogleSourceKey?: string = undefined;\n private officeRetryTimeoutId?: number = undefined;\n private officeAutoRetriedSourceKey?: string = undefined;\n private currentOfficeSourceKey?: string = undefined;\n private lastEmittedPhase?: ViewerRenderPhase = undefined;\n\n constructor(\n private domSanitizer: DomSanitizer,\n private ngZone: NgZone,\n private cdr: ChangeDetectorRef,\n ) {}\n\n ngOnDestroy(): void {\n this.clearExternalLoadTimeout();\n this.clearGoogleFinalRetry();\n this.clearOfficeRetry();\n if (this.checkIFrameSubscription) {\n this.checkIFrameSubscription.unsubscribe();\n }\n }\n\n async ngOnChanges(changes: SimpleChanges): Promise<void> {\n if (\n changes &&\n changes['retryNonce'] &&\n changes['retryNonce'].firstChange\n ) {\n return;\n }\n if (\n changes &&\n changes['viewer'] &&\n (changes['viewer'].firstChange ||\n changes['viewer'].currentValue !== changes['viewer'].previousValue)\n ) {\n if (\n this.viewer !== 'google' &&\n this.viewer !== 'office' &&\n this.viewer !== 'mammoth' &&\n this.viewer !== 'pdf' &&\n this.viewer !== 'url'\n ) {\n console.error(\n `Unsupported viewer: '${this.viewer}'. Supported viewers: google, office, mammoth and pdf`,\n );\n }\n this.configuredViewer = this.viewer;\n this.updateTemplateContexts();\n }\n\n if (\n (changes['url'] &&\n changes['url'].currentValue !== changes['url'].previousValue) ||\n (changes['viewer'] &&\n changes['viewer'].currentValue !== changes['viewer'].previousValue) ||\n (changes['viewerUrl'] &&\n changes['viewerUrl'].currentValue !==\n changes['viewerUrl'].previousValue)\n ) {\n let viewerDetails = getViewerDetails(\n this.url,\n this.configuredViewer,\n this.queryParams,\n this.viewerUrl,\n );\n const loadVersion = ++this.loadVersion;\n this.clearExternalLoadTimeout();\n this.externalViewer = viewerDetails.externalViewer;\n if (\n viewerDetails.externalViewer &&\n this.overrideLocalhost &&\n isLocalFile(this.url)\n ) {\n const newUrl = replaceLocalUrl(this.url, this.overrideLocalhost);\n viewerDetails = getViewerDetails(\n newUrl,\n this.configuredViewer,\n this.queryParams,\n this.viewerUrl,\n );\n }\n const officeSourceKey =\n this.configuredViewer === 'office' ? viewerDetails.url : undefined;\n if (officeSourceKey !== this.currentOfficeSourceKey) {\n this.officeAutoRetriedSourceKey = undefined;\n }\n this.currentOfficeSourceKey = officeSourceKey;\n const googleSourceKey =\n this.configuredViewer === 'google' ? viewerDetails.url : undefined;\n if (googleSourceKey !== this.currentGoogleSourceKey) {\n this.googleFinalRetriedSourceKey = undefined;\n }\n this.currentGoogleSourceKey = googleSourceKey;\n this.docHtml = '';\n this.errorText = '';\n this.failedUrl = this.url;\n this.clearGoogleFinalRetry();\n this.clearOfficeRetry();\n this.updateTemplateContexts();\n if (this.checkIFrameSubscription) {\n this.checkIFrameSubscription.unsubscribe();\n }\n if (!this.url) {\n this.fullUrl = undefined;\n this.showIframe = false;\n this.externalViewer = false;\n this.setRenderPhase('idle');\n this.updateTemplateContexts();\n } else if (\n viewerDetails.externalViewer ||\n this.configuredViewer === 'url' ||\n this.configuredViewer === 'pdf'\n ) {\n this.setRenderPhase('loading');\n const iframeUrl = this.domSanitizer.bypassSecurityTrustResourceUrl(\n viewerDetails.url,\n );\n this.fullUrl = undefined;\n this.showIframe = false;\n this.cdr.detectChanges();\n this.fullUrl = iframeUrl;\n this.showIframe = true;\n this.updateTemplateContexts();\n this.scheduleExternalLoadTimeout(loadVersion);\n this.cdr.detectChanges();\n this.scheduleViewerRecovery();\n } else if (this.configuredViewer === 'mammoth') {\n this.setRenderPhase('loading');\n this.externalViewer = false;\n this.fullUrl = undefined;\n this.showIframe = false;\n try {\n const docHtml = await getDocxToHtml(this.url);\n if (loadVersion !== this.loadVersion) {\n return;\n }\n this.ngZone.run(() => {\n this.docHtml = docHtml;\n this.setRenderPhase('ready');\n this.updateTemplateContexts();\n this.cdr.detectChanges();\n });\n } catch (error) {\n if (loadVersion !== this.loadVersion) {\n return;\n }\n this.ngZone.run(() => {\n this.errorText =\n error instanceof Error ? error.message : 'Unable to load document.';\n this.setRenderPhase('error');\n this.updateTemplateContexts();\n this.cdr.detectChanges();\n });\n }\n }\n }\n }\n\n retryLoad() {\n this.retryNonce += 1;\n const retryVersion = ++this.loadVersion;\n this.clearExternalLoadTimeout();\n this.clearGoogleFinalRetry();\n this.clearOfficeRetry();\n this.errorText = '';\n this.setRenderPhase(this.url ? 'loading' : 'idle');\n this.updateTemplateContexts();\n\n if (!this.url) {\n return;\n }\n\n if (this.configuredViewer === 'mammoth') {\n this.docHtml = '';\n void this.reloadMammoth(retryVersion);\n return;\n }\n\n if (\n this.configuredViewer === 'google' ||\n this.configuredViewer === 'office' ||\n this.configuredViewer === 'url' ||\n this.configuredViewer === 'pdf'\n ) {\n const details = getViewerDetails(\n this.url,\n this.configuredViewer,\n this.queryParams,\n this.viewerUrl,\n );\n const finalUrl =\n details.externalViewer && this.overrideLocalhost && isLocalFile(this.url)\n ? getViewerDetails(\n replaceLocalUrl(this.url, this.overrideLocalhost),\n this.configuredViewer,\n this.queryParams,\n this.viewerUrl,\n ).url\n : details.url;\n\n this.fullUrl = undefined;\n this.showIframe = false;\n this.cdr.detectChanges();\n this.fullUrl =\n this.domSanitizer.bypassSecurityTrustResourceUrl(finalUrl);\n this.showIframe = true;\n this.scheduleExternalLoadTimeout(retryVersion);\n this.scheduleViewerRecovery();\n this.updateTemplateContexts();\n this.cdr.detectChanges();\n }\n }\n\n private reloadIframe(iframe: HTMLIFrameElement) {\n this.checkIFrameSubscription = googleCheckSubscription();\n this.checkIFrameSubscription.subscribe(\n iframe,\n this.googleCheckInterval,\n this.googleMaxChecks,\n );\n }\n\n private scheduleViewerRecovery() {\n const recoveryPlan = getViewerRecoveryPlan({\n viewer: this.configuredViewer,\n googleCheckContentLoaded: this.googleCheckContentLoaded,\n googleFinalRetryDelay: this.googleFinalRetryDelay,\n officeAutoRetry: this.officeAutoRetry,\n });\n for (const mode of recoveryPlan.modes) {\n if (mode === 'google-probe') {\n this.scheduleGoogleRecovery();\n }\n if (mode === 'google-final-retry') {\n continue;\n }\n if (mode === 'office-auto-retry') {\n this.scheduleOfficeRetry();\n }\n }\n }\n\n private scheduleGoogleRecovery() {\n if (\n this.configuredViewer !== 'google' ||\n !this.googleCheckContentLoaded\n ) {\n return;\n }\n // see:\n // https://stackoverflow.com/questions/40414039/google-docs-viewer-returning-204-responses-no-longer-working-alternatives\n // hack to reload iframe if it's not loaded.\n this.ngZone.runOutsideAngular(() => {\n window.setTimeout(() => {\n const iframe = this.iframes?.first?.nativeElement as HTMLIFrameElement;\n if (iframe) {\n this.reloadIframe(iframe);\n }\n }, 0);\n });\n }\n\n iframeLoaded() {\n const iframe = this.iframes?.first?.nativeElement as HTMLIFrameElement;\n if (iframe && iframeIsLoaded(iframe)) {\n this.clearExternalLoadTimeout();\n this.clearGoogleFinalRetry();\n this.clearOfficeRetry();\n this.setRenderPhase('ready');\n this.updateTemplateContexts();\n this.loaded.emit(undefined);\n if (this.checkIFrameSubscription) {\n this.checkIFrameSubscription.unsubscribe();\n }\n }\n }\n\n objectLoaded() {\n this.clearExternalLoadTimeout();\n this.clearGoogleFinalRetry();\n this.clearOfficeRetry();\n this.setRenderPhase('ready');\n this.updateTemplateContexts();\n }\n\n private async reloadMammoth(loadVersion: number) {\n this.externalViewer = false;\n this.fullUrl = undefined;\n this.showIframe = false;\n try {\n const docHtml = await getDocxToHtml(this.url);\n if (loadVersion !== this.loadVersion) {\n return;\n }\n this.ngZone.run(() => {\n this.docHtml = docHtml;\n this.setRenderPhase('ready');\n this.updateTemplateContexts();\n this.cdr.detectChanges();\n });\n } catch (error) {\n if (loadVersion !== this.loadVersion) {\n return;\n }\n this.ngZone.run(() => {\n this.errorText =\n error instanceof Error ? error.message : 'Unable to load document.';\n this.setRenderPhase('error');\n this.updateTemplateContexts();\n this.cdr.detectChanges();\n });\n }\n }\n\n private scheduleExternalLoadTimeout(loadVersion: number) {\n this.clearExternalLoadTimeout();\n const timeoutMs =\n this.configuredViewer === 'google'\n ? Math.max(this.googleCheckInterval * this.googleMaxChecks + 2000, 15000)\n : 15000;\n this.externalLoadTimeoutId = window.setTimeout(() => {\n if (loadVersion !== this.loadVersion || this.renderPhase !== 'loading') {\n return;\n }\n if (this.scheduleGoogleFinalRetry()) {\n return;\n }\n this.ngZone.run(() => {\n this.errorText = `The ${this.configuredViewer} viewer did not finish loading in time.`;\n this.setRenderPhase('error');\n this.updateTemplateContexts();\n this.cdr.detectChanges();\n });\n }, timeoutMs);\n }\n\n private clearExternalLoadTimeout() {\n if (this.externalLoadTimeoutId) {\n window.clearTimeout(this.externalLoadTimeoutId);\n this.externalLoadTimeoutId = undefined;\n }\n }\n\n private clearGoogleFinalRetry() {\n if (this.googleFinalRetryTimeoutId) {\n window.clearTimeout(this.googleFinalRetryTimeoutId);\n this.googleFinalRetryTimeoutId = undefined;\n }\n }\n\n private clearOfficeRetry() {\n if (this.officeRetryTimeoutId) {\n window.clearTimeout(this.officeRetryTimeoutId);\n this.officeRetryTimeoutId = undefined;\n }\n }\n\n private scheduleOfficeRetry() {\n if (\n this.configuredViewer !== 'office' ||\n !this.officeAutoRetry ||\n !this.currentOfficeSourceKey ||\n this.officeAutoRetriedSourceKey === this.currentOfficeSourceKey\n ) {\n return;\n }\n this.clearOfficeRetry();\n this.officeRetryTimeoutId = window.setTimeout(() => {\n if (\n !this.currentOfficeSourceKey ||\n this.officeAutoRetriedSourceKey === this.currentOfficeSourceKey\n ) {\n return;\n }\n this.officeAutoRetriedSourceKey = this.currentOfficeSourceKey;\n this.ngZone.run(() => this.retryLoad());\n }, this.officeRetryDelay);\n }\n\n private scheduleGoogleFinalRetry() {\n const recoveryPlan = getViewerRecoveryPlan({\n viewer: this.configuredViewer,\n googleCheckContentLoaded: this.googleCheckContentLoaded,\n googleFinalRetryDelay: this.googleFinalRetryDelay,\n officeAutoRetry: this.officeAutoRetry,\n });\n if (\n !recoveryPlan.modes.includes('google-final-retry') ||\n !this.currentGoogleSourceKey ||\n this.googleFinalRetriedSourceKey === this.currentGoogleSourceKey\n ) {\n return false;\n }\n this.clearGoogleFinalRetry();\n this.googleFinalRetryTimeoutId = window.setTimeout(() => {\n if (\n !this.currentGoogleSourceKey ||\n this.googleFinalRetriedSourceKey === this.currentGoogleSourceKey\n ) {\n return;\n }\n this.googleFinalRetriedSourceKey = this.currentGoogleSourceKey;\n this.ngZone.run(() => this.retryLoad());\n }, this.googleFinalRetryDelay);\n return true;\n }\n\n get displayedErrorText() {\n return this.errorTextOverride || this.errorText || 'Unable to load document.';\n }\n\n private updateTemplateContexts() {\n const state = this.createStateContext();\n this.loadingTemplateContext = { $implicit: state, state };\n this.errorTemplateContext = { $implicit: state, state };\n }\n\n private createTemplateContext(): ViewerTemplateContext {\n const state = this.createStateContext();\n return { $implicit: state, state };\n }\n\n private createStateContext(): ViewerStateContext {\n return {\n viewer: this.configuredViewer,\n url: this.failedUrl || this.url,\n phase: this.renderPhase,\n errorText: this.displayedErrorText,\n retry: () => this.retryLoad(),\n actionUrl: this.failedUrl || this.url,\n };\n }\n\n private setRenderPhase(phase: ViewerRenderPhase) {\n this.renderPhase = phase;\n this.emitLifecycleIfNeeded();\n }\n\n private emitLifecycleIfNeeded() {\n if (this.lastEmittedPhase === this.renderPhase) {\n return;\n }\n this.lastEmittedPhase = this.renderPhase;\n const state = this.createStateContext();\n this.phaseChange.emit(state);\n if (this.renderPhase === 'loading') {\n this.loading.emit(state);\n }\n if (this.renderPhase === 'error') {\n this.error.emit(state);\n }\n }\n}\n","<div class=\"container\">\n <div *ngIf=\"renderPhase === 'loading'\" class=\"loading-overlay\">\n <ng-container *ngIf=\"loadingTemplate; else defaultLoadingTemplate\">\n <ng-container *ngTemplateOutlet=\"loadingTemplate; context: loadingTemplateContext\"></ng-container>\n </ng-container>\n <ng-template #defaultLoadingTemplate>{{ loadingText }}</ng-template>\n </div>\n <div *ngIf=\"renderPhase === 'error'\" class=\"error-overlay\">\n <ng-container *ngIf=\"errorTemplate; else defaultErrorTemplate\">\n <ng-container *ngTemplateOutlet=\"errorTemplate; context: errorTemplateContext\"></ng-container>\n </ng-container>\n <ng-template #defaultErrorTemplate>\n <div>\n <div>{{ displayedErrorText }}</div>\n <div *ngIf=\"configuredViewer\" style=\"margin-top: 8px; color: #475569;\">\n Viewer: {{ configuredViewer }}\n </div>\n <div *ngIf=\"failedUrl\" style=\"margin-top: 4px; color: #64748b; font-size: 12px; word-break: break-word;\">\n {{ failedUrl }}\n </div>\n <ng-container *ngIf=\"errorActionsTemplate; else defaultErrorActions\">\n <ng-container *ngTemplateOutlet=\"errorActionsTemplate; context: errorTemplateContext\"></ng-container>\n </ng-container>\n <ng-template #defaultErrorActions>\n <div style=\"margin-top: 14px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;\">\n <button\n type=\"button\"\n (click)=\"retryLoad()\"\n style=\"border: 1px solid #fecaca; background: #fff; color: #991b1b; border-radius: 999px; padding: 8px 14px; font: inherit; cursor: pointer;\"\n >\n {{ retryButtonText }}\n </button>\n <a\n *ngIf=\"secondaryActionText && failedUrl\"\n [href]=\"failedUrl\"\n [attr.target]=\"secondaryActionMode === 'open' ? '_blank' : null\"\n [attr.rel]=\"secondaryActionMode === 'open' ? 'noreferrer' : null\"\n [attr.download]=\"secondaryActionMode === 'download' ? '' : null\"\n style=\"border: 1px solid #cbd5e1; background: #fff; color: #334155; border-radius: 999px; padding: 8px 14px; text-decoration: none; font: inherit;\"\n >\n {{ secondaryActionText }}\n </a>\n </div>\n </ng-template>\n </div>\n </ng-template>\n </div>\n\n <ng-container *ngIf=\"!externalViewer\">\n <div *ngIf=\"configuredViewer !== 'pdf'\" class=\"inline-document-shell\">\n <div class=\"inline-document-page\" [innerHTML]=\"docHtml\"></div>\n </div>\n <object\n (load)=\"objectLoaded()\"\n *ngIf=\"fullUrl && configuredViewer === 'pdf'\"\n [data]=\"fullUrl\"\n type=\"application/pdf\"\n width=\"100%\"\n height=\"100%\"\n >\n <p>\n Your browser does not support PDFs.\n <a [href]=\"fullUrl\">Download the PDF</a>.\n </p>\n </object>\n </ng-container>\n\n <button\n *ngIf=\"configuredViewer === 'office' && renderPhase === 'ready'\"\n class=\"office-reload-btn\"\n type=\"button\"\n [attr.title]=\"officeReloadButtonTitle\"\n (click)=\"retryLoad()\"\n >\n <ng-container *ngIf=\"officeReloadTemplate; else defaultOfficeReloadTemplate\">\n <ng-container *ngTemplateOutlet=\"officeReloadTemplate; context: errorTemplateContext\"></ng-container>\n </ng-container>\n <ng-template #defaultOfficeReloadTemplate>{{ officeReloadButtonText }}</ng-template>\n </button>\n\n <ng-container *ngIf=\"externalViewer\">\n <iframe\n (load)=\"iframeLoaded()\"\n *ngIf=\"fullUrl && showIframe && disableContent === 'none'\"\n #iframe\n id=\"iframe-doc-viewer\"\n frameBorder=\"0\"\n allow=\"clipboard-read; clipboard-write\"\n [src]=\"fullUrl\"\n ></iframe>\n <div class=\"container\" *ngIf=\"disableContent !== 'none'\">\n <div\n [class.overlay-full]=\"disableContent === 'all'\"\n [class.overlay-popout-google]=\"\n configuredViewer === 'google' &&\n (disableContent === 'popout' || disableContent === 'popout-hide')\n \"\n [class.overlay-popout-office]=\"\n configuredViewer === 'office' &&\n (disableContent === 'popout' || disableContent === 'popout-hide')\n \"\n [style.background-color]=\"\n disableContent === 'popout-hide' ? '#fff' : 'transparent'\n \"\n ></div>\n <iframe\n (load)=\"iframeLoaded()\"\n *ngIf=\"fullUrl && showIframe\"\n #iframe\n id=\"iframe\"\n frameBorder=\"0\"\n allow=\"clipboard-read; clipboard-write\"\n [src]=\"fullUrl\"\n ></iframe>\n </div>\n </ng-container>\n</div>\n","import { NgxDocViewerComponent } from './document-viewer.component';\nimport { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\n@NgModule({\n imports: [CommonModule, NgxDocViewerComponent],\n exports: [NgxDocViewerComponent],\n})\nexport class NgxDocViewerModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;MAiOa,qBAAqB,CAAA;AA2DtB,IAAA,YAAA;AACA,IAAA,MAAA;AACA,IAAA,GAAA;AA1DA,IAAA,MAAM,GAAuB,IAAI,YAAY,EAAE;AAC/C,IAAA,OAAO,GAAqC,IAAI,YAAY,EAAE;AAC9D,IAAA,KAAK,GAAqC,IAAI,YAAY,EAAE;AAC5D,IAAA,WAAW,GAAqC,IAAI,YAAY,EAAE;IACnE,GAAG,GAAG,EAAE;IACR,WAAW,GAAG,EAAE;IAChB,SAAS,GAAG,EAAE;IACd,mBAAmB,GAAG,IAAI;IAC1B,eAAe,GAAG,CAAC;IACnB,qBAAqB,GAAG,CAAC;IACzB,cAAc,GAA8C,MAAM;IAClE,wBAAwB,GAAG,IAAI;IAC/B,MAAM,GAAe,QAAQ;IAC7B,iBAAiB,GAAG,EAAE;IACtB,WAAW,GAAG,qBAAqB;IACnC,iBAAiB,GAAG,EAAE;IACtB,eAAe,GAAG,OAAO;IACzB,eAAe,GAAG,KAAK;IACvB,gBAAgB,GAAG,IAAI;IACvB,sBAAsB,GAAG,GAAG;IAC5B,uBAAuB,GAAG,iBAAiB;IAC3C,mBAAmB,GAAG,EAAE;IACxB,mBAAmB,GAAwB,MAAM;AAE1D,IAAA,eAAe;AAEf,IAAA,aAAa;AAEb,IAAA,oBAAoB;AAEpB,IAAA,oBAAoB;IACI,OAAO,GAA2B,SAAS;IAE5D,O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Y;AAAC,gBAAA,IAAA,EAAA,CAAA,cAAc,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;;sBAElD,YAAY;AAAC,gBAAA,IAAA,EAAA,CAAA,cAAc,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;;sBAElD,YAAY;AAAC,gBAAA,IAAA,EAAA,CAAA,qBAAqB,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;;sBAEzD,YAAY;uBAAC,QAAQ;;;ME3PX,kBAAkB,CAAA;uGAAlB,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;AAAlB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,EAAA,OAAA,EAAA,CAHnB,YAAY,EAAE,qBAAqB,aACnC,qBAAqB,CAAA,EAAA,CAAA;wGAEpB,kBAAkB,EAAA,OAAA,EAAA,CAHnB,YAAY,EAAE,qBAAqB,CAAA,EAAA,CAAA;;2FAGlC,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAJ9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,qBAAqB,CAAC;oBAC9C,OAAO,EAAE,CAAC,qBAAqB,CAAC;AACjC,iBAAA;;;ACPD;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngx-doc-viewer",
3
- "version": "21.0.0",
3
+ "version": "21.0.1",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "description": "Angular document viewer.",
@@ -26,6 +26,6 @@
26
26
  "@angular/common": ">= 15.0.0"
27
27
  },
28
28
  "dependencies": {
29
- "docviewhelper": "0.1.0"
29
+ "docviewhelper": "0.1.1"
30
30
  }
31
31
  }