Happy Addons for Elementor (Mega Menu, Post Grid, Woocommerce Product Grid, Table, Event Calendar, Slider Elementor Widget) - Version 3.3.3

Version Description

  • 12 December 2021 =

  • Fix: Social icon missing for viber

  • Tweak: Pdf view add support for page selection

Download this release

Release Info

Developer thehappymonster
Plugin Icon 128x128 Happy Addons for Elementor (Mega Menu, Post Grid, Woocommerce Product Grid, Table, Event Calendar, Slider Elementor Widget)
Version 3.3.3
Comparing to
See all releases

Code changes from version 3.3.2 to 3.3.3

Files changed (69) hide show
  1. assets/css/main.css +1 -1
  2. assets/css/main.min.css +1 -1
  3. assets/css/widgets/pdf.min.css +1 -1
  4. assets/js/happy-addons.js +12 -40
  5. assets/js/happy-addons.min.js +12 -40
  6. assets/vendor/pdfjs/mozila/LICENSE +0 -177
  7. assets/vendor/pdfjs/mozila/web/images/annotation-check.svg +0 -11
  8. assets/vendor/pdfjs/mozila/web/images/annotation-comment.svg +0 -16
  9. assets/vendor/pdfjs/mozila/web/images/annotation-help.svg +0 -26
  10. assets/vendor/pdfjs/mozila/web/images/annotation-insert.svg +0 -10
  11. assets/vendor/pdfjs/mozila/web/images/annotation-key.svg +0 -11
  12. assets/vendor/pdfjs/mozila/web/images/annotation-newparagraph.svg +0 -11
  13. assets/vendor/pdfjs/mozila/web/images/annotation-noicon.svg +0 -7
  14. assets/vendor/pdfjs/mozila/web/images/annotation-note.svg +0 -42
  15. assets/vendor/pdfjs/mozila/web/images/annotation-paragraph.svg +0 -16
  16. assets/vendor/pdfjs/mozila/web/images/findbarButton-next.svg +0 -4
  17. assets/vendor/pdfjs/mozila/web/images/findbarButton-previous.svg +0 -4
  18. assets/vendor/pdfjs/mozila/web/images/grab.cur +0 -0
  19. assets/vendor/pdfjs/mozila/web/images/grabbing.cur +0 -0
  20. assets/vendor/pdfjs/mozila/web/images/loading-dark.svg +0 -24
  21. assets/vendor/pdfjs/mozila/web/images/loading-icon.gif +0 -0
  22. assets/vendor/pdfjs/mozila/web/images/loading.svg +0 -1
  23. assets/vendor/pdfjs/mozila/web/images/secondaryToolbarButton-documentProperties.svg +0 -15
  24. assets/vendor/pdfjs/mozila/web/images/secondaryToolbarButton-firstPage.svg +0 -1
  25. assets/vendor/pdfjs/mozila/web/images/secondaryToolbarButton-handTool.svg +0 -1
  26. assets/vendor/pdfjs/mozila/web/images/secondaryToolbarButton-lastPage.svg +0 -1
  27. assets/vendor/pdfjs/mozila/web/images/secondaryToolbarButton-rotateCcw.svg +0 -1
  28. assets/vendor/pdfjs/mozila/web/images/secondaryToolbarButton-rotateCw.svg +0 -4
  29. assets/vendor/pdfjs/mozila/web/images/secondaryToolbarButton-scrollHorizontal.svg +0 -1
  30. assets/vendor/pdfjs/mozila/web/images/secondaryToolbarButton-scrollVertical.svg +0 -1
  31. assets/vendor/pdfjs/mozila/web/images/secondaryToolbarButton-scrollWrapped.svg +0 -1
  32. assets/vendor/pdfjs/mozila/web/images/secondaryToolbarButton-selectTool.svg +0 -4
  33. assets/vendor/pdfjs/mozila/web/images/secondaryToolbarButton-spreadEven.svg +0 -1
  34. assets/vendor/pdfjs/mozila/web/images/secondaryToolbarButton-spreadNone.svg +0 -1
  35. assets/vendor/pdfjs/mozila/web/images/secondaryToolbarButton-spreadOdd.svg +0 -1
  36. assets/vendor/pdfjs/mozila/web/images/shadow.png +0 -0
  37. assets/vendor/pdfjs/mozila/web/images/toolbarButton-bookmark.svg +0 -1
  38. assets/vendor/pdfjs/mozila/web/images/toolbarButton-currentOutlineItem.svg +0 -1
  39. assets/vendor/pdfjs/mozila/web/images/toolbarButton-download.svg +0 -4
  40. assets/vendor/pdfjs/mozila/web/images/toolbarButton-menuArrow.svg +0 -1
  41. assets/vendor/pdfjs/mozila/web/images/toolbarButton-openFile.svg +0 -4
  42. assets/vendor/pdfjs/mozila/web/images/toolbarButton-pageDown.svg +0 -7
  43. assets/vendor/pdfjs/mozila/web/images/toolbarButton-pageUp.svg +0 -12
  44. assets/vendor/pdfjs/mozila/web/images/toolbarButton-presentationMode.svg +0 -1
  45. assets/vendor/pdfjs/mozila/web/images/toolbarButton-print.svg +0 -4
  46. assets/vendor/pdfjs/mozila/web/images/toolbarButton-search.svg +0 -4
  47. assets/vendor/pdfjs/mozila/web/images/toolbarButton-secondaryToolbarToggle.svg +0 -4
  48. assets/vendor/pdfjs/mozila/web/images/toolbarButton-sidebarToggle.svg +0 -4
  49. assets/vendor/pdfjs/mozila/web/images/toolbarButton-viewAttachments.svg +0 -1
  50. assets/vendor/pdfjs/mozila/web/images/toolbarButton-viewLayers.svg +0 -1
  51. assets/vendor/pdfjs/mozila/web/images/toolbarButton-viewOutline.svg +0 -1
  52. assets/vendor/pdfjs/mozila/web/images/toolbarButton-viewThumbnail.svg +0 -4
  53. assets/vendor/pdfjs/mozila/web/images/toolbarButton-zoomIn.svg +0 -4
  54. assets/vendor/pdfjs/mozila/web/images/toolbarButton-zoomOut.svg +0 -4
  55. assets/vendor/pdfjs/mozila/web/images/treeitem-collapsed.svg +0 -1
  56. assets/vendor/pdfjs/mozila/web/images/treeitem-expanded.svg +0 -1
  57. assets/vendor/pdfjs/mozila/web/viewer.css +0 -2665
  58. assets/vendor/pdfjs/mozila/web/viewer.html +0 -398
  59. assets/vendor/pdfjs/mozila/web/viewer.js +0 -15406
  60. changelog.txt +7 -2
  61. classes/assets-manager.php +3 -10
  62. classes/extensions-manager.php +1 -1
  63. classes/widgets-manager.php +1 -1
  64. plugin.php +3 -3
  65. readme.txt +32 -25
  66. widgets/image-grid/widget.php +15 -0
  67. widgets/justified-gallery/widget.php +15 -0
  68. widgets/pdf-view/widget.php +56 -119
  69. widgets/social-share/widget.php +5 -4
assets/css/main.css CHANGED
@@ -26,7 +26,7 @@
26
  .ha-member>.elementor-widget-container{padding:25px;border-radius:5px;background-color:#fff;box-shadow:0 3px 40px rgba(36,36,36,.1)}.ha-member-figure{position:relative;display:inline-block;margin:0 0 25px!important}.ha-member-figure img{width:100%;height:100%;vertical-align:bottom;-o-object-fit:cover;object-fit:cover}.ha-member.ha-member-hover-image-on .ha-member-figure img:nth-of-type(2){position:absolute;top:0;left:0;z-index:-1;opacity:0}.ha-member.ha-member-hover-image-on .ha-member-figure:hover img:nth-of-type(1){z-index:-1;opacity:0}.ha-member.ha-member-hover-image-on .ha-member-figure:hover img:nth-of-type(2){z-index:2;opacity:1}.ha-member-name{margin-top:0;margin-bottom:10px;color:#151515;font-size:18px}.ha-member-position{margin-bottom:25px;color:#7f7f7f;font-size:14px}.ha-member-bio{margin-bottom:25px;font-size:14px;line-height:1.6}.ha-member-links>a{display:inline-block;color:#9895ad;text-align:center;line-height:1;-webkit-transition:all .2s;transition:all .2s}.ha-member-links>a:focus,.ha-member-links>a:hover{color:#222}.ha-member-links>a>i{width:1em;height:1em}.ha-member-links>a:not(:last-child){margin-right:10px}.ha-member .ha-btn{margin-bottom:15px;cursor:pointer}.ha-member-body .ha-btn:last-child{margin-top:15px;margin-bottom:0}.ha-member-lightbox{position:fixed;top:0;left:0;z-index:-999999;display:none;visibility:hidden;width:0;height:0}.ha-member-lightbox.ha-member-lightbox-show{z-index:999999;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;visibility:visible;overflow:auto;-webkit-box-align:start;-webkit-align-items:flex-start;align-items:flex-start;-ms-flex-align:start;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;width:100%;height:100%;background-color:rgba(0,0,0,.6)}.ha-member-lightbox.ha-member-lightbox-show .ha-member-lightbox-close{position:absolute;z-index:99999;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;color:#9ec8f0;font-size:30px;cursor:pointer;-webkit-transition:-webkit-transform .3s;transition:transform .3s,-webkit-transform .3s;transition:transform .3s;-webkit-transition-delay:.5s;transition-delay:.5s;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.ha-member-lightbox.ha-member-lightbox-show .ha-member-lightbox-inner{width:100%;-webkit-animation-name:ha-member-lightbox-zoomIn;animation-name:ha-member-lightbox-zoomIn;-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-fill-mode:both;animation-fill-mode:both}@-webkit-keyframes ha-member-lightbox-zoomIn{0%{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes ha-member-lightbox-zoomIn{0%{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}50%{opacity:1}}
27
  .ha-news-ticker-wrapper{position:relative;overflow:hidden;padding:20px 0;border:1px solid #d2d2d2;border-radius:5px}.ha-news-ticker-wrapper ul.ha-news-ticker-container{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin:0;padding:0;list-style:none}.ha-news-ticker-wrapper ul.ha-news-ticker-container:focus,.ha-news-ticker-wrapper ul.ha-news-ticker-container:hover{-webkit-animation-play-state:paused!important;animation-play-state:paused!important}.ha-news-ticker-wrapper span.ha-news-ticker-sticky-title{position:absolute;top:50%;left:auto;z-index:1;padding:20px;background:#333;color:#fff;font-size:1rem;line-height:1;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%)}.ha-news-ticker-wrapper li.ha-news-ticker-item{margin-right:20px;white-space:nowrap}.ha-news-ticker-wrapper li.ha-news-ticker-item:last-child{margin-right:0}.ha-news-ticker-wrapper .ha-news-ticker-title{margin:0;font-size:1rem;line-height:1}.ha-news-ticker-wrapper li.ha-news-ticker-item a{color:#242424}.ha-news-ticker-wrapper li.ha-news-ticker-item a:hover{color:#e04c8a}
28
  .ha-number-body{position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;overflow:hidden;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-ms-flex-align:center;padding:6px;width:50px;height:50px;border-radius:100%;background-color:#562dd4;color:#fff;text-align:center;font-size:20px}.ha-number-overlay{position:absolute;top:0;left:0;width:100%;height:100%}.ha-number-text{position:relative;z-index:1;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}
29
- .pdf_viewer_options{-webkit-align-content:center;-ms-flex-line-pack:center;align-content:center;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-justify-content:space-between;justify-content:space-between}.ha-title-flex,.pdf-icon,.pdf_viewer_options{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-ms-flex-align:center}.ha-title-flex{-webkit-align-content:center;-ms-flex-line-pack:center;align-content:center;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-pack:start;-ms-flex-pack:start;-webkit-justify-content:flex-start;justify-content:flex-start}.pdf-icon{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center}.ha-title-flex h2{margin-bottom:5px}.pdf-button a{padding:15px 25px;border-radius:5px;background-color:#562dd4;color:#fff}
30
  .ha-post-list{margin:0;padding:0;list-style:none}.ha-post-list .ha-post-list-item,.ha-post-list.ha-post-list-inline{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.ha-post-list.ha-post-list-inline{-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap}.ha-post-list .ha-post-list-item{margin:0 0 10px;padding:0}.ha-post-list.ha-post-list-inline .ha-post-list-item{margin-right:21px}.ha-post-list .ha-post-list-item:last-child,.ha-post-list.ha-post-list-inline .ha-post-list-item:last-child{margin-right:0;margin-bottom:0}.ha-post-list .ha-post-list-item a,.ha-post-list-meta-wrap{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.ha-post-list .ha-post-list-item a{width:100%}.ha-post-list-title{display:block;margin-top:0;margin-bottom:0;color:#242424;font-size:1rem;-webkit-transition:all .4s;transition:all .4s}.ha-post-list .ha-post-list-item a:hover .ha-post-list-title{color:#e04d8b}.ha-post-list-item a img{margin-right:15px;-o-object-fit:cover;object-fit:cover}span.ha-post-list-icon{margin-right:8px;color:#242424;font-size:14px}span.ha-post-list-icon svg{width:auto;height:1em;fill:currentColor}.ha-post-list-meta-wrap{margin-top:3px}.ha-post-list-meta-wrap span{margin-right:10px;color:#8c8c8c;font-size:13px}.ha-post-list-meta-wrap span:last-child{margin-right:0}.ha-post-list-meta-wrap span i{margin-right:3px}.ha-post-list-excerpt p{margin-bottom:0;color:#8c8c8c}
31
  .ha-post-tab .ha-post-tab-filter{padding:0;border-bottom:1px solid #ddd;list-style:none}.ha-post-tab .ha-post-tab-filter li{display:inline-block;margin:0 5px 0 0;padding:15px 25px;background:#fff;color:#333;text-decoration:none;-webkit-transition:all .3s;transition:all .3s}.ha-post-tab .ha-post-tab-filter li.active,.ha-post-tab .ha-post-tab-filter li:hover,.ha-post-tab.ha-post-tab-left .ha-post-tab-filter li.active,.ha-post-tab.ha-post-tab-left .ha-post-tab-filter li:hover{background:#6d39ef;color:#fff;cursor:pointer}.ha-post-tab .ha-post-tab-item-wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;visibility:hidden;overflow:hidden;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;height:0;opacity:0}.ha-post-tab span.ha-post-tab-loading{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;width:100%;height:100%;text-align:center;font-size:60px;opacity:.5}.ha-post-tab .ha-post-tab-item-wrapper.active{visibility:visible;height:auto;opacity:1}.ha-post-tab .ha-post-tab-item{margin-bottom:30px;padding-right:15px;padding-left:15px}.ha-post-tab .ha-post-tab-item-inner{box-sizing:border-box;padding:20px;height:100%;border-radius:5px;background:#fff;box-shadow:0 1px 20px rgba(0,0,0,.09)}.ha-post-tab .ha-post-tab-item-inner .ha-post-tab-thumb{position:relative;display:block;overflow:hidden;margin-bottom:15px;padding-right:0;padding-left:0}.ha-post-tab .ha-post-tab-item-inner .ha-post-tab-thumb img{max-width:100%;height:auto;-o-object-fit:cover;object-fit:cover}.ha-post-tab .ha-post-tab-item-inner .ha-post-tab-title{display:block;margin-top:0;margin-bottom:10px;font-size:16px}.ha-post-tab .ha-post-tab-item-inner .ha-post-tab-title a,.ha-post-tab .ha-post-tab-meta span a{color:#333;text-decoration:none;-webkit-transition:all .4s;transition:all .4s}.ha-post-tab .ha-post-tab-meta span a:hover,.ha-post-tab .ha-post-tab-title a:hover{color:#6d39ef}.ha-post-tab .ha-post-tab-meta{font-size:14px}.ha-post-tab .ha-post-tab-meta span{display:inline-block;margin-top:10px;margin-right:15px;color:#9b9b9b;-webkit-transition:all .4s;transition:all .4s}.ha-post-tab .ha-post-tab-meta span i{padding-right:5px}.ha-post-tab .ha-post-tab-meta span a{color:#9b9b9b}.ha-post-tab .ha-post-tab-excerpt p{margin:0}.ha-post-tab.ha-post-tab-left,.ha-post-tab.ha-post-tab-right{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap}.ha-post-tab.ha-post-tab-left .ha-post-tab-filter{-webkit-box-flex:0;-webkit-flex:0 0 200px;-ms-flex:0 0 200px;flex:0 0 200px;min-width:200px;border-right:1px solid #f1f1f1;border-bottom:none}.ha-post-tab.ha-post-tab-left .ha-post-tab-filter li,.ha-post-tab.ha-post-tab-right .ha-post-tab-filter li{text-align:left;display:block;margin:0;text-decoration:none;-webkit-transition:all .3s;transition:all .3s}.ha-post-tab.ha-post-tab-right .ha-post-tab-filter li{text-align:right}.ha-post-tab.ha-post-tab-left .ha-post-tab-content{-webkit-box-flex:0;-webkit-flex:0 0 calc(100% - 200px);-ms-flex:0 0 calc(100% - 200px);flex:0 0 calc(100% - 200px);min-width:calc(100% - 200px);min-height:100%}.ha-post-tab.ha-post-tab-right{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-webkit-flex-direction:row-reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.ha-post-tab.ha-post-tab-right .ha-post-tab-filter{-webkit-box-flex:0;-webkit-flex:0 0 200px;-ms-flex:0 0 200px;flex:0 0 200px;min-width:200px;border-bottom:none;border-left:1px solid #f1f1f1}.ha-post-tab.ha-post-tab-right .ha-post-tab-content{-webkit-box-flex:0;-webkit-flex:0 0 calc(100% - 200px);-ms-flex:0 0 calc(100% - 200px);flex:0 0 calc(100% - 200px);min-width:calc(100% - 200px);min-height:100%}@media (max-width:767px){.ha-post-tab.ha-post-tab-right{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-webkit-flex-direction:row-reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.ha-post-tab.ha-post-tab-left .ha-post-tab-filter,.ha-post-tab.ha-post-tab-right .ha-post-tab-filter{-webkit-box-flex:0;-webkit-flex:0 0 100%;-ms-flex:0 0 100%;flex:0 0 100%;min-width:100%;border-right:0;border-bottom:1px solid #f1f1f1;border-left:0}.ha-post-tab.ha-post-tab-left .ha-post-tab-content,.ha-post-tab.ha-post-tab-right .ha-post-tab-content{-webkit-box-flex:0;-webkit-flex:0 0 100%;-ms-flex:0 0 100%;flex:0 0 100%;min-width:100%;min-height:100%}.ha-post-tab.ha-post-tab-left .ha-post-tab-filter li,.ha-post-tab.ha-post-tab-right .ha-post-tab-filter li{display:inline-block}}
32
  .ha-pricing-table>.elementor-widget-container{position:relative;overflow:hidden;padding:3em 4em;border-radius:5px;background-color:#fff;box-shadow:0 3px 40px rgba(36,36,36,.1)}.ha-pricing-table-badge{position:absolute;top:-1px;padding:.8rem 1rem;background-color:#e2498a;color:#fff;line-height:1}.ha-pricing-table-badge--left{left:0;-webkit-transform:rotate(-90deg) translateX(-100%);-ms-transform:rotate(-90deg) translateX(-100%);transform:rotate(-90deg) translateX(-100%);-webkit-transform-origin:left top;-ms-transform-origin:left top;transform-origin:left top}.ha-pricing-table-badge--right{right:0;-webkit-transform:rotate(-90deg) translateY(-100%);-ms-transform:rotate(-90deg) translateY(-100%);transform:rotate(-90deg) translateY(-100%);-webkit-transform-origin:right top;-ms-transform-origin:right top;transform-origin:right top}.ha-pricing-table-title{margin-top:0;margin-bottom:.5rem;color:#242424;font-weight:400;font-size:24px}.ha-pricing-table-price{margin-bottom:3rem}.ha-pricing-table-price-tag{margin-bottom:.5rem;color:#242424;font-weight:700;font-size:60px;line-height:normal}.ha-pricing-table-currency{font-size:24px}.ha-pricing-table-period{color:#8c8c8c;font-size:16px}.ha-pricing-table-body{margin-bottom:3rem}.ha-pricing-table-features-title{margin-top:0;margin-bottom:1rem;font-weight:700;font-size:16px}.ha-pricing-table-features-list{margin:0;padding:0;list-style:none}.ha-pricing-table-features-list li{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:baseline;-webkit-align-items:baseline;align-items:baseline;-ms-flex-align:baseline;margin-bottom:1rem;font-size:16px}.ha-pricing-table-features-list li>i,.ha-pricing-table-features-list li>svg{margin-right:.5rem;min-width:15px;text-align:center;font-size:.8em}.ha-pricing-table-features-list li>svg{width:auto;height:1em;fill:currentColor}.ha-pricing-table-feature-text{display:inline-block}.ha-pricing-table-btn{display:inline-block;padding:.8rem 2rem;border-radius:40px;background-color:#e2498a;color:#fff;text-decoration:none;text-transform:uppercase;font-size:12px;-webkit-transition:all .3s;transition:all .3s}.ha-pricing-table-btn:hover{background-color:#562dd4;color:#fff}
26
  .ha-member>.elementor-widget-container{padding:25px;border-radius:5px;background-color:#fff;box-shadow:0 3px 40px rgba(36,36,36,.1)}.ha-member-figure{position:relative;display:inline-block;margin:0 0 25px!important}.ha-member-figure img{width:100%;height:100%;vertical-align:bottom;-o-object-fit:cover;object-fit:cover}.ha-member.ha-member-hover-image-on .ha-member-figure img:nth-of-type(2){position:absolute;top:0;left:0;z-index:-1;opacity:0}.ha-member.ha-member-hover-image-on .ha-member-figure:hover img:nth-of-type(1){z-index:-1;opacity:0}.ha-member.ha-member-hover-image-on .ha-member-figure:hover img:nth-of-type(2){z-index:2;opacity:1}.ha-member-name{margin-top:0;margin-bottom:10px;color:#151515;font-size:18px}.ha-member-position{margin-bottom:25px;color:#7f7f7f;font-size:14px}.ha-member-bio{margin-bottom:25px;font-size:14px;line-height:1.6}.ha-member-links>a{display:inline-block;color:#9895ad;text-align:center;line-height:1;-webkit-transition:all .2s;transition:all .2s}.ha-member-links>a:focus,.ha-member-links>a:hover{color:#222}.ha-member-links>a>i{width:1em;height:1em}.ha-member-links>a:not(:last-child){margin-right:10px}.ha-member .ha-btn{margin-bottom:15px;cursor:pointer}.ha-member-body .ha-btn:last-child{margin-top:15px;margin-bottom:0}.ha-member-lightbox{position:fixed;top:0;left:0;z-index:-999999;display:none;visibility:hidden;width:0;height:0}.ha-member-lightbox.ha-member-lightbox-show{z-index:999999;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;visibility:visible;overflow:auto;-webkit-box-align:start;-webkit-align-items:flex-start;align-items:flex-start;-ms-flex-align:start;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;width:100%;height:100%;background-color:rgba(0,0,0,.6)}.ha-member-lightbox.ha-member-lightbox-show .ha-member-lightbox-close{position:absolute;z-index:99999;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;color:#9ec8f0;font-size:30px;cursor:pointer;-webkit-transition:-webkit-transform .3s;transition:transform .3s,-webkit-transform .3s;transition:transform .3s;-webkit-transition-delay:.5s;transition-delay:.5s;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.ha-member-lightbox.ha-member-lightbox-show .ha-member-lightbox-inner{width:100%;-webkit-animation-name:ha-member-lightbox-zoomIn;animation-name:ha-member-lightbox-zoomIn;-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-fill-mode:both;animation-fill-mode:both}@-webkit-keyframes ha-member-lightbox-zoomIn{0%{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes ha-member-lightbox-zoomIn{0%{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}50%{opacity:1}}
27
  .ha-news-ticker-wrapper{position:relative;overflow:hidden;padding:20px 0;border:1px solid #d2d2d2;border-radius:5px}.ha-news-ticker-wrapper ul.ha-news-ticker-container{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin:0;padding:0;list-style:none}.ha-news-ticker-wrapper ul.ha-news-ticker-container:focus,.ha-news-ticker-wrapper ul.ha-news-ticker-container:hover{-webkit-animation-play-state:paused!important;animation-play-state:paused!important}.ha-news-ticker-wrapper span.ha-news-ticker-sticky-title{position:absolute;top:50%;left:auto;z-index:1;padding:20px;background:#333;color:#fff;font-size:1rem;line-height:1;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%)}.ha-news-ticker-wrapper li.ha-news-ticker-item{margin-right:20px;white-space:nowrap}.ha-news-ticker-wrapper li.ha-news-ticker-item:last-child{margin-right:0}.ha-news-ticker-wrapper .ha-news-ticker-title{margin:0;font-size:1rem;line-height:1}.ha-news-ticker-wrapper li.ha-news-ticker-item a{color:#242424}.ha-news-ticker-wrapper li.ha-news-ticker-item a:hover{color:#e04c8a}
28
  .ha-number-body{position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;overflow:hidden;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-ms-flex-align:center;padding:6px;width:50px;height:50px;border-radius:100%;background-color:#562dd4;color:#fff;text-align:center;font-size:20px}.ha-number-overlay{position:absolute;top:0;left:0;width:100%;height:100%}.ha-number-text{position:relative;z-index:1;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}
29
+ .ha-title-flex,.pdf-icon,.pdf_viewer_options{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.pdf_viewer_options{-webkit-align-content:center;-ms-flex-line-pack:center;align-content:center;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-justify-content:space-between;justify-content:space-between}.ha-title-flex,.pdf-icon{-webkit-box-align:center;-webkit-align-items:center;align-items:center;-ms-flex-align:center}.ha-title-flex{-webkit-align-content:center;-ms-flex-line-pack:center;align-content:center;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-pack:start;-ms-flex-pack:start;-webkit-justify-content:flex-start;justify-content:flex-start}.pdf-icon{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center}.ha-title-flex h2{margin-bottom:5px}.pdf-button a{padding:15px 25px;border-radius:5px;background-color:#562dd4;color:#fff}
30
  .ha-post-list{margin:0;padding:0;list-style:none}.ha-post-list .ha-post-list-item,.ha-post-list.ha-post-list-inline{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.ha-post-list.ha-post-list-inline{-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap}.ha-post-list .ha-post-list-item{margin:0 0 10px;padding:0}.ha-post-list.ha-post-list-inline .ha-post-list-item{margin-right:21px}.ha-post-list .ha-post-list-item:last-child,.ha-post-list.ha-post-list-inline .ha-post-list-item:last-child{margin-right:0;margin-bottom:0}.ha-post-list .ha-post-list-item a,.ha-post-list-meta-wrap{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.ha-post-list .ha-post-list-item a{width:100%}.ha-post-list-title{display:block;margin-top:0;margin-bottom:0;color:#242424;font-size:1rem;-webkit-transition:all .4s;transition:all .4s}.ha-post-list .ha-post-list-item a:hover .ha-post-list-title{color:#e04d8b}.ha-post-list-item a img{margin-right:15px;-o-object-fit:cover;object-fit:cover}span.ha-post-list-icon{margin-right:8px;color:#242424;font-size:14px}span.ha-post-list-icon svg{width:auto;height:1em;fill:currentColor}.ha-post-list-meta-wrap{margin-top:3px}.ha-post-list-meta-wrap span{margin-right:10px;color:#8c8c8c;font-size:13px}.ha-post-list-meta-wrap span:last-child{margin-right:0}.ha-post-list-meta-wrap span i{margin-right:3px}.ha-post-list-excerpt p{margin-bottom:0;color:#8c8c8c}
31
  .ha-post-tab .ha-post-tab-filter{padding:0;border-bottom:1px solid #ddd;list-style:none}.ha-post-tab .ha-post-tab-filter li{display:inline-block;margin:0 5px 0 0;padding:15px 25px;background:#fff;color:#333;text-decoration:none;-webkit-transition:all .3s;transition:all .3s}.ha-post-tab .ha-post-tab-filter li.active,.ha-post-tab .ha-post-tab-filter li:hover,.ha-post-tab.ha-post-tab-left .ha-post-tab-filter li.active,.ha-post-tab.ha-post-tab-left .ha-post-tab-filter li:hover{background:#6d39ef;color:#fff;cursor:pointer}.ha-post-tab .ha-post-tab-item-wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;visibility:hidden;overflow:hidden;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;height:0;opacity:0}.ha-post-tab span.ha-post-tab-loading{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;width:100%;height:100%;text-align:center;font-size:60px;opacity:.5}.ha-post-tab .ha-post-tab-item-wrapper.active{visibility:visible;height:auto;opacity:1}.ha-post-tab .ha-post-tab-item{margin-bottom:30px;padding-right:15px;padding-left:15px}.ha-post-tab .ha-post-tab-item-inner{box-sizing:border-box;padding:20px;height:100%;border-radius:5px;background:#fff;box-shadow:0 1px 20px rgba(0,0,0,.09)}.ha-post-tab .ha-post-tab-item-inner .ha-post-tab-thumb{position:relative;display:block;overflow:hidden;margin-bottom:15px;padding-right:0;padding-left:0}.ha-post-tab .ha-post-tab-item-inner .ha-post-tab-thumb img{max-width:100%;height:auto;-o-object-fit:cover;object-fit:cover}.ha-post-tab .ha-post-tab-item-inner .ha-post-tab-title{display:block;margin-top:0;margin-bottom:10px;font-size:16px}.ha-post-tab .ha-post-tab-item-inner .ha-post-tab-title a,.ha-post-tab .ha-post-tab-meta span a{color:#333;text-decoration:none;-webkit-transition:all .4s;transition:all .4s}.ha-post-tab .ha-post-tab-meta span a:hover,.ha-post-tab .ha-post-tab-title a:hover{color:#6d39ef}.ha-post-tab .ha-post-tab-meta{font-size:14px}.ha-post-tab .ha-post-tab-meta span{display:inline-block;margin-top:10px;margin-right:15px;color:#9b9b9b;-webkit-transition:all .4s;transition:all .4s}.ha-post-tab .ha-post-tab-meta span i{padding-right:5px}.ha-post-tab .ha-post-tab-meta span a{color:#9b9b9b}.ha-post-tab .ha-post-tab-excerpt p{margin:0}.ha-post-tab.ha-post-tab-left,.ha-post-tab.ha-post-tab-right{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap}.ha-post-tab.ha-post-tab-left .ha-post-tab-filter{-webkit-box-flex:0;-webkit-flex:0 0 200px;-ms-flex:0 0 200px;flex:0 0 200px;min-width:200px;border-right:1px solid #f1f1f1;border-bottom:none}.ha-post-tab.ha-post-tab-left .ha-post-tab-filter li,.ha-post-tab.ha-post-tab-right .ha-post-tab-filter li{text-align:left;display:block;margin:0;text-decoration:none;-webkit-transition:all .3s;transition:all .3s}.ha-post-tab.ha-post-tab-right .ha-post-tab-filter li{text-align:right}.ha-post-tab.ha-post-tab-left .ha-post-tab-content{-webkit-box-flex:0;-webkit-flex:0 0 calc(100% - 200px);-ms-flex:0 0 calc(100% - 200px);flex:0 0 calc(100% - 200px);min-width:calc(100% - 200px);min-height:100%}.ha-post-tab.ha-post-tab-right{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-webkit-flex-direction:row-reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.ha-post-tab.ha-post-tab-right .ha-post-tab-filter{-webkit-box-flex:0;-webkit-flex:0 0 200px;-ms-flex:0 0 200px;flex:0 0 200px;min-width:200px;border-bottom:none;border-left:1px solid #f1f1f1}.ha-post-tab.ha-post-tab-right .ha-post-tab-content{-webkit-box-flex:0;-webkit-flex:0 0 calc(100% - 200px);-ms-flex:0 0 calc(100% - 200px);flex:0 0 calc(100% - 200px);min-width:calc(100% - 200px);min-height:100%}@media (max-width:767px){.ha-post-tab.ha-post-tab-right{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-webkit-flex-direction:row-reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.ha-post-tab.ha-post-tab-left .ha-post-tab-filter,.ha-post-tab.ha-post-tab-right .ha-post-tab-filter{-webkit-box-flex:0;-webkit-flex:0 0 100%;-ms-flex:0 0 100%;flex:0 0 100%;min-width:100%;border-right:0;border-bottom:1px solid #f1f1f1;border-left:0}.ha-post-tab.ha-post-tab-left .ha-post-tab-content,.ha-post-tab.ha-post-tab-right .ha-post-tab-content{-webkit-box-flex:0;-webkit-flex:0 0 100%;-ms-flex:0 0 100%;flex:0 0 100%;min-width:100%;min-height:100%}.ha-post-tab.ha-post-tab-left .ha-post-tab-filter li,.ha-post-tab.ha-post-tab-right .ha-post-tab-filter li{display:inline-block}}
32
  .ha-pricing-table>.elementor-widget-container{position:relative;overflow:hidden;padding:3em 4em;border-radius:5px;background-color:#fff;box-shadow:0 3px 40px rgba(36,36,36,.1)}.ha-pricing-table-badge{position:absolute;top:-1px;padding:.8rem 1rem;background-color:#e2498a;color:#fff;line-height:1}.ha-pricing-table-badge--left{left:0;-webkit-transform:rotate(-90deg) translateX(-100%);-ms-transform:rotate(-90deg) translateX(-100%);transform:rotate(-90deg) translateX(-100%);-webkit-transform-origin:left top;-ms-transform-origin:left top;transform-origin:left top}.ha-pricing-table-badge--right{right:0;-webkit-transform:rotate(-90deg) translateY(-100%);-ms-transform:rotate(-90deg) translateY(-100%);transform:rotate(-90deg) translateY(-100%);-webkit-transform-origin:right top;-ms-transform-origin:right top;transform-origin:right top}.ha-pricing-table-title{margin-top:0;margin-bottom:.5rem;color:#242424;font-weight:400;font-size:24px}.ha-pricing-table-price{margin-bottom:3rem}.ha-pricing-table-price-tag{margin-bottom:.5rem;color:#242424;font-weight:700;font-size:60px;line-height:normal}.ha-pricing-table-currency{font-size:24px}.ha-pricing-table-period{color:#8c8c8c;font-size:16px}.ha-pricing-table-body{margin-bottom:3rem}.ha-pricing-table-features-title{margin-top:0;margin-bottom:1rem;font-weight:700;font-size:16px}.ha-pricing-table-features-list{margin:0;padding:0;list-style:none}.ha-pricing-table-features-list li{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:baseline;-webkit-align-items:baseline;align-items:baseline;-ms-flex-align:baseline;margin-bottom:1rem;font-size:16px}.ha-pricing-table-features-list li>i,.ha-pricing-table-features-list li>svg{margin-right:.5rem;min-width:15px;text-align:center;font-size:.8em}.ha-pricing-table-features-list li>svg{width:auto;height:1em;fill:currentColor}.ha-pricing-table-feature-text{display:inline-block}.ha-pricing-table-btn{display:inline-block;padding:.8rem 2rem;border-radius:40px;background-color:#e2498a;color:#fff;text-decoration:none;text-transform:uppercase;font-size:12px;-webkit-transition:all .3s;transition:all .3s}.ha-pricing-table-btn:hover{background-color:#562dd4;color:#fff}
assets/css/main.min.css CHANGED
@@ -26,7 +26,7 @@
26
  .ha-member>.elementor-widget-container{padding:25px;border-radius:5px;background-color:#fff;box-shadow:0 3px 40px rgba(36,36,36,.1)}.ha-member-figure{position:relative;display:inline-block;margin:0 0 25px!important}.ha-member-figure img{width:100%;height:100%;vertical-align:bottom;-o-object-fit:cover;object-fit:cover}.ha-member.ha-member-hover-image-on .ha-member-figure img:nth-of-type(2){position:absolute;top:0;left:0;z-index:-1;opacity:0}.ha-member.ha-member-hover-image-on .ha-member-figure:hover img:nth-of-type(1){z-index:-1;opacity:0}.ha-member.ha-member-hover-image-on .ha-member-figure:hover img:nth-of-type(2){z-index:2;opacity:1}.ha-member-name{margin-top:0;margin-bottom:10px;color:#151515;font-size:18px}.ha-member-position{margin-bottom:25px;color:#7f7f7f;font-size:14px}.ha-member-bio{margin-bottom:25px;font-size:14px;line-height:1.6}.ha-member-links>a{display:inline-block;color:#9895ad;text-align:center;line-height:1;-webkit-transition:all .2s;transition:all .2s}.ha-member-links>a:focus,.ha-member-links>a:hover{color:#222}.ha-member-links>a>i{width:1em;height:1em}.ha-member-links>a:not(:last-child){margin-right:10px}.ha-member .ha-btn{margin-bottom:15px;cursor:pointer}.ha-member-body .ha-btn:last-child{margin-top:15px;margin-bottom:0}.ha-member-lightbox{position:fixed;top:0;left:0;z-index:-999999;display:none;visibility:hidden;width:0;height:0}.ha-member-lightbox.ha-member-lightbox-show{z-index:999999;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;visibility:visible;overflow:auto;-webkit-box-align:start;-webkit-align-items:flex-start;align-items:flex-start;-ms-flex-align:start;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;width:100%;height:100%;background-color:rgba(0,0,0,.6)}.ha-member-lightbox.ha-member-lightbox-show .ha-member-lightbox-close{position:absolute;z-index:99999;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;color:#9ec8f0;font-size:30px;cursor:pointer;-webkit-transition:-webkit-transform .3s;transition:transform .3s,-webkit-transform .3s;transition:transform .3s;-webkit-transition-delay:.5s;transition-delay:.5s;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.ha-member-lightbox.ha-member-lightbox-show .ha-member-lightbox-inner{width:100%;-webkit-animation-name:ha-member-lightbox-zoomIn;animation-name:ha-member-lightbox-zoomIn;-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-fill-mode:both;animation-fill-mode:both}@-webkit-keyframes ha-member-lightbox-zoomIn{0%{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes ha-member-lightbox-zoomIn{0%{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}50%{opacity:1}}
27
  .ha-news-ticker-wrapper{position:relative;overflow:hidden;padding:20px 0;border:1px solid #d2d2d2;border-radius:5px}.ha-news-ticker-wrapper ul.ha-news-ticker-container{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin:0;padding:0;list-style:none}.ha-news-ticker-wrapper ul.ha-news-ticker-container:focus,.ha-news-ticker-wrapper ul.ha-news-ticker-container:hover{-webkit-animation-play-state:paused!important;animation-play-state:paused!important}.ha-news-ticker-wrapper span.ha-news-ticker-sticky-title{position:absolute;top:50%;left:auto;z-index:1;padding:20px;background:#333;color:#fff;font-size:1rem;line-height:1;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%)}.ha-news-ticker-wrapper li.ha-news-ticker-item{margin-right:20px;white-space:nowrap}.ha-news-ticker-wrapper li.ha-news-ticker-item:last-child{margin-right:0}.ha-news-ticker-wrapper .ha-news-ticker-title{margin:0;font-size:1rem;line-height:1}.ha-news-ticker-wrapper li.ha-news-ticker-item a{color:#242424}.ha-news-ticker-wrapper li.ha-news-ticker-item a:hover{color:#e04c8a}
28
  .ha-number-body{position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;overflow:hidden;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-ms-flex-align:center;padding:6px;width:50px;height:50px;border-radius:100%;background-color:#562dd4;color:#fff;text-align:center;font-size:20px}.ha-number-overlay{position:absolute;top:0;left:0;width:100%;height:100%}.ha-number-text{position:relative;z-index:1;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}
29
- .pdf_viewer_options{-webkit-align-content:center;-ms-flex-line-pack:center;align-content:center;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-justify-content:space-between;justify-content:space-between}.ha-title-flex,.pdf-icon,.pdf_viewer_options{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-ms-flex-align:center}.ha-title-flex{-webkit-align-content:center;-ms-flex-line-pack:center;align-content:center;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-pack:start;-ms-flex-pack:start;-webkit-justify-content:flex-start;justify-content:flex-start}.pdf-icon{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center}.ha-title-flex h2{margin-bottom:5px}.pdf-button a{padding:15px 25px;border-radius:5px;background-color:#562dd4;color:#fff}
30
  .ha-post-list{margin:0;padding:0;list-style:none}.ha-post-list .ha-post-list-item,.ha-post-list.ha-post-list-inline{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.ha-post-list.ha-post-list-inline{-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap}.ha-post-list .ha-post-list-item{margin:0 0 10px;padding:0}.ha-post-list.ha-post-list-inline .ha-post-list-item{margin-right:21px}.ha-post-list .ha-post-list-item:last-child,.ha-post-list.ha-post-list-inline .ha-post-list-item:last-child{margin-right:0;margin-bottom:0}.ha-post-list .ha-post-list-item a,.ha-post-list-meta-wrap{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.ha-post-list .ha-post-list-item a{width:100%}.ha-post-list-title{display:block;margin-top:0;margin-bottom:0;color:#242424;font-size:1rem;-webkit-transition:all .4s;transition:all .4s}.ha-post-list .ha-post-list-item a:hover .ha-post-list-title{color:#e04d8b}.ha-post-list-item a img{margin-right:15px;-o-object-fit:cover;object-fit:cover}span.ha-post-list-icon{margin-right:8px;color:#242424;font-size:14px}span.ha-post-list-icon svg{width:auto;height:1em;fill:currentColor}.ha-post-list-meta-wrap{margin-top:3px}.ha-post-list-meta-wrap span{margin-right:10px;color:#8c8c8c;font-size:13px}.ha-post-list-meta-wrap span:last-child{margin-right:0}.ha-post-list-meta-wrap span i{margin-right:3px}.ha-post-list-excerpt p{margin-bottom:0;color:#8c8c8c}
31
  .ha-post-tab .ha-post-tab-filter{padding:0;border-bottom:1px solid #ddd;list-style:none}.ha-post-tab .ha-post-tab-filter li{display:inline-block;margin:0 5px 0 0;padding:15px 25px;background:#fff;color:#333;text-decoration:none;-webkit-transition:all .3s;transition:all .3s}.ha-post-tab .ha-post-tab-filter li.active,.ha-post-tab .ha-post-tab-filter li:hover,.ha-post-tab.ha-post-tab-left .ha-post-tab-filter li.active,.ha-post-tab.ha-post-tab-left .ha-post-tab-filter li:hover{background:#6d39ef;color:#fff;cursor:pointer}.ha-post-tab .ha-post-tab-item-wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;visibility:hidden;overflow:hidden;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;height:0;opacity:0}.ha-post-tab span.ha-post-tab-loading{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;width:100%;height:100%;text-align:center;font-size:60px;opacity:.5}.ha-post-tab .ha-post-tab-item-wrapper.active{visibility:visible;height:auto;opacity:1}.ha-post-tab .ha-post-tab-item{margin-bottom:30px;padding-right:15px;padding-left:15px}.ha-post-tab .ha-post-tab-item-inner{box-sizing:border-box;padding:20px;height:100%;border-radius:5px;background:#fff;box-shadow:0 1px 20px rgba(0,0,0,.09)}.ha-post-tab .ha-post-tab-item-inner .ha-post-tab-thumb{position:relative;display:block;overflow:hidden;margin-bottom:15px;padding-right:0;padding-left:0}.ha-post-tab .ha-post-tab-item-inner .ha-post-tab-thumb img{max-width:100%;height:auto;-o-object-fit:cover;object-fit:cover}.ha-post-tab .ha-post-tab-item-inner .ha-post-tab-title{display:block;margin-top:0;margin-bottom:10px;font-size:16px}.ha-post-tab .ha-post-tab-item-inner .ha-post-tab-title a,.ha-post-tab .ha-post-tab-meta span a{color:#333;text-decoration:none;-webkit-transition:all .4s;transition:all .4s}.ha-post-tab .ha-post-tab-meta span a:hover,.ha-post-tab .ha-post-tab-title a:hover{color:#6d39ef}.ha-post-tab .ha-post-tab-meta{font-size:14px}.ha-post-tab .ha-post-tab-meta span{display:inline-block;margin-top:10px;margin-right:15px;color:#9b9b9b;-webkit-transition:all .4s;transition:all .4s}.ha-post-tab .ha-post-tab-meta span i{padding-right:5px}.ha-post-tab .ha-post-tab-meta span a{color:#9b9b9b}.ha-post-tab .ha-post-tab-excerpt p{margin:0}.ha-post-tab.ha-post-tab-left,.ha-post-tab.ha-post-tab-right{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap}.ha-post-tab.ha-post-tab-left .ha-post-tab-filter{-webkit-box-flex:0;-webkit-flex:0 0 200px;-ms-flex:0 0 200px;flex:0 0 200px;min-width:200px;border-right:1px solid #f1f1f1;border-bottom:none}.ha-post-tab.ha-post-tab-left .ha-post-tab-filter li,.ha-post-tab.ha-post-tab-right .ha-post-tab-filter li{text-align:left;display:block;margin:0;text-decoration:none;-webkit-transition:all .3s;transition:all .3s}.ha-post-tab.ha-post-tab-right .ha-post-tab-filter li{text-align:right}.ha-post-tab.ha-post-tab-left .ha-post-tab-content{-webkit-box-flex:0;-webkit-flex:0 0 calc(100% - 200px);-ms-flex:0 0 calc(100% - 200px);flex:0 0 calc(100% - 200px);min-width:calc(100% - 200px);min-height:100%}.ha-post-tab.ha-post-tab-right{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-webkit-flex-direction:row-reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.ha-post-tab.ha-post-tab-right .ha-post-tab-filter{-webkit-box-flex:0;-webkit-flex:0 0 200px;-ms-flex:0 0 200px;flex:0 0 200px;min-width:200px;border-bottom:none;border-left:1px solid #f1f1f1}.ha-post-tab.ha-post-tab-right .ha-post-tab-content{-webkit-box-flex:0;-webkit-flex:0 0 calc(100% - 200px);-ms-flex:0 0 calc(100% - 200px);flex:0 0 calc(100% - 200px);min-width:calc(100% - 200px);min-height:100%}@media (max-width:767px){.ha-post-tab.ha-post-tab-right{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-webkit-flex-direction:row-reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.ha-post-tab.ha-post-tab-left .ha-post-tab-filter,.ha-post-tab.ha-post-tab-right .ha-post-tab-filter{-webkit-box-flex:0;-webkit-flex:0 0 100%;-ms-flex:0 0 100%;flex:0 0 100%;min-width:100%;border-right:0;border-bottom:1px solid #f1f1f1;border-left:0}.ha-post-tab.ha-post-tab-left .ha-post-tab-content,.ha-post-tab.ha-post-tab-right .ha-post-tab-content{-webkit-box-flex:0;-webkit-flex:0 0 100%;-ms-flex:0 0 100%;flex:0 0 100%;min-width:100%;min-height:100%}.ha-post-tab.ha-post-tab-left .ha-post-tab-filter li,.ha-post-tab.ha-post-tab-right .ha-post-tab-filter li{display:inline-block}}
32
  .ha-pricing-table>.elementor-widget-container{position:relative;overflow:hidden;padding:3em 4em;border-radius:5px;background-color:#fff;box-shadow:0 3px 40px rgba(36,36,36,.1)}.ha-pricing-table-badge{position:absolute;top:-1px;padding:.8rem 1rem;background-color:#e2498a;color:#fff;line-height:1}.ha-pricing-table-badge--left{left:0;-webkit-transform:rotate(-90deg) translateX(-100%);-ms-transform:rotate(-90deg) translateX(-100%);transform:rotate(-90deg) translateX(-100%);-webkit-transform-origin:left top;-ms-transform-origin:left top;transform-origin:left top}.ha-pricing-table-badge--right{right:0;-webkit-transform:rotate(-90deg) translateY(-100%);-ms-transform:rotate(-90deg) translateY(-100%);transform:rotate(-90deg) translateY(-100%);-webkit-transform-origin:right top;-ms-transform-origin:right top;transform-origin:right top}.ha-pricing-table-title{margin-top:0;margin-bottom:.5rem;color:#242424;font-weight:400;font-size:24px}.ha-pricing-table-price{margin-bottom:3rem}.ha-pricing-table-price-tag{margin-bottom:.5rem;color:#242424;font-weight:700;font-size:60px;line-height:normal}.ha-pricing-table-currency{font-size:24px}.ha-pricing-table-period{color:#8c8c8c;font-size:16px}.ha-pricing-table-body{margin-bottom:3rem}.ha-pricing-table-features-title{margin-top:0;margin-bottom:1rem;font-weight:700;font-size:16px}.ha-pricing-table-features-list{margin:0;padding:0;list-style:none}.ha-pricing-table-features-list li{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:baseline;-webkit-align-items:baseline;align-items:baseline;-ms-flex-align:baseline;margin-bottom:1rem;font-size:16px}.ha-pricing-table-features-list li>i,.ha-pricing-table-features-list li>svg{margin-right:.5rem;min-width:15px;text-align:center;font-size:.8em}.ha-pricing-table-features-list li>svg{width:auto;height:1em;fill:currentColor}.ha-pricing-table-feature-text{display:inline-block}.ha-pricing-table-btn{display:inline-block;padding:.8rem 2rem;border-radius:40px;background-color:#e2498a;color:#fff;text-decoration:none;text-transform:uppercase;font-size:12px;-webkit-transition:all .3s;transition:all .3s}.ha-pricing-table-btn:hover{background-color:#562dd4;color:#fff}
26
  .ha-member>.elementor-widget-container{padding:25px;border-radius:5px;background-color:#fff;box-shadow:0 3px 40px rgba(36,36,36,.1)}.ha-member-figure{position:relative;display:inline-block;margin:0 0 25px!important}.ha-member-figure img{width:100%;height:100%;vertical-align:bottom;-o-object-fit:cover;object-fit:cover}.ha-member.ha-member-hover-image-on .ha-member-figure img:nth-of-type(2){position:absolute;top:0;left:0;z-index:-1;opacity:0}.ha-member.ha-member-hover-image-on .ha-member-figure:hover img:nth-of-type(1){z-index:-1;opacity:0}.ha-member.ha-member-hover-image-on .ha-member-figure:hover img:nth-of-type(2){z-index:2;opacity:1}.ha-member-name{margin-top:0;margin-bottom:10px;color:#151515;font-size:18px}.ha-member-position{margin-bottom:25px;color:#7f7f7f;font-size:14px}.ha-member-bio{margin-bottom:25px;font-size:14px;line-height:1.6}.ha-member-links>a{display:inline-block;color:#9895ad;text-align:center;line-height:1;-webkit-transition:all .2s;transition:all .2s}.ha-member-links>a:focus,.ha-member-links>a:hover{color:#222}.ha-member-links>a>i{width:1em;height:1em}.ha-member-links>a:not(:last-child){margin-right:10px}.ha-member .ha-btn{margin-bottom:15px;cursor:pointer}.ha-member-body .ha-btn:last-child{margin-top:15px;margin-bottom:0}.ha-member-lightbox{position:fixed;top:0;left:0;z-index:-999999;display:none;visibility:hidden;width:0;height:0}.ha-member-lightbox.ha-member-lightbox-show{z-index:999999;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;visibility:visible;overflow:auto;-webkit-box-align:start;-webkit-align-items:flex-start;align-items:flex-start;-ms-flex-align:start;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;width:100%;height:100%;background-color:rgba(0,0,0,.6)}.ha-member-lightbox.ha-member-lightbox-show .ha-member-lightbox-close{position:absolute;z-index:99999;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;color:#9ec8f0;font-size:30px;cursor:pointer;-webkit-transition:-webkit-transform .3s;transition:transform .3s,-webkit-transform .3s;transition:transform .3s;-webkit-transition-delay:.5s;transition-delay:.5s;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.ha-member-lightbox.ha-member-lightbox-show .ha-member-lightbox-inner{width:100%;-webkit-animation-name:ha-member-lightbox-zoomIn;animation-name:ha-member-lightbox-zoomIn;-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-fill-mode:both;animation-fill-mode:both}@-webkit-keyframes ha-member-lightbox-zoomIn{0%{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes ha-member-lightbox-zoomIn{0%{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}50%{opacity:1}}
27
  .ha-news-ticker-wrapper{position:relative;overflow:hidden;padding:20px 0;border:1px solid #d2d2d2;border-radius:5px}.ha-news-ticker-wrapper ul.ha-news-ticker-container{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin:0;padding:0;list-style:none}.ha-news-ticker-wrapper ul.ha-news-ticker-container:focus,.ha-news-ticker-wrapper ul.ha-news-ticker-container:hover{-webkit-animation-play-state:paused!important;animation-play-state:paused!important}.ha-news-ticker-wrapper span.ha-news-ticker-sticky-title{position:absolute;top:50%;left:auto;z-index:1;padding:20px;background:#333;color:#fff;font-size:1rem;line-height:1;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%)}.ha-news-ticker-wrapper li.ha-news-ticker-item{margin-right:20px;white-space:nowrap}.ha-news-ticker-wrapper li.ha-news-ticker-item:last-child{margin-right:0}.ha-news-ticker-wrapper .ha-news-ticker-title{margin:0;font-size:1rem;line-height:1}.ha-news-ticker-wrapper li.ha-news-ticker-item a{color:#242424}.ha-news-ticker-wrapper li.ha-news-ticker-item a:hover{color:#e04c8a}
28
  .ha-number-body{position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;overflow:hidden;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-ms-flex-align:center;padding:6px;width:50px;height:50px;border-radius:100%;background-color:#562dd4;color:#fff;text-align:center;font-size:20px}.ha-number-overlay{position:absolute;top:0;left:0;width:100%;height:100%}.ha-number-text{position:relative;z-index:1;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}
29
+ .ha-title-flex,.pdf-icon,.pdf_viewer_options{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.pdf_viewer_options{-webkit-align-content:center;-ms-flex-line-pack:center;align-content:center;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-justify-content:space-between;justify-content:space-between}.ha-title-flex,.pdf-icon{-webkit-box-align:center;-webkit-align-items:center;align-items:center;-ms-flex-align:center}.ha-title-flex{-webkit-align-content:center;-ms-flex-line-pack:center;align-content:center;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-pack:start;-ms-flex-pack:start;-webkit-justify-content:flex-start;justify-content:flex-start}.pdf-icon{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center}.ha-title-flex h2{margin-bottom:5px}.pdf-button a{padding:15px 25px;border-radius:5px;background-color:#562dd4;color:#fff}
30
  .ha-post-list{margin:0;padding:0;list-style:none}.ha-post-list .ha-post-list-item,.ha-post-list.ha-post-list-inline{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.ha-post-list.ha-post-list-inline{-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap}.ha-post-list .ha-post-list-item{margin:0 0 10px;padding:0}.ha-post-list.ha-post-list-inline .ha-post-list-item{margin-right:21px}.ha-post-list .ha-post-list-item:last-child,.ha-post-list.ha-post-list-inline .ha-post-list-item:last-child{margin-right:0;margin-bottom:0}.ha-post-list .ha-post-list-item a,.ha-post-list-meta-wrap{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.ha-post-list .ha-post-list-item a{width:100%}.ha-post-list-title{display:block;margin-top:0;margin-bottom:0;color:#242424;font-size:1rem;-webkit-transition:all .4s;transition:all .4s}.ha-post-list .ha-post-list-item a:hover .ha-post-list-title{color:#e04d8b}.ha-post-list-item a img{margin-right:15px;-o-object-fit:cover;object-fit:cover}span.ha-post-list-icon{margin-right:8px;color:#242424;font-size:14px}span.ha-post-list-icon svg{width:auto;height:1em;fill:currentColor}.ha-post-list-meta-wrap{margin-top:3px}.ha-post-list-meta-wrap span{margin-right:10px;color:#8c8c8c;font-size:13px}.ha-post-list-meta-wrap span:last-child{margin-right:0}.ha-post-list-meta-wrap span i{margin-right:3px}.ha-post-list-excerpt p{margin-bottom:0;color:#8c8c8c}
31
  .ha-post-tab .ha-post-tab-filter{padding:0;border-bottom:1px solid #ddd;list-style:none}.ha-post-tab .ha-post-tab-filter li{display:inline-block;margin:0 5px 0 0;padding:15px 25px;background:#fff;color:#333;text-decoration:none;-webkit-transition:all .3s;transition:all .3s}.ha-post-tab .ha-post-tab-filter li.active,.ha-post-tab .ha-post-tab-filter li:hover,.ha-post-tab.ha-post-tab-left .ha-post-tab-filter li.active,.ha-post-tab.ha-post-tab-left .ha-post-tab-filter li:hover{background:#6d39ef;color:#fff;cursor:pointer}.ha-post-tab .ha-post-tab-item-wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;visibility:hidden;overflow:hidden;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;height:0;opacity:0}.ha-post-tab span.ha-post-tab-loading{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;width:100%;height:100%;text-align:center;font-size:60px;opacity:.5}.ha-post-tab .ha-post-tab-item-wrapper.active{visibility:visible;height:auto;opacity:1}.ha-post-tab .ha-post-tab-item{margin-bottom:30px;padding-right:15px;padding-left:15px}.ha-post-tab .ha-post-tab-item-inner{box-sizing:border-box;padding:20px;height:100%;border-radius:5px;background:#fff;box-shadow:0 1px 20px rgba(0,0,0,.09)}.ha-post-tab .ha-post-tab-item-inner .ha-post-tab-thumb{position:relative;display:block;overflow:hidden;margin-bottom:15px;padding-right:0;padding-left:0}.ha-post-tab .ha-post-tab-item-inner .ha-post-tab-thumb img{max-width:100%;height:auto;-o-object-fit:cover;object-fit:cover}.ha-post-tab .ha-post-tab-item-inner .ha-post-tab-title{display:block;margin-top:0;margin-bottom:10px;font-size:16px}.ha-post-tab .ha-post-tab-item-inner .ha-post-tab-title a,.ha-post-tab .ha-post-tab-meta span a{color:#333;text-decoration:none;-webkit-transition:all .4s;transition:all .4s}.ha-post-tab .ha-post-tab-meta span a:hover,.ha-post-tab .ha-post-tab-title a:hover{color:#6d39ef}.ha-post-tab .ha-post-tab-meta{font-size:14px}.ha-post-tab .ha-post-tab-meta span{display:inline-block;margin-top:10px;margin-right:15px;color:#9b9b9b;-webkit-transition:all .4s;transition:all .4s}.ha-post-tab .ha-post-tab-meta span i{padding-right:5px}.ha-post-tab .ha-post-tab-meta span a{color:#9b9b9b}.ha-post-tab .ha-post-tab-excerpt p{margin:0}.ha-post-tab.ha-post-tab-left,.ha-post-tab.ha-post-tab-right{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap}.ha-post-tab.ha-post-tab-left .ha-post-tab-filter{-webkit-box-flex:0;-webkit-flex:0 0 200px;-ms-flex:0 0 200px;flex:0 0 200px;min-width:200px;border-right:1px solid #f1f1f1;border-bottom:none}.ha-post-tab.ha-post-tab-left .ha-post-tab-filter li,.ha-post-tab.ha-post-tab-right .ha-post-tab-filter li{text-align:left;display:block;margin:0;text-decoration:none;-webkit-transition:all .3s;transition:all .3s}.ha-post-tab.ha-post-tab-right .ha-post-tab-filter li{text-align:right}.ha-post-tab.ha-post-tab-left .ha-post-tab-content{-webkit-box-flex:0;-webkit-flex:0 0 calc(100% - 200px);-ms-flex:0 0 calc(100% - 200px);flex:0 0 calc(100% - 200px);min-width:calc(100% - 200px);min-height:100%}.ha-post-tab.ha-post-tab-right{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-webkit-flex-direction:row-reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.ha-post-tab.ha-post-tab-right .ha-post-tab-filter{-webkit-box-flex:0;-webkit-flex:0 0 200px;-ms-flex:0 0 200px;flex:0 0 200px;min-width:200px;border-bottom:none;border-left:1px solid #f1f1f1}.ha-post-tab.ha-post-tab-right .ha-post-tab-content{-webkit-box-flex:0;-webkit-flex:0 0 calc(100% - 200px);-ms-flex:0 0 calc(100% - 200px);flex:0 0 calc(100% - 200px);min-width:calc(100% - 200px);min-height:100%}@media (max-width:767px){.ha-post-tab.ha-post-tab-right{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-webkit-flex-direction:row-reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.ha-post-tab.ha-post-tab-left .ha-post-tab-filter,.ha-post-tab.ha-post-tab-right .ha-post-tab-filter{-webkit-box-flex:0;-webkit-flex:0 0 100%;-ms-flex:0 0 100%;flex:0 0 100%;min-width:100%;border-right:0;border-bottom:1px solid #f1f1f1;border-left:0}.ha-post-tab.ha-post-tab-left .ha-post-tab-content,.ha-post-tab.ha-post-tab-right .ha-post-tab-content{-webkit-box-flex:0;-webkit-flex:0 0 100%;-ms-flex:0 0 100%;flex:0 0 100%;min-width:100%;min-height:100%}.ha-post-tab.ha-post-tab-left .ha-post-tab-filter li,.ha-post-tab.ha-post-tab-right .ha-post-tab-filter li{display:inline-block}}
32
  .ha-pricing-table>.elementor-widget-container{position:relative;overflow:hidden;padding:3em 4em;border-radius:5px;background-color:#fff;box-shadow:0 3px 40px rgba(36,36,36,.1)}.ha-pricing-table-badge{position:absolute;top:-1px;padding:.8rem 1rem;background-color:#e2498a;color:#fff;line-height:1}.ha-pricing-table-badge--left{left:0;-webkit-transform:rotate(-90deg) translateX(-100%);-ms-transform:rotate(-90deg) translateX(-100%);transform:rotate(-90deg) translateX(-100%);-webkit-transform-origin:left top;-ms-transform-origin:left top;transform-origin:left top}.ha-pricing-table-badge--right{right:0;-webkit-transform:rotate(-90deg) translateY(-100%);-ms-transform:rotate(-90deg) translateY(-100%);transform:rotate(-90deg) translateY(-100%);-webkit-transform-origin:right top;-ms-transform-origin:right top;transform-origin:right top}.ha-pricing-table-title{margin-top:0;margin-bottom:.5rem;color:#242424;font-weight:400;font-size:24px}.ha-pricing-table-price{margin-bottom:3rem}.ha-pricing-table-price-tag{margin-bottom:.5rem;color:#242424;font-weight:700;font-size:60px;line-height:normal}.ha-pricing-table-currency{font-size:24px}.ha-pricing-table-period{color:#8c8c8c;font-size:16px}.ha-pricing-table-body{margin-bottom:3rem}.ha-pricing-table-features-title{margin-top:0;margin-bottom:1rem;font-weight:700;font-size:16px}.ha-pricing-table-features-list{margin:0;padding:0;list-style:none}.ha-pricing-table-features-list li{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:baseline;-webkit-align-items:baseline;align-items:baseline;-ms-flex-align:baseline;margin-bottom:1rem;font-size:16px}.ha-pricing-table-features-list li>i,.ha-pricing-table-features-list li>svg{margin-right:.5rem;min-width:15px;text-align:center;font-size:.8em}.ha-pricing-table-features-list li>svg{width:auto;height:1em;fill:currentColor}.ha-pricing-table-feature-text{display:inline-block}.ha-pricing-table-btn{display:inline-block;padding:.8rem 2rem;border-radius:40px;background-color:#e2498a;color:#fff;text-decoration:none;text-transform:uppercase;font-size:12px;-webkit-transition:all .3s;transition:all .3s}.ha-pricing-table-btn:hover{background-color:#562dd4;color:#fff}
assets/css/widgets/pdf.min.css CHANGED
@@ -1 +1 @@
1
- .pdf_viewer_options{-webkit-align-content:center;-ms-flex-line-pack:center;align-content:center;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-justify-content:space-between;justify-content:space-between}.ha-title-flex,.pdf-icon,.pdf_viewer_options{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-ms-flex-align:center}.ha-title-flex{-webkit-align-content:center;-ms-flex-line-pack:center;align-content:center;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-pack:start;-ms-flex-pack:start;-webkit-justify-content:flex-start;justify-content:flex-start}.pdf-icon{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center}.ha-title-flex h2{margin-bottom:5px}.pdf-button a{padding:15px 25px;border-radius:5px;background-color:#562dd4;color:#fff}
1
+ .ha-title-flex,.pdf-icon,.pdf_viewer_options{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.pdf_viewer_options{-webkit-align-content:center;-ms-flex-line-pack:center;align-content:center;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-justify-content:space-between;justify-content:space-between}.ha-title-flex,.pdf-icon{-webkit-box-align:center;-webkit-align-items:center;align-items:center;-ms-flex-align:center}.ha-title-flex{-webkit-align-content:center;-ms-flex-line-pack:center;align-content:center;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-pack:start;-ms-flex-pack:start;-webkit-justify-content:flex-start;justify-content:flex-start}.pdf-icon{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center}.ha-title-flex h2{margin-bottom:5px}.pdf-button a{padding:15px 25px;border-radius:5px;background-color:#562dd4;color:#fff}
assets/js/happy-addons.js CHANGED
@@ -1051,45 +1051,17 @@
1051
  }
1052
  };
1053
 
1054
- //PDF View
1055
- var PDF_View = function($scope) {
1056
- // console.log($scope);
1057
- var viewer_container = $scope.find('.pdf_viewer_container');
1058
-
1059
- var settings = viewer_container.data('pdf-settings');
1060
- if(settings.pdfjs_expres == "yes" && settings.license) {
1061
-
1062
- WebViewer({
1063
- path: HappyLocalize.pdf_js_lib, // path to the PDF.js Express'lib' folder on your server
1064
- // licenseKey: settings.license,
1065
- licenseKey: settings.license,
1066
- // initialDoc: 'https://pdftron.s3.amazonaws.com/downloads/pl/webviewer-demo.pdf',
1067
- // initialDoc: 'http://www.africau.edu/images/default/sample.pdf',
1068
- initialDoc: settings.pdf_url,
1069
- // initialDoc: '/path/to/my/file.pdf', // You can also use documents on your server
1070
- }, document.getElementById(settings.unique_id))
1071
- .then(instance => {
1072
- // now you can access APIs through the WebViewer instance
1073
- const { Core, UI } = instance;
1074
- console.log(UI);
1075
- // UI.openElements(['menuOverlay','downloadButton']);
1076
- // UI.openElements(['menuOverlay','fullScreenButton']);
1077
- instance.setFitMode(UI.FitMode.FitWidth);
1078
-
1079
- // UI.disableElements([ 'leftPanel', 'leftPanelButton' ]);
1080
- UI.enableElements([ 'textPopup', 'copyTextButton' ]);
1081
- UI.enableElements([ 'textPopup', 'textHighlightToolButton' ]);
1082
- // adding an event listener for when a document is loaded
1083
- Core.documentViewer.addEventListener('documentLoaded', () => {
1084
- console.log('document loaded');
1085
- });
1086
-
1087
- // adding an event listener for when the page number has changed
1088
- Core.documentViewer.addEventListener('pageNumberUpdated', (pageNumber) => {
1089
- console.log(`Page number is: ${pageNumber}`);
1090
- });
1091
- });
1092
- }
1093
  };
1094
 
1095
 
@@ -1192,7 +1164,7 @@
1192
  'ha-content-switcher.default' : Content_Switcher,
1193
  'ha-member.default' : Team_Member,
1194
  'ha-creative-button.default' : Creative_Button,
1195
- 'ha-pdf-view.default' : PDF_View,
1196
  };
1197
 
1198
  $.each( fnHanlders, function( widgetName, handlerFn ) {
1051
  }
1052
  };
1053
 
1054
+ var PDF_View = function($scope){
1055
+ var $pdf_viewer_options = $scope.find(".pdf_viewer_options");
1056
+ var $settings = $pdf_viewer_options.data('pdf-settings');
1057
+ // if( $settings !== undefined && $settings.file_type == 'upload_file'){
1058
+ var options = {
1059
+ width: $settings.width,
1060
+ height: $settings.height,
1061
+ page: $settings.page_number
1062
+ };
1063
+ PDFObject.embed($settings.pdf_url, "#pdf-container", options);
1064
+ // }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1065
  };
1066
 
1067
 
1164
  'ha-content-switcher.default' : Content_Switcher,
1165
  'ha-member.default' : Team_Member,
1166
  'ha-creative-button.default' : Creative_Button,
1167
+ 'ha-pdf-view.default' : PDF_View
1168
  };
1169
 
1170
  $.each( fnHanlders, function( widgetName, handlerFn ) {
assets/js/happy-addons.min.js CHANGED
@@ -1051,45 +1051,17 @@
1051
  }
1052
  };
1053
 
1054
- //PDF View
1055
- var PDF_View = function($scope) {
1056
- // console.log($scope);
1057
- var viewer_container = $scope.find('.pdf_viewer_container');
1058
-
1059
- var settings = viewer_container.data('pdf-settings');
1060
- if(settings.pdfjs_expres == "yes" && settings.license) {
1061
-
1062
- WebViewer({
1063
- path: HappyLocalize.pdf_js_lib, // path to the PDF.js Express'lib' folder on your server
1064
- // licenseKey: settings.license,
1065
- licenseKey: settings.license,
1066
- // initialDoc: 'https://pdftron.s3.amazonaws.com/downloads/pl/webviewer-demo.pdf',
1067
- // initialDoc: 'http://www.africau.edu/images/default/sample.pdf',
1068
- initialDoc: settings.pdf_url,
1069
- // initialDoc: '/path/to/my/file.pdf', // You can also use documents on your server
1070
- }, document.getElementById(settings.unique_id))
1071
- .then(instance => {
1072
- // now you can access APIs through the WebViewer instance
1073
- const { Core, UI } = instance;
1074
- console.log(UI);
1075
- // UI.openElements(['menuOverlay','downloadButton']);
1076
- // UI.openElements(['menuOverlay','fullScreenButton']);
1077
- instance.setFitMode(UI.FitMode.FitWidth);
1078
-
1079
- // UI.disableElements([ 'leftPanel', 'leftPanelButton' ]);
1080
- UI.enableElements([ 'textPopup', 'copyTextButton' ]);
1081
- UI.enableElements([ 'textPopup', 'textHighlightToolButton' ]);
1082
- // adding an event listener for when a document is loaded
1083
- Core.documentViewer.addEventListener('documentLoaded', () => {
1084
- console.log('document loaded');
1085
- });
1086
-
1087
- // adding an event listener for when the page number has changed
1088
- Core.documentViewer.addEventListener('pageNumberUpdated', (pageNumber) => {
1089
- console.log(`Page number is: ${pageNumber}`);
1090
- });
1091
- });
1092
- }
1093
  };
1094
 
1095
 
@@ -1192,7 +1164,7 @@
1192
  'ha-content-switcher.default' : Content_Switcher,
1193
  'ha-member.default' : Team_Member,
1194
  'ha-creative-button.default' : Creative_Button,
1195
- 'ha-pdf-view.default' : PDF_View,
1196
  };
1197
 
1198
  $.each( fnHanlders, function( widgetName, handlerFn ) {
1051
  }
1052
  };
1053
 
1054
+ var PDF_View = function($scope){
1055
+ var $pdf_viewer_options = $scope.find(".pdf_viewer_options");
1056
+ var $settings = $pdf_viewer_options.data('pdf-settings');
1057
+ // if( $settings !== undefined && $settings.file_type == 'upload_file'){
1058
+ var options = {
1059
+ width: $settings.width,
1060
+ height: $settings.height,
1061
+ page: $settings.page_number
1062
+ };
1063
+ PDFObject.embed($settings.pdf_url, "#pdf-container", options);
1064
+ // }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1065
  };
1066
 
1067
 
1164
  'ha-content-switcher.default' : Content_Switcher,
1165
  'ha-member.default' : Team_Member,
1166
  'ha-creative-button.default' : Creative_Button,
1167
+ 'ha-pdf-view.default' : PDF_View
1168
  };
1169
 
1170
  $.each( fnHanlders, function( widgetName, handlerFn ) {
assets/vendor/pdfjs/mozila/LICENSE DELETED
@@ -1,177 +0,0 @@
1
-
2
- Apache License
3
- Version 2.0, January 2004
4
- http://www.apache.org/licenses/
5
-
6
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
-
8
- 1. Definitions.
9
-
10
- "License" shall mean the terms and conditions for use, reproduction,
11
- and distribution as defined by Sections 1 through 9 of this document.
12
-
13
- "Licensor" shall mean the copyright owner or entity authorized by
14
- the copyright owner that is granting the License.
15
-
16
- "Legal Entity" shall mean the union of the acting entity and all
17
- other entities that control, are controlled by, or are under common
18
- control with that entity. For the purposes of this definition,
19
- "control" means (i) the power, direct or indirect, to cause the
20
- direction or management of such entity, whether by contract or
21
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
- outstanding shares, or (iii) beneficial ownership of such entity.
23
-
24
- "You" (or "Your") shall mean an individual or Legal Entity
25
- exercising permissions granted by this License.
26
-
27
- "Source" form shall mean the preferred form for making modifications,
28
- including but not limited to software source code, documentation
29
- source, and configuration files.
30
-
31
- "Object" form shall mean any form resulting from mechanical
32
- transformation or translation of a Source form, including but
33
- not limited to compiled object code, generated documentation,
34
- and conversions to other media types.
35
-
36
- "Work" shall mean the work of authorship, whether in Source or
37
- Object form, made available under the License, as indicated by a
38
- copyright notice that is included in or attached to the work
39
- (an example is provided in the Appendix below).
40
-
41
- "Derivative Works" shall mean any work, whether in Source or Object
42
- form, that is based on (or derived from) the Work and for which the
43
- editorial revisions, annotations, elaborations, or other modifications
44
- represent, as a whole, an original work of authorship. For the purposes
45
- of this License, Derivative Works shall not include works that remain
46
- separable from, or merely link (or bind by name) to the interfaces of,
47
- the Work and Derivative Works thereof.
48
-
49
- "Contribution" shall mean any work of authorship, including
50
- the original version of the Work and any modifications or additions
51
- to that Work or Derivative Works thereof, that is intentionally
52
- submitted to Licensor for inclusion in the Work by the copyright owner
53
- or by an individual or Legal Entity authorized to submit on behalf of
54
- the copyright owner. For the purposes of this definition, "submitted"
55
- means any form of electronic, verbal, or written communication sent
56
- to the Licensor or its representatives, including but not limited to
57
- communication on electronic mailing lists, source code control systems,
58
- and issue tracking systems that are managed by, or on behalf of, the
59
- Licensor for the purpose of discussing and improving the Work, but
60
- excluding communication that is conspicuously marked or otherwise
61
- designated in writing by the copyright owner as "Not a Contribution."
62
-
63
- "Contributor" shall mean Licensor and any individual or Legal Entity
64
- on behalf of whom a Contribution has been received by Licensor and
65
- subsequently incorporated within the Work.
66
-
67
- 2. Grant of Copyright License. Subject to the terms and conditions of
68
- this License, each Contributor hereby grants to You a perpetual,
69
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
- copyright license to reproduce, prepare Derivative Works of,
71
- publicly display, publicly perform, sublicense, and distribute the
72
- Work and such Derivative Works in Source or Object form.
73
-
74
- 3. Grant of Patent License. Subject to the terms and conditions of
75
- this License, each Contributor hereby grants to You a perpetual,
76
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
- (except as stated in this section) patent license to make, have made,
78
- use, offer to sell, sell, import, and otherwise transfer the Work,
79
- where such license applies only to those patent claims licensable
80
- by such Contributor that are necessarily infringed by their
81
- Contribution(s) alone or by combination of their Contribution(s)
82
- with the Work to which such Contribution(s) was submitted. If You
83
- institute patent litigation against any entity (including a
84
- cross-claim or counterclaim in a lawsuit) alleging that the Work
85
- or a Contribution incorporated within the Work constitutes direct
86
- or contributory patent infringement, then any patent licenses
87
- granted to You under this License for that Work shall terminate
88
- as of the date such litigation is filed.
89
-
90
- 4. Redistribution. You may reproduce and distribute copies of the
91
- Work or Derivative Works thereof in any medium, with or without
92
- modifications, and in Source or Object form, provided that You
93
- meet the following conditions:
94
-
95
- (a) You must give any other recipients of the Work or
96
- Derivative Works a copy of this License; and
97
-
98
- (b) You must cause any modified files to carry prominent notices
99
- stating that You changed the files; and
100
-
101
- (c) You must retain, in the Source form of any Derivative Works
102
- that You distribute, all copyright, patent, trademark, and
103
- attribution notices from the Source form of the Work,
104
- excluding those notices that do not pertain to any part of
105
- the Derivative Works; and
106
-
107
- (d) If the Work includes a "NOTICE" text file as part of its
108
- distribution, then any Derivative Works that You distribute must
109
- include a readable copy of the attribution notices contained
110
- within such NOTICE file, excluding those notices that do not
111
- pertain to any part of the Derivative Works, in at least one
112
- of the following places: within a NOTICE text file distributed
113
- as part of the Derivative Works; within the Source form or
114
- documentation, if provided along with the Derivative Works; or,
115
- within a display generated by the Derivative Works, if and
116
- wherever such third-party notices normally appear. The contents
117
- of the NOTICE file are for informational purposes only and
118
- do not modify the License. You may add Your own attribution
119
- notices within Derivative Works that You distribute, alongside
120
- or as an addendum to the NOTICE text from the Work, provided
121
- that such additional attribution notices cannot be construed
122
- as modifying the License.
123
-
124
- You may add Your own copyright statement to Your modifications and
125
- may provide additional or different license terms and conditions
126
- for use, reproduction, or distribution of Your modifications, or
127
- for any such Derivative Works as a whole, provided Your use,
128
- reproduction, and distribution of the Work otherwise complies with
129
- the conditions stated in this License.
130
-
131
- 5. Submission of Contributions. Unless You explicitly state otherwise,
132
- any Contribution intentionally submitted for inclusion in the Work
133
- by You to the Licensor shall be under the terms and conditions of
134
- this License, without any additional terms or conditions.
135
- Notwithstanding the above, nothing herein shall supersede or modify
136
- the terms of any separate license agreement you may have executed
137
- with Licensor regarding such Contributions.
138
-
139
- 6. Trademarks. This License does not grant permission to use the trade
140
- names, trademarks, service marks, or product names of the Licensor,
141
- except as required for reasonable and customary use in describing the
142
- origin of the Work and reproducing the content of the NOTICE file.
143
-
144
- 7. Disclaimer of Warranty. Unless required by applicable law or
145
- agreed to in writing, Licensor provides the Work (and each
146
- Contributor provides its Contributions) on an "AS IS" BASIS,
147
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
- implied, including, without limitation, any warranties or conditions
149
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
- PARTICULAR PURPOSE. You are solely responsible for determining the
151
- appropriateness of using or redistributing the Work and assume any
152
- risks associated with Your exercise of permissions under this License.
153
-
154
- 8. Limitation of Liability. In no event and under no legal theory,
155
- whether in tort (including negligence), contract, or otherwise,
156
- unless required by applicable law (such as deliberate and grossly
157
- negligent acts) or agreed to in writing, shall any Contributor be
158
- liable to You for damages, including any direct, indirect, special,
159
- incidental, or consequential damages of any character arising as a
160
- result of this License or out of the use or inability to use the
161
- Work (including but not limited to damages for loss of goodwill,
162
- work stoppage, computer failure or malfunction, or any and all
163
- other commercial damages or losses), even if such Contributor
164
- has been advised of the possibility of such damages.
165
-
166
- 9. Accepting Warranty or Additional Liability. While redistributing
167
- the Work or Derivative Works thereof, You may choose to offer,
168
- and charge a fee for, acceptance of support, warranty, indemnity,
169
- or other liability obligations and/or rights consistent with this
170
- License. However, in accepting such obligations, You may act only
171
- on Your own behalf and on Your sole responsibility, not on behalf
172
- of any other Contributor, and only if You agree to indemnify,
173
- defend, and hold each Contributor harmless for any liability
174
- incurred by, or claims asserted against, such Contributor by reason
175
- of your accepting any such warranty or additional liability.
176
-
177
- END OF TERMS AND CONDITIONS
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/vendor/pdfjs/mozila/web/images/annotation-check.svg DELETED
@@ -1,11 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
- <svg
3
- xmlns="http://www.w3.org/2000/svg"
4
- width="40"
5
- height="40"
6
- viewBox="0 0 40 40">
7
- <path
8
- d="M 1.5006714,23.536225 6.8925879,18.994244 14.585721,26.037937 34.019683,4.5410479 38.499329,9.2235032 14.585721,35.458952 z"
9
- id="path4"
10
- style="fill:#ffff00;fill-opacity:1;stroke:#000000;stroke-width:1.25402856;stroke-opacity:1" />
11
- </svg>
 
 
 
 
 
 
 
 
 
 
 
assets/vendor/pdfjs/mozila/web/images/annotation-comment.svg DELETED
@@ -1,16 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
- <svg
3
- xmlns="http://www.w3.org/2000/svg"
4
- height="40"
5
- width="40"
6
- viewBox="0 0 40 40">
7
- <rect
8
- style="fill:#ffff00;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
9
- width="33.76017"
10
- height="33.76017"
11
- x="3.119915"
12
- y="3.119915" />
13
- <path
14
- d="m 20.677967,8.54499 c -7.342801,0 -13.295293,4.954293 -13.295293,11.065751 0,2.088793 0.3647173,3.484376 1.575539,5.150563 L 6.0267418,31.45501 13.560595,29.011117 c 2.221262,1.387962 4.125932,1.665377 7.117372,1.665377 7.3428,0 13.295291,-4.954295 13.295291,-11.065753 0,-6.111458 -5.952491,-11.065751 -13.295291,-11.065751 z"
15
- style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.93031836;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"/>
16
- </svg>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/vendor/pdfjs/mozila/web/images/annotation-help.svg DELETED
@@ -1,26 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
- <svg
3
- xmlns="http://www.w3.org/2000/svg"
4
- width="40"
5
- height="40"
6
- viewBox="0 0 40 40">
7
- <g
8
- transform="translate(0,-60)"
9
- id="layer1">
10
- <rect
11
- width="36.460953"
12
- height="34.805603"
13
- x="1.7695236"
14
- y="62.597198"
15
- style="fill:#ffff00;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.30826771;stroke-opacity:1" />
16
- <g
17
- transform="matrix(0.88763677,0,0,0.88763677,2.2472646,8.9890584)">
18
- <path
19
- d="M 20,64.526342 C 11.454135,64.526342 4.5263421,71.454135 4.5263421,80 4.5263421,88.545865 11.454135,95.473658 20,95.473658 28.545865,95.473658 35.473658,88.545865 35.473658,80 35.473658,71.454135 28.545865,64.526342 20,64.526342 z m -0.408738,9.488564 c 3.527079,0 6.393832,2.84061 6.393832,6.335441 0,3.494831 -2.866753,6.335441 -6.393832,6.335441 -3.527079,0 -6.393832,-2.84061 -6.393832,-6.335441 0,-3.494831 2.866753,-6.335441 6.393832,-6.335441 z"
20
- style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1.02768445;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
21
- <path
22
- d="m 7.2335209,71.819938 4.9702591,4.161823 c -1.679956,2.581606 -1.443939,6.069592 0.159325,8.677725 l -5.1263071,3.424463 c 0.67516,1.231452 3.0166401,3.547686 4.2331971,4.194757 l 3.907728,-4.567277 c 2.541952,1.45975 5.730694,1.392161 8.438683,-0.12614 l 3.469517,6.108336 c 1.129779,-0.44367 4.742234,-3.449633 5.416358,-5.003859 l -5.46204,-4.415541 c 1.44319,-2.424098 1.651175,-5.267515 0.557303,-7.748623 l 5.903195,-3.833951 C 33.14257,71.704996 30.616217,69.018606 29.02952,67.99296 l -4.118813,4.981678 C 22.411934,71.205099 18.900853,70.937534 16.041319,72.32916 l -3.595408,-5.322091 c -1.345962,0.579488 -4.1293881,2.921233 -5.2123901,4.812869 z m 8.1010311,3.426672 c 2.75284,-2.446266 6.769149,-2.144694 9.048998,0.420874 2.279848,2.56557 2.113919,6.596919 -0.638924,9.043185 -2.752841,2.446267 -6.775754,2.13726 -9.055604,-0.428308 -2.279851,-2.565568 -2.107313,-6.589485 0.64553,-9.035751 z"
23
- style="fill:#000000;fill-opacity:1;stroke:none" />
24
- </g>
25
- </g>
26
- </svg>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/vendor/pdfjs/mozila/web/images/annotation-insert.svg DELETED
@@ -1,10 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
- <svg
3
- xmlns="http://www.w3.org/2000/svg"
4
- width="64"
5
- height="64"
6
- viewBox="0 0 64 64">
7
- <path
8
- d="M 32.003143,1.4044602 57.432701,62.632577 6.5672991,62.627924 z"
9
- style="fill:#ffff00;fill-opacity:0.94117647;fill-rule:nonzero;stroke:#000000;stroke-width:1.00493038;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
10
- </svg>
 
 
 
 
 
 
 
 
 
 
assets/vendor/pdfjs/mozila/web/images/annotation-key.svg DELETED
@@ -1,11 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
- <svg
3
- xmlns="http://www.w3.org/2000/svg"
4
- width="64"
5
- height="64"
6
- viewBox="0 0 64 64">
7
- <path
8
- d="M 25.470843,9.4933766 C 25.30219,12.141818 30.139101,14.445969 34.704831,13.529144 40.62635,12.541995 41.398833,7.3856498 35.97505,5.777863 31.400921,4.1549155 25.157674,6.5445892 25.470843,9.4933766 z M 4.5246282,17.652051 C 4.068249,11.832873 9.2742983,5.9270407 18.437379,3.0977088 29.751911,-0.87185184 45.495663,1.4008022 53.603953,7.1104009 c 9.275765,6.1889221 7.158128,16.2079421 -3.171076,21.5939521 -1.784316,1.635815 -6.380222,1.21421 -7.068351,3.186186 -1.04003,0.972427 -1.288046,2.050158 -1.232864,3.168203 1.015111,2.000108 -3.831548,1.633216 -3.270553,3.759574 0.589477,5.264544 -0.179276,10.53738 -0.362842,15.806257 -0.492006,2.184998 1.163456,4.574232 -0.734888,6.610642 -2.482919,2.325184 -7.30604,2.189143 -9.193497,-0.274767 -2.733688,-1.740626 -8.254447,-3.615254 -6.104247,-6.339626 3.468112,-1.708686 -2.116197,-3.449897 0.431242,-5.080274 5.058402,-1.39256 -2.393215,-2.304318 -0.146889,-4.334645 3.069198,-0.977415 2.056986,-2.518352 -0.219121,-3.540397 1.876567,-1.807151 1.484149,-4.868919 -2.565455,-5.942205 0.150866,-1.805474 2.905737,-4.136876 -1.679967,-5.20493 C 10.260902,27.882167 4.6872697,22.95045 4.5245945,17.652051 z"
9
- id="path604"
10
- style="fill:#ffff00;fill-opacity:1;stroke:#000000;stroke-width:1.72665179;stroke-opacity:1" />
11
- </svg>
 
 
 
 
 
 
 
 
 
 
 
assets/vendor/pdfjs/mozila/web/images/annotation-newparagraph.svg DELETED
@@ -1,11 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
- <svg
3
- xmlns="http://www.w3.org/2000/svg"
4
- width="64"
5
- height="64"
6
- viewBox="0 0 64 64">
7
- <path
8
- d="M 32.003143,10.913072 57.432701,53.086929 6.567299,53.083723 z"
9
- id="path2985"
10
- style="fill:#ffff00;fill-opacity:0.94117647;fill-rule:nonzero;stroke:#000000;stroke-width:0.83403099;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
11
- </svg>
 
 
 
 
 
 
 
 
 
 
 
assets/vendor/pdfjs/mozila/web/images/annotation-noicon.svg DELETED
@@ -1,7 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
- <svg
3
- xmlns="http://www.w3.org/2000/svg"
4
- width="40"
5
- height="40"
6
- viewBox="0 0 40 40">
7
- </svg>
 
 
 
 
 
 
 
assets/vendor/pdfjs/mozila/web/images/annotation-note.svg DELETED
@@ -1,42 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
- <svg
3
- xmlns="http://www.w3.org/2000/svg"
4
- width="40"
5
- height="40"
6
- viewBox="0 0 40 40">
7
- <rect
8
- width="36.075428"
9
- height="31.096582"
10
- x="1.962286"
11
- y="4.4517088"
12
- id="rect4"
13
- style="fill:#ffff00;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.23004246;stroke-opacity:1" />
14
- <rect
15
- width="27.96859"
16
- height="1.5012145"
17
- x="6.0157046"
18
- y="10.285"
19
- id="rect6"
20
- style="fill:#000000;fill-opacity:1;stroke:none" />
21
- <rect
22
- width="27.96859"
23
- height="0.85783684"
24
- x="6.0157056"
25
- y="23.21689"
26
- id="rect8"
27
- style="fill:#000000;fill-opacity:1;stroke:none" />
28
- <rect
29
- width="27.96859"
30
- height="0.85783684"
31
- x="5.8130345"
32
- y="28.964394"
33
- id="rect10"
34
- style="fill:#000000;fill-opacity:1;stroke:none" />
35
- <rect
36
- width="27.96859"
37
- height="0.85783684"
38
- x="6.0157046"
39
- y="17.426493"
40
- id="rect12"
41
- style="fill:#000000;fill-opacity:1;stroke:none" />
42
- </svg>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/vendor/pdfjs/mozila/web/images/annotation-paragraph.svg DELETED
@@ -1,16 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
- <svg
3
- xmlns="http://www.w3.org/2000/svg"
4
- width="40"
5
- height="40"
6
- viewBox="0 0 40 40">
7
- <rect
8
- width="33.76017"
9
- height="33.76017"
10
- x="3.119915"
11
- y="3.119915"
12
- style="fill:#ffff00;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
13
- <path
14
- d="m 17.692678,34.50206 0,-16.182224 c -1.930515,-0.103225 -3.455824,-0.730383 -4.57593,-1.881473 -1.12011,-1.151067 -1.680164,-2.619596 -1.680164,-4.405591 0,-1.992435 0.621995,-3.5796849 1.865988,-4.7617553 1.243989,-1.1820288 3.06352,-1.7730536 5.458598,-1.7730764 l 9.802246,0 0,2.6789711 -2.229895,0 0,26.3251486 -2.632515,0 0,-26.3251486 -3.45324,0 0,26.3251486 z"
15
- style="font-size:29.42051125px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1.07795751;stroke-opacity:1;font-family:Arial;-inkscape-font-specification:Arial" />
16
- </svg>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/vendor/pdfjs/mozila/web/images/findbarButton-next.svg DELETED
@@ -1,4 +0,0 @@
1
- <!-- This Source Code Form is subject to the terms of the Mozilla Public
2
- - License, v. 2.0. If a copy of the MPL was not distributed with this
3
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
4
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path d="M8 12a1 1 0 0 1-.707-.293l-5-5a1 1 0 0 1 1.414-1.414L8 9.586l4.293-4.293a1 1 0 0 1 1.414 1.414l-5 5A1 1 0 0 1 8 12z"></path></svg>
 
 
 
 
assets/vendor/pdfjs/mozila/web/images/findbarButton-previous.svg DELETED
@@ -1,4 +0,0 @@
1
- <!-- This Source Code Form is subject to the terms of the Mozilla Public
2
- - License, v. 2.0. If a copy of the MPL was not distributed with this
3
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
4
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path d="M13 11a1 1 0 0 1-.707-.293L8 6.414l-4.293 4.293a1 1 0 0 1-1.414-1.414l5-5a1 1 0 0 1 1.414 0l5 5A1 1 0 0 1 13 11z"></path></svg>
 
 
 
 
assets/vendor/pdfjs/mozila/web/images/grab.cur DELETED
Binary file
assets/vendor/pdfjs/mozila/web/images/grabbing.cur DELETED
Binary file
assets/vendor/pdfjs/mozila/web/images/loading-dark.svg DELETED
@@ -1,24 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"
2
- fill="rgba(255,255,255,1)" style="animation:spinLoadingIcon 1s steps(12,end)
3
- infinite"><style>@keyframes
4
- spinLoadingIcon{to{transform:rotate(360deg)}}</style><path
5
- d="M7 3V1s0-1 1-1 1 1 1 1v2s0 1-1 1-1-1-1-1z"/><path d="M4.63
6
- 4.1l-1-1.73S3.13 1.5 4 1c.87-.5 1.37.37 1.37.37l1 1.73s.5.87-.37
7
- 1.37c-.87.57-1.37-.37-1.37-.37z" fill-opacity=".93"/><path
8
- d="M3.1 6.37l-1.73-1S.5 4.87 1 4c.5-.87 1.37-.37 1.37-.37l1.73 1s.87.5.37
9
- 1.37c-.5.87-1.37.37-1.37.37z" fill-opacity=".86"/><path d="M3
10
- 9H1S0 9 0 8s1-1 1-1h2s1 0 1 1-1 1-1 1z" fill-opacity=".79"/><path d="M4.1 11.37l-1.73 1S1.5 12.87 1
11
- 12c-.5-.87.37-1.37.37-1.37l1.73-1s.87-.5 1.37.37c.5.87-.37 1.37-.37 1.37z"
12
- fill-opacity=".72"/><path d="M3.63 13.56l1-1.73s.5-.87
13
- 1.37-.37c.87.5.37 1.37.37 1.37l-1 1.73s-.5.87-1.37.37c-.87-.5-.37-1.37-.37-1.37z"
14
- fill-opacity=".65"/><path d="M7 15v-2s0-1 1-1 1 1 1 1v2s0 1-1
15
- 1-1-1-1-1z" fill-opacity=".58"/><path d="M10.63
16
- 14.56l-1-1.73s-.5-.87.37-1.37c.87-.5 1.37.37 1.37.37l1 1.73s.5.87-.37
17
- 1.37c-.87.5-1.37-.37-1.37-.37z" fill-opacity=".51"/><path
18
- d="M13.56 12.37l-1.73-1s-.87-.5-.37-1.37c.5-.87 1.37-.37 1.37-.37l1.73 1s.87.5.37
19
- 1.37c-.5.87-1.37.37-1.37.37z" fill-opacity=".44"/><path d="M15
20
- 9h-2s-1 0-1-1 1-1 1-1h2s1 0 1 1-1 1-1 1z" fill-opacity=".37"/><path d="M14.56 5.37l-1.73
21
- 1s-.87.5-1.37-.37c-.5-.87.37-1.37.37-1.37l1.73-1s.87-.5 1.37.37c.5.87-.37 1.37-.37
22
- 1.37z" fill-opacity=".3"/><path d="M9.64 3.1l.98-1.66s.5-.874
23
- 1.37-.37c.87.5.37 1.37.37 1.37l-1 1.73s-.5.87-1.37.37c-.87-.5-.37-1.37-.37-1.37z"
24
- fill-opacity=".23"/></svg>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/vendor/pdfjs/mozila/web/images/loading-icon.gif DELETED
Binary file
assets/vendor/pdfjs/mozila/web/images/loading.svg DELETED
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" style="animation:spinLoadingIcon 1s steps(12,end) infinite"><style>@keyframes spinLoadingIcon{to{transform:rotate(360deg)}}</style><path d="M7 3V1s0-1 1-1 1 1 1 1v2s0 1-1 1-1-1-1-1z"/><path d="M4.63 4.1l-1-1.73S3.13 1.5 4 1c.87-.5 1.37.37 1.37.37l1 1.73s.5.87-.37 1.37c-.87.57-1.37-.37-1.37-.37z" fill-opacity=".93"/><path d="M3.1 6.37l-1.73-1S.5 4.87 1 4c.5-.87 1.37-.37 1.37-.37l1.73 1s.87.5.37 1.37c-.5.87-1.37.37-1.37.37z" fill-opacity=".86"/><path d="M3 9H1S0 9 0 8s1-1 1-1h2s1 0 1 1-1 1-1 1z" fill-opacity=".79"/><path d="M4.1 11.37l-1.73 1S1.5 12.87 1 12c-.5-.87.37-1.37.37-1.37l1.73-1s.87-.5 1.37.37c.5.87-.37 1.37-.37 1.37z" fill-opacity=".72"/><path d="M3.63 13.56l1-1.73s.5-.87 1.37-.37c.87.5.37 1.37.37 1.37l-1 1.73s-.5.87-1.37.37c-.87-.5-.37-1.37-.37-1.37z" fill-opacity=".65"/><path d="M7 15v-2s0-1 1-1 1 1 1 1v2s0 1-1 1-1-1-1-1z" fill-opacity=".58"/><path d="M10.63 14.56l-1-1.73s-.5-.87.37-1.37c.87-.5 1.37.37 1.37.37l1 1.73s.5.87-.37 1.37c-.87.5-1.37-.37-1.37-.37z" fill-opacity=".51"/><path d="M13.56 12.37l-1.73-1s-.87-.5-.37-1.37c.5-.87 1.37-.37 1.37-.37l1.73 1s.87.5.37 1.37c-.5.87-1.37.37-1.37.37z" fill-opacity=".44"/><path d="M15 9h-2s-1 0-1-1 1-1 1-1h2s1 0 1 1-1 1-1 1z" fill-opacity=".37"/><path d="M14.56 5.37l-1.73 1s-.87.5-1.37-.37c-.5-.87.37-1.37.37-1.37l1.73-1s.87-.5 1.37.37c.5.87-.37 1.37-.37 1.37z" fill-opacity=".3"/><path d="M9.64 3.1l.98-1.66s.5-.874 1.37-.37c.87.5.37 1.37.37 1.37l-1 1.73s-.5.87-1.37.37c-.87-.5-.37-1.37-.37-1.37z" fill-opacity=".23"/></svg>
 
assets/vendor/pdfjs/mozila/web/images/secondaryToolbarButton-documentProperties.svg DELETED
@@ -1,15 +0,0 @@
1
- <!-- This Source Code Form is subject to the terms of the Mozilla Public
2
- - License, v. 2.0. If a copy of the MPL was not distributed with this
3
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
4
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16
5
- 16">
6
- <path
7
- d="M8 16a8 8 0 1 1 8-8 8.009 8.009 0 0 1-8 8zM8 2a6 6 0 1 0 6 6 6.006 6.006 0 0 0-6-6z">
8
- </path>
9
- <path
10
- d="M8 7a1 1 0 0 0-1 1v3a1 1 0 0 0 2 0V8a1 1 0 0 0-1-1z">
11
- </path>
12
- <circle
13
- cx="8" cy="5" r="1.188">
14
- </circle>
15
- </svg>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/vendor/pdfjs/mozila/web/images/secondaryToolbarButton-firstPage.svg DELETED
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M13 13c-.3 0-.5-.1-.7-.3L8 8.4l-4.3 4.3c-.9.9-2.3-.5-1.4-1.4l5-5c.4-.4 1-.4 1.4 0l5 5c.6.6.2 1.7-.7 1.7zm0-11H3C1.7 2 1.7 4 3 4h10c1.3 0 1.3-2 0-2z"/></svg>
 
assets/vendor/pdfjs/mozila/web/images/secondaryToolbarButton-handTool.svg DELETED
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"><path d="M15 3.7V13c0 1.5-1.53 3-3 3H7.13c-.72 0-1.63-.5-2.13-1l-5-5s.84-1 .87-1c.13-.1.33-.2.53-.2.1 0 .3.1.4.2L4 10.6V2.7c0-.6.4-1 1-1s1 .4 1 1v4.6h1V1c0-.6.4-1 1-1s1 .4 1 1v6.3h1V1.7c0-.6.4-1 1-1s1 .4 1 1v5.7h1V3.7c0-.6.4-1 1-1s1 .4 1 1z"/></svg>
 
assets/vendor/pdfjs/mozila/web/images/secondaryToolbarButton-lastPage.svg DELETED
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M8 10c-.3 0-.5-.1-.7-.3l-5-5c-.9-.9.5-2.3 1.4-1.4L8 7.6l4.3-4.3c.9-.9 2.3.5 1.4 1.4l-5 5c-.2.2-.4.3-.7.3zm5 2H3c-1.3 0-1.3 2 0 2h10c1.3 0 1.3-2 0-2z"/></svg>
 
assets/vendor/pdfjs/mozila/web/images/secondaryToolbarButton-rotateCcw.svg DELETED
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"><path d="M1 1a1 1 0 011 1v2.4A7 7 0 118 15a7 7 0 01-4.9-2 1 1 0 011.4-1.5 5 5 0 10-1-5.5H6a1 1 0 010 2H1a1 1 0 01-1-1V2a1 1 0 011-1z"/></svg>
 
assets/vendor/pdfjs/mozila/web/images/secondaryToolbarButton-rotateCw.svg DELETED
@@ -1,4 +0,0 @@
1
- <!-- This Source Code Form is subject to the terms of the Mozilla Public
2
- - License, v. 2.0. If a copy of the MPL was not distributed with this
3
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
4
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path d="M15 1a1 1 0 0 0-1 1v2.418A6.995 6.995 0 1 0 8 15a6.954 6.954 0 0 0 4.95-2.05 1 1 0 0 0-1.414-1.414A5.019 5.019 0 1 1 12.549 6H10a1 1 0 0 0 0 2h5a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1z"></path></svg>
 
 
 
 
assets/vendor/pdfjs/mozila/web/images/secondaryToolbarButton-scrollHorizontal.svg DELETED
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"><path d="M0 4h1.5c1 0 1.5.5 1.5 1.5v5c0 1-.5 1.5-1.5 1.5H0zM9.5 4c1 0 1.5.5 1.5 1.5v5c0 1-.5 1.5-1.5 1.5h-3c-1 0-1.5-.5-1.5-1.5v-5C5 4.5 5.5 4 6.5 4zM16 4h-1.5c-1 0-1.5.5-1.5 1.5v5c0 1 .5 1.5 1.5 1.5H16z"/></svg>
 
assets/vendor/pdfjs/mozila/web/images/secondaryToolbarButton-scrollVertical.svg DELETED
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"><path d="M9.5 4c1 0 1.5.5 1.5 1.5v5c0 1-.5 1.5-1.5 1.5h-3c-1 0-1.5-.5-1.5-1.5v-5C5 4.5 5.5 4 6.5 4zM11 0v.5c0 1-.5 1.5-1.5 1.5h-3C5.5 2 5 1.5 5 .5V0h6zM11 16v-.5c0-1-.5-1.5-1.5-1.5h-3c-1 0-1.5.5-1.5 1.5v.5h6z"/></svg>
 
assets/vendor/pdfjs/mozila/web/images/secondaryToolbarButton-scrollWrapped.svg DELETED
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M5.5 4c1 0 1.5.5 1.5 1.5v5c0 1-.5 1.5-1.5 1.5h-3c-1 0-1.5-.5-1.5-1.5v-5C1 4.5 1.5 4 2.5 4zM7 0v.5C7 1.5 6.5 2 5.5 2h-3C1.5 2 1 1.5 1 .5V0h6zM7 16v-.5c0-1-.5-1.5-1.5-1.5h-3c-1 0-1.5.5-1.5 1.5v.5h6zM13.5 4c1 0 1.5.5 1.5 1.5v5c0 1-.5 1.5-1.5 1.5h-3c-1 0-1.5-.5-1.5-1.5v-5c0-1 .5-1.5 1.5-1.5zM15 0v.5c0 1-.5 1.5-1.5 1.5h-3C9.5 2 9 1.5 9 .5V0h6zM15 16v-.507c0-1-.5-1.5-1.5-1.5h-3C9.5 14 9 14.5 9 15.5v.5h6z"/></svg>
 
assets/vendor/pdfjs/mozila/web/images/secondaryToolbarButton-selectTool.svg DELETED
@@ -1,4 +0,0 @@
1
- <!-- This Source Code Form is subject to the terms of the Mozilla Public
2
- - License, v. 2.0. If a copy of the MPL was not distributed with this
3
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
4
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path d="M12.408 8.217l-8.083-6.7A.2.2 0 0 0 4 1.672V12.3a.2.2 0 0 0 .333.146l2.56-2.372 1.857 3.9A1.125 1.125 0 1 0 10.782 13L8.913 9.075l3.4-.51a.2.2 0 0 0 .095-.348z"></path></svg>
 
 
 
 
assets/vendor/pdfjs/mozila/web/images/secondaryToolbarButton-spreadEven.svg DELETED
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M1.5 3.5C.5 3.5 0 4 0 5v6.5c0 1 .5 1.5 1.5 1.5h4c1 0 1.5-.5 1.5-1.5V5c0-1-.5-1.5-1.5-1.5zm2 1.2c.8 0 1.4.2 1.8.6.5.4.7 1 .7 1.7 0 .5-.2 1-.5 1.4-.2.3-.5.7-1 1l-.6.4c-.4.3-.6.4-.75.56-.15.14-.25.24-.35.44H6v1.3H1c0-.6.1-1.1.3-1.5.3-.6.7-1 1.5-1.6.7-.4 1.1-.8 1.28-1 .32-.3.42-.6.42-1 0-.3-.1-.6-.23-.8-.17-.2-.37-.3-.77-.3s-.7.1-.9.5c-.04.2-.1.5-.1.9H1.1c0-.6.1-1.1.3-1.5.4-.7 1.1-1.1 2.1-1.1zM10.54 3.54C9.5 3.54 9 4 9 5v6.5c0 1 .5 1.5 1.54 1.5h4c.96 0 1.46-.5 1.46-1.5V5c0-1-.5-1.46-1.5-1.46zm1.9.95c.7 0 1.3.2 1.7.5.4.4.6.8.6 1.4 0 .4-.1.8-.4 1.1-.2.2-.3.3-.5.4.1 0 .3.1.6.3.4.3.5.8.5 1.4 0 .6-.2 1.2-.6 1.6-.4.5-1.1.7-1.9.7-1 0-1.8-.3-2.2-1-.14-.29-.24-.69-.24-1.29h1.4c0 .3 0 .5.1.7.2.4.5.5 1 .5.3 0 .5-.1.7-.3.2-.2.3-.5.3-.8 0-.5-.2-.8-.6-.95-.2-.05-.5-.15-1-.15v-1c.5 0 .8-.1 1-.14.3-.1.5-.4.5-.9 0-.3-.1-.5-.2-.7-.2-.2-.4-.3-.7-.3-.3 0-.6.1-.75.3-.2.2-.2.5-.2.86h-1.34c0-.4.1-.7.19-1.1 0-.12.2-.32.4-.62.2-.2.4-.3.7-.4.3-.1.6-.1 1-.1z"/></svg>
 
assets/vendor/pdfjs/mozila/web/images/secondaryToolbarButton-spreadNone.svg DELETED
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"><path d="M6 3c-1 0-1.5.5-1.5 1.5v7c0 1 .5 1.5 1.5 1.5h4c1 0 1.5-.5 1.5-1.5v-7c0-1-.5-1.5-1.5-1.5z"/></svg>
 
assets/vendor/pdfjs/mozila/web/images/secondaryToolbarButton-spreadOdd.svg DELETED
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M10.56 3.5C9.56 3.5 9 4 9 5v6.5c0 1 .5 1.5 1.5 1.5h4c1 0 1.5-.5 1.5-1.5V5c0-1-.5-1.5-1.5-1.5zm1.93 1.2c.8 0 1.4.2 1.8.64.5.4.7 1 .7 1.7 0 .5-.2 1-.5 1.44-.2.3-.6.6-1 .93l-.6.4c-.4.3-.6.4-.7.55-.1.1-.2.2-.3.4h3.2v1.27h-5c0-.5.1-1 .3-1.43.2-.49.7-1 1.5-1.54.7-.5 1.1-.8 1.3-1.02.3-.3.4-.7.4-1.05 0-.3-.1-.6-.3-.77-.2-.2-.4-.3-.7-.3-.4 0-.7.2-.9.5-.1.2-.1.5-.2.9h-1.4c0-.6.2-1.1.3-1.5.4-.7 1.1-1.1 2-1.1zM1.54 3.5C.54 3.5 0 4 0 5v6.5c0 1 .5 1.5 1.54 1.5h4c1 0 1.5-.5 1.5-1.5V5c0-1-.5-1.5-1.5-1.5zm1.8 1.125H4.5V12H3V6.9H1.3v-1c.5 0 .8 0 .97-.03.33-.07.53-.17.73-.37.1-.2.2-.3.25-.5.05-.2.05-.3.05-.3z"/></svg>
 
assets/vendor/pdfjs/mozila/web/images/shadow.png DELETED
Binary file
assets/vendor/pdfjs/mozila/web/images/toolbarButton-bookmark.svg DELETED
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"><path d="M4 16V2s0-1 1-1h6s1 0 1 1v14l-4-5z"/></svg>
 
assets/vendor/pdfjs/mozila/web/images/toolbarButton-currentOutlineItem.svg DELETED
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"><path d="m14 9h-6c-1.3 0-1.3 2 0 2h6c1.3 0 1.3-2 0-2zm-5.2-8h-3.8c-1.3 0-1.3 2 0 2h1.7zm-6.8 0c-1 0-1.3 1-0.7 1.7 0.7 0.6 1.7 0.3 1.7-0.7 0-0.5-0.4-1-1-1zm3 8c-1 0-1.3 1-0.7 1.7 0.6 0.6 1.7 0.2 1.7-0.7 0-0.5-0.4-1-1-1zm0.3-4h-0.3c-1.4 0-1.4 2 0 2h2.3zm-3.3 0c-0.9 0-1.4 1-0.7 1.7 0.7 0.6 1.7 0.2 1.7-0.7 0-0.6-0.5-1-1-1zm12 8h-9c-1.3 0-1.3 2 0 2h9c1.3 0 1.3-2 0-2zm-12 0c-1 0-1.3 1-0.7 1.7 0.7 0.6 1.7 0.2 1.7-0.712 0-0.5-0.4-1-1-1z"/><path d="m7.37 4.838 3.93-3.911v2.138h3.629v3.546h-3.629v2.138l-3.93-3.911"/></svg>
 
assets/vendor/pdfjs/mozila/web/images/toolbarButton-download.svg DELETED
@@ -1,4 +0,0 @@
1
- <!-- This Source Code Form is subject to the terms of the Mozilla Public
2
- - License, v. 2.0. If a copy of the MPL was not distributed with this
3
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
4
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path d="M14 3h-2v2h2v8H2V5h7V3h-.849L6.584 1.538A2 2 0 0 0 5.219 1H2a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2zM2 3h3.219l1.072 1H2z"></path><path d="M8.146 6.146a.5.5 0 0 0 0 .707l2 2a.5.5 0 0 0 .707 0l2-2a.5.5 0 1 0-.707-.707L11 7.293V.5a.5.5 0 0 0-1 0v6.793L8.854 6.146a.5.5 0 0 0-.708 0z"></path></svg>
 
 
 
 
assets/vendor/pdfjs/mozila/web/images/toolbarButton-menuArrow.svg DELETED
@@ -1 +0,0 @@
1
- <svg width="16" height="16" xmlns="http://www.w3.org/2000/svg"><path d="M8 11a1 1 0 01-.707-.293l-2.99-2.99c-.91-.942.471-2.324 1.414-1.414L8 8.586l2.283-2.283c.943-.91 2.324.472 1.414 1.414l-2.99 2.99A1 1 0 018 11z"/></svg>
 
assets/vendor/pdfjs/mozila/web/images/toolbarButton-openFile.svg DELETED
@@ -1,4 +0,0 @@
1
- <!-- This Source Code Form is subject to the terms of the Mozilla Public
2
- - License, v. 2.0. If a copy of the MPL was not distributed with this
3
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
4
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path d="M14.859 3.2a1.335 1.335 0 0 1-1.217.8H13v1h1v8H2V5h8V4h-.642a1.365 1.365 0 0 1-1.325-1.11L6.584 1.538A2 2 0 0 0 5.219 1H2a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V5a2 2 0 0 0-1.141-1.8zM2 3h3.219l1.072 1H2zm7.854-.146L11 1.707V8.5a.5.5 0 0 0 1 0V1.707l1.146 1.146a.5.5 0 1 0 .707-.707l-2-2a.5.5 0 0 0-.707 0l-2 2a.5.5 0 0 0 .707.707z"></path></svg>
 
 
 
 
assets/vendor/pdfjs/mozila/web/images/toolbarButton-pageDown.svg DELETED
@@ -1,7 +0,0 @@
1
- <!-- This Source Code Form is subject to the terms of the Mozilla Public
2
- - License, v. 2.0. If a copy of the MPL was not distributed with this
3
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
4
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16
5
- 16"><path transform='rotate(90) translate(0, -16)'
6
- d="M15.707 7.293l-6-6a1 1 0 0 0-1.414 1.414L12.586 7H1a1 1 0 0 0 0 2h11.586l-4.293
7
- 4.293a1 1 0 1 0 1.414 1.414l6-6a1 1 0 0 0 0-1.414z"></path></svg>
 
 
 
 
 
 
 
assets/vendor/pdfjs/mozila/web/images/toolbarButton-pageUp.svg DELETED
@@ -1,12 +0,0 @@
1
- <!-- This Source Code Form is subject to the terms of the Mozilla Public
2
- - License, v. 2.0. If a copy of the MPL was not distributed with this
3
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
4
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16
5
- 16">
6
- <path
7
- transform='rotate(90) translate(0, -16)'
8
- d="M15 7H3.414l4.293-4.293a1 1 0 0
9
- 0-1.414-1.414l-6 6a1 1 0 0 0 0 1.414l6 6a1 1 0 0 0 1.414-1.414L3.414 9H15a1 1 0 0
10
- 0 0-2z">
11
- </path>
12
- </svg>
 
 
 
 
 
 
 
 
 
 
 
 
assets/vendor/pdfjs/mozila/web/images/toolbarButton-presentationMode.svg DELETED
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M.5 1H7s0-1 1-1 1 1 1 1h6.5s.5 0 .5.5-.5.5-.5.5H.5S0 2 0 1.5.5 1 .5 1zM1 3h14v7c0 2-1 2-2 2H3c-1 0-2 0-2-2zm5 1v7l6-3.5zM3.72 15.33l.53-2s0-.5.65-.35c.51.13.38.63.38.63l-.53 2s0 .5-.64.35c-.53-.13-.39-.63-.39-.63zM11.24 15.61l-.53-1.99s0-.5.38-.63c.51-.13.64.35.64.35l.53 2s0 .5-.38.63c-.5.13-.64-.35-.65-.35z"/></svg>
 
assets/vendor/pdfjs/mozila/web/images/toolbarButton-print.svg DELETED
@@ -1,4 +0,0 @@
1
- <!-- This Source Code Form is subject to the terms of the Mozilla Public
2
- - License, v. 2.0. If a copy of the MPL was not distributed with this
3
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
4
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path d="M14 5h-1V1a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v4H2a2 2 0 0 0-2 2v5h3v3a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-3h3V7a2 2 0 0 0-2-2zM2.5 8a.5.5 0 1 1 .5-.5.5.5 0 0 1-.5.5zm9.5 7H4v-5h8zm0-10H4V1h8zm-6.5 7h4a.5.5 0 0 0 0-1h-4a.5.5 0 1 0 0 1zm0 2h5a.5.5 0 0 0 0-1h-5a.5.5 0 1 0 0 1z"></path></svg>
 
 
 
 
assets/vendor/pdfjs/mozila/web/images/toolbarButton-search.svg DELETED
@@ -1,4 +0,0 @@
1
- <!-- This Source Code Form is subject to the terms of the Mozilla Public
2
- - License, v. 2.0. If a copy of the MPL was not distributed with this
3
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
4
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path d="M15.707 14.293l-4.822-4.822a6.019 6.019 0 1 0-1.414 1.414l4.822 4.822a1 1 0 0 0 1.414-1.414zM6 10a4 4 0 1 1 4-4 4 4 0 0 1-4 4z"></path></svg>
 
 
 
 
assets/vendor/pdfjs/mozila/web/images/toolbarButton-secondaryToolbarToggle.svg DELETED
@@ -1,4 +0,0 @@
1
- <!-- This Source Code Form is subject to the terms of the Mozilla Public
2
- - License, v. 2.0. If a copy of the MPL was not distributed with this
3
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
4
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path d="M8.707 7.293l-5-5a1 1 0 0 0-1.414 1.414L6.586 8l-4.293 4.293a1 1 0 1 0 1.414 1.414l5-5a1 1 0 0 0 0-1.414zm6 0l-5-5a1 1 0 0 0-1.414 1.414L12.586 8l-4.293 4.293a1 1 0 1 0 1.414 1.414l5-5a1 1 0 0 0 0-1.414z"></path></svg>
 
 
 
 
assets/vendor/pdfjs/mozila/web/images/toolbarButton-sidebarToggle.svg DELETED
@@ -1,4 +0,0 @@
1
- <!-- This Source Code Form is subject to the terms of the Mozilla Public
2
- - License, v. 2.0. If a copy of the MPL was not distributed with this
3
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
4
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path d="M3 1h10a3.008 3.008 0 0 1 3 3v8a3.009 3.009 0 0 1-3 3H3a3.005 3.005 0 0 1-3-3V4a3.013 3.013 0 0 1 3-3zm11 11V4a1 1 0 0 0-1-1H8v10h5a1 1 0 0 0 1-1zM2 12a1 1 0 0 0 1 1h4V3H3a1 1 0 0 0-1 1v8z"></path><path d="M3.5 5h2a.5.5 0 0 0 0-1h-2a.5.5 0 0 0 0 1zm0 2h2a.5.5 0 0 0 0-1h-2a.5.5 0 0 0 0 1zm1 2h1a.5.5 0 0 0 0-1h-1a.5.5 0 0 0 0 1z"></path></svg>
 
 
 
 
assets/vendor/pdfjs/mozila/web/images/toolbarButton-viewAttachments.svg DELETED
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"><path d="M6.2 2s.5-.5 1.06 0c.5.5 0 1 0 1l-4.6 4.61s-2.5 2.5 0 5 5 0 5 0L13.8 6.4s1.6-1.6 0-3.2-3.2 0-3.2 0L5.8 8s-.7.7 0 1.4 1.4 0 1.4 0l3.9-3.9s.6-.5 1 0c.5.5 0 1 0 1l-3.8 4s-1.8 1.8-3.5 0C3 8.7 4.8 7 4.8 7l4.7-4.9s2.7-2.6 5.3 0c2.6 2.6 0 5.3 0 5.3l-6.2 6.3s-3.5 3.5-7 0 0-7 0-7z"/></svg>
 
assets/vendor/pdfjs/mozila/web/images/toolbarButton-viewLayers.svg DELETED
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4.233 4.233" height="16" width="16"><path d="M.15 2.992c-.198.1-.2.266-.002.365l1.604.802a.93.93 0 00.729-.001l1.602-.801c.198-.1.197-.264 0-.364l-.695-.348c-1.306.595-2.542 0-2.542 0m-.264.53l.658-.329c.6.252 1.238.244 1.754 0l.659.329-1.536.768zM.15 1.935c-.198.1-.198.265 0 .364l1.604.802a.926.926 0 00.727 0l1.603-.802c.198-.099.198-.264 0-.363l-.694-.35c-1.14.56-2.546.001-2.546.001m-.264.53l.664-.332c.52.266 1.261.235 1.75.002l.659.33-1.537.768zM.15.877c-.198.099-.198.264 0 .363l1.604.802a.926.926 0 00.727 0l1.603-.802c.198-.099.198-.264 0-.363L2.481.075a.926.926 0 00-.727 0zm.43.182L2.117.29l1.538.769-1.538.768z"/></svg>
 
assets/vendor/pdfjs/mozila/web/images/toolbarButton-viewOutline.svg DELETED
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"><path d="M14 9H8c-1.3 0-1.3 2 0 2h6c1.3 0 1.3-2 0-2zm0-8H5C3.7 1 3.7 3 5 3h9c1.3 0 1.3-2 0-2zM2 1C1 1 .7 2 1.3 2.7 2 3.3 3 3 3 2c0-.5-.4-1-1-1zm3 8c-1 0-1.3 1-.7 1.7.6.6 1.7.2 1.7-.7 0-.5-.4-1-1-1zM14 5H5C3.6 5 3.6 7 5 7h9c1.3 0 1.3-2 0-2zM2 5c-.9 0-1.4 1-.7 1.7C2 7.3 3 6.9 3 6c0-.6-.5-1-1-1zM14 13H5c-1.3 0-1.3 2 0 2h9c1.3 0 1.3-2 0-2zM2 13c-1 0-1.3 1-.7 1.7.7.6 1.7.2 1.7-.712 0-.5-.4-1-1-1z"/></svg>
 
assets/vendor/pdfjs/mozila/web/images/toolbarButton-viewThumbnail.svg DELETED
@@ -1,4 +0,0 @@
1
- <!-- This Source Code Form is subject to the terms of the Mozilla Public
2
- - License, v. 2.0. If a copy of the MPL was not distributed with this
3
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
4
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><g style="--darkreader-inline-fill:rgba(81, 82, 83, 0.8);" data-darkreader-inline-fill=""><rect x="1" y="1" width="6" height="6" rx="1" ry="1"></rect><rect x="9" y="1" width="6" height="6" rx="1" ry="1"></rect><rect x="1" y="9" width="6" height="6" rx="1" ry="1"></rect><rect x="9" y="9" width="6" height="6" rx="1" ry="1"></rect></g></svg>
 
 
 
 
assets/vendor/pdfjs/mozila/web/images/toolbarButton-zoomIn.svg DELETED
@@ -1,4 +0,0 @@
1
- <!-- This Source Code Form is subject to the terms of the Mozilla Public
2
- - License, v. 2.0. If a copy of the MPL was not distributed with this
3
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
4
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path d="M14 7H9V2a1 1 0 0 0-2 0v5H2a1 1 0 0 0 0 2h5v5a1 1 0 0 0 2 0V9h5a1 1 0 0 0 0-2z"></path></svg>
 
 
 
 
assets/vendor/pdfjs/mozila/web/images/toolbarButton-zoomOut.svg DELETED
@@ -1,4 +0,0 @@
1
- <!-- This Source Code Form is subject to the terms of the Mozilla Public
2
- - License, v. 2.0. If a copy of the MPL was not distributed with this
3
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
4
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><rect x="2" y="7" width="12" height="2" rx="1"></rect></svg>
 
 
 
 
assets/vendor/pdfjs/mozila/web/images/treeitem-collapsed.svg DELETED
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M13 9L6 5v8z"/></svg>
 
assets/vendor/pdfjs/mozila/web/images/treeitem-expanded.svg DELETED
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M10 13l4-7H6z"/></svg>
 
assets/vendor/pdfjs/mozila/web/viewer.css DELETED
@@ -1,2665 +0,0 @@
1
- /* Copyright 2014 Mozilla Foundation
2
- *
3
- * Licensed under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License.
5
- * You may obtain a copy of the License at
6
- *
7
- * http://www.apache.org/licenses/LICENSE-2.0
8
- *
9
- * Unless required by applicable law or agreed to in writing, software
10
- * distributed under the License is distributed on an "AS IS" BASIS,
11
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- * See the License for the specific language governing permissions and
13
- * limitations under the License.
14
- */
15
-
16
- .textLayer {
17
- position: absolute;
18
- text-align: initial;
19
- left: 0;
20
- top: 0;
21
- right: 0;
22
- bottom: 0;
23
- overflow: hidden;
24
- opacity: 0.2;
25
- line-height: 1;
26
- }
27
-
28
- .textLayer span,
29
- .textLayer br {
30
- color: transparent;
31
- position: absolute;
32
- white-space: pre;
33
- cursor: text;
34
- transform-origin: 0% 0%;
35
- }
36
-
37
- .textLayer .highlight {
38
- margin: -1px;
39
- padding: 1px;
40
- background-color: rgba(180, 0, 170, 1);
41
- border-radius: 4px;
42
- }
43
-
44
- .textLayer .highlight.appended {
45
- position: initial;
46
- }
47
-
48
- .textLayer .highlight.begin {
49
- border-radius: 4px 0 0 4px;
50
- }
51
-
52
- .textLayer .highlight.end {
53
- border-radius: 0 4px 4px 0;
54
- }
55
-
56
- .textLayer .highlight.middle {
57
- border-radius: 0;
58
- }
59
-
60
- .textLayer .highlight.selected {
61
- background-color: rgba(0, 100, 0, 1);
62
- }
63
-
64
- .textLayer ::-moz-selection {
65
- background: rgba(0, 0, 255, 1);
66
- }
67
-
68
- .textLayer ::selection {
69
- background: rgba(0, 0, 255, 1);
70
- }
71
-
72
- .textLayer .endOfContent {
73
- display: block;
74
- position: absolute;
75
- left: 0;
76
- top: 100%;
77
- right: 0;
78
- bottom: 0;
79
- z-index: -1;
80
- cursor: default;
81
- -webkit-user-select: none;
82
- -moz-user-select: none;
83
- user-select: none;
84
- }
85
-
86
- .textLayer .endOfContent.active {
87
- top: 0;
88
- }
89
-
90
-
91
- .annotationLayer section {
92
- position: absolute;
93
- text-align: initial;
94
- }
95
-
96
- .annotationLayer .linkAnnotation > a,
97
- .annotationLayer .buttonWidgetAnnotation.pushButton > a {
98
- position: absolute;
99
- font-size: 1em;
100
- top: 0;
101
- left: 0;
102
- width: 100%;
103
- height: 100%;
104
- }
105
-
106
- .annotationLayer .linkAnnotation > a:hover,
107
- .annotationLayer .buttonWidgetAnnotation.pushButton > a:hover {
108
- opacity: 0.2;
109
- background: rgba(255, 255, 0, 1);
110
- box-shadow: 0 2px 10px rgba(255, 255, 0, 1);
111
- }
112
-
113
- .annotationLayer .textAnnotation img {
114
- position: absolute;
115
- cursor: pointer;
116
- }
117
-
118
- .annotationLayer .textWidgetAnnotation input,
119
- .annotationLayer .textWidgetAnnotation textarea,
120
- .annotationLayer .choiceWidgetAnnotation select,
121
- .annotationLayer .buttonWidgetAnnotation.checkBox input,
122
- .annotationLayer .buttonWidgetAnnotation.radioButton input {
123
- background-color: rgba(0, 54, 255, 0.13);
124
- border: 1px solid transparent;
125
- box-sizing: border-box;
126
- font-size: 9px;
127
- height: 100%;
128
- margin: 0;
129
- padding: 0 3px;
130
- vertical-align: top;
131
- width: 100%;
132
- }
133
-
134
- .annotationLayer .choiceWidgetAnnotation select option {
135
- padding: 0;
136
- }
137
-
138
- .annotationLayer .buttonWidgetAnnotation.radioButton input {
139
- border-radius: 50%;
140
- }
141
-
142
- .annotationLayer .textWidgetAnnotation textarea {
143
- font: message-box;
144
- font-size: 9px;
145
- resize: none;
146
- }
147
-
148
- .annotationLayer .textWidgetAnnotation input[disabled],
149
- .annotationLayer .textWidgetAnnotation textarea[disabled],
150
- .annotationLayer .choiceWidgetAnnotation select[disabled],
151
- .annotationLayer .buttonWidgetAnnotation.checkBox input[disabled],
152
- .annotationLayer .buttonWidgetAnnotation.radioButton input[disabled] {
153
- background: none;
154
- border: 1px solid transparent;
155
- cursor: not-allowed;
156
- }
157
-
158
- .annotationLayer .textWidgetAnnotation input:hover,
159
- .annotationLayer .textWidgetAnnotation textarea:hover,
160
- .annotationLayer .choiceWidgetAnnotation select:hover,
161
- .annotationLayer .buttonWidgetAnnotation.checkBox input:hover,
162
- .annotationLayer .buttonWidgetAnnotation.radioButton input:hover {
163
- border: 1px solid rgba(0, 0, 0, 1);
164
- }
165
-
166
- .annotationLayer .textWidgetAnnotation input:focus,
167
- .annotationLayer .textWidgetAnnotation textarea:focus,
168
- .annotationLayer .choiceWidgetAnnotation select:focus {
169
- background: none;
170
- border: 1px solid transparent;
171
- }
172
-
173
- .annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before,
174
- .annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after,
175
- .annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before {
176
- background-color: rgba(0, 0, 0, 1);
177
- content: "";
178
- display: block;
179
- position: absolute;
180
- }
181
-
182
- .annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before,
183
- .annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after {
184
- height: 80%;
185
- left: 45%;
186
- width: 1px;
187
- }
188
-
189
- .annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before {
190
- transform: rotate(45deg);
191
- }
192
-
193
- .annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after {
194
- transform: rotate(-45deg);
195
- }
196
-
197
- .annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before {
198
- border-radius: 50%;
199
- height: 50%;
200
- left: 30%;
201
- top: 20%;
202
- width: 50%;
203
- }
204
-
205
- .annotationLayer .textWidgetAnnotation input.comb {
206
- font-family: monospace;
207
- padding-left: 2px;
208
- padding-right: 0;
209
- }
210
-
211
- .annotationLayer .textWidgetAnnotation input.comb:focus {
212
- /*
213
- * Letter spacing is placed on the right side of each character. Hence, the
214
- * letter spacing of the last character may be placed outside the visible
215
- * area, causing horizontal scrolling. We avoid this by extending the width
216
- * when the element has focus and revert this when it loses focus.
217
- */
218
- width: 103%;
219
- }
220
-
221
- .annotationLayer .buttonWidgetAnnotation.checkBox input,
222
- .annotationLayer .buttonWidgetAnnotation.radioButton input {
223
- -webkit-appearance: none;
224
- -moz-appearance: none;
225
- appearance: none;
226
- padding: 0;
227
- }
228
-
229
- .annotationLayer .popupWrapper {
230
- position: absolute;
231
- width: 20em;
232
- }
233
-
234
- .annotationLayer .popup {
235
- position: absolute;
236
- z-index: 200;
237
- max-width: 20em;
238
- background-color: rgba(255, 255, 153, 1);
239
- box-shadow: 0 2px 5px rgba(136, 136, 136, 1);
240
- border-radius: 2px;
241
- padding: 6px;
242
- margin-left: 5px;
243
- cursor: pointer;
244
- font: message-box;
245
- font-size: 9px;
246
- white-space: normal;
247
- word-wrap: break-word;
248
- }
249
-
250
- .annotationLayer .popup > * {
251
- font-size: 9px;
252
- }
253
-
254
- .annotationLayer .popup h1 {
255
- display: inline-block;
256
- }
257
-
258
- .annotationLayer .popup span {
259
- display: inline-block;
260
- margin-left: 5px;
261
- }
262
-
263
- .annotationLayer .popup p {
264
- border-top: 1px solid rgba(51, 51, 51, 1);
265
- margin-top: 2px;
266
- padding-top: 2px;
267
- }
268
-
269
- .annotationLayer .highlightAnnotation,
270
- .annotationLayer .underlineAnnotation,
271
- .annotationLayer .squigglyAnnotation,
272
- .annotationLayer .strikeoutAnnotation,
273
- .annotationLayer .freeTextAnnotation,
274
- .annotationLayer .lineAnnotation svg line,
275
- .annotationLayer .squareAnnotation svg rect,
276
- .annotationLayer .circleAnnotation svg ellipse,
277
- .annotationLayer .polylineAnnotation svg polyline,
278
- .annotationLayer .polygonAnnotation svg polygon,
279
- .annotationLayer .caretAnnotation,
280
- .annotationLayer .inkAnnotation svg polyline,
281
- .annotationLayer .stampAnnotation,
282
- .annotationLayer .fileAttachmentAnnotation {
283
- cursor: pointer;
284
- }
285
-
286
-
287
- .xfaPage {
288
- overflow: hidden;
289
- position: relative;
290
- }
291
-
292
- .xfaContentarea {
293
- position: absolute;
294
- }
295
-
296
- .xfaPrintOnly {
297
- display: none;
298
- }
299
-
300
- .xfaLayer {
301
- position: absolute;
302
- text-align: initial;
303
- top: 0;
304
- left: 0;
305
- transform-origin: 0 0;
306
- line-height: 1.2;
307
- }
308
-
309
- .xfaLayer * {
310
- color: inherit;
311
- font: inherit;
312
- font-style: inherit;
313
- font-weight: inherit;
314
- font-kerning: inherit;
315
- letter-spacing: -0.01px;
316
- text-align: inherit;
317
- text-decoration: inherit;
318
- box-sizing: border-box;
319
- background: transparent;
320
- padding: 0;
321
- margin: 0;
322
- pointer-events: auto;
323
- }
324
-
325
- .xfaLayer div {
326
- pointer-events: none;
327
- }
328
-
329
- .xfaLayer svg {
330
- pointer-events: none;
331
- }
332
-
333
- .xfaLayer svg * {
334
- pointer-events: none;
335
- }
336
-
337
- .xfaLayer a {
338
- color: blue;
339
- }
340
-
341
- .xfaRich li {
342
- margin-left: 3em;
343
- }
344
-
345
- .xfaFont {
346
- color: black;
347
- font-weight: normal;
348
- font-kerning: none;
349
- font-size: 10px;
350
- font-style: normal;
351
- letter-spacing: 0;
352
- text-decoration: none;
353
- vertical-align: 0;
354
- }
355
-
356
- .xfaCaption {
357
- overflow: hidden;
358
- flex: 0 1 auto;
359
- }
360
-
361
- .xfaCaptionForCheckButton {
362
- overflow: hidden;
363
- flex: 1 1 auto;
364
- }
365
-
366
- .xfaLabel {
367
- height: 100%;
368
- width: 100%;
369
- }
370
-
371
- .xfaLeft {
372
- display: flex;
373
- flex-direction: row;
374
- align-items: center;
375
- }
376
-
377
- .xfaLeft > .xfaCaption,
378
- .xfaLeft > .xfaCaptionForCheckButton {
379
- max-height: 100%;
380
- }
381
-
382
- .xfaTop {
383
- display: flex;
384
- flex-direction: column;
385
- align-items: flex-start;
386
- }
387
-
388
- .xfaTop > .xfaCaption,
389
- .xfaTop > .xfaCaptionForCheckButton {
390
- width: 100%;
391
- }
392
-
393
- .xfaBorder {
394
- background: transparent;
395
- position: absolute;
396
- pointer-events: none;
397
- }
398
-
399
- .xfaWrapped {
400
- width: 100%;
401
- height: 100%;
402
- }
403
-
404
- .xfaTextfield,
405
- .xfaSelect {
406
- background-color: rgba(0, 54, 255, 0.13);
407
- }
408
-
409
- .xfaTextfield:focus,
410
- .xfaSelect:focus {
411
- background-color: transparent;
412
- outline: none;
413
- }
414
-
415
- .xfaTextfield,
416
- .xfaSelect {
417
- width: 100%;
418
- height: 100%;
419
- flex: 1 1 0;
420
- border: none;
421
- resize: none;
422
- }
423
-
424
- .xfaButton {
425
- cursor: pointer;
426
- width: 100%;
427
- height: 100%;
428
- border: none;
429
- text-align: center;
430
- }
431
-
432
- .xfaButton:hover {
433
- background: Highlight;
434
- }
435
-
436
- .xfaCheckbox,
437
- .xfaRadio {
438
- width: 100%;
439
- height: 100%;
440
- flex: 0 0 auto;
441
- border: none;
442
- }
443
-
444
- .xfaRich {
445
- white-space: pre-wrap;
446
- width: 100%;
447
- height: 100%;
448
- }
449
-
450
- .xfaImage {
451
- -o-object-position: left top;
452
- object-position: left top;
453
- -o-object-fit: contain;
454
- object-fit: contain;
455
- width: 100%;
456
- height: 100%;
457
- }
458
-
459
- .xfaLrTb,
460
- .xfaRlTb,
461
- .xfaTb {
462
- display: flex;
463
- flex-direction: column;
464
- align-items: stretch;
465
- }
466
-
467
- .xfaLr {
468
- display: flex;
469
- flex-direction: row;
470
- align-items: stretch;
471
- }
472
-
473
- .xfaRl {
474
- display: flex;
475
- flex-direction: row-reverse;
476
- align-items: stretch;
477
- }
478
-
479
- .xfaTb > div {
480
- justify-content: left;
481
- }
482
-
483
- .xfaPosition {
484
- position: relative;
485
- }
486
-
487
- .xfaArea {
488
- position: relative;
489
- }
490
-
491
- .xfaValignMiddle {
492
- display: flex;
493
- align-items: center;
494
- }
495
-
496
- .xfaTable {
497
- display: flex;
498
- flex-direction: column;
499
- align-items: stretch;
500
- }
501
-
502
- .xfaTable .xfaRow {
503
- display: flex;
504
- flex-direction: row;
505
- align-items: stretch;
506
- }
507
-
508
- .xfaTable .xfaRlRow {
509
- display: flex;
510
- flex-direction: row-reverse;
511
- align-items: stretch;
512
- flex: 1;
513
- }
514
-
515
- .xfaTable .xfaRlRow > div {
516
- flex: 1;
517
- }
518
-
519
- .xfaNonInteractive input,
520
- .xfaNonInteractive textarea,
521
- .xfaDisabled input,
522
- .xfaDisabled textarea,
523
- .xfaReadOnly input,
524
- .xfaReadOnly textarea {
525
- background: initial;
526
- }
527
-
528
- @media print {
529
- .xfaTextfield,
530
- .xfaSelect {
531
- background-color: transparent;
532
- }
533
-
534
- .xfaSelect {
535
- -webkit-appearance: none;
536
- -moz-appearance: none;
537
- appearance: none;
538
- text-indent: 1px;
539
- text-overflow: "";
540
- }
541
- }
542
-
543
- :root {
544
- --pdfViewer-padding-bottom: none;
545
- --page-margin: 1px auto -8px;
546
- --page-border: 9px solid transparent;
547
- --spreadHorizontalWrapped-margin-LR: -3.5px;
548
- }
549
-
550
- @media screen and (forced-colors: active) {
551
- :root {
552
- --pdfViewer-padding-bottom: 9px;
553
- --page-margin: 9px auto 0;
554
- --page-border: none;
555
- --spreadHorizontalWrapped-margin-LR: 4.5px;
556
- }
557
- }
558
-
559
- .pdfViewer {
560
- padding-bottom: var(--pdfViewer-padding-bottom);
561
- }
562
-
563
- .pdfViewer .canvasWrapper {
564
- overflow: hidden;
565
- }
566
-
567
- .pdfViewer .page {
568
- direction: ltr;
569
- width: 816px;
570
- height: 1056px;
571
- margin: var(--page-margin);
572
- position: relative;
573
- overflow: visible;
574
- border: var(--page-border);
575
- background-clip: content-box;
576
- -o-border-image: url(images/shadow.png) 9 9 repeat;
577
- border-image: url(images/shadow.png) 9 9 repeat;
578
- background-color: rgba(255, 255, 255, 1);
579
- }
580
-
581
- .pdfViewer.removePageBorders .page {
582
- margin: 0 auto 10px;
583
- border: none;
584
- }
585
-
586
- .pdfViewer.singlePageView {
587
- display: inline-block;
588
- }
589
-
590
- .pdfViewer.singlePageView .page {
591
- margin: 0;
592
- border: none;
593
- }
594
-
595
- .pdfViewer.scrollHorizontal,
596
- .pdfViewer.scrollWrapped,
597
- .spread {
598
- margin-left: 3.5px;
599
- margin-right: 3.5px;
600
- text-align: center;
601
- }
602
-
603
- .pdfViewer.scrollHorizontal,
604
- .spread {
605
- white-space: nowrap;
606
- }
607
-
608
- .pdfViewer.removePageBorders,
609
- .pdfViewer.scrollHorizontal .spread,
610
- .pdfViewer.scrollWrapped .spread {
611
- margin-left: 0;
612
- margin-right: 0;
613
- }
614
-
615
- .spread .page,
616
- .pdfViewer.scrollHorizontal .page,
617
- .pdfViewer.scrollWrapped .page,
618
- .pdfViewer.scrollHorizontal .spread,
619
- .pdfViewer.scrollWrapped .spread {
620
- display: inline-block;
621
- vertical-align: middle;
622
- }
623
-
624
- .spread .page,
625
- .pdfViewer.scrollHorizontal .page,
626
- .pdfViewer.scrollWrapped .page {
627
- margin-left: var(--spreadHorizontalWrapped-margin-LR);
628
- margin-right: var(--spreadHorizontalWrapped-margin-LR);
629
- }
630
-
631
- .pdfViewer.removePageBorders .spread .page,
632
- .pdfViewer.removePageBorders.scrollHorizontal .page,
633
- .pdfViewer.removePageBorders.scrollWrapped .page {
634
- margin-left: 5px;
635
- margin-right: 5px;
636
- }
637
-
638
- .pdfViewer .page canvas {
639
- margin: 0;
640
- display: block;
641
- }
642
-
643
- .pdfViewer .page canvas[hidden] {
644
- display: none;
645
- }
646
-
647
- .pdfViewer .page .loadingIcon {
648
- position: absolute;
649
- display: block;
650
- left: 0;
651
- top: 0;
652
- right: 0;
653
- bottom: 0;
654
- background: url("images/loading-icon.gif") center no-repeat;
655
- }
656
-
657
- .pdfPresentationMode .pdfViewer {
658
- margin-left: 0;
659
- margin-right: 0;
660
- }
661
-
662
- .pdfPresentationMode .pdfViewer .page,
663
- .pdfPresentationMode .pdfViewer .spread {
664
- display: block;
665
- }
666
-
667
- .pdfPresentationMode .pdfViewer .page,
668
- .pdfPresentationMode .pdfViewer.removePageBorders .page {
669
- margin-left: auto;
670
- margin-right: auto;
671
- }
672
-
673
- .pdfPresentationMode:-webkit-full-screen .pdfViewer .page {
674
- margin-bottom: 100%;
675
- border: 0;
676
- }
677
-
678
- .pdfPresentationMode:fullscreen .pdfViewer .page {
679
- margin-bottom: 100%;
680
- border: 0;
681
- }
682
-
683
- :root {
684
- --sidebar-width: 200px;
685
- --sidebar-transition-duration: 200ms;
686
- --sidebar-transition-timing-function: ease;
687
- --loadingBar-end-offset: 0;
688
-
689
- --toolbar-icon-opacity: 0.7;
690
- --doorhanger-icon-opacity: 0.9;
691
-
692
- --main-color: rgba(12, 12, 13, 1);
693
- --body-bg-color: rgba(237, 237, 240, 1);
694
- --errorWrapper-bg-color: rgba(255, 110, 110, 1);
695
- --progressBar-color: rgba(10, 132, 255, 1);
696
- --progressBar-indeterminate-bg-color: rgba(221, 221, 222, 1);
697
- --progressBar-indeterminate-blend-color: rgba(116, 177, 239, 1);
698
- --scrollbar-color: auto;
699
- --scrollbar-bg-color: auto;
700
- --toolbar-icon-bg-color: rgba(0, 0, 0, 1);
701
- --toolbar-icon-hover-bg-color: rgba(0, 0, 0, 1);
702
-
703
- --sidebar-narrow-bg-color: rgba(237, 237, 240, 0.9);
704
- --sidebar-toolbar-bg-color: rgba(245, 246, 247, 1);
705
- --toolbar-bg-color: rgba(249, 249, 250, 1);
706
- --toolbar-border-color: rgba(204, 204, 204, 1);
707
- --button-hover-color: rgba(221, 222, 223, 1);
708
- --toggled-btn-color: rgba(0, 0, 0, 1);
709
- --toggled-btn-bg-color: rgba(0, 0, 0, 0.3);
710
- --toggled-hover-active-btn-color: rgba(0, 0, 0, 0.4);
711
- --dropdown-btn-bg-color: rgba(215, 215, 219, 1);
712
- --separator-color: rgba(0, 0, 0, 0.3);
713
- --field-color: rgba(6, 6, 6, 1);
714
- --field-bg-color: rgba(255, 255, 255, 1);
715
- --field-border-color: rgba(187, 187, 188, 1);
716
- --findbar-nextprevious-btn-bg-color: rgba(227, 228, 230, 1);
717
- --treeitem-color: rgba(0, 0, 0, 0.8);
718
- --treeitem-hover-color: rgba(0, 0, 0, 0.9);
719
- --treeitem-selected-color: rgba(0, 0, 0, 0.9);
720
- --treeitem-selected-bg-color: rgba(0, 0, 0, 0.25);
721
- --sidebaritem-bg-color: rgba(0, 0, 0, 0.15);
722
- --doorhanger-bg-color: rgba(255, 255, 255, 1);
723
- --doorhanger-border-color: rgba(12, 12, 13, 0.2);
724
- --doorhanger-hover-color: rgba(12, 12, 13, 1);
725
- --doorhanger-hover-bg-color: rgba(237, 237, 237, 1);
726
- --doorhanger-separator-color: rgba(222, 222, 222, 1);
727
- --overlay-button-border: 0 none;
728
- --overlay-button-bg-color: rgba(12, 12, 13, 0.1);
729
- --overlay-button-hover-bg-color: rgba(12, 12, 13, 0.3);
730
-
731
- --loading-icon: url(images/loading.svg);
732
- --treeitem-expanded-icon: url(images/treeitem-expanded.svg);
733
- --treeitem-collapsed-icon: url(images/treeitem-collapsed.svg);
734
- --toolbarButton-menuArrow-icon: url(images/toolbarButton-menuArrow.svg);
735
- --toolbarButton-sidebarToggle-icon: url(images/toolbarButton-sidebarToggle.svg);
736
- --toolbarButton-secondaryToolbarToggle-icon: url(images/toolbarButton-secondaryToolbarToggle.svg);
737
- --toolbarButton-pageUp-icon: url(images/toolbarButton-pageUp.svg);
738
- --toolbarButton-pageDown-icon: url(images/toolbarButton-pageDown.svg);
739
- --toolbarButton-zoomOut-icon: url(images/toolbarButton-zoomOut.svg);
740
- --toolbarButton-zoomIn-icon: url(images/toolbarButton-zoomIn.svg);
741
- --toolbarButton-presentationMode-icon: url(images/toolbarButton-presentationMode.svg);
742
- --toolbarButton-print-icon: url(images/toolbarButton-print.svg);
743
- --toolbarButton-openFile-icon: url(images/toolbarButton-openFile.svg);
744
- --toolbarButton-download-icon: url(images/toolbarButton-download.svg);
745
- --toolbarButton-bookmark-icon: url(images/toolbarButton-bookmark.svg);
746
- --toolbarButton-viewThumbnail-icon: url(images/toolbarButton-viewThumbnail.svg);
747
- --toolbarButton-viewOutline-icon: url(images/toolbarButton-viewOutline.svg);
748
- --toolbarButton-viewAttachments-icon: url(images/toolbarButton-viewAttachments.svg);
749
- --toolbarButton-viewLayers-icon: url(images/toolbarButton-viewLayers.svg);
750
- --toolbarButton-currentOutlineItem-icon: url(images/toolbarButton-currentOutlineItem.svg);
751
- --toolbarButton-search-icon: url(images/toolbarButton-search.svg);
752
- --findbarButton-previous-icon: url(images/findbarButton-previous.svg);
753
- --findbarButton-next-icon: url(images/findbarButton-next.svg);
754
- --secondaryToolbarButton-firstPage-icon: url(images/secondaryToolbarButton-firstPage.svg);
755
- --secondaryToolbarButton-lastPage-icon: url(images/secondaryToolbarButton-lastPage.svg);
756
- --secondaryToolbarButton-rotateCcw-icon: url(images/secondaryToolbarButton-rotateCcw.svg);
757
- --secondaryToolbarButton-rotateCw-icon: url(images/secondaryToolbarButton-rotateCw.svg);
758
- --secondaryToolbarButton-selectTool-icon: url(images/secondaryToolbarButton-selectTool.svg);
759
- --secondaryToolbarButton-handTool-icon: url(images/secondaryToolbarButton-handTool.svg);
760
- --secondaryToolbarButton-scrollVertical-icon: url(images/secondaryToolbarButton-scrollVertical.svg);
761
- --secondaryToolbarButton-scrollHorizontal-icon: url(images/secondaryToolbarButton-scrollHorizontal.svg);
762
- --secondaryToolbarButton-scrollWrapped-icon: url(images/secondaryToolbarButton-scrollWrapped.svg);
763
- --secondaryToolbarButton-spreadNone-icon: url(images/secondaryToolbarButton-spreadNone.svg);
764
- --secondaryToolbarButton-spreadOdd-icon: url(images/secondaryToolbarButton-spreadOdd.svg);
765
- --secondaryToolbarButton-spreadEven-icon: url(images/secondaryToolbarButton-spreadEven.svg);
766
- --secondaryToolbarButton-documentProperties-icon: url(images/secondaryToolbarButton-documentProperties.svg);
767
- }
768
-
769
- @media (prefers-color-scheme: dark) {
770
- :root {
771
- --main-color: rgba(249, 249, 250, 1);
772
- --body-bg-color: rgba(42, 42, 46, 1);
773
- --errorWrapper-bg-color: rgba(169, 14, 14, 1);
774
- --progressBar-color: rgba(0, 96, 223, 1);
775
- --progressBar-indeterminate-bg-color: rgba(40, 40, 43, 1);
776
- --progressBar-indeterminate-blend-color: rgba(20, 68, 133, 1);
777
- --scrollbar-color: rgba(121, 121, 123, 1);
778
- --scrollbar-bg-color: rgba(35, 35, 39, 1);
779
- --toolbar-icon-bg-color: rgba(255, 255, 255, 1);
780
- --toolbar-icon-hover-bg-color: rgba(255, 255, 255, 1);
781
-
782
- --sidebar-narrow-bg-color: rgba(42, 42, 46, 0.9);
783
- --sidebar-toolbar-bg-color: rgba(50, 50, 52, 1);
784
- --toolbar-bg-color: rgba(56, 56, 61, 1);
785
- --toolbar-border-color: rgba(12, 12, 13, 1);
786
- --button-hover-color: rgba(102, 102, 103, 1);
787
- --toggled-btn-color: rgba(255, 255, 255, 1);
788
- --toggled-btn-bg-color: rgba(0, 0, 0, 0.3);
789
- --toggled-hover-active-btn-color: rgba(0, 0, 0, 0.4);
790
- --dropdown-btn-bg-color: rgba(74, 74, 79, 1);
791
- --separator-color: rgba(0, 0, 0, 0.3);
792
- --field-color: rgba(250, 250, 250, 1);
793
- --field-bg-color: rgba(64, 64, 68, 1);
794
- --field-border-color: rgba(115, 115, 115, 1);
795
- --findbar-nextprevious-btn-bg-color: rgba(89, 89, 89, 1);
796
- --treeitem-color: rgba(255, 255, 255, 0.8);
797
- --treeitem-hover-color: rgba(255, 255, 255, 0.9);
798
- --treeitem-selected-color: rgba(255, 255, 255, 0.9);
799
- --treeitem-selected-bg-color: rgba(255, 255, 255, 0.25);
800
- --sidebaritem-bg-color: rgba(255, 255, 255, 0.15);
801
- --doorhanger-bg-color: rgba(74, 74, 79, 1);
802
- --doorhanger-border-color: rgba(39, 39, 43, 1);
803
- --doorhanger-hover-color: rgba(249, 249, 250, 1);
804
- --doorhanger-hover-bg-color: rgba(93, 94, 98, 1);
805
- --doorhanger-separator-color: rgba(92, 92, 97, 1);
806
- --overlay-button-bg-color: rgba(92, 92, 97, 1);
807
- --overlay-button-hover-bg-color: rgba(115, 115, 115, 1);
808
-
809
- /* This image is used in <input> elements, which unfortunately means that
810
- * the `mask-image` approach used with all of the other images doesn't work
811
- * here; hence why we still have two versions of this particular image. */
812
- --loading-icon: url(images/loading-dark.svg);
813
- }
814
- }
815
-
816
- @media screen and (forced-colors: active) {
817
- :root {
818
- --main-color: ButtonText;
819
- --button-hover-color: Highlight;
820
- --doorhanger-hover-bg-color: Highlight;
821
- --toolbar-icon-opacity: 1;
822
- --toolbar-icon-bg-color: ButtonText;
823
- --toolbar-icon-hover-bg-color: ButtonFace;
824
- --toggled-btn-color: HighlightText;
825
- --toggled-btn-bg-color: LinkText;
826
- --doorhanger-hover-color: ButtonFace;
827
- --doorhanger-border-color-whcm: 1px solid ButtonText;
828
- --doorhanger-triangle-opacity-whcm: 0;
829
- --overlay-button-border: 1px solid Highlight;
830
- --overlay-button-hover-bg-color: Highlight;
831
- --overlay-button-hover-color: ButtonFace;
832
- --field-border-color: ButtonText;
833
- }
834
- }
835
-
836
- * {
837
- padding: 0;
838
- margin: 0;
839
- }
840
-
841
- html {
842
- height: 100%;
843
- width: 100%;
844
- /* Font size is needed to make the activity bar the correct size. */
845
- font-size: 10px;
846
- }
847
-
848
- body {
849
- height: 100%;
850
- width: 100%;
851
- background-color: var(--body-bg-color);
852
- }
853
-
854
- body,
855
- input,
856
- button,
857
- select {
858
- font: message-box;
859
- outline: none;
860
- scrollbar-color: var(--scrollbar-color) var(--scrollbar-bg-color);
861
- }
862
-
863
- .hidden {
864
- display: none !important;
865
- }
866
- [hidden] {
867
- display: none !important;
868
- }
869
-
870
- .pdfViewer.enablePermissions .textLayer span {
871
- -webkit-user-select: none !important;
872
- -moz-user-select: none !important;
873
- user-select: none !important;
874
- cursor: not-allowed;
875
- }
876
-
877
- #viewerContainer.pdfPresentationMode:-webkit-full-screen {
878
- top: 0;
879
- border-top: 2px solid rgba(0, 0, 0, 0);
880
- background-color: rgba(0, 0, 0, 1);
881
- width: 100%;
882
- height: 100%;
883
- overflow: hidden;
884
- cursor: none;
885
- -webkit-user-select: none;
886
- user-select: none;
887
- }
888
-
889
- #viewerContainer.pdfPresentationMode:fullscreen {
890
- top: 0;
891
- border-top: 2px solid rgba(0, 0, 0, 0);
892
- background-color: rgba(0, 0, 0, 1);
893
- width: 100%;
894
- height: 100%;
895
- overflow: hidden;
896
- cursor: none;
897
- -webkit-user-select: none;
898
- -moz-user-select: none;
899
- user-select: none;
900
- }
901
-
902
- .pdfPresentationMode:-webkit-full-screen a:not(.internalLink) {
903
- display: none;
904
- }
905
-
906
- .pdfPresentationMode:fullscreen a:not(.internalLink) {
907
- display: none;
908
- }
909
-
910
- .pdfPresentationMode:-webkit-full-screen .textLayer span {
911
- cursor: none;
912
- }
913
-
914
- .pdfPresentationMode:fullscreen .textLayer span {
915
- cursor: none;
916
- }
917
-
918
- .pdfPresentationMode.pdfPresentationModeControls > *,
919
- .pdfPresentationMode.pdfPresentationModeControls .textLayer span {
920
- cursor: default;
921
- }
922
-
923
- #outerContainer {
924
- width: 100%;
925
- height: 100%;
926
- position: relative;
927
- }
928
-
929
- #sidebarContainer {
930
- position: absolute;
931
- top: 32px;
932
- bottom: 0;
933
- width: var(--sidebar-width);
934
- visibility: hidden;
935
- z-index: 100;
936
- border-top: 1px solid rgba(51, 51, 51, 1);
937
- transition-duration: var(--sidebar-transition-duration);
938
- transition-timing-function: var(--sidebar-transition-timing-function);
939
- }
940
- html[dir="ltr"] #sidebarContainer {
941
- transition-property: left;
942
- left: calc(0px - var(--sidebar-width));
943
- border-right: var(--doorhanger-border-color-whcm);
944
- }
945
- html[dir="rtl"] #sidebarContainer {
946
- transition-property: right;
947
- right: calc(0px - var(--sidebar-width));
948
- border-left: var(--doorhanger-border-color-whcm);
949
- }
950
-
951
- #outerContainer.sidebarResizing #sidebarContainer {
952
- /* Improve responsiveness and avoid visual glitches when the sidebar is resized. */
953
- transition-duration: 0s;
954
- /* Prevent e.g. the thumbnails being selected when the sidebar is resized. */
955
- -webkit-user-select: none;
956
- -moz-user-select: none;
957
- user-select: none;
958
- }
959
-
960
- #outerContainer.sidebarMoving #sidebarContainer,
961
- #outerContainer.sidebarOpen #sidebarContainer {
962
- visibility: visible;
963
- }
964
- html[dir="ltr"] #outerContainer.sidebarOpen #sidebarContainer {
965
- left: 0;
966
- }
967
- html[dir="rtl"] #outerContainer.sidebarOpen #sidebarContainer {
968
- right: 0;
969
- }
970
-
971
- #mainContainer {
972
- position: absolute;
973
- top: 0;
974
- right: 0;
975
- bottom: 0;
976
- left: 0;
977
- min-width: 320px;
978
- }
979
-
980
- #sidebarContent {
981
- top: 32px;
982
- bottom: 0;
983
- overflow: auto;
984
- -webkit-overflow-scrolling: touch;
985
- position: absolute;
986
- width: 100%;
987
- background-color: rgba(0, 0, 0, 0.1);
988
- }
989
- html[dir="ltr"] #sidebarContent {
990
- left: 0;
991
- box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.25);
992
- }
993
- html[dir="rtl"] #sidebarContent {
994
- right: 0;
995
- box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.25);
996
- }
997
-
998
- #viewerContainer {
999
- overflow: auto;
1000
- -webkit-overflow-scrolling: touch;
1001
- position: absolute;
1002
- top: 32px;
1003
- right: 0;
1004
- bottom: 0;
1005
- left: 0;
1006
- outline: none;
1007
- }
1008
- #viewerContainer:not(.pdfPresentationMode) {
1009
- transition-duration: var(--sidebar-transition-duration);
1010
- transition-timing-function: var(--sidebar-transition-timing-function);
1011
- }
1012
-
1013
- #outerContainer.sidebarResizing #viewerContainer {
1014
- /* Improve responsiveness and avoid visual glitches when the sidebar is resized. */
1015
- transition-duration: 0s;
1016
- }
1017
-
1018
- html[dir="ltr"]
1019
- #outerContainer.sidebarOpen
1020
- #viewerContainer:not(.pdfPresentationMode) {
1021
- transition-property: left;
1022
- left: var(--sidebar-width);
1023
- }
1024
- html[dir="rtl"]
1025
- #outerContainer.sidebarOpen
1026
- #viewerContainer:not(.pdfPresentationMode) {
1027
- transition-property: right;
1028
- right: var(--sidebar-width);
1029
- }
1030
-
1031
- .toolbar {
1032
- position: relative;
1033
- left: 0;
1034
- right: 0;
1035
- z-index: 9999;
1036
- cursor: default;
1037
- }
1038
-
1039
- #toolbarContainer {
1040
- width: 100%;
1041
- }
1042
-
1043
- #toolbarSidebar {
1044
- width: 100%;
1045
- height: 32px;
1046
- background-color: var(--sidebar-toolbar-bg-color);
1047
- }
1048
- html[dir="ltr"] #toolbarSidebar {
1049
- box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.25), 0 1px 0 rgba(0, 0, 0, 0.15),
1050
- 0 0 1px rgba(0, 0, 0, 0.1);
1051
- }
1052
- html[dir="rtl"] #toolbarSidebar {
1053
- box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.25), 0 1px 0 rgba(0, 0, 0, 0.15),
1054
- 0 0 1px rgba(0, 0, 0, 0.1);
1055
- }
1056
-
1057
- html[dir="ltr"] #toolbarSidebar .toolbarButton {
1058
- margin-right: 2px !important;
1059
- }
1060
- html[dir="rtl"] #toolbarSidebar .toolbarButton {
1061
- margin-left: 2px !important;
1062
- }
1063
-
1064
- html[dir="ltr"] #toolbarSidebarRight .toolbarButton {
1065
- margin-right: 3px !important;
1066
- }
1067
- html[dir="rtl"] #toolbarSidebarRight .toolbarButton {
1068
- margin-left: 3px !important;
1069
- }
1070
-
1071
- #sidebarResizer {
1072
- position: absolute;
1073
- top: 0;
1074
- bottom: 0;
1075
- width: 6px;
1076
- z-index: 200;
1077
- cursor: ew-resize;
1078
- }
1079
- html[dir="ltr"] #sidebarResizer {
1080
- right: -6px;
1081
- }
1082
- html[dir="rtl"] #sidebarResizer {
1083
- left: -6px;
1084
- }
1085
-
1086
- #toolbarContainer,
1087
- .findbar,
1088
- .secondaryToolbar {
1089
- position: relative;
1090
- height: 32px;
1091
- background-color: var(--toolbar-bg-color);
1092
- box-shadow: 0 1px 0 var(--toolbar-border-color);
1093
- }
1094
-
1095
- #toolbarViewer {
1096
- height: 32px;
1097
- }
1098
-
1099
- #loadingBar {
1100
- position: absolute;
1101
- height: 4px;
1102
- background-color: var(--body-bg-color);
1103
- border-bottom: 1px solid var(--toolbar-border-color);
1104
-
1105
- transition-duration: var(--sidebar-transition-duration);
1106
- transition-timing-function: var(--sidebar-transition-timing-function);
1107
- }
1108
- html[dir="ltr"] #loadingBar {
1109
- transition-property: left;
1110
- left: 0;
1111
- right: var(--loadingBar-end-offset);
1112
- }
1113
- html[dir="rtl"] #loadingBar {
1114
- transition-property: right;
1115
- left: var(--loadingBar-end-offset);
1116
- right: 0;
1117
- }
1118
-
1119
- html[dir="ltr"] #outerContainer.sidebarOpen #loadingBar {
1120
- left: var(--sidebar-width);
1121
- }
1122
- html[dir="rtl"] #outerContainer.sidebarOpen #loadingBar {
1123
- right: var(--sidebar-width);
1124
- }
1125
-
1126
- #outerContainer.sidebarResizing #loadingBar {
1127
- /* Improve responsiveness and avoid visual glitches when the sidebar is resized. */
1128
- transition-duration: 0s;
1129
- }
1130
-
1131
- #loadingBar .progress {
1132
- position: absolute;
1133
- top: 0;
1134
- left: 0;
1135
- width: 0%;
1136
- height: 100%;
1137
- background-color: var(--progressBar-color);
1138
- overflow: hidden;
1139
- transition: width 200ms;
1140
- }
1141
-
1142
- @-webkit-keyframes progressIndeterminate {
1143
- 0% {
1144
- left: -142px;
1145
- }
1146
- 100% {
1147
- left: 0;
1148
- }
1149
- }
1150
-
1151
- @keyframes progressIndeterminate {
1152
- 0% {
1153
- left: -142px;
1154
- }
1155
- 100% {
1156
- left: 0;
1157
- }
1158
- }
1159
-
1160
- #loadingBar .progress.indeterminate {
1161
- background-color: var(--progressBar-indeterminate-bg-color);
1162
- transition: none;
1163
- }
1164
-
1165
- #loadingBar .progress.indeterminate .glimmer {
1166
- position: absolute;
1167
- top: 0;
1168
- left: 0;
1169
- height: 100%;
1170
- width: calc(100% + 150px);
1171
- background: repeating-linear-gradient(
1172
- 135deg,
1173
- var(--progressBar-indeterminate-blend-color) 0,
1174
- var(--progressBar-indeterminate-bg-color) 5px,
1175
- var(--progressBar-indeterminate-bg-color) 45px,
1176
- var(--progressBar-color) 55px,
1177
- var(--progressBar-color) 95px,
1178
- var(--progressBar-indeterminate-blend-color) 100px
1179
- );
1180
- -webkit-animation: progressIndeterminate 1s linear infinite;
1181
- animation: progressIndeterminate 1s linear infinite;
1182
- }
1183
-
1184
- .findbar,
1185
- .secondaryToolbar {
1186
- top: 32px;
1187
- position: absolute;
1188
- z-index: 10000;
1189
- height: auto;
1190
- min-width: 16px;
1191
- padding: 0 4px;
1192
- margin: 4px 2px;
1193
- color: rgba(217, 217, 217, 1);
1194
- font-size: 12px;
1195
- line-height: 14px;
1196
- text-align: left;
1197
- cursor: default;
1198
- }
1199
-
1200
- .findbar {
1201
- min-width: 300px;
1202
- background-color: var(--toolbar-bg-color);
1203
- }
1204
- .findbar > div {
1205
- height: 32px;
1206
- }
1207
- .findbar.wrapContainers > div {
1208
- clear: both;
1209
- }
1210
- .findbar.wrapContainers > div#findbarMessageContainer {
1211
- height: auto;
1212
- }
1213
- html[dir="ltr"] .findbar {
1214
- left: 64px;
1215
- }
1216
- html[dir="rtl"] .findbar {
1217
- right: 64px;
1218
- }
1219
-
1220
- .findbar .splitToolbarButton {
1221
- margin-top: 3px;
1222
- }
1223
- html[dir="ltr"] .findbar .splitToolbarButton {
1224
- margin-left: 0;
1225
- margin-right: 5px;
1226
- }
1227
- html[dir="rtl"] .findbar .splitToolbarButton {
1228
- margin-left: 5px;
1229
- margin-right: 0;
1230
- }
1231
-
1232
- .findbar .splitToolbarButton > .toolbarButton {
1233
- background-color: var(--findbar-nextprevious-btn-bg-color);
1234
- border-radius: 0;
1235
- height: 26px;
1236
- border-top: 1px solid var(--field-border-color);
1237
- border-bottom: 1px solid var(--field-border-color);
1238
- }
1239
-
1240
- .findbar .splitToolbarButton > .toolbarButton::before {
1241
- top: 5px;
1242
- }
1243
-
1244
- .findbar .splitToolbarButton > .findNext {
1245
- width: 29px;
1246
- }
1247
- html[dir="ltr"] .findbar .splitToolbarButton > .findNext {
1248
- border-bottom-right-radius: 2px;
1249
- border-top-right-radius: 2px;
1250
- border-right: 1px solid var(--field-border-color);
1251
- }
1252
- html[dir="rtl"] .findbar .splitToolbarButton > .findNext {
1253
- border-bottom-left-radius: 2px;
1254
- border-top-left-radius: 2px;
1255
- border-left: 1px solid var(--field-border-color);
1256
- }
1257
-
1258
- .findbar input[type="checkbox"] {
1259
- pointer-events: none;
1260
- }
1261
-
1262
- .findbar label {
1263
- -webkit-user-select: none;
1264
- -moz-user-select: none;
1265
- user-select: none;
1266
- }
1267
-
1268
- .findbar label:hover,
1269
- .findbar input:focus + label {
1270
- color: var(--toggled-btn-color);
1271
- background-color: var(--button-hover-color);
1272
- }
1273
-
1274
- html[dir="ltr"] #findInput {
1275
- border-top-right-radius: 0;
1276
- border-bottom-right-radius: 0;
1277
- }
1278
- html[dir="rtl"] #findInput {
1279
- border-top-left-radius: 0;
1280
- border-bottom-left-radius: 0;
1281
- }
1282
-
1283
- .findbar .toolbarField[type="checkbox"]:checked + .toolbarLabel {
1284
- background-color: var(--toggled-btn-bg-color) !important;
1285
- color: var(--toggled-btn-color);
1286
- }
1287
-
1288
- #findInput {
1289
- width: 200px;
1290
- }
1291
- #findInput::-moz-placeholder {
1292
- font-style: normal;
1293
- }
1294
- #findInput::placeholder {
1295
- font-style: normal;
1296
- }
1297
- #findInput[data-status="pending"] {
1298
- background-image: var(--loading-icon);
1299
- background-repeat: no-repeat;
1300
- background-position: 98%;
1301
- }
1302
- html[dir="rtl"] #findInput[data-status="pending"] {
1303
- background-position: 3px;
1304
- }
1305
- #findInput[data-status="notFound"] {
1306
- background-color: rgba(255, 102, 102, 1);
1307
- }
1308
-
1309
- .secondaryToolbar {
1310
- padding: 6px 0 10px;
1311
- height: auto;
1312
- z-index: 30000;
1313
- background-color: var(--doorhanger-bg-color);
1314
- }
1315
- html[dir="ltr"] .secondaryToolbar {
1316
- right: 4px;
1317
- }
1318
- html[dir="rtl"] .secondaryToolbar {
1319
- left: 4px;
1320
- }
1321
-
1322
- #secondaryToolbarButtonContainer {
1323
- max-width: 220px;
1324
- max-height: 400px;
1325
- overflow-y: auto;
1326
- -webkit-overflow-scrolling: touch;
1327
- margin-bottom: -4px;
1328
- }
1329
-
1330
- #secondaryToolbarButtonContainer.hiddenScrollModeButtons > .scrollModeButtons,
1331
- #secondaryToolbarButtonContainer.hiddenSpreadModeButtons > .spreadModeButtons {
1332
- display: none !important;
1333
- }
1334
-
1335
- .doorHanger,
1336
- .doorHangerRight {
1337
- border-radius: 2px;
1338
- box-shadow: 0 1px 5px var(--doorhanger-border-color),
1339
- 0 0 0 1px var(--doorhanger-border-color);
1340
- border: var(--doorhanger-border-color-whcm);
1341
- }
1342
- .doorHanger:after,
1343
- .doorHanger:before,
1344
- .doorHangerRight:after,
1345
- .doorHangerRight:before {
1346
- bottom: 100%;
1347
- border: solid rgba(0, 0, 0, 0);
1348
- content: " ";
1349
- height: 0;
1350
- width: 0;
1351
- position: absolute;
1352
- pointer-events: none;
1353
- opacity: var(--doorhanger-triangle-opacity-whcm);
1354
- }
1355
- .doorHanger:after,
1356
- .doorHangerRight:after {
1357
- border-width: 8px;
1358
- }
1359
- .doorHanger:after {
1360
- border-bottom-color: var(--toolbar-bg-color);
1361
- }
1362
- .doorHangerRight:after {
1363
- border-bottom-color: var(--doorhanger-bg-color);
1364
- }
1365
- .doorHanger:before,
1366
- .doorHangerRight:before {
1367
- border-bottom-color: var(--doorhanger-border-color);
1368
- border-width: 9px;
1369
- }
1370
-
1371
- html[dir="ltr"] .doorHanger:after,
1372
- html[dir="rtl"] .doorHangerRight:after {
1373
- left: 10px;
1374
- margin-left: -8px;
1375
- }
1376
-
1377
- html[dir="ltr"] .doorHanger:before,
1378
- html[dir="rtl"] .doorHangerRight:before {
1379
- left: 10px;
1380
- margin-left: -9px;
1381
- }
1382
-
1383
- html[dir="rtl"] .doorHanger:after,
1384
- html[dir="ltr"] .doorHangerRight:after {
1385
- right: 10px;
1386
- margin-right: -8px;
1387
- }
1388
-
1389
- html[dir="rtl"] .doorHanger:before,
1390
- html[dir="ltr"] .doorHangerRight:before {
1391
- right: 10px;
1392
- margin-right: -9px;
1393
- }
1394
-
1395
- #findResultsCount {
1396
- background-color: rgba(217, 217, 217, 1);
1397
- color: rgba(82, 82, 82, 1);
1398
- text-align: center;
1399
- padding: 4px 5px;
1400
- margin: 5px;
1401
- }
1402
-
1403
- #findMsg {
1404
- color: rgba(251, 0, 0, 1);
1405
- }
1406
- #findMsg:empty {
1407
- display: none;
1408
- }
1409
-
1410
- #toolbarViewerMiddle {
1411
- position: absolute;
1412
- left: 50%;
1413
- transform: translateX(-50%);
1414
- }
1415
-
1416
- html[dir="ltr"] #toolbarViewerLeft,
1417
- html[dir="rtl"] #toolbarViewerRight,
1418
- html[dir="ltr"] #toolbarSidebarLeft,
1419
- html[dir="rtl"] #toolbarSidebarRight {
1420
- float: left;
1421
- }
1422
- html[dir="ltr"] #toolbarViewerRight,
1423
- html[dir="rtl"] #toolbarViewerLeft,
1424
- html[dir="ltr"] #toolbarSidebarRight,
1425
- html[dir="rtl"] #toolbarSidebarLeft {
1426
- float: right;
1427
- }
1428
- html[dir="ltr"] #toolbarViewerLeft > *,
1429
- html[dir="ltr"] #toolbarViewerMiddle > *,
1430
- html[dir="ltr"] #toolbarViewerRight > *,
1431
- html[dir="ltr"] #toolbarSidebarLeft *,
1432
- html[dir="ltr"] #toolbarSidebarRight *,
1433
- html[dir="ltr"] .findbar * {
1434
- position: relative;
1435
- float: left;
1436
- }
1437
- html[dir="rtl"] #toolbarViewerLeft > *,
1438
- html[dir="rtl"] #toolbarViewerMiddle > *,
1439
- html[dir="rtl"] #toolbarViewerRight > *,
1440
- html[dir="rtl"] #toolbarSidebarLeft *,
1441
- html[dir="rtl"] #toolbarSidebarRight *,
1442
- html[dir="rtl"] .findbar * {
1443
- position: relative;
1444
- float: right;
1445
- }
1446
-
1447
- .splitToolbarButton {
1448
- margin: 2px 2px 0;
1449
- display: inline-block;
1450
- }
1451
- html[dir="ltr"] .splitToolbarButton > .toolbarButton {
1452
- float: left;
1453
- }
1454
- html[dir="rtl"] .splitToolbarButton > .toolbarButton {
1455
- float: right;
1456
- }
1457
-
1458
- .toolbarButton,
1459
- .secondaryToolbarButton,
1460
- .overlayButton {
1461
- border: 0 none;
1462
- background: none;
1463
- width: 28px;
1464
- height: 28px;
1465
- }
1466
-
1467
- .overlayButton:hover,
1468
- .overlayButton:focus {
1469
- background-color: var(--overlay-button-hover-bg-color);
1470
- }
1471
-
1472
- .overlayButton:hover > span,
1473
- .overlayButton:focus > span {
1474
- color: var(--overlay-button-hover-color);
1475
- }
1476
-
1477
- .toolbarButton > span {
1478
- display: inline-block;
1479
- width: 0;
1480
- height: 0;
1481
- overflow: hidden;
1482
- }
1483
-
1484
- .toolbarButton[disabled],
1485
- .secondaryToolbarButton[disabled],
1486
- .overlayButton[disabled] {
1487
- opacity: 0.5;
1488
- }
1489
-
1490
- .splitToolbarButton.toggled .toolbarButton {
1491
- margin: 0;
1492
- }
1493
-
1494
- .splitToolbarButton > .toolbarButton:hover,
1495
- .splitToolbarButton > .toolbarButton:focus,
1496
- .dropdownToolbarButton:hover,
1497
- .toolbarButton.textButton:hover,
1498
- .toolbarButton.textButton:focus {
1499
- background-color: var(--button-hover-color);
1500
- z-index: 199;
1501
- }
1502
- .splitToolbarButton > .toolbarButton {
1503
- position: relative;
1504
- }
1505
- html[dir="ltr"] .splitToolbarButton > .toolbarButton:first-child,
1506
- html[dir="rtl"] .splitToolbarButton > .toolbarButton:last-child {
1507
- margin: 0;
1508
- }
1509
- html[dir="ltr"] .splitToolbarButton > .toolbarButton:last-child,
1510
- html[dir="rtl"] .splitToolbarButton > .toolbarButton:first-child {
1511
- margin: 0;
1512
- }
1513
- .splitToolbarButtonSeparator {
1514
- padding: 10px 0;
1515
- width: 1px;
1516
- background-color: var(--separator-color);
1517
- z-index: 99;
1518
- display: inline-block;
1519
- margin: 4px 0;
1520
- }
1521
-
1522
- .findbar .splitToolbarButtonSeparator {
1523
- background-color: var(--field-border-color);
1524
- margin: 0;
1525
- padding: 13px 0;
1526
- }
1527
-
1528
- html[dir="ltr"] .splitToolbarButtonSeparator {
1529
- float: left;
1530
- }
1531
- html[dir="rtl"] .splitToolbarButtonSeparator {
1532
- float: right;
1533
- }
1534
-
1535
- .toolbarButton,
1536
- .dropdownToolbarButton,
1537
- .secondaryToolbarButton,
1538
- .overlayButton {
1539
- min-width: 16px;
1540
- margin: 2px 1px;
1541
- padding: 2px 6px 0;
1542
- border: none;
1543
- border-radius: 2px;
1544
- color: var(--main-color);
1545
- font-size: 12px;
1546
- line-height: 14px;
1547
- -webkit-user-select: none;
1548
- -moz-user-select: none;
1549
- user-select: none;
1550
- cursor: default;
1551
- box-sizing: border-box;
1552
- }
1553
-
1554
- html[dir="ltr"] #toolbarViewerLeft > .toolbarButton:first-child,
1555
- html[dir="rtl"] #toolbarViewerRight > .toolbarButton:last-child {
1556
- margin-left: 2px;
1557
- }
1558
-
1559
- html[dir="ltr"] #toolbarViewerRight > .toolbarButton:last-child,
1560
- html[dir="rtl"] #toolbarViewerLeft > .toolbarButton:first-child {
1561
- margin-right: 2px;
1562
- }
1563
- .toolbarButton:hover,
1564
- .toolbarButton:focus {
1565
- background-color: var(--button-hover-color);
1566
- }
1567
- .secondaryToolbarButton:hover,
1568
- .secondaryToolbarButton:focus {
1569
- background-color: var(--doorhanger-hover-bg-color);
1570
- color: var(--doorhanger-hover-color);
1571
- }
1572
-
1573
- .toolbarButton.toggled,
1574
- .splitToolbarButton.toggled > .toolbarButton.toggled,
1575
- .secondaryToolbarButton.toggled {
1576
- background-color: var(--toggled-btn-bg-color);
1577
- color: var(--toggled-btn-color);
1578
- }
1579
-
1580
- .secondaryToolbarButton.toggled::before {
1581
- background-color: var(--toggled-btn-color);
1582
- }
1583
-
1584
- .toolbarButton.toggled::before {
1585
- background-color: var(--toggled-btn-color);
1586
- }
1587
-
1588
- .toolbarButton.toggled:hover:active,
1589
- .splitToolbarButton.toggled > .toolbarButton.toggled:hover:active,
1590
- .secondaryToolbarButton.toggled:hover:active {
1591
- background-color: var(--toggled-hover-active-btn-color);
1592
- }
1593
-
1594
- .dropdownToolbarButton {
1595
- width: 140px;
1596
- padding: 0;
1597
- overflow: hidden;
1598
- background-color: var(--dropdown-btn-bg-color);
1599
- margin-top: 2px !important;
1600
- }
1601
- .dropdownToolbarButton::after {
1602
- top: 6px;
1603
- pointer-events: none;
1604
-
1605
- -webkit-mask-image: var(--toolbarButton-menuArrow-icon);
1606
- mask-image: var(--toolbarButton-menuArrow-icon);
1607
- }
1608
- html[dir="ltr"] .dropdownToolbarButton::after {
1609
- right: 7px;
1610
- }
1611
- html[dir="rtl"] .dropdownToolbarButton::after {
1612
- left: 7px;
1613
- }
1614
-
1615
- .dropdownToolbarButton > select {
1616
- width: 162px;
1617
- height: 28px;
1618
- font-size: 12px;
1619
- color: var(--main-color);
1620
- margin: 0;
1621
- padding: 1px 0 2px;
1622
- border: none;
1623
- background-color: var(--dropdown-btn-bg-color);
1624
- }
1625
- html[dir="ltr"] .dropdownToolbarButton > select {
1626
- padding-left: 4px;
1627
- }
1628
- html[dir="rtl"] .dropdownToolbarButton > select {
1629
- padding-right: 4px;
1630
- }
1631
- .dropdownToolbarButton > select:hover,
1632
- .dropdownToolbarButton > select:focus {
1633
- background-color: var(--button-hover-color);
1634
- color: var(--toggled-btn-color);
1635
- }
1636
-
1637
- .dropdownToolbarButton > select > option {
1638
- background: var(--doorhanger-bg-color);
1639
- color: var(--main-color);
1640
- }
1641
-
1642
- #customScaleOption {
1643
- display: none;
1644
- }
1645
-
1646
- #pageWidthOption {
1647
- border-bottom: 1px rgba(255, 255, 255, 0.5) solid;
1648
- }
1649
-
1650
- .toolbarButtonSpacer {
1651
- width: 30px;
1652
- display: inline-block;
1653
- height: 1px;
1654
- }
1655
-
1656
- .toolbarButton::before,
1657
- .secondaryToolbarButton::before,
1658
- .dropdownToolbarButton::after,
1659
- .treeItemToggler::before {
1660
- /* All matching images have a size of 16x16
1661
- * All relevant containers have a size of 28x28 */
1662
- position: absolute;
1663
- display: inline-block;
1664
- width: 16px;
1665
- height: 16px;
1666
-
1667
- content: "";
1668
- background-color: var(--toolbar-icon-bg-color);
1669
- -webkit-mask-size: cover;
1670
- mask-size: cover;
1671
- }
1672
-
1673
- .dropdownToolbarButton:hover::after,
1674
- .dropdownToolbarButton:focus::after,
1675
- .dropdownToolbarButton:active::after {
1676
- background-color: var(--toolbar-icon-hover-bg-color);
1677
- }
1678
-
1679
- .toolbarButton::before {
1680
- opacity: var(--toolbar-icon-opacity);
1681
- top: 6px;
1682
- left: 6px;
1683
- }
1684
-
1685
- .toolbarButton:hover::before,
1686
- .toolbarButton:focus::before,
1687
- .secondaryToolbarButton:hover::before,
1688
- .secondaryToolbarButton:focus::before {
1689
- background-color: var(--toolbar-icon-hover-bg-color);
1690
- }
1691
-
1692
- .secondaryToolbarButton::before {
1693
- opacity: var(--doorhanger-icon-opacity);
1694
- top: 5px;
1695
- }
1696
- html[dir="ltr"] .secondaryToolbarButton::before {
1697
- left: 12px;
1698
- }
1699
- html[dir="rtl"] .secondaryToolbarButton::before {
1700
- right: 12px;
1701
- }
1702
-
1703
- .toolbarButton#sidebarToggle::before {
1704
- -webkit-mask-image: var(--toolbarButton-sidebarToggle-icon);
1705
- mask-image: var(--toolbarButton-sidebarToggle-icon);
1706
- }
1707
- html[dir="rtl"] .toolbarButton#sidebarToggle::before {
1708
- transform: scaleX(-1);
1709
- }
1710
-
1711
- .toolbarButton#secondaryToolbarToggle::before {
1712
- -webkit-mask-image: var(--toolbarButton-secondaryToolbarToggle-icon);
1713
- mask-image: var(--toolbarButton-secondaryToolbarToggle-icon);
1714
- }
1715
- html[dir="rtl"] .toolbarButton#secondaryToolbarToggle::before {
1716
- transform: scaleX(-1);
1717
- }
1718
-
1719
- .toolbarButton.findPrevious::before {
1720
- -webkit-mask-image: var(--findbarButton-previous-icon);
1721
- mask-image: var(--findbarButton-previous-icon);
1722
- }
1723
-
1724
- .toolbarButton.findNext::before {
1725
- -webkit-mask-image: var(--findbarButton-next-icon);
1726
- mask-image: var(--findbarButton-next-icon);
1727
- }
1728
-
1729
- .toolbarButton.pageUp::before {
1730
- -webkit-mask-image: var(--toolbarButton-pageUp-icon);
1731
- mask-image: var(--toolbarButton-pageUp-icon);
1732
- }
1733
-
1734
- .toolbarButton.pageDown::before {
1735
- -webkit-mask-image: var(--toolbarButton-pageDown-icon);
1736
- mask-image: var(--toolbarButton-pageDown-icon);
1737
- }
1738
-
1739
- .toolbarButton.zoomOut::before {
1740
- -webkit-mask-image: var(--toolbarButton-zoomOut-icon);
1741
- mask-image: var(--toolbarButton-zoomOut-icon);
1742
- }
1743
-
1744
- .toolbarButton.zoomIn::before {
1745
- -webkit-mask-image: var(--toolbarButton-zoomIn-icon);
1746
- mask-image: var(--toolbarButton-zoomIn-icon);
1747
- }
1748
-
1749
- .toolbarButton.presentationMode::before,
1750
- .secondaryToolbarButton.presentationMode::before {
1751
- -webkit-mask-image: var(--toolbarButton-presentationMode-icon);
1752
- mask-image: var(--toolbarButton-presentationMode-icon);
1753
- }
1754
-
1755
- .toolbarButton.print::before,
1756
- .secondaryToolbarButton.print::before {
1757
- -webkit-mask-image: var(--toolbarButton-print-icon);
1758
- mask-image: var(--toolbarButton-print-icon);
1759
- }
1760
-
1761
- .toolbarButton.openFile::before,
1762
- .secondaryToolbarButton.openFile::before {
1763
- -webkit-mask-image: var(--toolbarButton-openFile-icon);
1764
- mask-image: var(--toolbarButton-openFile-icon);
1765
- }
1766
-
1767
- .toolbarButton.download::before,
1768
- .secondaryToolbarButton.download::before {
1769
- -webkit-mask-image: var(--toolbarButton-download-icon);
1770
- mask-image: var(--toolbarButton-download-icon);
1771
- }
1772
-
1773
- .secondaryToolbarButton.bookmark {
1774
- padding-top: 6px;
1775
- text-decoration: none;
1776
- }
1777
-
1778
- .bookmark[href="#"] {
1779
- opacity: 0.5;
1780
- pointer-events: none;
1781
- }
1782
-
1783
- .toolbarButton.bookmark::before,
1784
- .secondaryToolbarButton.bookmark::before {
1785
- -webkit-mask-image: var(--toolbarButton-bookmark-icon);
1786
- mask-image: var(--toolbarButton-bookmark-icon);
1787
- }
1788
-
1789
- #viewThumbnail.toolbarButton::before {
1790
- -webkit-mask-image: var(--toolbarButton-viewThumbnail-icon);
1791
- mask-image: var(--toolbarButton-viewThumbnail-icon);
1792
- }
1793
-
1794
- #viewOutline.toolbarButton::before {
1795
- -webkit-mask-image: var(--toolbarButton-viewOutline-icon);
1796
- mask-image: var(--toolbarButton-viewOutline-icon);
1797
- }
1798
- html[dir="rtl"] #viewOutline.toolbarButton::before {
1799
- transform: scaleX(-1);
1800
- }
1801
-
1802
- #viewAttachments.toolbarButton::before {
1803
- -webkit-mask-image: var(--toolbarButton-viewAttachments-icon);
1804
- mask-image: var(--toolbarButton-viewAttachments-icon);
1805
- }
1806
-
1807
- #viewLayers.toolbarButton::before {
1808
- -webkit-mask-image: var(--toolbarButton-viewLayers-icon);
1809
- mask-image: var(--toolbarButton-viewLayers-icon);
1810
- }
1811
-
1812
- #currentOutlineItem.toolbarButton::before {
1813
- -webkit-mask-image: var(--toolbarButton-currentOutlineItem-icon);
1814
- mask-image: var(--toolbarButton-currentOutlineItem-icon);
1815
- }
1816
- html[dir="rtl"] #currentOutlineItem.toolbarButton::before {
1817
- transform: scaleX(-1);
1818
- }
1819
-
1820
- #viewFind.toolbarButton::before {
1821
- -webkit-mask-image: var(--toolbarButton-search-icon);
1822
- mask-image: var(--toolbarButton-search-icon);
1823
- }
1824
-
1825
- .toolbarButton.pdfSidebarNotification::after {
1826
- position: absolute;
1827
- display: inline-block;
1828
- top: 1px;
1829
- /* Create a filled circle, with a diameter of 9 pixels, using only CSS: */
1830
- content: "";
1831
- background-color: rgba(112, 219, 85, 1);
1832
- height: 9px;
1833
- width: 9px;
1834
- border-radius: 50%;
1835
- }
1836
- html[dir="ltr"] .toolbarButton.pdfSidebarNotification::after {
1837
- left: 17px;
1838
- }
1839
- html[dir="rtl"] .toolbarButton.pdfSidebarNotification::after {
1840
- right: 17px;
1841
- }
1842
-
1843
- .secondaryToolbarButton {
1844
- position: relative;
1845
- margin: 0;
1846
- padding: 0 0 1px;
1847
- height: auto;
1848
- min-height: 26px;
1849
- width: auto;
1850
- min-width: 100%;
1851
- white-space: normal;
1852
- border-radius: 0;
1853
- box-sizing: border-box;
1854
- }
1855
- html[dir="ltr"] .secondaryToolbarButton {
1856
- padding-left: 36px;
1857
- text-align: left;
1858
- }
1859
- html[dir="rtl"] .secondaryToolbarButton {
1860
- padding-right: 36px;
1861
- text-align: right;
1862
- }
1863
-
1864
- html[dir="ltr"] .secondaryToolbarButton > span {
1865
- padding-right: 4px;
1866
- }
1867
- html[dir="rtl"] .secondaryToolbarButton > span {
1868
- padding-left: 4px;
1869
- }
1870
-
1871
- .secondaryToolbarButton.firstPage::before {
1872
- -webkit-mask-image: var(--secondaryToolbarButton-firstPage-icon);
1873
- mask-image: var(--secondaryToolbarButton-firstPage-icon);
1874
- }
1875
-
1876
- .secondaryToolbarButton.lastPage::before {
1877
- -webkit-mask-image: var(--secondaryToolbarButton-lastPage-icon);
1878
- mask-image: var(--secondaryToolbarButton-lastPage-icon);
1879
- }
1880
-
1881
- .secondaryToolbarButton.rotateCcw::before {
1882
- -webkit-mask-image: var(--secondaryToolbarButton-rotateCcw-icon);
1883
- mask-image: var(--secondaryToolbarButton-rotateCcw-icon);
1884
- }
1885
-
1886
- .secondaryToolbarButton.rotateCw::before {
1887
- -webkit-mask-image: var(--secondaryToolbarButton-rotateCw-icon);
1888
- mask-image: var(--secondaryToolbarButton-rotateCw-icon);
1889
- }
1890
-
1891
- .secondaryToolbarButton.selectTool::before {
1892
- -webkit-mask-image: var(--secondaryToolbarButton-selectTool-icon);
1893
- mask-image: var(--secondaryToolbarButton-selectTool-icon);
1894
- }
1895
-
1896
- .secondaryToolbarButton.handTool::before {
1897
- -webkit-mask-image: var(--secondaryToolbarButton-handTool-icon);
1898
- mask-image: var(--secondaryToolbarButton-handTool-icon);
1899
- }
1900
-
1901
- .secondaryToolbarButton.scrollVertical::before {
1902
- -webkit-mask-image: var(--secondaryToolbarButton-scrollVertical-icon);
1903
- mask-image: var(--secondaryToolbarButton-scrollVertical-icon);
1904
- }
1905
-
1906
- .secondaryToolbarButton.scrollHorizontal::before {
1907
- -webkit-mask-image: var(--secondaryToolbarButton-scrollHorizontal-icon);
1908
- mask-image: var(--secondaryToolbarButton-scrollHorizontal-icon);
1909
- }
1910
-
1911
- .secondaryToolbarButton.scrollWrapped::before {
1912
- -webkit-mask-image: var(--secondaryToolbarButton-scrollWrapped-icon);
1913
- mask-image: var(--secondaryToolbarButton-scrollWrapped-icon);
1914
- }
1915
-
1916
- .secondaryToolbarButton.spreadNone::before {
1917
- -webkit-mask-image: var(--secondaryToolbarButton-spreadNone-icon);
1918
- mask-image: var(--secondaryToolbarButton-spreadNone-icon);
1919
- }
1920
-
1921
- .secondaryToolbarButton.spreadOdd::before {
1922
- -webkit-mask-image: var(--secondaryToolbarButton-spreadOdd-icon);
1923
- mask-image: var(--secondaryToolbarButton-spreadOdd-icon);
1924
- }
1925
-
1926
- .secondaryToolbarButton.spreadEven::before {
1927
- -webkit-mask-image: var(--secondaryToolbarButton-spreadEven-icon);
1928
- mask-image: var(--secondaryToolbarButton-spreadEven-icon);
1929
- }
1930
-
1931
- .secondaryToolbarButton.documentProperties::before {
1932
- -webkit-mask-image: var(--secondaryToolbarButton-documentProperties-icon);
1933
- mask-image: var(--secondaryToolbarButton-documentProperties-icon);
1934
- }
1935
-
1936
- .verticalToolbarSeparator {
1937
- display: block;
1938
- padding: 11px 0;
1939
- margin: 5px 2px;
1940
- width: 1px;
1941
- background-color: var(--separator-color);
1942
- }
1943
- html[dir="ltr"] .verticalToolbarSeparator {
1944
- margin-left: 2px;
1945
- }
1946
- html[dir="rtl"] .verticalToolbarSeparator {
1947
- margin-right: 2px;
1948
- }
1949
-
1950
- .horizontalToolbarSeparator {
1951
- display: block;
1952
- margin: 6px 0 5px;
1953
- height: 1px;
1954
- width: 100%;
1955
- border-top: 1px solid var(--doorhanger-separator-color);
1956
- }
1957
-
1958
- .toolbarField {
1959
- padding: 4px 7px;
1960
- margin: 3px 0;
1961
- border-radius: 2px;
1962
- background-color: var(--field-bg-color);
1963
- background-clip: padding-box;
1964
- border-width: 1px;
1965
- border-style: solid;
1966
- border-color: var(--field-border-color);
1967
- box-shadow: none;
1968
- color: var(--field-color);
1969
- font-size: 12px;
1970
- line-height: 16px;
1971
- outline-style: none;
1972
- }
1973
-
1974
- .toolbarField[type="checkbox"] {
1975
- opacity: 0;
1976
- position: absolute !important;
1977
- left: 0;
1978
- }
1979
-
1980
- html[dir="ltr"] .toolbarField[type="checkbox"] {
1981
- margin: 10px 0 3px 7px;
1982
- }
1983
-
1984
- html[dir="rtl"] .toolbarField[type="checkbox"] {
1985
- margin: 10px 7px 3px 0;
1986
- }
1987
-
1988
- .toolbarField.pageNumber {
1989
- -moz-appearance: textfield; /* hides the spinner in moz */
1990
- min-width: 16px;
1991
- text-align: right;
1992
- width: 40px;
1993
- }
1994
-
1995
- .toolbarField.pageNumber.visiblePageIsLoading {
1996
- background-image: var(--loading-icon);
1997
- background-repeat: no-repeat;
1998
- background-position: 3px;
1999
- }
2000
-
2001
- .toolbarField.pageNumber::-webkit-inner-spin-button,
2002
- .toolbarField.pageNumber::-webkit-outer-spin-button {
2003
- -webkit-appearance: none;
2004
- margin: 0;
2005
- }
2006
-
2007
- .toolbarField:focus {
2008
- border-color: #0a84ff;
2009
- }
2010
-
2011
- .toolbarLabel {
2012
- min-width: 16px;
2013
- padding: 7px;
2014
- margin: 2px;
2015
- border-radius: 2px;
2016
- color: var(--main-color);
2017
- font-size: 12px;
2018
- line-height: 14px;
2019
- text-align: left;
2020
- -webkit-user-select: none;
2021
- -moz-user-select: none;
2022
- user-select: none;
2023
- cursor: default;
2024
- }
2025
-
2026
- html[dir="ltr"] #numPages.toolbarLabel {
2027
- padding-left: 3px;
2028
- }
2029
- html[dir="rtl"] #numPages.toolbarLabel {
2030
- padding-right: 3px;
2031
- }
2032
-
2033
- #thumbnailView {
2034
- position: absolute;
2035
- width: calc(100% - 60px);
2036
- top: 0;
2037
- bottom: 0;
2038
- padding: 10px 30px 0;
2039
- overflow: auto;
2040
- -webkit-overflow-scrolling: touch;
2041
- }
2042
-
2043
- #thumbnailView > a:active,
2044
- #thumbnailView > a:focus {
2045
- outline: 0;
2046
- }
2047
-
2048
- .thumbnail {
2049
- margin: 0 10px 5px;
2050
- }
2051
- html[dir="ltr"] .thumbnail {
2052
- float: left;
2053
- }
2054
- html[dir="rtl"] .thumbnail {
2055
- float: right;
2056
- }
2057
-
2058
- #thumbnailView > a:last-of-type > .thumbnail {
2059
- margin-bottom: 10px;
2060
- }
2061
-
2062
- #thumbnailView > a:last-of-type > .thumbnail:not([data-loaded]) {
2063
- margin-bottom: 9px;
2064
- }
2065
-
2066
- .thumbnail:not([data-loaded]) {
2067
- border: 1px dashed rgba(132, 132, 132, 1);
2068
- margin: -1px 9px 4px;
2069
- }
2070
-
2071
- .thumbnailImage {
2072
- border: 1px solid rgba(0, 0, 0, 0);
2073
- box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
2074
- opacity: 0.8;
2075
- z-index: 99;
2076
- background-color: rgba(255, 255, 255, 1);
2077
- background-clip: content-box;
2078
- }
2079
-
2080
- .thumbnailSelectionRing {
2081
- border-radius: 2px;
2082
- padding: 7px;
2083
- }
2084
-
2085
- a:focus > .thumbnail > .thumbnailSelectionRing > .thumbnailImage,
2086
- .thumbnail:hover > .thumbnailSelectionRing > .thumbnailImage {
2087
- opacity: 0.9;
2088
- }
2089
-
2090
- a:focus > .thumbnail > .thumbnailSelectionRing,
2091
- .thumbnail:hover > .thumbnailSelectionRing {
2092
- background-color: var(--sidebaritem-bg-color);
2093
- background-clip: padding-box;
2094
- color: rgba(255, 255, 255, 0.9);
2095
- }
2096
-
2097
- .thumbnail.selected > .thumbnailSelectionRing > .thumbnailImage {
2098
- opacity: 1;
2099
- }
2100
-
2101
- .thumbnail.selected > .thumbnailSelectionRing {
2102
- background-color: var(--sidebaritem-bg-color);
2103
- background-clip: padding-box;
2104
- color: rgba(255, 255, 255, 1);
2105
- }
2106
-
2107
- #outlineView,
2108
- #attachmentsView,
2109
- #layersView {
2110
- position: absolute;
2111
- width: calc(100% - 8px);
2112
- top: 0;
2113
- bottom: 0;
2114
- padding: 4px 4px 0;
2115
- overflow: auto;
2116
- -webkit-overflow-scrolling: touch;
2117
- -webkit-user-select: none;
2118
- -moz-user-select: none;
2119
- user-select: none;
2120
- }
2121
-
2122
- html[dir="ltr"] .treeWithDeepNesting > .treeItem,
2123
- html[dir="ltr"] .treeItem > .treeItems {
2124
- margin-left: 20px;
2125
- }
2126
-
2127
- html[dir="rtl"] .treeWithDeepNesting > .treeItem,
2128
- html[dir="rtl"] .treeItem > .treeItems {
2129
- margin-right: 20px;
2130
- }
2131
-
2132
- .treeItem > a {
2133
- text-decoration: none;
2134
- display: inline-block;
2135
- min-width: 95%;
2136
- /* Subtract the right padding (left, in RTL mode) of the container: */
2137
- min-width: calc(100% - 4px);
2138
- height: auto;
2139
- margin-bottom: 1px;
2140
- border-radius: 2px;
2141
- color: var(--treeitem-color);
2142
- font-size: 13px;
2143
- line-height: 15px;
2144
- -webkit-user-select: none;
2145
- -moz-user-select: none;
2146
- user-select: none;
2147
- white-space: normal;
2148
- cursor: pointer;
2149
- }
2150
- html[dir="ltr"] .treeItem > a {
2151
- padding: 2px 0 5px 4px;
2152
- }
2153
- html[dir="rtl"] .treeItem > a {
2154
- padding: 2px 4px 5px 0;
2155
- }
2156
-
2157
- #layersView .treeItem > a > * {
2158
- cursor: pointer;
2159
- }
2160
- html[dir="ltr"] #layersView .treeItem > a > label {
2161
- padding-left: 4px;
2162
- }
2163
- html[dir="rtl"] #layersView .treesItem > a > label {
2164
- padding-right: 4px;
2165
- }
2166
-
2167
- .treeItemToggler {
2168
- position: relative;
2169
- height: 0;
2170
- width: 0;
2171
- color: rgba(255, 255, 255, 0.5);
2172
- }
2173
- .treeItemToggler::before {
2174
- -webkit-mask-image: var(--treeitem-expanded-icon);
2175
- mask-image: var(--treeitem-expanded-icon);
2176
- }
2177
- .treeItemToggler.treeItemsHidden::before {
2178
- -webkit-mask-image: var(--treeitem-collapsed-icon);
2179
- mask-image: var(--treeitem-collapsed-icon);
2180
- }
2181
- html[dir="rtl"] .treeItemToggler.treeItemsHidden::before {
2182
- transform: scaleX(-1);
2183
- }
2184
- .treeItemToggler.treeItemsHidden ~ .treeItems {
2185
- display: none;
2186
- }
2187
- html[dir="ltr"] .treeItemToggler {
2188
- float: left;
2189
- }
2190
- html[dir="rtl"] .treeItemToggler {
2191
- float: right;
2192
- }
2193
- html[dir="ltr"] .treeItemToggler::before {
2194
- right: 4px;
2195
- }
2196
- html[dir="rtl"] .treeItemToggler::before {
2197
- left: 4px;
2198
- }
2199
-
2200
- .treeItem.selected > a {
2201
- background-color: var(--treeitem-selected-bg-color);
2202
- color: var(--treeitem-selected-color);
2203
- }
2204
-
2205
- .treeItemToggler:hover,
2206
- .treeItemToggler:hover + a,
2207
- .treeItemToggler:hover ~ .treeItems,
2208
- .treeItem > a:hover {
2209
- background-color: var(--sidebaritem-bg-color);
2210
- background-clip: padding-box;
2211
- border-radius: 2px;
2212
- color: var(--treeitem-hover-color);
2213
- }
2214
-
2215
- /* TODO: file FF bug to support ::-moz-selection:window-inactive
2216
- so we can override the opaque grey background when the window is inactive;
2217
- see https://bugzilla.mozilla.org/show_bug.cgi?id=706209 */
2218
- ::-moz-selection {
2219
- background: rgba(0, 0, 255, 0.3);
2220
- }
2221
- ::selection {
2222
- background: rgba(0, 0, 255, 0.3);
2223
- }
2224
-
2225
- #errorWrapper {
2226
- background: none repeat scroll 0 0 var(--errorWrapper-bg-color);
2227
- color: var(--main-color);
2228
- left: 0;
2229
- position: absolute;
2230
- right: 0;
2231
- z-index: 1000;
2232
- padding: 3px 6px;
2233
- }
2234
-
2235
- #errorMessageLeft {
2236
- float: left;
2237
- }
2238
-
2239
- #errorMessageRight {
2240
- float: right;
2241
- }
2242
-
2243
- #errorMoreInfo {
2244
- background-color: var(--field-bg-color);
2245
- color: var(--field-color);
2246
- border: 1px solid var(--field-border-color);
2247
- padding: 3px;
2248
- margin: 3px;
2249
- width: 98%;
2250
- }
2251
-
2252
- .overlayButton {
2253
- width: auto;
2254
- margin: 3px 4px 2px !important;
2255
- padding: 2px 11px;
2256
- color: var(--main-color);
2257
- background-color: var(--overlay-button-bg-color);
2258
- border: var(--overlay-button-border) !important;
2259
- }
2260
-
2261
- #overlayContainer {
2262
- display: table;
2263
- position: absolute;
2264
- width: 100%;
2265
- height: 100%;
2266
- background-color: rgba(0, 0, 0, 0.2);
2267
- z-index: 40000;
2268
- }
2269
- #overlayContainer > * {
2270
- overflow: auto;
2271
- -webkit-overflow-scrolling: touch;
2272
- }
2273
-
2274
- #overlayContainer > .container {
2275
- display: table-cell;
2276
- vertical-align: middle;
2277
- text-align: center;
2278
- }
2279
-
2280
- #overlayContainer > .container > .dialog {
2281
- display: inline-block;
2282
- padding: 15px;
2283
- border-spacing: 4px;
2284
- color: var(--main-color);
2285
- font-size: 12px;
2286
- line-height: 14px;
2287
- background-color: var(--doorhanger-bg-color);
2288
- border: 1px solid rgba(0, 0, 0, 0.5);
2289
- border-radius: 4px;
2290
- box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
2291
- }
2292
-
2293
- .dialog > .row {
2294
- display: table-row;
2295
- }
2296
-
2297
- .dialog > .row > * {
2298
- display: table-cell;
2299
- }
2300
-
2301
- .dialog .toolbarField {
2302
- margin: 5px 0;
2303
- }
2304
-
2305
- .dialog .separator {
2306
- display: block;
2307
- margin: 4px 0;
2308
- height: 1px;
2309
- width: 100%;
2310
- background-color: var(--separator-color);
2311
- }
2312
-
2313
- .dialog .buttonRow {
2314
- text-align: center;
2315
- vertical-align: middle;
2316
- }
2317
-
2318
- .dialog :link {
2319
- color: rgba(255, 255, 255, 1);
2320
- }
2321
-
2322
- #passwordOverlay > .dialog {
2323
- text-align: center;
2324
- }
2325
- #passwordOverlay .toolbarField {
2326
- width: 200px;
2327
- }
2328
-
2329
- #documentPropertiesOverlay > .dialog {
2330
- text-align: left;
2331
- }
2332
- #documentPropertiesOverlay .row > * {
2333
- min-width: 100px;
2334
- }
2335
- html[dir="ltr"] #documentPropertiesOverlay .row > * {
2336
- text-align: left;
2337
- }
2338
- html[dir="rtl"] #documentPropertiesOverlay .row > * {
2339
- text-align: right;
2340
- }
2341
- #documentPropertiesOverlay .row > span {
2342
- width: 125px;
2343
- word-wrap: break-word;
2344
- }
2345
- #documentPropertiesOverlay .row > p {
2346
- max-width: 225px;
2347
- word-wrap: break-word;
2348
- }
2349
- #documentPropertiesOverlay .buttonRow {
2350
- margin-top: 10px;
2351
- }
2352
-
2353
- .clearBoth {
2354
- clear: both;
2355
- }
2356
-
2357
- .fileInput {
2358
- background: rgba(255, 255, 255, 1);
2359
- color: rgba(0, 0, 0, 1);
2360
- margin-top: 5px;
2361
- visibility: hidden;
2362
- position: fixed;
2363
- right: 0;
2364
- top: 0;
2365
- }
2366
-
2367
- #PDFBug {
2368
- background: none repeat scroll 0 0 rgba(255, 255, 255, 1);
2369
- border: 1px solid rgba(102, 102, 102, 1);
2370
- position: fixed;
2371
- top: 32px;
2372
- right: 0;
2373
- bottom: 0;
2374
- font-size: 10px;
2375
- padding: 0;
2376
- width: 300px;
2377
- }
2378
- #PDFBug .controls {
2379
- background: rgba(238, 238, 238, 1);
2380
- border-bottom: 1px solid rgba(102, 102, 102, 1);
2381
- padding: 3px;
2382
- }
2383
- #PDFBug .panels {
2384
- bottom: 0;
2385
- left: 0;
2386
- overflow: auto;
2387
- -webkit-overflow-scrolling: touch;
2388
- position: absolute;
2389
- right: 0;
2390
- top: 27px;
2391
- }
2392
- #PDFBug .panels > div {
2393
- padding: 5px;
2394
- }
2395
- #PDFBug button.active {
2396
- font-weight: bold;
2397
- }
2398
- .debuggerShowText {
2399
- background: none repeat scroll 0 0 rgba(255, 255, 0, 1);
2400
- color: rgba(0, 0, 255, 1);
2401
- }
2402
- .debuggerHideText:hover {
2403
- background: none repeat scroll 0 0 rgba(255, 255, 0, 1);
2404
- }
2405
- #PDFBug .stats {
2406
- font-family: courier;
2407
- font-size: 10px;
2408
- white-space: pre;
2409
- }
2410
- #PDFBug .stats .title {
2411
- font-weight: bold;
2412
- }
2413
- #PDFBug table {
2414
- font-size: 10px;
2415
- }
2416
- #PDFBug table.showText {
2417
- border-collapse: collapse;
2418
- text-align: center;
2419
- }
2420
- #PDFBug table.showText,
2421
- #PDFBug table.showText tr,
2422
- #PDFBug table.showText td {
2423
- border: 1px solid black;
2424
- padding: 1px;
2425
- }
2426
- #PDFBug table.showText td.advance {
2427
- color: grey;
2428
- }
2429
-
2430
- #viewer.textLayer-visible .textLayer {
2431
- opacity: 1;
2432
- }
2433
-
2434
- #viewer.textLayer-visible .canvasWrapper {
2435
- background-color: rgba(128, 255, 128, 1);
2436
- }
2437
-
2438
- #viewer.textLayer-visible .canvasWrapper canvas {
2439
- mix-blend-mode: screen;
2440
- }
2441
-
2442
- #viewer.textLayer-visible .textLayer span {
2443
- background-color: rgba(255, 255, 0, 0.1);
2444
- color: rgba(0, 0, 0, 1);
2445
- border: solid 1px rgba(255, 0, 0, 0.5);
2446
- box-sizing: border-box;
2447
- }
2448
-
2449
- #viewer.textLayer-hover .textLayer span:hover {
2450
- background-color: rgba(255, 255, 255, 1);
2451
- color: rgba(0, 0, 0, 1);
2452
- }
2453
-
2454
- #viewer.textLayer-shadow .textLayer span {
2455
- background-color: rgba(255, 255, 255, 0.6);
2456
- color: rgba(0, 0, 0, 1);
2457
- }
2458
-
2459
- .grab-to-pan-grab {
2460
- cursor: url("images/grab.cur"), move !important;
2461
- cursor: -webkit-grab !important;
2462
- cursor: grab !important;
2463
- }
2464
- .grab-to-pan-grab
2465
- *:not(input):not(textarea):not(button):not(select):not(:link) {
2466
- cursor: inherit !important;
2467
- }
2468
- .grab-to-pan-grab:active,
2469
- .grab-to-pan-grabbing {
2470
- cursor: url("images/grabbing.cur"), move !important;
2471
- cursor: -webkit-grabbing !important;
2472
- cursor: grabbing !important;
2473
- position: fixed;
2474
- background: rgba(0, 0, 0, 0);
2475
- display: block;
2476
- top: 0;
2477
- left: 0;
2478
- right: 0;
2479
- bottom: 0;
2480
- overflow: hidden;
2481
- z-index: 50000; /* should be higher than anything else in PDF.js! */
2482
- }
2483
-
2484
- @page {
2485
- margin: 0;
2486
- }
2487
-
2488
- #printContainer {
2489
- display: none;
2490
- }
2491
-
2492
- @media print {
2493
- /* General rules for printing. */
2494
- body {
2495
- background: rgba(0, 0, 0, 0) none;
2496
- }
2497
-
2498
- /* Rules for browsers that don't support mozPrintCallback. */
2499
- #sidebarContainer,
2500
- #secondaryToolbar,
2501
- .toolbar,
2502
- #loadingBox,
2503
- #errorWrapper,
2504
- .textLayer,
2505
- .canvasWrapper {
2506
- display: none;
2507
- }
2508
- #viewerContainer {
2509
- overflow: visible;
2510
- }
2511
-
2512
- #mainContainer,
2513
- #viewerContainer,
2514
- .page,
2515
- .page canvas {
2516
- position: static;
2517
- padding: 0;
2518
- margin: 0;
2519
- }
2520
-
2521
- .page {
2522
- float: left;
2523
- display: none;
2524
- border: none;
2525
- box-shadow: none;
2526
- background-clip: content-box;
2527
- background-color: rgba(255, 255, 255, 1);
2528
- }
2529
-
2530
- .page[data-loaded] {
2531
- display: block;
2532
- }
2533
-
2534
- .fileInput {
2535
- display: none;
2536
- }
2537
-
2538
- /* Rules for browsers that support PDF.js printing */
2539
- body[data-pdfjsprinting] #outerContainer {
2540
- display: none;
2541
- }
2542
- body[data-pdfjsprinting] #printContainer {
2543
- display: block;
2544
- }
2545
- #printContainer {
2546
- height: 100%;
2547
- }
2548
- /* wrapper around (scaled) print canvas elements */
2549
- #printContainer > .printedPage {
2550
- page-break-after: always;
2551
- page-break-inside: avoid;
2552
-
2553
- /* The wrapper always cover the whole page. */
2554
- height: 100%;
2555
- width: 100%;
2556
-
2557
- display: flex;
2558
- flex-direction: column;
2559
- justify-content: center;
2560
- align-items: center;
2561
- }
2562
-
2563
- #printContainer > .xfaPrintedPage .xfaPage {
2564
- position: initial;
2565
- }
2566
-
2567
- #printContainer > .xfaPrintedPage {
2568
- page-break-after: always;
2569
- page-break-inside: avoid;
2570
- width: 100%;
2571
- height: 100%;
2572
- position: relative;
2573
- }
2574
-
2575
- #printContainer > .printedPage canvas,
2576
- #printContainer > .printedPage img {
2577
- /* The intrinsic canvas / image size will make sure that we fit the page. */
2578
- max-width: 100%;
2579
- max-height: 100%;
2580
-
2581
- direction: ltr;
2582
- display: block;
2583
- }
2584
- }
2585
-
2586
- .visibleLargeView,
2587
- .visibleMediumView,
2588
- .visibleSmallView {
2589
- display: none;
2590
- }
2591
-
2592
- @media all and (max-width: 900px) {
2593
- #toolbarViewerMiddle {
2594
- display: table;
2595
- margin: auto;
2596
- left: auto;
2597
- position: inherit;
2598
- transform: none;
2599
- }
2600
- }
2601
-
2602
- @media all and (max-width: 840px) {
2603
- #sidebarContainer {
2604
- background-color: var(--sidebar-narrow-bg-color);
2605
- }
2606
-
2607
- html[dir="ltr"] #outerContainer.sidebarOpen #viewerContainer {
2608
- left: 0 !important;
2609
- }
2610
- html[dir="rtl"] #outerContainer.sidebarOpen #viewerContainer {
2611
- right: 0 !important;
2612
- }
2613
-
2614
- #outerContainer .hiddenLargeView,
2615
- #outerContainer .hiddenMediumView {
2616
- display: inherit;
2617
- }
2618
- #outerContainer .visibleLargeView,
2619
- #outerContainer .visibleMediumView {
2620
- display: none;
2621
- }
2622
- }
2623
-
2624
- @media all and (max-width: 770px) {
2625
- #outerContainer .hiddenLargeView {
2626
- display: none;
2627
- }
2628
- #outerContainer .visibleLargeView {
2629
- display: inherit;
2630
- }
2631
- }
2632
-
2633
- @media all and (max-width: 700px) {
2634
- #outerContainer .hiddenMediumView {
2635
- display: none;
2636
- }
2637
- #outerContainer .visibleMediumView {
2638
- display: inherit;
2639
- }
2640
- }
2641
-
2642
- @media all and (max-width: 640px) {
2643
- .hiddenSmallView,
2644
- .hiddenSmallView * {
2645
- display: none;
2646
- }
2647
- .visibleSmallView {
2648
- display: inherit;
2649
- }
2650
- .toolbarButtonSpacer {
2651
- width: 0;
2652
- }
2653
- html[dir="ltr"] .findbar {
2654
- left: 34px;
2655
- }
2656
- html[dir="rtl"] .findbar {
2657
- right: 34px;
2658
- }
2659
- }
2660
-
2661
- @media all and (max-width: 535px) {
2662
- #scaleSelectContainer {
2663
- display: none;
2664
- }
2665
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/vendor/pdfjs/mozila/web/viewer.html DELETED
@@ -1,398 +0,0 @@
1
- <!DOCTYPE html>
2
- <!--
3
- Copyright 2012 Mozilla Foundation
4
-
5
- Licensed under the Apache License, Version 2.0 (the "License");
6
- you may not use this file except in compliance with the License.
7
- You may obtain a copy of the License at
8
-
9
- http://www.apache.org/licenses/LICENSE-2.0
10
-
11
- Unless required by applicable law or agreed to in writing, software
12
- distributed under the License is distributed on an "AS IS" BASIS,
13
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- See the License for the specific language governing permissions and
15
- limitations under the License.
16
-
17
- Adobe CMap resources are covered by their own copyright but the same license:
18
-
19
- Copyright 1990-2015 Adobe Systems Incorporated.
20
-
21
- See https://github.com/adobe-type-tools/cmap-resources
22
- -->
23
- <html dir="ltr" mozdisallowselectionprint>
24
- <head>
25
- <meta charset="utf-8">
26
- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
27
- <meta name="google" content="notranslate">
28
- <title>PDF.js viewer</title>
29
-
30
-
31
- <link rel="stylesheet" href="viewer.css">
32
-
33
-
34
- <!-- This snippet is used in production (included from viewer.html) -->
35
- <!-- <link rel="resource" type="application/l10n" href="locale/locale.properties"> -->
36
- <script src="https://cdn.jsdelivr.net/npm/pdfjs-dist@2.10.377/build/pdf.min.js"></script>
37
-
38
-
39
- <script src="viewer.js"></script>
40
-
41
- </head>
42
-
43
- <body tabindex="1">
44
- <div id="outerContainer">
45
-
46
- <div id="sidebarContainer">
47
- <div id="toolbarSidebar">
48
- <div id="toolbarSidebarLeft">
49
- <div class="splitToolbarButton toggled">
50
- <button id="viewThumbnail" class="toolbarButton toggled" title="Show Thumbnails" tabindex="2" data-l10n-id="thumbs">
51
- <span data-l10n-id="thumbs_label">Thumbnails</span>
52
- </button>
53
- <button id="viewOutline" class="toolbarButton" title="Show Document Outline (double-click to expand/collapse all items)" tabindex="3" data-l10n-id="document_outline">
54
- <span data-l10n-id="document_outline_label">Document Outline</span>
55
- </button>
56
- <button id="viewAttachments" class="toolbarButton" title="Show Attachments" tabindex="4" data-l10n-id="attachments">
57
- <span data-l10n-id="attachments_label">Attachments</span>
58
- </button>
59
- <button id="viewLayers" class="toolbarButton" title="Show Layers (double-click to reset all layers to the default state)" tabindex="5" data-l10n-id="layers">
60
- <span data-l10n-id="layers_label">Layers</span>
61
- </button>
62
- </div>
63
- </div>
64
-
65
- <div id="toolbarSidebarRight">
66
- <div id="outlineOptionsContainer" class="hidden">
67
- <div class="verticalToolbarSeparator"></div>
68
-
69
- <button id="currentOutlineItem" class="toolbarButton" disabled="disabled" title="Find Current Outline Item" tabindex="6" data-l10n-id="current_outline_item">
70
- <span data-l10n-id="current_outline_item_label">Current Outline Item</span>
71
- </button>
72
- </div>
73
- </div>
74
- </div>
75
- <div id="sidebarContent">
76
- <div id="thumbnailView">
77
- </div>
78
- <div id="outlineView" class="hidden">
79
- </div>
80
- <div id="attachmentsView" class="hidden">
81
- </div>
82
- <div id="layersView" class="hidden">
83
- </div>
84
- </div>
85
- <div id="sidebarResizer"></div>
86
- </div> <!-- sidebarContainer -->
87
-
88
- <div id="mainContainer">
89
- <div class="findbar hidden doorHanger" id="findbar">
90
- <div id="findbarInputContainer">
91
- <input id="findInput" class="toolbarField" title="Find" placeholder="Find in document…" tabindex="91" data-l10n-id="find_input">
92
- <div class="splitToolbarButton">
93
- <button id="findPrevious" class="toolbarButton findPrevious" title="Find the previous occurrence of the phrase" tabindex="92" data-l10n-id="find_previous">
94
- <span data-l10n-id="find_previous_label">Previous</span>
95
- </button>
96
- <div class="splitToolbarButtonSeparator"></div>
97
- <button id="findNext" class="toolbarButton findNext" title="Find the next occurrence of the phrase" tabindex="93" data-l10n-id="find_next">
98
- <span data-l10n-id="find_next_label">Next</span>
99
- </button>
100
- </div>
101
- </div>
102
-
103
- <div id="findbarOptionsOneContainer">
104
- <input type="checkbox" id="findHighlightAll" class="toolbarField" tabindex="94">
105
- <label for="findHighlightAll" class="toolbarLabel" data-l10n-id="find_highlight">Highlight all</label>
106
- <input type="checkbox" id="findMatchCase" class="toolbarField" tabindex="95">
107
- <label for="findMatchCase" class="toolbarLabel" data-l10n-id="find_match_case_label">Match case</label>
108
- </div>
109
- <div id="findbarOptionsTwoContainer">
110
- <input type="checkbox" id="findEntireWord" class="toolbarField" tabindex="96">
111
- <label for="findEntireWord" class="toolbarLabel" data-l10n-id="find_entire_word_label">Whole words</label>
112
- <span id="findResultsCount" class="toolbarLabel hidden"></span>
113
- </div>
114
-
115
- <div id="findbarMessageContainer">
116
- <span id="findMsg" class="toolbarLabel"></span>
117
- </div>
118
- </div> <!-- findbar -->
119
-
120
- <div id="secondaryToolbar" class="secondaryToolbar hidden doorHangerRight">
121
- <div id="secondaryToolbarButtonContainer">
122
- <button id="secondaryPresentationMode" class="secondaryToolbarButton presentationMode visibleLargeView" title="Switch to Presentation Mode" tabindex="51" data-l10n-id="presentation_mode">
123
- <span data-l10n-id="presentation_mode_label">Presentation Mode</span>
124
- </button>
125
-
126
- <button id="secondaryOpenFile" class="secondaryToolbarButton openFile visibleLargeView" title="Open File" tabindex="52" data-l10n-id="open_file">
127
- <span data-l10n-id="open_file_label">Open</span>
128
- </button>
129
-
130
- <button id="secondaryPrint" class="secondaryToolbarButton print visibleMediumView" title="Print" tabindex="53" data-l10n-id="print">
131
- <span data-l10n-id="print_label">Print</span>
132
- </button>
133
-
134
- <button id="secondaryDownload" class="secondaryToolbarButton download visibleMediumView" title="Download" tabindex="54" data-l10n-id="download">
135
- <span data-l10n-id="download_label">Download</span>
136
- </button>
137
-
138
- <a href="#" id="secondaryViewBookmark" class="secondaryToolbarButton bookmark visibleSmallView" title="Current view (copy or open in new window)" tabindex="55" data-l10n-id="bookmark">
139
- <span data-l10n-id="bookmark_label">Current View</span>
140
- </a>
141
-
142
- <div class="horizontalToolbarSeparator visibleLargeView"></div>
143
-
144
- <button id="firstPage" class="secondaryToolbarButton firstPage" title="Go to First Page" tabindex="56" data-l10n-id="first_page">
145
- <span data-l10n-id="first_page_label">Go to First Page</span>
146
- </button>
147
- <button id="lastPage" class="secondaryToolbarButton lastPage" title="Go to Last Page" tabindex="57" data-l10n-id="last_page">
148
- <span data-l10n-id="last_page_label">Go to Last Page</span>
149
- </button>
150
-
151
- <div class="horizontalToolbarSeparator"></div>
152
-
153
- <button id="pageRotateCw" class="secondaryToolbarButton rotateCw" title="Rotate Clockwise" tabindex="58" data-l10n-id="page_rotate_cw">
154
- <span data-l10n-id="page_rotate_cw_label">Rotate Clockwise</span>
155
- </button>
156
- <button id="pageRotateCcw" class="secondaryToolbarButton rotateCcw" title="Rotate Counterclockwise" tabindex="59" data-l10n-id="page_rotate_ccw">
157
- <span data-l10n-id="page_rotate_ccw_label">Rotate Counterclockwise</span>
158
- </button>
159
-
160
- <div class="horizontalToolbarSeparator"></div>
161
-
162
- <button id="cursorSelectTool" class="secondaryToolbarButton selectTool toggled" title="Enable Text Selection Tool" tabindex="60" data-l10n-id="cursor_text_select_tool">
163
- <span data-l10n-id="cursor_text_select_tool_label">Text Selection Tool</span>
164
- </button>
165
- <button id="cursorHandTool" class="secondaryToolbarButton handTool" title="Enable Hand Tool" tabindex="61" data-l10n-id="cursor_hand_tool">
166
- <span data-l10n-id="cursor_hand_tool_label">Hand Tool</span>
167
- </button>
168
-
169
- <div class="horizontalToolbarSeparator"></div>
170
-
171
- <button id="scrollVertical" class="secondaryToolbarButton scrollModeButtons scrollVertical toggled" title="Use Vertical Scrolling" tabindex="62" data-l10n-id="scroll_vertical">
172
- <span data-l10n-id="scroll_vertical_label">Vertical Scrolling</span>
173
- </button>
174
- <button id="scrollHorizontal" class="secondaryToolbarButton scrollModeButtons scrollHorizontal" title="Use Horizontal Scrolling" tabindex="63" data-l10n-id="scroll_horizontal">
175
- <span data-l10n-id="scroll_horizontal_label">Horizontal Scrolling</span>
176
- </button>
177
- <button id="scrollWrapped" class="secondaryToolbarButton scrollModeButtons scrollWrapped" title="Use Wrapped Scrolling" tabindex="64" data-l10n-id="scroll_wrapped">
178
- <span data-l10n-id="scroll_wrapped_label">Wrapped Scrolling</span>
179
- </button>
180
-
181
- <div class="horizontalToolbarSeparator scrollModeButtons"></div>
182
-
183
- <button id="spreadNone" class="secondaryToolbarButton spreadModeButtons spreadNone toggled" title="Do not join page spreads" tabindex="65" data-l10n-id="spread_none">
184
- <span data-l10n-id="spread_none_label">No Spreads</span>
185
- </button>
186
- <button id="spreadOdd" class="secondaryToolbarButton spreadModeButtons spreadOdd" title="Join page spreads starting with odd-numbered pages" tabindex="66" data-l10n-id="spread_odd">
187
- <span data-l10n-id="spread_odd_label">Odd Spreads</span>
188
- </button>
189
- <button id="spreadEven" class="secondaryToolbarButton spreadModeButtons spreadEven" title="Join page spreads starting with even-numbered pages" tabindex="67" data-l10n-id="spread_even">
190
- <span data-l10n-id="spread_even_label">Even Spreads</span>
191
- </button>
192
-
193
- <div class="horizontalToolbarSeparator spreadModeButtons"></div>
194
-
195
- <button id="documentProperties" class="secondaryToolbarButton documentProperties" title="Document Properties…" tabindex="68" data-l10n-id="document_properties">
196
- <span data-l10n-id="document_properties_label">Document Properties…</span>
197
- </button>
198
- </div>
199
- </div> <!-- secondaryToolbar -->
200
-
201
- <div class="toolbar">
202
- <div id="toolbarContainer">
203
- <div id="toolbarViewer">
204
- <div id="toolbarViewerLeft">
205
- <button id="sidebarToggle" class="toolbarButton" title="Toggle Sidebar" tabindex="11" data-l10n-id="toggle_sidebar" aria-expanded="false" aria-controls="sidebarContainer">
206
- <span data-l10n-id="toggle_sidebar_label">Toggle Sidebar</span>
207
- </button>
208
- <div class="toolbarButtonSpacer"></div>
209
- <button id="viewFind" class="toolbarButton" title="Find in Document" tabindex="12" data-l10n-id="findbar" aria-expanded="false" aria-controls="findbar">
210
- <span data-l10n-id="findbar_label">Find</span>
211
- </button>
212
- <div class="splitToolbarButton hiddenSmallView">
213
- <button class="toolbarButton pageUp" title="Previous Page" id="previous" tabindex="13" data-l10n-id="previous">
214
- <span data-l10n-id="previous_label">Previous</span>
215
- </button>
216
- <div class="splitToolbarButtonSeparator"></div>
217
- <button class="toolbarButton pageDown" title="Next Page" id="next" tabindex="14" data-l10n-id="next">
218
- <span data-l10n-id="next_label">Next</span>
219
- </button>
220
- </div>
221
- <input type="number" id="pageNumber" class="toolbarField pageNumber" title="Page" value="1" size="4" min="1" tabindex="15" data-l10n-id="page" autocomplete="off">
222
- <span id="numPages" class="toolbarLabel"></span>
223
- </div>
224
- <div id="toolbarViewerRight">
225
- <button id="presentationMode" class="toolbarButton presentationMode hiddenLargeView" title="Switch to Presentation Mode" tabindex="31" data-l10n-id="presentation_mode">
226
- <span data-l10n-id="presentation_mode_label">Presentation Mode</span>
227
- </button>
228
-
229
- <button id="openFile" class="toolbarButton openFile hiddenLargeView" title="Open File" tabindex="32" data-l10n-id="open_file">
230
- <span data-l10n-id="open_file_label">Open</span>
231
- </button>
232
-
233
- <button id="print" class="toolbarButton print hiddenMediumView" title="Print" tabindex="33" data-l10n-id="print">
234
- <span data-l10n-id="print_label">Print</span>
235
- </button>
236
-
237
- <button id="download" class="toolbarButton download hiddenMediumView" title="Download" tabindex="34" data-l10n-id="download">
238
- <span data-l10n-id="download_label">Download</span>
239
- </button>
240
- <a href="#" id="viewBookmark" class="toolbarButton bookmark hiddenSmallView" title="Current view (copy or open in new window)" tabindex="35" data-l10n-id="bookmark">
241
- <span data-l10n-id="bookmark_label">Current View</span>
242
- </a>
243
-
244
- <div class="verticalToolbarSeparator hiddenSmallView"></div>
245
-
246
- <button id="secondaryToolbarToggle" class="toolbarButton" title="Tools" tabindex="36" data-l10n-id="tools" aria-expanded="false" aria-controls="secondaryToolbar">
247
- <span data-l10n-id="tools_label">Tools</span>
248
- </button>
249
- </div>
250
- <div id="toolbarViewerMiddle">
251
- <div class="splitToolbarButton">
252
- <button id="zoomOut" class="toolbarButton zoomOut" title="Zoom Out" tabindex="21" data-l10n-id="zoom_out">
253
- <span data-l10n-id="zoom_out_label">Zoom Out</span>
254
- </button>
255
- <div class="splitToolbarButtonSeparator"></div>
256
- <button id="zoomIn" class="toolbarButton zoomIn" title="Zoom In" tabindex="22" data-l10n-id="zoom_in">
257
- <span data-l10n-id="zoom_in_label">Zoom In</span>
258
- </button>
259
- </div>
260
- <span id="scaleSelectContainer" class="dropdownToolbarButton">
261
- <select id="scaleSelect" title="Zoom" tabindex="23" data-l10n-id="zoom">
262
- <option id="pageAutoOption" title="" value="auto" selected="selected" data-l10n-id="page_scale_auto">Automatic Zoom</option>
263
- <option id="pageActualOption" title="" value="page-actual" data-l10n-id="page_scale_actual">Actual Size</option>
264
- <option id="pageFitOption" title="" value="page-fit" data-l10n-id="page_scale_fit">Page Fit</option>
265
- <option id="pageWidthOption" title="" value="page-width" data-l10n-id="page_scale_width">Page Width</option>
266
- <option id="customScaleOption" title="" value="custom" disabled="disabled" hidden="true"></option>
267
- <option title="" value="0.5" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 50 }'>50%</option>
268
- <option title="" value="0.75" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 75 }'>75%</option>
269
- <option title="" value="1" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 100 }'>100%</option>
270
- <option title="" value="1.25" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 125 }'>125%</option>
271
- <option title="" value="1.5" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 150 }'>150%</option>
272
- <option title="" value="2" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 200 }'>200%</option>
273
- <option title="" value="3" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 300 }'>300%</option>
274
- <option title="" value="4" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 400 }'>400%</option>
275
- </select>
276
- </span>
277
- </div>
278
- </div>
279
- <div id="loadingBar">
280
- <div class="progress">
281
- <div class="glimmer">
282
- </div>
283
- </div>
284
- </div>
285
- </div>
286
- </div>
287
-
288
- <div id="viewerContainer" tabindex="0">
289
- <div id="viewer" class="pdfViewer"></div>
290
- </div>
291
-
292
- <div id="errorWrapper" hidden='true'>
293
- <div id="errorMessageLeft">
294
- <span id="errorMessage"></span>
295
- <button id="errorShowMore" data-l10n-id="error_more_info">
296
- More Information
297
- </button>
298
- <button id="errorShowLess" data-l10n-id="error_less_info" hidden='true'>
299
- Less Information
300
- </button>
301
- </div>
302
- <div id="errorMessageRight">
303
- <button id="errorClose" data-l10n-id="error_close">
304
- Close
305
- </button>
306
- </div>
307
- <div class="clearBoth"></div>
308
- <textarea id="errorMoreInfo" hidden='true' readonly="readonly"></textarea>
309
- </div>
310
- </div> <!-- mainContainer -->
311
-
312
- <div id="overlayContainer" class="hidden">
313
- <div id="passwordOverlay" class="container hidden">
314
- <div class="dialog">
315
- <div class="row">
316
- <p id="passwordText" data-l10n-id="password_label">Enter the password to open this PDF file:</p>
317
- </div>
318
- <div class="row">
319
- <input type="password" id="password" class="toolbarField">
320
- </div>
321
- <div class="buttonRow">
322
- <button id="passwordCancel" class="overlayButton"><span data-l10n-id="password_cancel">Cancel</span></button>
323
- <button id="passwordSubmit" class="overlayButton"><span data-l10n-id="password_ok">OK</span></button>
324
- </div>
325
- </div>
326
- </div>
327
- <div id="documentPropertiesOverlay" class="container hidden">
328
- <div class="dialog">
329
- <div class="row">
330
- <span data-l10n-id="document_properties_file_name">File name:</span> <p id="fileNameField">-</p>
331
- </div>
332
- <div class="row">
333
- <span data-l10n-id="document_properties_file_size">File size:</span> <p id="fileSizeField">-</p>
334
- </div>
335
- <div class="separator"></div>
336
- <div class="row">
337
- <span data-l10n-id="document_properties_title">Title:</span> <p id="titleField">-</p>
338
- </div>
339
- <div class="row">
340
- <span data-l10n-id="document_properties_author">Author:</span> <p id="authorField">-</p>
341
- </div>
342
- <div class="row">
343
- <span data-l10n-id="document_properties_subject">Subject:</span> <p id="subjectField">-</p>
344
- </div>
345
- <div class="row">
346
- <span data-l10n-id="document_properties_keywords">Keywords:</span> <p id="keywordsField">-</p>
347
- </div>
348
- <div class="row">
349
- <span data-l10n-id="document_properties_creation_date">Creation Date:</span> <p id="creationDateField">-</p>
350
- </div>
351
- <div class="row">
352
- <span data-l10n-id="document_properties_modification_date">Modification Date:</span> <p id="modificationDateField">-</p>
353
- </div>
354
- <div class="row">
355
- <span data-l10n-id="document_properties_creator">Creator:</span> <p id="creatorField">-</p>
356
- </div>
357
- <div class="separator"></div>
358
- <div class="row">
359
- <span data-l10n-id="document_properties_producer">PDF Producer:</span> <p id="producerField">-</p>
360
- </div>
361
- <div class="row">
362
- <span data-l10n-id="document_properties_version">PDF Version:</span> <p id="versionField">-</p>
363
- </div>
364
- <div class="row">
365
- <span data-l10n-id="document_properties_page_count">Page Count:</span> <p id="pageCountField">-</p>
366
- </div>
367
- <div class="row">
368
- <span data-l10n-id="document_properties_page_size">Page Size:</span> <p id="pageSizeField">-</p>
369
- </div>
370
- <div class="separator"></div>
371
- <div class="row">
372
- <span data-l10n-id="document_properties_linearized">Fast Web View:</span> <p id="linearizedField">-</p>
373
- </div>
374
- <div class="buttonRow">
375
- <button id="documentPropertiesClose" class="overlayButton"><span data-l10n-id="document_properties_close">Close</span></button>
376
- </div>
377
- </div>
378
- </div>
379
- <div id="printServiceOverlay" class="container hidden">
380
- <div class="dialog">
381
- <div class="row">
382
- <span data-l10n-id="print_progress_message">Preparing document for printing…</span>
383
- </div>
384
- <div class="row">
385
- <progress value="0" max="100"></progress>
386
- <span data-l10n-id="print_progress_percent" data-l10n-args='{ "progress": 0 }' class="relative-progress">0%</span>
387
- </div>
388
- <div class="buttonRow">
389
- <button id="printCancel" class="overlayButton"><span data-l10n-id="print_progress_close">Cancel</span></button>
390
- </div>
391
- </div>
392
- </div>
393
- </div> <!-- overlayContainer -->
394
-
395
- </div> <!-- outerContainer -->
396
- <div id="printContainer"></div>
397
- </body>
398
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/vendor/pdfjs/mozila/web/viewer.js DELETED
@@ -1,15406 +0,0 @@
1
- /**
2
- * @licstart The following is the entire license notice for the
3
- * Javascript code in this page
4
- *
5
- * Copyright 2021 Mozilla Foundation
6
- *
7
- * Licensed under the Apache License, Version 2.0 (the "License");
8
- * you may not use this file except in compliance with the License.
9
- * You may obtain a copy of the License at
10
- *
11
- * http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing, software
14
- * distributed under the License is distributed on an "AS IS" BASIS,
15
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- * See the License for the specific language governing permissions and
17
- * limitations under the License.
18
- *
19
- * @licend The above is the entire license notice for the
20
- * Javascript code in this page
21
- */
22
-
23
- /******/ (() => { // webpackBootstrap
24
- /******/ "use strict";
25
- /******/ var __webpack_modules__ = ([
26
- /* 0 */,
27
- /* 1 */
28
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
29
-
30
-
31
-
32
- Object.defineProperty(exports, "__esModule", ({
33
- value: true
34
- }));
35
- exports.OptionKind = exports.AppOptions = void 0;
36
-
37
- var _viewer_compatibility = __webpack_require__(2);
38
-
39
- const OptionKind = {
40
- VIEWER: 0x02,
41
- API: 0x04,
42
- WORKER: 0x08,
43
- PREFERENCE: 0x80
44
- };
45
- exports.OptionKind = OptionKind;
46
- const defaultOptions = {
47
- cursorToolOnLoad: {
48
- value: 0,
49
- kind: OptionKind.VIEWER + OptionKind.PREFERENCE
50
- },
51
- defaultUrl: {
52
- value: "compressed.tracemonkey-pldi-09.pdf",
53
- kind: OptionKind.VIEWER
54
- },
55
- defaultZoomValue: {
56
- value: "",
57
- kind: OptionKind.VIEWER + OptionKind.PREFERENCE
58
- },
59
- disableHistory: {
60
- value: false,
61
- kind: OptionKind.VIEWER
62
- },
63
- disablePageLabels: {
64
- value: false,
65
- kind: OptionKind.VIEWER + OptionKind.PREFERENCE
66
- },
67
- enablePermissions: {
68
- value: false,
69
- kind: OptionKind.VIEWER + OptionKind.PREFERENCE
70
- },
71
- enablePrintAutoRotate: {
72
- value: true,
73
- kind: OptionKind.VIEWER + OptionKind.PREFERENCE
74
- },
75
- enableScripting: {
76
- value: true,
77
- kind: OptionKind.VIEWER + OptionKind.PREFERENCE
78
- },
79
- externalLinkRel: {
80
- value: "noopener noreferrer nofollow",
81
- kind: OptionKind.VIEWER
82
- },
83
- externalLinkTarget: {
84
- value: 0,
85
- kind: OptionKind.VIEWER + OptionKind.PREFERENCE
86
- },
87
- historyUpdateUrl: {
88
- value: false,
89
- kind: OptionKind.VIEWER + OptionKind.PREFERENCE
90
- },
91
- ignoreDestinationZoom: {
92
- value: false,
93
- kind: OptionKind.VIEWER + OptionKind.PREFERENCE
94
- },
95
- imageResourcesPath: {
96
- value: "./images/",
97
- kind: OptionKind.VIEWER
98
- },
99
- maxCanvasPixels: {
100
- value: 16777216,
101
- compatibility: _viewer_compatibility.viewerCompatibilityParams.maxCanvasPixels,
102
- kind: OptionKind.VIEWER
103
- },
104
- pdfBugEnabled: {
105
- value: false,
106
- kind: OptionKind.VIEWER + OptionKind.PREFERENCE
107
- },
108
- printResolution: {
109
- value: 150,
110
- kind: OptionKind.VIEWER
111
- },
112
- renderer: {
113
- value: "canvas",
114
- kind: OptionKind.VIEWER
115
- },
116
- renderInteractiveForms: {
117
- value: true,
118
- kind: OptionKind.VIEWER + OptionKind.PREFERENCE
119
- },
120
- sidebarViewOnLoad: {
121
- value: -1,
122
- kind: OptionKind.VIEWER + OptionKind.PREFERENCE
123
- },
124
- scrollModeOnLoad: {
125
- value: -1,
126
- kind: OptionKind.VIEWER + OptionKind.PREFERENCE
127
- },
128
- spreadModeOnLoad: {
129
- value: -1,
130
- kind: OptionKind.VIEWER + OptionKind.PREFERENCE
131
- },
132
- textLayerMode: {
133
- value: 1,
134
- kind: OptionKind.VIEWER + OptionKind.PREFERENCE
135
- },
136
- useOnlyCssZoom: {
137
- value: false,
138
- kind: OptionKind.VIEWER + OptionKind.PREFERENCE
139
- },
140
- viewerCssTheme: {
141
- value: 0,
142
- kind: OptionKind.VIEWER + OptionKind.PREFERENCE
143
- },
144
- viewOnLoad: {
145
- value: 0,
146
- kind: OptionKind.VIEWER + OptionKind.PREFERENCE
147
- },
148
- cMapPacked: {
149
- value: true,
150
- kind: OptionKind.API
151
- },
152
- cMapUrl: {
153
- value: "../web/cmaps/",
154
- kind: OptionKind.API
155
- },
156
- disableAutoFetch: {
157
- value: false,
158
- kind: OptionKind.API + OptionKind.PREFERENCE
159
- },
160
- disableFontFace: {
161
- value: false,
162
- kind: OptionKind.API + OptionKind.PREFERENCE
163
- },
164
- disableRange: {
165
- value: false,
166
- kind: OptionKind.API + OptionKind.PREFERENCE
167
- },
168
- disableStream: {
169
- value: false,
170
- kind: OptionKind.API + OptionKind.PREFERENCE
171
- },
172
- docBaseUrl: {
173
- value: "",
174
- kind: OptionKind.API
175
- },
176
- enableXfa: {
177
- value: false,
178
- kind: OptionKind.API + OptionKind.PREFERENCE
179
- },
180
- fontExtraProperties: {
181
- value: false,
182
- kind: OptionKind.API
183
- },
184
- isEvalSupported: {
185
- value: true,
186
- kind: OptionKind.API
187
- },
188
- maxImageSize: {
189
- value: -1,
190
- kind: OptionKind.API
191
- },
192
- pdfBug: {
193
- value: false,
194
- kind: OptionKind.API
195
- },
196
- standardFontDataUrl: {
197
- value: "../web/standard_fonts/",
198
- kind: OptionKind.API
199
- },
200
- verbosity: {
201
- value: 1,
202
- kind: OptionKind.API
203
- },
204
- workerPort: {
205
- value: null,
206
- kind: OptionKind.WORKER
207
- },
208
- workerSrc: {
209
- value: "../build/pdf.worker.js",
210
- kind: OptionKind.WORKER
211
- }
212
- };
213
- {
214
- defaultOptions.disablePreferences = {
215
- value: false,
216
- kind: OptionKind.VIEWER
217
- };
218
- defaultOptions.locale = {
219
- value: typeof navigator !== "undefined" ? navigator.language : "en-US",
220
- kind: OptionKind.VIEWER
221
- };
222
- defaultOptions.sandboxBundleSrc = {
223
- value: "../build/pdf.sandbox.js",
224
- kind: OptionKind.VIEWER
225
- };
226
- defaultOptions.renderer.kind += OptionKind.PREFERENCE;
227
- }
228
- const userOptions = Object.create(null);
229
-
230
- class AppOptions {
231
- constructor() {
232
- throw new Error("Cannot initialize AppOptions.");
233
- }
234
-
235
- static get(name) {
236
- const userOption = userOptions[name];
237
-
238
- if (userOption !== undefined) {
239
- return userOption;
240
- }
241
-
242
- const defaultOption = defaultOptions[name];
243
-
244
- if (defaultOption !== undefined) {
245
- return defaultOption.compatibility ?? defaultOption.value;
246
- }
247
-
248
- return undefined;
249
- }
250
-
251
- static getAll(kind = null) {
252
- const options = Object.create(null);
253
-
254
- for (const name in defaultOptions) {
255
- const defaultOption = defaultOptions[name];
256
-
257
- if (kind) {
258
- if ((kind & defaultOption.kind) === 0) {
259
- continue;
260
- }
261
-
262
- if (kind === OptionKind.PREFERENCE) {
263
- const value = defaultOption.value,
264
- valueType = typeof value;
265
-
266
- if (valueType === "boolean" || valueType === "string" || valueType === "number" && Number.isInteger(value)) {
267
- options[name] = value;
268
- continue;
269
- }
270
-
271
- throw new Error(`Invalid type for preference: ${name}`);
272
- }
273
- }
274
-
275
- const userOption = userOptions[name];
276
- options[name] = userOption !== undefined ? userOption : defaultOption.compatibility ?? defaultOption.value;
277
- }
278
-
279
- return options;
280
- }
281
-
282
- static set(name, value) {
283
- userOptions[name] = value;
284
- }
285
-
286
- static setAll(options) {
287
- for (const name in options) {
288
- userOptions[name] = options[name];
289
- }
290
- }
291
-
292
- static remove(name) {
293
- delete userOptions[name];
294
- }
295
-
296
- }
297
-
298
- exports.AppOptions = AppOptions;
299
-
300
- /***/ }),
301
- /* 2 */
302
- /***/ ((__unused_webpack_module, exports) => {
303
-
304
-
305
-
306
- Object.defineProperty(exports, "__esModule", ({
307
- value: true
308
- }));
309
- exports.viewerCompatibilityParams = void 0;
310
- const compatibilityParams = Object.create(null);
311
- {
312
- const userAgent = typeof navigator !== "undefined" && navigator.userAgent || "";
313
- const platform = typeof navigator !== "undefined" && navigator.platform || "";
314
- const maxTouchPoints = typeof navigator !== "undefined" && navigator.maxTouchPoints || 1;
315
- const isAndroid = /Android/.test(userAgent);
316
- const isIOS = /\b(iPad|iPhone|iPod)(?=;)/.test(userAgent) || platform === "MacIntel" && maxTouchPoints > 1;
317
- const isIOSChrome = /CriOS/.test(userAgent);
318
-
319
- (function checkOnBlobSupport() {
320
- if (isIOSChrome) {
321
- compatibilityParams.disableCreateObjectURL = true;
322
- }
323
- })();
324
-
325
- (function checkCanvasSizeLimitation() {
326
- if (isIOS || isAndroid) {
327
- compatibilityParams.maxCanvasPixels = 5242880;
328
- }
329
- })();
330
- }
331
- const viewerCompatibilityParams = Object.freeze(compatibilityParams);
332
- exports.viewerCompatibilityParams = viewerCompatibilityParams;
333
-
334
- /***/ }),
335
- /* 3 */
336
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
337
-
338
-
339
-
340
- Object.defineProperty(exports, "__esModule", ({
341
- value: true
342
- }));
343
- exports.PDFViewerApplication = exports.PDFPrintServiceFactory = exports.DefaultExternalServices = void 0;
344
-
345
- var _ui_utils = __webpack_require__(4);
346
-
347
- var _app_options = __webpack_require__(1);
348
-
349
- var _pdfjsLib = __webpack_require__(5);
350
-
351
- var _pdf_cursor_tools = __webpack_require__(6);
352
-
353
- var _pdf_rendering_queue = __webpack_require__(8);
354
-
355
- var _overlay_manager = __webpack_require__(9);
356
-
357
- var _password_prompt = __webpack_require__(10);
358
-
359
- var _pdf_attachment_viewer = __webpack_require__(11);
360
-
361
- var _pdf_document_properties = __webpack_require__(13);
362
-
363
- var _pdf_find_bar = __webpack_require__(14);
364
-
365
- var _pdf_find_controller = __webpack_require__(15);
366
-
367
- var _pdf_history = __webpack_require__(17);
368
-
369
- var _pdf_layer_viewer = __webpack_require__(18);
370
-
371
- var _pdf_link_service = __webpack_require__(19);
372
-
373
- var _pdf_outline_viewer = __webpack_require__(20);
374
-
375
- var _pdf_presentation_mode = __webpack_require__(21);
376
-
377
- var _pdf_scripting_manager = __webpack_require__(22);
378
-
379
- var _pdf_sidebar = __webpack_require__(23);
380
-
381
- var _pdf_sidebar_resizer = __webpack_require__(24);
382
-
383
- var _pdf_thumbnail_viewer = __webpack_require__(25);
384
-
385
- var _pdf_viewer = __webpack_require__(27);
386
-
387
- var _secondary_toolbar = __webpack_require__(35);
388
-
389
- var _toolbar = __webpack_require__(37);
390
-
391
- var _viewer_compatibility = __webpack_require__(2);
392
-
393
- var _view_history = __webpack_require__(38);
394
-
395
- const DEFAULT_SCALE_DELTA = 1.1;
396
- const DISABLE_AUTO_FETCH_LOADING_BAR_TIMEOUT = 5000;
397
- const FORCE_PAGES_LOADED_TIMEOUT = 10000;
398
- const WHEEL_ZOOM_DISABLED_TIMEOUT = 1000;
399
- const ENABLE_PERMISSIONS_CLASS = "enablePermissions";
400
- const ViewOnLoad = {
401
- UNKNOWN: -1,
402
- PREVIOUS: 0,
403
- INITIAL: 1
404
- };
405
- const ViewerCssTheme = {
406
- AUTOMATIC: 0,
407
- LIGHT: 1,
408
- DARK: 2
409
- };
410
- const KNOWN_VERSIONS = ["1.0", "1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "1.9", "2.0", "2.1", "2.2", "2.3"];
411
- const KNOWN_GENERATORS = ["acrobat distiller", "acrobat pdfwriter", "adobe livecycle", "adobe pdf library", "adobe photoshop", "ghostscript", "tcpdf", "cairo", "dvipdfm", "dvips", "pdftex", "pdfkit", "itext", "prince", "quarkxpress", "mac os x", "microsoft", "openoffice", "oracle", "luradocument", "pdf-xchange", "antenna house", "aspose.cells", "fpdf"];
412
-
413
- class DefaultExternalServices {
414
- constructor() {
415
- throw new Error("Cannot initialize DefaultExternalServices.");
416
- }
417
-
418
- static updateFindControlState(data) {}
419
-
420
- static updateFindMatchesCount(data) {}
421
-
422
- static initPassiveLoading(callbacks) {}
423
-
424
- static async fallback(data) {}
425
-
426
- static reportTelemetry(data) {}
427
-
428
- static createDownloadManager(options) {
429
- throw new Error("Not implemented: createDownloadManager");
430
- }
431
-
432
- static createPreferences() {
433
- throw new Error("Not implemented: createPreferences");
434
- }
435
-
436
- static createL10n(options) {
437
- throw new Error("Not implemented: createL10n");
438
- }
439
-
440
- static createScripting(options) {
441
- throw new Error("Not implemented: createScripting");
442
- }
443
-
444
- static get supportsIntegratedFind() {
445
- return (0, _pdfjsLib.shadow)(this, "supportsIntegratedFind", false);
446
- }
447
-
448
- static get supportsDocumentFonts() {
449
- return (0, _pdfjsLib.shadow)(this, "supportsDocumentFonts", true);
450
- }
451
-
452
- static get supportedMouseWheelZoomModifierKeys() {
453
- return (0, _pdfjsLib.shadow)(this, "supportedMouseWheelZoomModifierKeys", {
454
- ctrlKey: true,
455
- metaKey: true
456
- });
457
- }
458
-
459
- static get isInAutomation() {
460
- return (0, _pdfjsLib.shadow)(this, "isInAutomation", false);
461
- }
462
-
463
- }
464
-
465
- exports.DefaultExternalServices = DefaultExternalServices;
466
- const PDFViewerApplication = {
467
- initialBookmark: document.location.hash.substring(1),
468
- _initializedCapability: (0, _pdfjsLib.createPromiseCapability)(),
469
- _fellback: false,
470
- appConfig: null,
471
- pdfDocument: null,
472
- pdfLoadingTask: null,
473
- printService: null,
474
- pdfViewer: null,
475
- pdfThumbnailViewer: null,
476
- pdfRenderingQueue: null,
477
- pdfPresentationMode: null,
478
- pdfDocumentProperties: null,
479
- pdfLinkService: null,
480
- pdfHistory: null,
481
- pdfSidebar: null,
482
- pdfSidebarResizer: null,
483
- pdfOutlineViewer: null,
484
- pdfAttachmentViewer: null,
485
- pdfLayerViewer: null,
486
- pdfCursorTools: null,
487
- pdfScriptingManager: null,
488
- store: null,
489
- downloadManager: null,
490
- overlayManager: null,
491
- preferences: null,
492
- toolbar: null,
493
- secondaryToolbar: null,
494
- eventBus: null,
495
- l10n: null,
496
- isInitialViewSet: false,
497
- downloadComplete: false,
498
- isViewerEmbedded: window.parent !== window,
499
- url: "",
500
- baseUrl: "",
501
- externalServices: DefaultExternalServices,
502
- _boundEvents: Object.create(null),
503
- documentInfo: null,
504
- metadata: null,
505
- _contentDispositionFilename: null,
506
- _contentLength: null,
507
- _saveInProgress: false,
508
- _wheelUnusedTicks: 0,
509
- _idleCallbacks: new Set(),
510
-
511
- async initialize(appConfig) {
512
- this.preferences = this.externalServices.createPreferences();
513
- this.appConfig = appConfig;
514
- await this._readPreferences();
515
- await this._parseHashParameters();
516
-
517
- this._forceCssTheme();
518
-
519
- await this._initializeL10n();
520
-
521
- if (this.isViewerEmbedded && _app_options.AppOptions.get("externalLinkTarget") === _pdfjsLib.LinkTarget.NONE) {
522
- _app_options.AppOptions.set("externalLinkTarget", _pdfjsLib.LinkTarget.TOP);
523
- }
524
-
525
- await this._initializeViewerComponents();
526
- this.bindEvents();
527
- this.bindWindowEvents();
528
- const appContainer = appConfig.appContainer || document.documentElement;
529
- this.l10n.translate(appContainer).then(() => {
530
- this.eventBus.dispatch("localized", {
531
- source: this
532
- });
533
- });
534
-
535
- this._initializedCapability.resolve();
536
- },
537
-
538
- async _readPreferences() {
539
- if (_app_options.AppOptions.get("disablePreferences")) {
540
- return;
541
- }
542
-
543
- try {
544
- _app_options.AppOptions.setAll(await this.preferences.getAll());
545
- } catch (reason) {
546
- console.error(`_readPreferences: "${reason?.message}".`);
547
- }
548
- },
549
-
550
- async _parseHashParameters() {
551
- if (!_app_options.AppOptions.get("pdfBugEnabled")) {
552
- return undefined;
553
- }
554
-
555
- const hash = document.location.hash.substring(1);
556
-
557
- if (!hash) {
558
- return undefined;
559
- }
560
-
561
- const hashParams = (0, _ui_utils.parseQueryString)(hash),
562
- waitOn = [];
563
-
564
- if ("disableworker" in hashParams && hashParams.disableworker === "true") {
565
- waitOn.push(loadFakeWorker());
566
- }
567
-
568
- if ("disablerange" in hashParams) {
569
- _app_options.AppOptions.set("disableRange", hashParams.disablerange === "true");
570
- }
571
-
572
- if ("disablestream" in hashParams) {
573
- _app_options.AppOptions.set("disableStream", hashParams.disablestream === "true");
574
- }
575
-
576
- if ("disableautofetch" in hashParams) {
577
- _app_options.AppOptions.set("disableAutoFetch", hashParams.disableautofetch === "true");
578
- }
579
-
580
- if ("disablefontface" in hashParams) {
581
- _app_options.AppOptions.set("disableFontFace", hashParams.disablefontface === "true");
582
- }
583
-
584
- if ("disablehistory" in hashParams) {
585
- _app_options.AppOptions.set("disableHistory", hashParams.disablehistory === "true");
586
- }
587
-
588
- if ("verbosity" in hashParams) {
589
- _app_options.AppOptions.set("verbosity", hashParams.verbosity | 0);
590
- }
591
-
592
- if ("textlayer" in hashParams) {
593
- switch (hashParams.textlayer) {
594
- case "off":
595
- _app_options.AppOptions.set("textLayerMode", _ui_utils.TextLayerMode.DISABLE);
596
-
597
- break;
598
-
599
- case "visible":
600
- case "shadow":
601
- case "hover":
602
- const viewer = this.appConfig.viewerContainer;
603
- viewer.classList.add("textLayer-" + hashParams.textlayer);
604
- break;
605
- }
606
- }
607
-
608
- if ("pdfbug" in hashParams) {
609
- _app_options.AppOptions.set("pdfBug", true);
610
-
611
- _app_options.AppOptions.set("fontExtraProperties", true);
612
-
613
- const enabled = hashParams.pdfbug.split(",");
614
- waitOn.push(loadAndEnablePDFBug(enabled));
615
- }
616
-
617
- if ("locale" in hashParams) {
618
- _app_options.AppOptions.set("locale", hashParams.locale);
619
- }
620
-
621
- if (waitOn.length === 0) {
622
- return undefined;
623
- }
624
-
625
- return Promise.all(waitOn).catch(reason => {
626
- console.error(`_parseHashParameters: "${reason.message}".`);
627
- });
628
- },
629
-
630
- async _initializeL10n() {
631
- this.l10n = this.externalServices.createL10n({
632
- locale: _app_options.AppOptions.get("locale")
633
- });
634
- const dir = await this.l10n.getDirection();
635
- document.getElementsByTagName("html")[0].dir = dir;
636
- },
637
-
638
- _forceCssTheme() {
639
- const cssTheme = _app_options.AppOptions.get("viewerCssTheme");
640
-
641
- if (cssTheme === ViewerCssTheme.AUTOMATIC || !Object.values(ViewerCssTheme).includes(cssTheme)) {
642
- return;
643
- }
644
-
645
- try {
646
- const styleSheet = document.styleSheets[0];
647
- const cssRules = styleSheet?.cssRules || [];
648
- const mediaMatcher = "prefers-color-scheme";
649
- const mediaRule = `(${mediaMatcher}: dark)`;
650
- const mediaRegex = new RegExp(`^@media \\(${mediaMatcher}: dark\\) {\\n\\s*([\\w\\s-.,:;/\\\\{}()]+)\\n}$`);
651
-
652
- for (let i = 0, ii = cssRules.length; i < ii; i++) {
653
- const rule = cssRules[i];
654
-
655
- if (rule instanceof CSSMediaRule && rule.media?.[0] === mediaRule) {
656
- if (cssTheme === ViewerCssTheme.LIGHT) {
657
- styleSheet.deleteRule(i);
658
- return;
659
- }
660
-
661
- const darkRules = mediaRegex.exec(rule.cssText);
662
-
663
- if (darkRules?.[1]) {
664
- styleSheet.deleteRule(i);
665
- styleSheet.insertRule(darkRules[1], i);
666
- }
667
-
668
- return;
669
- }
670
- }
671
- } catch (reason) {
672
- console.error(`_forceCssTheme: "${reason?.message}".`);
673
- }
674
- },
675
-
676
- async _initializeViewerComponents() {
677
- const appConfig = this.appConfig;
678
- const eventBus = appConfig.eventBus || new _ui_utils.EventBus({
679
- isInAutomation: this.externalServices.isInAutomation
680
- });
681
- this.eventBus = eventBus;
682
- this.overlayManager = new _overlay_manager.OverlayManager();
683
- const pdfRenderingQueue = new _pdf_rendering_queue.PDFRenderingQueue();
684
- pdfRenderingQueue.onIdle = this._cleanup.bind(this);
685
- this.pdfRenderingQueue = pdfRenderingQueue;
686
- const pdfLinkService = new _pdf_link_service.PDFLinkService({
687
- eventBus,
688
- externalLinkTarget: _app_options.AppOptions.get("externalLinkTarget"),
689
- externalLinkRel: _app_options.AppOptions.get("externalLinkRel"),
690
- ignoreDestinationZoom: _app_options.AppOptions.get("ignoreDestinationZoom")
691
- });
692
- this.pdfLinkService = pdfLinkService;
693
- const downloadManager = this.externalServices.createDownloadManager();
694
- this.downloadManager = downloadManager;
695
- const findController = new _pdf_find_controller.PDFFindController({
696
- linkService: pdfLinkService,
697
- eventBus
698
- });
699
- this.findController = findController;
700
- const pdfScriptingManager = new _pdf_scripting_manager.PDFScriptingManager({
701
- eventBus,
702
- sandboxBundleSrc: _app_options.AppOptions.get("sandboxBundleSrc"),
703
- scriptingFactory: this.externalServices,
704
- docPropertiesLookup: this._scriptingDocProperties.bind(this)
705
- });
706
- this.pdfScriptingManager = pdfScriptingManager;
707
- const container = appConfig.mainContainer;
708
- const viewer = appConfig.viewerContainer;
709
- this.pdfViewer = new _pdf_viewer.PDFViewer({
710
- container,
711
- viewer,
712
- eventBus,
713
- renderingQueue: pdfRenderingQueue,
714
- linkService: pdfLinkService,
715
- downloadManager,
716
- findController,
717
- scriptingManager: pdfScriptingManager,
718
- renderer: _app_options.AppOptions.get("renderer"),
719
- l10n: this.l10n,
720
- textLayerMode: _app_options.AppOptions.get("textLayerMode"),
721
- imageResourcesPath: _app_options.AppOptions.get("imageResourcesPath"),
722
- renderInteractiveForms: _app_options.AppOptions.get("renderInteractiveForms"),
723
- enablePrintAutoRotate: _app_options.AppOptions.get("enablePrintAutoRotate"),
724
- useOnlyCssZoom: _app_options.AppOptions.get("useOnlyCssZoom"),
725
- maxCanvasPixels: _app_options.AppOptions.get("maxCanvasPixels"),
726
- enableScripting: _app_options.AppOptions.get("enableScripting")
727
- });
728
- pdfRenderingQueue.setViewer(this.pdfViewer);
729
- pdfLinkService.setViewer(this.pdfViewer);
730
- pdfScriptingManager.setViewer(this.pdfViewer);
731
- this.pdfThumbnailViewer = new _pdf_thumbnail_viewer.PDFThumbnailViewer({
732
- container: appConfig.sidebar.thumbnailView,
733
- eventBus,
734
- renderingQueue: pdfRenderingQueue,
735
- linkService: pdfLinkService,
736
- l10n: this.l10n
737
- });
738
- pdfRenderingQueue.setThumbnailViewer(this.pdfThumbnailViewer);
739
- this.pdfHistory = new _pdf_history.PDFHistory({
740
- linkService: pdfLinkService,
741
- eventBus
742
- });
743
- pdfLinkService.setHistory(this.pdfHistory);
744
-
745
- if (!this.supportsIntegratedFind) {
746
- this.findBar = new _pdf_find_bar.PDFFindBar(appConfig.findBar, eventBus, this.l10n);
747
- }
748
-
749
- this.pdfDocumentProperties = new _pdf_document_properties.PDFDocumentProperties(appConfig.documentProperties, this.overlayManager, eventBus, this.l10n);
750
- this.pdfCursorTools = new _pdf_cursor_tools.PDFCursorTools({
751
- container,
752
- eventBus,
753
- cursorToolOnLoad: _app_options.AppOptions.get("cursorToolOnLoad")
754
- });
755
- this.toolbar = new _toolbar.Toolbar(appConfig.toolbar, eventBus, this.l10n);
756
- this.secondaryToolbar = new _secondary_toolbar.SecondaryToolbar(appConfig.secondaryToolbar, container, eventBus);
757
-
758
- if (this.supportsFullscreen) {
759
- this.pdfPresentationMode = new _pdf_presentation_mode.PDFPresentationMode({
760
- container,
761
- pdfViewer: this.pdfViewer,
762
- eventBus
763
- });
764
- }
765
-
766
- this.passwordPrompt = new _password_prompt.PasswordPrompt(appConfig.passwordOverlay, this.overlayManager, this.l10n, this.isViewerEmbedded);
767
- this.pdfOutlineViewer = new _pdf_outline_viewer.PDFOutlineViewer({
768
- container: appConfig.sidebar.outlineView,
769
- eventBus,
770
- linkService: pdfLinkService
771
- });
772
- this.pdfAttachmentViewer = new _pdf_attachment_viewer.PDFAttachmentViewer({
773
- container: appConfig.sidebar.attachmentsView,
774
- eventBus,
775
- downloadManager
776
- });
777
- this.pdfLayerViewer = new _pdf_layer_viewer.PDFLayerViewer({
778
- container: appConfig.sidebar.layersView,
779
- eventBus,
780
- l10n: this.l10n
781
- });
782
- this.pdfSidebar = new _pdf_sidebar.PDFSidebar({
783
- elements: appConfig.sidebar,
784
- pdfViewer: this.pdfViewer,
785
- pdfThumbnailViewer: this.pdfThumbnailViewer,
786
- eventBus,
787
- l10n: this.l10n
788
- });
789
- this.pdfSidebar.onToggled = this.forceRendering.bind(this);
790
- this.pdfSidebarResizer = new _pdf_sidebar_resizer.PDFSidebarResizer(appConfig.sidebarResizer, eventBus, this.l10n);
791
- },
792
-
793
- run(config) {
794
- this.initialize(config).then(webViewerInitialized);
795
- },
796
-
797
- get initialized() {
798
- return this._initializedCapability.settled;
799
- },
800
-
801
- get initializedPromise() {
802
- return this._initializedCapability.promise;
803
- },
804
-
805
- zoomIn(ticks) {
806
- if (this.pdfViewer.isInPresentationMode) {
807
- return;
808
- }
809
-
810
- let newScale = this.pdfViewer.currentScale;
811
-
812
- do {
813
- newScale = (newScale * DEFAULT_SCALE_DELTA).toFixed(2);
814
- newScale = Math.ceil(newScale * 10) / 10;
815
- newScale = Math.min(_ui_utils.MAX_SCALE, newScale);
816
- } while (--ticks > 0 && newScale < _ui_utils.MAX_SCALE);
817
-
818
- this.pdfViewer.currentScaleValue = newScale;
819
- },
820
-
821
- zoomOut(ticks) {
822
- if (this.pdfViewer.isInPresentationMode) {
823
- return;
824
- }
825
-
826
- let newScale = this.pdfViewer.currentScale;
827
-
828
- do {
829
- newScale = (newScale / DEFAULT_SCALE_DELTA).toFixed(2);
830
- newScale = Math.floor(newScale * 10) / 10;
831
- newScale = Math.max(_ui_utils.MIN_SCALE, newScale);
832
- } while (--ticks > 0 && newScale > _ui_utils.MIN_SCALE);
833
-
834
- this.pdfViewer.currentScaleValue = newScale;
835
- },
836
-
837
- zoomReset() {
838
- if (this.pdfViewer.isInPresentationMode) {
839
- return;
840
- }
841
-
842
- this.pdfViewer.currentScaleValue = _ui_utils.DEFAULT_SCALE_VALUE;
843
- },
844
-
845
- get pagesCount() {
846
- return this.pdfDocument ? this.pdfDocument.numPages : 0;
847
- },
848
-
849
- get page() {
850
- return this.pdfViewer.currentPageNumber;
851
- },
852
-
853
- set page(val) {
854
- this.pdfViewer.currentPageNumber = val;
855
- },
856
-
857
- get supportsPrinting() {
858
- return PDFPrintServiceFactory.instance.supportsPrinting;
859
- },
860
-
861
- get supportsFullscreen() {
862
- const doc = document.documentElement;
863
- let support = !!(doc.requestFullscreen || doc.mozRequestFullScreen || doc.webkitRequestFullScreen);
864
-
865
- if (document.fullscreenEnabled === false || document.mozFullScreenEnabled === false || document.webkitFullscreenEnabled === false) {
866
- support = false;
867
- }
868
-
869
- return (0, _pdfjsLib.shadow)(this, "supportsFullscreen", support);
870
- },
871
-
872
- get supportsIntegratedFind() {
873
- return this.externalServices.supportsIntegratedFind;
874
- },
875
-
876
- get supportsDocumentFonts() {
877
- return this.externalServices.supportsDocumentFonts;
878
- },
879
-
880
- get loadingBar() {
881
- const bar = new _ui_utils.ProgressBar("#loadingBar");
882
- return (0, _pdfjsLib.shadow)(this, "loadingBar", bar);
883
- },
884
-
885
- get supportedMouseWheelZoomModifierKeys() {
886
- return this.externalServices.supportedMouseWheelZoomModifierKeys;
887
- },
888
-
889
- initPassiveLoading() {
890
- throw new Error("Not implemented: initPassiveLoading");
891
- },
892
-
893
- setTitleUsingUrl(url = "") {
894
- this.url = url;
895
- this.baseUrl = url.split("#")[0];
896
- let title = (0, _pdfjsLib.getPdfFilenameFromUrl)(url, "");
897
-
898
- if (!title) {
899
- try {
900
- title = decodeURIComponent((0, _pdfjsLib.getFilenameFromUrl)(url)) || url;
901
- } catch (ex) {
902
- title = url;
903
- }
904
- }
905
-
906
- this.setTitle(title);
907
- },
908
-
909
- setTitle(title) {
910
- if (this.isViewerEmbedded) {
911
- return;
912
- }
913
-
914
- document.title = title;
915
- },
916
-
917
- get _docFilename() {
918
- return this._contentDispositionFilename || (0, _pdfjsLib.getPdfFilenameFromUrl)(this.url);
919
- },
920
-
921
- _cancelIdleCallbacks() {
922
- if (!this._idleCallbacks.size) {
923
- return;
924
- }
925
-
926
- for (const callback of this._idleCallbacks) {
927
- window.cancelIdleCallback(callback);
928
- }
929
-
930
- this._idleCallbacks.clear();
931
- },
932
-
933
- async close() {
934
- this._unblockDocumentLoadEvent();
935
-
936
- const {
937
- container
938
- } = this.appConfig.errorWrapper;
939
- container.hidden = true;
940
-
941
- if (!this.pdfLoadingTask) {
942
- return;
943
- }
944
-
945
- if (this.pdfDocument?.annotationStorage.size > 0 && this._annotationStorageModified) {
946
- try {
947
- await this.save({
948
- sourceEventType: "save"
949
- });
950
- } catch (reason) {}
951
- }
952
-
953
- const promises = [];
954
- promises.push(this.pdfLoadingTask.destroy());
955
- this.pdfLoadingTask = null;
956
-
957
- if (this.pdfDocument) {
958
- this.pdfDocument = null;
959
- this.pdfThumbnailViewer.setDocument(null);
960
- this.pdfViewer.setDocument(null);
961
- this.pdfLinkService.setDocument(null);
962
- this.pdfDocumentProperties.setDocument(null);
963
- }
964
-
965
- webViewerResetPermissions();
966
- this.pdfLinkService.externalLinkEnabled = true;
967
- this._fellback = false;
968
- this.store = null;
969
- this.isInitialViewSet = false;
970
- this.downloadComplete = false;
971
- this.url = "";
972
- this.baseUrl = "";
973
- this.documentInfo = null;
974
- this.metadata = null;
975
- this._contentDispositionFilename = null;
976
- this._contentLength = null;
977
- this._saveInProgress = false;
978
-
979
- this._cancelIdleCallbacks();
980
-
981
- promises.push(this.pdfScriptingManager.destroyPromise);
982
- this.pdfSidebar.reset();
983
- this.pdfOutlineViewer.reset();
984
- this.pdfAttachmentViewer.reset();
985
- this.pdfLayerViewer.reset();
986
-
987
- if (this.pdfHistory) {
988
- this.pdfHistory.reset();
989
- }
990
-
991
- if (this.findBar) {
992
- this.findBar.reset();
993
- }
994
-
995
- this.toolbar.reset();
996
- this.secondaryToolbar.reset();
997
-
998
- if (typeof PDFBug !== "undefined") {
999
- PDFBug.cleanup();
1000
- }
1001
-
1002
- await Promise.all(promises);
1003
- },
1004
-
1005
- async open(file, args) {
1006
- if (this.pdfLoadingTask) {
1007
- await this.close();
1008
- }
1009
-
1010
- const workerParameters = _app_options.AppOptions.getAll(_app_options.OptionKind.WORKER);
1011
-
1012
- for (const key in workerParameters) {
1013
- _pdfjsLib.GlobalWorkerOptions[key] = workerParameters[key];
1014
- }
1015
-
1016
- const parameters = Object.create(null);
1017
-
1018
- if (typeof file === "string") {
1019
- this.setTitleUsingUrl(file);
1020
- parameters.url = file;
1021
- } else if (file && "byteLength" in file) {
1022
- parameters.data = file;
1023
- } else if (file.url && file.originalUrl) {
1024
- this.setTitleUsingUrl(file.originalUrl);
1025
- parameters.url = file.url;
1026
- }
1027
-
1028
- const apiParameters = _app_options.AppOptions.getAll(_app_options.OptionKind.API);
1029
-
1030
- for (const key in apiParameters) {
1031
- let value = apiParameters[key];
1032
-
1033
- if (key === "docBaseUrl" && !value) {}
1034
-
1035
- parameters[key] = value;
1036
- }
1037
-
1038
- if (args) {
1039
- for (const key in args) {
1040
- parameters[key] = args[key];
1041
- }
1042
- }
1043
-
1044
- const loadingTask = (0, _pdfjsLib.getDocument)(parameters);
1045
- this.pdfLoadingTask = loadingTask;
1046
-
1047
- loadingTask.onPassword = (updateCallback, reason) => {
1048
- this.pdfLinkService.externalLinkEnabled = false;
1049
- this.passwordPrompt.setUpdateCallback(updateCallback, reason);
1050
- this.passwordPrompt.open();
1051
- };
1052
-
1053
- loadingTask.onProgress = ({
1054
- loaded,
1055
- total
1056
- }) => {
1057
- this.progress(loaded / total);
1058
- };
1059
-
1060
- loadingTask.onUnsupportedFeature = this.fallback.bind(this);
1061
- return loadingTask.promise.then(pdfDocument => {
1062
- this.load(pdfDocument);
1063
- }, exception => {
1064
- if (loadingTask !== this.pdfLoadingTask) {
1065
- return undefined;
1066
- }
1067
-
1068
- let key = "loading_error";
1069
-
1070
- if (exception instanceof _pdfjsLib.InvalidPDFException) {
1071
- key = "invalid_file_error";
1072
- } else if (exception instanceof _pdfjsLib.MissingPDFException) {
1073
- key = "missing_file_error";
1074
- } else if (exception instanceof _pdfjsLib.UnexpectedResponseException) {
1075
- key = "unexpected_response_error";
1076
- }
1077
-
1078
- return this.l10n.get(key).then(msg => {
1079
- this._documentError(msg, {
1080
- message: exception?.message
1081
- });
1082
-
1083
- throw exception;
1084
- });
1085
- });
1086
- },
1087
-
1088
- _ensureDownloadComplete() {
1089
- if (this.pdfDocument && this.downloadComplete) {
1090
- return;
1091
- }
1092
-
1093
- throw new Error("PDF document not downloaded.");
1094
- },
1095
-
1096
- async download({
1097
- sourceEventType = "download"
1098
- } = {}) {
1099
- const url = this.baseUrl,
1100
- filename = this._docFilename;
1101
-
1102
- try {
1103
- this._ensureDownloadComplete();
1104
-
1105
- const data = await this.pdfDocument.getData();
1106
- const blob = new Blob([data], {
1107
- type: "application/pdf"
1108
- });
1109
- await this.downloadManager.download(blob, url, filename, sourceEventType);
1110
- } catch (reason) {
1111
- await this.downloadManager.downloadUrl(url, filename);
1112
- }
1113
- },
1114
-
1115
- async save({
1116
- sourceEventType = "download"
1117
- } = {}) {
1118
- if (this._saveInProgress) {
1119
- return;
1120
- }
1121
-
1122
- this._saveInProgress = true;
1123
- await this.pdfScriptingManager.dispatchWillSave();
1124
- const url = this.baseUrl,
1125
- filename = this._docFilename;
1126
-
1127
- try {
1128
- this._ensureDownloadComplete();
1129
-
1130
- const data = await this.pdfDocument.saveDocument();
1131
- const blob = new Blob([data], {
1132
- type: "application/pdf"
1133
- });
1134
- await this.downloadManager.download(blob, url, filename, sourceEventType);
1135
- } catch (reason) {
1136
- await this.download({
1137
- sourceEventType
1138
- });
1139
- } finally {
1140
- await this.pdfScriptingManager.dispatchDidSave();
1141
- this._saveInProgress = false;
1142
- }
1143
- },
1144
-
1145
- downloadOrSave(options) {
1146
- if (this.pdfDocument?.annotationStorage.size > 0) {
1147
- this.save(options);
1148
- } else {
1149
- this.download(options);
1150
- }
1151
- },
1152
-
1153
- fallback(featureId) {
1154
- this.externalServices.reportTelemetry({
1155
- type: "unsupportedFeature",
1156
- featureId
1157
- });
1158
-
1159
- if (this._fellback) {
1160
- return;
1161
- }
1162
-
1163
- this._fellback = true;
1164
- this.externalServices.fallback({
1165
- featureId,
1166
- url: this.baseUrl
1167
- }).then(download => {
1168
- if (!download) {
1169
- return;
1170
- }
1171
-
1172
- this.download({
1173
- sourceEventType: "download"
1174
- });
1175
- });
1176
- },
1177
-
1178
- _documentError(message, moreInfo = null) {
1179
- this._unblockDocumentLoadEvent();
1180
-
1181
- this._otherError(message, moreInfo);
1182
- },
1183
-
1184
- _otherError(message, moreInfo = null) {
1185
- const moreInfoText = [this.l10n.get("error_version_info", {
1186
- version: _pdfjsLib.version || "?",
1187
- build: _pdfjsLib.build || "?"
1188
- })];
1189
-
1190
- if (moreInfo) {
1191
- moreInfoText.push(this.l10n.get("error_message", {
1192
- message: moreInfo.message
1193
- }));
1194
-
1195
- if (moreInfo.stack) {
1196
- moreInfoText.push(this.l10n.get("error_stack", {
1197
- stack: moreInfo.stack
1198
- }));
1199
- } else {
1200
- if (moreInfo.filename) {
1201
- moreInfoText.push(this.l10n.get("error_file", {
1202
- file: moreInfo.filename
1203
- }));
1204
- }
1205
-
1206
- if (moreInfo.lineNumber) {
1207
- moreInfoText.push(this.l10n.get("error_line", {
1208
- line: moreInfo.lineNumber
1209
- }));
1210
- }
1211
- }
1212
- }
1213
-
1214
- const errorWrapperConfig = this.appConfig.errorWrapper;
1215
- const errorWrapper = errorWrapperConfig.container;
1216
- errorWrapper.hidden = false;
1217
- const errorMessage = errorWrapperConfig.errorMessage;
1218
- errorMessage.textContent = message;
1219
- const closeButton = errorWrapperConfig.closeButton;
1220
-
1221
- closeButton.onclick = function () {
1222
- errorWrapper.hidden = true;
1223
- };
1224
-
1225
- const errorMoreInfo = errorWrapperConfig.errorMoreInfo;
1226
- const moreInfoButton = errorWrapperConfig.moreInfoButton;
1227
- const lessInfoButton = errorWrapperConfig.lessInfoButton;
1228
-
1229
- moreInfoButton.onclick = function () {
1230
- errorMoreInfo.hidden = false;
1231
- moreInfoButton.hidden = true;
1232
- lessInfoButton.hidden = false;
1233
- errorMoreInfo.style.height = errorMoreInfo.scrollHeight + "px";
1234
- };
1235
-
1236
- lessInfoButton.onclick = function () {
1237
- errorMoreInfo.hidden = true;
1238
- moreInfoButton.hidden = false;
1239
- lessInfoButton.hidden = true;
1240
- };
1241
-
1242
- moreInfoButton.oncontextmenu = _ui_utils.noContextMenuHandler;
1243
- lessInfoButton.oncontextmenu = _ui_utils.noContextMenuHandler;
1244
- closeButton.oncontextmenu = _ui_utils.noContextMenuHandler;
1245
- moreInfoButton.hidden = false;
1246
- lessInfoButton.hidden = true;
1247
- Promise.all(moreInfoText).then(parts => {
1248
- errorMoreInfo.value = parts.join("\n");
1249
- });
1250
- },
1251
-
1252
- progress(level) {
1253
- if (this.downloadComplete) {
1254
- return;
1255
- }
1256
-
1257
- const percent = Math.round(level * 100);
1258
-
1259
- if (percent > this.loadingBar.percent || isNaN(percent)) {
1260
- this.loadingBar.percent = percent;
1261
- const disableAutoFetch = this.pdfDocument ? this.pdfDocument.loadingParams.disableAutoFetch : _app_options.AppOptions.get("disableAutoFetch");
1262
-
1263
- if (disableAutoFetch && percent) {
1264
- if (this.disableAutoFetchLoadingBarTimeout) {
1265
- clearTimeout(this.disableAutoFetchLoadingBarTimeout);
1266
- this.disableAutoFetchLoadingBarTimeout = null;
1267
- }
1268
-
1269
- this.loadingBar.show();
1270
- this.disableAutoFetchLoadingBarTimeout = setTimeout(() => {
1271
- this.loadingBar.hide();
1272
- this.disableAutoFetchLoadingBarTimeout = null;
1273
- }, DISABLE_AUTO_FETCH_LOADING_BAR_TIMEOUT);
1274
- }
1275
- }
1276
- },
1277
-
1278
- load(pdfDocument) {
1279
- this.pdfDocument = pdfDocument;
1280
- pdfDocument.getDownloadInfo().then(({
1281
- length
1282
- }) => {
1283
- this._contentLength = length;
1284
- this.downloadComplete = true;
1285
- this.loadingBar.hide();
1286
- firstPagePromise.then(() => {
1287
- this.eventBus.dispatch("documentloaded", {
1288
- source: this
1289
- });
1290
- });
1291
- });
1292
- const pageLayoutPromise = pdfDocument.getPageLayout().catch(function () {});
1293
- const pageModePromise = pdfDocument.getPageMode().catch(function () {});
1294
- const openActionPromise = pdfDocument.getOpenAction().catch(function () {});
1295
- this.toolbar.setPagesCount(pdfDocument.numPages, false);
1296
- this.secondaryToolbar.setPagesCount(pdfDocument.numPages);
1297
- let baseDocumentUrl;
1298
- baseDocumentUrl = null;
1299
- this.pdfLinkService.setDocument(pdfDocument, baseDocumentUrl);
1300
- this.pdfDocumentProperties.setDocument(pdfDocument, this.url);
1301
- const pdfViewer = this.pdfViewer;
1302
- pdfViewer.setDocument(pdfDocument);
1303
- const {
1304
- firstPagePromise,
1305
- onePageRendered,
1306
- pagesPromise
1307
- } = pdfViewer;
1308
- const pdfThumbnailViewer = this.pdfThumbnailViewer;
1309
- pdfThumbnailViewer.setDocument(pdfDocument);
1310
- const storedPromise = (this.store = new _view_history.ViewHistory(pdfDocument.fingerprints[0])).getMultiple({
1311
- page: null,
1312
- zoom: _ui_utils.DEFAULT_SCALE_VALUE,
1313
- scrollLeft: "0",
1314
- scrollTop: "0",
1315
- rotation: null,
1316
- sidebarView: _ui_utils.SidebarView.UNKNOWN,
1317
- scrollMode: _ui_utils.ScrollMode.UNKNOWN,
1318
- spreadMode: _ui_utils.SpreadMode.UNKNOWN
1319
- }).catch(() => {
1320
- return Object.create(null);
1321
- });
1322
- firstPagePromise.then(pdfPage => {
1323
- this.loadingBar.setWidth(this.appConfig.viewerContainer);
1324
-
1325
- this._initializeAnnotationStorageCallbacks(pdfDocument);
1326
-
1327
- Promise.all([_ui_utils.animationStarted, storedPromise, pageLayoutPromise, pageModePromise, openActionPromise]).then(async ([timeStamp, stored, pageLayout, pageMode, openAction]) => {
1328
- const viewOnLoad = _app_options.AppOptions.get("viewOnLoad");
1329
-
1330
- this._initializePdfHistory({
1331
- fingerprint: pdfDocument.fingerprints[0],
1332
- viewOnLoad,
1333
- initialDest: openAction?.dest
1334
- });
1335
-
1336
- const initialBookmark = this.initialBookmark;
1337
-
1338
- const zoom = _app_options.AppOptions.get("defaultZoomValue");
1339
-
1340
- let hash = zoom ? `zoom=${zoom}` : null;
1341
- let rotation = null;
1342
-
1343
- let sidebarView = _app_options.AppOptions.get("sidebarViewOnLoad");
1344
-
1345
- let scrollMode = _app_options.AppOptions.get("scrollModeOnLoad");
1346
-
1347
- let spreadMode = _app_options.AppOptions.get("spreadModeOnLoad");
1348
-
1349
- if (stored.page && viewOnLoad !== ViewOnLoad.INITIAL) {
1350
- hash = `page=${stored.page}&zoom=${zoom || stored.zoom},` + `${stored.scrollLeft},${stored.scrollTop}`;
1351
- rotation = parseInt(stored.rotation, 10);
1352
-
1353
- if (sidebarView === _ui_utils.SidebarView.UNKNOWN) {
1354
- sidebarView = stored.sidebarView | 0;
1355
- }
1356
-
1357
- if (scrollMode === _ui_utils.ScrollMode.UNKNOWN) {
1358
- scrollMode = stored.scrollMode | 0;
1359
- }
1360
-
1361
- if (spreadMode === _ui_utils.SpreadMode.UNKNOWN) {
1362
- spreadMode = stored.spreadMode | 0;
1363
- }
1364
- }
1365
-
1366
- if (pageMode && sidebarView === _ui_utils.SidebarView.UNKNOWN) {
1367
- sidebarView = (0, _ui_utils.apiPageModeToSidebarView)(pageMode);
1368
- }
1369
-
1370
- if (pageLayout && spreadMode === _ui_utils.SpreadMode.UNKNOWN) {
1371
- spreadMode = (0, _ui_utils.apiPageLayoutToSpreadMode)(pageLayout);
1372
- }
1373
-
1374
- this.setInitialView(hash, {
1375
- rotation,
1376
- sidebarView,
1377
- scrollMode,
1378
- spreadMode
1379
- });
1380
- this.eventBus.dispatch("documentinit", {
1381
- source: this
1382
- });
1383
-
1384
- if (!this.isViewerEmbedded) {
1385
- pdfViewer.focus();
1386
- }
1387
-
1388
- this._initializePermissions(pdfDocument);
1389
-
1390
- await Promise.race([pagesPromise, new Promise(resolve => {
1391
- setTimeout(resolve, FORCE_PAGES_LOADED_TIMEOUT);
1392
- })]);
1393
-
1394
- if (!initialBookmark && !hash) {
1395
- return;
1396
- }
1397
-
1398
- if (pdfViewer.hasEqualPageSizes) {
1399
- return;
1400
- }
1401
-
1402
- this.initialBookmark = initialBookmark;
1403
- pdfViewer.currentScaleValue = pdfViewer.currentScaleValue;
1404
- this.setInitialView(hash);
1405
- }).catch(() => {
1406
- this.setInitialView();
1407
- }).then(function () {
1408
- pdfViewer.update();
1409
- });
1410
- });
1411
- pagesPromise.then(() => {
1412
- this._unblockDocumentLoadEvent();
1413
-
1414
- this._initializeAutoPrint(pdfDocument, openActionPromise);
1415
- });
1416
- onePageRendered.then(() => {
1417
- pdfDocument.getOutline().then(outline => {
1418
- if (pdfDocument !== this.pdfDocument) {
1419
- return;
1420
- }
1421
-
1422
- this.pdfOutlineViewer.render({
1423
- outline,
1424
- pdfDocument
1425
- });
1426
- });
1427
- pdfDocument.getAttachments().then(attachments => {
1428
- if (pdfDocument !== this.pdfDocument) {
1429
- return;
1430
- }
1431
-
1432
- this.pdfAttachmentViewer.render({
1433
- attachments
1434
- });
1435
- });
1436
- pdfViewer.optionalContentConfigPromise.then(optionalContentConfig => {
1437
- if (pdfDocument !== this.pdfDocument) {
1438
- return;
1439
- }
1440
-
1441
- this.pdfLayerViewer.render({
1442
- optionalContentConfig,
1443
- pdfDocument
1444
- });
1445
- });
1446
-
1447
- if ("requestIdleCallback" in window) {
1448
- const callback = window.requestIdleCallback(() => {
1449
- this._collectTelemetry(pdfDocument);
1450
-
1451
- this._idleCallbacks.delete(callback);
1452
- }, {
1453
- timeout: 1000
1454
- });
1455
-
1456
- this._idleCallbacks.add(callback);
1457
- }
1458
- });
1459
-
1460
- this._initializePageLabels(pdfDocument);
1461
-
1462
- this._initializeMetadata(pdfDocument);
1463
- },
1464
-
1465
- async _scriptingDocProperties(pdfDocument) {
1466
- if (!this.documentInfo) {
1467
- await new Promise(resolve => {
1468
- this.eventBus._on("metadataloaded", resolve, {
1469
- once: true
1470
- });
1471
- });
1472
-
1473
- if (pdfDocument !== this.pdfDocument) {
1474
- return null;
1475
- }
1476
- }
1477
-
1478
- if (!this._contentLength) {
1479
- await new Promise(resolve => {
1480
- this.eventBus._on("documentloaded", resolve, {
1481
- once: true
1482
- });
1483
- });
1484
-
1485
- if (pdfDocument !== this.pdfDocument) {
1486
- return null;
1487
- }
1488
- }
1489
-
1490
- return { ...this.documentInfo,
1491
- baseURL: this.baseUrl,
1492
- filesize: this._contentLength,
1493
- filename: this._docFilename,
1494
- metadata: this.metadata?.getRaw(),
1495
- authors: this.metadata?.get("dc:creator"),
1496
- numPages: this.pagesCount,
1497
- URL: this.url
1498
- };
1499
- },
1500
-
1501
- async _collectTelemetry(pdfDocument) {
1502
- const markInfo = await this.pdfDocument.getMarkInfo();
1503
-
1504
- if (pdfDocument !== this.pdfDocument) {
1505
- return;
1506
- }
1507
-
1508
- const tagged = markInfo?.Marked || false;
1509
- this.externalServices.reportTelemetry({
1510
- type: "tagged",
1511
- tagged
1512
- });
1513
- },
1514
-
1515
- async _initializeAutoPrint(pdfDocument, openActionPromise) {
1516
- const [openAction, javaScript] = await Promise.all([openActionPromise, !this.pdfViewer.enableScripting ? pdfDocument.getJavaScript() : null]);
1517
-
1518
- if (pdfDocument !== this.pdfDocument) {
1519
- return;
1520
- }
1521
-
1522
- let triggerAutoPrint = false;
1523
-
1524
- if (openAction?.action === "Print") {
1525
- triggerAutoPrint = true;
1526
- }
1527
-
1528
- if (javaScript) {
1529
- javaScript.some(js => {
1530
- if (!js) {
1531
- return false;
1532
- }
1533
-
1534
- console.warn("Warning: JavaScript support is not enabled");
1535
- this.fallback(_pdfjsLib.UNSUPPORTED_FEATURES.javaScript);
1536
- return true;
1537
- });
1538
-
1539
- if (!triggerAutoPrint) {
1540
- for (const js of javaScript) {
1541
- if (js && _ui_utils.AutoPrintRegExp.test(js)) {
1542
- triggerAutoPrint = true;
1543
- break;
1544
- }
1545
- }
1546
- }
1547
- }
1548
-
1549
- if (triggerAutoPrint) {
1550
- this.triggerPrinting();
1551
- }
1552
- },
1553
-
1554
- async _initializeMetadata(pdfDocument) {
1555
- const {
1556
- info,
1557
- metadata,
1558
- contentDispositionFilename,
1559
- contentLength
1560
- } = await pdfDocument.getMetadata();
1561
-
1562
- if (pdfDocument !== this.pdfDocument) {
1563
- return;
1564
- }
1565
-
1566
- this.documentInfo = info;
1567
- this.metadata = metadata;
1568
- this._contentDispositionFilename ?? (this._contentDispositionFilename = contentDispositionFilename);
1569
- this._contentLength ?? (this._contentLength = contentLength);
1570
- console.log(`PDF ${pdfDocument.fingerprints[0]} [${info.PDFFormatVersion} ` + `${(info.Producer || "-").trim()} / ${(info.Creator || "-").trim()}] ` + `(PDF.js: ${_pdfjsLib.version || "-"})`);
1571
- let pdfTitle = info?.Title;
1572
- const metadataTitle = metadata?.get("dc:title");
1573
-
1574
- if (metadataTitle) {
1575
- if (metadataTitle !== "Untitled" && !/[\uFFF0-\uFFFF]/g.test(metadataTitle)) {
1576
- pdfTitle = metadataTitle;
1577
- }
1578
- }
1579
-
1580
- if (pdfTitle) {
1581
- this.setTitle(`${pdfTitle} - ${contentDispositionFilename || document.title}`);
1582
- } else if (contentDispositionFilename) {
1583
- this.setTitle(contentDispositionFilename);
1584
- }
1585
-
1586
- if (info.IsXFAPresent && !info.IsAcroFormPresent && !pdfDocument.isPureXfa) {
1587
- console.warn("Warning: XFA support is not enabled");
1588
- this.fallback(_pdfjsLib.UNSUPPORTED_FEATURES.forms);
1589
- } else if ((info.IsAcroFormPresent || info.IsXFAPresent) && !this.pdfViewer.renderInteractiveForms) {
1590
- console.warn("Warning: Interactive form support is not enabled");
1591
- this.fallback(_pdfjsLib.UNSUPPORTED_FEATURES.forms);
1592
- }
1593
-
1594
- if (info.IsSignaturesPresent) {
1595
- console.warn("Warning: Digital signatures validation is not supported");
1596
- this.fallback(_pdfjsLib.UNSUPPORTED_FEATURES.signatures);
1597
- }
1598
-
1599
- let versionId = "other";
1600
-
1601
- if (KNOWN_VERSIONS.includes(info.PDFFormatVersion)) {
1602
- versionId = `v${info.PDFFormatVersion.replace(".", "_")}`;
1603
- }
1604
-
1605
- let generatorId = "other";
1606
-
1607
- if (info.Producer) {
1608
- const producer = info.Producer.toLowerCase();
1609
- KNOWN_GENERATORS.some(function (generator) {
1610
- if (!producer.includes(generator)) {
1611
- return false;
1612
- }
1613
-
1614
- generatorId = generator.replace(/[ .-]/g, "_");
1615
- return true;
1616
- });
1617
- }
1618
-
1619
- let formType = null;
1620
-
1621
- if (info.IsXFAPresent) {
1622
- formType = "xfa";
1623
- } else if (info.IsAcroFormPresent) {
1624
- formType = "acroform";
1625
- }
1626
-
1627
- this.externalServices.reportTelemetry({
1628
- type: "documentInfo",
1629
- version: versionId,
1630
- generator: generatorId,
1631
- formType
1632
- });
1633
- this.eventBus.dispatch("metadataloaded", {
1634
- source: this
1635
- });
1636
- },
1637
-
1638
- async _initializePageLabels(pdfDocument) {
1639
- const labels = await pdfDocument.getPageLabels();
1640
-
1641
- if (pdfDocument !== this.pdfDocument) {
1642
- return;
1643
- }
1644
-
1645
- if (!labels || _app_options.AppOptions.get("disablePageLabels")) {
1646
- return;
1647
- }
1648
-
1649
- const numLabels = labels.length;
1650
-
1651
- if (numLabels !== this.pagesCount) {
1652
- console.error("The number of Page Labels does not match the number of pages in the document.");
1653
- return;
1654
- }
1655
-
1656
- let i = 0;
1657
-
1658
- while (i < numLabels && labels[i] === (i + 1).toString()) {
1659
- i++;
1660
- }
1661
-
1662
- if (i === numLabels) {
1663
- return;
1664
- }
1665
-
1666
- const {
1667
- pdfViewer,
1668
- pdfThumbnailViewer,
1669
- toolbar
1670
- } = this;
1671
- pdfViewer.setPageLabels(labels);
1672
- pdfThumbnailViewer.setPageLabels(labels);
1673
- toolbar.setPagesCount(numLabels, true);
1674
- toolbar.setPageNumber(pdfViewer.currentPageNumber, pdfViewer.currentPageLabel);
1675
- },
1676
-
1677
- _initializePdfHistory({
1678
- fingerprint,
1679
- viewOnLoad,
1680
- initialDest = null
1681
- }) {
1682
- if (this.isViewerEmbedded || _app_options.AppOptions.get("disableHistory")) {
1683
- return;
1684
- }
1685
-
1686
- this.pdfHistory.initialize({
1687
- fingerprint,
1688
- resetHistory: viewOnLoad === ViewOnLoad.INITIAL,
1689
- updateUrl: _app_options.AppOptions.get("historyUpdateUrl")
1690
- });
1691
-
1692
- if (this.pdfHistory.initialBookmark) {
1693
- this.initialBookmark = this.pdfHistory.initialBookmark;
1694
- this.initialRotation = this.pdfHistory.initialRotation;
1695
- }
1696
-
1697
- if (initialDest && !this.initialBookmark && viewOnLoad === ViewOnLoad.UNKNOWN) {
1698
- this.initialBookmark = JSON.stringify(initialDest);
1699
- this.pdfHistory.push({
1700
- explicitDest: initialDest,
1701
- pageNumber: null
1702
- });
1703
- }
1704
- },
1705
-
1706
- async _initializePermissions(pdfDocument) {
1707
- const permissions = await pdfDocument.getPermissions();
1708
-
1709
- if (pdfDocument !== this.pdfDocument) {
1710
- return;
1711
- }
1712
-
1713
- if (!permissions || !_app_options.AppOptions.get("enablePermissions")) {
1714
- return;
1715
- }
1716
-
1717
- if (!permissions.includes(_pdfjsLib.PermissionFlag.COPY)) {
1718
- this.appConfig.viewerContainer.classList.add(ENABLE_PERMISSIONS_CLASS);
1719
- }
1720
- },
1721
-
1722
- _initializeAnnotationStorageCallbacks(pdfDocument) {
1723
- if (pdfDocument !== this.pdfDocument) {
1724
- return;
1725
- }
1726
-
1727
- const {
1728
- annotationStorage
1729
- } = pdfDocument;
1730
-
1731
- annotationStorage.onSetModified = () => {
1732
- window.addEventListener("beforeunload", beforeUnload);
1733
- this._annotationStorageModified = true;
1734
- };
1735
-
1736
- annotationStorage.onResetModified = () => {
1737
- window.removeEventListener("beforeunload", beforeUnload);
1738
- delete this._annotationStorageModified;
1739
- };
1740
- },
1741
-
1742
- setInitialView(storedHash, {
1743
- rotation,
1744
- sidebarView,
1745
- scrollMode,
1746
- spreadMode
1747
- } = {}) {
1748
- const setRotation = angle => {
1749
- if ((0, _ui_utils.isValidRotation)(angle)) {
1750
- this.pdfViewer.pagesRotation = angle;
1751
- }
1752
- };
1753
-
1754
- const setViewerModes = (scroll, spread) => {
1755
- if ((0, _ui_utils.isValidScrollMode)(scroll)) {
1756
- this.pdfViewer.scrollMode = scroll;
1757
- }
1758
-
1759
- if ((0, _ui_utils.isValidSpreadMode)(spread)) {
1760
- this.pdfViewer.spreadMode = spread;
1761
- }
1762
- };
1763
-
1764
- this.isInitialViewSet = true;
1765
- this.pdfSidebar.setInitialView(sidebarView);
1766
- setViewerModes(scrollMode, spreadMode);
1767
-
1768
- if (this.initialBookmark) {
1769
- setRotation(this.initialRotation);
1770
- delete this.initialRotation;
1771
- this.pdfLinkService.setHash(this.initialBookmark);
1772
- this.initialBookmark = null;
1773
- } else if (storedHash) {
1774
- setRotation(rotation);
1775
- this.pdfLinkService.setHash(storedHash);
1776
- }
1777
-
1778
- this.toolbar.setPageNumber(this.pdfViewer.currentPageNumber, this.pdfViewer.currentPageLabel);
1779
- this.secondaryToolbar.setPageNumber(this.pdfViewer.currentPageNumber);
1780
-
1781
- if (!this.pdfViewer.currentScaleValue) {
1782
- this.pdfViewer.currentScaleValue = _ui_utils.DEFAULT_SCALE_VALUE;
1783
- }
1784
- },
1785
-
1786
- _cleanup() {
1787
- if (!this.pdfDocument) {
1788
- return;
1789
- }
1790
-
1791
- this.pdfViewer.cleanup();
1792
- this.pdfThumbnailViewer.cleanup();
1793
- this.pdfDocument.cleanup(this.pdfViewer.renderer === _ui_utils.RendererType.SVG);
1794
- },
1795
-
1796
- forceRendering() {
1797
- this.pdfRenderingQueue.printing = !!this.printService;
1798
- this.pdfRenderingQueue.isThumbnailViewEnabled = this.pdfSidebar.isThumbnailViewVisible;
1799
- this.pdfRenderingQueue.renderHighestPriority();
1800
- },
1801
-
1802
- beforePrint() {
1803
- this.pdfScriptingManager.dispatchWillPrint();
1804
-
1805
- if (this.printService) {
1806
- return;
1807
- }
1808
-
1809
- if (!this.supportsPrinting) {
1810
- this.l10n.get("printing_not_supported").then(msg => {
1811
- this._otherError(msg);
1812
- });
1813
- return;
1814
- }
1815
-
1816
- if (!this.pdfViewer.pageViewsReady) {
1817
- this.l10n.get("printing_not_ready").then(msg => {
1818
- window.alert(msg);
1819
- });
1820
- return;
1821
- }
1822
-
1823
- const pagesOverview = this.pdfViewer.getPagesOverview();
1824
- const printContainer = this.appConfig.printContainer;
1825
-
1826
- const printResolution = _app_options.AppOptions.get("printResolution");
1827
-
1828
- const optionalContentConfigPromise = this.pdfViewer.optionalContentConfigPromise;
1829
- const printService = PDFPrintServiceFactory.instance.createPrintService(this.pdfDocument, pagesOverview, printContainer, printResolution, optionalContentConfigPromise, this.l10n);
1830
- this.printService = printService;
1831
- this.forceRendering();
1832
- printService.layout();
1833
- this.externalServices.reportTelemetry({
1834
- type: "print"
1835
- });
1836
- },
1837
-
1838
- afterPrint() {
1839
- this.pdfScriptingManager.dispatchDidPrint();
1840
-
1841
- if (this.printService) {
1842
- this.printService.destroy();
1843
- this.printService = null;
1844
-
1845
- if (this.pdfDocument) {
1846
- this.pdfDocument.annotationStorage.resetModified();
1847
- }
1848
- }
1849
-
1850
- this.forceRendering();
1851
- },
1852
-
1853
- rotatePages(delta) {
1854
- this.pdfViewer.pagesRotation += delta;
1855
- },
1856
-
1857
- requestPresentationMode() {
1858
- if (!this.pdfPresentationMode) {
1859
- return;
1860
- }
1861
-
1862
- this.pdfPresentationMode.request();
1863
- },
1864
-
1865
- triggerPrinting() {
1866
- if (!this.supportsPrinting) {
1867
- return;
1868
- }
1869
-
1870
- window.print();
1871
- },
1872
-
1873
- bindEvents() {
1874
- const {
1875
- eventBus,
1876
- _boundEvents
1877
- } = this;
1878
- _boundEvents.beforePrint = this.beforePrint.bind(this);
1879
- _boundEvents.afterPrint = this.afterPrint.bind(this);
1880
-
1881
- eventBus._on("resize", webViewerResize);
1882
-
1883
- eventBus._on("hashchange", webViewerHashchange);
1884
-
1885
- eventBus._on("beforeprint", _boundEvents.beforePrint);
1886
-
1887
- eventBus._on("afterprint", _boundEvents.afterPrint);
1888
-
1889
- eventBus._on("pagerendered", webViewerPageRendered);
1890
-
1891
- eventBus._on("updateviewarea", webViewerUpdateViewarea);
1892
-
1893
- eventBus._on("pagechanging", webViewerPageChanging);
1894
-
1895
- eventBus._on("scalechanging", webViewerScaleChanging);
1896
-
1897
- eventBus._on("rotationchanging", webViewerRotationChanging);
1898
-
1899
- eventBus._on("sidebarviewchanged", webViewerSidebarViewChanged);
1900
-
1901
- eventBus._on("pagemode", webViewerPageMode);
1902
-
1903
- eventBus._on("namedaction", webViewerNamedAction);
1904
-
1905
- eventBus._on("presentationmodechanged", webViewerPresentationModeChanged);
1906
-
1907
- eventBus._on("presentationmode", webViewerPresentationMode);
1908
-
1909
- eventBus._on("print", webViewerPrint);
1910
-
1911
- eventBus._on("download", webViewerDownload);
1912
-
1913
- eventBus._on("save", webViewerSave);
1914
-
1915
- eventBus._on("firstpage", webViewerFirstPage);
1916
-
1917
- eventBus._on("lastpage", webViewerLastPage);
1918
-
1919
- eventBus._on("nextpage", webViewerNextPage);
1920
-
1921
- eventBus._on("previouspage", webViewerPreviousPage);
1922
-
1923
- eventBus._on("zoomin", webViewerZoomIn);
1924
-
1925
- eventBus._on("zoomout", webViewerZoomOut);
1926
-
1927
- eventBus._on("zoomreset", webViewerZoomReset);
1928
-
1929
- eventBus._on("pagenumberchanged", webViewerPageNumberChanged);
1930
-
1931
- eventBus._on("scalechanged", webViewerScaleChanged);
1932
-
1933
- eventBus._on("rotatecw", webViewerRotateCw);
1934
-
1935
- eventBus._on("rotateccw", webViewerRotateCcw);
1936
-
1937
- eventBus._on("optionalcontentconfig", webViewerOptionalContentConfig);
1938
-
1939
- eventBus._on("switchscrollmode", webViewerSwitchScrollMode);
1940
-
1941
- eventBus._on("scrollmodechanged", webViewerScrollModeChanged);
1942
-
1943
- eventBus._on("switchspreadmode", webViewerSwitchSpreadMode);
1944
-
1945
- eventBus._on("spreadmodechanged", webViewerSpreadModeChanged);
1946
-
1947
- eventBus._on("documentproperties", webViewerDocumentProperties);
1948
-
1949
- eventBus._on("find", webViewerFind);
1950
-
1951
- eventBus._on("findfromurlhash", webViewerFindFromUrlHash);
1952
-
1953
- eventBus._on("updatefindmatchescount", webViewerUpdateFindMatchesCount);
1954
-
1955
- eventBus._on("updatefindcontrolstate", webViewerUpdateFindControlState);
1956
-
1957
- if (_app_options.AppOptions.get("pdfBug")) {
1958
- _boundEvents.reportPageStatsPDFBug = reportPageStatsPDFBug;
1959
-
1960
- eventBus._on("pagerendered", _boundEvents.reportPageStatsPDFBug);
1961
-
1962
- eventBus._on("pagechanging", _boundEvents.reportPageStatsPDFBug);
1963
- }
1964
-
1965
- eventBus._on("fileinputchange", webViewerFileInputChange);
1966
-
1967
- eventBus._on("openfile", webViewerOpenFile);
1968
- },
1969
-
1970
- bindWindowEvents() {
1971
- const {
1972
- eventBus,
1973
- _boundEvents
1974
- } = this;
1975
-
1976
- _boundEvents.windowResize = () => {
1977
- eventBus.dispatch("resize", {
1978
- source: window
1979
- });
1980
- };
1981
-
1982
- _boundEvents.windowHashChange = () => {
1983
- eventBus.dispatch("hashchange", {
1984
- source: window,
1985
- hash: document.location.hash.substring(1)
1986
- });
1987
- };
1988
-
1989
- _boundEvents.windowBeforePrint = () => {
1990
- eventBus.dispatch("beforeprint", {
1991
- source: window
1992
- });
1993
- };
1994
-
1995
- _boundEvents.windowAfterPrint = () => {
1996
- eventBus.dispatch("afterprint", {
1997
- source: window
1998
- });
1999
- };
2000
-
2001
- _boundEvents.windowUpdateFromSandbox = event => {
2002
- eventBus.dispatch("updatefromsandbox", {
2003
- source: window,
2004
- detail: event.detail
2005
- });
2006
- };
2007
-
2008
- window.addEventListener("visibilitychange", webViewerVisibilityChange);
2009
- window.addEventListener("wheel", webViewerWheel, {
2010
- passive: false
2011
- });
2012
- window.addEventListener("touchstart", webViewerTouchStart, {
2013
- passive: false
2014
- });
2015
- window.addEventListener("click", webViewerClick);
2016
- window.addEventListener("keydown", webViewerKeyDown);
2017
- window.addEventListener("resize", _boundEvents.windowResize);
2018
- window.addEventListener("hashchange", _boundEvents.windowHashChange);
2019
- window.addEventListener("beforeprint", _boundEvents.windowBeforePrint);
2020
- window.addEventListener("afterprint", _boundEvents.windowAfterPrint);
2021
- window.addEventListener("updatefromsandbox", _boundEvents.windowUpdateFromSandbox);
2022
- },
2023
-
2024
- unbindEvents() {
2025
- const {
2026
- eventBus,
2027
- _boundEvents
2028
- } = this;
2029
-
2030
- eventBus._off("resize", webViewerResize);
2031
-
2032
- eventBus._off("hashchange", webViewerHashchange);
2033
-
2034
- eventBus._off("beforeprint", _boundEvents.beforePrint);
2035
-
2036
- eventBus._off("afterprint", _boundEvents.afterPrint);
2037
-
2038
- eventBus._off("pagerendered", webViewerPageRendered);
2039
-
2040
- eventBus._off("updateviewarea", webViewerUpdateViewarea);
2041
-
2042
- eventBus._off("pagechanging", webViewerPageChanging);
2043
-
2044
- eventBus._off("scalechanging", webViewerScaleChanging);
2045
-
2046
- eventBus._off("rotationchanging", webViewerRotationChanging);
2047
-
2048
- eventBus._off("sidebarviewchanged", webViewerSidebarViewChanged);
2049
-
2050
- eventBus._off("pagemode", webViewerPageMode);
2051
-
2052
- eventBus._off("namedaction", webViewerNamedAction);
2053
-
2054
- eventBus._off("presentationmodechanged", webViewerPresentationModeChanged);
2055
-
2056
- eventBus._off("presentationmode", webViewerPresentationMode);
2057
-
2058
- eventBus._off("print", webViewerPrint);
2059
-
2060
- eventBus._off("download", webViewerDownload);
2061
-
2062
- eventBus._off("save", webViewerSave);
2063
-
2064
- eventBus._off("firstpage", webViewerFirstPage);
2065
-
2066
- eventBus._off("lastpage", webViewerLastPage);
2067
-
2068
- eventBus._off("nextpage", webViewerNextPage);
2069
-
2070
- eventBus._off("previouspage", webViewerPreviousPage);
2071
-
2072
- eventBus._off("zoomin", webViewerZoomIn);
2073
-
2074
- eventBus._off("zoomout", webViewerZoomOut);
2075
-
2076
- eventBus._off("zoomreset", webViewerZoomReset);
2077
-
2078
- eventBus._off("pagenumberchanged", webViewerPageNumberChanged);
2079
-
2080
- eventBus._off("scalechanged", webViewerScaleChanged);
2081
-
2082
- eventBus._off("rotatecw", webViewerRotateCw);
2083
-
2084
- eventBus._off("rotateccw", webViewerRotateCcw);
2085
-
2086
- eventBus._off("optionalcontentconfig", webViewerOptionalContentConfig);
2087
-
2088
- eventBus._off("switchscrollmode", webViewerSwitchScrollMode);
2089
-
2090
- eventBus._off("scrollmodechanged", webViewerScrollModeChanged);
2091
-
2092
- eventBus._off("switchspreadmode", webViewerSwitchSpreadMode);
2093
-
2094
- eventBus._off("spreadmodechanged", webViewerSpreadModeChanged);
2095
-
2096
- eventBus._off("documentproperties", webViewerDocumentProperties);
2097
-
2098
- eventBus._off("find", webViewerFind);
2099
-
2100
- eventBus._off("findfromurlhash", webViewerFindFromUrlHash);
2101
-
2102
- eventBus._off("updatefindmatchescount", webViewerUpdateFindMatchesCount);
2103
-
2104
- eventBus._off("updatefindcontrolstate", webViewerUpdateFindControlState);
2105
-
2106
- if (_boundEvents.reportPageStatsPDFBug) {
2107
- eventBus._off("pagerendered", _boundEvents.reportPageStatsPDFBug);
2108
-
2109
- eventBus._off("pagechanging", _boundEvents.reportPageStatsPDFBug);
2110
-
2111
- _boundEvents.reportPageStatsPDFBug = null;
2112
- }
2113
-
2114
- eventBus._off("fileinputchange", webViewerFileInputChange);
2115
-
2116
- eventBus._off("openfile", webViewerOpenFile);
2117
-
2118
- _boundEvents.beforePrint = null;
2119
- _boundEvents.afterPrint = null;
2120
- },
2121
-
2122
- unbindWindowEvents() {
2123
- const {
2124
- _boundEvents
2125
- } = this;
2126
- window.removeEventListener("visibilitychange", webViewerVisibilityChange);
2127
- window.removeEventListener("wheel", webViewerWheel, {
2128
- passive: false
2129
- });
2130
- window.removeEventListener("touchstart", webViewerTouchStart, {
2131
- passive: false
2132
- });
2133
- window.removeEventListener("click", webViewerClick);
2134
- window.removeEventListener("keydown", webViewerKeyDown);
2135
- window.removeEventListener("resize", _boundEvents.windowResize);
2136
- window.removeEventListener("hashchange", _boundEvents.windowHashChange);
2137
- window.removeEventListener("beforeprint", _boundEvents.windowBeforePrint);
2138
- window.removeEventListener("afterprint", _boundEvents.windowAfterPrint);
2139
- window.removeEventListener("updatefromsandbox", _boundEvents.windowUpdateFromSandbox);
2140
- _boundEvents.windowResize = null;
2141
- _boundEvents.windowHashChange = null;
2142
- _boundEvents.windowBeforePrint = null;
2143
- _boundEvents.windowAfterPrint = null;
2144
- _boundEvents.windowUpdateFromSandbox = null;
2145
- },
2146
-
2147
- accumulateWheelTicks(ticks) {
2148
- if (this._wheelUnusedTicks > 0 && ticks < 0 || this._wheelUnusedTicks < 0 && ticks > 0) {
2149
- this._wheelUnusedTicks = 0;
2150
- }
2151
-
2152
- this._wheelUnusedTicks += ticks;
2153
- const wholeTicks = Math.sign(this._wheelUnusedTicks) * Math.floor(Math.abs(this._wheelUnusedTicks));
2154
- this._wheelUnusedTicks -= wholeTicks;
2155
- return wholeTicks;
2156
- },
2157
-
2158
- _unblockDocumentLoadEvent() {
2159
- if (document.blockUnblockOnload) {
2160
- document.blockUnblockOnload(false);
2161
- }
2162
-
2163
- this._unblockDocumentLoadEvent = () => {};
2164
- },
2165
-
2166
- get scriptingReady() {
2167
- return this.pdfScriptingManager.ready;
2168
- }
2169
-
2170
- };
2171
- exports.PDFViewerApplication = PDFViewerApplication;
2172
- let validateFileURL;
2173
- {
2174
- const HOSTED_VIEWER_ORIGINS = ["null", "http://mozilla.github.io", "https://mozilla.github.io"];
2175
-
2176
- validateFileURL = function (file) {
2177
- if (file === undefined) {
2178
- return;
2179
- }
2180
-
2181
- try {
2182
- const viewerOrigin = new URL(window.location.href).origin || "null";
2183
-
2184
- if (HOSTED_VIEWER_ORIGINS.includes(viewerOrigin)) {
2185
- return;
2186
- }
2187
-
2188
- const {
2189
- origin,
2190
- protocol
2191
- } = new URL(file, window.location.href);
2192
-
2193
- if (origin !== viewerOrigin && protocol !== "blob:") {
2194
- throw new Error("file origin does not match viewer's");
2195
- }
2196
- } catch (ex) {
2197
- PDFViewerApplication.l10n.get("loading_error").then(msg => {
2198
- PDFViewerApplication._documentError(msg, {
2199
- message: ex?.message
2200
- });
2201
- });
2202
- throw ex;
2203
- }
2204
- };
2205
- }
2206
-
2207
- async function loadFakeWorker() {
2208
- if (!_pdfjsLib.GlobalWorkerOptions.workerSrc) {
2209
- _pdfjsLib.GlobalWorkerOptions.workerSrc = _app_options.AppOptions.get("workerSrc");
2210
- }
2211
-
2212
- return (0, _pdfjsLib.loadScript)(_pdfjsLib.PDFWorker.getWorkerSrc());
2213
- }
2214
-
2215
- function loadAndEnablePDFBug(enabledTabs) {
2216
- const appConfig = PDFViewerApplication.appConfig;
2217
- return (0, _pdfjsLib.loadScript)(appConfig.debuggerScriptPath).then(function () {
2218
- PDFBug.enable(enabledTabs);
2219
- PDFBug.init({
2220
- OPS: _pdfjsLib.OPS
2221
- }, appConfig.mainContainer);
2222
- });
2223
- }
2224
-
2225
- function reportPageStatsPDFBug({
2226
- pageNumber
2227
- }) {
2228
- if (typeof Stats === "undefined" || !Stats.enabled) {
2229
- return;
2230
- }
2231
-
2232
- const pageView = PDFViewerApplication.pdfViewer.getPageView(pageNumber - 1);
2233
- const pageStats = pageView?.pdfPage?.stats;
2234
-
2235
- if (!pageStats) {
2236
- return;
2237
- }
2238
-
2239
- Stats.add(pageNumber, pageStats);
2240
- }
2241
-
2242
- function webViewerInitialized() {
2243
- const appConfig = PDFViewerApplication.appConfig;
2244
- let file;
2245
- const queryString = document.location.search.substring(1);
2246
- const params = (0, _ui_utils.parseQueryString)(queryString);
2247
- file = "file" in params ? params.file : _app_options.AppOptions.get("defaultUrl");
2248
- validateFileURL(file);
2249
- const fileInput = document.createElement("input");
2250
- fileInput.id = appConfig.openFileInputName;
2251
- fileInput.className = "fileInput";
2252
- fileInput.setAttribute("type", "file");
2253
- fileInput.oncontextmenu = _ui_utils.noContextMenuHandler;
2254
- document.body.appendChild(fileInput);
2255
-
2256
- if (!window.File || !window.FileReader || !window.FileList || !window.Blob) {
2257
- appConfig.toolbar.openFile.hidden = true;
2258
- appConfig.secondaryToolbar.openFileButton.hidden = true;
2259
- } else {
2260
- fileInput.value = null;
2261
- }
2262
-
2263
- fileInput.addEventListener("change", function (evt) {
2264
- const files = evt.target.files;
2265
-
2266
- if (!files || files.length === 0) {
2267
- return;
2268
- }
2269
-
2270
- PDFViewerApplication.eventBus.dispatch("fileinputchange", {
2271
- source: this,
2272
- fileInput: evt.target
2273
- });
2274
- });
2275
- appConfig.mainContainer.addEventListener("dragover", function (evt) {
2276
- evt.preventDefault();
2277
- evt.dataTransfer.dropEffect = "move";
2278
- });
2279
- appConfig.mainContainer.addEventListener("drop", function (evt) {
2280
- evt.preventDefault();
2281
- const files = evt.dataTransfer.files;
2282
-
2283
- if (!files || files.length === 0) {
2284
- return;
2285
- }
2286
-
2287
- PDFViewerApplication.eventBus.dispatch("fileinputchange", {
2288
- source: this,
2289
- fileInput: evt.dataTransfer
2290
- });
2291
- });
2292
-
2293
- if (!PDFViewerApplication.supportsDocumentFonts) {
2294
- _app_options.AppOptions.set("disableFontFace", true);
2295
-
2296
- PDFViewerApplication.l10n.get("web_fonts_disabled").then(msg => {
2297
- console.warn(msg);
2298
- });
2299
- }
2300
-
2301
- if (!PDFViewerApplication.supportsPrinting) {
2302
- appConfig.toolbar.print.classList.add("hidden");
2303
- appConfig.secondaryToolbar.printButton.classList.add("hidden");
2304
- }
2305
-
2306
- if (!PDFViewerApplication.supportsFullscreen) {
2307
- appConfig.toolbar.presentationModeButton.classList.add("hidden");
2308
- appConfig.secondaryToolbar.presentationModeButton.classList.add("hidden");
2309
- }
2310
-
2311
- if (PDFViewerApplication.supportsIntegratedFind) {
2312
- appConfig.toolbar.viewFind.classList.add("hidden");
2313
- }
2314
-
2315
- appConfig.mainContainer.addEventListener("transitionend", function (evt) {
2316
- if (evt.target === this) {
2317
- PDFViewerApplication.eventBus.dispatch("resize", {
2318
- source: this
2319
- });
2320
- }
2321
- }, true);
2322
-
2323
- try {
2324
- webViewerOpenFileViaURL(file);
2325
- } catch (reason) {
2326
- PDFViewerApplication.l10n.get("loading_error").then(msg => {
2327
- PDFViewerApplication._documentError(msg, reason);
2328
- });
2329
- }
2330
- }
2331
-
2332
- function webViewerOpenFileViaURL(file) {
2333
- if (file) {
2334
- PDFViewerApplication.open(file);
2335
- }
2336
- }
2337
-
2338
- function webViewerResetPermissions() {
2339
- const {
2340
- appConfig
2341
- } = PDFViewerApplication;
2342
-
2343
- if (!appConfig) {
2344
- return;
2345
- }
2346
-
2347
- appConfig.viewerContainer.classList.remove(ENABLE_PERMISSIONS_CLASS);
2348
- }
2349
-
2350
- function webViewerPageRendered({
2351
- pageNumber,
2352
- timestamp,
2353
- error
2354
- }) {
2355
- if (pageNumber === PDFViewerApplication.page) {
2356
- PDFViewerApplication.toolbar.updateLoadingIndicatorState(false);
2357
- }
2358
-
2359
- if (PDFViewerApplication.pdfSidebar.isThumbnailViewVisible) {
2360
- const pageView = PDFViewerApplication.pdfViewer.getPageView(pageNumber - 1);
2361
- const thumbnailView = PDFViewerApplication.pdfThumbnailViewer.getThumbnail(pageNumber - 1);
2362
-
2363
- if (pageView && thumbnailView) {
2364
- thumbnailView.setImage(pageView);
2365
- }
2366
- }
2367
-
2368
- if (error) {
2369
- PDFViewerApplication.l10n.get("rendering_error").then(msg => {
2370
- PDFViewerApplication._otherError(msg, error);
2371
- });
2372
- }
2373
-
2374
- PDFViewerApplication.externalServices.reportTelemetry({
2375
- type: "pageInfo",
2376
- timestamp
2377
- });
2378
- PDFViewerApplication.pdfDocument.getStats().then(function (stats) {
2379
- PDFViewerApplication.externalServices.reportTelemetry({
2380
- type: "documentStats",
2381
- stats
2382
- });
2383
- });
2384
- }
2385
-
2386
- function webViewerPageMode({
2387
- mode
2388
- }) {
2389
- let view;
2390
-
2391
- switch (mode) {
2392
- case "thumbs":
2393
- view = _ui_utils.SidebarView.THUMBS;
2394
- break;
2395
-
2396
- case "bookmarks":
2397
- case "outline":
2398
- view = _ui_utils.SidebarView.OUTLINE;
2399
- break;
2400
-
2401
- case "attachments":
2402
- view = _ui_utils.SidebarView.ATTACHMENTS;
2403
- break;
2404
-
2405
- case "layers":
2406
- view = _ui_utils.SidebarView.LAYERS;
2407
- break;
2408
-
2409
- case "none":
2410
- view = _ui_utils.SidebarView.NONE;
2411
- break;
2412
-
2413
- default:
2414
- console.error('Invalid "pagemode" hash parameter: ' + mode);
2415
- return;
2416
- }
2417
-
2418
- PDFViewerApplication.pdfSidebar.switchView(view, true);
2419
- }
2420
-
2421
- function webViewerNamedAction(evt) {
2422
- switch (evt.action) {
2423
- case "GoToPage":
2424
- PDFViewerApplication.appConfig.toolbar.pageNumber.select();
2425
- break;
2426
-
2427
- case "Find":
2428
- if (!PDFViewerApplication.supportsIntegratedFind) {
2429
- PDFViewerApplication.findBar.toggle();
2430
- }
2431
-
2432
- break;
2433
-
2434
- case "Print":
2435
- PDFViewerApplication.triggerPrinting();
2436
- break;
2437
-
2438
- case "SaveAs":
2439
- webViewerSave();
2440
- break;
2441
- }
2442
- }
2443
-
2444
- function webViewerPresentationModeChanged(evt) {
2445
- PDFViewerApplication.pdfViewer.presentationModeState = evt.state;
2446
- }
2447
-
2448
- function webViewerSidebarViewChanged(evt) {
2449
- PDFViewerApplication.pdfRenderingQueue.isThumbnailViewEnabled = PDFViewerApplication.pdfSidebar.isThumbnailViewVisible;
2450
- const store = PDFViewerApplication.store;
2451
-
2452
- if (store && PDFViewerApplication.isInitialViewSet) {
2453
- store.set("sidebarView", evt.view).catch(function () {});
2454
- }
2455
- }
2456
-
2457
- function webViewerUpdateViewarea(evt) {
2458
- const location = evt.location,
2459
- store = PDFViewerApplication.store;
2460
-
2461
- if (store && PDFViewerApplication.isInitialViewSet) {
2462
- store.setMultiple({
2463
- page: location.pageNumber,
2464
- zoom: location.scale,
2465
- scrollLeft: location.left,
2466
- scrollTop: location.top,
2467
- rotation: location.rotation
2468
- }).catch(function () {});
2469
- }
2470
-
2471
- const href = PDFViewerApplication.pdfLinkService.getAnchorUrl(location.pdfOpenParams);
2472
- PDFViewerApplication.appConfig.toolbar.viewBookmark.href = href;
2473
- PDFViewerApplication.appConfig.secondaryToolbar.viewBookmarkButton.href = href;
2474
- const currentPage = PDFViewerApplication.pdfViewer.getPageView(PDFViewerApplication.page - 1);
2475
- const loading = currentPage?.renderingState !== _pdf_rendering_queue.RenderingStates.FINISHED;
2476
- PDFViewerApplication.toolbar.updateLoadingIndicatorState(loading);
2477
- }
2478
-
2479
- function webViewerScrollModeChanged(evt) {
2480
- const store = PDFViewerApplication.store;
2481
-
2482
- if (store && PDFViewerApplication.isInitialViewSet) {
2483
- store.set("scrollMode", evt.mode).catch(function () {});
2484
- }
2485
- }
2486
-
2487
- function webViewerSpreadModeChanged(evt) {
2488
- const store = PDFViewerApplication.store;
2489
-
2490
- if (store && PDFViewerApplication.isInitialViewSet) {
2491
- store.set("spreadMode", evt.mode).catch(function () {});
2492
- }
2493
- }
2494
-
2495
- function webViewerResize() {
2496
- const {
2497
- pdfDocument,
2498
- pdfViewer
2499
- } = PDFViewerApplication;
2500
-
2501
- if (!pdfDocument) {
2502
- return;
2503
- }
2504
-
2505
- const currentScaleValue = pdfViewer.currentScaleValue;
2506
-
2507
- if (currentScaleValue === "auto" || currentScaleValue === "page-fit" || currentScaleValue === "page-width") {
2508
- pdfViewer.currentScaleValue = currentScaleValue;
2509
- }
2510
-
2511
- pdfViewer.update();
2512
- }
2513
-
2514
- function webViewerHashchange(evt) {
2515
- const hash = evt.hash;
2516
-
2517
- if (!hash) {
2518
- return;
2519
- }
2520
-
2521
- if (!PDFViewerApplication.isInitialViewSet) {
2522
- PDFViewerApplication.initialBookmark = hash;
2523
- } else if (!PDFViewerApplication.pdfHistory.popStateInProgress) {
2524
- PDFViewerApplication.pdfLinkService.setHash(hash);
2525
- }
2526
- }
2527
-
2528
- let webViewerFileInputChange, webViewerOpenFile;
2529
- {
2530
- webViewerFileInputChange = function (evt) {
2531
- if (PDFViewerApplication.pdfViewer?.isInPresentationMode) {
2532
- return;
2533
- }
2534
-
2535
- const file = evt.fileInput.files[0];
2536
-
2537
- if (!_viewer_compatibility.viewerCompatibilityParams.disableCreateObjectURL) {
2538
- let url = URL.createObjectURL(file);
2539
-
2540
- if (file.name) {
2541
- url = {
2542
- url,
2543
- originalUrl: file.name
2544
- };
2545
- }
2546
-
2547
- PDFViewerApplication.open(url);
2548
- } else {
2549
- PDFViewerApplication.setTitleUsingUrl(file.name);
2550
- const fileReader = new FileReader();
2551
-
2552
- fileReader.onload = function webViewerChangeFileReaderOnload(event) {
2553
- const buffer = event.target.result;
2554
- PDFViewerApplication.open(new Uint8Array(buffer));
2555
- };
2556
-
2557
- fileReader.readAsArrayBuffer(file);
2558
- }
2559
-
2560
- const appConfig = PDFViewerApplication.appConfig;
2561
- appConfig.toolbar.viewBookmark.hidden = true;
2562
- appConfig.secondaryToolbar.viewBookmarkButton.hidden = true;
2563
- appConfig.toolbar.download.hidden = true;
2564
- appConfig.secondaryToolbar.downloadButton.hidden = true;
2565
- };
2566
-
2567
- webViewerOpenFile = function (evt) {
2568
- const openFileInputName = PDFViewerApplication.appConfig.openFileInputName;
2569
- document.getElementById(openFileInputName).click();
2570
- };
2571
- }
2572
-
2573
- function webViewerPresentationMode() {
2574
- PDFViewerApplication.requestPresentationMode();
2575
- }
2576
-
2577
- function webViewerPrint() {
2578
- PDFViewerApplication.triggerPrinting();
2579
- }
2580
-
2581
- function webViewerDownload() {
2582
- PDFViewerApplication.downloadOrSave({
2583
- sourceEventType: "download"
2584
- });
2585
- }
2586
-
2587
- function webViewerSave() {
2588
- PDFViewerApplication.downloadOrSave({
2589
- sourceEventType: "save"
2590
- });
2591
- }
2592
-
2593
- function webViewerFirstPage() {
2594
- if (PDFViewerApplication.pdfDocument) {
2595
- PDFViewerApplication.page = 1;
2596
- }
2597
- }
2598
-
2599
- function webViewerLastPage() {
2600
- if (PDFViewerApplication.pdfDocument) {
2601
- PDFViewerApplication.page = PDFViewerApplication.pagesCount;
2602
- }
2603
- }
2604
-
2605
- function webViewerNextPage() {
2606
- PDFViewerApplication.pdfViewer.nextPage();
2607
- }
2608
-
2609
- function webViewerPreviousPage() {
2610
- PDFViewerApplication.pdfViewer.previousPage();
2611
- }
2612
-
2613
- function webViewerZoomIn() {
2614
- PDFViewerApplication.zoomIn();
2615
- }
2616
-
2617
- function webViewerZoomOut() {
2618
- PDFViewerApplication.zoomOut();
2619
- }
2620
-
2621
- function webViewerZoomReset() {
2622
- PDFViewerApplication.zoomReset();
2623
- }
2624
-
2625
- function webViewerPageNumberChanged(evt) {
2626
- const pdfViewer = PDFViewerApplication.pdfViewer;
2627
-
2628
- if (evt.value !== "") {
2629
- PDFViewerApplication.pdfLinkService.goToPage(evt.value);
2630
- }
2631
-
2632
- if (evt.value !== pdfViewer.currentPageNumber.toString() && evt.value !== pdfViewer.currentPageLabel) {
2633
- PDFViewerApplication.toolbar.setPageNumber(pdfViewer.currentPageNumber, pdfViewer.currentPageLabel);
2634
- }
2635
- }
2636
-
2637
- function webViewerScaleChanged(evt) {
2638
- PDFViewerApplication.pdfViewer.currentScaleValue = evt.value;
2639
- }
2640
-
2641
- function webViewerRotateCw() {
2642
- PDFViewerApplication.rotatePages(90);
2643
- }
2644
-
2645
- function webViewerRotateCcw() {
2646
- PDFViewerApplication.rotatePages(-90);
2647
- }
2648
-
2649
- function webViewerOptionalContentConfig(evt) {
2650
- PDFViewerApplication.pdfViewer.optionalContentConfigPromise = evt.promise;
2651
- }
2652
-
2653
- function webViewerSwitchScrollMode(evt) {
2654
- PDFViewerApplication.pdfViewer.scrollMode = evt.mode;
2655
- }
2656
-
2657
- function webViewerSwitchSpreadMode(evt) {
2658
- PDFViewerApplication.pdfViewer.spreadMode = evt.mode;
2659
- }
2660
-
2661
- function webViewerDocumentProperties() {
2662
- PDFViewerApplication.pdfDocumentProperties.open();
2663
- }
2664
-
2665
- function webViewerFind(evt) {
2666
- PDFViewerApplication.findController.executeCommand("find" + evt.type, {
2667
- query: evt.query,
2668
- phraseSearch: evt.phraseSearch,
2669
- caseSensitive: evt.caseSensitive,
2670
- entireWord: evt.entireWord,
2671
- highlightAll: evt.highlightAll,
2672
- findPrevious: evt.findPrevious
2673
- });
2674
- }
2675
-
2676
- function webViewerFindFromUrlHash(evt) {
2677
- PDFViewerApplication.findController.executeCommand("find", {
2678
- query: evt.query,
2679
- phraseSearch: evt.phraseSearch,
2680
- caseSensitive: false,
2681
- entireWord: false,
2682
- highlightAll: true,
2683
- findPrevious: false
2684
- });
2685
- }
2686
-
2687
- function webViewerUpdateFindMatchesCount({
2688
- matchesCount
2689
- }) {
2690
- if (PDFViewerApplication.supportsIntegratedFind) {
2691
- PDFViewerApplication.externalServices.updateFindMatchesCount(matchesCount);
2692
- } else {
2693
- PDFViewerApplication.findBar.updateResultsCount(matchesCount);
2694
- }
2695
- }
2696
-
2697
- function webViewerUpdateFindControlState({
2698
- state,
2699
- previous,
2700
- matchesCount,
2701
- rawQuery
2702
- }) {
2703
- if (PDFViewerApplication.supportsIntegratedFind) {
2704
- PDFViewerApplication.externalServices.updateFindControlState({
2705
- result: state,
2706
- findPrevious: previous,
2707
- matchesCount,
2708
- rawQuery
2709
- });
2710
- } else {
2711
- PDFViewerApplication.findBar.updateUIState(state, previous, matchesCount);
2712
- }
2713
- }
2714
-
2715
- function webViewerScaleChanging(evt) {
2716
- PDFViewerApplication.toolbar.setPageScale(evt.presetValue, evt.scale);
2717
- PDFViewerApplication.pdfViewer.update();
2718
- }
2719
-
2720
- function webViewerRotationChanging(evt) {
2721
- PDFViewerApplication.pdfThumbnailViewer.pagesRotation = evt.pagesRotation;
2722
- PDFViewerApplication.forceRendering();
2723
- PDFViewerApplication.pdfViewer.currentPageNumber = evt.pageNumber;
2724
- }
2725
-
2726
- function webViewerPageChanging({
2727
- pageNumber,
2728
- pageLabel
2729
- }) {
2730
- PDFViewerApplication.toolbar.setPageNumber(pageNumber, pageLabel);
2731
- PDFViewerApplication.secondaryToolbar.setPageNumber(pageNumber);
2732
-
2733
- if (PDFViewerApplication.pdfSidebar.isThumbnailViewVisible) {
2734
- PDFViewerApplication.pdfThumbnailViewer.scrollThumbnailIntoView(pageNumber);
2735
- }
2736
- }
2737
-
2738
- function webViewerVisibilityChange(evt) {
2739
- if (document.visibilityState === "visible") {
2740
- setZoomDisabledTimeout();
2741
- }
2742
- }
2743
-
2744
- let zoomDisabledTimeout = null;
2745
-
2746
- function setZoomDisabledTimeout() {
2747
- if (zoomDisabledTimeout) {
2748
- clearTimeout(zoomDisabledTimeout);
2749
- }
2750
-
2751
- zoomDisabledTimeout = setTimeout(function () {
2752
- zoomDisabledTimeout = null;
2753
- }, WHEEL_ZOOM_DISABLED_TIMEOUT);
2754
- }
2755
-
2756
- function webViewerWheel(evt) {
2757
- const {
2758
- pdfViewer,
2759
- supportedMouseWheelZoomModifierKeys
2760
- } = PDFViewerApplication;
2761
-
2762
- if (pdfViewer.isInPresentationMode) {
2763
- return;
2764
- }
2765
-
2766
- if (evt.ctrlKey && supportedMouseWheelZoomModifierKeys.ctrlKey || evt.metaKey && supportedMouseWheelZoomModifierKeys.metaKey) {
2767
- evt.preventDefault();
2768
-
2769
- if (zoomDisabledTimeout || document.visibilityState === "hidden") {
2770
- return;
2771
- }
2772
-
2773
- const previousScale = pdfViewer.currentScale;
2774
- const delta = (0, _ui_utils.normalizeWheelEventDirection)(evt);
2775
- let ticks = 0;
2776
-
2777
- if (evt.deltaMode === WheelEvent.DOM_DELTA_LINE || evt.deltaMode === WheelEvent.DOM_DELTA_PAGE) {
2778
- if (Math.abs(delta) >= 1) {
2779
- ticks = Math.sign(delta);
2780
- } else {
2781
- ticks = PDFViewerApplication.accumulateWheelTicks(delta);
2782
- }
2783
- } else {
2784
- const PIXELS_PER_LINE_SCALE = 30;
2785
- ticks = PDFViewerApplication.accumulateWheelTicks(delta / PIXELS_PER_LINE_SCALE);
2786
- }
2787
-
2788
- if (ticks < 0) {
2789
- PDFViewerApplication.zoomOut(-ticks);
2790
- } else if (ticks > 0) {
2791
- PDFViewerApplication.zoomIn(ticks);
2792
- }
2793
-
2794
- const currentScale = pdfViewer.currentScale;
2795
-
2796
- if (previousScale !== currentScale) {
2797
- const scaleCorrectionFactor = currentScale / previousScale - 1;
2798
- const rect = pdfViewer.container.getBoundingClientRect();
2799
- const dx = evt.clientX - rect.left;
2800
- const dy = evt.clientY - rect.top;
2801
- pdfViewer.container.scrollLeft += dx * scaleCorrectionFactor;
2802
- pdfViewer.container.scrollTop += dy * scaleCorrectionFactor;
2803
- }
2804
- } else {
2805
- setZoomDisabledTimeout();
2806
- }
2807
- }
2808
-
2809
- function webViewerTouchStart(evt) {
2810
- if (evt.touches.length > 1) {
2811
- evt.preventDefault();
2812
- }
2813
- }
2814
-
2815
- function webViewerClick(evt) {
2816
- if (!PDFViewerApplication.secondaryToolbar.isOpen) {
2817
- return;
2818
- }
2819
-
2820
- const appConfig = PDFViewerApplication.appConfig;
2821
-
2822
- if (PDFViewerApplication.pdfViewer.containsElement(evt.target) || appConfig.toolbar.container.contains(evt.target) && evt.target !== appConfig.secondaryToolbar.toggleButton) {
2823
- PDFViewerApplication.secondaryToolbar.close();
2824
- }
2825
- }
2826
-
2827
- function webViewerKeyDown(evt) {
2828
- if (PDFViewerApplication.overlayManager.active) {
2829
- return;
2830
- }
2831
-
2832
- let handled = false,
2833
- ensureViewerFocused = false;
2834
- const cmd = (evt.ctrlKey ? 1 : 0) | (evt.altKey ? 2 : 0) | (evt.shiftKey ? 4 : 0) | (evt.metaKey ? 8 : 0);
2835
- const pdfViewer = PDFViewerApplication.pdfViewer;
2836
- const isViewerInPresentationMode = pdfViewer?.isInPresentationMode;
2837
-
2838
- if (cmd === 1 || cmd === 8 || cmd === 5 || cmd === 12) {
2839
- switch (evt.keyCode) {
2840
- case 70:
2841
- if (!PDFViewerApplication.supportsIntegratedFind && !evt.shiftKey) {
2842
- PDFViewerApplication.findBar.open();
2843
- handled = true;
2844
- }
2845
-
2846
- break;
2847
-
2848
- case 71:
2849
- if (!PDFViewerApplication.supportsIntegratedFind) {
2850
- const findState = PDFViewerApplication.findController.state;
2851
-
2852
- if (findState) {
2853
- PDFViewerApplication.findController.executeCommand("findagain", {
2854
- query: findState.query,
2855
- phraseSearch: findState.phraseSearch,
2856
- caseSensitive: findState.caseSensitive,
2857
- entireWord: findState.entireWord,
2858
- highlightAll: findState.highlightAll,
2859
- findPrevious: cmd === 5 || cmd === 12
2860
- });
2861
- }
2862
-
2863
- handled = true;
2864
- }
2865
-
2866
- break;
2867
-
2868
- case 61:
2869
- case 107:
2870
- case 187:
2871
- case 171:
2872
- if (!isViewerInPresentationMode) {
2873
- PDFViewerApplication.zoomIn();
2874
- }
2875
-
2876
- handled = true;
2877
- break;
2878
-
2879
- case 173:
2880
- case 109:
2881
- case 189:
2882
- if (!isViewerInPresentationMode) {
2883
- PDFViewerApplication.zoomOut();
2884
- }
2885
-
2886
- handled = true;
2887
- break;
2888
-
2889
- case 48:
2890
- case 96:
2891
- if (!isViewerInPresentationMode) {
2892
- setTimeout(function () {
2893
- PDFViewerApplication.zoomReset();
2894
- });
2895
- handled = false;
2896
- }
2897
-
2898
- break;
2899
-
2900
- case 38:
2901
- if (isViewerInPresentationMode || PDFViewerApplication.page > 1) {
2902
- PDFViewerApplication.page = 1;
2903
- handled = true;
2904
- ensureViewerFocused = true;
2905
- }
2906
-
2907
- break;
2908
-
2909
- case 40:
2910
- if (isViewerInPresentationMode || PDFViewerApplication.page < PDFViewerApplication.pagesCount) {
2911
- PDFViewerApplication.page = PDFViewerApplication.pagesCount;
2912
- handled = true;
2913
- ensureViewerFocused = true;
2914
- }
2915
-
2916
- break;
2917
- }
2918
- }
2919
-
2920
- const {
2921
- eventBus
2922
- } = PDFViewerApplication;
2923
-
2924
- if (cmd === 1 || cmd === 8) {
2925
- switch (evt.keyCode) {
2926
- case 83:
2927
- eventBus.dispatch("download", {
2928
- source: window
2929
- });
2930
- handled = true;
2931
- break;
2932
-
2933
- case 79:
2934
- {
2935
- eventBus.dispatch("openfile", {
2936
- source: window
2937
- });
2938
- handled = true;
2939
- }
2940
- break;
2941
- }
2942
- }
2943
-
2944
- if (cmd === 3 || cmd === 10) {
2945
- switch (evt.keyCode) {
2946
- case 80:
2947
- PDFViewerApplication.requestPresentationMode();
2948
- handled = true;
2949
- break;
2950
-
2951
- case 71:
2952
- PDFViewerApplication.appConfig.toolbar.pageNumber.select();
2953
- handled = true;
2954
- break;
2955
- }
2956
- }
2957
-
2958
- if (handled) {
2959
- if (ensureViewerFocused && !isViewerInPresentationMode) {
2960
- pdfViewer.focus();
2961
- }
2962
-
2963
- evt.preventDefault();
2964
- return;
2965
- }
2966
-
2967
- const curElement = (0, _ui_utils.getActiveOrFocusedElement)();
2968
- const curElementTagName = curElement?.tagName.toUpperCase();
2969
-
2970
- if (curElementTagName === "INPUT" || curElementTagName === "TEXTAREA" || curElementTagName === "SELECT" || curElement?.isContentEditable) {
2971
- if (evt.keyCode !== 27) {
2972
- return;
2973
- }
2974
- }
2975
-
2976
- if (cmd === 0) {
2977
- let turnPage = 0,
2978
- turnOnlyIfPageFit = false;
2979
-
2980
- switch (evt.keyCode) {
2981
- case 38:
2982
- case 33:
2983
- if (pdfViewer.isVerticalScrollbarEnabled) {
2984
- turnOnlyIfPageFit = true;
2985
- }
2986
-
2987
- turnPage = -1;
2988
- break;
2989
-
2990
- case 8:
2991
- if (!isViewerInPresentationMode) {
2992
- turnOnlyIfPageFit = true;
2993
- }
2994
-
2995
- turnPage = -1;
2996
- break;
2997
-
2998
- case 37:
2999
- if (pdfViewer.isHorizontalScrollbarEnabled) {
3000
- turnOnlyIfPageFit = true;
3001
- }
3002
-
3003
- case 75:
3004
- case 80:
3005
- turnPage = -1;
3006
- break;
3007
-
3008
- case 27:
3009
- if (PDFViewerApplication.secondaryToolbar.isOpen) {
3010
- PDFViewerApplication.secondaryToolbar.close();
3011
- handled = true;
3012
- }
3013
-
3014
- if (!PDFViewerApplication.supportsIntegratedFind && PDFViewerApplication.findBar.opened) {
3015
- PDFViewerApplication.findBar.close();
3016
- handled = true;
3017
- }
3018
-
3019
- break;
3020
-
3021
- case 40:
3022
- case 34:
3023
- if (pdfViewer.isVerticalScrollbarEnabled) {
3024
- turnOnlyIfPageFit = true;
3025
- }
3026
-
3027
- turnPage = 1;
3028
- break;
3029
-
3030
- case 13:
3031
- case 32:
3032
- if (!isViewerInPresentationMode) {
3033
- turnOnlyIfPageFit = true;
3034
- }
3035
-
3036
- turnPage = 1;
3037
- break;
3038
-
3039
- case 39:
3040
- if (pdfViewer.isHorizontalScrollbarEnabled) {
3041
- turnOnlyIfPageFit = true;
3042
- }
3043
-
3044
- case 74:
3045
- case 78:
3046
- turnPage = 1;
3047
- break;
3048
-
3049
- case 36:
3050
- if (isViewerInPresentationMode || PDFViewerApplication.page > 1) {
3051
- PDFViewerApplication.page = 1;
3052
- handled = true;
3053
- ensureViewerFocused = true;
3054
- }
3055
-
3056
- break;
3057
-
3058
- case 35:
3059
- if (isViewerInPresentationMode || PDFViewerApplication.page < PDFViewerApplication.pagesCount) {
3060
- PDFViewerApplication.page = PDFViewerApplication.pagesCount;
3061
- handled = true;
3062
- ensureViewerFocused = true;
3063
- }
3064
-
3065
- break;
3066
-
3067
- case 83:
3068
- PDFViewerApplication.pdfCursorTools.switchTool(_pdf_cursor_tools.CursorTool.SELECT);
3069
- break;
3070
-
3071
- case 72:
3072
- PDFViewerApplication.pdfCursorTools.switchTool(_pdf_cursor_tools.CursorTool.HAND);
3073
- break;
3074
-
3075
- case 82:
3076
- PDFViewerApplication.rotatePages(90);
3077
- break;
3078
-
3079
- case 115:
3080
- PDFViewerApplication.pdfSidebar.toggle();
3081
- break;
3082
- }
3083
-
3084
- if (turnPage !== 0 && (!turnOnlyIfPageFit || pdfViewer.currentScaleValue === "page-fit")) {
3085
- if (turnPage > 0) {
3086
- pdfViewer.nextPage();
3087
- } else {
3088
- pdfViewer.previousPage();
3089
- }
3090
-
3091
- handled = true;
3092
- }
3093
- }
3094
-
3095
- if (cmd === 4) {
3096
- switch (evt.keyCode) {
3097
- case 13:
3098
- case 32:
3099
- if (!isViewerInPresentationMode && pdfViewer.currentScaleValue !== "page-fit") {
3100
- break;
3101
- }
3102
-
3103
- if (PDFViewerApplication.page > 1) {
3104
- PDFViewerApplication.page--;
3105
- }
3106
-
3107
- handled = true;
3108
- break;
3109
-
3110
- case 82:
3111
- PDFViewerApplication.rotatePages(-90);
3112
- break;
3113
- }
3114
- }
3115
-
3116
- if (!handled && !isViewerInPresentationMode) {
3117
- if (evt.keyCode >= 33 && evt.keyCode <= 40 || evt.keyCode === 32 && curElementTagName !== "BUTTON") {
3118
- ensureViewerFocused = true;
3119
- }
3120
- }
3121
-
3122
- if (ensureViewerFocused && !pdfViewer.containsElement(curElement)) {
3123
- pdfViewer.focus();
3124
- }
3125
-
3126
- if (handled) {
3127
- evt.preventDefault();
3128
- }
3129
- }
3130
-
3131
- function beforeUnload(evt) {
3132
- evt.preventDefault();
3133
- evt.returnValue = "";
3134
- return false;
3135
- }
3136
-
3137
- const PDFPrintServiceFactory = {
3138
- instance: {
3139
- supportsPrinting: false,
3140
-
3141
- createPrintService() {
3142
- throw new Error("Not implemented: createPrintService");
3143
- }
3144
-
3145
- }
3146
- };
3147
- exports.PDFPrintServiceFactory = PDFPrintServiceFactory;
3148
-
3149
- /***/ }),
3150
- /* 4 */
3151
- /***/ ((__unused_webpack_module, exports) => {
3152
-
3153
-
3154
-
3155
- Object.defineProperty(exports, "__esModule", ({
3156
- value: true
3157
- }));
3158
- exports.apiPageLayoutToSpreadMode = apiPageLayoutToSpreadMode;
3159
- exports.apiPageModeToSidebarView = apiPageModeToSidebarView;
3160
- exports.approximateFraction = approximateFraction;
3161
- exports.backtrackBeforeAllVisibleElements = backtrackBeforeAllVisibleElements;
3162
- exports.binarySearchFirstItem = binarySearchFirstItem;
3163
- exports.getActiveOrFocusedElement = getActiveOrFocusedElement;
3164
- exports.getOutputScale = getOutputScale;
3165
- exports.getPageSizeInches = getPageSizeInches;
3166
- exports.getVisibleElements = getVisibleElements;
3167
- exports.isPortraitOrientation = isPortraitOrientation;
3168
- exports.isValidRotation = isValidRotation;
3169
- exports.isValidScrollMode = isValidScrollMode;
3170
- exports.isValidSpreadMode = isValidSpreadMode;
3171
- exports.moveToEndOfArray = moveToEndOfArray;
3172
- exports.noContextMenuHandler = noContextMenuHandler;
3173
- exports.normalizeWheelEventDelta = normalizeWheelEventDelta;
3174
- exports.normalizeWheelEventDirection = normalizeWheelEventDirection;
3175
- exports.parseQueryString = parseQueryString;
3176
- exports.roundToDivide = roundToDivide;
3177
- exports.scrollIntoView = scrollIntoView;
3178
- exports.waitOnEventOrTimeout = waitOnEventOrTimeout;
3179
- exports.watchScroll = watchScroll;
3180
- exports.WaitOnType = exports.VERTICAL_PADDING = exports.UNKNOWN_SCALE = exports.TextLayerMode = exports.SpreadMode = exports.SidebarView = exports.ScrollMode = exports.SCROLLBAR_PADDING = exports.RendererType = exports.ProgressBar = exports.PresentationModeState = exports.MIN_SCALE = exports.MAX_SCALE = exports.MAX_AUTO_SCALE = exports.EventBus = exports.DEFAULT_SCALE_VALUE = exports.DEFAULT_SCALE = exports.CSS_UNITS = exports.AutoPrintRegExp = exports.animationStarted = void 0;
3181
- const CSS_UNITS = 96.0 / 72.0;
3182
- exports.CSS_UNITS = CSS_UNITS;
3183
- const DEFAULT_SCALE_VALUE = "auto";
3184
- exports.DEFAULT_SCALE_VALUE = DEFAULT_SCALE_VALUE;
3185
- const DEFAULT_SCALE = 1.0;
3186
- exports.DEFAULT_SCALE = DEFAULT_SCALE;
3187
- const MIN_SCALE = 0.1;
3188
- exports.MIN_SCALE = MIN_SCALE;
3189
- const MAX_SCALE = 10.0;
3190
- exports.MAX_SCALE = MAX_SCALE;
3191
- const UNKNOWN_SCALE = 0;
3192
- exports.UNKNOWN_SCALE = UNKNOWN_SCALE;
3193
- const MAX_AUTO_SCALE = 1.25;
3194
- exports.MAX_AUTO_SCALE = MAX_AUTO_SCALE;
3195
- const SCROLLBAR_PADDING = 40;
3196
- exports.SCROLLBAR_PADDING = SCROLLBAR_PADDING;
3197
- const VERTICAL_PADDING = 5;
3198
- exports.VERTICAL_PADDING = VERTICAL_PADDING;
3199
- const LOADINGBAR_END_OFFSET_VAR = "--loadingBar-end-offset";
3200
- const PresentationModeState = {
3201
- UNKNOWN: 0,
3202
- NORMAL: 1,
3203
- CHANGING: 2,
3204
- FULLSCREEN: 3
3205
- };
3206
- exports.PresentationModeState = PresentationModeState;
3207
- const SidebarView = {
3208
- UNKNOWN: -1,
3209
- NONE: 0,
3210
- THUMBS: 1,
3211
- OUTLINE: 2,
3212
- ATTACHMENTS: 3,
3213
- LAYERS: 4
3214
- };
3215
- exports.SidebarView = SidebarView;
3216
- const RendererType = {
3217
- CANVAS: "canvas",
3218
- SVG: "svg"
3219
- };
3220
- exports.RendererType = RendererType;
3221
- const TextLayerMode = {
3222
- DISABLE: 0,
3223
- ENABLE: 1,
3224
- ENABLE_ENHANCE: 2
3225
- };
3226
- exports.TextLayerMode = TextLayerMode;
3227
- const ScrollMode = {
3228
- UNKNOWN: -1,
3229
- VERTICAL: 0,
3230
- HORIZONTAL: 1,
3231
- WRAPPED: 2
3232
- };
3233
- exports.ScrollMode = ScrollMode;
3234
- const SpreadMode = {
3235
- UNKNOWN: -1,
3236
- NONE: 0,
3237
- ODD: 1,
3238
- EVEN: 2
3239
- };
3240
- exports.SpreadMode = SpreadMode;
3241
- const AutoPrintRegExp = /\bprint\s*\(/;
3242
- exports.AutoPrintRegExp = AutoPrintRegExp;
3243
-
3244
- function getOutputScale(ctx) {
3245
- const devicePixelRatio = window.devicePixelRatio || 1;
3246
- const backingStoreRatio = ctx.webkitBackingStorePixelRatio || ctx.mozBackingStorePixelRatio || ctx.backingStorePixelRatio || 1;
3247
- const pixelRatio = devicePixelRatio / backingStoreRatio;
3248
- return {
3249
- sx: pixelRatio,
3250
- sy: pixelRatio,
3251
- scaled: pixelRatio !== 1
3252
- };
3253
- }
3254
-
3255
- function scrollIntoView(element, spot, scrollMatches = false) {
3256
- let parent = element.offsetParent;
3257
-
3258
- if (!parent) {
3259
- console.error("offsetParent is not set -- cannot scroll");
3260
- return;
3261
- }
3262
-
3263
- let offsetY = element.offsetTop + element.clientTop;
3264
- let offsetX = element.offsetLeft + element.clientLeft;
3265
-
3266
- while (parent.clientHeight === parent.scrollHeight && parent.clientWidth === parent.scrollWidth || scrollMatches && (parent.classList.contains("markedContent") || getComputedStyle(parent).overflow === "hidden")) {
3267
- offsetY += parent.offsetTop;
3268
- offsetX += parent.offsetLeft;
3269
- parent = parent.offsetParent;
3270
-
3271
- if (!parent) {
3272
- return;
3273
- }
3274
- }
3275
-
3276
- if (spot) {
3277
- if (spot.top !== undefined) {
3278
- offsetY += spot.top;
3279
- }
3280
-
3281
- if (spot.left !== undefined) {
3282
- offsetX += spot.left;
3283
- parent.scrollLeft = offsetX;
3284
- }
3285
- }
3286
-
3287
- parent.scrollTop = offsetY;
3288
- }
3289
-
3290
- function watchScroll(viewAreaElement, callback) {
3291
- const debounceScroll = function (evt) {
3292
- if (rAF) {
3293
- return;
3294
- }
3295
-
3296
- rAF = window.requestAnimationFrame(function viewAreaElementScrolled() {
3297
- rAF = null;
3298
- const currentX = viewAreaElement.scrollLeft;
3299
- const lastX = state.lastX;
3300
-
3301
- if (currentX !== lastX) {
3302
- state.right = currentX > lastX;
3303
- }
3304
-
3305
- state.lastX = currentX;
3306
- const currentY = viewAreaElement.scrollTop;
3307
- const lastY = state.lastY;
3308
-
3309
- if (currentY !== lastY) {
3310
- state.down = currentY > lastY;
3311
- }
3312
-
3313
- state.lastY = currentY;
3314
- callback(state);
3315
- });
3316
- };
3317
-
3318
- const state = {
3319
- right: true,
3320
- down: true,
3321
- lastX: viewAreaElement.scrollLeft,
3322
- lastY: viewAreaElement.scrollTop,
3323
- _eventHandler: debounceScroll
3324
- };
3325
- let rAF = null;
3326
- viewAreaElement.addEventListener("scroll", debounceScroll, true);
3327
- return state;
3328
- }
3329
-
3330
- function parseQueryString(query) {
3331
- const parts = query.split("&");
3332
- const params = Object.create(null);
3333
-
3334
- for (let i = 0, ii = parts.length; i < ii; ++i) {
3335
- const param = parts[i].split("=");
3336
- const key = param[0].toLowerCase();
3337
- const value = param.length > 1 ? param[1] : null;
3338
- params[decodeURIComponent(key)] = decodeURIComponent(value);
3339
- }
3340
-
3341
- return params;
3342
- }
3343
-
3344
- function binarySearchFirstItem(items, condition) {
3345
- let minIndex = 0;
3346
- let maxIndex = items.length - 1;
3347
-
3348
- if (maxIndex < 0 || !condition(items[maxIndex])) {
3349
- return items.length;
3350
- }
3351
-
3352
- if (condition(items[minIndex])) {
3353
- return minIndex;
3354
- }
3355
-
3356
- while (minIndex < maxIndex) {
3357
- const currentIndex = minIndex + maxIndex >> 1;
3358
- const currentItem = items[currentIndex];
3359
-
3360
- if (condition(currentItem)) {
3361
- maxIndex = currentIndex;
3362
- } else {
3363
- minIndex = currentIndex + 1;
3364
- }
3365
- }
3366
-
3367
- return minIndex;
3368
- }
3369
-
3370
- function approximateFraction(x) {
3371
- if (Math.floor(x) === x) {
3372
- return [x, 1];
3373
- }
3374
-
3375
- const xinv = 1 / x;
3376
- const limit = 8;
3377
-
3378
- if (xinv > limit) {
3379
- return [1, limit];
3380
- } else if (Math.floor(xinv) === xinv) {
3381
- return [1, xinv];
3382
- }
3383
-
3384
- const x_ = x > 1 ? xinv : x;
3385
- let a = 0,
3386
- b = 1,
3387
- c = 1,
3388
- d = 1;
3389
-
3390
- while (true) {
3391
- const p = a + c,
3392
- q = b + d;
3393
-
3394
- if (q > limit) {
3395
- break;
3396
- }
3397
-
3398
- if (x_ <= p / q) {
3399
- c = p;
3400
- d = q;
3401
- } else {
3402
- a = p;
3403
- b = q;
3404
- }
3405
- }
3406
-
3407
- let result;
3408
-
3409
- if (x_ - a / b < c / d - x_) {
3410
- result = x_ === x ? [a, b] : [b, a];
3411
- } else {
3412
- result = x_ === x ? [c, d] : [d, c];
3413
- }
3414
-
3415
- return result;
3416
- }
3417
-
3418
- function roundToDivide(x, div) {
3419
- const r = x % div;
3420
- return r === 0 ? x : Math.round(x - r + div);
3421
- }
3422
-
3423
- function getPageSizeInches({
3424
- view,
3425
- userUnit,
3426
- rotate
3427
- }) {
3428
- const [x1, y1, x2, y2] = view;
3429
- const changeOrientation = rotate % 180 !== 0;
3430
- const width = (x2 - x1) / 72 * userUnit;
3431
- const height = (y2 - y1) / 72 * userUnit;
3432
- return {
3433
- width: changeOrientation ? height : width,
3434
- height: changeOrientation ? width : height
3435
- };
3436
- }
3437
-
3438
- function backtrackBeforeAllVisibleElements(index, views, top) {
3439
- if (index < 2) {
3440
- return index;
3441
- }
3442
-
3443
- let elt = views[index].div;
3444
- let pageTop = elt.offsetTop + elt.clientTop;
3445
-
3446
- if (pageTop >= top) {
3447
- elt = views[index - 1].div;
3448
- pageTop = elt.offsetTop + elt.clientTop;
3449
- }
3450
-
3451
- for (let i = index - 2; i >= 0; --i) {
3452
- elt = views[i].div;
3453
-
3454
- if (elt.offsetTop + elt.clientTop + elt.clientHeight <= pageTop) {
3455
- break;
3456
- }
3457
-
3458
- index = i;
3459
- }
3460
-
3461
- return index;
3462
- }
3463
-
3464
- function getVisibleElements({
3465
- scrollEl,
3466
- views,
3467
- sortByVisibility = false,
3468
- horizontal = false,
3469
- rtl = false
3470
- }) {
3471
- const top = scrollEl.scrollTop,
3472
- bottom = top + scrollEl.clientHeight;
3473
- const left = scrollEl.scrollLeft,
3474
- right = left + scrollEl.clientWidth;
3475
-
3476
- function isElementBottomAfterViewTop(view) {
3477
- const element = view.div;
3478
- const elementBottom = element.offsetTop + element.clientTop + element.clientHeight;
3479
- return elementBottom > top;
3480
- }
3481
-
3482
- function isElementNextAfterViewHorizontally(view) {
3483
- const element = view.div;
3484
- const elementLeft = element.offsetLeft + element.clientLeft;
3485
- const elementRight = elementLeft + element.clientWidth;
3486
- return rtl ? elementLeft < right : elementRight > left;
3487
- }
3488
-
3489
- const visible = [],
3490
- numViews = views.length;
3491
- let firstVisibleElementInd = binarySearchFirstItem(views, horizontal ? isElementNextAfterViewHorizontally : isElementBottomAfterViewTop);
3492
-
3493
- if (firstVisibleElementInd > 0 && firstVisibleElementInd < numViews && !horizontal) {
3494
- firstVisibleElementInd = backtrackBeforeAllVisibleElements(firstVisibleElementInd, views, top);
3495
- }
3496
-
3497
- let lastEdge = horizontal ? right : -1;
3498
-
3499
- for (let i = firstVisibleElementInd; i < numViews; i++) {
3500
- const view = views[i],
3501
- element = view.div;
3502
- const currentWidth = element.offsetLeft + element.clientLeft;
3503
- const currentHeight = element.offsetTop + element.clientTop;
3504
- const viewWidth = element.clientWidth,
3505
- viewHeight = element.clientHeight;
3506
- const viewRight = currentWidth + viewWidth;
3507
- const viewBottom = currentHeight + viewHeight;
3508
-
3509
- if (lastEdge === -1) {
3510
- if (viewBottom >= bottom) {
3511
- lastEdge = viewBottom;
3512
- }
3513
- } else if ((horizontal ? currentWidth : currentHeight) > lastEdge) {
3514
- break;
3515
- }
3516
-
3517
- if (viewBottom <= top || currentHeight >= bottom || viewRight <= left || currentWidth >= right) {
3518
- continue;
3519
- }
3520
-
3521
- const hiddenHeight = Math.max(0, top - currentHeight) + Math.max(0, viewBottom - bottom);
3522
- const hiddenWidth = Math.max(0, left - currentWidth) + Math.max(0, viewRight - right);
3523
- const fractionHeight = (viewHeight - hiddenHeight) / viewHeight,
3524
- fractionWidth = (viewWidth - hiddenWidth) / viewWidth;
3525
- const percent = fractionHeight * fractionWidth * 100 | 0;
3526
- visible.push({
3527
- id: view.id,
3528
- x: currentWidth,
3529
- y: currentHeight,
3530
- view,
3531
- percent,
3532
- widthPercent: fractionWidth * 100 | 0
3533
- });
3534
- }
3535
-
3536
- const first = visible[0],
3537
- last = visible[visible.length - 1];
3538
-
3539
- if (sortByVisibility) {
3540
- visible.sort(function (a, b) {
3541
- const pc = a.percent - b.percent;
3542
-
3543
- if (Math.abs(pc) > 0.001) {
3544
- return -pc;
3545
- }
3546
-
3547
- return a.id - b.id;
3548
- });
3549
- }
3550
-
3551
- return {
3552
- first,
3553
- last,
3554
- views: visible
3555
- };
3556
- }
3557
-
3558
- function noContextMenuHandler(evt) {
3559
- evt.preventDefault();
3560
- }
3561
-
3562
- function normalizeWheelEventDirection(evt) {
3563
- let delta = Math.hypot(evt.deltaX, evt.deltaY);
3564
- const angle = Math.atan2(evt.deltaY, evt.deltaX);
3565
-
3566
- if (-0.25 * Math.PI < angle && angle < 0.75 * Math.PI) {
3567
- delta = -delta;
3568
- }
3569
-
3570
- return delta;
3571
- }
3572
-
3573
- function normalizeWheelEventDelta(evt) {
3574
- let delta = normalizeWheelEventDirection(evt);
3575
- const MOUSE_DOM_DELTA_PIXEL_MODE = 0;
3576
- const MOUSE_DOM_DELTA_LINE_MODE = 1;
3577
- const MOUSE_PIXELS_PER_LINE = 30;
3578
- const MOUSE_LINES_PER_PAGE = 30;
3579
-
3580
- if (evt.deltaMode === MOUSE_DOM_DELTA_PIXEL_MODE) {
3581
- delta /= MOUSE_PIXELS_PER_LINE * MOUSE_LINES_PER_PAGE;
3582
- } else if (evt.deltaMode === MOUSE_DOM_DELTA_LINE_MODE) {
3583
- delta /= MOUSE_LINES_PER_PAGE;
3584
- }
3585
-
3586
- return delta;
3587
- }
3588
-
3589
- function isValidRotation(angle) {
3590
- return Number.isInteger(angle) && angle % 90 === 0;
3591
- }
3592
-
3593
- function isValidScrollMode(mode) {
3594
- return Number.isInteger(mode) && Object.values(ScrollMode).includes(mode) && mode !== ScrollMode.UNKNOWN;
3595
- }
3596
-
3597
- function isValidSpreadMode(mode) {
3598
- return Number.isInteger(mode) && Object.values(SpreadMode).includes(mode) && mode !== SpreadMode.UNKNOWN;
3599
- }
3600
-
3601
- function isPortraitOrientation(size) {
3602
- return size.width <= size.height;
3603
- }
3604
-
3605
- const WaitOnType = {
3606
- EVENT: "event",
3607
- TIMEOUT: "timeout"
3608
- };
3609
- exports.WaitOnType = WaitOnType;
3610
-
3611
- function waitOnEventOrTimeout({
3612
- target,
3613
- name,
3614
- delay = 0
3615
- }) {
3616
- return new Promise(function (resolve, reject) {
3617
- if (typeof target !== "object" || !(name && typeof name === "string") || !(Number.isInteger(delay) && delay >= 0)) {
3618
- throw new Error("waitOnEventOrTimeout - invalid parameters.");
3619
- }
3620
-
3621
- function handler(type) {
3622
- if (target instanceof EventBus) {
3623
- target._off(name, eventHandler);
3624
- } else {
3625
- target.removeEventListener(name, eventHandler);
3626
- }
3627
-
3628
- if (timeout) {
3629
- clearTimeout(timeout);
3630
- }
3631
-
3632
- resolve(type);
3633
- }
3634
-
3635
- const eventHandler = handler.bind(null, WaitOnType.EVENT);
3636
-
3637
- if (target instanceof EventBus) {
3638
- target._on(name, eventHandler);
3639
- } else {
3640
- target.addEventListener(name, eventHandler);
3641
- }
3642
-
3643
- const timeoutHandler = handler.bind(null, WaitOnType.TIMEOUT);
3644
- const timeout = setTimeout(timeoutHandler, delay);
3645
- });
3646
- }
3647
-
3648
- const animationStarted = new Promise(function (resolve) {
3649
- window.requestAnimationFrame(resolve);
3650
- });
3651
- exports.animationStarted = animationStarted;
3652
-
3653
- function dispatchDOMEvent(eventName, args = null) {
3654
- throw new Error("Not implemented: dispatchDOMEvent");
3655
- }
3656
-
3657
- class EventBus {
3658
- constructor(options) {
3659
- this._listeners = Object.create(null);
3660
- }
3661
-
3662
- on(eventName, listener, options = null) {
3663
- this._on(eventName, listener, {
3664
- external: true,
3665
- once: options?.once
3666
- });
3667
- }
3668
-
3669
- off(eventName, listener, options = null) {
3670
- this._off(eventName, listener, {
3671
- external: true,
3672
- once: options?.once
3673
- });
3674
- }
3675
-
3676
- dispatch(eventName) {
3677
- const eventListeners = this._listeners[eventName];
3678
-
3679
- if (!eventListeners || eventListeners.length === 0) {
3680
- return;
3681
- }
3682
-
3683
- const args = Array.prototype.slice.call(arguments, 1);
3684
- let externalListeners;
3685
-
3686
- for (const {
3687
- listener,
3688
- external,
3689
- once
3690
- } of eventListeners.slice(0)) {
3691
- if (once) {
3692
- this._off(eventName, listener);
3693
- }
3694
-
3695
- if (external) {
3696
- (externalListeners || (externalListeners = [])).push(listener);
3697
- continue;
3698
- }
3699
-
3700
- listener.apply(null, args);
3701
- }
3702
-
3703
- if (externalListeners) {
3704
- for (const listener of externalListeners) {
3705
- listener.apply(null, args);
3706
- }
3707
-
3708
- externalListeners = null;
3709
- }
3710
- }
3711
-
3712
- _on(eventName, listener, options = null) {
3713
- var _this$_listeners;
3714
-
3715
- const eventListeners = (_this$_listeners = this._listeners)[eventName] || (_this$_listeners[eventName] = []);
3716
- eventListeners.push({
3717
- listener,
3718
- external: options?.external === true,
3719
- once: options?.once === true
3720
- });
3721
- }
3722
-
3723
- _off(eventName, listener, options = null) {
3724
- const eventListeners = this._listeners[eventName];
3725
-
3726
- if (!eventListeners) {
3727
- return;
3728
- }
3729
-
3730
- for (let i = 0, ii = eventListeners.length; i < ii; i++) {
3731
- if (eventListeners[i].listener === listener) {
3732
- eventListeners.splice(i, 1);
3733
- return;
3734
- }
3735
- }
3736
- }
3737
-
3738
- }
3739
-
3740
- exports.EventBus = EventBus;
3741
-
3742
- function clamp(v, min, max) {
3743
- return Math.min(Math.max(v, min), max);
3744
- }
3745
-
3746
- class ProgressBar {
3747
- constructor(id, {
3748
- height,
3749
- width,
3750
- units
3751
- } = {}) {
3752
- this.visible = true;
3753
- this.div = document.querySelector(id + " .progress");
3754
- this.bar = this.div.parentNode;
3755
- this.height = height || 100;
3756
- this.width = width || 100;
3757
- this.units = units || "%";
3758
- this.div.style.height = this.height + this.units;
3759
- this.percent = 0;
3760
- }
3761
-
3762
- _updateBar() {
3763
- if (this._indeterminate) {
3764
- this.div.classList.add("indeterminate");
3765
- this.div.style.width = this.width + this.units;
3766
- return;
3767
- }
3768
-
3769
- this.div.classList.remove("indeterminate");
3770
- const progressSize = this.width * this._percent / 100;
3771
- this.div.style.width = progressSize + this.units;
3772
- }
3773
-
3774
- get percent() {
3775
- return this._percent;
3776
- }
3777
-
3778
- set percent(val) {
3779
- this._indeterminate = isNaN(val);
3780
- this._percent = clamp(val, 0, 100);
3781
-
3782
- this._updateBar();
3783
- }
3784
-
3785
- setWidth(viewer) {
3786
- if (!viewer) {
3787
- return;
3788
- }
3789
-
3790
- const container = viewer.parentNode;
3791
- const scrollbarWidth = container.offsetWidth - viewer.offsetWidth;
3792
-
3793
- if (scrollbarWidth > 0) {
3794
- const doc = document.documentElement;
3795
- doc.style.setProperty(LOADINGBAR_END_OFFSET_VAR, `${scrollbarWidth}px`);
3796
- }
3797
- }
3798
-
3799
- hide() {
3800
- if (!this.visible) {
3801
- return;
3802
- }
3803
-
3804
- this.visible = false;
3805
- this.bar.classList.add("hidden");
3806
- }
3807
-
3808
- show() {
3809
- if (this.visible) {
3810
- return;
3811
- }
3812
-
3813
- this.visible = true;
3814
- this.bar.classList.remove("hidden");
3815
- }
3816
-
3817
- }
3818
-
3819
- exports.ProgressBar = ProgressBar;
3820
-
3821
- function moveToEndOfArray(arr, condition) {
3822
- const moved = [],
3823
- len = arr.length;
3824
- let write = 0;
3825
-
3826
- for (let read = 0; read < len; ++read) {
3827
- if (condition(arr[read])) {
3828
- moved.push(arr[read]);
3829
- } else {
3830
- arr[write] = arr[read];
3831
- ++write;
3832
- }
3833
- }
3834
-
3835
- for (let read = 0; write < len; ++read, ++write) {
3836
- arr[write] = moved[read];
3837
- }
3838
- }
3839
-
3840
- function getActiveOrFocusedElement() {
3841
- let curRoot = document;
3842
- let curActiveOrFocused = curRoot.activeElement || curRoot.querySelector(":focus");
3843
-
3844
- while (curActiveOrFocused?.shadowRoot) {
3845
- curRoot = curActiveOrFocused.shadowRoot;
3846
- curActiveOrFocused = curRoot.activeElement || curRoot.querySelector(":focus");
3847
- }
3848
-
3849
- return curActiveOrFocused;
3850
- }
3851
-
3852
- function apiPageLayoutToSpreadMode(layout) {
3853
- switch (layout) {
3854
- case "SinglePage":
3855
- case "OneColumn":
3856
- return SpreadMode.NONE;
3857
-
3858
- case "TwoColumnLeft":
3859
- case "TwoPageLeft":
3860
- return SpreadMode.ODD;
3861
-
3862
- case "TwoColumnRight":
3863
- case "TwoPageRight":
3864
- return SpreadMode.EVEN;
3865
- }
3866
-
3867
- return SpreadMode.NONE;
3868
- }
3869
-
3870
- function apiPageModeToSidebarView(mode) {
3871
- switch (mode) {
3872
- case "UseNone":
3873
- return SidebarView.NONE;
3874
-
3875
- case "UseThumbs":
3876
- return SidebarView.THUMBS;
3877
-
3878
- case "UseOutlines":
3879
- return SidebarView.OUTLINE;
3880
-
3881
- case "UseAttachments":
3882
- return SidebarView.ATTACHMENTS;
3883
-
3884
- case "UseOC":
3885
- return SidebarView.LAYERS;
3886
- }
3887
-
3888
- return SidebarView.NONE;
3889
- }
3890
-
3891
- /***/ }),
3892
- /* 5 */
3893
- /***/ ((module) => {
3894
-
3895
-
3896
-
3897
- let pdfjsLib;
3898
-
3899
- if (typeof window !== "undefined" && window["pdfjs-dist/build/pdf"]) {
3900
- pdfjsLib = window["pdfjs-dist/build/pdf"];
3901
- } else {
3902
- pdfjsLib = require("../build/pdf.js");
3903
- }
3904
-
3905
- module.exports = pdfjsLib;
3906
-
3907
- /***/ }),
3908
- /* 6 */
3909
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
3910
-
3911
-
3912
-
3913
- Object.defineProperty(exports, "__esModule", ({
3914
- value: true
3915
- }));
3916
- exports.PDFCursorTools = exports.CursorTool = void 0;
3917
-
3918
- var _grab_to_pan = __webpack_require__(7);
3919
-
3920
- var _ui_utils = __webpack_require__(4);
3921
-
3922
- const CursorTool = {
3923
- SELECT: 0,
3924
- HAND: 1,
3925
- ZOOM: 2
3926
- };
3927
- exports.CursorTool = CursorTool;
3928
-
3929
- class PDFCursorTools {
3930
- constructor({
3931
- container,
3932
- eventBus,
3933
- cursorToolOnLoad = CursorTool.SELECT
3934
- }) {
3935
- this.container = container;
3936
- this.eventBus = eventBus;
3937
- this.active = CursorTool.SELECT;
3938
- this.activeBeforePresentationMode = null;
3939
- this.handTool = new _grab_to_pan.GrabToPan({
3940
- element: this.container
3941
- });
3942
-
3943
- this._addEventListeners();
3944
-
3945
- Promise.resolve().then(() => {
3946
- this.switchTool(cursorToolOnLoad);
3947
- });
3948
- }
3949
-
3950
- get activeTool() {
3951
- return this.active;
3952
- }
3953
-
3954
- switchTool(tool) {
3955
- if (this.activeBeforePresentationMode !== null) {
3956
- return;
3957
- }
3958
-
3959
- if (tool === this.active) {
3960
- return;
3961
- }
3962
-
3963
- const disableActiveTool = () => {
3964
- switch (this.active) {
3965
- case CursorTool.SELECT:
3966
- break;
3967
-
3968
- case CursorTool.HAND:
3969
- this.handTool.deactivate();
3970
- break;
3971
-
3972
- case CursorTool.ZOOM:
3973
- }
3974
- };
3975
-
3976
- switch (tool) {
3977
- case CursorTool.SELECT:
3978
- disableActiveTool();
3979
- break;
3980
-
3981
- case CursorTool.HAND:
3982
- disableActiveTool();
3983
- this.handTool.activate();
3984
- break;
3985
-
3986
- case CursorTool.ZOOM:
3987
- default:
3988
- console.error(`switchTool: "${tool}" is an unsupported value.`);
3989
- return;
3990
- }
3991
-
3992
- this.active = tool;
3993
-
3994
- this._dispatchEvent();
3995
- }
3996
-
3997
- _dispatchEvent() {
3998
- this.eventBus.dispatch("cursortoolchanged", {
3999
- source: this,
4000
- tool: this.active
4001
- });
4002
- }
4003
-
4004
- _addEventListeners() {
4005
- this.eventBus._on("switchcursortool", evt => {
4006
- this.switchTool(evt.tool);
4007
- });
4008
-
4009
- this.eventBus._on("presentationmodechanged", evt => {
4010
- switch (evt.state) {
4011
- case _ui_utils.PresentationModeState.FULLSCREEN:
4012
- {
4013
- const previouslyActive = this.active;
4014
- this.switchTool(CursorTool.SELECT);
4015
- this.activeBeforePresentationMode = previouslyActive;
4016
- break;
4017
- }
4018
-
4019
- case _ui_utils.PresentationModeState.NORMAL:
4020
- {
4021
- const previouslyActive = this.activeBeforePresentationMode;
4022
- this.activeBeforePresentationMode = null;
4023
- this.switchTool(previouslyActive);
4024
- break;
4025
- }
4026
- }
4027
- });
4028
- }
4029
-
4030
- }
4031
-
4032
- exports.PDFCursorTools = PDFCursorTools;
4033
-
4034
- /***/ }),
4035
- /* 7 */
4036
- /***/ ((__unused_webpack_module, exports) => {
4037
-
4038
-
4039
-
4040
- Object.defineProperty(exports, "__esModule", ({
4041
- value: true
4042
- }));
4043
- exports.GrabToPan = GrabToPan;
4044
-
4045
- function GrabToPan(options) {
4046
- this.element = options.element;
4047
- this.document = options.element.ownerDocument;
4048
-
4049
- if (typeof options.ignoreTarget === "function") {
4050
- this.ignoreTarget = options.ignoreTarget;
4051
- }
4052
-
4053
- this.onActiveChanged = options.onActiveChanged;
4054
- this.activate = this.activate.bind(this);
4055
- this.deactivate = this.deactivate.bind(this);
4056
- this.toggle = this.toggle.bind(this);
4057
- this._onmousedown = this._onmousedown.bind(this);
4058
- this._onmousemove = this._onmousemove.bind(this);
4059
- this._endPan = this._endPan.bind(this);
4060
- const overlay = this.overlay = document.createElement("div");
4061
- overlay.className = "grab-to-pan-grabbing";
4062
- }
4063
-
4064
- GrabToPan.prototype = {
4065
- CSS_CLASS_GRAB: "grab-to-pan-grab",
4066
- activate: function GrabToPan_activate() {
4067
- if (!this.active) {
4068
- this.active = true;
4069
- this.element.addEventListener("mousedown", this._onmousedown, true);
4070
- this.element.classList.add(this.CSS_CLASS_GRAB);
4071
-
4072
- if (this.onActiveChanged) {
4073
- this.onActiveChanged(true);
4074
- }
4075
- }
4076
- },
4077
- deactivate: function GrabToPan_deactivate() {
4078
- if (this.active) {
4079
- this.active = false;
4080
- this.element.removeEventListener("mousedown", this._onmousedown, true);
4081
-
4082
- this._endPan();
4083
-
4084
- this.element.classList.remove(this.CSS_CLASS_GRAB);
4085
-
4086
- if (this.onActiveChanged) {
4087
- this.onActiveChanged(false);
4088
- }
4089
- }
4090
- },
4091
- toggle: function GrabToPan_toggle() {
4092
- if (this.active) {
4093
- this.deactivate();
4094
- } else {
4095
- this.activate();
4096
- }
4097
- },
4098
- ignoreTarget: function GrabToPan_ignoreTarget(node) {
4099
- return node.matches("a[href], a[href] *, input, textarea, button, button *, select, option");
4100
- },
4101
- _onmousedown: function GrabToPan__onmousedown(event) {
4102
- if (event.button !== 0 || this.ignoreTarget(event.target)) {
4103
- return;
4104
- }
4105
-
4106
- if (event.originalTarget) {
4107
- try {
4108
- event.originalTarget.tagName;
4109
- } catch (e) {
4110
- return;
4111
- }
4112
- }
4113
-
4114
- this.scrollLeftStart = this.element.scrollLeft;
4115
- this.scrollTopStart = this.element.scrollTop;
4116
- this.clientXStart = event.clientX;
4117
- this.clientYStart = event.clientY;
4118
- this.document.addEventListener("mousemove", this._onmousemove, true);
4119
- this.document.addEventListener("mouseup", this._endPan, true);
4120
- this.element.addEventListener("scroll", this._endPan, true);
4121
- event.preventDefault();
4122
- event.stopPropagation();
4123
- const focusedElement = document.activeElement;
4124
-
4125
- if (focusedElement && !focusedElement.contains(event.target)) {
4126
- focusedElement.blur();
4127
- }
4128
- },
4129
- _onmousemove: function GrabToPan__onmousemove(event) {
4130
- this.element.removeEventListener("scroll", this._endPan, true);
4131
-
4132
- if (isLeftMouseReleased(event)) {
4133
- this._endPan();
4134
-
4135
- return;
4136
- }
4137
-
4138
- const xDiff = event.clientX - this.clientXStart;
4139
- const yDiff = event.clientY - this.clientYStart;
4140
- const scrollTop = this.scrollTopStart - yDiff;
4141
- const scrollLeft = this.scrollLeftStart - xDiff;
4142
-
4143
- if (this.element.scrollTo) {
4144
- this.element.scrollTo({
4145
- top: scrollTop,
4146
- left: scrollLeft,
4147
- behavior: "instant"
4148
- });
4149
- } else {
4150
- this.element.scrollTop = scrollTop;
4151
- this.element.scrollLeft = scrollLeft;
4152
- }
4153
-
4154
- if (!this.overlay.parentNode) {
4155
- document.body.appendChild(this.overlay);
4156
- }
4157
- },
4158
- _endPan: function GrabToPan__endPan() {
4159
- this.element.removeEventListener("scroll", this._endPan, true);
4160
- this.document.removeEventListener("mousemove", this._onmousemove, true);
4161
- this.document.removeEventListener("mouseup", this._endPan, true);
4162
- this.overlay.remove();
4163
- }
4164
- };
4165
-
4166
- function isLeftMouseReleased(event) {
4167
- if ("buttons" in event) {
4168
- return !(event.buttons & 1);
4169
- }
4170
-
4171
- const chrome = window.chrome;
4172
- const isChrome15OrOpera15plus = chrome && (chrome.webstore || chrome.app);
4173
- const isSafari6plus = /Apple/.test(navigator.vendor) && /Version\/([6-9]\d*|[1-5]\d+)/.test(navigator.userAgent);
4174
-
4175
- if (isChrome15OrOpera15plus || isSafari6plus) {
4176
- return event.which === 0;
4177
- }
4178
-
4179
- return false;
4180
- }
4181
-
4182
- /***/ }),
4183
- /* 8 */
4184
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4185
-
4186
-
4187
-
4188
- Object.defineProperty(exports, "__esModule", ({
4189
- value: true
4190
- }));
4191
- exports.RenderingStates = exports.PDFRenderingQueue = void 0;
4192
-
4193
- var _pdfjsLib = __webpack_require__(5);
4194
-
4195
- const CLEANUP_TIMEOUT = 30000;
4196
- const RenderingStates = {
4197
- INITIAL: 0,
4198
- RUNNING: 1,
4199
- PAUSED: 2,
4200
- FINISHED: 3
4201
- };
4202
- exports.RenderingStates = RenderingStates;
4203
-
4204
- class PDFRenderingQueue {
4205
- constructor() {
4206
- this.pdfViewer = null;
4207
- this.pdfThumbnailViewer = null;
4208
- this.onIdle = null;
4209
- this.highestPriorityPage = null;
4210
- this.idleTimeout = null;
4211
- this.printing = false;
4212
- this.isThumbnailViewEnabled = false;
4213
- }
4214
-
4215
- setViewer(pdfViewer) {
4216
- this.pdfViewer = pdfViewer;
4217
- }
4218
-
4219
- setThumbnailViewer(pdfThumbnailViewer) {
4220
- this.pdfThumbnailViewer = pdfThumbnailViewer;
4221
- }
4222
-
4223
- isHighestPriority(view) {
4224
- return this.highestPriorityPage === view.renderingId;
4225
- }
4226
-
4227
- renderHighestPriority(currentlyVisiblePages) {
4228
- if (this.idleTimeout) {
4229
- clearTimeout(this.idleTimeout);
4230
- this.idleTimeout = null;
4231
- }
4232
-
4233
- if (this.pdfViewer.forceRendering(currentlyVisiblePages)) {
4234
- return;
4235
- }
4236
-
4237
- if (this.pdfThumbnailViewer && this.isThumbnailViewEnabled) {
4238
- if (this.pdfThumbnailViewer.forceRendering()) {
4239
- return;
4240
- }
4241
- }
4242
-
4243
- if (this.printing) {
4244
- return;
4245
- }
4246
-
4247
- if (this.onIdle) {
4248
- this.idleTimeout = setTimeout(this.onIdle.bind(this), CLEANUP_TIMEOUT);
4249
- }
4250
- }
4251
-
4252
- getHighestPriority(visible, views, scrolledDown) {
4253
- const visibleViews = visible.views;
4254
- const numVisible = visibleViews.length;
4255
-
4256
- if (numVisible === 0) {
4257
- return null;
4258
- }
4259
-
4260
- for (let i = 0; i < numVisible; ++i) {
4261
- const view = visibleViews[i].view;
4262
-
4263
- if (!this.isViewFinished(view)) {
4264
- return view;
4265
- }
4266
- }
4267
-
4268
- if (scrolledDown) {
4269
- const nextPageIndex = visible.last.id;
4270
-
4271
- if (views[nextPageIndex] && !this.isViewFinished(views[nextPageIndex])) {
4272
- return views[nextPageIndex];
4273
- }
4274
- } else {
4275
- const previousPageIndex = visible.first.id - 2;
4276
-
4277
- if (views[previousPageIndex] && !this.isViewFinished(views[previousPageIndex])) {
4278
- return views[previousPageIndex];
4279
- }
4280
- }
4281
-
4282
- return null;
4283
- }
4284
-
4285
- isViewFinished(view) {
4286
- return view.renderingState === RenderingStates.FINISHED;
4287
- }
4288
-
4289
- renderView(view) {
4290
- switch (view.renderingState) {
4291
- case RenderingStates.FINISHED:
4292
- return false;
4293
-
4294
- case RenderingStates.PAUSED:
4295
- this.highestPriorityPage = view.renderingId;
4296
- view.resume();
4297
- break;
4298
-
4299
- case RenderingStates.RUNNING:
4300
- this.highestPriorityPage = view.renderingId;
4301
- break;
4302
-
4303
- case RenderingStates.INITIAL:
4304
- this.highestPriorityPage = view.renderingId;
4305
- view.draw().finally(() => {
4306
- this.renderHighestPriority();
4307
- }).catch(reason => {
4308
- if (reason instanceof _pdfjsLib.RenderingCancelledException) {
4309
- return;
4310
- }
4311
-
4312
- console.error(`renderView: "${reason}"`);
4313
- });
4314
- break;
4315
- }
4316
-
4317
- return true;
4318
- }
4319
-
4320
- }
4321
-
4322
- exports.PDFRenderingQueue = PDFRenderingQueue;
4323
-
4324
- /***/ }),
4325
- /* 9 */
4326
- /***/ ((__unused_webpack_module, exports) => {
4327
-
4328
-
4329
-
4330
- Object.defineProperty(exports, "__esModule", ({
4331
- value: true
4332
- }));
4333
- exports.OverlayManager = void 0;
4334
-
4335
- class OverlayManager {
4336
- constructor() {
4337
- this._overlays = {};
4338
- this._active = null;
4339
- this._keyDownBound = this._keyDown.bind(this);
4340
- }
4341
-
4342
- get active() {
4343
- return this._active;
4344
- }
4345
-
4346
- async register(name, element, callerCloseMethod = null, canForceClose = false) {
4347
- let container;
4348
-
4349
- if (!name || !element || !(container = element.parentNode)) {
4350
- throw new Error("Not enough parameters.");
4351
- } else if (this._overlays[name]) {
4352
- throw new Error("The overlay is already registered.");
4353
- }
4354
-
4355
- this._overlays[name] = {
4356
- element,
4357
- container,
4358
- callerCloseMethod,
4359
- canForceClose
4360
- };
4361
- }
4362
-
4363
- async unregister(name) {
4364
- if (!this._overlays[name]) {
4365
- throw new Error("The overlay does not exist.");
4366
- } else if (this._active === name) {
4367
- throw new Error("The overlay cannot be removed while it is active.");
4368
- }
4369
-
4370
- delete this._overlays[name];
4371
- }
4372
-
4373
- async open(name) {
4374
- if (!this._overlays[name]) {
4375
- throw new Error("The overlay does not exist.");
4376
- } else if (this._active) {
4377
- if (this._overlays[name].canForceClose) {
4378
- this._closeThroughCaller();
4379
- } else if (this._active === name) {
4380
- throw new Error("The overlay is already active.");
4381
- } else {
4382
- throw new Error("Another overlay is currently active.");
4383
- }
4384
- }
4385
-
4386
- this._active = name;
4387
-
4388
- this._overlays[this._active].element.classList.remove("hidden");
4389
-
4390
- this._overlays[this._active].container.classList.remove("hidden");
4391
-
4392
- window.addEventListener("keydown", this._keyDownBound);
4393
- }
4394
-
4395
- async close(name) {
4396
- if (!this._overlays[name]) {
4397
- throw new Error("The overlay does not exist.");
4398
- } else if (!this._active) {
4399
- throw new Error("The overlay is currently not active.");
4400
- } else if (this._active !== name) {
4401
- throw new Error("Another overlay is currently active.");
4402
- }
4403
-
4404
- this._overlays[this._active].container.classList.add("hidden");
4405
-
4406
- this._overlays[this._active].element.classList.add("hidden");
4407
-
4408
- this._active = null;
4409
- window.removeEventListener("keydown", this._keyDownBound);
4410
- }
4411
-
4412
- _keyDown(evt) {
4413
- if (this._active && evt.keyCode === 27) {
4414
- this._closeThroughCaller();
4415
-
4416
- evt.preventDefault();
4417
- }
4418
- }
4419
-
4420
- _closeThroughCaller() {
4421
- if (this._overlays[this._active].callerCloseMethod) {
4422
- this._overlays[this._active].callerCloseMethod();
4423
- }
4424
-
4425
- if (this._active) {
4426
- this.close(this._active);
4427
- }
4428
- }
4429
-
4430
- }
4431
-
4432
- exports.OverlayManager = OverlayManager;
4433
-
4434
- /***/ }),
4435
- /* 10 */
4436
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4437
-
4438
-
4439
-
4440
- Object.defineProperty(exports, "__esModule", ({
4441
- value: true
4442
- }));
4443
- exports.PasswordPrompt = void 0;
4444
-
4445
- var _pdfjsLib = __webpack_require__(5);
4446
-
4447
- class PasswordPrompt {
4448
- constructor(options, overlayManager, l10n, isViewerEmbedded = false) {
4449
- this.overlayName = options.overlayName;
4450
- this.container = options.container;
4451
- this.label = options.label;
4452
- this.input = options.input;
4453
- this.submitButton = options.submitButton;
4454
- this.cancelButton = options.cancelButton;
4455
- this.overlayManager = overlayManager;
4456
- this.l10n = l10n;
4457
- this._isViewerEmbedded = isViewerEmbedded;
4458
- this.updateCallback = null;
4459
- this.reason = null;
4460
- this.submitButton.addEventListener("click", this.verify.bind(this));
4461
- this.cancelButton.addEventListener("click", this.close.bind(this));
4462
- this.input.addEventListener("keydown", e => {
4463
- if (e.keyCode === 13) {
4464
- this.verify();
4465
- }
4466
- });
4467
- this.overlayManager.register(this.overlayName, this.container, this.close.bind(this), true);
4468
- }
4469
-
4470
- async open() {
4471
- await this.overlayManager.open(this.overlayName);
4472
- const passwordIncorrect = this.reason === _pdfjsLib.PasswordResponses.INCORRECT_PASSWORD;
4473
-
4474
- if (!this._isViewerEmbedded || passwordIncorrect) {
4475
- this.input.focus();
4476
- }
4477
-
4478
- this.label.textContent = await this.l10n.get(`password_${passwordIncorrect ? "invalid" : "label"}`);
4479
- }
4480
-
4481
- close() {
4482
- this.overlayManager.close(this.overlayName).then(() => {
4483
- this.input.value = "";
4484
- });
4485
- }
4486
-
4487
- verify() {
4488
- const password = this.input.value;
4489
-
4490
- if (password?.length > 0) {
4491
- this.close();
4492
- this.updateCallback(password);
4493
- }
4494
- }
4495
-
4496
- setUpdateCallback(updateCallback, reason) {
4497
- this.updateCallback = updateCallback;
4498
- this.reason = reason;
4499
- }
4500
-
4501
- }
4502
-
4503
- exports.PasswordPrompt = PasswordPrompt;
4504
-
4505
- /***/ }),
4506
- /* 11 */
4507
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4508
-
4509
-
4510
-
4511
- Object.defineProperty(exports, "__esModule", ({
4512
- value: true
4513
- }));
4514
- exports.PDFAttachmentViewer = void 0;
4515
-
4516
- var _pdfjsLib = __webpack_require__(5);
4517
-
4518
- var _base_tree_viewer = __webpack_require__(12);
4519
-
4520
- class PDFAttachmentViewer extends _base_tree_viewer.BaseTreeViewer {
4521
- constructor(options) {
4522
- super(options);
4523
- this.downloadManager = options.downloadManager;
4524
-
4525
- this.eventBus._on("fileattachmentannotation", this._appendAttachment.bind(this));
4526
- }
4527
-
4528
- reset(keepRenderedCapability = false) {
4529
- super.reset();
4530
- this._attachments = null;
4531
-
4532
- if (!keepRenderedCapability) {
4533
- this._renderedCapability = (0, _pdfjsLib.createPromiseCapability)();
4534
- }
4535
-
4536
- if (this._pendingDispatchEvent) {
4537
- clearTimeout(this._pendingDispatchEvent);
4538
- }
4539
-
4540
- this._pendingDispatchEvent = null;
4541
- }
4542
-
4543
- _dispatchEvent(attachmentsCount) {
4544
- this._renderedCapability.resolve();
4545
-
4546
- if (this._pendingDispatchEvent) {
4547
- clearTimeout(this._pendingDispatchEvent);
4548
- this._pendingDispatchEvent = null;
4549
- }
4550
-
4551
- if (attachmentsCount === 0) {
4552
- this._pendingDispatchEvent = setTimeout(() => {
4553
- this.eventBus.dispatch("attachmentsloaded", {
4554
- source: this,
4555
- attachmentsCount: 0
4556
- });
4557
- this._pendingDispatchEvent = null;
4558
- });
4559
- return;
4560
- }
4561
-
4562
- this.eventBus.dispatch("attachmentsloaded", {
4563
- source: this,
4564
- attachmentsCount
4565
- });
4566
- }
4567
-
4568
- _bindLink(element, {
4569
- content,
4570
- filename
4571
- }) {
4572
- element.onclick = () => {
4573
- this.downloadManager.openOrDownloadData(element, content, filename);
4574
- return false;
4575
- };
4576
- }
4577
-
4578
- render({
4579
- attachments,
4580
- keepRenderedCapability = false
4581
- }) {
4582
- if (this._attachments) {
4583
- this.reset(keepRenderedCapability);
4584
- }
4585
-
4586
- this._attachments = attachments || null;
4587
-
4588
- if (!attachments) {
4589
- this._dispatchEvent(0);
4590
-
4591
- return;
4592
- }
4593
-
4594
- const names = Object.keys(attachments).sort(function (a, b) {
4595
- return a.toLowerCase().localeCompare(b.toLowerCase());
4596
- });
4597
- const fragment = document.createDocumentFragment();
4598
- let attachmentsCount = 0;
4599
-
4600
- for (const name of names) {
4601
- const item = attachments[name];
4602
- const content = item.content,
4603
- filename = (0, _pdfjsLib.getFilenameFromUrl)(item.filename);
4604
- const div = document.createElement("div");
4605
- div.className = "treeItem";
4606
- const element = document.createElement("a");
4607
-
4608
- this._bindLink(element, {
4609
- content,
4610
- filename
4611
- });
4612
-
4613
- element.textContent = this._normalizeTextContent(filename);
4614
- div.appendChild(element);
4615
- fragment.appendChild(div);
4616
- attachmentsCount++;
4617
- }
4618
-
4619
- this._finishRendering(fragment, attachmentsCount);
4620
- }
4621
-
4622
- _appendAttachment({
4623
- id,
4624
- filename,
4625
- content
4626
- }) {
4627
- const renderedPromise = this._renderedCapability.promise;
4628
- renderedPromise.then(() => {
4629
- if (renderedPromise !== this._renderedCapability.promise) {
4630
- return;
4631
- }
4632
-
4633
- let attachments = this._attachments;
4634
-
4635
- if (!attachments) {
4636
- attachments = Object.create(null);
4637
- } else {
4638
- for (const name in attachments) {
4639
- if (id === name) {
4640
- return;
4641
- }
4642
- }
4643
- }
4644
-
4645
- attachments[id] = {
4646
- filename,
4647
- content
4648
- };
4649
- this.render({
4650
- attachments,
4651
- keepRenderedCapability: true
4652
- });
4653
- });
4654
- }
4655
-
4656
- }
4657
-
4658
- exports.PDFAttachmentViewer = PDFAttachmentViewer;
4659
-
4660
- /***/ }),
4661
- /* 12 */
4662
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4663
-
4664
-
4665
-
4666
- Object.defineProperty(exports, "__esModule", ({
4667
- value: true
4668
- }));
4669
- exports.BaseTreeViewer = void 0;
4670
-
4671
- var _pdfjsLib = __webpack_require__(5);
4672
-
4673
- const TREEITEM_OFFSET_TOP = -100;
4674
- const TREEITEM_SELECTED_CLASS = "selected";
4675
-
4676
- class BaseTreeViewer {
4677
- constructor(options) {
4678
- if (this.constructor === BaseTreeViewer) {
4679
- throw new Error("Cannot initialize BaseTreeViewer.");
4680
- }
4681
-
4682
- this.container = options.container;
4683
- this.eventBus = options.eventBus;
4684
- this.reset();
4685
- }
4686
-
4687
- reset() {
4688
- this._pdfDocument = null;
4689
- this._lastToggleIsShow = true;
4690
- this._currentTreeItem = null;
4691
- this.container.textContent = "";
4692
- this.container.classList.remove("treeWithDeepNesting");
4693
- }
4694
-
4695
- _dispatchEvent(count) {
4696
- throw new Error("Not implemented: _dispatchEvent");
4697
- }
4698
-
4699
- _bindLink(element, params) {
4700
- throw new Error("Not implemented: _bindLink");
4701
- }
4702
-
4703
- _normalizeTextContent(str) {
4704
- return (0, _pdfjsLib.removeNullCharacters)(str) || "\u2013";
4705
- }
4706
-
4707
- _addToggleButton(div, hidden = false) {
4708
- const toggler = document.createElement("div");
4709
- toggler.className = "treeItemToggler";
4710
-
4711
- if (hidden) {
4712
- toggler.classList.add("treeItemsHidden");
4713
- }
4714
-
4715
- toggler.onclick = evt => {
4716
- evt.stopPropagation();
4717
- toggler.classList.toggle("treeItemsHidden");
4718
-
4719
- if (evt.shiftKey) {
4720
- const shouldShowAll = !toggler.classList.contains("treeItemsHidden");
4721
-
4722
- this._toggleTreeItem(div, shouldShowAll);
4723
- }
4724
- };
4725
-
4726
- div.insertBefore(toggler, div.firstChild);
4727
- }
4728
-
4729
- _toggleTreeItem(root, show = false) {
4730
- this._lastToggleIsShow = show;
4731
-
4732
- for (const toggler of root.querySelectorAll(".treeItemToggler")) {
4733
- toggler.classList.toggle("treeItemsHidden", !show);
4734
- }
4735
- }
4736
-
4737
- _toggleAllTreeItems() {
4738
- this._toggleTreeItem(this.container, !this._lastToggleIsShow);
4739
- }
4740
-
4741
- _finishRendering(fragment, count, hasAnyNesting = false) {
4742
- if (hasAnyNesting) {
4743
- this.container.classList.add("treeWithDeepNesting");
4744
- this._lastToggleIsShow = !fragment.querySelector(".treeItemsHidden");
4745
- }
4746
-
4747
- this.container.appendChild(fragment);
4748
-
4749
- this._dispatchEvent(count);
4750
- }
4751
-
4752
- render(params) {
4753
- throw new Error("Not implemented: render");
4754
- }
4755
-
4756
- _updateCurrentTreeItem(treeItem = null) {
4757
- if (this._currentTreeItem) {
4758
- this._currentTreeItem.classList.remove(TREEITEM_SELECTED_CLASS);
4759
-
4760
- this._currentTreeItem = null;
4761
- }
4762
-
4763
- if (treeItem) {
4764
- treeItem.classList.add(TREEITEM_SELECTED_CLASS);
4765
- this._currentTreeItem = treeItem;
4766
- }
4767
- }
4768
-
4769
- _scrollToCurrentTreeItem(treeItem) {
4770
- if (!treeItem) {
4771
- return;
4772
- }
4773
-
4774
- let currentNode = treeItem.parentNode;
4775
-
4776
- while (currentNode && currentNode !== this.container) {
4777
- if (currentNode.classList.contains("treeItem")) {
4778
- const toggler = currentNode.firstElementChild;
4779
- toggler?.classList.remove("treeItemsHidden");
4780
- }
4781
-
4782
- currentNode = currentNode.parentNode;
4783
- }
4784
-
4785
- this._updateCurrentTreeItem(treeItem);
4786
-
4787
- this.container.scrollTo(treeItem.offsetLeft, treeItem.offsetTop + TREEITEM_OFFSET_TOP);
4788
- }
4789
-
4790
- }
4791
-
4792
- exports.BaseTreeViewer = BaseTreeViewer;
4793
-
4794
- /***/ }),
4795
- /* 13 */
4796
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4797
-
4798
-
4799
-
4800
- Object.defineProperty(exports, "__esModule", ({
4801
- value: true
4802
- }));
4803
- exports.PDFDocumentProperties = void 0;
4804
-
4805
- var _pdfjsLib = __webpack_require__(5);
4806
-
4807
- var _ui_utils = __webpack_require__(4);
4808
-
4809
- const DEFAULT_FIELD_CONTENT = "-";
4810
- const NON_METRIC_LOCALES = ["en-us", "en-lr", "my"];
4811
- const US_PAGE_NAMES = {
4812
- "8.5x11": "Letter",
4813
- "8.5x14": "Legal"
4814
- };
4815
- const METRIC_PAGE_NAMES = {
4816
- "297x420": "A3",
4817
- "210x297": "A4"
4818
- };
4819
-
4820
- function getPageName(size, isPortrait, pageNames) {
4821
- const width = isPortrait ? size.width : size.height;
4822
- const height = isPortrait ? size.height : size.width;
4823
- return pageNames[`${width}x${height}`];
4824
- }
4825
-
4826
- class PDFDocumentProperties {
4827
- constructor({
4828
- overlayName,
4829
- fields,
4830
- container,
4831
- closeButton
4832
- }, overlayManager, eventBus, l10n) {
4833
- this.overlayName = overlayName;
4834
- this.fields = fields;
4835
- this.container = container;
4836
- this.overlayManager = overlayManager;
4837
- this.l10n = l10n;
4838
-
4839
- this._reset();
4840
-
4841
- closeButton.addEventListener("click", this.close.bind(this));
4842
- this.overlayManager.register(this.overlayName, this.container, this.close.bind(this));
4843
-
4844
- eventBus._on("pagechanging", evt => {
4845
- this._currentPageNumber = evt.pageNumber;
4846
- });
4847
-
4848
- eventBus._on("rotationchanging", evt => {
4849
- this._pagesRotation = evt.pagesRotation;
4850
- });
4851
-
4852
- this._isNonMetricLocale = true;
4853
- l10n.getLanguage().then(locale => {
4854
- this._isNonMetricLocale = NON_METRIC_LOCALES.includes(locale);
4855
- });
4856
- }
4857
-
4858
- async open() {
4859
- const freezeFieldData = data => {
4860
- Object.defineProperty(this, "fieldData", {
4861
- value: Object.freeze(data),
4862
- writable: false,
4863
- enumerable: true,
4864
- configurable: true
4865
- });
4866
- };
4867
-
4868
- await Promise.all([this.overlayManager.open(this.overlayName), this._dataAvailableCapability.promise]);
4869
- const currentPageNumber = this._currentPageNumber;
4870
- const pagesRotation = this._pagesRotation;
4871
-
4872
- if (this.fieldData && currentPageNumber === this.fieldData._currentPageNumber && pagesRotation === this.fieldData._pagesRotation) {
4873
- this._updateUI();
4874
-
4875
- return;
4876
- }
4877
-
4878
- const {
4879
- info,
4880
- contentDispositionFilename,
4881
- contentLength
4882
- } = await this.pdfDocument.getMetadata();
4883
- const [fileName, fileSize, creationDate, modificationDate, pageSize, isLinearized] = await Promise.all([contentDispositionFilename || (0, _pdfjsLib.getPdfFilenameFromUrl)(this.url), this._parseFileSize(contentLength), this._parseDate(info.CreationDate), this._parseDate(info.ModDate), this.pdfDocument.getPage(currentPageNumber).then(pdfPage => {
4884
- return this._parsePageSize((0, _ui_utils.getPageSizeInches)(pdfPage), pagesRotation);
4885
- }), this._parseLinearization(info.IsLinearized)]);
4886
- freezeFieldData({
4887
- fileName,
4888
- fileSize,
4889
- title: info.Title,
4890
- author: info.Author,
4891
- subject: info.Subject,
4892
- keywords: info.Keywords,
4893
- creationDate,
4894
- modificationDate,
4895
- creator: info.Creator,
4896
- producer: info.Producer,
4897
- version: info.PDFFormatVersion,
4898
- pageCount: this.pdfDocument.numPages,
4899
- pageSize,
4900
- linearized: isLinearized,
4901
- _currentPageNumber: currentPageNumber,
4902
- _pagesRotation: pagesRotation
4903
- });
4904
-
4905
- this._updateUI();
4906
-
4907
- const {
4908
- length
4909
- } = await this.pdfDocument.getDownloadInfo();
4910
-
4911
- if (contentLength === length) {
4912
- return;
4913
- }
4914
-
4915
- const data = Object.assign(Object.create(null), this.fieldData);
4916
- data.fileSize = await this._parseFileSize(length);
4917
- freezeFieldData(data);
4918
-
4919
- this._updateUI();
4920
- }
4921
-
4922
- close() {
4923
- this.overlayManager.close(this.overlayName);
4924
- }
4925
-
4926
- setDocument(pdfDocument, url = null) {
4927
- if (this.pdfDocument) {
4928
- this._reset();
4929
-
4930
- this._updateUI(true);
4931
- }
4932
-
4933
- if (!pdfDocument) {
4934
- return;
4935
- }
4936
-
4937
- this.pdfDocument = pdfDocument;
4938
- this.url = url;
4939
-
4940
- this._dataAvailableCapability.resolve();
4941
- }
4942
-
4943
- _reset() {
4944
- this.pdfDocument = null;
4945
- this.url = null;
4946
- delete this.fieldData;
4947
- this._dataAvailableCapability = (0, _pdfjsLib.createPromiseCapability)();
4948
- this._currentPageNumber = 1;
4949
- this._pagesRotation = 0;
4950
- }
4951
-
4952
- _updateUI(reset = false) {
4953
- if (reset || !this.fieldData) {
4954
- for (const id in this.fields) {
4955
- this.fields[id].textContent = DEFAULT_FIELD_CONTENT;
4956
- }
4957
-
4958
- return;
4959
- }
4960
-
4961
- if (this.overlayManager.active !== this.overlayName) {
4962
- return;
4963
- }
4964
-
4965
- for (const id in this.fields) {
4966
- const content = this.fieldData[id];
4967
- this.fields[id].textContent = content || content === 0 ? content : DEFAULT_FIELD_CONTENT;
4968
- }
4969
- }
4970
-
4971
- async _parseFileSize(fileSize = 0) {
4972
- const kb = fileSize / 1024,
4973
- mb = kb / 1024;
4974
-
4975
- if (!kb) {
4976
- return undefined;
4977
- }
4978
-
4979
- return this.l10n.get(`document_properties_${mb >= 1 ? "mb" : "kb"}`, {
4980
- size_mb: mb >= 1 && (+mb.toPrecision(3)).toLocaleString(),
4981
- size_kb: mb < 1 && (+kb.toPrecision(3)).toLocaleString(),
4982
- size_b: fileSize.toLocaleString()
4983
- });
4984
- }
4985
-
4986
- async _parsePageSize(pageSizeInches, pagesRotation) {
4987
- if (!pageSizeInches) {
4988
- return undefined;
4989
- }
4990
-
4991
- if (pagesRotation % 180 !== 0) {
4992
- pageSizeInches = {
4993
- width: pageSizeInches.height,
4994
- height: pageSizeInches.width
4995
- };
4996
- }
4997
-
4998
- const isPortrait = (0, _ui_utils.isPortraitOrientation)(pageSizeInches);
4999
- let sizeInches = {
5000
- width: Math.round(pageSizeInches.width * 100) / 100,
5001
- height: Math.round(pageSizeInches.height * 100) / 100
5002
- };
5003
- let sizeMillimeters = {
5004
- width: Math.round(pageSizeInches.width * 25.4 * 10) / 10,
5005
- height: Math.round(pageSizeInches.height * 25.4 * 10) / 10
5006
- };
5007
- let rawName = getPageName(sizeInches, isPortrait, US_PAGE_NAMES) || getPageName(sizeMillimeters, isPortrait, METRIC_PAGE_NAMES);
5008
-
5009
- if (!rawName && !(Number.isInteger(sizeMillimeters.width) && Number.isInteger(sizeMillimeters.height))) {
5010
- const exactMillimeters = {
5011
- width: pageSizeInches.width * 25.4,
5012
- height: pageSizeInches.height * 25.4
5013
- };
5014
- const intMillimeters = {
5015
- width: Math.round(sizeMillimeters.width),
5016
- height: Math.round(sizeMillimeters.height)
5017
- };
5018
-
5019
- if (Math.abs(exactMillimeters.width - intMillimeters.width) < 0.1 && Math.abs(exactMillimeters.height - intMillimeters.height) < 0.1) {
5020
- rawName = getPageName(intMillimeters, isPortrait, METRIC_PAGE_NAMES);
5021
-
5022
- if (rawName) {
5023
- sizeInches = {
5024
- width: Math.round(intMillimeters.width / 25.4 * 100) / 100,
5025
- height: Math.round(intMillimeters.height / 25.4 * 100) / 100
5026
- };
5027
- sizeMillimeters = intMillimeters;
5028
- }
5029
- }
5030
- }
5031
-
5032
- const [{
5033
- width,
5034
- height
5035
- }, unit, name, orientation] = await Promise.all([this._isNonMetricLocale ? sizeInches : sizeMillimeters, this.l10n.get(`document_properties_page_size_unit_${this._isNonMetricLocale ? "inches" : "millimeters"}`), rawName && this.l10n.get(`document_properties_page_size_name_${rawName.toLowerCase()}`), this.l10n.get(`document_properties_page_size_orientation_${isPortrait ? "portrait" : "landscape"}`)]);
5036
- return this.l10n.get(`document_properties_page_size_dimension_${name ? "name_" : ""}string`, {
5037
- width: width.toLocaleString(),
5038
- height: height.toLocaleString(),
5039
- unit,
5040
- name,
5041
- orientation
5042
- });
5043
- }
5044
-
5045
- async _parseDate(inputDate) {
5046
- const dateObject = _pdfjsLib.PDFDateString.toDateObject(inputDate);
5047
-
5048
- if (!dateObject) {
5049
- return undefined;
5050
- }
5051
-
5052
- return this.l10n.get("document_properties_date_string", {
5053
- date: dateObject.toLocaleDateString(),
5054
- time: dateObject.toLocaleTimeString()
5055
- });
5056
- }
5057
-
5058
- _parseLinearization(isLinearized) {
5059
- return this.l10n.get(`document_properties_linearized_${isLinearized ? "yes" : "no"}`);
5060
- }
5061
-
5062
- }
5063
-
5064
- exports.PDFDocumentProperties = PDFDocumentProperties;
5065
-
5066
- /***/ }),
5067
- /* 14 */
5068
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5069
-
5070
-
5071
-
5072
- Object.defineProperty(exports, "__esModule", ({
5073
- value: true
5074
- }));
5075
- exports.PDFFindBar = void 0;
5076
-
5077
- var _pdf_find_controller = __webpack_require__(15);
5078
-
5079
- const MATCHES_COUNT_LIMIT = 1000;
5080
-
5081
- class PDFFindBar {
5082
- constructor(options, eventBus, l10n) {
5083
- this.opened = false;
5084
- this.bar = options.bar;
5085
- this.toggleButton = options.toggleButton;
5086
- this.findField = options.findField;
5087
- this.highlightAll = options.highlightAllCheckbox;
5088
- this.caseSensitive = options.caseSensitiveCheckbox;
5089
- this.entireWord = options.entireWordCheckbox;
5090
- this.findMsg = options.findMsg;
5091
- this.findResultsCount = options.findResultsCount;
5092
- this.findPreviousButton = options.findPreviousButton;
5093
- this.findNextButton = options.findNextButton;
5094
- this.eventBus = eventBus;
5095
- this.l10n = l10n;
5096
- this.toggleButton.addEventListener("click", () => {
5097
- this.toggle();
5098
- });
5099
- this.findField.addEventListener("input", () => {
5100
- this.dispatchEvent("");
5101
- });
5102
- this.bar.addEventListener("keydown", e => {
5103
- switch (e.keyCode) {
5104
- case 13:
5105
- if (e.target === this.findField) {
5106
- this.dispatchEvent("again", e.shiftKey);
5107
- }
5108
-
5109
- break;
5110
-
5111
- case 27:
5112
- this.close();
5113
- break;
5114
- }
5115
- });
5116
- this.findPreviousButton.addEventListener("click", () => {
5117
- this.dispatchEvent("again", true);
5118
- });
5119
- this.findNextButton.addEventListener("click", () => {
5120
- this.dispatchEvent("again", false);
5121
- });
5122
- this.highlightAll.addEventListener("click", () => {
5123
- this.dispatchEvent("highlightallchange");
5124
- });
5125
- this.caseSensitive.addEventListener("click", () => {
5126
- this.dispatchEvent("casesensitivitychange");
5127
- });
5128
- this.entireWord.addEventListener("click", () => {
5129
- this.dispatchEvent("entirewordchange");
5130
- });
5131
-
5132
- this.eventBus._on("resize", this._adjustWidth.bind(this));
5133
- }
5134
-
5135
- reset() {
5136
- this.updateUIState();
5137
- }
5138
-
5139
- dispatchEvent(type, findPrev) {
5140
- this.eventBus.dispatch("find", {
5141
- source: this,
5142
- type,
5143
- query: this.findField.value,
5144
- phraseSearch: true,
5145
- caseSensitive: this.caseSensitive.checked,
5146
- entireWord: this.entireWord.checked,
5147
- highlightAll: this.highlightAll.checked,
5148
- findPrevious: findPrev
5149
- });
5150
- }
5151
-
5152
- updateUIState(state, previous, matchesCount) {
5153
- let findMsg = Promise.resolve("");
5154
- let status = "";
5155
-
5156
- switch (state) {
5157
- case _pdf_find_controller.FindState.FOUND:
5158
- break;
5159
-
5160
- case _pdf_find_controller.FindState.PENDING:
5161
- status = "pending";
5162
- break;
5163
-
5164
- case _pdf_find_controller.FindState.NOT_FOUND:
5165
- findMsg = this.l10n.get("find_not_found");
5166
- status = "notFound";
5167
- break;
5168
-
5169
- case _pdf_find_controller.FindState.WRAPPED:
5170
- findMsg = this.l10n.get(`find_reached_${previous ? "top" : "bottom"}`);
5171
- break;
5172
- }
5173
-
5174
- this.findField.setAttribute("data-status", status);
5175
- findMsg.then(msg => {
5176
- this.findMsg.textContent = msg;
5177
-
5178
- this._adjustWidth();
5179
- });
5180
- this.updateResultsCount(matchesCount);
5181
- }
5182
-
5183
- updateResultsCount({
5184
- current = 0,
5185
- total = 0
5186
- } = {}) {
5187
- const limit = MATCHES_COUNT_LIMIT;
5188
- let matchCountMsg = Promise.resolve("");
5189
-
5190
- if (total > 0) {
5191
- if (total > limit) {
5192
- let key = "find_match_count_limit";
5193
- matchCountMsg = this.l10n.get(key, {
5194
- limit
5195
- });
5196
- } else {
5197
- let key = "find_match_count";
5198
- matchCountMsg = this.l10n.get(key, {
5199
- current,
5200
- total
5201
- });
5202
- }
5203
- }
5204
-
5205
- matchCountMsg.then(msg => {
5206
- this.findResultsCount.textContent = msg;
5207
- this.findResultsCount.classList.toggle("hidden", !total);
5208
-
5209
- this._adjustWidth();
5210
- });
5211
- }
5212
-
5213
- open() {
5214
- if (!this.opened) {
5215
- this.opened = true;
5216
- this.toggleButton.classList.add("toggled");
5217
- this.toggleButton.setAttribute("aria-expanded", "true");
5218
- this.bar.classList.remove("hidden");
5219
- }
5220
-
5221
- this.findField.select();
5222
- this.findField.focus();
5223
-
5224
- this._adjustWidth();
5225
- }
5226
-
5227
- close() {
5228
- if (!this.opened) {
5229
- return;
5230
- }
5231
-
5232
- this.opened = false;
5233
- this.toggleButton.classList.remove("toggled");
5234
- this.toggleButton.setAttribute("aria-expanded", "false");
5235
- this.bar.classList.add("hidden");
5236
- this.eventBus.dispatch("findbarclose", {
5237
- source: this
5238
- });
5239
- }
5240
-
5241
- toggle() {
5242
- if (this.opened) {
5243
- this.close();
5244
- } else {
5245
- this.open();
5246
- }
5247
- }
5248
-
5249
- _adjustWidth() {
5250
- if (!this.opened) {
5251
- return;
5252
- }
5253
-
5254
- this.bar.classList.remove("wrapContainers");
5255
- const findbarHeight = this.bar.clientHeight;
5256
- const inputContainerHeight = this.bar.firstElementChild.clientHeight;
5257
-
5258
- if (findbarHeight > inputContainerHeight) {
5259
- this.bar.classList.add("wrapContainers");
5260
- }
5261
- }
5262
-
5263
- }
5264
-
5265
- exports.PDFFindBar = PDFFindBar;
5266
-
5267
- /***/ }),
5268
- /* 15 */
5269
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5270
-
5271
-
5272
-
5273
- Object.defineProperty(exports, "__esModule", ({
5274
- value: true
5275
- }));
5276
- exports.PDFFindController = exports.FindState = void 0;
5277
-
5278
- var _pdfjsLib = __webpack_require__(5);
5279
-
5280
- var _pdf_find_utils = __webpack_require__(16);
5281
-
5282
- var _ui_utils = __webpack_require__(4);
5283
-
5284
- const FindState = {
5285
- FOUND: 0,
5286
- NOT_FOUND: 1,
5287
- WRAPPED: 2,
5288
- PENDING: 3
5289
- };
5290
- exports.FindState = FindState;
5291
- const FIND_TIMEOUT = 250;
5292
- const MATCH_SCROLL_OFFSET_TOP = -50;
5293
- const MATCH_SCROLL_OFFSET_LEFT = -400;
5294
- const CHARACTERS_TO_NORMALIZE = {
5295
- "\u2010": "-",
5296
- "\u2018": "'",
5297
- "\u2019": "'",
5298
- "\u201A": "'",
5299
- "\u201B": "'",
5300
- "\u201C": '"',
5301
- "\u201D": '"',
5302
- "\u201E": '"',
5303
- "\u201F": '"',
5304
- "\u00BC": "1/4",
5305
- "\u00BD": "1/2",
5306
- "\u00BE": "3/4"
5307
- };
5308
- let normalizationRegex = null;
5309
-
5310
- function normalize(text) {
5311
- if (!normalizationRegex) {
5312
- const replace = Object.keys(CHARACTERS_TO_NORMALIZE).join("");
5313
- normalizationRegex = new RegExp(`[${replace}]`, "g");
5314
- }
5315
-
5316
- let diffs = null;
5317
- const normalizedText = text.replace(normalizationRegex, function (ch, index) {
5318
- const normalizedCh = CHARACTERS_TO_NORMALIZE[ch],
5319
- diff = normalizedCh.length - ch.length;
5320
-
5321
- if (diff !== 0) {
5322
- (diffs || (diffs = [])).push([index, diff]);
5323
- }
5324
-
5325
- return normalizedCh;
5326
- });
5327
- return [normalizedText, diffs];
5328
- }
5329
-
5330
- function getOriginalIndex(matchIndex, diffs = null) {
5331
- if (!diffs) {
5332
- return matchIndex;
5333
- }
5334
-
5335
- let totalDiff = 0;
5336
-
5337
- for (const [index, diff] of diffs) {
5338
- const currentIndex = index + totalDiff;
5339
-
5340
- if (currentIndex >= matchIndex) {
5341
- break;
5342
- }
5343
-
5344
- if (currentIndex + diff > matchIndex) {
5345
- totalDiff += matchIndex - currentIndex;
5346
- break;
5347
- }
5348
-
5349
- totalDiff += diff;
5350
- }
5351
-
5352
- return matchIndex - totalDiff;
5353
- }
5354
-
5355
- class PDFFindController {
5356
- constructor({
5357
- linkService,
5358
- eventBus
5359
- }) {
5360
- this._linkService = linkService;
5361
- this._eventBus = eventBus;
5362
-
5363
- this._reset();
5364
-
5365
- eventBus._on("findbarclose", this._onFindBarClose.bind(this));
5366
- }
5367
-
5368
- get highlightMatches() {
5369
- return this._highlightMatches;
5370
- }
5371
-
5372
- get pageMatches() {
5373
- return this._pageMatches;
5374
- }
5375
-
5376
- get pageMatchesLength() {
5377
- return this._pageMatchesLength;
5378
- }
5379
-
5380
- get selected() {
5381
- return this._selected;
5382
- }
5383
-
5384
- get state() {
5385
- return this._state;
5386
- }
5387
-
5388
- setDocument(pdfDocument) {
5389
- if (this._pdfDocument) {
5390
- this._reset();
5391
- }
5392
-
5393
- if (!pdfDocument) {
5394
- return;
5395
- }
5396
-
5397
- this._pdfDocument = pdfDocument;
5398
-
5399
- this._firstPageCapability.resolve();
5400
- }
5401
-
5402
- executeCommand(cmd, state) {
5403
- if (!state) {
5404
- return;
5405
- }
5406
-
5407
- const pdfDocument = this._pdfDocument;
5408
-
5409
- if (this._state === null || this._shouldDirtyMatch(cmd, state)) {
5410
- this._dirtyMatch = true;
5411
- }
5412
-
5413
- this._state = state;
5414
-
5415
- if (cmd !== "findhighlightallchange") {
5416
- this._updateUIState(FindState.PENDING);
5417
- }
5418
-
5419
- this._firstPageCapability.promise.then(() => {
5420
- if (!this._pdfDocument || pdfDocument && this._pdfDocument !== pdfDocument) {
5421
- return;
5422
- }
5423
-
5424
- this._extractText();
5425
-
5426
- const findbarClosed = !this._highlightMatches;
5427
- const pendingTimeout = !!this._findTimeout;
5428
-
5429
- if (this._findTimeout) {
5430
- clearTimeout(this._findTimeout);
5431
- this._findTimeout = null;
5432
- }
5433
-
5434
- if (cmd === "find") {
5435
- this._findTimeout = setTimeout(() => {
5436
- this._nextMatch();
5437
-
5438
- this._findTimeout = null;
5439
- }, FIND_TIMEOUT);
5440
- } else if (this._dirtyMatch) {
5441
- this._nextMatch();
5442
- } else if (cmd === "findagain") {
5443
- this._nextMatch();
5444
-
5445
- if (findbarClosed && this._state.highlightAll) {
5446
- this._updateAllPages();
5447
- }
5448
- } else if (cmd === "findhighlightallchange") {
5449
- if (pendingTimeout) {
5450
- this._nextMatch();
5451
- } else {
5452
- this._highlightMatches = true;
5453
- }
5454
-
5455
- this._updateAllPages();
5456
- } else {
5457
- this._nextMatch();
5458
- }
5459
- });
5460
- }
5461
-
5462
- scrollMatchIntoView({
5463
- element = null,
5464
- selectedLeft = 0,
5465
- pageIndex = -1,
5466
- matchIndex = -1
5467
- }) {
5468
- if (!this._scrollMatches || !element) {
5469
- return;
5470
- } else if (matchIndex === -1 || matchIndex !== this._selected.matchIdx) {
5471
- return;
5472
- } else if (pageIndex === -1 || pageIndex !== this._selected.pageIdx) {
5473
- return;
5474
- }
5475
-
5476
- this._scrollMatches = false;
5477
- const spot = {
5478
- top: MATCH_SCROLL_OFFSET_TOP,
5479
- left: selectedLeft + MATCH_SCROLL_OFFSET_LEFT
5480
- };
5481
- (0, _ui_utils.scrollIntoView)(element, spot, true);
5482
- }
5483
-
5484
- _reset() {
5485
- this._highlightMatches = false;
5486
- this._scrollMatches = false;
5487
- this._pdfDocument = null;
5488
- this._pageMatches = [];
5489
- this._pageMatchesLength = [];
5490
- this._state = null;
5491
- this._selected = {
5492
- pageIdx: -1,
5493
- matchIdx: -1
5494
- };
5495
- this._offset = {
5496
- pageIdx: null,
5497
- matchIdx: null,
5498
- wrapped: false
5499
- };
5500
- this._extractTextPromises = [];
5501
- this._pageContents = [];
5502
- this._pageDiffs = [];
5503
- this._matchesCountTotal = 0;
5504
- this._pagesToSearch = null;
5505
- this._pendingFindMatches = new Set();
5506
- this._resumePageIdx = null;
5507
- this._dirtyMatch = false;
5508
- clearTimeout(this._findTimeout);
5509
- this._findTimeout = null;
5510
- this._firstPageCapability = (0, _pdfjsLib.createPromiseCapability)();
5511
- }
5512
-
5513
- get _query() {
5514
- if (this._state.query !== this._rawQuery) {
5515
- this._rawQuery = this._state.query;
5516
- [this._normalizedQuery] = normalize(this._state.query);
5517
- }
5518
-
5519
- return this._normalizedQuery;
5520
- }
5521
-
5522
- _shouldDirtyMatch(cmd, state) {
5523
- if (state.query !== this._state.query) {
5524
- return true;
5525
- }
5526
-
5527
- switch (cmd) {
5528
- case "findagain":
5529
- const pageNumber = this._selected.pageIdx + 1;
5530
- const linkService = this._linkService;
5531
-
5532
- if (pageNumber >= 1 && pageNumber <= linkService.pagesCount && pageNumber !== linkService.page && !linkService.isPageVisible(pageNumber)) {
5533
- return true;
5534
- }
5535
-
5536
- return false;
5537
-
5538
- case "findhighlightallchange":
5539
- return false;
5540
- }
5541
-
5542
- return true;
5543
- }
5544
-
5545
- _prepareMatches(matchesWithLength, matches, matchesLength) {
5546
- function isSubTerm(currentIndex) {
5547
- const currentElem = matchesWithLength[currentIndex];
5548
- const nextElem = matchesWithLength[currentIndex + 1];
5549
-
5550
- if (currentIndex < matchesWithLength.length - 1 && currentElem.match === nextElem.match) {
5551
- currentElem.skipped = true;
5552
- return true;
5553
- }
5554
-
5555
- for (let i = currentIndex - 1; i >= 0; i--) {
5556
- const prevElem = matchesWithLength[i];
5557
-
5558
- if (prevElem.skipped) {
5559
- continue;
5560
- }
5561
-
5562
- if (prevElem.match + prevElem.matchLength < currentElem.match) {
5563
- break;
5564
- }
5565
-
5566
- if (prevElem.match + prevElem.matchLength >= currentElem.match + currentElem.matchLength) {
5567
- currentElem.skipped = true;
5568
- return true;
5569
- }
5570
- }
5571
-
5572
- return false;
5573
- }
5574
-
5575
- matchesWithLength.sort(function (a, b) {
5576
- return a.match === b.match ? a.matchLength - b.matchLength : a.match - b.match;
5577
- });
5578
-
5579
- for (let i = 0, len = matchesWithLength.length; i < len; i++) {
5580
- if (isSubTerm(i)) {
5581
- continue;
5582
- }
5583
-
5584
- matches.push(matchesWithLength[i].match);
5585
- matchesLength.push(matchesWithLength[i].matchLength);
5586
- }
5587
- }
5588
-
5589
- _isEntireWord(content, startIdx, length) {
5590
- if (startIdx > 0) {
5591
- const first = content.charCodeAt(startIdx);
5592
- const limit = content.charCodeAt(startIdx - 1);
5593
-
5594
- if ((0, _pdf_find_utils.getCharacterType)(first) === (0, _pdf_find_utils.getCharacterType)(limit)) {
5595
- return false;
5596
- }
5597
- }
5598
-
5599
- const endIdx = startIdx + length - 1;
5600
-
5601
- if (endIdx < content.length - 1) {
5602
- const last = content.charCodeAt(endIdx);
5603
- const limit = content.charCodeAt(endIdx + 1);
5604
-
5605
- if ((0, _pdf_find_utils.getCharacterType)(last) === (0, _pdf_find_utils.getCharacterType)(limit)) {
5606
- return false;
5607
- }
5608
- }
5609
-
5610
- return true;
5611
- }
5612
-
5613
- _calculatePhraseMatch(query, pageIndex, pageContent, pageDiffs, entireWord) {
5614
- const matches = [],
5615
- matchesLength = [];
5616
- const queryLen = query.length;
5617
- let matchIdx = -queryLen;
5618
-
5619
- while (true) {
5620
- matchIdx = pageContent.indexOf(query, matchIdx + queryLen);
5621
-
5622
- if (matchIdx === -1) {
5623
- break;
5624
- }
5625
-
5626
- if (entireWord && !this._isEntireWord(pageContent, matchIdx, queryLen)) {
5627
- continue;
5628
- }
5629
-
5630
- const originalMatchIdx = getOriginalIndex(matchIdx, pageDiffs),
5631
- matchEnd = matchIdx + queryLen - 1,
5632
- originalQueryLen = getOriginalIndex(matchEnd, pageDiffs) - originalMatchIdx + 1;
5633
- matches.push(originalMatchIdx);
5634
- matchesLength.push(originalQueryLen);
5635
- }
5636
-
5637
- this._pageMatches[pageIndex] = matches;
5638
- this._pageMatchesLength[pageIndex] = matchesLength;
5639
- }
5640
-
5641
- _calculateWordMatch(query, pageIndex, pageContent, pageDiffs, entireWord) {
5642
- const matchesWithLength = [];
5643
- const queryArray = query.match(/\S+/g);
5644
-
5645
- for (let i = 0, len = queryArray.length; i < len; i++) {
5646
- const subquery = queryArray[i];
5647
- const subqueryLen = subquery.length;
5648
- let matchIdx = -subqueryLen;
5649
-
5650
- while (true) {
5651
- matchIdx = pageContent.indexOf(subquery, matchIdx + subqueryLen);
5652
-
5653
- if (matchIdx === -1) {
5654
- break;
5655
- }
5656
-
5657
- if (entireWord && !this._isEntireWord(pageContent, matchIdx, subqueryLen)) {
5658
- continue;
5659
- }
5660
-
5661
- const originalMatchIdx = getOriginalIndex(matchIdx, pageDiffs),
5662
- matchEnd = matchIdx + subqueryLen - 1,
5663
- originalQueryLen = getOriginalIndex(matchEnd, pageDiffs) - originalMatchIdx + 1;
5664
- matchesWithLength.push({
5665
- match: originalMatchIdx,
5666
- matchLength: originalQueryLen,
5667
- skipped: false
5668
- });
5669
- }
5670
- }
5671
-
5672
- this._pageMatchesLength[pageIndex] = [];
5673
- this._pageMatches[pageIndex] = [];
5674
-
5675
- this._prepareMatches(matchesWithLength, this._pageMatches[pageIndex], this._pageMatchesLength[pageIndex]);
5676
- }
5677
-
5678
- _calculateMatch(pageIndex) {
5679
- let pageContent = this._pageContents[pageIndex];
5680
- const pageDiffs = this._pageDiffs[pageIndex];
5681
- let query = this._query;
5682
- const {
5683
- caseSensitive,
5684
- entireWord,
5685
- phraseSearch
5686
- } = this._state;
5687
-
5688
- if (query.length === 0) {
5689
- return;
5690
- }
5691
-
5692
- if (!caseSensitive) {
5693
- pageContent = pageContent.toLowerCase();
5694
- query = query.toLowerCase();
5695
- }
5696
-
5697
- if (phraseSearch) {
5698
- this._calculatePhraseMatch(query, pageIndex, pageContent, pageDiffs, entireWord);
5699
- } else {
5700
- this._calculateWordMatch(query, pageIndex, pageContent, pageDiffs, entireWord);
5701
- }
5702
-
5703
- if (this._state.highlightAll) {
5704
- this._updatePage(pageIndex);
5705
- }
5706
-
5707
- if (this._resumePageIdx === pageIndex) {
5708
- this._resumePageIdx = null;
5709
-
5710
- this._nextPageMatch();
5711
- }
5712
-
5713
- const pageMatchesCount = this._pageMatches[pageIndex].length;
5714
-
5715
- if (pageMatchesCount > 0) {
5716
- this._matchesCountTotal += pageMatchesCount;
5717
-
5718
- this._updateUIResultsCount();
5719
- }
5720
- }
5721
-
5722
- _extractText() {
5723
- if (this._extractTextPromises.length > 0) {
5724
- return;
5725
- }
5726
-
5727
- let promise = Promise.resolve();
5728
-
5729
- for (let i = 0, ii = this._linkService.pagesCount; i < ii; i++) {
5730
- const extractTextCapability = (0, _pdfjsLib.createPromiseCapability)();
5731
- this._extractTextPromises[i] = extractTextCapability.promise;
5732
- promise = promise.then(() => {
5733
- return this._pdfDocument.getPage(i + 1).then(pdfPage => {
5734
- return pdfPage.getTextContent({
5735
- normalizeWhitespace: true
5736
- });
5737
- }).then(textContent => {
5738
- const textItems = textContent.items;
5739
- const strBuf = [];
5740
-
5741
- for (let j = 0, jj = textItems.length; j < jj; j++) {
5742
- strBuf.push(textItems[j].str);
5743
- }
5744
-
5745
- [this._pageContents[i], this._pageDiffs[i]] = normalize(strBuf.join(""));
5746
- extractTextCapability.resolve(i);
5747
- }, reason => {
5748
- console.error(`Unable to get text content for page ${i + 1}`, reason);
5749
- this._pageContents[i] = "";
5750
- this._pageDiffs[i] = null;
5751
- extractTextCapability.resolve(i);
5752
- });
5753
- });
5754
- }
5755
- }
5756
-
5757
- _updatePage(index) {
5758
- if (this._scrollMatches && this._selected.pageIdx === index) {
5759
- this._linkService.page = index + 1;
5760
- }
5761
-
5762
- this._eventBus.dispatch("updatetextlayermatches", {
5763
- source: this,
5764
- pageIndex: index
5765
- });
5766
- }
5767
-
5768
- _updateAllPages() {
5769
- this._eventBus.dispatch("updatetextlayermatches", {
5770
- source: this,
5771
- pageIndex: -1
5772
- });
5773
- }
5774
-
5775
- _nextMatch() {
5776
- const previous = this._state.findPrevious;
5777
- const currentPageIndex = this._linkService.page - 1;
5778
- const numPages = this._linkService.pagesCount;
5779
- this._highlightMatches = true;
5780
-
5781
- if (this._dirtyMatch) {
5782
- this._dirtyMatch = false;
5783
- this._selected.pageIdx = this._selected.matchIdx = -1;
5784
- this._offset.pageIdx = currentPageIndex;
5785
- this._offset.matchIdx = null;
5786
- this._offset.wrapped = false;
5787
- this._resumePageIdx = null;
5788
- this._pageMatches.length = 0;
5789
- this._pageMatchesLength.length = 0;
5790
- this._matchesCountTotal = 0;
5791
-
5792
- this._updateAllPages();
5793
-
5794
- for (let i = 0; i < numPages; i++) {
5795
- if (this._pendingFindMatches.has(i)) {
5796
- continue;
5797
- }
5798
-
5799
- this._pendingFindMatches.add(i);
5800
-
5801
- this._extractTextPromises[i].then(pageIdx => {
5802
- this._pendingFindMatches.delete(pageIdx);
5803
-
5804
- this._calculateMatch(pageIdx);
5805
- });
5806
- }
5807
- }
5808
-
5809
- if (this._query === "") {
5810
- this._updateUIState(FindState.FOUND);
5811
-
5812
- return;
5813
- }
5814
-
5815
- if (this._resumePageIdx) {
5816
- return;
5817
- }
5818
-
5819
- const offset = this._offset;
5820
- this._pagesToSearch = numPages;
5821
-
5822
- if (offset.matchIdx !== null) {
5823
- const numPageMatches = this._pageMatches[offset.pageIdx].length;
5824
-
5825
- if (!previous && offset.matchIdx + 1 < numPageMatches || previous && offset.matchIdx > 0) {
5826
- offset.matchIdx = previous ? offset.matchIdx - 1 : offset.matchIdx + 1;
5827
-
5828
- this._updateMatch(true);
5829
-
5830
- return;
5831
- }
5832
-
5833
- this._advanceOffsetPage(previous);
5834
- }
5835
-
5836
- this._nextPageMatch();
5837
- }
5838
-
5839
- _matchesReady(matches) {
5840
- const offset = this._offset;
5841
- const numMatches = matches.length;
5842
- const previous = this._state.findPrevious;
5843
-
5844
- if (numMatches) {
5845
- offset.matchIdx = previous ? numMatches - 1 : 0;
5846
-
5847
- this._updateMatch(true);
5848
-
5849
- return true;
5850
- }
5851
-
5852
- this._advanceOffsetPage(previous);
5853
-
5854
- if (offset.wrapped) {
5855
- offset.matchIdx = null;
5856
-
5857
- if (this._pagesToSearch < 0) {
5858
- this._updateMatch(false);
5859
-
5860
- return true;
5861
- }
5862
- }
5863
-
5864
- return false;
5865
- }
5866
-
5867
- _nextPageMatch() {
5868
- if (this._resumePageIdx !== null) {
5869
- console.error("There can only be one pending page.");
5870
- }
5871
-
5872
- let matches = null;
5873
-
5874
- do {
5875
- const pageIdx = this._offset.pageIdx;
5876
- matches = this._pageMatches[pageIdx];
5877
-
5878
- if (!matches) {
5879
- this._resumePageIdx = pageIdx;
5880
- break;
5881
- }
5882
- } while (!this._matchesReady(matches));
5883
- }
5884
-
5885
- _advanceOffsetPage(previous) {
5886
- const offset = this._offset;
5887
- const numPages = this._linkService.pagesCount;
5888
- offset.pageIdx = previous ? offset.pageIdx - 1 : offset.pageIdx + 1;
5889
- offset.matchIdx = null;
5890
- this._pagesToSearch--;
5891
-
5892
- if (offset.pageIdx >= numPages || offset.pageIdx < 0) {
5893
- offset.pageIdx = previous ? numPages - 1 : 0;
5894
- offset.wrapped = true;
5895
- }
5896
- }
5897
-
5898
- _updateMatch(found = false) {
5899
- let state = FindState.NOT_FOUND;
5900
- const wrapped = this._offset.wrapped;
5901
- this._offset.wrapped = false;
5902
-
5903
- if (found) {
5904
- const previousPage = this._selected.pageIdx;
5905
- this._selected.pageIdx = this._offset.pageIdx;
5906
- this._selected.matchIdx = this._offset.matchIdx;
5907
- state = wrapped ? FindState.WRAPPED : FindState.FOUND;
5908
-
5909
- if (previousPage !== -1 && previousPage !== this._selected.pageIdx) {
5910
- this._updatePage(previousPage);
5911
- }
5912
- }
5913
-
5914
- this._updateUIState(state, this._state.findPrevious);
5915
-
5916
- if (this._selected.pageIdx !== -1) {
5917
- this._scrollMatches = true;
5918
-
5919
- this._updatePage(this._selected.pageIdx);
5920
- }
5921
- }
5922
-
5923
- _onFindBarClose(evt) {
5924
- const pdfDocument = this._pdfDocument;
5925
-
5926
- this._firstPageCapability.promise.then(() => {
5927
- if (!this._pdfDocument || pdfDocument && this._pdfDocument !== pdfDocument) {
5928
- return;
5929
- }
5930
-
5931
- if (this._findTimeout) {
5932
- clearTimeout(this._findTimeout);
5933
- this._findTimeout = null;
5934
- }
5935
-
5936
- if (this._resumePageIdx) {
5937
- this._resumePageIdx = null;
5938
- this._dirtyMatch = true;
5939
- }
5940
-
5941
- this._updateUIState(FindState.FOUND);
5942
-
5943
- this._highlightMatches = false;
5944
-
5945
- this._updateAllPages();
5946
- });
5947
- }
5948
-
5949
- _requestMatchesCount() {
5950
- const {
5951
- pageIdx,
5952
- matchIdx
5953
- } = this._selected;
5954
- let current = 0,
5955
- total = this._matchesCountTotal;
5956
-
5957
- if (matchIdx !== -1) {
5958
- for (let i = 0; i < pageIdx; i++) {
5959
- current += this._pageMatches[i]?.length || 0;
5960
- }
5961
-
5962
- current += matchIdx + 1;
5963
- }
5964
-
5965
- if (current < 1 || current > total) {
5966
- current = total = 0;
5967
- }
5968
-
5969
- return {
5970
- current,
5971
- total
5972
- };
5973
- }
5974
-
5975
- _updateUIResultsCount() {
5976
- this._eventBus.dispatch("updatefindmatchescount", {
5977
- source: this,
5978
- matchesCount: this._requestMatchesCount()
5979
- });
5980
- }
5981
-
5982
- _updateUIState(state, previous) {
5983
- this._eventBus.dispatch("updatefindcontrolstate", {
5984
- source: this,
5985
- state,
5986
- previous,
5987
- matchesCount: this._requestMatchesCount(),
5988
- rawQuery: this._state?.query ?? null
5989
- });
5990
- }
5991
-
5992
- }
5993
-
5994
- exports.PDFFindController = PDFFindController;
5995
-
5996
- /***/ }),
5997
- /* 16 */
5998
- /***/ ((__unused_webpack_module, exports) => {
5999
-
6000
-
6001
-
6002
- Object.defineProperty(exports, "__esModule", ({
6003
- value: true
6004
- }));
6005
- exports.getCharacterType = getCharacterType;
6006
- exports.CharacterType = void 0;
6007
- const CharacterType = {
6008
- SPACE: 0,
6009
- ALPHA_LETTER: 1,
6010
- PUNCT: 2,
6011
- HAN_LETTER: 3,
6012
- KATAKANA_LETTER: 4,
6013
- HIRAGANA_LETTER: 5,
6014
- HALFWIDTH_KATAKANA_LETTER: 6,
6015
- THAI_LETTER: 7
6016
- };
6017
- exports.CharacterType = CharacterType;
6018
-
6019
- function isAlphabeticalScript(charCode) {
6020
- return charCode < 0x2e80;
6021
- }
6022
-
6023
- function isAscii(charCode) {
6024
- return (charCode & 0xff80) === 0;
6025
- }
6026
-
6027
- function isAsciiAlpha(charCode) {
6028
- return charCode >= 0x61 && charCode <= 0x7a || charCode >= 0x41 && charCode <= 0x5a;
6029
- }
6030
-
6031
- function isAsciiDigit(charCode) {
6032
- return charCode >= 0x30 && charCode <= 0x39;
6033
- }
6034
-
6035
- function isAsciiSpace(charCode) {
6036
- return charCode === 0x20 || charCode === 0x09 || charCode === 0x0d || charCode === 0x0a;
6037
- }
6038
-
6039
- function isHan(charCode) {
6040
- return charCode >= 0x3400 && charCode <= 0x9fff || charCode >= 0xf900 && charCode <= 0xfaff;
6041
- }
6042
-
6043
- function isKatakana(charCode) {
6044
- return charCode >= 0x30a0 && charCode <= 0x30ff;
6045
- }
6046
-
6047
- function isHiragana(charCode) {
6048
- return charCode >= 0x3040 && charCode <= 0x309f;
6049
- }
6050
-
6051
- function isHalfwidthKatakana(charCode) {
6052
- return charCode >= 0xff60 && charCode <= 0xff9f;
6053
- }
6054
-
6055
- function isThai(charCode) {
6056
- return (charCode & 0xff80) === 0x0e00;
6057
- }
6058
-
6059
- function getCharacterType(charCode) {
6060
- if (isAlphabeticalScript(charCode)) {
6061
- if (isAscii(charCode)) {
6062
- if (isAsciiSpace(charCode)) {
6063
- return CharacterType.SPACE;
6064
- } else if (isAsciiAlpha(charCode) || isAsciiDigit(charCode) || charCode === 0x5f) {
6065
- return CharacterType.ALPHA_LETTER;
6066
- }
6067
-
6068
- return CharacterType.PUNCT;
6069
- } else if (isThai(charCode)) {
6070
- return CharacterType.THAI_LETTER;
6071
- } else if (charCode === 0xa0) {
6072
- return CharacterType.SPACE;
6073
- }
6074
-
6075
- return CharacterType.ALPHA_LETTER;
6076
- }
6077
-
6078
- if (isHan(charCode)) {
6079
- return CharacterType.HAN_LETTER;
6080
- } else if (isKatakana(charCode)) {
6081
- return CharacterType.KATAKANA_LETTER;
6082
- } else if (isHiragana(charCode)) {
6083
- return CharacterType.HIRAGANA_LETTER;
6084
- } else if (isHalfwidthKatakana(charCode)) {
6085
- return CharacterType.HALFWIDTH_KATAKANA_LETTER;
6086
- }
6087
-
6088
- return CharacterType.ALPHA_LETTER;
6089
- }
6090
-
6091
- /***/ }),
6092
- /* 17 */
6093
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6094
-
6095
-
6096
-
6097
- Object.defineProperty(exports, "__esModule", ({
6098
- value: true
6099
- }));
6100
- exports.isDestArraysEqual = isDestArraysEqual;
6101
- exports.isDestHashesEqual = isDestHashesEqual;
6102
- exports.PDFHistory = void 0;
6103
-
6104
- var _ui_utils = __webpack_require__(4);
6105
-
6106
- const HASH_CHANGE_TIMEOUT = 1000;
6107
- const POSITION_UPDATED_THRESHOLD = 50;
6108
- const UPDATE_VIEWAREA_TIMEOUT = 1000;
6109
-
6110
- function getCurrentHash() {
6111
- return document.location.hash;
6112
- }
6113
-
6114
- class PDFHistory {
6115
- constructor({
6116
- linkService,
6117
- eventBus
6118
- }) {
6119
- this.linkService = linkService;
6120
- this.eventBus = eventBus;
6121
- this._initialized = false;
6122
- this._fingerprint = "";
6123
- this.reset();
6124
- this._boundEvents = null;
6125
- this._isViewerInPresentationMode = false;
6126
-
6127
- this.eventBus._on("presentationmodechanged", evt => {
6128
- this._isViewerInPresentationMode = evt.state !== _ui_utils.PresentationModeState.NORMAL;
6129
- });
6130
-
6131
- this.eventBus._on("pagesinit", () => {
6132
- this._isPagesLoaded = false;
6133
-
6134
- this.eventBus._on("pagesloaded", evt => {
6135
- this._isPagesLoaded = !!evt.pagesCount;
6136
- }, {
6137
- once: true
6138
- });
6139
- });
6140
- }
6141
-
6142
- initialize({
6143
- fingerprint,
6144
- resetHistory = false,
6145
- updateUrl = false
6146
- }) {
6147
- if (!fingerprint || typeof fingerprint !== "string") {
6148
- console.error('PDFHistory.initialize: The "fingerprint" must be a non-empty string.');
6149
- return;
6150
- }
6151
-
6152
- if (this._initialized) {
6153
- this.reset();
6154
- }
6155
-
6156
- const reInitialized = this._fingerprint !== "" && this._fingerprint !== fingerprint;
6157
- this._fingerprint = fingerprint;
6158
- this._updateUrl = updateUrl === true;
6159
- this._initialized = true;
6160
-
6161
- this._bindEvents();
6162
-
6163
- const state = window.history.state;
6164
- this._popStateInProgress = false;
6165
- this._blockHashChange = 0;
6166
- this._currentHash = getCurrentHash();
6167
- this._numPositionUpdates = 0;
6168
- this._uid = this._maxUid = 0;
6169
- this._destination = null;
6170
- this._position = null;
6171
-
6172
- if (!this._isValidState(state, true) || resetHistory) {
6173
- const {
6174
- hash,
6175
- page,
6176
- rotation
6177
- } = this._parseCurrentHash(true);
6178
-
6179
- if (!hash || reInitialized || resetHistory) {
6180
- this._pushOrReplaceState(null, true);
6181
-
6182
- return;
6183
- }
6184
-
6185
- this._pushOrReplaceState({
6186
- hash,
6187
- page,
6188
- rotation
6189
- }, true);
6190
-
6191
- return;
6192
- }
6193
-
6194
- const destination = state.destination;
6195
-
6196
- this._updateInternalState(destination, state.uid, true);
6197
-
6198
- if (destination.rotation !== undefined) {
6199
- this._initialRotation = destination.rotation;
6200
- }
6201
-
6202
- if (destination.dest) {
6203
- this._initialBookmark = JSON.stringify(destination.dest);
6204
- this._destination.page = null;
6205
- } else if (destination.hash) {
6206
- this._initialBookmark = destination.hash;
6207
- } else if (destination.page) {
6208
- this._initialBookmark = `page=${destination.page}`;
6209
- }
6210
- }
6211
-
6212
- reset() {
6213
- if (this._initialized) {
6214
- this._pageHide();
6215
-
6216
- this._initialized = false;
6217
-
6218
- this._unbindEvents();
6219
- }
6220
-
6221
- if (this._updateViewareaTimeout) {
6222
- clearTimeout(this._updateViewareaTimeout);
6223
- this._updateViewareaTimeout = null;
6224
- }
6225
-
6226
- this._initialBookmark = null;
6227
- this._initialRotation = null;
6228
- }
6229
-
6230
- push({
6231
- namedDest = null,
6232
- explicitDest,
6233
- pageNumber
6234
- }) {
6235
- if (!this._initialized) {
6236
- return;
6237
- }
6238
-
6239
- if (namedDest && typeof namedDest !== "string") {
6240
- console.error("PDFHistory.push: " + `"${namedDest}" is not a valid namedDest parameter.`);
6241
- return;
6242
- } else if (!Array.isArray(explicitDest)) {
6243
- console.error("PDFHistory.push: " + `"${explicitDest}" is not a valid explicitDest parameter.`);
6244
- return;
6245
- } else if (!this._isValidPage(pageNumber)) {
6246
- if (pageNumber !== null || this._destination) {
6247
- console.error("PDFHistory.push: " + `"${pageNumber}" is not a valid pageNumber parameter.`);
6248
- return;
6249
- }
6250
- }
6251
-
6252
- const hash = namedDest || JSON.stringify(explicitDest);
6253
-
6254
- if (!hash) {
6255
- return;
6256
- }
6257
-
6258
- let forceReplace = false;
6259
-
6260
- if (this._destination && (isDestHashesEqual(this._destination.hash, hash) || isDestArraysEqual(this._destination.dest, explicitDest))) {
6261
- if (this._destination.page) {
6262
- return;
6263
- }
6264
-
6265
- forceReplace = true;
6266
- }
6267
-
6268
- if (this._popStateInProgress && !forceReplace) {
6269
- return;
6270
- }
6271
-
6272
- this._pushOrReplaceState({
6273
- dest: explicitDest,
6274
- hash,
6275
- page: pageNumber,
6276
- rotation: this.linkService.rotation
6277
- }, forceReplace);
6278
-
6279
- if (!this._popStateInProgress) {
6280
- this._popStateInProgress = true;
6281
- Promise.resolve().then(() => {
6282
- this._popStateInProgress = false;
6283
- });
6284
- }
6285
- }
6286
-
6287
- pushPage(pageNumber) {
6288
- if (!this._initialized) {
6289
- return;
6290
- }
6291
-
6292
- if (!this._isValidPage(pageNumber)) {
6293
- console.error(`PDFHistory.pushPage: "${pageNumber}" is not a valid page number.`);
6294
- return;
6295
- }
6296
-
6297
- if (this._destination?.page === pageNumber) {
6298
- return;
6299
- }
6300
-
6301
- if (this._popStateInProgress) {
6302
- return;
6303
- }
6304
-
6305
- this._pushOrReplaceState({
6306
- dest: null,
6307
- hash: `page=${pageNumber}`,
6308
- page: pageNumber,
6309
- rotation: this.linkService.rotation
6310
- });
6311
-
6312
- if (!this._popStateInProgress) {
6313
- this._popStateInProgress = true;
6314
- Promise.resolve().then(() => {
6315
- this._popStateInProgress = false;
6316
- });
6317
- }
6318
- }
6319
-
6320
- pushCurrentPosition() {
6321
- if (!this._initialized || this._popStateInProgress) {
6322
- return;
6323
- }
6324
-
6325
- this._tryPushCurrentPosition();
6326
- }
6327
-
6328
- back() {
6329
- if (!this._initialized || this._popStateInProgress) {
6330
- return;
6331
- }
6332
-
6333
- const state = window.history.state;
6334
-
6335
- if (this._isValidState(state) && state.uid > 0) {
6336
- window.history.back();
6337
- }
6338
- }
6339
-
6340
- forward() {
6341
- if (!this._initialized || this._popStateInProgress) {
6342
- return;
6343
- }
6344
-
6345
- const state = window.history.state;
6346
-
6347
- if (this._isValidState(state) && state.uid < this._maxUid) {
6348
- window.history.forward();
6349
- }
6350
- }
6351
-
6352
- get popStateInProgress() {
6353
- return this._initialized && (this._popStateInProgress || this._blockHashChange > 0);
6354
- }
6355
-
6356
- get initialBookmark() {
6357
- return this._initialized ? this._initialBookmark : null;
6358
- }
6359
-
6360
- get initialRotation() {
6361
- return this._initialized ? this._initialRotation : null;
6362
- }
6363
-
6364
- _pushOrReplaceState(destination, forceReplace = false) {
6365
- const shouldReplace = forceReplace || !this._destination;
6366
- const newState = {
6367
- fingerprint: this._fingerprint,
6368
- uid: shouldReplace ? this._uid : this._uid + 1,
6369
- destination
6370
- };
6371
-
6372
- this._updateInternalState(destination, newState.uid);
6373
-
6374
- let newUrl;
6375
-
6376
- if (this._updateUrl && destination?.hash) {
6377
- const baseUrl = document.location.href.split("#")[0];
6378
-
6379
- if (!baseUrl.startsWith("file://")) {
6380
- newUrl = `${baseUrl}#${destination.hash}`;
6381
- }
6382
- }
6383
-
6384
- if (shouldReplace) {
6385
- window.history.replaceState(newState, "", newUrl);
6386
- } else {
6387
- window.history.pushState(newState, "", newUrl);
6388
- }
6389
- }
6390
-
6391
- _tryPushCurrentPosition(temporary = false) {
6392
- if (!this._position) {
6393
- return;
6394
- }
6395
-
6396
- let position = this._position;
6397
-
6398
- if (temporary) {
6399
- position = Object.assign(Object.create(null), this._position);
6400
- position.temporary = true;
6401
- }
6402
-
6403
- if (!this._destination) {
6404
- this._pushOrReplaceState(position);
6405
-
6406
- return;
6407
- }
6408
-
6409
- if (this._destination.temporary) {
6410
- this._pushOrReplaceState(position, true);
6411
-
6412
- return;
6413
- }
6414
-
6415
- if (this._destination.hash === position.hash) {
6416
- return;
6417
- }
6418
-
6419
- if (!this._destination.page && (POSITION_UPDATED_THRESHOLD <= 0 || this._numPositionUpdates <= POSITION_UPDATED_THRESHOLD)) {
6420
- return;
6421
- }
6422
-
6423
- let forceReplace = false;
6424
-
6425
- if (this._destination.page >= position.first && this._destination.page <= position.page) {
6426
- if (this._destination.dest !== undefined || !this._destination.first) {
6427
- return;
6428
- }
6429
-
6430
- forceReplace = true;
6431
- }
6432
-
6433
- this._pushOrReplaceState(position, forceReplace);
6434
- }
6435
-
6436
- _isValidPage(val) {
6437
- return Number.isInteger(val) && val > 0 && val <= this.linkService.pagesCount;
6438
- }
6439
-
6440
- _isValidState(state, checkReload = false) {
6441
- if (!state) {
6442
- return false;
6443
- }
6444
-
6445
- if (state.fingerprint !== this._fingerprint) {
6446
- if (checkReload) {
6447
- if (typeof state.fingerprint !== "string" || state.fingerprint.length !== this._fingerprint.length) {
6448
- return false;
6449
- }
6450
-
6451
- const [perfEntry] = performance.getEntriesByType("navigation");
6452
-
6453
- if (perfEntry?.type !== "reload") {
6454
- return false;
6455
- }
6456
- } else {
6457
- return false;
6458
- }
6459
- }
6460
-
6461
- if (!Number.isInteger(state.uid) || state.uid < 0) {
6462
- return false;
6463
- }
6464
-
6465
- if (state.destination === null || typeof state.destination !== "object") {
6466
- return false;
6467
- }
6468
-
6469
- return true;
6470
- }
6471
-
6472
- _updateInternalState(destination, uid, removeTemporary = false) {
6473
- if (this._updateViewareaTimeout) {
6474
- clearTimeout(this._updateViewareaTimeout);
6475
- this._updateViewareaTimeout = null;
6476
- }
6477
-
6478
- if (removeTemporary && destination?.temporary) {
6479
- delete destination.temporary;
6480
- }
6481
-
6482
- this._destination = destination;
6483
- this._uid = uid;
6484
- this._maxUid = Math.max(this._maxUid, uid);
6485
- this._numPositionUpdates = 0;
6486
- }
6487
-
6488
- _parseCurrentHash(checkNameddest = false) {
6489
- const hash = unescape(getCurrentHash()).substring(1);
6490
- const params = (0, _ui_utils.parseQueryString)(hash);
6491
- const nameddest = params.nameddest || "";
6492
- let page = params.page | 0;
6493
-
6494
- if (!this._isValidPage(page) || checkNameddest && nameddest.length > 0) {
6495
- page = null;
6496
- }
6497
-
6498
- return {
6499
- hash,
6500
- page,
6501
- rotation: this.linkService.rotation
6502
- };
6503
- }
6504
-
6505
- _updateViewarea({
6506
- location
6507
- }) {
6508
- if (this._updateViewareaTimeout) {
6509
- clearTimeout(this._updateViewareaTimeout);
6510
- this._updateViewareaTimeout = null;
6511
- }
6512
-
6513
- this._position = {
6514
- hash: this._isViewerInPresentationMode ? `page=${location.pageNumber}` : location.pdfOpenParams.substring(1),
6515
- page: this.linkService.page,
6516
- first: location.pageNumber,
6517
- rotation: location.rotation
6518
- };
6519
-
6520
- if (this._popStateInProgress) {
6521
- return;
6522
- }
6523
-
6524
- if (POSITION_UPDATED_THRESHOLD > 0 && this._isPagesLoaded && this._destination && !this._destination.page) {
6525
- this._numPositionUpdates++;
6526
- }
6527
-
6528
- if (UPDATE_VIEWAREA_TIMEOUT > 0) {
6529
- this._updateViewareaTimeout = setTimeout(() => {
6530
- if (!this._popStateInProgress) {
6531
- this._tryPushCurrentPosition(true);
6532
- }
6533
-
6534
- this._updateViewareaTimeout = null;
6535
- }, UPDATE_VIEWAREA_TIMEOUT);
6536
- }
6537
- }
6538
-
6539
- _popState({
6540
- state
6541
- }) {
6542
- const newHash = getCurrentHash(),
6543
- hashChanged = this._currentHash !== newHash;
6544
- this._currentHash = newHash;
6545
-
6546
- if (!state) {
6547
- this._uid++;
6548
-
6549
- const {
6550
- hash,
6551
- page,
6552
- rotation
6553
- } = this._parseCurrentHash();
6554
-
6555
- this._pushOrReplaceState({
6556
- hash,
6557
- page,
6558
- rotation
6559
- }, true);
6560
-
6561
- return;
6562
- }
6563
-
6564
- if (!this._isValidState(state)) {
6565
- return;
6566
- }
6567
-
6568
- this._popStateInProgress = true;
6569
-
6570
- if (hashChanged) {
6571
- this._blockHashChange++;
6572
- (0, _ui_utils.waitOnEventOrTimeout)({
6573
- target: window,
6574
- name: "hashchange",
6575
- delay: HASH_CHANGE_TIMEOUT
6576
- }).then(() => {
6577
- this._blockHashChange--;
6578
- });
6579
- }
6580
-
6581
- const destination = state.destination;
6582
-
6583
- this._updateInternalState(destination, state.uid, true);
6584
-
6585
- if ((0, _ui_utils.isValidRotation)(destination.rotation)) {
6586
- this.linkService.rotation = destination.rotation;
6587
- }
6588
-
6589
- if (destination.dest) {
6590
- this.linkService.goToDestination(destination.dest);
6591
- } else if (destination.hash) {
6592
- this.linkService.setHash(destination.hash);
6593
- } else if (destination.page) {
6594
- this.linkService.page = destination.page;
6595
- }
6596
-
6597
- Promise.resolve().then(() => {
6598
- this._popStateInProgress = false;
6599
- });
6600
- }
6601
-
6602
- _pageHide() {
6603
- if (!this._destination || this._destination.temporary) {
6604
- this._tryPushCurrentPosition();
6605
- }
6606
- }
6607
-
6608
- _bindEvents() {
6609
- if (this._boundEvents) {
6610
- return;
6611
- }
6612
-
6613
- this._boundEvents = {
6614
- updateViewarea: this._updateViewarea.bind(this),
6615
- popState: this._popState.bind(this),
6616
- pageHide: this._pageHide.bind(this)
6617
- };
6618
-
6619
- this.eventBus._on("updateviewarea", this._boundEvents.updateViewarea);
6620
-
6621
- window.addEventListener("popstate", this._boundEvents.popState);
6622
- window.addEventListener("pagehide", this._boundEvents.pageHide);
6623
- }
6624
-
6625
- _unbindEvents() {
6626
- if (!this._boundEvents) {
6627
- return;
6628
- }
6629
-
6630
- this.eventBus._off("updateviewarea", this._boundEvents.updateViewarea);
6631
-
6632
- window.removeEventListener("popstate", this._boundEvents.popState);
6633
- window.removeEventListener("pagehide", this._boundEvents.pageHide);
6634
- this._boundEvents = null;
6635
- }
6636
-
6637
- }
6638
-
6639
- exports.PDFHistory = PDFHistory;
6640
-
6641
- function isDestHashesEqual(destHash, pushHash) {
6642
- if (typeof destHash !== "string" || typeof pushHash !== "string") {
6643
- return false;
6644
- }
6645
-
6646
- if (destHash === pushHash) {
6647
- return true;
6648
- }
6649
-
6650
- const {
6651
- nameddest
6652
- } = (0, _ui_utils.parseQueryString)(destHash);
6653
-
6654
- if (nameddest === pushHash) {
6655
- return true;
6656
- }
6657
-
6658
- return false;
6659
- }
6660
-
6661
- function isDestArraysEqual(firstDest, secondDest) {
6662
- function isEntryEqual(first, second) {
6663
- if (typeof first !== typeof second) {
6664
- return false;
6665
- }
6666
-
6667
- if (Array.isArray(first) || Array.isArray(second)) {
6668
- return false;
6669
- }
6670
-
6671
- if (first !== null && typeof first === "object" && second !== null) {
6672
- if (Object.keys(first).length !== Object.keys(second).length) {
6673
- return false;
6674
- }
6675
-
6676
- for (const key in first) {
6677
- if (!isEntryEqual(first[key], second[key])) {
6678
- return false;
6679
- }
6680
- }
6681
-
6682
- return true;
6683
- }
6684
-
6685
- return first === second || Number.isNaN(first) && Number.isNaN(second);
6686
- }
6687
-
6688
- if (!(Array.isArray(firstDest) && Array.isArray(secondDest))) {
6689
- return false;
6690
- }
6691
-
6692
- if (firstDest.length !== secondDest.length) {
6693
- return false;
6694
- }
6695
-
6696
- for (let i = 0, ii = firstDest.length; i < ii; i++) {
6697
- if (!isEntryEqual(firstDest[i], secondDest[i])) {
6698
- return false;
6699
- }
6700
- }
6701
-
6702
- return true;
6703
- }
6704
-
6705
- /***/ }),
6706
- /* 18 */
6707
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6708
-
6709
-
6710
-
6711
- Object.defineProperty(exports, "__esModule", ({
6712
- value: true
6713
- }));
6714
- exports.PDFLayerViewer = void 0;
6715
-
6716
- var _base_tree_viewer = __webpack_require__(12);
6717
-
6718
- class PDFLayerViewer extends _base_tree_viewer.BaseTreeViewer {
6719
- constructor(options) {
6720
- super(options);
6721
- this.l10n = options.l10n;
6722
-
6723
- this.eventBus._on("resetlayers", this._resetLayers.bind(this));
6724
-
6725
- this.eventBus._on("togglelayerstree", this._toggleAllTreeItems.bind(this));
6726
- }
6727
-
6728
- reset() {
6729
- super.reset();
6730
- this._optionalContentConfig = null;
6731
- }
6732
-
6733
- _dispatchEvent(layersCount) {
6734
- this.eventBus.dispatch("layersloaded", {
6735
- source: this,
6736
- layersCount
6737
- });
6738
- }
6739
-
6740
- _bindLink(element, {
6741
- groupId,
6742
- input
6743
- }) {
6744
- const setVisibility = () => {
6745
- this._optionalContentConfig.setVisibility(groupId, input.checked);
6746
-
6747
- this.eventBus.dispatch("optionalcontentconfig", {
6748
- source: this,
6749
- promise: Promise.resolve(this._optionalContentConfig)
6750
- });
6751
- };
6752
-
6753
- element.onclick = evt => {
6754
- if (evt.target === input) {
6755
- setVisibility();
6756
- return true;
6757
- } else if (evt.target !== element) {
6758
- return true;
6759
- }
6760
-
6761
- input.checked = !input.checked;
6762
- setVisibility();
6763
- return false;
6764
- };
6765
- }
6766
-
6767
- async _setNestedName(element, {
6768
- name = null
6769
- }) {
6770
- if (typeof name === "string") {
6771
- element.textContent = this._normalizeTextContent(name);
6772
- return;
6773
- }
6774
-
6775
- element.textContent = await this.l10n.get("additional_layers");
6776
- element.style.fontStyle = "italic";
6777
- }
6778
-
6779
- _addToggleButton(div, {
6780
- name = null
6781
- }) {
6782
- super._addToggleButton(div, name === null);
6783
- }
6784
-
6785
- _toggleAllTreeItems() {
6786
- if (!this._optionalContentConfig) {
6787
- return;
6788
- }
6789
-
6790
- super._toggleAllTreeItems();
6791
- }
6792
-
6793
- render({
6794
- optionalContentConfig,
6795
- pdfDocument
6796
- }) {
6797
- if (this._optionalContentConfig) {
6798
- this.reset();
6799
- }
6800
-
6801
- this._optionalContentConfig = optionalContentConfig || null;
6802
- this._pdfDocument = pdfDocument || null;
6803
- const groups = optionalContentConfig?.getOrder();
6804
-
6805
- if (!groups) {
6806
- this._dispatchEvent(0);
6807
-
6808
- return;
6809
- }
6810
-
6811
- const fragment = document.createDocumentFragment(),
6812
- queue = [{
6813
- parent: fragment,
6814
- groups
6815
- }];
6816
- let layersCount = 0,
6817
- hasAnyNesting = false;
6818
-
6819
- while (queue.length > 0) {
6820
- const levelData = queue.shift();
6821
-
6822
- for (const groupId of levelData.groups) {
6823
- const div = document.createElement("div");
6824
- div.className = "treeItem";
6825
- const element = document.createElement("a");
6826
- div.appendChild(element);
6827
-
6828
- if (typeof groupId === "object") {
6829
- hasAnyNesting = true;
6830
-
6831
- this._addToggleButton(div, groupId);
6832
-
6833
- this._setNestedName(element, groupId);
6834
-
6835
- const itemsDiv = document.createElement("div");
6836
- itemsDiv.className = "treeItems";
6837
- div.appendChild(itemsDiv);
6838
- queue.push({
6839
- parent: itemsDiv,
6840
- groups: groupId.order
6841
- });
6842
- } else {
6843
- const group = optionalContentConfig.getGroup(groupId);
6844
- const input = document.createElement("input");
6845
-
6846
- this._bindLink(element, {
6847
- groupId,
6848
- input
6849
- });
6850
-
6851
- input.type = "checkbox";
6852
- input.id = groupId;
6853
- input.checked = group.visible;
6854
- const label = document.createElement("label");
6855
- label.setAttribute("for", groupId);
6856
- label.textContent = this._normalizeTextContent(group.name);
6857
- element.appendChild(input);
6858
- element.appendChild(label);
6859
- layersCount++;
6860
- }
6861
-
6862
- levelData.parent.appendChild(div);
6863
- }
6864
- }
6865
-
6866
- this._finishRendering(fragment, layersCount, hasAnyNesting);
6867
- }
6868
-
6869
- async _resetLayers() {
6870
- if (!this._optionalContentConfig) {
6871
- return;
6872
- }
6873
-
6874
- const optionalContentConfig = await this._pdfDocument.getOptionalContentConfig();
6875
- this.eventBus.dispatch("optionalcontentconfig", {
6876
- source: this,
6877
- promise: Promise.resolve(optionalContentConfig)
6878
- });
6879
- this.render({
6880
- optionalContentConfig,
6881
- pdfDocument: this._pdfDocument
6882
- });
6883
- }
6884
-
6885
- }
6886
-
6887
- exports.PDFLayerViewer = PDFLayerViewer;
6888
-
6889
- /***/ }),
6890
- /* 19 */
6891
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6892
-
6893
-
6894
-
6895
- Object.defineProperty(exports, "__esModule", ({
6896
- value: true
6897
- }));
6898
- exports.SimpleLinkService = exports.PDFLinkService = void 0;
6899
-
6900
- var _ui_utils = __webpack_require__(4);
6901
-
6902
- class PDFLinkService {
6903
- constructor({
6904
- eventBus,
6905
- externalLinkTarget = null,
6906
- externalLinkRel = null,
6907
- ignoreDestinationZoom = false
6908
- } = {}) {
6909
- this.eventBus = eventBus;
6910
- this.externalLinkTarget = externalLinkTarget;
6911
- this.externalLinkRel = externalLinkRel;
6912
- this.externalLinkEnabled = true;
6913
- this._ignoreDestinationZoom = ignoreDestinationZoom;
6914
- this.baseUrl = null;
6915
- this.pdfDocument = null;
6916
- this.pdfViewer = null;
6917
- this.pdfHistory = null;
6918
- this._pagesRefCache = null;
6919
- }
6920
-
6921
- setDocument(pdfDocument, baseUrl = null) {
6922
- this.baseUrl = baseUrl;
6923
- this.pdfDocument = pdfDocument;
6924
- this._pagesRefCache = Object.create(null);
6925
- }
6926
-
6927
- setViewer(pdfViewer) {
6928
- this.pdfViewer = pdfViewer;
6929
- }
6930
-
6931
- setHistory(pdfHistory) {
6932
- this.pdfHistory = pdfHistory;
6933
- }
6934
-
6935
- get pagesCount() {
6936
- return this.pdfDocument ? this.pdfDocument.numPages : 0;
6937
- }
6938
-
6939
- get page() {
6940
- return this.pdfViewer.currentPageNumber;
6941
- }
6942
-
6943
- set page(value) {
6944
- this.pdfViewer.currentPageNumber = value;
6945
- }
6946
-
6947
- get rotation() {
6948
- return this.pdfViewer.pagesRotation;
6949
- }
6950
-
6951
- set rotation(value) {
6952
- this.pdfViewer.pagesRotation = value;
6953
- }
6954
-
6955
- _goToDestinationHelper(rawDest, namedDest = null, explicitDest) {
6956
- const destRef = explicitDest[0];
6957
- let pageNumber;
6958
-
6959
- if (typeof destRef === "object" && destRef !== null) {
6960
- pageNumber = this._cachedPageNumber(destRef);
6961
-
6962
- if (pageNumber === null) {
6963
- this.pdfDocument.getPageIndex(destRef).then(pageIndex => {
6964
- this.cachePageRef(pageIndex + 1, destRef);
6965
-
6966
- this._goToDestinationHelper(rawDest, namedDest, explicitDest);
6967
- }).catch(() => {
6968
- console.error(`PDFLinkService._goToDestinationHelper: "${destRef}" is not ` + `a valid page reference, for dest="${rawDest}".`);
6969
- });
6970
- return;
6971
- }
6972
- } else if (Number.isInteger(destRef)) {
6973
- pageNumber = destRef + 1;
6974
- } else {
6975
- console.error(`PDFLinkService._goToDestinationHelper: "${destRef}" is not ` + `a valid destination reference, for dest="${rawDest}".`);
6976
- return;
6977
- }
6978
-
6979
- if (!pageNumber || pageNumber < 1 || pageNumber > this.pagesCount) {
6980
- console.error(`PDFLinkService._goToDestinationHelper: "${pageNumber}" is not ` + `a valid page number, for dest="${rawDest}".`);
6981
- return;
6982
- }
6983
-
6984
- if (this.pdfHistory) {
6985
- this.pdfHistory.pushCurrentPosition();
6986
- this.pdfHistory.push({
6987
- namedDest,
6988
- explicitDest,
6989
- pageNumber
6990
- });
6991
- }
6992
-
6993
- this.pdfViewer.scrollPageIntoView({
6994
- pageNumber,
6995
- destArray: explicitDest,
6996
- ignoreDestinationZoom: this._ignoreDestinationZoom
6997
- });
6998
- }
6999
-
7000
- async goToDestination(dest) {
7001
- if (!this.pdfDocument) {
7002
- return;
7003
- }
7004
-
7005
- let namedDest, explicitDest;
7006
-
7007
- if (typeof dest === "string") {
7008
- namedDest = dest;
7009
- explicitDest = await this.pdfDocument.getDestination(dest);
7010
- } else {
7011
- namedDest = null;
7012
- explicitDest = await dest;
7013
- }
7014
-
7015
- if (!Array.isArray(explicitDest)) {
7016
- console.error(`PDFLinkService.goToDestination: "${explicitDest}" is not ` + `a valid destination array, for dest="${dest}".`);
7017
- return;
7018
- }
7019
-
7020
- this._goToDestinationHelper(dest, namedDest, explicitDest);
7021
- }
7022
-
7023
- goToPage(val) {
7024
- if (!this.pdfDocument) {
7025
- return;
7026
- }
7027
-
7028
- const pageNumber = typeof val === "string" && this.pdfViewer.pageLabelToPageNumber(val) || val | 0;
7029
-
7030
- if (!(Number.isInteger(pageNumber) && pageNumber > 0 && pageNumber <= this.pagesCount)) {
7031
- console.error(`PDFLinkService.goToPage: "${val}" is not a valid page.`);
7032
- return;
7033
- }
7034
-
7035
- if (this.pdfHistory) {
7036
- this.pdfHistory.pushCurrentPosition();
7037
- this.pdfHistory.pushPage(pageNumber);
7038
- }
7039
-
7040
- this.pdfViewer.scrollPageIntoView({
7041
- pageNumber
7042
- });
7043
- }
7044
-
7045
- getDestinationHash(dest) {
7046
- if (typeof dest === "string") {
7047
- if (dest.length > 0) {
7048
- return this.getAnchorUrl("#" + escape(dest));
7049
- }
7050
- } else if (Array.isArray(dest)) {
7051
- const str = JSON.stringify(dest);
7052
-
7053
- if (str.length > 0) {
7054
- return this.getAnchorUrl("#" + escape(str));
7055
- }
7056
- }
7057
-
7058
- return this.getAnchorUrl("");
7059
- }
7060
-
7061
- getAnchorUrl(anchor) {
7062
- return (this.baseUrl || "") + anchor;
7063
- }
7064
-
7065
- setHash(hash) {
7066
- if (!this.pdfDocument) {
7067
- return;
7068
- }
7069
-
7070
- let pageNumber, dest;
7071
-
7072
- if (hash.includes("=")) {
7073
- const params = (0, _ui_utils.parseQueryString)(hash);
7074
-
7075
- if ("search" in params) {
7076
- this.eventBus.dispatch("findfromurlhash", {
7077
- source: this,
7078
- query: params.search.replace(/"/g, ""),
7079
- phraseSearch: params.phrase === "true"
7080
- });
7081
- }
7082
-
7083
- if ("page" in params) {
7084
- pageNumber = params.page | 0 || 1;
7085
- }
7086
-
7087
- if ("zoom" in params) {
7088
- const zoomArgs = params.zoom.split(",");
7089
- const zoomArg = zoomArgs[0];
7090
- const zoomArgNumber = parseFloat(zoomArg);
7091
-
7092
- if (!zoomArg.includes("Fit")) {
7093
- dest = [null, {
7094
- name: "XYZ"
7095
- }, zoomArgs.length > 1 ? zoomArgs[1] | 0 : null, zoomArgs.length > 2 ? zoomArgs[2] | 0 : null, zoomArgNumber ? zoomArgNumber / 100 : zoomArg];
7096
- } else {
7097
- if (zoomArg === "Fit" || zoomArg === "FitB") {
7098
- dest = [null, {
7099
- name: zoomArg
7100
- }];
7101
- } else if (zoomArg === "FitH" || zoomArg === "FitBH" || zoomArg === "FitV" || zoomArg === "FitBV") {
7102
- dest = [null, {
7103
- name: zoomArg
7104
- }, zoomArgs.length > 1 ? zoomArgs[1] | 0 : null];
7105
- } else if (zoomArg === "FitR") {
7106
- if (zoomArgs.length !== 5) {
7107
- console.error('PDFLinkService.setHash: Not enough parameters for "FitR".');
7108
- } else {
7109
- dest = [null, {
7110
- name: zoomArg
7111
- }, zoomArgs[1] | 0, zoomArgs[2] | 0, zoomArgs[3] | 0, zoomArgs[4] | 0];
7112
- }
7113
- } else {
7114
- console.error(`PDFLinkService.setHash: "${zoomArg}" is not ` + "a valid zoom value.");
7115
- }
7116
- }
7117
- }
7118
-
7119
- if (dest) {
7120
- this.pdfViewer.scrollPageIntoView({
7121
- pageNumber: pageNumber || this.page,
7122
- destArray: dest,
7123
- allowNegativeOffset: true
7124
- });
7125
- } else if (pageNumber) {
7126
- this.page = pageNumber;
7127
- }
7128
-
7129
- if ("pagemode" in params) {
7130
- this.eventBus.dispatch("pagemode", {
7131
- source: this,
7132
- mode: params.pagemode
7133
- });
7134
- }
7135
-
7136
- if ("nameddest" in params) {
7137
- this.goToDestination(params.nameddest);
7138
- }
7139
- } else {
7140
- dest = unescape(hash);
7141
-
7142
- try {
7143
- dest = JSON.parse(dest);
7144
-
7145
- if (!Array.isArray(dest)) {
7146
- dest = dest.toString();
7147
- }
7148
- } catch (ex) {}
7149
-
7150
- if (typeof dest === "string" || isValidExplicitDestination(dest)) {
7151
- this.goToDestination(dest);
7152
- return;
7153
- }
7154
-
7155
- console.error(`PDFLinkService.setHash: "${unescape(hash)}" is not ` + "a valid destination.");
7156
- }
7157
- }
7158
-
7159
- executeNamedAction(action) {
7160
- switch (action) {
7161
- case "GoBack":
7162
- if (this.pdfHistory) {
7163
- this.pdfHistory.back();
7164
- }
7165
-
7166
- break;
7167
-
7168
- case "GoForward":
7169
- if (this.pdfHistory) {
7170
- this.pdfHistory.forward();
7171
- }
7172
-
7173
- break;
7174
-
7175
- case "NextPage":
7176
- this.pdfViewer.nextPage();
7177
- break;
7178
-
7179
- case "PrevPage":
7180
- this.pdfViewer.previousPage();
7181
- break;
7182
-
7183
- case "LastPage":
7184
- this.page = this.pagesCount;
7185
- break;
7186
-
7187
- case "FirstPage":
7188
- this.page = 1;
7189
- break;
7190
-
7191
- default:
7192
- break;
7193
- }
7194
-
7195
- this.eventBus.dispatch("namedaction", {
7196
- source: this,
7197
- action
7198
- });
7199
- }
7200
-
7201
- cachePageRef(pageNum, pageRef) {
7202
- if (!pageRef) {
7203
- return;
7204
- }
7205
-
7206
- const refStr = pageRef.gen === 0 ? `${pageRef.num}R` : `${pageRef.num}R${pageRef.gen}`;
7207
- this._pagesRefCache[refStr] = pageNum;
7208
- }
7209
-
7210
- _cachedPageNumber(pageRef) {
7211
- const refStr = pageRef.gen === 0 ? `${pageRef.num}R` : `${pageRef.num}R${pageRef.gen}`;
7212
- return this._pagesRefCache?.[refStr] || null;
7213
- }
7214
-
7215
- isPageVisible(pageNumber) {
7216
- return this.pdfViewer.isPageVisible(pageNumber);
7217
- }
7218
-
7219
- isPageCached(pageNumber) {
7220
- return this.pdfViewer.isPageCached(pageNumber);
7221
- }
7222
-
7223
- }
7224
-
7225
- exports.PDFLinkService = PDFLinkService;
7226
-
7227
- function isValidExplicitDestination(dest) {
7228
- if (!Array.isArray(dest)) {
7229
- return false;
7230
- }
7231
-
7232
- const destLength = dest.length;
7233
-
7234
- if (destLength < 2) {
7235
- return false;
7236
- }
7237
-
7238
- const page = dest[0];
7239
-
7240
- if (!(typeof page === "object" && Number.isInteger(page.num) && Number.isInteger(page.gen)) && !(Number.isInteger(page) && page >= 0)) {
7241
- return false;
7242
- }
7243
-
7244
- const zoom = dest[1];
7245
-
7246
- if (!(typeof zoom === "object" && typeof zoom.name === "string")) {
7247
- return false;
7248
- }
7249
-
7250
- let allowNull = true;
7251
-
7252
- switch (zoom.name) {
7253
- case "XYZ":
7254
- if (destLength !== 5) {
7255
- return false;
7256
- }
7257
-
7258
- break;
7259
-
7260
- case "Fit":
7261
- case "FitB":
7262
- return destLength === 2;
7263
-
7264
- case "FitH":
7265
- case "FitBH":
7266
- case "FitV":
7267
- case "FitBV":
7268
- if (destLength !== 3) {
7269
- return false;
7270
- }
7271
-
7272
- break;
7273
-
7274
- case "FitR":
7275
- if (destLength !== 6) {
7276
- return false;
7277
- }
7278
-
7279
- allowNull = false;
7280
- break;
7281
-
7282
- default:
7283
- return false;
7284
- }
7285
-
7286
- for (let i = 2; i < destLength; i++) {
7287
- const param = dest[i];
7288
-
7289
- if (!(typeof param === "number" || allowNull && param === null)) {
7290
- return false;
7291
- }
7292
- }
7293
-
7294
- return true;
7295
- }
7296
-
7297
- class SimpleLinkService {
7298
- constructor() {
7299
- this.externalLinkTarget = null;
7300
- this.externalLinkRel = null;
7301
- this.externalLinkEnabled = true;
7302
- this._ignoreDestinationZoom = false;
7303
- }
7304
-
7305
- get pagesCount() {
7306
- return 0;
7307
- }
7308
-
7309
- get page() {
7310
- return 0;
7311
- }
7312
-
7313
- set page(value) {}
7314
-
7315
- get rotation() {
7316
- return 0;
7317
- }
7318
-
7319
- set rotation(value) {}
7320
-
7321
- async goToDestination(dest) {}
7322
-
7323
- goToPage(val) {}
7324
-
7325
- getDestinationHash(dest) {
7326
- return "#";
7327
- }
7328
-
7329
- getAnchorUrl(hash) {
7330
- return "#";
7331
- }
7332
-
7333
- setHash(hash) {}
7334
-
7335
- executeNamedAction(action) {}
7336
-
7337
- cachePageRef(pageNum, pageRef) {}
7338
-
7339
- isPageVisible(pageNumber) {
7340
- return true;
7341
- }
7342
-
7343
- isPageCached(pageNumber) {
7344
- return true;
7345
- }
7346
-
7347
- }
7348
-
7349
- exports.SimpleLinkService = SimpleLinkService;
7350
-
7351
- /***/ }),
7352
- /* 20 */
7353
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7354
-
7355
-
7356
-
7357
- Object.defineProperty(exports, "__esModule", ({
7358
- value: true
7359
- }));
7360
- exports.PDFOutlineViewer = void 0;
7361
-
7362
- var _pdfjsLib = __webpack_require__(5);
7363
-
7364
- var _base_tree_viewer = __webpack_require__(12);
7365
-
7366
- var _ui_utils = __webpack_require__(4);
7367
-
7368
- class PDFOutlineViewer extends _base_tree_viewer.BaseTreeViewer {
7369
- constructor(options) {
7370
- super(options);
7371
- this.linkService = options.linkService;
7372
-
7373
- this.eventBus._on("toggleoutlinetree", this._toggleAllTreeItems.bind(this));
7374
-
7375
- this.eventBus._on("currentoutlineitem", this._currentOutlineItem.bind(this));
7376
-
7377
- this.eventBus._on("pagechanging", evt => {
7378
- this._currentPageNumber = evt.pageNumber;
7379
- });
7380
-
7381
- this.eventBus._on("pagesloaded", evt => {
7382
- this._isPagesLoaded = !!evt.pagesCount;
7383
-
7384
- if (this._currentOutlineItemCapability && !this._currentOutlineItemCapability.settled) {
7385
- this._currentOutlineItemCapability.resolve(this._isPagesLoaded);
7386
- }
7387
- });
7388
-
7389
- this.eventBus._on("sidebarviewchanged", evt => {
7390
- this._sidebarView = evt.view;
7391
- });
7392
- }
7393
-
7394
- reset() {
7395
- super.reset();
7396
- this._outline = null;
7397
- this._pageNumberToDestHashCapability = null;
7398
- this._currentPageNumber = 1;
7399
- this._isPagesLoaded = false;
7400
-
7401
- if (this._currentOutlineItemCapability && !this._currentOutlineItemCapability.settled) {
7402
- this._currentOutlineItemCapability.resolve(false);
7403
- }
7404
-
7405
- this._currentOutlineItemCapability = null;
7406
- }
7407
-
7408
- _dispatchEvent(outlineCount) {
7409
- this._currentOutlineItemCapability = (0, _pdfjsLib.createPromiseCapability)();
7410
-
7411
- if (outlineCount === 0 || this._pdfDocument?.loadingParams.disableAutoFetch) {
7412
- this._currentOutlineItemCapability.resolve(false);
7413
- } else if (this._isPagesLoaded) {
7414
- this._currentOutlineItemCapability.resolve(true);
7415
- }
7416
-
7417
- this.eventBus.dispatch("outlineloaded", {
7418
- source: this,
7419
- outlineCount,
7420
- currentOutlineItemPromise: this._currentOutlineItemCapability.promise
7421
- });
7422
- }
7423
-
7424
- _bindLink(element, {
7425
- url,
7426
- newWindow,
7427
- dest
7428
- }) {
7429
- const {
7430
- linkService
7431
- } = this;
7432
-
7433
- if (url) {
7434
- (0, _pdfjsLib.addLinkAttributes)(element, {
7435
- url,
7436
- target: newWindow ? _pdfjsLib.LinkTarget.BLANK : linkService.externalLinkTarget,
7437
- rel: linkService.externalLinkRel,
7438
- enabled: linkService.externalLinkEnabled
7439
- });
7440
- return;
7441
- }
7442
-
7443
- element.href = linkService.getDestinationHash(dest);
7444
-
7445
- element.onclick = evt => {
7446
- this._updateCurrentTreeItem(evt.target.parentNode);
7447
-
7448
- if (dest) {
7449
- linkService.goToDestination(dest);
7450
- }
7451
-
7452
- return false;
7453
- };
7454
- }
7455
-
7456
- _setStyles(element, {
7457
- bold,
7458
- italic
7459
- }) {
7460
- if (bold) {
7461
- element.style.fontWeight = "bold";
7462
- }
7463
-
7464
- if (italic) {
7465
- element.style.fontStyle = "italic";
7466
- }
7467
- }
7468
-
7469
- _addToggleButton(div, {
7470
- count,
7471
- items
7472
- }) {
7473
- let hidden = false;
7474
-
7475
- if (count < 0) {
7476
- let totalCount = items.length;
7477
-
7478
- if (totalCount > 0) {
7479
- const queue = [...items];
7480
-
7481
- while (queue.length > 0) {
7482
- const {
7483
- count: nestedCount,
7484
- items: nestedItems
7485
- } = queue.shift();
7486
-
7487
- if (nestedCount > 0 && nestedItems.length > 0) {
7488
- totalCount += nestedItems.length;
7489
- queue.push(...nestedItems);
7490
- }
7491
- }
7492
- }
7493
-
7494
- if (Math.abs(count) === totalCount) {
7495
- hidden = true;
7496
- }
7497
- }
7498
-
7499
- super._addToggleButton(div, hidden);
7500
- }
7501
-
7502
- _toggleAllTreeItems() {
7503
- if (!this._outline) {
7504
- return;
7505
- }
7506
-
7507
- super._toggleAllTreeItems();
7508
- }
7509
-
7510
- render({
7511
- outline,
7512
- pdfDocument
7513
- }) {
7514
- if (this._outline) {
7515
- this.reset();
7516
- }
7517
-
7518
- this._outline = outline || null;
7519
- this._pdfDocument = pdfDocument || null;
7520
-
7521
- if (!outline) {
7522
- this._dispatchEvent(0);
7523
-
7524
- return;
7525
- }
7526
-
7527
- const fragment = document.createDocumentFragment();
7528
- const queue = [{
7529
- parent: fragment,
7530
- items: outline
7531
- }];
7532
- let outlineCount = 0,
7533
- hasAnyNesting = false;
7534
-
7535
- while (queue.length > 0) {
7536
- const levelData = queue.shift();
7537
-
7538
- for (const item of levelData.items) {
7539
- const div = document.createElement("div");
7540
- div.className = "treeItem";
7541
- const element = document.createElement("a");
7542
-
7543
- this._bindLink(element, item);
7544
-
7545
- this._setStyles(element, item);
7546
-
7547
- element.textContent = this._normalizeTextContent(item.title);
7548
- div.appendChild(element);
7549
-
7550
- if (item.items.length > 0) {
7551
- hasAnyNesting = true;
7552
-
7553
- this._addToggleButton(div, item);
7554
-
7555
- const itemsDiv = document.createElement("div");
7556
- itemsDiv.className = "treeItems";
7557
- div.appendChild(itemsDiv);
7558
- queue.push({
7559
- parent: itemsDiv,
7560
- items: item.items
7561
- });
7562
- }
7563
-
7564
- levelData.parent.appendChild(div);
7565
- outlineCount++;
7566
- }
7567
- }
7568
-
7569
- this._finishRendering(fragment, outlineCount, hasAnyNesting);
7570
- }
7571
-
7572
- async _currentOutlineItem() {
7573
- if (!this._isPagesLoaded) {
7574
- throw new Error("_currentOutlineItem: All pages have not been loaded.");
7575
- }
7576
-
7577
- if (!this._outline || !this._pdfDocument) {
7578
- return;
7579
- }
7580
-
7581
- const pageNumberToDestHash = await this._getPageNumberToDestHash(this._pdfDocument);
7582
-
7583
- if (!pageNumberToDestHash) {
7584
- return;
7585
- }
7586
-
7587
- this._updateCurrentTreeItem(null);
7588
-
7589
- if (this._sidebarView !== _ui_utils.SidebarView.OUTLINE) {
7590
- return;
7591
- }
7592
-
7593
- for (let i = this._currentPageNumber; i > 0; i--) {
7594
- const destHash = pageNumberToDestHash.get(i);
7595
-
7596
- if (!destHash) {
7597
- continue;
7598
- }
7599
-
7600
- const linkElement = this.container.querySelector(`a[href="${destHash}"]`);
7601
-
7602
- if (!linkElement) {
7603
- continue;
7604
- }
7605
-
7606
- this._scrollToCurrentTreeItem(linkElement.parentNode);
7607
-
7608
- break;
7609
- }
7610
- }
7611
-
7612
- async _getPageNumberToDestHash(pdfDocument) {
7613
- if (this._pageNumberToDestHashCapability) {
7614
- return this._pageNumberToDestHashCapability.promise;
7615
- }
7616
-
7617
- this._pageNumberToDestHashCapability = (0, _pdfjsLib.createPromiseCapability)();
7618
- const pageNumberToDestHash = new Map(),
7619
- pageNumberNesting = new Map();
7620
- const queue = [{
7621
- nesting: 0,
7622
- items: this._outline
7623
- }];
7624
-
7625
- while (queue.length > 0) {
7626
- const levelData = queue.shift(),
7627
- currentNesting = levelData.nesting;
7628
-
7629
- for (const {
7630
- dest,
7631
- items
7632
- } of levelData.items) {
7633
- let explicitDest, pageNumber;
7634
-
7635
- if (typeof dest === "string") {
7636
- explicitDest = await pdfDocument.getDestination(dest);
7637
-
7638
- if (pdfDocument !== this._pdfDocument) {
7639
- return null;
7640
- }
7641
- } else {
7642
- explicitDest = dest;
7643
- }
7644
-
7645
- if (Array.isArray(explicitDest)) {
7646
- const [destRef] = explicitDest;
7647
-
7648
- if (typeof destRef === "object" && destRef !== null) {
7649
- pageNumber = this.linkService._cachedPageNumber(destRef);
7650
-
7651
- if (!pageNumber) {
7652
- try {
7653
- pageNumber = (await pdfDocument.getPageIndex(destRef)) + 1;
7654
-
7655
- if (pdfDocument !== this._pdfDocument) {
7656
- return null;
7657
- }
7658
-
7659
- this.linkService.cachePageRef(pageNumber, destRef);
7660
- } catch (ex) {}
7661
- }
7662
- } else if (Number.isInteger(destRef)) {
7663
- pageNumber = destRef + 1;
7664
- }
7665
-
7666
- if (Number.isInteger(pageNumber) && (!pageNumberToDestHash.has(pageNumber) || currentNesting > pageNumberNesting.get(pageNumber))) {
7667
- const destHash = this.linkService.getDestinationHash(dest);
7668
- pageNumberToDestHash.set(pageNumber, destHash);
7669
- pageNumberNesting.set(pageNumber, currentNesting);
7670
- }
7671
- }
7672
-
7673
- if (items.length > 0) {
7674
- queue.push({
7675
- nesting: currentNesting + 1,
7676
- items
7677
- });
7678
- }
7679
- }
7680
- }
7681
-
7682
- this._pageNumberToDestHashCapability.resolve(pageNumberToDestHash.size > 0 ? pageNumberToDestHash : null);
7683
-
7684
- return this._pageNumberToDestHashCapability.promise;
7685
- }
7686
-
7687
- }
7688
-
7689
- exports.PDFOutlineViewer = PDFOutlineViewer;
7690
-
7691
- /***/ }),
7692
- /* 21 */
7693
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7694
-
7695
-
7696
-
7697
- Object.defineProperty(exports, "__esModule", ({
7698
- value: true
7699
- }));
7700
- exports.PDFPresentationMode = void 0;
7701
-
7702
- var _ui_utils = __webpack_require__(4);
7703
-
7704
- const DELAY_BEFORE_RESETTING_SWITCH_IN_PROGRESS = 1500;
7705
- const DELAY_BEFORE_HIDING_CONTROLS = 3000;
7706
- const ACTIVE_SELECTOR = "pdfPresentationMode";
7707
- const CONTROLS_SELECTOR = "pdfPresentationModeControls";
7708
- const MOUSE_SCROLL_COOLDOWN_TIME = 50;
7709
- const PAGE_SWITCH_THRESHOLD = 0.1;
7710
- const SWIPE_MIN_DISTANCE_THRESHOLD = 50;
7711
- const SWIPE_ANGLE_THRESHOLD = Math.PI / 6;
7712
-
7713
- class PDFPresentationMode {
7714
- constructor({
7715
- container,
7716
- pdfViewer,
7717
- eventBus
7718
- }) {
7719
- this.container = container;
7720
- this.pdfViewer = pdfViewer;
7721
- this.eventBus = eventBus;
7722
- this.active = false;
7723
- this.args = null;
7724
- this.contextMenuOpen = false;
7725
- this.mouseScrollTimeStamp = 0;
7726
- this.mouseScrollDelta = 0;
7727
- this.touchSwipeState = null;
7728
- }
7729
-
7730
- request() {
7731
- if (this.switchInProgress || this.active || !this.pdfViewer.pagesCount) {
7732
- return false;
7733
- }
7734
-
7735
- this._addFullscreenChangeListeners();
7736
-
7737
- this._setSwitchInProgress();
7738
-
7739
- this._notifyStateChange();
7740
-
7741
- if (this.container.requestFullscreen) {
7742
- this.container.requestFullscreen();
7743
- } else if (this.container.mozRequestFullScreen) {
7744
- this.container.mozRequestFullScreen();
7745
- } else if (this.container.webkitRequestFullscreen) {
7746
- this.container.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
7747
- } else {
7748
- return false;
7749
- }
7750
-
7751
- this.args = {
7752
- page: this.pdfViewer.currentPageNumber,
7753
- previousScale: this.pdfViewer.currentScaleValue
7754
- };
7755
- return true;
7756
- }
7757
-
7758
- _mouseWheel(evt) {
7759
- if (!this.active) {
7760
- return;
7761
- }
7762
-
7763
- evt.preventDefault();
7764
- const delta = (0, _ui_utils.normalizeWheelEventDelta)(evt);
7765
- const currentTime = Date.now();
7766
- const storedTime = this.mouseScrollTimeStamp;
7767
-
7768
- if (currentTime > storedTime && currentTime - storedTime < MOUSE_SCROLL_COOLDOWN_TIME) {
7769
- return;
7770
- }
7771
-
7772
- if (this.mouseScrollDelta > 0 && delta < 0 || this.mouseScrollDelta < 0 && delta > 0) {
7773
- this._resetMouseScrollState();
7774
- }
7775
-
7776
- this.mouseScrollDelta += delta;
7777
-
7778
- if (Math.abs(this.mouseScrollDelta) >= PAGE_SWITCH_THRESHOLD) {
7779
- const totalDelta = this.mouseScrollDelta;
7780
-
7781
- this._resetMouseScrollState();
7782
-
7783
- const success = totalDelta > 0 ? this.pdfViewer.previousPage() : this.pdfViewer.nextPage();
7784
-
7785
- if (success) {
7786
- this.mouseScrollTimeStamp = currentTime;
7787
- }
7788
- }
7789
- }
7790
-
7791
- get isFullscreen() {
7792
- return !!(document.fullscreenElement || document.mozFullScreen || document.webkitIsFullScreen);
7793
- }
7794
-
7795
- _notifyStateChange() {
7796
- let state = _ui_utils.PresentationModeState.NORMAL;
7797
-
7798
- if (this.switchInProgress) {
7799
- state = _ui_utils.PresentationModeState.CHANGING;
7800
- } else if (this.active) {
7801
- state = _ui_utils.PresentationModeState.FULLSCREEN;
7802
- }
7803
-
7804
- this.eventBus.dispatch("presentationmodechanged", {
7805
- source: this,
7806
- state
7807
- });
7808
- }
7809
-
7810
- _setSwitchInProgress() {
7811
- if (this.switchInProgress) {
7812
- clearTimeout(this.switchInProgress);
7813
- }
7814
-
7815
- this.switchInProgress = setTimeout(() => {
7816
- this._removeFullscreenChangeListeners();
7817
-
7818
- delete this.switchInProgress;
7819
-
7820
- this._notifyStateChange();
7821
- }, DELAY_BEFORE_RESETTING_SWITCH_IN_PROGRESS);
7822
- }
7823
-
7824
- _resetSwitchInProgress() {
7825
- if (this.switchInProgress) {
7826
- clearTimeout(this.switchInProgress);
7827
- delete this.switchInProgress;
7828
- }
7829
- }
7830
-
7831
- _enter() {
7832
- this.active = true;
7833
-
7834
- this._resetSwitchInProgress();
7835
-
7836
- this._notifyStateChange();
7837
-
7838
- this.container.classList.add(ACTIVE_SELECTOR);
7839
- setTimeout(() => {
7840
- this.pdfViewer.currentPageNumber = this.args.page;
7841
- this.pdfViewer.currentScaleValue = "page-fit";
7842
- }, 0);
7843
-
7844
- this._addWindowListeners();
7845
-
7846
- this._showControls();
7847
-
7848
- this.contextMenuOpen = false;
7849
- window.getSelection().removeAllRanges();
7850
- }
7851
-
7852
- _exit() {
7853
- const page = this.pdfViewer.currentPageNumber;
7854
- this.container.classList.remove(ACTIVE_SELECTOR);
7855
- setTimeout(() => {
7856
- this.active = false;
7857
-
7858
- this._removeFullscreenChangeListeners();
7859
-
7860
- this._notifyStateChange();
7861
-
7862
- this.pdfViewer.currentScaleValue = this.args.previousScale;
7863
- this.pdfViewer.currentPageNumber = page;
7864
- this.args = null;
7865
- }, 0);
7866
-
7867
- this._removeWindowListeners();
7868
-
7869
- this._hideControls();
7870
-
7871
- this._resetMouseScrollState();
7872
-
7873
- this.contextMenuOpen = false;
7874
- }
7875
-
7876
- _mouseDown(evt) {
7877
- if (this.contextMenuOpen) {
7878
- this.contextMenuOpen = false;
7879
- evt.preventDefault();
7880
- return;
7881
- }
7882
-
7883
- if (evt.button === 0) {
7884
- const isInternalLink = evt.target.href && evt.target.classList.contains("internalLink");
7885
-
7886
- if (!isInternalLink) {
7887
- evt.preventDefault();
7888
-
7889
- if (evt.shiftKey) {
7890
- this.pdfViewer.previousPage();
7891
- } else {
7892
- this.pdfViewer.nextPage();
7893
- }
7894
- }
7895
- }
7896
- }
7897
-
7898
- _contextMenu() {
7899
- this.contextMenuOpen = true;
7900
- }
7901
-
7902
- _showControls() {
7903
- if (this.controlsTimeout) {
7904
- clearTimeout(this.controlsTimeout);
7905
- } else {
7906
- this.container.classList.add(CONTROLS_SELECTOR);
7907
- }
7908
-
7909
- this.controlsTimeout = setTimeout(() => {
7910
- this.container.classList.remove(CONTROLS_SELECTOR);
7911
- delete this.controlsTimeout;
7912
- }, DELAY_BEFORE_HIDING_CONTROLS);
7913
- }
7914
-
7915
- _hideControls() {
7916
- if (!this.controlsTimeout) {
7917
- return;
7918
- }
7919
-
7920
- clearTimeout(this.controlsTimeout);
7921
- this.container.classList.remove(CONTROLS_SELECTOR);
7922
- delete this.controlsTimeout;
7923
- }
7924
-
7925
- _resetMouseScrollState() {
7926
- this.mouseScrollTimeStamp = 0;
7927
- this.mouseScrollDelta = 0;
7928
- }
7929
-
7930
- _touchSwipe(evt) {
7931
- if (!this.active) {
7932
- return;
7933
- }
7934
-
7935
- if (evt.touches.length > 1) {
7936
- this.touchSwipeState = null;
7937
- return;
7938
- }
7939
-
7940
- switch (evt.type) {
7941
- case "touchstart":
7942
- this.touchSwipeState = {
7943
- startX: evt.touches[0].pageX,
7944
- startY: evt.touches[0].pageY,
7945
- endX: evt.touches[0].pageX,
7946
- endY: evt.touches[0].pageY
7947
- };
7948
- break;
7949
-
7950
- case "touchmove":
7951
- if (this.touchSwipeState === null) {
7952
- return;
7953
- }
7954
-
7955
- this.touchSwipeState.endX = evt.touches[0].pageX;
7956
- this.touchSwipeState.endY = evt.touches[0].pageY;
7957
- evt.preventDefault();
7958
- break;
7959
-
7960
- case "touchend":
7961
- if (this.touchSwipeState === null) {
7962
- return;
7963
- }
7964
-
7965
- let delta = 0;
7966
- const dx = this.touchSwipeState.endX - this.touchSwipeState.startX;
7967
- const dy = this.touchSwipeState.endY - this.touchSwipeState.startY;
7968
- const absAngle = Math.abs(Math.atan2(dy, dx));
7969
-
7970
- if (Math.abs(dx) > SWIPE_MIN_DISTANCE_THRESHOLD && (absAngle <= SWIPE_ANGLE_THRESHOLD || absAngle >= Math.PI - SWIPE_ANGLE_THRESHOLD)) {
7971
- delta = dx;
7972
- } else if (Math.abs(dy) > SWIPE_MIN_DISTANCE_THRESHOLD && Math.abs(absAngle - Math.PI / 2) <= SWIPE_ANGLE_THRESHOLD) {
7973
- delta = dy;
7974
- }
7975
-
7976
- if (delta > 0) {
7977
- this.pdfViewer.previousPage();
7978
- } else if (delta < 0) {
7979
- this.pdfViewer.nextPage();
7980
- }
7981
-
7982
- break;
7983
- }
7984
- }
7985
-
7986
- _addWindowListeners() {
7987
- this.showControlsBind = this._showControls.bind(this);
7988
- this.mouseDownBind = this._mouseDown.bind(this);
7989
- this.mouseWheelBind = this._mouseWheel.bind(this);
7990
- this.resetMouseScrollStateBind = this._resetMouseScrollState.bind(this);
7991
- this.contextMenuBind = this._contextMenu.bind(this);
7992
- this.touchSwipeBind = this._touchSwipe.bind(this);
7993
- window.addEventListener("mousemove", this.showControlsBind);
7994
- window.addEventListener("mousedown", this.mouseDownBind);
7995
- window.addEventListener("wheel", this.mouseWheelBind, {
7996
- passive: false
7997
- });
7998
- window.addEventListener("keydown", this.resetMouseScrollStateBind);
7999
- window.addEventListener("contextmenu", this.contextMenuBind);
8000
- window.addEventListener("touchstart", this.touchSwipeBind);
8001
- window.addEventListener("touchmove", this.touchSwipeBind);
8002
- window.addEventListener("touchend", this.touchSwipeBind);
8003
- }
8004
-
8005
- _removeWindowListeners() {
8006
- window.removeEventListener("mousemove", this.showControlsBind);
8007
- window.removeEventListener("mousedown", this.mouseDownBind);
8008
- window.removeEventListener("wheel", this.mouseWheelBind, {
8009
- passive: false
8010
- });
8011
- window.removeEventListener("keydown", this.resetMouseScrollStateBind);
8012
- window.removeEventListener("contextmenu", this.contextMenuBind);
8013
- window.removeEventListener("touchstart", this.touchSwipeBind);
8014
- window.removeEventListener("touchmove", this.touchSwipeBind);
8015
- window.removeEventListener("touchend", this.touchSwipeBind);
8016
- delete this.showControlsBind;
8017
- delete this.mouseDownBind;
8018
- delete this.mouseWheelBind;
8019
- delete this.resetMouseScrollStateBind;
8020
- delete this.contextMenuBind;
8021
- delete this.touchSwipeBind;
8022
- }
8023
-
8024
- _fullscreenChange() {
8025
- if (this.isFullscreen) {
8026
- this._enter();
8027
- } else {
8028
- this._exit();
8029
- }
8030
- }
8031
-
8032
- _addFullscreenChangeListeners() {
8033
- this.fullscreenChangeBind = this._fullscreenChange.bind(this);
8034
- window.addEventListener("fullscreenchange", this.fullscreenChangeBind);
8035
- window.addEventListener("mozfullscreenchange", this.fullscreenChangeBind);
8036
- window.addEventListener("webkitfullscreenchange", this.fullscreenChangeBind);
8037
- }
8038
-
8039
- _removeFullscreenChangeListeners() {
8040
- window.removeEventListener("fullscreenchange", this.fullscreenChangeBind);
8041
- window.removeEventListener("mozfullscreenchange", this.fullscreenChangeBind);
8042
- window.removeEventListener("webkitfullscreenchange", this.fullscreenChangeBind);
8043
- delete this.fullscreenChangeBind;
8044
- }
8045
-
8046
- }
8047
-
8048
- exports.PDFPresentationMode = PDFPresentationMode;
8049
-
8050
- /***/ }),
8051
- /* 22 */
8052
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8053
-
8054
-
8055
-
8056
- Object.defineProperty(exports, "__esModule", ({
8057
- value: true
8058
- }));
8059
- exports.PDFScriptingManager = void 0;
8060
-
8061
- var _pdfjsLib = __webpack_require__(5);
8062
-
8063
- var _ui_utils = __webpack_require__(4);
8064
-
8065
- var _pdf_rendering_queue = __webpack_require__(8);
8066
-
8067
- class PDFScriptingManager {
8068
- constructor({
8069
- eventBus,
8070
- sandboxBundleSrc = null,
8071
- scriptingFactory = null,
8072
- docPropertiesLookup = null
8073
- }) {
8074
- this._pdfDocument = null;
8075
- this._pdfViewer = null;
8076
- this._closeCapability = null;
8077
- this._destroyCapability = null;
8078
- this._scripting = null;
8079
- this._mouseState = Object.create(null);
8080
- this._ready = false;
8081
- this._eventBus = eventBus;
8082
- this._sandboxBundleSrc = sandboxBundleSrc;
8083
- this._scriptingFactory = scriptingFactory;
8084
- this._docPropertiesLookup = docPropertiesLookup;
8085
- }
8086
-
8087
- setViewer(pdfViewer) {
8088
- this._pdfViewer = pdfViewer;
8089
- }
8090
-
8091
- async setDocument(pdfDocument) {
8092
- if (this._pdfDocument) {
8093
- await this._destroyScripting();
8094
- }
8095
-
8096
- this._pdfDocument = pdfDocument;
8097
-
8098
- if (!pdfDocument) {
8099
- return;
8100
- }
8101
-
8102
- const [objects, calculationOrder, docActions] = await Promise.all([pdfDocument.getFieldObjects(), pdfDocument.getCalculationOrderIds(), pdfDocument.getJSActions()]);
8103
-
8104
- if (!objects && !docActions) {
8105
- await this._destroyScripting();
8106
- return;
8107
- }
8108
-
8109
- if (pdfDocument !== this._pdfDocument) {
8110
- return;
8111
- }
8112
-
8113
- try {
8114
- this._scripting = this._createScripting();
8115
- } catch (error) {
8116
- console.error(`PDFScriptingManager.setDocument: "${error?.message}".`);
8117
- await this._destroyScripting();
8118
- return;
8119
- }
8120
-
8121
- this._internalEvents.set("updatefromsandbox", event => {
8122
- if (event?.source !== window) {
8123
- return;
8124
- }
8125
-
8126
- this._updateFromSandbox(event.detail);
8127
- });
8128
-
8129
- this._internalEvents.set("dispatcheventinsandbox", event => {
8130
- this._scripting?.dispatchEventInSandbox(event.detail);
8131
- });
8132
-
8133
- this._internalEvents.set("pagechanging", ({
8134
- pageNumber,
8135
- previous
8136
- }) => {
8137
- if (pageNumber === previous) {
8138
- return;
8139
- }
8140
-
8141
- this._dispatchPageClose(previous);
8142
-
8143
- this._dispatchPageOpen(pageNumber);
8144
- });
8145
-
8146
- this._internalEvents.set("pagerendered", ({
8147
- pageNumber
8148
- }) => {
8149
- if (!this._pageOpenPending.has(pageNumber)) {
8150
- return;
8151
- }
8152
-
8153
- if (pageNumber !== this._pdfViewer.currentPageNumber) {
8154
- return;
8155
- }
8156
-
8157
- this._dispatchPageOpen(pageNumber);
8158
- });
8159
-
8160
- this._internalEvents.set("pagesdestroy", async event => {
8161
- await this._dispatchPageClose(this._pdfViewer.currentPageNumber);
8162
- await this._scripting?.dispatchEventInSandbox({
8163
- id: "doc",
8164
- name: "WillClose"
8165
- });
8166
- this._closeCapability?.resolve();
8167
- });
8168
-
8169
- this._domEvents.set("mousedown", event => {
8170
- this._mouseState.isDown = true;
8171
- });
8172
-
8173
- this._domEvents.set("mouseup", event => {
8174
- this._mouseState.isDown = false;
8175
- });
8176
-
8177
- for (const [name, listener] of this._internalEvents) {
8178
- this._eventBus._on(name, listener);
8179
- }
8180
-
8181
- for (const [name, listener] of this._domEvents) {
8182
- window.addEventListener(name, listener);
8183
- }
8184
-
8185
- try {
8186
- const docProperties = await this._getDocProperties();
8187
-
8188
- if (pdfDocument !== this._pdfDocument) {
8189
- return;
8190
- }
8191
-
8192
- await this._scripting.createSandbox({
8193
- objects,
8194
- calculationOrder,
8195
- appInfo: {
8196
- platform: navigator.platform,
8197
- language: navigator.language
8198
- },
8199
- docInfo: { ...docProperties,
8200
- actions: docActions
8201
- }
8202
- });
8203
-
8204
- this._eventBus.dispatch("sandboxcreated", {
8205
- source: this
8206
- });
8207
- } catch (error) {
8208
- console.error(`PDFScriptingManager.setDocument: "${error?.message}".`);
8209
- await this._destroyScripting();
8210
- return;
8211
- }
8212
-
8213
- await this._scripting?.dispatchEventInSandbox({
8214
- id: "doc",
8215
- name: "Open"
8216
- });
8217
- await this._dispatchPageOpen(this._pdfViewer.currentPageNumber, true);
8218
- Promise.resolve().then(() => {
8219
- if (pdfDocument === this._pdfDocument) {
8220
- this._ready = true;
8221
- }
8222
- });
8223
- }
8224
-
8225
- async dispatchWillSave(detail) {
8226
- return this._scripting?.dispatchEventInSandbox({
8227
- id: "doc",
8228
- name: "WillSave"
8229
- });
8230
- }
8231
-
8232
- async dispatchDidSave(detail) {
8233
- return this._scripting?.dispatchEventInSandbox({
8234
- id: "doc",
8235
- name: "DidSave"
8236
- });
8237
- }
8238
-
8239
- async dispatchWillPrint(detail) {
8240
- return this._scripting?.dispatchEventInSandbox({
8241
- id: "doc",
8242
- name: "WillPrint"
8243
- });
8244
- }
8245
-
8246
- async dispatchDidPrint(detail) {
8247
- return this._scripting?.dispatchEventInSandbox({
8248
- id: "doc",
8249
- name: "DidPrint"
8250
- });
8251
- }
8252
-
8253
- get mouseState() {
8254
- return this._mouseState;
8255
- }
8256
-
8257
- get destroyPromise() {
8258
- return this._destroyCapability?.promise || null;
8259
- }
8260
-
8261
- get ready() {
8262
- return this._ready;
8263
- }
8264
-
8265
- get _internalEvents() {
8266
- return (0, _pdfjsLib.shadow)(this, "_internalEvents", new Map());
8267
- }
8268
-
8269
- get _domEvents() {
8270
- return (0, _pdfjsLib.shadow)(this, "_domEvents", new Map());
8271
- }
8272
-
8273
- get _pageOpenPending() {
8274
- return (0, _pdfjsLib.shadow)(this, "_pageOpenPending", new Set());
8275
- }
8276
-
8277
- get _visitedPages() {
8278
- return (0, _pdfjsLib.shadow)(this, "_visitedPages", new Map());
8279
- }
8280
-
8281
- async _updateFromSandbox(detail) {
8282
- const isInPresentationMode = this._pdfViewer.isInPresentationMode || this._pdfViewer.isChangingPresentationMode;
8283
- const {
8284
- id,
8285
- siblings,
8286
- command,
8287
- value
8288
- } = detail;
8289
-
8290
- if (!id) {
8291
- switch (command) {
8292
- case "clear":
8293
- console.clear();
8294
- break;
8295
-
8296
- case "error":
8297
- console.error(value);
8298
- break;
8299
-
8300
- case "layout":
8301
- this._pdfViewer.spreadMode = (0, _ui_utils.apiPageLayoutToSpreadMode)(value);
8302
- break;
8303
-
8304
- case "page-num":
8305
- this._pdfViewer.currentPageNumber = value + 1;
8306
- break;
8307
-
8308
- case "print":
8309
- await this._pdfViewer.pagesPromise;
8310
-
8311
- this._eventBus.dispatch("print", {
8312
- source: this
8313
- });
8314
-
8315
- break;
8316
-
8317
- case "println":
8318
- console.log(value);
8319
- break;
8320
-
8321
- case "zoom":
8322
- if (isInPresentationMode) {
8323
- return;
8324
- }
8325
-
8326
- this._pdfViewer.currentScaleValue = value;
8327
- break;
8328
- }
8329
-
8330
- return;
8331
- }
8332
-
8333
- if (isInPresentationMode) {
8334
- if (detail.focus) {
8335
- return;
8336
- }
8337
- }
8338
-
8339
- delete detail.id;
8340
- delete detail.siblings;
8341
- const ids = siblings ? [id, ...siblings] : [id];
8342
-
8343
- for (const elementId of ids) {
8344
- const element = document.getElementById(elementId);
8345
-
8346
- if (element) {
8347
- element.dispatchEvent(new CustomEvent("updatefromsandbox", {
8348
- detail
8349
- }));
8350
- } else {
8351
- this._pdfDocument?.annotationStorage.setValue(elementId, detail);
8352
- }
8353
- }
8354
- }
8355
-
8356
- async _dispatchPageOpen(pageNumber, initialize = false) {
8357
- const pdfDocument = this._pdfDocument,
8358
- visitedPages = this._visitedPages;
8359
-
8360
- if (initialize) {
8361
- this._closeCapability = (0, _pdfjsLib.createPromiseCapability)();
8362
- }
8363
-
8364
- if (!this._closeCapability) {
8365
- return;
8366
- }
8367
-
8368
- const pageView = this._pdfViewer.getPageView(pageNumber - 1);
8369
-
8370
- if (pageView?.renderingState !== _pdf_rendering_queue.RenderingStates.FINISHED) {
8371
- this._pageOpenPending.add(pageNumber);
8372
-
8373
- return;
8374
- }
8375
-
8376
- this._pageOpenPending.delete(pageNumber);
8377
-
8378
- const actionsPromise = (async () => {
8379
- const actions = await (!visitedPages.has(pageNumber) ? pageView.pdfPage?.getJSActions() : null);
8380
-
8381
- if (pdfDocument !== this._pdfDocument) {
8382
- return;
8383
- }
8384
-
8385
- await this._scripting?.dispatchEventInSandbox({
8386
- id: "page",
8387
- name: "PageOpen",
8388
- pageNumber,
8389
- actions
8390
- });
8391
- })();
8392
-
8393
- visitedPages.set(pageNumber, actionsPromise);
8394
- }
8395
-
8396
- async _dispatchPageClose(pageNumber) {
8397
- const pdfDocument = this._pdfDocument,
8398
- visitedPages = this._visitedPages;
8399
-
8400
- if (!this._closeCapability) {
8401
- return;
8402
- }
8403
-
8404
- if (this._pageOpenPending.has(pageNumber)) {
8405
- return;
8406
- }
8407
-
8408
- const actionsPromise = visitedPages.get(pageNumber);
8409
-
8410
- if (!actionsPromise) {
8411
- return;
8412
- }
8413
-
8414
- visitedPages.set(pageNumber, null);
8415
- await actionsPromise;
8416
-
8417
- if (pdfDocument !== this._pdfDocument) {
8418
- return;
8419
- }
8420
-
8421
- await this._scripting?.dispatchEventInSandbox({
8422
- id: "page",
8423
- name: "PageClose",
8424
- pageNumber
8425
- });
8426
- }
8427
-
8428
- async _getDocProperties() {
8429
- if (this._docPropertiesLookup) {
8430
- return this._docPropertiesLookup(this._pdfDocument);
8431
- }
8432
-
8433
- throw new Error("_getDocProperties: Unable to lookup properties.");
8434
- }
8435
-
8436
- _createScripting() {
8437
- this._destroyCapability = (0, _pdfjsLib.createPromiseCapability)();
8438
-
8439
- if (this._scripting) {
8440
- throw new Error("_createScripting: Scripting already exists.");
8441
- }
8442
-
8443
- if (this._scriptingFactory) {
8444
- return this._scriptingFactory.createScripting({
8445
- sandboxBundleSrc: this._sandboxBundleSrc
8446
- });
8447
- }
8448
-
8449
- throw new Error("_createScripting: Cannot create scripting.");
8450
- }
8451
-
8452
- async _destroyScripting() {
8453
- if (!this._scripting) {
8454
- this._pdfDocument = null;
8455
- this._destroyCapability?.resolve();
8456
- return;
8457
- }
8458
-
8459
- if (this._closeCapability) {
8460
- await Promise.race([this._closeCapability.promise, new Promise(resolve => {
8461
- setTimeout(resolve, 1000);
8462
- })]).catch(reason => {});
8463
- this._closeCapability = null;
8464
- }
8465
-
8466
- this._pdfDocument = null;
8467
-
8468
- try {
8469
- await this._scripting.destroySandbox();
8470
- } catch (ex) {}
8471
-
8472
- for (const [name, listener] of this._internalEvents) {
8473
- this._eventBus._off(name, listener);
8474
- }
8475
-
8476
- this._internalEvents.clear();
8477
-
8478
- for (const [name, listener] of this._domEvents) {
8479
- window.removeEventListener(name, listener);
8480
- }
8481
-
8482
- this._domEvents.clear();
8483
-
8484
- this._pageOpenPending.clear();
8485
-
8486
- this._visitedPages.clear();
8487
-
8488
- this._scripting = null;
8489
- delete this._mouseState.isDown;
8490
- this._ready = false;
8491
- this._destroyCapability?.resolve();
8492
- }
8493
-
8494
- }
8495
-
8496
- exports.PDFScriptingManager = PDFScriptingManager;
8497
-
8498
- /***/ }),
8499
- /* 23 */
8500
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8501
-
8502
-
8503
-
8504
- Object.defineProperty(exports, "__esModule", ({
8505
- value: true
8506
- }));
8507
- exports.PDFSidebar = void 0;
8508
-
8509
- var _ui_utils = __webpack_require__(4);
8510
-
8511
- var _pdf_rendering_queue = __webpack_require__(8);
8512
-
8513
- const UI_NOTIFICATION_CLASS = "pdfSidebarNotification";
8514
-
8515
- class PDFSidebar {
8516
- constructor({
8517
- elements,
8518
- pdfViewer,
8519
- pdfThumbnailViewer,
8520
- eventBus,
8521
- l10n
8522
- }) {
8523
- this.isOpen = false;
8524
- this.active = _ui_utils.SidebarView.THUMBS;
8525
- this.isInitialViewSet = false;
8526
- this.onToggled = null;
8527
- this.pdfViewer = pdfViewer;
8528
- this.pdfThumbnailViewer = pdfThumbnailViewer;
8529
- this.outerContainer = elements.outerContainer;
8530
- this.viewerContainer = elements.viewerContainer;
8531
- this.toggleButton = elements.toggleButton;
8532
- this.thumbnailButton = elements.thumbnailButton;
8533
- this.outlineButton = elements.outlineButton;
8534
- this.attachmentsButton = elements.attachmentsButton;
8535
- this.layersButton = elements.layersButton;
8536
- this.thumbnailView = elements.thumbnailView;
8537
- this.outlineView = elements.outlineView;
8538
- this.attachmentsView = elements.attachmentsView;
8539
- this.layersView = elements.layersView;
8540
- this._outlineOptionsContainer = elements.outlineOptionsContainer;
8541
- this._currentOutlineItemButton = elements.currentOutlineItemButton;
8542
- this.eventBus = eventBus;
8543
- this.l10n = l10n;
8544
-
8545
- this._addEventListeners();
8546
- }
8547
-
8548
- reset() {
8549
- this.isInitialViewSet = false;
8550
-
8551
- this._hideUINotification(true);
8552
-
8553
- this.switchView(_ui_utils.SidebarView.THUMBS);
8554
- this.outlineButton.disabled = false;
8555
- this.attachmentsButton.disabled = false;
8556
- this.layersButton.disabled = false;
8557
- this._currentOutlineItemButton.disabled = true;
8558
- }
8559
-
8560
- get visibleView() {
8561
- return this.isOpen ? this.active : _ui_utils.SidebarView.NONE;
8562
- }
8563
-
8564
- get isThumbnailViewVisible() {
8565
- return this.isOpen && this.active === _ui_utils.SidebarView.THUMBS;
8566
- }
8567
-
8568
- get isOutlineViewVisible() {
8569
- return this.isOpen && this.active === _ui_utils.SidebarView.OUTLINE;
8570
- }
8571
-
8572
- get isAttachmentsViewVisible() {
8573
- return this.isOpen && this.active === _ui_utils.SidebarView.ATTACHMENTS;
8574
- }
8575
-
8576
- get isLayersViewVisible() {
8577
- return this.isOpen && this.active === _ui_utils.SidebarView.LAYERS;
8578
- }
8579
-
8580
- setInitialView(view = _ui_utils.SidebarView.NONE) {
8581
- if (this.isInitialViewSet) {
8582
- return;
8583
- }
8584
-
8585
- this.isInitialViewSet = true;
8586
-
8587
- if (view === _ui_utils.SidebarView.NONE || view === _ui_utils.SidebarView.UNKNOWN) {
8588
- this._dispatchEvent();
8589
-
8590
- return;
8591
- }
8592
-
8593
- if (!this._switchView(view, true)) {
8594
- this._dispatchEvent();
8595
- }
8596
- }
8597
-
8598
- switchView(view, forceOpen = false) {
8599
- this._switchView(view, forceOpen);
8600
- }
8601
-
8602
- _switchView(view, forceOpen = false) {
8603
- const isViewChanged = view !== this.active;
8604
- let shouldForceRendering = false;
8605
-
8606
- switch (view) {
8607
- case _ui_utils.SidebarView.NONE:
8608
- if (this.isOpen) {
8609
- this.close();
8610
- return true;
8611
- }
8612
-
8613
- return false;
8614
-
8615
- case _ui_utils.SidebarView.THUMBS:
8616
- if (this.isOpen && isViewChanged) {
8617
- shouldForceRendering = true;
8618
- }
8619
-
8620
- break;
8621
-
8622
- case _ui_utils.SidebarView.OUTLINE:
8623
- if (this.outlineButton.disabled) {
8624
- return false;
8625
- }
8626
-
8627
- break;
8628
-
8629
- case _ui_utils.SidebarView.ATTACHMENTS:
8630
- if (this.attachmentsButton.disabled) {
8631
- return false;
8632
- }
8633
-
8634
- break;
8635
-
8636
- case _ui_utils.SidebarView.LAYERS:
8637
- if (this.layersButton.disabled) {
8638
- return false;
8639
- }
8640
-
8641
- break;
8642
-
8643
- default:
8644
- console.error(`PDFSidebar._switchView: "${view}" is not a valid view.`);
8645
- return false;
8646
- }
8647
-
8648
- this.active = view;
8649
- this.thumbnailButton.classList.toggle("toggled", view === _ui_utils.SidebarView.THUMBS);
8650
- this.outlineButton.classList.toggle("toggled", view === _ui_utils.SidebarView.OUTLINE);
8651
- this.attachmentsButton.classList.toggle("toggled", view === _ui_utils.SidebarView.ATTACHMENTS);
8652
- this.layersButton.classList.toggle("toggled", view === _ui_utils.SidebarView.LAYERS);
8653
- this.thumbnailView.classList.toggle("hidden", view !== _ui_utils.SidebarView.THUMBS);
8654
- this.outlineView.classList.toggle("hidden", view !== _ui_utils.SidebarView.OUTLINE);
8655
- this.attachmentsView.classList.toggle("hidden", view !== _ui_utils.SidebarView.ATTACHMENTS);
8656
- this.layersView.classList.toggle("hidden", view !== _ui_utils.SidebarView.LAYERS);
8657
-
8658
- this._outlineOptionsContainer.classList.toggle("hidden", view !== _ui_utils.SidebarView.OUTLINE);
8659
-
8660
- if (forceOpen && !this.isOpen) {
8661
- this.open();
8662
- return true;
8663
- }
8664
-
8665
- if (shouldForceRendering) {
8666
- this._updateThumbnailViewer();
8667
-
8668
- this._forceRendering();
8669
- }
8670
-
8671
- if (isViewChanged) {
8672
- this._dispatchEvent();
8673
- }
8674
-
8675
- return isViewChanged;
8676
- }
8677
-
8678
- open() {
8679
- if (this.isOpen) {
8680
- return;
8681
- }
8682
-
8683
- this.isOpen = true;
8684
- this.toggleButton.classList.add("toggled");
8685
- this.toggleButton.setAttribute("aria-expanded", "true");
8686
- this.outerContainer.classList.add("sidebarMoving", "sidebarOpen");
8687
-
8688
- if (this.active === _ui_utils.SidebarView.THUMBS) {
8689
- this._updateThumbnailViewer();
8690
- }
8691
-
8692
- this._forceRendering();
8693
-
8694
- this._dispatchEvent();
8695
-
8696
- this._hideUINotification();
8697
- }
8698
-
8699
- close() {
8700
- if (!this.isOpen) {
8701
- return;
8702
- }
8703
-
8704
- this.isOpen = false;
8705
- this.toggleButton.classList.remove("toggled");
8706
- this.toggleButton.setAttribute("aria-expanded", "false");
8707
- this.outerContainer.classList.add("sidebarMoving");
8708
- this.outerContainer.classList.remove("sidebarOpen");
8709
-
8710
- this._forceRendering();
8711
-
8712
- this._dispatchEvent();
8713
- }
8714
-
8715
- toggle() {
8716
- if (this.isOpen) {
8717
- this.close();
8718
- } else {
8719
- this.open();
8720
- }
8721
- }
8722
-
8723
- _dispatchEvent() {
8724
- this.eventBus.dispatch("sidebarviewchanged", {
8725
- source: this,
8726
- view: this.visibleView
8727
- });
8728
- }
8729
-
8730
- _forceRendering() {
8731
- if (this.onToggled) {
8732
- this.onToggled();
8733
- } else {
8734
- this.pdfViewer.forceRendering();
8735
- this.pdfThumbnailViewer.forceRendering();
8736
- }
8737
- }
8738
-
8739
- _updateThumbnailViewer() {
8740
- const {
8741
- pdfViewer,
8742
- pdfThumbnailViewer
8743
- } = this;
8744
- const pagesCount = pdfViewer.pagesCount;
8745
-
8746
- for (let pageIndex = 0; pageIndex < pagesCount; pageIndex++) {
8747
- const pageView = pdfViewer.getPageView(pageIndex);
8748
-
8749
- if (pageView?.renderingState === _pdf_rendering_queue.RenderingStates.FINISHED) {
8750
- const thumbnailView = pdfThumbnailViewer.getThumbnail(pageIndex);
8751
- thumbnailView.setImage(pageView);
8752
- }
8753
- }
8754
-
8755
- pdfThumbnailViewer.scrollThumbnailIntoView(pdfViewer.currentPageNumber);
8756
- }
8757
-
8758
- _showUINotification() {
8759
- this.l10n.get("toggle_sidebar_notification2.title").then(msg => {
8760
- this.toggleButton.title = msg;
8761
- });
8762
-
8763
- if (!this.isOpen) {
8764
- this.toggleButton.classList.add(UI_NOTIFICATION_CLASS);
8765
- }
8766
- }
8767
-
8768
- _hideUINotification(reset = false) {
8769
- if (this.isOpen || reset) {
8770
- this.toggleButton.classList.remove(UI_NOTIFICATION_CLASS);
8771
- }
8772
-
8773
- if (reset) {
8774
- this.l10n.get("toggle_sidebar.title").then(msg => {
8775
- this.toggleButton.title = msg;
8776
- });
8777
- }
8778
- }
8779
-
8780
- _addEventListeners() {
8781
- this.viewerContainer.addEventListener("transitionend", evt => {
8782
- if (evt.target === this.viewerContainer) {
8783
- this.outerContainer.classList.remove("sidebarMoving");
8784
- }
8785
- });
8786
- this.toggleButton.addEventListener("click", () => {
8787
- this.toggle();
8788
- });
8789
- this.thumbnailButton.addEventListener("click", () => {
8790
- this.switchView(_ui_utils.SidebarView.THUMBS);
8791
- });
8792
- this.outlineButton.addEventListener("click", () => {
8793
- this.switchView(_ui_utils.SidebarView.OUTLINE);
8794
- });
8795
- this.outlineButton.addEventListener("dblclick", () => {
8796
- this.eventBus.dispatch("toggleoutlinetree", {
8797
- source: this
8798
- });
8799
- });
8800
- this.attachmentsButton.addEventListener("click", () => {
8801
- this.switchView(_ui_utils.SidebarView.ATTACHMENTS);
8802
- });
8803
- this.layersButton.addEventListener("click", () => {
8804
- this.switchView(_ui_utils.SidebarView.LAYERS);
8805
- });
8806
- this.layersButton.addEventListener("dblclick", () => {
8807
- this.eventBus.dispatch("resetlayers", {
8808
- source: this
8809
- });
8810
- });
8811
-
8812
- this._currentOutlineItemButton.addEventListener("click", () => {
8813
- this.eventBus.dispatch("currentoutlineitem", {
8814
- source: this
8815
- });
8816
- });
8817
-
8818
- const onTreeLoaded = (count, button, view) => {
8819
- button.disabled = !count;
8820
-
8821
- if (count) {
8822
- this._showUINotification();
8823
- } else if (this.active === view) {
8824
- this.switchView(_ui_utils.SidebarView.THUMBS);
8825
- }
8826
- };
8827
-
8828
- this.eventBus._on("outlineloaded", evt => {
8829
- onTreeLoaded(evt.outlineCount, this.outlineButton, _ui_utils.SidebarView.OUTLINE);
8830
- evt.currentOutlineItemPromise.then(enabled => {
8831
- if (!this.isInitialViewSet) {
8832
- return;
8833
- }
8834
-
8835
- this._currentOutlineItemButton.disabled = !enabled;
8836
- });
8837
- });
8838
-
8839
- this.eventBus._on("attachmentsloaded", evt => {
8840
- onTreeLoaded(evt.attachmentsCount, this.attachmentsButton, _ui_utils.SidebarView.ATTACHMENTS);
8841
- });
8842
-
8843
- this.eventBus._on("layersloaded", evt => {
8844
- onTreeLoaded(evt.layersCount, this.layersButton, _ui_utils.SidebarView.LAYERS);
8845
- });
8846
-
8847
- this.eventBus._on("presentationmodechanged", evt => {
8848
- if (evt.state === _ui_utils.PresentationModeState.NORMAL && this.isThumbnailViewVisible) {
8849
- this._updateThumbnailViewer();
8850
- }
8851
- });
8852
- }
8853
-
8854
- }
8855
-
8856
- exports.PDFSidebar = PDFSidebar;
8857
-
8858
- /***/ }),
8859
- /* 24 */
8860
- /***/ ((__unused_webpack_module, exports) => {
8861
-
8862
-
8863
-
8864
- Object.defineProperty(exports, "__esModule", ({
8865
- value: true
8866
- }));
8867
- exports.PDFSidebarResizer = void 0;
8868
- const SIDEBAR_WIDTH_VAR = "--sidebar-width";
8869
- const SIDEBAR_MIN_WIDTH = 200;
8870
- const SIDEBAR_RESIZING_CLASS = "sidebarResizing";
8871
-
8872
- class PDFSidebarResizer {
8873
- constructor(options, eventBus, l10n) {
8874
- this.isRTL = false;
8875
- this.sidebarOpen = false;
8876
- this.doc = document.documentElement;
8877
- this._width = null;
8878
- this._outerContainerWidth = null;
8879
- this._boundEvents = Object.create(null);
8880
- this.outerContainer = options.outerContainer;
8881
- this.resizer = options.resizer;
8882
- this.eventBus = eventBus;
8883
- l10n.getDirection().then(dir => {
8884
- this.isRTL = dir === "rtl";
8885
- });
8886
-
8887
- this._addEventListeners();
8888
- }
8889
-
8890
- get outerContainerWidth() {
8891
- return this._outerContainerWidth || (this._outerContainerWidth = this.outerContainer.clientWidth);
8892
- }
8893
-
8894
- _updateWidth(width = 0) {
8895
- const maxWidth = Math.floor(this.outerContainerWidth / 2);
8896
-
8897
- if (width > maxWidth) {
8898
- width = maxWidth;
8899
- }
8900
-
8901
- if (width < SIDEBAR_MIN_WIDTH) {
8902
- width = SIDEBAR_MIN_WIDTH;
8903
- }
8904
-
8905
- if (width === this._width) {
8906
- return false;
8907
- }
8908
-
8909
- this._width = width;
8910
- this.doc.style.setProperty(SIDEBAR_WIDTH_VAR, `${width}px`);
8911
- return true;
8912
- }
8913
-
8914
- _mouseMove(evt) {
8915
- let width = evt.clientX;
8916
-
8917
- if (this.isRTL) {
8918
- width = this.outerContainerWidth - width;
8919
- }
8920
-
8921
- this._updateWidth(width);
8922
- }
8923
-
8924
- _mouseUp(evt) {
8925
- this.outerContainer.classList.remove(SIDEBAR_RESIZING_CLASS);
8926
- this.eventBus.dispatch("resize", {
8927
- source: this
8928
- });
8929
- const _boundEvents = this._boundEvents;
8930
- window.removeEventListener("mousemove", _boundEvents.mouseMove);
8931
- window.removeEventListener("mouseup", _boundEvents.mouseUp);
8932
- }
8933
-
8934
- _addEventListeners() {
8935
- const _boundEvents = this._boundEvents;
8936
- _boundEvents.mouseMove = this._mouseMove.bind(this);
8937
- _boundEvents.mouseUp = this._mouseUp.bind(this);
8938
- this.resizer.addEventListener("mousedown", evt => {
8939
- if (evt.button !== 0) {
8940
- return;
8941
- }
8942
-
8943
- this.outerContainer.classList.add(SIDEBAR_RESIZING_CLASS);
8944
- window.addEventListener("mousemove", _boundEvents.mouseMove);
8945
- window.addEventListener("mouseup", _boundEvents.mouseUp);
8946
- });
8947
-
8948
- this.eventBus._on("sidebarviewchanged", evt => {
8949
- this.sidebarOpen = !!evt?.view;
8950
- });
8951
-
8952
- this.eventBus._on("resize", evt => {
8953
- if (evt?.source !== window) {
8954
- return;
8955
- }
8956
-
8957
- this._outerContainerWidth = null;
8958
-
8959
- if (!this._width) {
8960
- return;
8961
- }
8962
-
8963
- if (!this.sidebarOpen) {
8964
- this._updateWidth(this._width);
8965
-
8966
- return;
8967
- }
8968
-
8969
- this.outerContainer.classList.add(SIDEBAR_RESIZING_CLASS);
8970
-
8971
- const updated = this._updateWidth(this._width);
8972
-
8973
- Promise.resolve().then(() => {
8974
- this.outerContainer.classList.remove(SIDEBAR_RESIZING_CLASS);
8975
-
8976
- if (updated) {
8977
- this.eventBus.dispatch("resize", {
8978
- source: this
8979
- });
8980
- }
8981
- });
8982
- });
8983
- }
8984
-
8985
- }
8986
-
8987
- exports.PDFSidebarResizer = PDFSidebarResizer;
8988
-
8989
- /***/ }),
8990
- /* 25 */
8991
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8992
-
8993
-
8994
-
8995
- Object.defineProperty(exports, "__esModule", ({
8996
- value: true
8997
- }));
8998
- exports.PDFThumbnailViewer = void 0;
8999
-
9000
- var _ui_utils = __webpack_require__(4);
9001
-
9002
- var _pdf_thumbnail_view = __webpack_require__(26);
9003
-
9004
- var _pdf_rendering_queue = __webpack_require__(8);
9005
-
9006
- const THUMBNAIL_SCROLL_MARGIN = -19;
9007
- const THUMBNAIL_SELECTED_CLASS = "selected";
9008
-
9009
- class PDFThumbnailViewer {
9010
- constructor({
9011
- container,
9012
- eventBus,
9013
- linkService,
9014
- renderingQueue,
9015
- l10n
9016
- }) {
9017
- this.container = container;
9018
- this.linkService = linkService;
9019
- this.renderingQueue = renderingQueue;
9020
- this.l10n = l10n;
9021
- this.scroll = (0, _ui_utils.watchScroll)(this.container, this._scrollUpdated.bind(this));
9022
-
9023
- this._resetView();
9024
-
9025
- eventBus._on("optionalcontentconfigchanged", () => {
9026
- this._setImageDisabled = true;
9027
- });
9028
- }
9029
-
9030
- _scrollUpdated() {
9031
- this.renderingQueue.renderHighestPriority();
9032
- }
9033
-
9034
- getThumbnail(index) {
9035
- return this._thumbnails[index];
9036
- }
9037
-
9038
- _getVisibleThumbs() {
9039
- return (0, _ui_utils.getVisibleElements)({
9040
- scrollEl: this.container,
9041
- views: this._thumbnails
9042
- });
9043
- }
9044
-
9045
- scrollThumbnailIntoView(pageNumber) {
9046
- if (!this.pdfDocument) {
9047
- return;
9048
- }
9049
-
9050
- const thumbnailView = this._thumbnails[pageNumber - 1];
9051
-
9052
- if (!thumbnailView) {
9053
- console.error('scrollThumbnailIntoView: Invalid "pageNumber" parameter.');
9054
- return;
9055
- }
9056
-
9057
- if (pageNumber !== this._currentPageNumber) {
9058
- const prevThumbnailView = this._thumbnails[this._currentPageNumber - 1];
9059
- prevThumbnailView.div.classList.remove(THUMBNAIL_SELECTED_CLASS);
9060
- thumbnailView.div.classList.add(THUMBNAIL_SELECTED_CLASS);
9061
- }
9062
-
9063
- const visibleThumbs = this._getVisibleThumbs();
9064
-
9065
- const numVisibleThumbs = visibleThumbs.views.length;
9066
-
9067
- if (numVisibleThumbs > 0) {
9068
- const first = visibleThumbs.first.id;
9069
- const last = numVisibleThumbs > 1 ? visibleThumbs.last.id : first;
9070
- let shouldScroll = false;
9071
-
9072
- if (pageNumber <= first || pageNumber >= last) {
9073
- shouldScroll = true;
9074
- } else {
9075
- visibleThumbs.views.some(function (view) {
9076
- if (view.id !== pageNumber) {
9077
- return false;
9078
- }
9079
-
9080
- shouldScroll = view.percent < 100;
9081
- return true;
9082
- });
9083
- }
9084
-
9085
- if (shouldScroll) {
9086
- (0, _ui_utils.scrollIntoView)(thumbnailView.div, {
9087
- top: THUMBNAIL_SCROLL_MARGIN
9088
- });
9089
- }
9090
- }
9091
-
9092
- this._currentPageNumber = pageNumber;
9093
- }
9094
-
9095
- get pagesRotation() {
9096
- return this._pagesRotation;
9097
- }
9098
-
9099
- set pagesRotation(rotation) {
9100
- if (!(0, _ui_utils.isValidRotation)(rotation)) {
9101
- throw new Error("Invalid thumbnails rotation angle.");
9102
- }
9103
-
9104
- if (!this.pdfDocument) {
9105
- return;
9106
- }
9107
-
9108
- if (this._pagesRotation === rotation) {
9109
- return;
9110
- }
9111
-
9112
- this._pagesRotation = rotation;
9113
-
9114
- for (let i = 0, ii = this._thumbnails.length; i < ii; i++) {
9115
- this._thumbnails[i].update(rotation);
9116
- }
9117
- }
9118
-
9119
- cleanup() {
9120
- for (let i = 0, ii = this._thumbnails.length; i < ii; i++) {
9121
- if (this._thumbnails[i] && this._thumbnails[i].renderingState !== _pdf_rendering_queue.RenderingStates.FINISHED) {
9122
- this._thumbnails[i].reset();
9123
- }
9124
- }
9125
-
9126
- _pdf_thumbnail_view.TempImageFactory.destroyCanvas();
9127
- }
9128
-
9129
- _resetView() {
9130
- this._thumbnails = [];
9131
- this._currentPageNumber = 1;
9132
- this._pageLabels = null;
9133
- this._pagesRotation = 0;
9134
- this._optionalContentConfigPromise = null;
9135
- this._pagesRequests = new WeakMap();
9136
- this._setImageDisabled = false;
9137
- this.container.textContent = "";
9138
- }
9139
-
9140
- setDocument(pdfDocument) {
9141
- if (this.pdfDocument) {
9142
- this._cancelRendering();
9143
-
9144
- this._resetView();
9145
- }
9146
-
9147
- this.pdfDocument = pdfDocument;
9148
-
9149
- if (!pdfDocument) {
9150
- return;
9151
- }
9152
-
9153
- const firstPagePromise = pdfDocument.getPage(1);
9154
- const optionalContentConfigPromise = pdfDocument.getOptionalContentConfig();
9155
- firstPagePromise.then(firstPdfPage => {
9156
- this._optionalContentConfigPromise = optionalContentConfigPromise;
9157
- const pagesCount = pdfDocument.numPages;
9158
- const viewport = firstPdfPage.getViewport({
9159
- scale: 1
9160
- });
9161
-
9162
- const checkSetImageDisabled = () => {
9163
- return this._setImageDisabled;
9164
- };
9165
-
9166
- for (let pageNum = 1; pageNum <= pagesCount; ++pageNum) {
9167
- const thumbnail = new _pdf_thumbnail_view.PDFThumbnailView({
9168
- container: this.container,
9169
- id: pageNum,
9170
- defaultViewport: viewport.clone(),
9171
- optionalContentConfigPromise,
9172
- linkService: this.linkService,
9173
- renderingQueue: this.renderingQueue,
9174
- checkSetImageDisabled,
9175
- l10n: this.l10n
9176
- });
9177
-
9178
- this._thumbnails.push(thumbnail);
9179
- }
9180
-
9181
- const firstThumbnailView = this._thumbnails[0];
9182
-
9183
- if (firstThumbnailView) {
9184
- firstThumbnailView.setPdfPage(firstPdfPage);
9185
- }
9186
-
9187
- const thumbnailView = this._thumbnails[this._currentPageNumber - 1];
9188
- thumbnailView.div.classList.add(THUMBNAIL_SELECTED_CLASS);
9189
- }).catch(reason => {
9190
- console.error("Unable to initialize thumbnail viewer", reason);
9191
- });
9192
- }
9193
-
9194
- _cancelRendering() {
9195
- for (let i = 0, ii = this._thumbnails.length; i < ii; i++) {
9196
- if (this._thumbnails[i]) {
9197
- this._thumbnails[i].cancelRendering();
9198
- }
9199
- }
9200
- }
9201
-
9202
- setPageLabels(labels) {
9203
- if (!this.pdfDocument) {
9204
- return;
9205
- }
9206
-
9207
- if (!labels) {
9208
- this._pageLabels = null;
9209
- } else if (!(Array.isArray(labels) && this.pdfDocument.numPages === labels.length)) {
9210
- this._pageLabels = null;
9211
- console.error("PDFThumbnailViewer_setPageLabels: Invalid page labels.");
9212
- } else {
9213
- this._pageLabels = labels;
9214
- }
9215
-
9216
- for (let i = 0, ii = this._thumbnails.length; i < ii; i++) {
9217
- this._thumbnails[i].setPageLabel(this._pageLabels?.[i] ?? null);
9218
- }
9219
- }
9220
-
9221
- _ensurePdfPageLoaded(thumbView) {
9222
- if (thumbView.pdfPage) {
9223
- return Promise.resolve(thumbView.pdfPage);
9224
- }
9225
-
9226
- if (this._pagesRequests.has(thumbView)) {
9227
- return this._pagesRequests.get(thumbView);
9228
- }
9229
-
9230
- const promise = this.pdfDocument.getPage(thumbView.id).then(pdfPage => {
9231
- if (!thumbView.pdfPage) {
9232
- thumbView.setPdfPage(pdfPage);
9233
- }
9234
-
9235
- this._pagesRequests.delete(thumbView);
9236
-
9237
- return pdfPage;
9238
- }).catch(reason => {
9239
- console.error("Unable to get page for thumb view", reason);
9240
-
9241
- this._pagesRequests.delete(thumbView);
9242
- });
9243
-
9244
- this._pagesRequests.set(thumbView, promise);
9245
-
9246
- return promise;
9247
- }
9248
-
9249
- forceRendering() {
9250
- const visibleThumbs = this._getVisibleThumbs();
9251
-
9252
- const thumbView = this.renderingQueue.getHighestPriority(visibleThumbs, this._thumbnails, this.scroll.down);
9253
-
9254
- if (thumbView) {
9255
- this._ensurePdfPageLoaded(thumbView).then(() => {
9256
- this.renderingQueue.renderView(thumbView);
9257
- });
9258
-
9259
- return true;
9260
- }
9261
-
9262
- return false;
9263
- }
9264
-
9265
- }
9266
-
9267
- exports.PDFThumbnailViewer = PDFThumbnailViewer;
9268
-
9269
- /***/ }),
9270
- /* 26 */
9271
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9272
-
9273
-
9274
-
9275
- Object.defineProperty(exports, "__esModule", ({
9276
- value: true
9277
- }));
9278
- exports.TempImageFactory = exports.PDFThumbnailView = void 0;
9279
-
9280
- var _ui_utils = __webpack_require__(4);
9281
-
9282
- var _pdfjsLib = __webpack_require__(5);
9283
-
9284
- var _pdf_rendering_queue = __webpack_require__(8);
9285
-
9286
- const DRAW_UPSCALE_FACTOR = 2;
9287
- const MAX_NUM_SCALING_STEPS = 3;
9288
- const THUMBNAIL_CANVAS_BORDER_WIDTH = 1;
9289
- const THUMBNAIL_WIDTH = 98;
9290
-
9291
- const TempImageFactory = function TempImageFactoryClosure() {
9292
- let tempCanvasCache = null;
9293
- return {
9294
- getCanvas(width, height) {
9295
- let tempCanvas = tempCanvasCache;
9296
-
9297
- if (!tempCanvas) {
9298
- tempCanvas = document.createElement("canvas");
9299
- tempCanvasCache = tempCanvas;
9300
- }
9301
-
9302
- tempCanvas.width = width;
9303
- tempCanvas.height = height;
9304
- tempCanvas.mozOpaque = true;
9305
- const ctx = tempCanvas.getContext("2d", {
9306
- alpha: false
9307
- });
9308
- ctx.save();
9309
- ctx.fillStyle = "rgb(255, 255, 255)";
9310
- ctx.fillRect(0, 0, width, height);
9311
- ctx.restore();
9312
- return [tempCanvas, tempCanvas.getContext("2d")];
9313
- },
9314
-
9315
- destroyCanvas() {
9316
- const tempCanvas = tempCanvasCache;
9317
-
9318
- if (tempCanvas) {
9319
- tempCanvas.width = 0;
9320
- tempCanvas.height = 0;
9321
- }
9322
-
9323
- tempCanvasCache = null;
9324
- }
9325
-
9326
- };
9327
- }();
9328
-
9329
- exports.TempImageFactory = TempImageFactory;
9330
-
9331
- class PDFThumbnailView {
9332
- constructor({
9333
- container,
9334
- id,
9335
- defaultViewport,
9336
- optionalContentConfigPromise,
9337
- linkService,
9338
- renderingQueue,
9339
- checkSetImageDisabled,
9340
- l10n
9341
- }) {
9342
- this.id = id;
9343
- this.renderingId = "thumbnail" + id;
9344
- this.pageLabel = null;
9345
- this.pdfPage = null;
9346
- this.rotation = 0;
9347
- this.viewport = defaultViewport;
9348
- this.pdfPageRotate = defaultViewport.rotation;
9349
- this._optionalContentConfigPromise = optionalContentConfigPromise || null;
9350
- this.linkService = linkService;
9351
- this.renderingQueue = renderingQueue;
9352
- this.renderTask = null;
9353
- this.renderingState = _pdf_rendering_queue.RenderingStates.INITIAL;
9354
- this.resume = null;
9355
-
9356
- this._checkSetImageDisabled = checkSetImageDisabled || function () {
9357
- return false;
9358
- };
9359
-
9360
- const pageWidth = this.viewport.width,
9361
- pageHeight = this.viewport.height,
9362
- pageRatio = pageWidth / pageHeight;
9363
- this.canvasWidth = THUMBNAIL_WIDTH;
9364
- this.canvasHeight = this.canvasWidth / pageRatio | 0;
9365
- this.scale = this.canvasWidth / pageWidth;
9366
- this.l10n = l10n;
9367
- const anchor = document.createElement("a");
9368
- anchor.href = linkService.getAnchorUrl("#page=" + id);
9369
-
9370
- this._thumbPageTitle.then(msg => {
9371
- anchor.title = msg;
9372
- });
9373
-
9374
- anchor.onclick = function () {
9375
- linkService.goToPage(id);
9376
- return false;
9377
- };
9378
-
9379
- this.anchor = anchor;
9380
- const div = document.createElement("div");
9381
- div.className = "thumbnail";
9382
- div.setAttribute("data-page-number", this.id);
9383
- this.div = div;
9384
- const ring = document.createElement("div");
9385
- ring.className = "thumbnailSelectionRing";
9386
- const borderAdjustment = 2 * THUMBNAIL_CANVAS_BORDER_WIDTH;
9387
- ring.style.width = this.canvasWidth + borderAdjustment + "px";
9388
- ring.style.height = this.canvasHeight + borderAdjustment + "px";
9389
- this.ring = ring;
9390
- div.appendChild(ring);
9391
- anchor.appendChild(div);
9392
- container.appendChild(anchor);
9393
- }
9394
-
9395
- setPdfPage(pdfPage) {
9396
- this.pdfPage = pdfPage;
9397
- this.pdfPageRotate = pdfPage.rotate;
9398
- const totalRotation = (this.rotation + this.pdfPageRotate) % 360;
9399
- this.viewport = pdfPage.getViewport({
9400
- scale: 1,
9401
- rotation: totalRotation
9402
- });
9403
- this.reset();
9404
- }
9405
-
9406
- reset() {
9407
- this.cancelRendering();
9408
- this.renderingState = _pdf_rendering_queue.RenderingStates.INITIAL;
9409
- const pageWidth = this.viewport.width,
9410
- pageHeight = this.viewport.height,
9411
- pageRatio = pageWidth / pageHeight;
9412
- this.canvasHeight = this.canvasWidth / pageRatio | 0;
9413
- this.scale = this.canvasWidth / pageWidth;
9414
- this.div.removeAttribute("data-loaded");
9415
- const ring = this.ring;
9416
- ring.textContent = "";
9417
- const borderAdjustment = 2 * THUMBNAIL_CANVAS_BORDER_WIDTH;
9418
- ring.style.width = this.canvasWidth + borderAdjustment + "px";
9419
- ring.style.height = this.canvasHeight + borderAdjustment + "px";
9420
-
9421
- if (this.canvas) {
9422
- this.canvas.width = 0;
9423
- this.canvas.height = 0;
9424
- delete this.canvas;
9425
- }
9426
-
9427
- if (this.image) {
9428
- this.image.removeAttribute("src");
9429
- delete this.image;
9430
- }
9431
- }
9432
-
9433
- update(rotation) {
9434
- if (typeof rotation !== "undefined") {
9435
- this.rotation = rotation;
9436
- }
9437
-
9438
- const totalRotation = (this.rotation + this.pdfPageRotate) % 360;
9439
- this.viewport = this.viewport.clone({
9440
- scale: 1,
9441
- rotation: totalRotation
9442
- });
9443
- this.reset();
9444
- }
9445
-
9446
- cancelRendering() {
9447
- if (this.renderTask) {
9448
- this.renderTask.cancel();
9449
- this.renderTask = null;
9450
- }
9451
-
9452
- this.resume = null;
9453
- }
9454
-
9455
- _getPageDrawContext(upscaleFactor = 1) {
9456
- const canvas = document.createElement("canvas");
9457
- canvas.mozOpaque = true;
9458
- const ctx = canvas.getContext("2d", {
9459
- alpha: false
9460
- });
9461
- const outputScale = (0, _ui_utils.getOutputScale)(ctx);
9462
- canvas.width = upscaleFactor * this.canvasWidth * outputScale.sx | 0;
9463
- canvas.height = upscaleFactor * this.canvasHeight * outputScale.sy | 0;
9464
- const transform = outputScale.scaled ? [outputScale.sx, 0, 0, outputScale.sy, 0, 0] : null;
9465
- return {
9466
- ctx,
9467
- canvas,
9468
- transform
9469
- };
9470
- }
9471
-
9472
- _convertCanvasToImage(canvas) {
9473
- if (this.renderingState !== _pdf_rendering_queue.RenderingStates.FINISHED) {
9474
- throw new Error("_convertCanvasToImage: Rendering has not finished.");
9475
- }
9476
-
9477
- const reducedCanvas = this._reduceImage(canvas);
9478
-
9479
- const image = document.createElement("img");
9480
- image.className = "thumbnailImage";
9481
-
9482
- this._thumbPageCanvas.then(msg => {
9483
- image.setAttribute("aria-label", msg);
9484
- });
9485
-
9486
- image.style.width = this.canvasWidth + "px";
9487
- image.style.height = this.canvasHeight + "px";
9488
- image.src = reducedCanvas.toDataURL();
9489
- this.image = image;
9490
- this.div.setAttribute("data-loaded", true);
9491
- this.ring.appendChild(image);
9492
- reducedCanvas.width = 0;
9493
- reducedCanvas.height = 0;
9494
- }
9495
-
9496
- draw() {
9497
- if (this.renderingState !== _pdf_rendering_queue.RenderingStates.INITIAL) {
9498
- console.error("Must be in new state before drawing");
9499
- return Promise.resolve(undefined);
9500
- }
9501
-
9502
- const {
9503
- pdfPage
9504
- } = this;
9505
-
9506
- if (!pdfPage) {
9507
- this.renderingState = _pdf_rendering_queue.RenderingStates.FINISHED;
9508
- return Promise.reject(new Error("pdfPage is not loaded"));
9509
- }
9510
-
9511
- this.renderingState = _pdf_rendering_queue.RenderingStates.RUNNING;
9512
-
9513
- const finishRenderTask = async (error = null) => {
9514
- if (renderTask === this.renderTask) {
9515
- this.renderTask = null;
9516
- }
9517
-
9518
- if (error instanceof _pdfjsLib.RenderingCancelledException) {
9519
- return;
9520
- }
9521
-
9522
- this.renderingState = _pdf_rendering_queue.RenderingStates.FINISHED;
9523
-
9524
- this._convertCanvasToImage(canvas);
9525
-
9526
- if (error) {
9527
- throw error;
9528
- }
9529
- };
9530
-
9531
- const {
9532
- ctx,
9533
- canvas,
9534
- transform
9535
- } = this._getPageDrawContext(DRAW_UPSCALE_FACTOR);
9536
-
9537
- const drawViewport = this.viewport.clone({
9538
- scale: DRAW_UPSCALE_FACTOR * this.scale
9539
- });
9540
-
9541
- const renderContinueCallback = cont => {
9542
- if (!this.renderingQueue.isHighestPriority(this)) {
9543
- this.renderingState = _pdf_rendering_queue.RenderingStates.PAUSED;
9544
-
9545
- this.resume = () => {
9546
- this.renderingState = _pdf_rendering_queue.RenderingStates.RUNNING;
9547
- cont();
9548
- };
9549
-
9550
- return;
9551
- }
9552
-
9553
- cont();
9554
- };
9555
-
9556
- const renderContext = {
9557
- canvasContext: ctx,
9558
- transform,
9559
- viewport: drawViewport,
9560
- optionalContentConfigPromise: this._optionalContentConfigPromise
9561
- };
9562
- const renderTask = this.renderTask = pdfPage.render(renderContext);
9563
- renderTask.onContinue = renderContinueCallback;
9564
- const resultPromise = renderTask.promise.then(function () {
9565
- return finishRenderTask(null);
9566
- }, function (error) {
9567
- return finishRenderTask(error);
9568
- });
9569
- resultPromise.finally(() => {
9570
- canvas.width = 0;
9571
- canvas.height = 0;
9572
- const pageCached = this.linkService.isPageCached(this.id);
9573
-
9574
- if (!pageCached) {
9575
- this.pdfPage?.cleanup();
9576
- }
9577
- });
9578
- return resultPromise;
9579
- }
9580
-
9581
- setImage(pageView) {
9582
- if (this._checkSetImageDisabled()) {
9583
- return;
9584
- }
9585
-
9586
- if (this.renderingState !== _pdf_rendering_queue.RenderingStates.INITIAL) {
9587
- return;
9588
- }
9589
-
9590
- const {
9591
- canvas,
9592
- pdfPage
9593
- } = pageView;
9594
-
9595
- if (!canvas) {
9596
- return;
9597
- }
9598
-
9599
- if (!this.pdfPage) {
9600
- this.setPdfPage(pdfPage);
9601
- }
9602
-
9603
- this.renderingState = _pdf_rendering_queue.RenderingStates.FINISHED;
9604
-
9605
- this._convertCanvasToImage(canvas);
9606
- }
9607
-
9608
- _reduceImage(img) {
9609
- const {
9610
- ctx,
9611
- canvas
9612
- } = this._getPageDrawContext();
9613
-
9614
- if (img.width <= 2 * canvas.width) {
9615
- ctx.drawImage(img, 0, 0, img.width, img.height, 0, 0, canvas.width, canvas.height);
9616
- return canvas;
9617
- }
9618
-
9619
- let reducedWidth = canvas.width << MAX_NUM_SCALING_STEPS;
9620
- let reducedHeight = canvas.height << MAX_NUM_SCALING_STEPS;
9621
- const [reducedImage, reducedImageCtx] = TempImageFactory.getCanvas(reducedWidth, reducedHeight);
9622
-
9623
- while (reducedWidth > img.width || reducedHeight > img.height) {
9624
- reducedWidth >>= 1;
9625
- reducedHeight >>= 1;
9626
- }
9627
-
9628
- reducedImageCtx.drawImage(img, 0, 0, img.width, img.height, 0, 0, reducedWidth, reducedHeight);
9629
-
9630
- while (reducedWidth > 2 * canvas.width) {
9631
- reducedImageCtx.drawImage(reducedImage, 0, 0, reducedWidth, reducedHeight, 0, 0, reducedWidth >> 1, reducedHeight >> 1);
9632
- reducedWidth >>= 1;
9633
- reducedHeight >>= 1;
9634
- }
9635
-
9636
- ctx.drawImage(reducedImage, 0, 0, reducedWidth, reducedHeight, 0, 0, canvas.width, canvas.height);
9637
- return canvas;
9638
- }
9639
-
9640
- get _thumbPageTitle() {
9641
- return this.l10n.get("thumb_page_title", {
9642
- page: this.pageLabel ?? this.id
9643
- });
9644
- }
9645
-
9646
- get _thumbPageCanvas() {
9647
- return this.l10n.get("thumb_page_canvas", {
9648
- page: this.pageLabel ?? this.id
9649
- });
9650
- }
9651
-
9652
- setPageLabel(label) {
9653
- this.pageLabel = typeof label === "string" ? label : null;
9654
-
9655
- this._thumbPageTitle.then(msg => {
9656
- this.anchor.title = msg;
9657
- });
9658
-
9659
- if (this.renderingState !== _pdf_rendering_queue.RenderingStates.FINISHED) {
9660
- return;
9661
- }
9662
-
9663
- this._thumbPageCanvas.then(msg => {
9664
- this.image?.setAttribute("aria-label", msg);
9665
- });
9666
- }
9667
-
9668
- }
9669
-
9670
- exports.PDFThumbnailView = PDFThumbnailView;
9671
-
9672
- /***/ }),
9673
- /* 27 */
9674
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9675
-
9676
-
9677
-
9678
- Object.defineProperty(exports, "__esModule", ({
9679
- value: true
9680
- }));
9681
- exports.PDFViewer = void 0;
9682
-
9683
- var _ui_utils = __webpack_require__(4);
9684
-
9685
- var _base_viewer = __webpack_require__(28);
9686
-
9687
- var _pdfjsLib = __webpack_require__(5);
9688
-
9689
- class PDFViewer extends _base_viewer.BaseViewer {
9690
- get _viewerElement() {
9691
- return (0, _pdfjsLib.shadow)(this, "_viewerElement", this.viewer);
9692
- }
9693
-
9694
- _scrollIntoView({
9695
- pageDiv,
9696
- pageSpot = null,
9697
- pageNumber = null
9698
- }) {
9699
- if (!pageSpot && !this.isInPresentationMode) {
9700
- const left = pageDiv.offsetLeft + pageDiv.clientLeft;
9701
- const right = left + pageDiv.clientWidth;
9702
- const {
9703
- scrollLeft,
9704
- clientWidth
9705
- } = this.container;
9706
-
9707
- if (this._isScrollModeHorizontal || left < scrollLeft || right > scrollLeft + clientWidth) {
9708
- pageSpot = {
9709
- left: 0,
9710
- top: 0
9711
- };
9712
- }
9713
- }
9714
-
9715
- super._scrollIntoView({
9716
- pageDiv,
9717
- pageSpot,
9718
- pageNumber
9719
- });
9720
- }
9721
-
9722
- _getVisiblePages() {
9723
- if (this.isInPresentationMode) {
9724
- return this._getCurrentVisiblePage();
9725
- }
9726
-
9727
- return super._getVisiblePages();
9728
- }
9729
-
9730
- _updateHelper(visiblePages) {
9731
- if (this.isInPresentationMode) {
9732
- return;
9733
- }
9734
-
9735
- let currentId = this._currentPageNumber;
9736
- let stillFullyVisible = false;
9737
-
9738
- for (const page of visiblePages) {
9739
- if (page.percent < 100) {
9740
- break;
9741
- }
9742
-
9743
- if (page.id === currentId && this._scrollMode === _ui_utils.ScrollMode.VERTICAL && this._spreadMode === _ui_utils.SpreadMode.NONE) {
9744
- stillFullyVisible = true;
9745
- break;
9746
- }
9747
- }
9748
-
9749
- if (!stillFullyVisible) {
9750
- currentId = visiblePages[0].id;
9751
- }
9752
-
9753
- this._setCurrentPageNumber(currentId);
9754
- }
9755
-
9756
- }
9757
-
9758
- exports.PDFViewer = PDFViewer;
9759
-
9760
- /***/ }),
9761
- /* 28 */
9762
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9763
-
9764
-
9765
-
9766
- Object.defineProperty(exports, "__esModule", ({
9767
- value: true
9768
- }));
9769
- exports.BaseViewer = void 0;
9770
-
9771
- var _pdfjsLib = __webpack_require__(5);
9772
-
9773
- var _ui_utils = __webpack_require__(4);
9774
-
9775
- var _pdf_rendering_queue = __webpack_require__(8);
9776
-
9777
- var _annotation_layer_builder = __webpack_require__(29);
9778
-
9779
- var _l10n_utils = __webpack_require__(30);
9780
-
9781
- var _pdf_page_view = __webpack_require__(31);
9782
-
9783
- var _pdf_link_service = __webpack_require__(19);
9784
-
9785
- var _struct_tree_layer_builder = __webpack_require__(32);
9786
-
9787
- var _text_layer_builder = __webpack_require__(33);
9788
-
9789
- var _xfa_layer_builder = __webpack_require__(34);
9790
-
9791
- const DEFAULT_CACHE_SIZE = 10;
9792
-
9793
- function PDFPageViewBuffer(size) {
9794
- const data = [];
9795
-
9796
- this.push = function (view) {
9797
- const i = data.indexOf(view);
9798
-
9799
- if (i >= 0) {
9800
- data.splice(i, 1);
9801
- }
9802
-
9803
- data.push(view);
9804
-
9805
- if (data.length > size) {
9806
- data.shift().destroy();
9807
- }
9808
- };
9809
-
9810
- this.resize = function (newSize, pagesToKeep) {
9811
- size = newSize;
9812
-
9813
- if (pagesToKeep) {
9814
- const pageIdsToKeep = new Set();
9815
-
9816
- for (let i = 0, iMax = pagesToKeep.length; i < iMax; ++i) {
9817
- pageIdsToKeep.add(pagesToKeep[i].id);
9818
- }
9819
-
9820
- (0, _ui_utils.moveToEndOfArray)(data, function (page) {
9821
- return pageIdsToKeep.has(page.id);
9822
- });
9823
- }
9824
-
9825
- while (data.length > size) {
9826
- data.shift().destroy();
9827
- }
9828
- };
9829
-
9830
- this.has = function (view) {
9831
- return data.includes(view);
9832
- };
9833
- }
9834
-
9835
- function isSameScale(oldScale, newScale) {
9836
- if (newScale === oldScale) {
9837
- return true;
9838
- }
9839
-
9840
- if (Math.abs(newScale - oldScale) < 1e-15) {
9841
- return true;
9842
- }
9843
-
9844
- return false;
9845
- }
9846
-
9847
- class BaseViewer {
9848
- constructor(options) {
9849
- if (this.constructor === BaseViewer) {
9850
- throw new Error("Cannot initialize BaseViewer.");
9851
- }
9852
-
9853
- const viewerVersion = '2.10.377';
9854
-
9855
- if (_pdfjsLib.version !== viewerVersion) {
9856
- throw new Error(`The API version "${_pdfjsLib.version}" does not match the Viewer version "${viewerVersion}".`);
9857
- }
9858
-
9859
- this._name = this.constructor.name;
9860
- this.container = options.container;
9861
- this.viewer = options.viewer || options.container.firstElementChild;
9862
-
9863
- if (!(this.container?.tagName.toUpperCase() === "DIV" && this.viewer?.tagName.toUpperCase() === "DIV")) {
9864
- throw new Error("Invalid `container` and/or `viewer` option.");
9865
- }
9866
-
9867
- if (this.container.offsetParent && getComputedStyle(this.container).position !== "absolute") {
9868
- throw new Error("The `container` must be absolutely positioned.");
9869
- }
9870
-
9871
- this.eventBus = options.eventBus;
9872
- this.linkService = options.linkService || new _pdf_link_service.SimpleLinkService();
9873
- this.downloadManager = options.downloadManager || null;
9874
- this.findController = options.findController || null;
9875
- this._scriptingManager = options.scriptingManager || null;
9876
- this.removePageBorders = options.removePageBorders || false;
9877
- this.textLayerMode = Number.isInteger(options.textLayerMode) ? options.textLayerMode : _ui_utils.TextLayerMode.ENABLE;
9878
- this.imageResourcesPath = options.imageResourcesPath || "";
9879
- this.renderInteractiveForms = options.renderInteractiveForms !== false;
9880
- this.enablePrintAutoRotate = options.enablePrintAutoRotate || false;
9881
- this.renderer = options.renderer || _ui_utils.RendererType.CANVAS;
9882
- this.useOnlyCssZoom = options.useOnlyCssZoom || false;
9883
- this.maxCanvasPixels = options.maxCanvasPixels;
9884
- this.l10n = options.l10n || _l10n_utils.NullL10n;
9885
- this.enableScripting = options.enableScripting === true && !!this._scriptingManager;
9886
- this.defaultRenderingQueue = !options.renderingQueue;
9887
-
9888
- if (this.defaultRenderingQueue) {
9889
- this.renderingQueue = new _pdf_rendering_queue.PDFRenderingQueue();
9890
- this.renderingQueue.setViewer(this);
9891
- } else {
9892
- this.renderingQueue = options.renderingQueue;
9893
- }
9894
-
9895
- this.scroll = (0, _ui_utils.watchScroll)(this.container, this._scrollUpdate.bind(this));
9896
- this.presentationModeState = _ui_utils.PresentationModeState.UNKNOWN;
9897
- this._onBeforeDraw = this._onAfterDraw = null;
9898
-
9899
- this._resetView();
9900
-
9901
- if (this.removePageBorders) {
9902
- this.viewer.classList.add("removePageBorders");
9903
- }
9904
-
9905
- Promise.resolve().then(() => {
9906
- this.eventBus.dispatch("baseviewerinit", {
9907
- source: this
9908
- });
9909
- });
9910
- }
9911
-
9912
- get pagesCount() {
9913
- return this._pages.length;
9914
- }
9915
-
9916
- getPageView(index) {
9917
- return this._pages[index];
9918
- }
9919
-
9920
- get pageViewsReady() {
9921
- if (!this._pagesCapability.settled) {
9922
- return false;
9923
- }
9924
-
9925
- return this._pages.every(function (pageView) {
9926
- return pageView?.pdfPage;
9927
- });
9928
- }
9929
-
9930
- get currentPageNumber() {
9931
- return this._currentPageNumber;
9932
- }
9933
-
9934
- set currentPageNumber(val) {
9935
- if (!Number.isInteger(val)) {
9936
- throw new Error("Invalid page number.");
9937
- }
9938
-
9939
- if (!this.pdfDocument) {
9940
- return;
9941
- }
9942
-
9943
- if (!this._setCurrentPageNumber(val, true)) {
9944
- console.error(`${this._name}.currentPageNumber: "${val}" is not a valid page.`);
9945
- }
9946
- }
9947
-
9948
- _setCurrentPageNumber(val, resetCurrentPageView = false) {
9949
- if (this._currentPageNumber === val) {
9950
- if (resetCurrentPageView) {
9951
- this._resetCurrentPageView();
9952
- }
9953
-
9954
- return true;
9955
- }
9956
-
9957
- if (!(0 < val && val <= this.pagesCount)) {
9958
- return false;
9959
- }
9960
-
9961
- const previous = this._currentPageNumber;
9962
- this._currentPageNumber = val;
9963
- this.eventBus.dispatch("pagechanging", {
9964
- source: this,
9965
- pageNumber: val,
9966
- pageLabel: this._pageLabels?.[val - 1] ?? null,
9967
- previous
9968
- });
9969
-
9970
- if (resetCurrentPageView) {
9971
- this._resetCurrentPageView();
9972
- }
9973
-
9974
- return true;
9975
- }
9976
-
9977
- get currentPageLabel() {
9978
- return this._pageLabels?.[this._currentPageNumber - 1] ?? null;
9979
- }
9980
-
9981
- set currentPageLabel(val) {
9982
- if (!this.pdfDocument) {
9983
- return;
9984
- }
9985
-
9986
- let page = val | 0;
9987
-
9988
- if (this._pageLabels) {
9989
- const i = this._pageLabels.indexOf(val);
9990
-
9991
- if (i >= 0) {
9992
- page = i + 1;
9993
- }
9994
- }
9995
-
9996
- if (!this._setCurrentPageNumber(page, true)) {
9997
- console.error(`${this._name}.currentPageLabel: "${val}" is not a valid page.`);
9998
- }
9999
- }
10000
-
10001
- get currentScale() {
10002
- return this._currentScale !== _ui_utils.UNKNOWN_SCALE ? this._currentScale : _ui_utils.DEFAULT_SCALE;
10003
- }
10004
-
10005
- set currentScale(val) {
10006
- if (isNaN(val)) {
10007
- throw new Error("Invalid numeric scale.");
10008
- }
10009
-
10010
- if (!this.pdfDocument) {
10011
- return;
10012
- }
10013
-
10014
- this._setScale(val, false);
10015
- }
10016
-
10017
- get currentScaleValue() {
10018
- return this._currentScaleValue;
10019
- }
10020
-
10021
- set currentScaleValue(val) {
10022
- if (!this.pdfDocument) {
10023
- return;
10024
- }
10025
-
10026
- this._setScale(val, false);
10027
- }
10028
-
10029
- get pagesRotation() {
10030
- return this._pagesRotation;
10031
- }
10032
-
10033
- set pagesRotation(rotation) {
10034
- if (!(0, _ui_utils.isValidRotation)(rotation)) {
10035
- throw new Error("Invalid pages rotation angle.");
10036
- }
10037
-
10038
- if (!this.pdfDocument) {
10039
- return;
10040
- }
10041
-
10042
- rotation %= 360;
10043
-
10044
- if (rotation < 0) {
10045
- rotation += 360;
10046
- }
10047
-
10048
- if (this._pagesRotation === rotation) {
10049
- return;
10050
- }
10051
-
10052
- this._pagesRotation = rotation;
10053
- const pageNumber = this._currentPageNumber;
10054
-
10055
- for (let i = 0, ii = this._pages.length; i < ii; i++) {
10056
- const pageView = this._pages[i];
10057
- pageView.update(pageView.scale, rotation);
10058
- }
10059
-
10060
- if (this._currentScaleValue) {
10061
- this._setScale(this._currentScaleValue, true);
10062
- }
10063
-
10064
- this.eventBus.dispatch("rotationchanging", {
10065
- source: this,
10066
- pagesRotation: rotation,
10067
- pageNumber
10068
- });
10069
-
10070
- if (this.defaultRenderingQueue) {
10071
- this.update();
10072
- }
10073
- }
10074
-
10075
- get firstPagePromise() {
10076
- return this.pdfDocument ? this._firstPageCapability.promise : null;
10077
- }
10078
-
10079
- get onePageRendered() {
10080
- return this.pdfDocument ? this._onePageRenderedCapability.promise : null;
10081
- }
10082
-
10083
- get pagesPromise() {
10084
- return this.pdfDocument ? this._pagesCapability.promise : null;
10085
- }
10086
-
10087
- get _viewerElement() {
10088
- throw new Error("Not implemented: _viewerElement");
10089
- }
10090
-
10091
- _onePageRenderedOrForceFetch() {
10092
- if (!this.container.offsetParent || this._getVisiblePages().views.length === 0) {
10093
- return Promise.resolve();
10094
- }
10095
-
10096
- return this._onePageRenderedCapability.promise;
10097
- }
10098
-
10099
- setDocument(pdfDocument) {
10100
- if (this.pdfDocument) {
10101
- this.eventBus.dispatch("pagesdestroy", {
10102
- source: this
10103
- });
10104
-
10105
- this._cancelRendering();
10106
-
10107
- this._resetView();
10108
-
10109
- if (this.findController) {
10110
- this.findController.setDocument(null);
10111
- }
10112
-
10113
- if (this._scriptingManager) {
10114
- this._scriptingManager.setDocument(null);
10115
- }
10116
- }
10117
-
10118
- this.pdfDocument = pdfDocument;
10119
-
10120
- if (!pdfDocument) {
10121
- return;
10122
- }
10123
-
10124
- const isPureXfa = pdfDocument.isPureXfa;
10125
- const pagesCount = pdfDocument.numPages;
10126
- const firstPagePromise = pdfDocument.getPage(1);
10127
- const optionalContentConfigPromise = pdfDocument.getOptionalContentConfig();
10128
-
10129
- this._pagesCapability.promise.then(() => {
10130
- this.eventBus.dispatch("pagesloaded", {
10131
- source: this,
10132
- pagesCount
10133
- });
10134
- });
10135
-
10136
- this._onBeforeDraw = evt => {
10137
- const pageView = this._pages[evt.pageNumber - 1];
10138
-
10139
- if (!pageView) {
10140
- return;
10141
- }
10142
-
10143
- this._buffer.push(pageView);
10144
- };
10145
-
10146
- this.eventBus._on("pagerender", this._onBeforeDraw);
10147
-
10148
- this._onAfterDraw = evt => {
10149
- if (evt.cssTransform || this._onePageRenderedCapability.settled) {
10150
- return;
10151
- }
10152
-
10153
- this._onePageRenderedCapability.resolve();
10154
-
10155
- this.eventBus._off("pagerendered", this._onAfterDraw);
10156
-
10157
- this._onAfterDraw = null;
10158
- };
10159
-
10160
- this.eventBus._on("pagerendered", this._onAfterDraw);
10161
-
10162
- firstPagePromise.then(firstPdfPage => {
10163
- this._firstPageCapability.resolve(firstPdfPage);
10164
-
10165
- this._optionalContentConfigPromise = optionalContentConfigPromise;
10166
- const scale = this.currentScale;
10167
- const viewport = firstPdfPage.getViewport({
10168
- scale: scale * _ui_utils.CSS_UNITS
10169
- });
10170
- const textLayerFactory = this.textLayerMode !== _ui_utils.TextLayerMode.DISABLE ? this : null;
10171
- const xfaLayerFactory = isPureXfa ? this : null;
10172
-
10173
- for (let pageNum = 1; pageNum <= pagesCount; ++pageNum) {
10174
- const pageView = new _pdf_page_view.PDFPageView({
10175
- container: this._viewerElement,
10176
- eventBus: this.eventBus,
10177
- id: pageNum,
10178
- scale,
10179
- defaultViewport: viewport.clone(),
10180
- optionalContentConfigPromise,
10181
- renderingQueue: this.renderingQueue,
10182
- textLayerFactory,
10183
- textLayerMode: this.textLayerMode,
10184
- annotationLayerFactory: this,
10185
- xfaLayerFactory,
10186
- structTreeLayerFactory: this,
10187
- imageResourcesPath: this.imageResourcesPath,
10188
- renderInteractiveForms: this.renderInteractiveForms,
10189
- renderer: this.renderer,
10190
- useOnlyCssZoom: this.useOnlyCssZoom,
10191
- maxCanvasPixels: this.maxCanvasPixels,
10192
- l10n: this.l10n
10193
- });
10194
-
10195
- this._pages.push(pageView);
10196
- }
10197
-
10198
- const firstPageView = this._pages[0];
10199
-
10200
- if (firstPageView) {
10201
- firstPageView.setPdfPage(firstPdfPage);
10202
- this.linkService.cachePageRef(1, firstPdfPage.ref);
10203
- }
10204
-
10205
- if (this._spreadMode !== _ui_utils.SpreadMode.NONE) {
10206
- this._updateSpreadMode();
10207
- }
10208
-
10209
- this._onePageRenderedOrForceFetch().then(() => {
10210
- if (this.findController) {
10211
- this.findController.setDocument(pdfDocument);
10212
- }
10213
-
10214
- if (this.enableScripting) {
10215
- this._scriptingManager.setDocument(pdfDocument);
10216
- }
10217
-
10218
- if (pdfDocument.loadingParams.disableAutoFetch || pagesCount > 7500) {
10219
- this._pagesCapability.resolve();
10220
-
10221
- return;
10222
- }
10223
-
10224
- let getPagesLeft = pagesCount - 1;
10225
-
10226
- if (getPagesLeft <= 0) {
10227
- this._pagesCapability.resolve();
10228
-
10229
- return;
10230
- }
10231
-
10232
- for (let pageNum = 2; pageNum <= pagesCount; ++pageNum) {
10233
- pdfDocument.getPage(pageNum).then(pdfPage => {
10234
- const pageView = this._pages[pageNum - 1];
10235
-
10236
- if (!pageView.pdfPage) {
10237
- pageView.setPdfPage(pdfPage);
10238
- }
10239
-
10240
- this.linkService.cachePageRef(pageNum, pdfPage.ref);
10241
-
10242
- if (--getPagesLeft === 0) {
10243
- this._pagesCapability.resolve();
10244
- }
10245
- }, reason => {
10246
- console.error(`Unable to get page ${pageNum} to initialize viewer`, reason);
10247
-
10248
- if (--getPagesLeft === 0) {
10249
- this._pagesCapability.resolve();
10250
- }
10251
- });
10252
- }
10253
- });
10254
-
10255
- this.eventBus.dispatch("pagesinit", {
10256
- source: this
10257
- });
10258
-
10259
- if (this.defaultRenderingQueue) {
10260
- this.update();
10261
- }
10262
- }).catch(reason => {
10263
- console.error("Unable to initialize viewer", reason);
10264
- });
10265
- }
10266
-
10267
- setPageLabels(labels) {
10268
- if (!this.pdfDocument) {
10269
- return;
10270
- }
10271
-
10272
- if (!labels) {
10273
- this._pageLabels = null;
10274
- } else if (!(Array.isArray(labels) && this.pdfDocument.numPages === labels.length)) {
10275
- this._pageLabels = null;
10276
- console.error(`${this._name}.setPageLabels: Invalid page labels.`);
10277
- } else {
10278
- this._pageLabels = labels;
10279
- }
10280
-
10281
- for (let i = 0, ii = this._pages.length; i < ii; i++) {
10282
- this._pages[i].setPageLabel(this._pageLabels?.[i] ?? null);
10283
- }
10284
- }
10285
-
10286
- _resetView() {
10287
- this._pages = [];
10288
- this._currentPageNumber = 1;
10289
- this._currentScale = _ui_utils.UNKNOWN_SCALE;
10290
- this._currentScaleValue = null;
10291
- this._pageLabels = null;
10292
- this._buffer = new PDFPageViewBuffer(DEFAULT_CACHE_SIZE);
10293
- this._location = null;
10294
- this._pagesRotation = 0;
10295
- this._optionalContentConfigPromise = null;
10296
- this._pagesRequests = new WeakMap();
10297
- this._firstPageCapability = (0, _pdfjsLib.createPromiseCapability)();
10298
- this._onePageRenderedCapability = (0, _pdfjsLib.createPromiseCapability)();
10299
- this._pagesCapability = (0, _pdfjsLib.createPromiseCapability)();
10300
- this._scrollMode = _ui_utils.ScrollMode.VERTICAL;
10301
- this._spreadMode = _ui_utils.SpreadMode.NONE;
10302
-
10303
- if (this._onBeforeDraw) {
10304
- this.eventBus._off("pagerender", this._onBeforeDraw);
10305
-
10306
- this._onBeforeDraw = null;
10307
- }
10308
-
10309
- if (this._onAfterDraw) {
10310
- this.eventBus._off("pagerendered", this._onAfterDraw);
10311
-
10312
- this._onAfterDraw = null;
10313
- }
10314
-
10315
- this.viewer.textContent = "";
10316
-
10317
- this._updateScrollMode();
10318
- }
10319
-
10320
- _scrollUpdate() {
10321
- if (this.pagesCount === 0) {
10322
- return;
10323
- }
10324
-
10325
- this.update();
10326
- }
10327
-
10328
- _scrollIntoView({
10329
- pageDiv,
10330
- pageSpot = null,
10331
- pageNumber = null
10332
- }) {
10333
- (0, _ui_utils.scrollIntoView)(pageDiv, pageSpot);
10334
- }
10335
-
10336
- _setScaleUpdatePages(newScale, newValue, noScroll = false, preset = false) {
10337
- this._currentScaleValue = newValue.toString();
10338
-
10339
- if (isSameScale(this._currentScale, newScale)) {
10340
- if (preset) {
10341
- this.eventBus.dispatch("scalechanging", {
10342
- source: this,
10343
- scale: newScale,
10344
- presetValue: newValue
10345
- });
10346
- }
10347
-
10348
- return;
10349
- }
10350
-
10351
- for (let i = 0, ii = this._pages.length; i < ii; i++) {
10352
- this._pages[i].update(newScale);
10353
- }
10354
-
10355
- this._currentScale = newScale;
10356
-
10357
- if (!noScroll) {
10358
- let page = this._currentPageNumber,
10359
- dest;
10360
-
10361
- if (this._location && !(this.isInPresentationMode || this.isChangingPresentationMode)) {
10362
- page = this._location.pageNumber;
10363
- dest = [null, {
10364
- name: "XYZ"
10365
- }, this._location.left, this._location.top, null];
10366
- }
10367
-
10368
- this.scrollPageIntoView({
10369
- pageNumber: page,
10370
- destArray: dest,
10371
- allowNegativeOffset: true
10372
- });
10373
- }
10374
-
10375
- this.eventBus.dispatch("scalechanging", {
10376
- source: this,
10377
- scale: newScale,
10378
- presetValue: preset ? newValue : undefined
10379
- });
10380
-
10381
- if (this.defaultRenderingQueue) {
10382
- this.update();
10383
- }
10384
- }
10385
-
10386
- get _pageWidthScaleFactor() {
10387
- if (this._spreadMode !== _ui_utils.SpreadMode.NONE && this._scrollMode !== _ui_utils.ScrollMode.HORIZONTAL && !this.isInPresentationMode) {
10388
- return 2;
10389
- }
10390
-
10391
- return 1;
10392
- }
10393
-
10394
- _setScale(value, noScroll = false) {
10395
- let scale = parseFloat(value);
10396
-
10397
- if (scale > 0) {
10398
- this._setScaleUpdatePages(scale, value, noScroll, false);
10399
- } else {
10400
- const currentPage = this._pages[this._currentPageNumber - 1];
10401
-
10402
- if (!currentPage) {
10403
- return;
10404
- }
10405
-
10406
- const noPadding = this.isInPresentationMode || this.removePageBorders;
10407
- let hPadding = noPadding ? 0 : _ui_utils.SCROLLBAR_PADDING;
10408
- let vPadding = noPadding ? 0 : _ui_utils.VERTICAL_PADDING;
10409
-
10410
- if (!noPadding && this._isScrollModeHorizontal) {
10411
- [hPadding, vPadding] = [vPadding, hPadding];
10412
- }
10413
-
10414
- const pageWidthScale = (this.container.clientWidth - hPadding) / currentPage.width * currentPage.scale / this._pageWidthScaleFactor;
10415
- const pageHeightScale = (this.container.clientHeight - vPadding) / currentPage.height * currentPage.scale;
10416
-
10417
- switch (value) {
10418
- case "page-actual":
10419
- scale = 1;
10420
- break;
10421
-
10422
- case "page-width":
10423
- scale = pageWidthScale;
10424
- break;
10425
-
10426
- case "page-height":
10427
- scale = pageHeightScale;
10428
- break;
10429
-
10430
- case "page-fit":
10431
- scale = Math.min(pageWidthScale, pageHeightScale);
10432
- break;
10433
-
10434
- case "auto":
10435
- const horizontalScale = (0, _ui_utils.isPortraitOrientation)(currentPage) ? pageWidthScale : Math.min(pageHeightScale, pageWidthScale);
10436
- scale = Math.min(_ui_utils.MAX_AUTO_SCALE, horizontalScale);
10437
- break;
10438
-
10439
- default:
10440
- console.error(`${this._name}._setScale: "${value}" is an unknown zoom value.`);
10441
- return;
10442
- }
10443
-
10444
- this._setScaleUpdatePages(scale, value, noScroll, true);
10445
- }
10446
- }
10447
-
10448
- _resetCurrentPageView() {
10449
- if (this.isInPresentationMode) {
10450
- this._setScale(this._currentScaleValue, true);
10451
- }
10452
-
10453
- const pageView = this._pages[this._currentPageNumber - 1];
10454
-
10455
- this._scrollIntoView({
10456
- pageDiv: pageView.div
10457
- });
10458
- }
10459
-
10460
- pageLabelToPageNumber(label) {
10461
- if (!this._pageLabels) {
10462
- return null;
10463
- }
10464
-
10465
- const i = this._pageLabels.indexOf(label);
10466
-
10467
- if (i < 0) {
10468
- return null;
10469
- }
10470
-
10471
- return i + 1;
10472
- }
10473
-
10474
- scrollPageIntoView({
10475
- pageNumber,
10476
- destArray = null,
10477
- allowNegativeOffset = false,
10478
- ignoreDestinationZoom = false
10479
- }) {
10480
- if (!this.pdfDocument) {
10481
- return;
10482
- }
10483
-
10484
- const pageView = Number.isInteger(pageNumber) && this._pages[pageNumber - 1];
10485
-
10486
- if (!pageView) {
10487
- console.error(`${this._name}.scrollPageIntoView: ` + `"${pageNumber}" is not a valid pageNumber parameter.`);
10488
- return;
10489
- }
10490
-
10491
- if (this.isInPresentationMode || !destArray) {
10492
- this._setCurrentPageNumber(pageNumber, true);
10493
-
10494
- return;
10495
- }
10496
-
10497
- let x = 0,
10498
- y = 0;
10499
- let width = 0,
10500
- height = 0,
10501
- widthScale,
10502
- heightScale;
10503
- const changeOrientation = pageView.rotation % 180 !== 0;
10504
- const pageWidth = (changeOrientation ? pageView.height : pageView.width) / pageView.scale / _ui_utils.CSS_UNITS;
10505
- const pageHeight = (changeOrientation ? pageView.width : pageView.height) / pageView.scale / _ui_utils.CSS_UNITS;
10506
- let scale = 0;
10507
-
10508
- switch (destArray[1].name) {
10509
- case "XYZ":
10510
- x = destArray[2];
10511
- y = destArray[3];
10512
- scale = destArray[4];
10513
- x = x !== null ? x : 0;
10514
- y = y !== null ? y : pageHeight;
10515
- break;
10516
-
10517
- case "Fit":
10518
- case "FitB":
10519
- scale = "page-fit";
10520
- break;
10521
-
10522
- case "FitH":
10523
- case "FitBH":
10524
- y = destArray[2];
10525
- scale = "page-width";
10526
-
10527
- if (y === null && this._location) {
10528
- x = this._location.left;
10529
- y = this._location.top;
10530
- } else if (typeof y !== "number") {
10531
- y = pageHeight;
10532
- }
10533
-
10534
- break;
10535
-
10536
- case "FitV":
10537
- case "FitBV":
10538
- x = destArray[2];
10539
- width = pageWidth;
10540
- height = pageHeight;
10541
- scale = "page-height";
10542
- break;
10543
-
10544
- case "FitR":
10545
- x = destArray[2];
10546
- y = destArray[3];
10547
- width = destArray[4] - x;
10548
- height = destArray[5] - y;
10549
- const hPadding = this.removePageBorders ? 0 : _ui_utils.SCROLLBAR_PADDING;
10550
- const vPadding = this.removePageBorders ? 0 : _ui_utils.VERTICAL_PADDING;
10551
- widthScale = (this.container.clientWidth - hPadding) / width / _ui_utils.CSS_UNITS;
10552
- heightScale = (this.container.clientHeight - vPadding) / height / _ui_utils.CSS_UNITS;
10553
- scale = Math.min(Math.abs(widthScale), Math.abs(heightScale));
10554
- break;
10555
-
10556
- default:
10557
- console.error(`${this._name}.scrollPageIntoView: ` + `"${destArray[1].name}" is not a valid destination type.`);
10558
- return;
10559
- }
10560
-
10561
- if (!ignoreDestinationZoom) {
10562
- if (scale && scale !== this._currentScale) {
10563
- this.currentScaleValue = scale;
10564
- } else if (this._currentScale === _ui_utils.UNKNOWN_SCALE) {
10565
- this.currentScaleValue = _ui_utils.DEFAULT_SCALE_VALUE;
10566
- }
10567
- }
10568
-
10569
- if (scale === "page-fit" && !destArray[4]) {
10570
- this._scrollIntoView({
10571
- pageDiv: pageView.div,
10572
- pageNumber
10573
- });
10574
-
10575
- return;
10576
- }
10577
-
10578
- const boundingRect = [pageView.viewport.convertToViewportPoint(x, y), pageView.viewport.convertToViewportPoint(x + width, y + height)];
10579
- let left = Math.min(boundingRect[0][0], boundingRect[1][0]);
10580
- let top = Math.min(boundingRect[0][1], boundingRect[1][1]);
10581
-
10582
- if (!allowNegativeOffset) {
10583
- left = Math.max(left, 0);
10584
- top = Math.max(top, 0);
10585
- }
10586
-
10587
- this._scrollIntoView({
10588
- pageDiv: pageView.div,
10589
- pageSpot: {
10590
- left,
10591
- top
10592
- },
10593
- pageNumber
10594
- });
10595
- }
10596
-
10597
- _updateLocation(firstPage) {
10598
- const currentScale = this._currentScale;
10599
- const currentScaleValue = this._currentScaleValue;
10600
- const normalizedScaleValue = parseFloat(currentScaleValue) === currentScale ? Math.round(currentScale * 10000) / 100 : currentScaleValue;
10601
- const pageNumber = firstPage.id;
10602
- let pdfOpenParams = "#page=" + pageNumber;
10603
- pdfOpenParams += "&zoom=" + normalizedScaleValue;
10604
- const currentPageView = this._pages[pageNumber - 1];
10605
- const container = this.container;
10606
- const topLeft = currentPageView.getPagePoint(container.scrollLeft - firstPage.x, container.scrollTop - firstPage.y);
10607
- const intLeft = Math.round(topLeft[0]);
10608
- const intTop = Math.round(topLeft[1]);
10609
- pdfOpenParams += "," + intLeft + "," + intTop;
10610
- this._location = {
10611
- pageNumber,
10612
- scale: normalizedScaleValue,
10613
- top: intTop,
10614
- left: intLeft,
10615
- rotation: this._pagesRotation,
10616
- pdfOpenParams
10617
- };
10618
- }
10619
-
10620
- _updateHelper(visiblePages) {
10621
- throw new Error("Not implemented: _updateHelper");
10622
- }
10623
-
10624
- update() {
10625
- const visible = this._getVisiblePages();
10626
-
10627
- const visiblePages = visible.views,
10628
- numVisiblePages = visiblePages.length;
10629
-
10630
- if (numVisiblePages === 0) {
10631
- return;
10632
- }
10633
-
10634
- const newCacheSize = Math.max(DEFAULT_CACHE_SIZE, 2 * numVisiblePages + 1);
10635
-
10636
- this._buffer.resize(newCacheSize, visiblePages);
10637
-
10638
- this.renderingQueue.renderHighestPriority(visible);
10639
-
10640
- this._updateHelper(visiblePages);
10641
-
10642
- this._updateLocation(visible.first);
10643
-
10644
- this.eventBus.dispatch("updateviewarea", {
10645
- source: this,
10646
- location: this._location
10647
- });
10648
- }
10649
-
10650
- containsElement(element) {
10651
- return this.container.contains(element);
10652
- }
10653
-
10654
- focus() {
10655
- this.container.focus();
10656
- }
10657
-
10658
- get _isScrollModeHorizontal() {
10659
- return this.isInPresentationMode ? false : this._scrollMode === _ui_utils.ScrollMode.HORIZONTAL;
10660
- }
10661
-
10662
- get _isContainerRtl() {
10663
- return getComputedStyle(this.container).direction === "rtl";
10664
- }
10665
-
10666
- get isInPresentationMode() {
10667
- return this.presentationModeState === _ui_utils.PresentationModeState.FULLSCREEN;
10668
- }
10669
-
10670
- get isChangingPresentationMode() {
10671
- return this.presentationModeState === _ui_utils.PresentationModeState.CHANGING;
10672
- }
10673
-
10674
- get isHorizontalScrollbarEnabled() {
10675
- return this.isInPresentationMode ? false : this.container.scrollWidth > this.container.clientWidth;
10676
- }
10677
-
10678
- get isVerticalScrollbarEnabled() {
10679
- return this.isInPresentationMode ? false : this.container.scrollHeight > this.container.clientHeight;
10680
- }
10681
-
10682
- _getCurrentVisiblePage() {
10683
- if (!this.pagesCount) {
10684
- return {
10685
- views: []
10686
- };
10687
- }
10688
-
10689
- const pageView = this._pages[this._currentPageNumber - 1];
10690
- const element = pageView.div;
10691
- const view = {
10692
- id: pageView.id,
10693
- x: element.offsetLeft + element.clientLeft,
10694
- y: element.offsetTop + element.clientTop,
10695
- view: pageView
10696
- };
10697
- return {
10698
- first: view,
10699
- last: view,
10700
- views: [view]
10701
- };
10702
- }
10703
-
10704
- _getVisiblePages() {
10705
- return (0, _ui_utils.getVisibleElements)({
10706
- scrollEl: this.container,
10707
- views: this._pages,
10708
- sortByVisibility: true,
10709
- horizontal: this._isScrollModeHorizontal,
10710
- rtl: this._isScrollModeHorizontal && this._isContainerRtl
10711
- });
10712
- }
10713
-
10714
- isPageVisible(pageNumber) {
10715
- if (!this.pdfDocument) {
10716
- return false;
10717
- }
10718
-
10719
- if (!(Number.isInteger(pageNumber) && pageNumber > 0 && pageNumber <= this.pagesCount)) {
10720
- console.error(`${this._name}.isPageVisible: "${pageNumber}" is not a valid page.`);
10721
- return false;
10722
- }
10723
-
10724
- return this._getVisiblePages().views.some(function (view) {
10725
- return view.id === pageNumber;
10726
- });
10727
- }
10728
-
10729
- isPageCached(pageNumber) {
10730
- if (!this.pdfDocument || !this._buffer) {
10731
- return false;
10732
- }
10733
-
10734
- if (!(Number.isInteger(pageNumber) && pageNumber > 0 && pageNumber <= this.pagesCount)) {
10735
- console.error(`${this._name}.isPageCached: "${pageNumber}" is not a valid page.`);
10736
- return false;
10737
- }
10738
-
10739
- const pageView = this._pages[pageNumber - 1];
10740
-
10741
- if (!pageView) {
10742
- return false;
10743
- }
10744
-
10745
- return this._buffer.has(pageView);
10746
- }
10747
-
10748
- cleanup() {
10749
- for (let i = 0, ii = this._pages.length; i < ii; i++) {
10750
- if (this._pages[i] && this._pages[i].renderingState !== _pdf_rendering_queue.RenderingStates.FINISHED) {
10751
- this._pages[i].reset();
10752
- }
10753
- }
10754
- }
10755
-
10756
- _cancelRendering() {
10757
- for (let i = 0, ii = this._pages.length; i < ii; i++) {
10758
- if (this._pages[i]) {
10759
- this._pages[i].cancelRendering();
10760
- }
10761
- }
10762
- }
10763
-
10764
- _ensurePdfPageLoaded(pageView) {
10765
- if (pageView.pdfPage) {
10766
- return Promise.resolve(pageView.pdfPage);
10767
- }
10768
-
10769
- if (this._pagesRequests.has(pageView)) {
10770
- return this._pagesRequests.get(pageView);
10771
- }
10772
-
10773
- const promise = this.pdfDocument.getPage(pageView.id).then(pdfPage => {
10774
- if (!pageView.pdfPage) {
10775
- pageView.setPdfPage(pdfPage);
10776
- }
10777
-
10778
- this._pagesRequests.delete(pageView);
10779
-
10780
- return pdfPage;
10781
- }).catch(reason => {
10782
- console.error("Unable to get page for page view", reason);
10783
-
10784
- this._pagesRequests.delete(pageView);
10785
- });
10786
-
10787
- this._pagesRequests.set(pageView, promise);
10788
-
10789
- return promise;
10790
- }
10791
-
10792
- forceRendering(currentlyVisiblePages) {
10793
- const visiblePages = currentlyVisiblePages || this._getVisiblePages();
10794
-
10795
- const scrollAhead = this._isScrollModeHorizontal ? this.scroll.right : this.scroll.down;
10796
- const pageView = this.renderingQueue.getHighestPriority(visiblePages, this._pages, scrollAhead);
10797
-
10798
- if (pageView) {
10799
- this._ensurePdfPageLoaded(pageView).then(() => {
10800
- this.renderingQueue.renderView(pageView);
10801
- });
10802
-
10803
- return true;
10804
- }
10805
-
10806
- return false;
10807
- }
10808
-
10809
- createTextLayerBuilder(textLayerDiv, pageIndex, viewport, enhanceTextSelection = false, eventBus) {
10810
- return new _text_layer_builder.TextLayerBuilder({
10811
- textLayerDiv,
10812
- eventBus,
10813
- pageIndex,
10814
- viewport,
10815
- findController: this.isInPresentationMode ? null : this.findController,
10816
- enhanceTextSelection: this.isInPresentationMode ? false : enhanceTextSelection
10817
- });
10818
- }
10819
-
10820
- createAnnotationLayerBuilder(pageDiv, pdfPage, annotationStorage = null, imageResourcesPath = "", renderInteractiveForms = false, l10n = _l10n_utils.NullL10n, enableScripting = null, hasJSActionsPromise = null, mouseState = null) {
10821
- return new _annotation_layer_builder.AnnotationLayerBuilder({
10822
- pageDiv,
10823
- pdfPage,
10824
- annotationStorage: annotationStorage || this.pdfDocument?.annotationStorage,
10825
- imageResourcesPath,
10826
- renderInteractiveForms,
10827
- linkService: this.linkService,
10828
- downloadManager: this.downloadManager,
10829
- l10n,
10830
- enableScripting: enableScripting ?? this.enableScripting,
10831
- hasJSActionsPromise: hasJSActionsPromise || this.pdfDocument?.hasJSActions(),
10832
- mouseState: mouseState || this._scriptingManager?.mouseState
10833
- });
10834
- }
10835
-
10836
- createXfaLayerBuilder(pageDiv, pdfPage, annotationStorage = null) {
10837
- return new _xfa_layer_builder.XfaLayerBuilder({
10838
- pageDiv,
10839
- pdfPage,
10840
- annotationStorage: annotationStorage || this.pdfDocument?.annotationStorage
10841
- });
10842
- }
10843
-
10844
- createStructTreeLayerBuilder(pdfPage) {
10845
- return new _struct_tree_layer_builder.StructTreeLayerBuilder({
10846
- pdfPage
10847
- });
10848
- }
10849
-
10850
- get hasEqualPageSizes() {
10851
- const firstPageView = this._pages[0];
10852
-
10853
- for (let i = 1, ii = this._pages.length; i < ii; ++i) {
10854
- const pageView = this._pages[i];
10855
-
10856
- if (pageView.width !== firstPageView.width || pageView.height !== firstPageView.height) {
10857
- return false;
10858
- }
10859
- }
10860
-
10861
- return true;
10862
- }
10863
-
10864
- getPagesOverview() {
10865
- return this._pages.map(pageView => {
10866
- const viewport = pageView.pdfPage.getViewport({
10867
- scale: 1
10868
- });
10869
-
10870
- if (!this.enablePrintAutoRotate || (0, _ui_utils.isPortraitOrientation)(viewport)) {
10871
- return {
10872
- width: viewport.width,
10873
- height: viewport.height,
10874
- rotation: viewport.rotation
10875
- };
10876
- }
10877
-
10878
- return {
10879
- width: viewport.height,
10880
- height: viewport.width,
10881
- rotation: (viewport.rotation - 90) % 360
10882
- };
10883
- });
10884
- }
10885
-
10886
- get optionalContentConfigPromise() {
10887
- if (!this.pdfDocument) {
10888
- return Promise.resolve(null);
10889
- }
10890
-
10891
- if (!this._optionalContentConfigPromise) {
10892
- return this.pdfDocument.getOptionalContentConfig();
10893
- }
10894
-
10895
- return this._optionalContentConfigPromise;
10896
- }
10897
-
10898
- set optionalContentConfigPromise(promise) {
10899
- if (!(promise instanceof Promise)) {
10900
- throw new Error(`Invalid optionalContentConfigPromise: ${promise}`);
10901
- }
10902
-
10903
- if (!this.pdfDocument) {
10904
- return;
10905
- }
10906
-
10907
- if (!this._optionalContentConfigPromise) {
10908
- return;
10909
- }
10910
-
10911
- this._optionalContentConfigPromise = promise;
10912
-
10913
- for (const pageView of this._pages) {
10914
- pageView.update(pageView.scale, pageView.rotation, promise);
10915
- }
10916
-
10917
- this.update();
10918
- this.eventBus.dispatch("optionalcontentconfigchanged", {
10919
- source: this,
10920
- promise
10921
- });
10922
- }
10923
-
10924
- get scrollMode() {
10925
- return this._scrollMode;
10926
- }
10927
-
10928
- set scrollMode(mode) {
10929
- if (this._scrollMode === mode) {
10930
- return;
10931
- }
10932
-
10933
- if (!(0, _ui_utils.isValidScrollMode)(mode)) {
10934
- throw new Error(`Invalid scroll mode: ${mode}`);
10935
- }
10936
-
10937
- this._scrollMode = mode;
10938
- this.eventBus.dispatch("scrollmodechanged", {
10939
- source: this,
10940
- mode
10941
- });
10942
-
10943
- this._updateScrollMode(this._currentPageNumber);
10944
- }
10945
-
10946
- _updateScrollMode(pageNumber = null) {
10947
- const scrollMode = this._scrollMode,
10948
- viewer = this.viewer;
10949
- viewer.classList.toggle("scrollHorizontal", scrollMode === _ui_utils.ScrollMode.HORIZONTAL);
10950
- viewer.classList.toggle("scrollWrapped", scrollMode === _ui_utils.ScrollMode.WRAPPED);
10951
-
10952
- if (!this.pdfDocument || !pageNumber) {
10953
- return;
10954
- }
10955
-
10956
- if (this._currentScaleValue && isNaN(this._currentScaleValue)) {
10957
- this._setScale(this._currentScaleValue, true);
10958
- }
10959
-
10960
- this._setCurrentPageNumber(pageNumber, true);
10961
-
10962
- this.update();
10963
- }
10964
-
10965
- get spreadMode() {
10966
- return this._spreadMode;
10967
- }
10968
-
10969
- set spreadMode(mode) {
10970
- if (this._spreadMode === mode) {
10971
- return;
10972
- }
10973
-
10974
- if (!(0, _ui_utils.isValidSpreadMode)(mode)) {
10975
- throw new Error(`Invalid spread mode: ${mode}`);
10976
- }
10977
-
10978
- this._spreadMode = mode;
10979
- this.eventBus.dispatch("spreadmodechanged", {
10980
- source: this,
10981
- mode
10982
- });
10983
-
10984
- this._updateSpreadMode(this._currentPageNumber);
10985
- }
10986
-
10987
- _updateSpreadMode(pageNumber = null) {
10988
- if (!this.pdfDocument) {
10989
- return;
10990
- }
10991
-
10992
- const viewer = this.viewer,
10993
- pages = this._pages;
10994
- viewer.textContent = "";
10995
-
10996
- if (this._spreadMode === _ui_utils.SpreadMode.NONE) {
10997
- for (let i = 0, iMax = pages.length; i < iMax; ++i) {
10998
- viewer.appendChild(pages[i].div);
10999
- }
11000
- } else {
11001
- const parity = this._spreadMode - 1;
11002
- let spread = null;
11003
-
11004
- for (let i = 0, iMax = pages.length; i < iMax; ++i) {
11005
- if (spread === null) {
11006
- spread = document.createElement("div");
11007
- spread.className = "spread";
11008
- viewer.appendChild(spread);
11009
- } else if (i % 2 === parity) {
11010
- spread = spread.cloneNode(false);
11011
- viewer.appendChild(spread);
11012
- }
11013
-
11014
- spread.appendChild(pages[i].div);
11015
- }
11016
- }
11017
-
11018
- if (!pageNumber) {
11019
- return;
11020
- }
11021
-
11022
- if (this._currentScaleValue && isNaN(this._currentScaleValue)) {
11023
- this._setScale(this._currentScaleValue, true);
11024
- }
11025
-
11026
- this._setCurrentPageNumber(pageNumber, true);
11027
-
11028
- this.update();
11029
- }
11030
-
11031
- _getPageAdvance(currentPageNumber, previous = false) {
11032
- if (this.isInPresentationMode) {
11033
- return 1;
11034
- }
11035
-
11036
- switch (this._scrollMode) {
11037
- case _ui_utils.ScrollMode.WRAPPED:
11038
- {
11039
- const {
11040
- views
11041
- } = this._getVisiblePages(),
11042
- pageLayout = new Map();
11043
-
11044
- for (const {
11045
- id,
11046
- y,
11047
- percent,
11048
- widthPercent
11049
- } of views) {
11050
- if (percent === 0 || widthPercent < 100) {
11051
- continue;
11052
- }
11053
-
11054
- let yArray = pageLayout.get(y);
11055
-
11056
- if (!yArray) {
11057
- pageLayout.set(y, yArray || (yArray = []));
11058
- }
11059
-
11060
- yArray.push(id);
11061
- }
11062
-
11063
- for (const yArray of pageLayout.values()) {
11064
- const currentIndex = yArray.indexOf(currentPageNumber);
11065
-
11066
- if (currentIndex === -1) {
11067
- continue;
11068
- }
11069
-
11070
- const numPages = yArray.length;
11071
-
11072
- if (numPages === 1) {
11073
- break;
11074
- }
11075
-
11076
- if (previous) {
11077
- for (let i = currentIndex - 1, ii = 0; i >= ii; i--) {
11078
- const currentId = yArray[i],
11079
- expectedId = yArray[i + 1] - 1;
11080
-
11081
- if (currentId < expectedId) {
11082
- return currentPageNumber - expectedId;
11083
- }
11084
- }
11085
- } else {
11086
- for (let i = currentIndex + 1, ii = numPages; i < ii; i++) {
11087
- const currentId = yArray[i],
11088
- expectedId = yArray[i - 1] + 1;
11089
-
11090
- if (currentId > expectedId) {
11091
- return expectedId - currentPageNumber;
11092
- }
11093
- }
11094
- }
11095
-
11096
- if (previous) {
11097
- const firstId = yArray[0];
11098
-
11099
- if (firstId < currentPageNumber) {
11100
- return currentPageNumber - firstId + 1;
11101
- }
11102
- } else {
11103
- const lastId = yArray[numPages - 1];
11104
-
11105
- if (lastId > currentPageNumber) {
11106
- return lastId - currentPageNumber + 1;
11107
- }
11108
- }
11109
-
11110
- break;
11111
- }
11112
-
11113
- break;
11114
- }
11115
-
11116
- case _ui_utils.ScrollMode.HORIZONTAL:
11117
- {
11118
- break;
11119
- }
11120
-
11121
- case _ui_utils.ScrollMode.VERTICAL:
11122
- {
11123
- if (this._spreadMode === _ui_utils.SpreadMode.NONE) {
11124
- break;
11125
- }
11126
-
11127
- const parity = this._spreadMode - 1;
11128
-
11129
- if (previous && currentPageNumber % 2 !== parity) {
11130
- break;
11131
- } else if (!previous && currentPageNumber % 2 === parity) {
11132
- break;
11133
- }
11134
-
11135
- const {
11136
- views
11137
- } = this._getVisiblePages(),
11138
- expectedId = previous ? currentPageNumber - 1 : currentPageNumber + 1;
11139
-
11140
- for (const {
11141
- id,
11142
- percent,
11143
- widthPercent
11144
- } of views) {
11145
- if (id !== expectedId) {
11146
- continue;
11147
- }
11148
-
11149
- if (percent > 0 && widthPercent === 100) {
11150
- return 2;
11151
- }
11152
-
11153
- break;
11154
- }
11155
-
11156
- break;
11157
- }
11158
- }
11159
-
11160
- return 1;
11161
- }
11162
-
11163
- nextPage() {
11164
- const currentPageNumber = this._currentPageNumber,
11165
- pagesCount = this.pagesCount;
11166
-
11167
- if (currentPageNumber >= pagesCount) {
11168
- return false;
11169
- }
11170
-
11171
- const advance = this._getPageAdvance(currentPageNumber, false) || 1;
11172
- this.currentPageNumber = Math.min(currentPageNumber + advance, pagesCount);
11173
- return true;
11174
- }
11175
-
11176
- previousPage() {
11177
- const currentPageNumber = this._currentPageNumber;
11178
-
11179
- if (currentPageNumber <= 1) {
11180
- return false;
11181
- }
11182
-
11183
- const advance = this._getPageAdvance(currentPageNumber, true) || 1;
11184
- this.currentPageNumber = Math.max(currentPageNumber - advance, 1);
11185
- return true;
11186
- }
11187
-
11188
- }
11189
-
11190
- exports.BaseViewer = BaseViewer;
11191
-
11192
- /***/ }),
11193
- /* 29 */
11194
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11195
-
11196
-
11197
-
11198
- Object.defineProperty(exports, "__esModule", ({
11199
- value: true
11200
- }));
11201
- exports.DefaultAnnotationLayerFactory = exports.AnnotationLayerBuilder = void 0;
11202
-
11203
- var _pdfjsLib = __webpack_require__(5);
11204
-
11205
- var _l10n_utils = __webpack_require__(30);
11206
-
11207
- var _pdf_link_service = __webpack_require__(19);
11208
-
11209
- class AnnotationLayerBuilder {
11210
- constructor({
11211
- pageDiv,
11212
- pdfPage,
11213
- linkService,
11214
- downloadManager,
11215
- annotationStorage = null,
11216
- imageResourcesPath = "",
11217
- renderInteractiveForms = true,
11218
- l10n = _l10n_utils.NullL10n,
11219
- enableScripting = false,
11220
- hasJSActionsPromise = null,
11221
- mouseState = null
11222
- }) {
11223
- this.pageDiv = pageDiv;
11224
- this.pdfPage = pdfPage;
11225
- this.linkService = linkService;
11226
- this.downloadManager = downloadManager;
11227
- this.imageResourcesPath = imageResourcesPath;
11228
- this.renderInteractiveForms = renderInteractiveForms;
11229
- this.l10n = l10n;
11230
- this.annotationStorage = annotationStorage;
11231
- this.enableScripting = enableScripting;
11232
- this._hasJSActionsPromise = hasJSActionsPromise;
11233
- this._mouseState = mouseState;
11234
- this.div = null;
11235
- this._cancelled = false;
11236
- }
11237
-
11238
- render(viewport, intent = "display") {
11239
- return Promise.all([this.pdfPage.getAnnotations({
11240
- intent
11241
- }), this._hasJSActionsPromise]).then(([annotations, hasJSActions = false]) => {
11242
- if (this._cancelled) {
11243
- return;
11244
- }
11245
-
11246
- if (annotations.length === 0) {
11247
- return;
11248
- }
11249
-
11250
- const parameters = {
11251
- viewport: viewport.clone({
11252
- dontFlip: true
11253
- }),
11254
- div: this.div,
11255
- annotations,
11256
- page: this.pdfPage,
11257
- imageResourcesPath: this.imageResourcesPath,
11258
- renderInteractiveForms: this.renderInteractiveForms,
11259
- linkService: this.linkService,
11260
- downloadManager: this.downloadManager,
11261
- annotationStorage: this.annotationStorage,
11262
- enableScripting: this.enableScripting,
11263
- hasJSActions,
11264
- mouseState: this._mouseState
11265
- };
11266
-
11267
- if (this.div) {
11268
- _pdfjsLib.AnnotationLayer.update(parameters);
11269
- } else {
11270
- this.div = document.createElement("div");
11271
- this.div.className = "annotationLayer";
11272
- this.pageDiv.appendChild(this.div);
11273
- parameters.div = this.div;
11274
-
11275
- _pdfjsLib.AnnotationLayer.render(parameters);
11276
-
11277
- this.l10n.translate(this.div);
11278
- }
11279
- });
11280
- }
11281
-
11282
- cancel() {
11283
- this._cancelled = true;
11284
- }
11285
-
11286
- hide() {
11287
- if (!this.div) {
11288
- return;
11289
- }
11290
-
11291
- this.div.hidden = true;
11292
- }
11293
-
11294
- }
11295
-
11296
- exports.AnnotationLayerBuilder = AnnotationLayerBuilder;
11297
-
11298
- class DefaultAnnotationLayerFactory {
11299
- createAnnotationLayerBuilder(pageDiv, pdfPage, annotationStorage = null, imageResourcesPath = "", renderInteractiveForms = true, l10n = _l10n_utils.NullL10n, enableScripting = false, hasJSActionsPromise = null, mouseState = null) {
11300
- return new AnnotationLayerBuilder({
11301
- pageDiv,
11302
- pdfPage,
11303
- imageResourcesPath,
11304
- renderInteractiveForms,
11305
- linkService: new _pdf_link_service.SimpleLinkService(),
11306
- l10n,
11307
- annotationStorage,
11308
- enableScripting,
11309
- hasJSActionsPromise,
11310
- mouseState
11311
- });
11312
- }
11313
-
11314
- }
11315
-
11316
- exports.DefaultAnnotationLayerFactory = DefaultAnnotationLayerFactory;
11317
-
11318
- /***/ }),
11319
- /* 30 */
11320
- /***/ ((__unused_webpack_module, exports) => {
11321
-
11322
-
11323
-
11324
- Object.defineProperty(exports, "__esModule", ({
11325
- value: true
11326
- }));
11327
- exports.fixupLangCode = fixupLangCode;
11328
- exports.getL10nFallback = getL10nFallback;
11329
- exports.NullL10n = void 0;
11330
- const DEFAULT_L10N_STRINGS = {
11331
- of_pages: "of {{pagesCount}}",
11332
- page_of_pages: "({{pageNumber}} of {{pagesCount}})",
11333
- document_properties_kb: "{{size_kb}} KB ({{size_b}} bytes)",
11334
- document_properties_mb: "{{size_mb}} MB ({{size_b}} bytes)",
11335
- document_properties_date_string: "{{date}}, {{time}}",
11336
- document_properties_page_size_unit_inches: "in",
11337
- document_properties_page_size_unit_millimeters: "mm",
11338
- document_properties_page_size_orientation_portrait: "portrait",
11339
- document_properties_page_size_orientation_landscape: "landscape",
11340
- document_properties_page_size_name_a3: "A3",
11341
- document_properties_page_size_name_a4: "A4",
11342
- document_properties_page_size_name_letter: "Letter",
11343
- document_properties_page_size_name_legal: "Legal",
11344
- document_properties_page_size_dimension_string: "{{width}} × {{height}} {{unit}} ({{orientation}})",
11345
- document_properties_page_size_dimension_name_string: "{{width}} × {{height}} {{unit}} ({{name}}, {{orientation}})",
11346
- document_properties_linearized_yes: "Yes",
11347
- document_properties_linearized_no: "No",
11348
- print_progress_percent: "{{progress}}%",
11349
- "toggle_sidebar.title": "Toggle Sidebar",
11350
- "toggle_sidebar_notification2.title": "Toggle Sidebar (document contains outline/attachments/layers)",
11351
- additional_layers: "Additional Layers",
11352
- page_landmark: "Page {{page}}",
11353
- thumb_page_title: "Page {{page}}",
11354
- thumb_page_canvas: "Thumbnail of Page {{page}}",
11355
- find_reached_top: "Reached top of document, continued from bottom",
11356
- find_reached_bottom: "Reached end of document, continued from top",
11357
- "find_match_count[one]": "{{current}} of {{total}} match",
11358
- "find_match_count[other]": "{{current}} of {{total}} matches",
11359
- "find_match_count_limit[one]": "More than {{limit}} match",
11360
- "find_match_count_limit[other]": "More than {{limit}} matches",
11361
- find_not_found: "Phrase not found",
11362
- error_version_info: "PDF.js v{{version}} (build: {{build}})",
11363
- error_message: "Message: {{message}}",
11364
- error_stack: "Stack: {{stack}}",
11365
- error_file: "File: {{file}}",
11366
- error_line: "Line: {{line}}",
11367
- rendering_error: "An error occurred while rendering the page.",
11368
- page_scale_width: "Page Width",
11369
- page_scale_fit: "Page Fit",
11370
- page_scale_auto: "Automatic Zoom",
11371
- page_scale_actual: "Actual Size",
11372
- page_scale_percent: "{{scale}}%",
11373
- loading: "Loading…",
11374
- loading_error: "An error occurred while loading the PDF.",
11375
- invalid_file_error: "Invalid or corrupted PDF file.",
11376
- missing_file_error: "Missing PDF file.",
11377
- unexpected_response_error: "Unexpected server response.",
11378
- printing_not_supported: "Warning: Printing is not fully supported by this browser.",
11379
- printing_not_ready: "Warning: The PDF is not fully loaded for printing.",
11380
- web_fonts_disabled: "Web fonts are disabled: unable to use embedded PDF fonts."
11381
- };
11382
-
11383
- function getL10nFallback(key, args) {
11384
- switch (key) {
11385
- case "find_match_count":
11386
- key = `find_match_count[${args.total === 1 ? "one" : "other"}]`;
11387
- break;
11388
-
11389
- case "find_match_count_limit":
11390
- key = `find_match_count_limit[${args.limit === 1 ? "one" : "other"}]`;
11391
- break;
11392
- }
11393
-
11394
- return DEFAULT_L10N_STRINGS[key] || "";
11395
- }
11396
-
11397
- const PARTIAL_LANG_CODES = {
11398
- en: "en-US",
11399
- es: "es-ES",
11400
- fy: "fy-NL",
11401
- ga: "ga-IE",
11402
- gu: "gu-IN",
11403
- hi: "hi-IN",
11404
- hy: "hy-AM",
11405
- nb: "nb-NO",
11406
- ne: "ne-NP",
11407
- nn: "nn-NO",
11408
- pa: "pa-IN",
11409
- pt: "pt-PT",
11410
- sv: "sv-SE",
11411
- zh: "zh-CN"
11412
- };
11413
-
11414
- function fixupLangCode(langCode) {
11415
- return PARTIAL_LANG_CODES[langCode?.toLowerCase()] || langCode;
11416
- }
11417
-
11418
- function formatL10nValue(text, args) {
11419
- if (!args) {
11420
- return text;
11421
- }
11422
-
11423
- return text.replace(/\{\{\s*(\w+)\s*\}\}/g, (all, name) => {
11424
- return name in args ? args[name] : "{{" + name + "}}";
11425
- });
11426
- }
11427
-
11428
- const NullL10n = {
11429
- async getLanguage() {
11430
- return "en-us";
11431
- },
11432
-
11433
- async getDirection() {
11434
- return "ltr";
11435
- },
11436
-
11437
- async get(key, args = null, fallback = getL10nFallback(key, args)) {
11438
- return formatL10nValue(fallback, args);
11439
- },
11440
-
11441
- async translate(element) {}
11442
-
11443
- };
11444
- exports.NullL10n = NullL10n;
11445
-
11446
- /***/ }),
11447
- /* 31 */
11448
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11449
-
11450
-
11451
-
11452
- Object.defineProperty(exports, "__esModule", ({
11453
- value: true
11454
- }));
11455
- exports.PDFPageView = void 0;
11456
-
11457
- var _ui_utils = __webpack_require__(4);
11458
-
11459
- var _pdfjsLib = __webpack_require__(5);
11460
-
11461
- var _l10n_utils = __webpack_require__(30);
11462
-
11463
- var _pdf_rendering_queue = __webpack_require__(8);
11464
-
11465
- var _viewer_compatibility = __webpack_require__(2);
11466
-
11467
- const MAX_CANVAS_PIXELS = _viewer_compatibility.viewerCompatibilityParams.maxCanvasPixels || 16777216;
11468
-
11469
- class PDFPageView {
11470
- constructor(options) {
11471
- const container = options.container;
11472
- const defaultViewport = options.defaultViewport;
11473
- this.id = options.id;
11474
- this.renderingId = "page" + this.id;
11475
- this.pdfPage = null;
11476
- this.pageLabel = null;
11477
- this.rotation = 0;
11478
- this.scale = options.scale || _ui_utils.DEFAULT_SCALE;
11479
- this.viewport = defaultViewport;
11480
- this.pdfPageRotate = defaultViewport.rotation;
11481
- this._optionalContentConfigPromise = options.optionalContentConfigPromise || null;
11482
- this.hasRestrictedScaling = false;
11483
- this.textLayerMode = Number.isInteger(options.textLayerMode) ? options.textLayerMode : _ui_utils.TextLayerMode.ENABLE;
11484
- this.imageResourcesPath = options.imageResourcesPath || "";
11485
- this.renderInteractiveForms = options.renderInteractiveForms !== false;
11486
- this.useOnlyCssZoom = options.useOnlyCssZoom || false;
11487
- this.maxCanvasPixels = options.maxCanvasPixels || MAX_CANVAS_PIXELS;
11488
- this.eventBus = options.eventBus;
11489
- this.renderingQueue = options.renderingQueue;
11490
- this.textLayerFactory = options.textLayerFactory;
11491
- this.annotationLayerFactory = options.annotationLayerFactory;
11492
- this.xfaLayerFactory = options.xfaLayerFactory;
11493
- this.structTreeLayerFactory = options.structTreeLayerFactory;
11494
- this.renderer = options.renderer || _ui_utils.RendererType.CANVAS;
11495
- this.l10n = options.l10n || _l10n_utils.NullL10n;
11496
- this.paintTask = null;
11497
- this.paintedViewportMap = new WeakMap();
11498
- this.renderingState = _pdf_rendering_queue.RenderingStates.INITIAL;
11499
- this.resume = null;
11500
- this._renderError = null;
11501
- this.annotationLayer = null;
11502
- this.textLayer = null;
11503
- this.zoomLayer = null;
11504
- this.xfaLayer = null;
11505
- this.structTreeLayer = null;
11506
- const div = document.createElement("div");
11507
- div.className = "page";
11508
- div.style.width = Math.floor(this.viewport.width) + "px";
11509
- div.style.height = Math.floor(this.viewport.height) + "px";
11510
- div.setAttribute("data-page-number", this.id);
11511
- div.setAttribute("role", "region");
11512
- this.l10n.get("page_landmark", {
11513
- page: this.id
11514
- }).then(msg => {
11515
- div.setAttribute("aria-label", msg);
11516
- });
11517
- this.div = div;
11518
- container.appendChild(div);
11519
- }
11520
-
11521
- setPdfPage(pdfPage) {
11522
- this.pdfPage = pdfPage;
11523
- this.pdfPageRotate = pdfPage.rotate;
11524
- const totalRotation = (this.rotation + this.pdfPageRotate) % 360;
11525
- this.viewport = pdfPage.getViewport({
11526
- scale: this.scale * _ui_utils.CSS_UNITS,
11527
- rotation: totalRotation
11528
- });
11529
- this.reset();
11530
- }
11531
-
11532
- destroy() {
11533
- this.reset();
11534
-
11535
- if (this.pdfPage) {
11536
- this.pdfPage.cleanup();
11537
- }
11538
- }
11539
-
11540
- async _renderAnnotationLayer() {
11541
- let error = null;
11542
-
11543
- try {
11544
- await this.annotationLayer.render(this.viewport, "display");
11545
- } catch (ex) {
11546
- error = ex;
11547
- } finally {
11548
- this.eventBus.dispatch("annotationlayerrendered", {
11549
- source: this,
11550
- pageNumber: this.id,
11551
- error
11552
- });
11553
- }
11554
- }
11555
-
11556
- async _renderXfaLayer() {
11557
- let error = null;
11558
-
11559
- try {
11560
- await this.xfaLayer.render(this.viewport, "display");
11561
- } catch (ex) {
11562
- error = ex;
11563
- } finally {
11564
- this.eventBus.dispatch("xfalayerrendered", {
11565
- source: this,
11566
- pageNumber: this.id,
11567
- error
11568
- });
11569
- }
11570
- }
11571
-
11572
- _resetZoomLayer(removeFromDOM = false) {
11573
- if (!this.zoomLayer) {
11574
- return;
11575
- }
11576
-
11577
- const zoomLayerCanvas = this.zoomLayer.firstChild;
11578
- this.paintedViewportMap.delete(zoomLayerCanvas);
11579
- zoomLayerCanvas.width = 0;
11580
- zoomLayerCanvas.height = 0;
11581
-
11582
- if (removeFromDOM) {
11583
- this.zoomLayer.remove();
11584
- }
11585
-
11586
- this.zoomLayer = null;
11587
- }
11588
-
11589
- reset({
11590
- keepZoomLayer = false,
11591
- keepAnnotationLayer = false,
11592
- keepXfaLayer = false
11593
- } = {}) {
11594
- this.cancelRendering({
11595
- keepAnnotationLayer,
11596
- keepXfaLayer
11597
- });
11598
- this.renderingState = _pdf_rendering_queue.RenderingStates.INITIAL;
11599
- const div = this.div;
11600
- div.style.width = Math.floor(this.viewport.width) + "px";
11601
- div.style.height = Math.floor(this.viewport.height) + "px";
11602
- const childNodes = div.childNodes,
11603
- zoomLayerNode = keepZoomLayer && this.zoomLayer || null,
11604
- annotationLayerNode = keepAnnotationLayer && this.annotationLayer?.div || null,
11605
- xfaLayerNode = keepXfaLayer && this.xfaLayer?.div || null;
11606
-
11607
- for (let i = childNodes.length - 1; i >= 0; i--) {
11608
- const node = childNodes[i];
11609
-
11610
- switch (node) {
11611
- case zoomLayerNode:
11612
- case annotationLayerNode:
11613
- case xfaLayerNode:
11614
- continue;
11615
- }
11616
-
11617
- div.removeChild(node);
11618
- }
11619
-
11620
- div.removeAttribute("data-loaded");
11621
-
11622
- if (annotationLayerNode) {
11623
- this.annotationLayer.hide();
11624
- }
11625
-
11626
- if (xfaLayerNode) {
11627
- this.xfaLayer.hide();
11628
- }
11629
-
11630
- if (!zoomLayerNode) {
11631
- if (this.canvas) {
11632
- this.paintedViewportMap.delete(this.canvas);
11633
- this.canvas.width = 0;
11634
- this.canvas.height = 0;
11635
- delete this.canvas;
11636
- }
11637
-
11638
- this._resetZoomLayer();
11639
- }
11640
-
11641
- if (this.svg) {
11642
- this.paintedViewportMap.delete(this.svg);
11643
- delete this.svg;
11644
- }
11645
-
11646
- this.loadingIconDiv = document.createElement("div");
11647
- this.loadingIconDiv.className = "loadingIcon";
11648
- this.loadingIconDiv.setAttribute("role", "img");
11649
- this.l10n.get("loading").then(msg => {
11650
- this.loadingIconDiv?.setAttribute("aria-label", msg);
11651
- });
11652
- div.appendChild(this.loadingIconDiv);
11653
- }
11654
-
11655
- update(scale, rotation, optionalContentConfigPromise = null) {
11656
- this.scale = scale || this.scale;
11657
-
11658
- if (typeof rotation !== "undefined") {
11659
- this.rotation = rotation;
11660
- }
11661
-
11662
- if (optionalContentConfigPromise instanceof Promise) {
11663
- this._optionalContentConfigPromise = optionalContentConfigPromise;
11664
- }
11665
-
11666
- const totalRotation = (this.rotation + this.pdfPageRotate) % 360;
11667
- this.viewport = this.viewport.clone({
11668
- scale: this.scale * _ui_utils.CSS_UNITS,
11669
- rotation: totalRotation
11670
- });
11671
-
11672
- if (this.svg) {
11673
- this.cssTransform({
11674
- target: this.svg,
11675
- redrawAnnotationLayer: true,
11676
- redrawXfaLayer: true
11677
- });
11678
- this.eventBus.dispatch("pagerendered", {
11679
- source: this,
11680
- pageNumber: this.id,
11681
- cssTransform: true,
11682
- timestamp: performance.now(),
11683
- error: this._renderError
11684
- });
11685
- return;
11686
- }
11687
-
11688
- let isScalingRestricted = false;
11689
-
11690
- if (this.canvas && this.maxCanvasPixels > 0) {
11691
- const outputScale = this.outputScale;
11692
-
11693
- if ((Math.floor(this.viewport.width) * outputScale.sx | 0) * (Math.floor(this.viewport.height) * outputScale.sy | 0) > this.maxCanvasPixels) {
11694
- isScalingRestricted = true;
11695
- }
11696
- }
11697
-
11698
- if (this.canvas) {
11699
- if (this.useOnlyCssZoom || this.hasRestrictedScaling && isScalingRestricted) {
11700
- this.cssTransform({
11701
- target: this.canvas,
11702
- redrawAnnotationLayer: true,
11703
- redrawXfaLayer: true
11704
- });
11705
- this.eventBus.dispatch("pagerendered", {
11706
- source: this,
11707
- pageNumber: this.id,
11708
- cssTransform: true,
11709
- timestamp: performance.now(),
11710
- error: this._renderError
11711
- });
11712
- return;
11713
- }
11714
-
11715
- if (!this.zoomLayer && !this.canvas.hidden) {
11716
- this.zoomLayer = this.canvas.parentNode;
11717
- this.zoomLayer.style.position = "absolute";
11718
- }
11719
- }
11720
-
11721
- if (this.zoomLayer) {
11722
- this.cssTransform({
11723
- target: this.zoomLayer.firstChild
11724
- });
11725
- }
11726
-
11727
- this.reset({
11728
- keepZoomLayer: true,
11729
- keepAnnotationLayer: true,
11730
- keepXfaLayer: true
11731
- });
11732
- }
11733
-
11734
- cancelRendering({
11735
- keepAnnotationLayer = false,
11736
- keepXfaLayer = false
11737
- } = {}) {
11738
- if (this.paintTask) {
11739
- this.paintTask.cancel();
11740
- this.paintTask = null;
11741
- }
11742
-
11743
- this.resume = null;
11744
-
11745
- if (this.textLayer) {
11746
- this.textLayer.cancel();
11747
- this.textLayer = null;
11748
- }
11749
-
11750
- if (this.annotationLayer && (!keepAnnotationLayer || !this.annotationLayer.div)) {
11751
- this.annotationLayer.cancel();
11752
- this.annotationLayer = null;
11753
- }
11754
-
11755
- if (this.xfaLayer && (!keepXfaLayer || !this.xfaLayer.div)) {
11756
- this.xfaLayer.cancel();
11757
- this.xfaLayer = null;
11758
- }
11759
-
11760
- if (this._onTextLayerRendered) {
11761
- this.eventBus._off("textlayerrendered", this._onTextLayerRendered);
11762
-
11763
- this._onTextLayerRendered = null;
11764
- }
11765
- }
11766
-
11767
- cssTransform({
11768
- target,
11769
- redrawAnnotationLayer = false,
11770
- redrawXfaLayer = false
11771
- }) {
11772
- const width = this.viewport.width;
11773
- const height = this.viewport.height;
11774
- const div = this.div;
11775
- target.style.width = target.parentNode.style.width = div.style.width = Math.floor(width) + "px";
11776
- target.style.height = target.parentNode.style.height = div.style.height = Math.floor(height) + "px";
11777
- const relativeRotation = this.viewport.rotation - this.paintedViewportMap.get(target).rotation;
11778
- const absRotation = Math.abs(relativeRotation);
11779
- let scaleX = 1,
11780
- scaleY = 1;
11781
-
11782
- if (absRotation === 90 || absRotation === 270) {
11783
- scaleX = height / width;
11784
- scaleY = width / height;
11785
- }
11786
-
11787
- target.style.transform = `rotate(${relativeRotation}deg) scale(${scaleX}, ${scaleY})`;
11788
-
11789
- if (this.textLayer) {
11790
- const textLayerViewport = this.textLayer.viewport;
11791
- const textRelativeRotation = this.viewport.rotation - textLayerViewport.rotation;
11792
- const textAbsRotation = Math.abs(textRelativeRotation);
11793
- let scale = width / textLayerViewport.width;
11794
-
11795
- if (textAbsRotation === 90 || textAbsRotation === 270) {
11796
- scale = width / textLayerViewport.height;
11797
- }
11798
-
11799
- const textLayerDiv = this.textLayer.textLayerDiv;
11800
- let transX, transY;
11801
-
11802
- switch (textAbsRotation) {
11803
- case 0:
11804
- transX = transY = 0;
11805
- break;
11806
-
11807
- case 90:
11808
- transX = 0;
11809
- transY = "-" + textLayerDiv.style.height;
11810
- break;
11811
-
11812
- case 180:
11813
- transX = "-" + textLayerDiv.style.width;
11814
- transY = "-" + textLayerDiv.style.height;
11815
- break;
11816
-
11817
- case 270:
11818
- transX = "-" + textLayerDiv.style.width;
11819
- transY = 0;
11820
- break;
11821
-
11822
- default:
11823
- console.error("Bad rotation value.");
11824
- break;
11825
- }
11826
-
11827
- textLayerDiv.style.transform = `rotate(${textAbsRotation}deg) ` + `scale(${scale}) ` + `translate(${transX}, ${transY})`;
11828
- textLayerDiv.style.transformOrigin = "0% 0%";
11829
- }
11830
-
11831
- if (redrawAnnotationLayer && this.annotationLayer) {
11832
- this._renderAnnotationLayer();
11833
- }
11834
-
11835
- if (redrawXfaLayer && this.xfaLayer) {
11836
- this._renderXfaLayer();
11837
- }
11838
- }
11839
-
11840
- get width() {
11841
- return this.viewport.width;
11842
- }
11843
-
11844
- get height() {
11845
- return this.viewport.height;
11846
- }
11847
-
11848
- getPagePoint(x, y) {
11849
- return this.viewport.convertToPdfPoint(x, y);
11850
- }
11851
-
11852
- draw() {
11853
- if (this.renderingState !== _pdf_rendering_queue.RenderingStates.INITIAL) {
11854
- console.error("Must be in new state before drawing");
11855
- this.reset();
11856
- }
11857
-
11858
- const {
11859
- div,
11860
- pdfPage
11861
- } = this;
11862
-
11863
- if (!pdfPage) {
11864
- this.renderingState = _pdf_rendering_queue.RenderingStates.FINISHED;
11865
-
11866
- if (this.loadingIconDiv) {
11867
- div.removeChild(this.loadingIconDiv);
11868
- delete this.loadingIconDiv;
11869
- }
11870
-
11871
- return Promise.reject(new Error("pdfPage is not loaded"));
11872
- }
11873
-
11874
- this.renderingState = _pdf_rendering_queue.RenderingStates.RUNNING;
11875
- const canvasWrapper = document.createElement("div");
11876
- canvasWrapper.style.width = div.style.width;
11877
- canvasWrapper.style.height = div.style.height;
11878
- canvasWrapper.classList.add("canvasWrapper");
11879
-
11880
- if (this.annotationLayer?.div) {
11881
- div.insertBefore(canvasWrapper, this.annotationLayer.div);
11882
- } else {
11883
- div.appendChild(canvasWrapper);
11884
- }
11885
-
11886
- let textLayer = null;
11887
-
11888
- if (this.textLayerMode !== _ui_utils.TextLayerMode.DISABLE && this.textLayerFactory) {
11889
- const textLayerDiv = document.createElement("div");
11890
- textLayerDiv.className = "textLayer";
11891
- textLayerDiv.style.width = canvasWrapper.style.width;
11892
- textLayerDiv.style.height = canvasWrapper.style.height;
11893
-
11894
- if (this.annotationLayer?.div) {
11895
- div.insertBefore(textLayerDiv, this.annotationLayer.div);
11896
- } else {
11897
- div.appendChild(textLayerDiv);
11898
- }
11899
-
11900
- textLayer = this.textLayerFactory.createTextLayerBuilder(textLayerDiv, this.id - 1, this.viewport, this.textLayerMode === _ui_utils.TextLayerMode.ENABLE_ENHANCE, this.eventBus);
11901
- }
11902
-
11903
- this.textLayer = textLayer;
11904
-
11905
- if (this.xfaLayer?.div) {
11906
- div.appendChild(this.xfaLayer.div);
11907
- }
11908
-
11909
- let renderContinueCallback = null;
11910
-
11911
- if (this.renderingQueue) {
11912
- renderContinueCallback = cont => {
11913
- if (!this.renderingQueue.isHighestPriority(this)) {
11914
- this.renderingState = _pdf_rendering_queue.RenderingStates.PAUSED;
11915
-
11916
- this.resume = () => {
11917
- this.renderingState = _pdf_rendering_queue.RenderingStates.RUNNING;
11918
- cont();
11919
- };
11920
-
11921
- return;
11922
- }
11923
-
11924
- cont();
11925
- };
11926
- }
11927
-
11928
- const finishPaintTask = async (error = null) => {
11929
- if (paintTask === this.paintTask) {
11930
- this.paintTask = null;
11931
- }
11932
-
11933
- if (error instanceof _pdfjsLib.RenderingCancelledException) {
11934
- this._renderError = null;
11935
- return;
11936
- }
11937
-
11938
- this._renderError = error;
11939
- this.renderingState = _pdf_rendering_queue.RenderingStates.FINISHED;
11940
-
11941
- if (this.loadingIconDiv) {
11942
- div.removeChild(this.loadingIconDiv);
11943
- delete this.loadingIconDiv;
11944
- }
11945
-
11946
- this._resetZoomLayer(true);
11947
-
11948
- this.eventBus.dispatch("pagerendered", {
11949
- source: this,
11950
- pageNumber: this.id,
11951
- cssTransform: false,
11952
- timestamp: performance.now(),
11953
- error: this._renderError
11954
- });
11955
-
11956
- if (error) {
11957
- throw error;
11958
- }
11959
- };
11960
-
11961
- const paintTask = this.renderer === _ui_utils.RendererType.SVG ? this.paintOnSvg(canvasWrapper) : this.paintOnCanvas(canvasWrapper);
11962
- paintTask.onRenderContinue = renderContinueCallback;
11963
- this.paintTask = paintTask;
11964
- const resultPromise = paintTask.promise.then(() => {
11965
- return finishPaintTask(null).then(() => {
11966
- if (textLayer) {
11967
- const readableStream = pdfPage.streamTextContent({
11968
- normalizeWhitespace: true,
11969
- includeMarkedContent: true
11970
- });
11971
- textLayer.setTextContentStream(readableStream);
11972
- textLayer.render();
11973
- }
11974
- });
11975
- }, function (reason) {
11976
- return finishPaintTask(reason);
11977
- });
11978
-
11979
- if (this.annotationLayerFactory) {
11980
- if (!this.annotationLayer) {
11981
- this.annotationLayer = this.annotationLayerFactory.createAnnotationLayerBuilder(div, pdfPage, null, this.imageResourcesPath, this.renderInteractiveForms, this.l10n, null, null, null);
11982
- }
11983
-
11984
- this._renderAnnotationLayer();
11985
- }
11986
-
11987
- if (this.xfaLayerFactory) {
11988
- if (!this.xfaLayer) {
11989
- this.xfaLayer = this.xfaLayerFactory.createXfaLayerBuilder(div, pdfPage, null);
11990
- }
11991
-
11992
- this._renderXfaLayer();
11993
- }
11994
-
11995
- if (this.structTreeLayerFactory && this.textLayer && this.canvas) {
11996
- this._onTextLayerRendered = event => {
11997
- if (event.pageNumber !== this.id) {
11998
- return;
11999
- }
12000
-
12001
- this.eventBus._off("textlayerrendered", this._onTextLayerRendered);
12002
-
12003
- this._onTextLayerRendered = null;
12004
-
12005
- if (!this.canvas) {
12006
- return;
12007
- }
12008
-
12009
- this.pdfPage.getStructTree().then(tree => {
12010
- if (!tree) {
12011
- return;
12012
- }
12013
-
12014
- if (!this.canvas) {
12015
- return;
12016
- }
12017
-
12018
- const treeDom = this.structTreeLayer.render(tree);
12019
- treeDom.classList.add("structTree");
12020
- this.canvas.appendChild(treeDom);
12021
- });
12022
- };
12023
-
12024
- this.eventBus._on("textlayerrendered", this._onTextLayerRendered);
12025
-
12026
- this.structTreeLayer = this.structTreeLayerFactory.createStructTreeLayerBuilder(pdfPage);
12027
- }
12028
-
12029
- div.setAttribute("data-loaded", true);
12030
- this.eventBus.dispatch("pagerender", {
12031
- source: this,
12032
- pageNumber: this.id
12033
- });
12034
- return resultPromise;
12035
- }
12036
-
12037
- paintOnCanvas(canvasWrapper) {
12038
- const renderCapability = (0, _pdfjsLib.createPromiseCapability)();
12039
- const result = {
12040
- promise: renderCapability.promise,
12041
-
12042
- onRenderContinue(cont) {
12043
- cont();
12044
- },
12045
-
12046
- cancel() {
12047
- renderTask.cancel();
12048
- }
12049
-
12050
- };
12051
- const viewport = this.viewport;
12052
- const canvas = document.createElement("canvas");
12053
- canvas.hidden = true;
12054
- let isCanvasHidden = true;
12055
-
12056
- const showCanvas = function () {
12057
- if (isCanvasHidden) {
12058
- canvas.hidden = false;
12059
- isCanvasHidden = false;
12060
- }
12061
- };
12062
-
12063
- canvasWrapper.appendChild(canvas);
12064
- this.canvas = canvas;
12065
- canvas.mozOpaque = true;
12066
- const ctx = canvas.getContext("2d", {
12067
- alpha: false
12068
- });
12069
- const outputScale = (0, _ui_utils.getOutputScale)(ctx);
12070
- this.outputScale = outputScale;
12071
-
12072
- if (this.useOnlyCssZoom) {
12073
- const actualSizeViewport = viewport.clone({
12074
- scale: _ui_utils.CSS_UNITS
12075
- });
12076
- outputScale.sx *= actualSizeViewport.width / viewport.width;
12077
- outputScale.sy *= actualSizeViewport.height / viewport.height;
12078
- outputScale.scaled = true;
12079
- }
12080
-
12081
- if (this.maxCanvasPixels > 0) {
12082
- const pixelsInViewport = viewport.width * viewport.height;
12083
- const maxScale = Math.sqrt(this.maxCanvasPixels / pixelsInViewport);
12084
-
12085
- if (outputScale.sx > maxScale || outputScale.sy > maxScale) {
12086
- outputScale.sx = maxScale;
12087
- outputScale.sy = maxScale;
12088
- outputScale.scaled = true;
12089
- this.hasRestrictedScaling = true;
12090
- } else {
12091
- this.hasRestrictedScaling = false;
12092
- }
12093
- }
12094
-
12095
- const sfx = (0, _ui_utils.approximateFraction)(outputScale.sx);
12096
- const sfy = (0, _ui_utils.approximateFraction)(outputScale.sy);
12097
- canvas.width = (0, _ui_utils.roundToDivide)(viewport.width * outputScale.sx, sfx[0]);
12098
- canvas.height = (0, _ui_utils.roundToDivide)(viewport.height * outputScale.sy, sfy[0]);
12099
- canvas.style.width = (0, _ui_utils.roundToDivide)(viewport.width, sfx[1]) + "px";
12100
- canvas.style.height = (0, _ui_utils.roundToDivide)(viewport.height, sfy[1]) + "px";
12101
- this.paintedViewportMap.set(canvas, viewport);
12102
- const transform = !outputScale.scaled ? null : [outputScale.sx, 0, 0, outputScale.sy, 0, 0];
12103
- const renderContext = {
12104
- canvasContext: ctx,
12105
- transform,
12106
- viewport: this.viewport,
12107
- renderInteractiveForms: this.renderInteractiveForms,
12108
- optionalContentConfigPromise: this._optionalContentConfigPromise
12109
- };
12110
- const renderTask = this.pdfPage.render(renderContext);
12111
-
12112
- renderTask.onContinue = function (cont) {
12113
- showCanvas();
12114
-
12115
- if (result.onRenderContinue) {
12116
- result.onRenderContinue(cont);
12117
- } else {
12118
- cont();
12119
- }
12120
- };
12121
-
12122
- renderTask.promise.then(function () {
12123
- showCanvas();
12124
- renderCapability.resolve(undefined);
12125
- }, function (error) {
12126
- showCanvas();
12127
- renderCapability.reject(error);
12128
- });
12129
- return result;
12130
- }
12131
-
12132
- paintOnSvg(wrapper) {
12133
- let cancelled = false;
12134
-
12135
- const ensureNotCancelled = () => {
12136
- if (cancelled) {
12137
- throw new _pdfjsLib.RenderingCancelledException(`Rendering cancelled, page ${this.id}`, "svg");
12138
- }
12139
- };
12140
-
12141
- const pdfPage = this.pdfPage;
12142
- const actualSizeViewport = this.viewport.clone({
12143
- scale: _ui_utils.CSS_UNITS
12144
- });
12145
- const promise = pdfPage.getOperatorList().then(opList => {
12146
- ensureNotCancelled();
12147
- const svgGfx = new _pdfjsLib.SVGGraphics(pdfPage.commonObjs, pdfPage.objs, _viewer_compatibility.viewerCompatibilityParams.disableCreateObjectURL);
12148
- return svgGfx.getSVG(opList, actualSizeViewport).then(svg => {
12149
- ensureNotCancelled();
12150
- this.svg = svg;
12151
- this.paintedViewportMap.set(svg, actualSizeViewport);
12152
- svg.style.width = wrapper.style.width;
12153
- svg.style.height = wrapper.style.height;
12154
- this.renderingState = _pdf_rendering_queue.RenderingStates.FINISHED;
12155
- wrapper.appendChild(svg);
12156
- });
12157
- });
12158
- return {
12159
- promise,
12160
-
12161
- onRenderContinue(cont) {
12162
- cont();
12163
- },
12164
-
12165
- cancel() {
12166
- cancelled = true;
12167
- }
12168
-
12169
- };
12170
- }
12171
-
12172
- setPageLabel(label) {
12173
- this.pageLabel = typeof label === "string" ? label : null;
12174
-
12175
- if (this.pageLabel !== null) {
12176
- this.div.setAttribute("data-page-label", this.pageLabel);
12177
- } else {
12178
- this.div.removeAttribute("data-page-label");
12179
- }
12180
- }
12181
-
12182
- }
12183
-
12184
- exports.PDFPageView = PDFPageView;
12185
-
12186
- /***/ }),
12187
- /* 32 */
12188
- /***/ ((__unused_webpack_module, exports) => {
12189
-
12190
-
12191
-
12192
- Object.defineProperty(exports, "__esModule", ({
12193
- value: true
12194
- }));
12195
- exports.StructTreeLayerBuilder = exports.DefaultStructTreeLayerFactory = void 0;
12196
- const PDF_ROLE_TO_HTML_ROLE = {
12197
- Document: null,
12198
- DocumentFragment: null,
12199
- Part: "group",
12200
- Sect: "group",
12201
- Div: "group",
12202
- Aside: "note",
12203
- NonStruct: "none",
12204
- P: null,
12205
- H: "heading",
12206
- Title: null,
12207
- FENote: "note",
12208
- Sub: "group",
12209
- Lbl: null,
12210
- Span: null,
12211
- Em: null,
12212
- Strong: null,
12213
- Link: "link",
12214
- Annot: "note",
12215
- Form: "form",
12216
- Ruby: null,
12217
- RB: null,
12218
- RT: null,
12219
- RP: null,
12220
- Warichu: null,
12221
- WT: null,
12222
- WP: null,
12223
- L: "list",
12224
- LI: "listitem",
12225
- LBody: null,
12226
- Table: "table",
12227
- TR: "row",
12228
- TH: "columnheader",
12229
- TD: "cell",
12230
- THead: "columnheader",
12231
- TBody: null,
12232
- TFoot: null,
12233
- Caption: null,
12234
- Figure: "figure",
12235
- Formula: null,
12236
- Artifact: null
12237
- };
12238
- const HEADING_PATTERN = /^H(\d+)$/;
12239
-
12240
- class StructTreeLayerBuilder {
12241
- constructor({
12242
- pdfPage
12243
- }) {
12244
- this.pdfPage = pdfPage;
12245
- }
12246
-
12247
- render(structTree) {
12248
- return this._walk(structTree);
12249
- }
12250
-
12251
- _setAttributes(structElement, htmlElement) {
12252
- if (structElement.alt !== undefined) {
12253
- htmlElement.setAttribute("aria-label", structElement.alt);
12254
- }
12255
-
12256
- if (structElement.id !== undefined) {
12257
- htmlElement.setAttribute("aria-owns", structElement.id);
12258
- }
12259
- }
12260
-
12261
- _walk(node) {
12262
- if (!node) {
12263
- return null;
12264
- }
12265
-
12266
- const element = document.createElement("span");
12267
-
12268
- if ("role" in node) {
12269
- const {
12270
- role
12271
- } = node;
12272
- const match = role.match(HEADING_PATTERN);
12273
-
12274
- if (match) {
12275
- element.setAttribute("role", "heading");
12276
- element.setAttribute("aria-level", match[1]);
12277
- } else if (PDF_ROLE_TO_HTML_ROLE[role]) {
12278
- element.setAttribute("role", PDF_ROLE_TO_HTML_ROLE[role]);
12279
- }
12280
- }
12281
-
12282
- this._setAttributes(node, element);
12283
-
12284
- if (node.children) {
12285
- if (node.children.length === 1 && "id" in node.children[0]) {
12286
- this._setAttributes(node.children[0], element);
12287
- } else {
12288
- for (const kid of node.children) {
12289
- element.appendChild(this._walk(kid));
12290
- }
12291
- }
12292
- }
12293
-
12294
- return element;
12295
- }
12296
-
12297
- }
12298
-
12299
- exports.StructTreeLayerBuilder = StructTreeLayerBuilder;
12300
-
12301
- class DefaultStructTreeLayerFactory {
12302
- createStructTreeLayerBuilder(pdfPage) {
12303
- return new StructTreeLayerBuilder({
12304
- pdfPage
12305
- });
12306
- }
12307
-
12308
- }
12309
-
12310
- exports.DefaultStructTreeLayerFactory = DefaultStructTreeLayerFactory;
12311
-
12312
- /***/ }),
12313
- /* 33 */
12314
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12315
-
12316
-
12317
-
12318
- Object.defineProperty(exports, "__esModule", ({
12319
- value: true
12320
- }));
12321
- exports.TextLayerBuilder = exports.DefaultTextLayerFactory = void 0;
12322
-
12323
- var _pdfjsLib = __webpack_require__(5);
12324
-
12325
- const EXPAND_DIVS_TIMEOUT = 300;
12326
-
12327
- class TextLayerBuilder {
12328
- constructor({
12329
- textLayerDiv,
12330
- eventBus,
12331
- pageIndex,
12332
- viewport,
12333
- findController = null,
12334
- enhanceTextSelection = false
12335
- }) {
12336
- this.textLayerDiv = textLayerDiv;
12337
- this.eventBus = eventBus;
12338
- this.textContent = null;
12339
- this.textContentItemsStr = [];
12340
- this.textContentStream = null;
12341
- this.renderingDone = false;
12342
- this.pageIdx = pageIndex;
12343
- this.pageNumber = this.pageIdx + 1;
12344
- this.matches = [];
12345
- this.viewport = viewport;
12346
- this.textDivs = [];
12347
- this.findController = findController;
12348
- this.textLayerRenderTask = null;
12349
- this.enhanceTextSelection = enhanceTextSelection;
12350
- this._onUpdateTextLayerMatches = null;
12351
-
12352
- this._bindMouse();
12353
- }
12354
-
12355
- _finishRendering() {
12356
- this.renderingDone = true;
12357
-
12358
- if (!this.enhanceTextSelection) {
12359
- const endOfContent = document.createElement("div");
12360
- endOfContent.className = "endOfContent";
12361
- this.textLayerDiv.appendChild(endOfContent);
12362
- }
12363
-
12364
- this.eventBus.dispatch("textlayerrendered", {
12365
- source: this,
12366
- pageNumber: this.pageNumber,
12367
- numTextDivs: this.textDivs.length
12368
- });
12369
- }
12370
-
12371
- render(timeout = 0) {
12372
- if (!(this.textContent || this.textContentStream) || this.renderingDone) {
12373
- return;
12374
- }
12375
-
12376
- this.cancel();
12377
- this.textDivs = [];
12378
- const textLayerFrag = document.createDocumentFragment();
12379
- this.textLayerRenderTask = (0, _pdfjsLib.renderTextLayer)({
12380
- textContent: this.textContent,
12381
- textContentStream: this.textContentStream,
12382
- container: textLayerFrag,
12383
- viewport: this.viewport,
12384
- textDivs: this.textDivs,
12385
- textContentItemsStr: this.textContentItemsStr,
12386
- timeout,
12387
- enhanceTextSelection: this.enhanceTextSelection
12388
- });
12389
- this.textLayerRenderTask.promise.then(() => {
12390
- this.textLayerDiv.appendChild(textLayerFrag);
12391
-
12392
- this._finishRendering();
12393
-
12394
- this._updateMatches();
12395
- }, function (reason) {});
12396
-
12397
- if (!this._onUpdateTextLayerMatches) {
12398
- this._onUpdateTextLayerMatches = evt => {
12399
- if (evt.pageIndex === this.pageIdx || evt.pageIndex === -1) {
12400
- this._updateMatches();
12401
- }
12402
- };
12403
-
12404
- this.eventBus._on("updatetextlayermatches", this._onUpdateTextLayerMatches);
12405
- }
12406
- }
12407
-
12408
- cancel() {
12409
- if (this.textLayerRenderTask) {
12410
- this.textLayerRenderTask.cancel();
12411
- this.textLayerRenderTask = null;
12412
- }
12413
-
12414
- if (this._onUpdateTextLayerMatches) {
12415
- this.eventBus._off("updatetextlayermatches", this._onUpdateTextLayerMatches);
12416
-
12417
- this._onUpdateTextLayerMatches = null;
12418
- }
12419
- }
12420
-
12421
- setTextContentStream(readableStream) {
12422
- this.cancel();
12423
- this.textContentStream = readableStream;
12424
- }
12425
-
12426
- setTextContent(textContent) {
12427
- this.cancel();
12428
- this.textContent = textContent;
12429
- }
12430
-
12431
- _convertMatches(matches, matchesLength) {
12432
- if (!matches) {
12433
- return [];
12434
- }
12435
-
12436
- const {
12437
- textContentItemsStr
12438
- } = this;
12439
- let i = 0,
12440
- iIndex = 0;
12441
- const end = textContentItemsStr.length - 1;
12442
- const result = [];
12443
-
12444
- for (let m = 0, mm = matches.length; m < mm; m++) {
12445
- let matchIdx = matches[m];
12446
-
12447
- while (i !== end && matchIdx >= iIndex + textContentItemsStr[i].length) {
12448
- iIndex += textContentItemsStr[i].length;
12449
- i++;
12450
- }
12451
-
12452
- if (i === textContentItemsStr.length) {
12453
- console.error("Could not find a matching mapping");
12454
- }
12455
-
12456
- const match = {
12457
- begin: {
12458
- divIdx: i,
12459
- offset: matchIdx - iIndex
12460
- }
12461
- };
12462
- matchIdx += matchesLength[m];
12463
-
12464
- while (i !== end && matchIdx > iIndex + textContentItemsStr[i].length) {
12465
- iIndex += textContentItemsStr[i].length;
12466
- i++;
12467
- }
12468
-
12469
- match.end = {
12470
- divIdx: i,
12471
- offset: matchIdx - iIndex
12472
- };
12473
- result.push(match);
12474
- }
12475
-
12476
- return result;
12477
- }
12478
-
12479
- _renderMatches(matches) {
12480
- if (matches.length === 0) {
12481
- return;
12482
- }
12483
-
12484
- const {
12485
- findController,
12486
- pageIdx,
12487
- textContentItemsStr,
12488
- textDivs
12489
- } = this;
12490
- const isSelectedPage = pageIdx === findController.selected.pageIdx;
12491
- const selectedMatchIdx = findController.selected.matchIdx;
12492
- const highlightAll = findController.state.highlightAll;
12493
- let prevEnd = null;
12494
- const infinity = {
12495
- divIdx: -1,
12496
- offset: undefined
12497
- };
12498
-
12499
- function beginText(begin, className) {
12500
- const divIdx = begin.divIdx;
12501
- textDivs[divIdx].textContent = "";
12502
- return appendTextToDiv(divIdx, 0, begin.offset, className);
12503
- }
12504
-
12505
- function appendTextToDiv(divIdx, fromOffset, toOffset, className) {
12506
- const div = textDivs[divIdx];
12507
- const content = textContentItemsStr[divIdx].substring(fromOffset, toOffset);
12508
- const node = document.createTextNode(content);
12509
-
12510
- if (className) {
12511
- const span = document.createElement("span");
12512
- span.className = `${className} appended`;
12513
- span.appendChild(node);
12514
- div.appendChild(span);
12515
- return className.includes("selected") ? span.offsetLeft : 0;
12516
- }
12517
-
12518
- div.appendChild(node);
12519
- return 0;
12520
- }
12521
-
12522
- let i0 = selectedMatchIdx,
12523
- i1 = i0 + 1;
12524
-
12525
- if (highlightAll) {
12526
- i0 = 0;
12527
- i1 = matches.length;
12528
- } else if (!isSelectedPage) {
12529
- return;
12530
- }
12531
-
12532
- for (let i = i0; i < i1; i++) {
12533
- const match = matches[i];
12534
- const begin = match.begin;
12535
- const end = match.end;
12536
- const isSelected = isSelectedPage && i === selectedMatchIdx;
12537
- const highlightSuffix = isSelected ? " selected" : "";
12538
- let selectedLeft = 0;
12539
-
12540
- if (!prevEnd || begin.divIdx !== prevEnd.divIdx) {
12541
- if (prevEnd !== null) {
12542
- appendTextToDiv(prevEnd.divIdx, prevEnd.offset, infinity.offset);
12543
- }
12544
-
12545
- beginText(begin);
12546
- } else {
12547
- appendTextToDiv(prevEnd.divIdx, prevEnd.offset, begin.offset);
12548
- }
12549
-
12550
- if (begin.divIdx === end.divIdx) {
12551
- selectedLeft = appendTextToDiv(begin.divIdx, begin.offset, end.offset, "highlight" + highlightSuffix);
12552
- } else {
12553
- selectedLeft = appendTextToDiv(begin.divIdx, begin.offset, infinity.offset, "highlight begin" + highlightSuffix);
12554
-
12555
- for (let n0 = begin.divIdx + 1, n1 = end.divIdx; n0 < n1; n0++) {
12556
- textDivs[n0].className = "highlight middle" + highlightSuffix;
12557
- }
12558
-
12559
- beginText(end, "highlight end" + highlightSuffix);
12560
- }
12561
-
12562
- prevEnd = end;
12563
-
12564
- if (isSelected) {
12565
- findController.scrollMatchIntoView({
12566
- element: textDivs[begin.divIdx],
12567
- selectedLeft,
12568
- pageIndex: pageIdx,
12569
- matchIndex: selectedMatchIdx
12570
- });
12571
- }
12572
- }
12573
-
12574
- if (prevEnd) {
12575
- appendTextToDiv(prevEnd.divIdx, prevEnd.offset, infinity.offset);
12576
- }
12577
- }
12578
-
12579
- _updateMatches() {
12580
- if (!this.renderingDone) {
12581
- return;
12582
- }
12583
-
12584
- const {
12585
- findController,
12586
- matches,
12587
- pageIdx,
12588
- textContentItemsStr,
12589
- textDivs
12590
- } = this;
12591
- let clearedUntilDivIdx = -1;
12592
-
12593
- for (let i = 0, ii = matches.length; i < ii; i++) {
12594
- const match = matches[i];
12595
- const begin = Math.max(clearedUntilDivIdx, match.begin.divIdx);
12596
-
12597
- for (let n = begin, end = match.end.divIdx; n <= end; n++) {
12598
- const div = textDivs[n];
12599
- div.textContent = textContentItemsStr[n];
12600
- div.className = "";
12601
- }
12602
-
12603
- clearedUntilDivIdx = match.end.divIdx + 1;
12604
- }
12605
-
12606
- if (!findController?.highlightMatches) {
12607
- return;
12608
- }
12609
-
12610
- const pageMatches = findController.pageMatches[pageIdx] || null;
12611
- const pageMatchesLength = findController.pageMatchesLength[pageIdx] || null;
12612
- this.matches = this._convertMatches(pageMatches, pageMatchesLength);
12613
-
12614
- this._renderMatches(this.matches);
12615
- }
12616
-
12617
- _bindMouse() {
12618
- const div = this.textLayerDiv;
12619
- let expandDivsTimer = null;
12620
- div.addEventListener("mousedown", evt => {
12621
- if (this.enhanceTextSelection && this.textLayerRenderTask) {
12622
- this.textLayerRenderTask.expandTextDivs(true);
12623
-
12624
- if (expandDivsTimer) {
12625
- clearTimeout(expandDivsTimer);
12626
- expandDivsTimer = null;
12627
- }
12628
-
12629
- return;
12630
- }
12631
-
12632
- const end = div.querySelector(".endOfContent");
12633
-
12634
- if (!end) {
12635
- return;
12636
- }
12637
-
12638
- let adjustTop = evt.target !== div;
12639
- adjustTop = adjustTop && window.getComputedStyle(end).getPropertyValue("-moz-user-select") !== "none";
12640
-
12641
- if (adjustTop) {
12642
- const divBounds = div.getBoundingClientRect();
12643
- const r = Math.max(0, (evt.pageY - divBounds.top) / divBounds.height);
12644
- end.style.top = (r * 100).toFixed(2) + "%";
12645
- }
12646
-
12647
- end.classList.add("active");
12648
- });
12649
- div.addEventListener("mouseup", () => {
12650
- if (this.enhanceTextSelection && this.textLayerRenderTask) {
12651
- expandDivsTimer = setTimeout(() => {
12652
- if (this.textLayerRenderTask) {
12653
- this.textLayerRenderTask.expandTextDivs(false);
12654
- }
12655
-
12656
- expandDivsTimer = null;
12657
- }, EXPAND_DIVS_TIMEOUT);
12658
- return;
12659
- }
12660
-
12661
- const end = div.querySelector(".endOfContent");
12662
-
12663
- if (!end) {
12664
- return;
12665
- }
12666
-
12667
- end.style.top = "";
12668
- end.classList.remove("active");
12669
- });
12670
- }
12671
-
12672
- }
12673
-
12674
- exports.TextLayerBuilder = TextLayerBuilder;
12675
-
12676
- class DefaultTextLayerFactory {
12677
- createTextLayerBuilder(textLayerDiv, pageIndex, viewport, enhanceTextSelection = false, eventBus) {
12678
- return new TextLayerBuilder({
12679
- textLayerDiv,
12680
- pageIndex,
12681
- viewport,
12682
- enhanceTextSelection,
12683
- eventBus
12684
- });
12685
- }
12686
-
12687
- }
12688
-
12689
- exports.DefaultTextLayerFactory = DefaultTextLayerFactory;
12690
-
12691
- /***/ }),
12692
- /* 34 */
12693
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12694
-
12695
-
12696
-
12697
- Object.defineProperty(exports, "__esModule", ({
12698
- value: true
12699
- }));
12700
- exports.XfaLayerBuilder = exports.DefaultXfaLayerFactory = void 0;
12701
-
12702
- var _pdfjsLib = __webpack_require__(5);
12703
-
12704
- class XfaLayerBuilder {
12705
- constructor({
12706
- pageDiv,
12707
- pdfPage,
12708
- xfaHtml,
12709
- annotationStorage
12710
- }) {
12711
- this.pageDiv = pageDiv;
12712
- this.pdfPage = pdfPage;
12713
- this.xfaHtml = xfaHtml;
12714
- this.annotationStorage = annotationStorage;
12715
- this.div = null;
12716
- this._cancelled = false;
12717
- }
12718
-
12719
- render(viewport, intent = "display") {
12720
- if (intent === "print") {
12721
- const parameters = {
12722
- viewport: viewport.clone({
12723
- dontFlip: true
12724
- }),
12725
- div: this.div,
12726
- xfa: this.xfaHtml,
12727
- page: null,
12728
- annotationStorage: this.annotationStorage,
12729
- intent
12730
- };
12731
- const div = document.createElement("div");
12732
- this.pageDiv.appendChild(div);
12733
- parameters.div = div;
12734
-
12735
- _pdfjsLib.XfaLayer.render(parameters);
12736
-
12737
- return Promise.resolve();
12738
- }
12739
-
12740
- return this.pdfPage.getXfa().then(xfa => {
12741
- if (this._cancelled) {
12742
- return;
12743
- }
12744
-
12745
- const parameters = {
12746
- viewport: viewport.clone({
12747
- dontFlip: true
12748
- }),
12749
- div: this.div,
12750
- xfa,
12751
- page: this.pdfPage,
12752
- annotationStorage: this.annotationStorage,
12753
- intent
12754
- };
12755
-
12756
- if (this.div) {
12757
- _pdfjsLib.XfaLayer.update(parameters);
12758
- } else {
12759
- this.div = document.createElement("div");
12760
- this.pageDiv.appendChild(this.div);
12761
- parameters.div = this.div;
12762
-
12763
- _pdfjsLib.XfaLayer.render(parameters);
12764
- }
12765
- }).catch(error => {
12766
- console.error(error);
12767
- });
12768
- }
12769
-
12770
- cancel() {
12771
- this._cancelled = true;
12772
- }
12773
-
12774
- hide() {
12775
- if (!this.div) {
12776
- return;
12777
- }
12778
-
12779
- this.div.hidden = true;
12780
- }
12781
-
12782
- }
12783
-
12784
- exports.XfaLayerBuilder = XfaLayerBuilder;
12785
-
12786
- class DefaultXfaLayerFactory {
12787
- createXfaLayerBuilder(pageDiv, pdfPage, annotationStorage = null, xfaHtml = null) {
12788
- return new XfaLayerBuilder({
12789
- pageDiv,
12790
- pdfPage,
12791
- annotationStorage,
12792
- xfaHtml
12793
- });
12794
- }
12795
-
12796
- }
12797
-
12798
- exports.DefaultXfaLayerFactory = DefaultXfaLayerFactory;
12799
-
12800
- /***/ }),
12801
- /* 35 */
12802
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12803
-
12804
-
12805
-
12806
- Object.defineProperty(exports, "__esModule", ({
12807
- value: true
12808
- }));
12809
- exports.SecondaryToolbar = void 0;
12810
-
12811
- var _ui_utils = __webpack_require__(4);
12812
-
12813
- var _pdf_cursor_tools = __webpack_require__(6);
12814
-
12815
- var _pdf_single_page_viewer = __webpack_require__(36);
12816
-
12817
- class SecondaryToolbar {
12818
- constructor(options, mainContainer, eventBus) {
12819
- this.toolbar = options.toolbar;
12820
- this.toggleButton = options.toggleButton;
12821
- this.toolbarButtonContainer = options.toolbarButtonContainer;
12822
- this.buttons = [{
12823
- element: options.presentationModeButton,
12824
- eventName: "presentationmode",
12825
- close: true
12826
- }, {
12827
- element: options.openFileButton,
12828
- eventName: "openfile",
12829
- close: true
12830
- }, {
12831
- element: options.printButton,
12832
- eventName: "print",
12833
- close: true
12834
- }, {
12835
- element: options.downloadButton,
12836
- eventName: "download",
12837
- close: true
12838
- }, {
12839
- element: options.viewBookmarkButton,
12840
- eventName: null,
12841
- close: true
12842
- }, {
12843
- element: options.firstPageButton,
12844
- eventName: "firstpage",
12845
- close: true
12846
- }, {
12847
- element: options.lastPageButton,
12848
- eventName: "lastpage",
12849
- close: true
12850
- }, {
12851
- element: options.pageRotateCwButton,
12852
- eventName: "rotatecw",
12853
- close: false
12854
- }, {
12855
- element: options.pageRotateCcwButton,
12856
- eventName: "rotateccw",
12857
- close: false
12858
- }, {
12859
- element: options.cursorSelectToolButton,
12860
- eventName: "switchcursortool",
12861
- eventDetails: {
12862
- tool: _pdf_cursor_tools.CursorTool.SELECT
12863
- },
12864
- close: true
12865
- }, {
12866
- element: options.cursorHandToolButton,
12867
- eventName: "switchcursortool",
12868
- eventDetails: {
12869
- tool: _pdf_cursor_tools.CursorTool.HAND
12870
- },
12871
- close: true
12872
- }, {
12873
- element: options.scrollVerticalButton,
12874
- eventName: "switchscrollmode",
12875
- eventDetails: {
12876
- mode: _ui_utils.ScrollMode.VERTICAL
12877
- },
12878
- close: true
12879
- }, {
12880
- element: options.scrollHorizontalButton,
12881
- eventName: "switchscrollmode",
12882
- eventDetails: {
12883
- mode: _ui_utils.ScrollMode.HORIZONTAL
12884
- },
12885
- close: true
12886
- }, {
12887
- element: options.scrollWrappedButton,
12888
- eventName: "switchscrollmode",
12889
- eventDetails: {
12890
- mode: _ui_utils.ScrollMode.WRAPPED
12891
- },
12892
- close: true
12893
- }, {
12894
- element: options.spreadNoneButton,
12895
- eventName: "switchspreadmode",
12896
- eventDetails: {
12897
- mode: _ui_utils.SpreadMode.NONE
12898
- },
12899
- close: true
12900
- }, {
12901
- element: options.spreadOddButton,
12902
- eventName: "switchspreadmode",
12903
- eventDetails: {
12904
- mode: _ui_utils.SpreadMode.ODD
12905
- },
12906
- close: true
12907
- }, {
12908
- element: options.spreadEvenButton,
12909
- eventName: "switchspreadmode",
12910
- eventDetails: {
12911
- mode: _ui_utils.SpreadMode.EVEN
12912
- },
12913
- close: true
12914
- }, {
12915
- element: options.documentPropertiesButton,
12916
- eventName: "documentproperties",
12917
- close: true
12918
- }];
12919
- this.items = {
12920
- firstPage: options.firstPageButton,
12921
- lastPage: options.lastPageButton,
12922
- pageRotateCw: options.pageRotateCwButton,
12923
- pageRotateCcw: options.pageRotateCcwButton
12924
- };
12925
- this.mainContainer = mainContainer;
12926
- this.eventBus = eventBus;
12927
- this.opened = false;
12928
- this.containerHeight = null;
12929
- this.previousContainerHeight = null;
12930
- this.reset();
12931
-
12932
- this._bindClickListeners();
12933
-
12934
- this._bindCursorToolsListener(options);
12935
-
12936
- this._bindScrollModeListener(options);
12937
-
12938
- this._bindSpreadModeListener(options);
12939
-
12940
- this.eventBus._on("resize", this._setMaxHeight.bind(this));
12941
-
12942
- this.eventBus._on("baseviewerinit", evt => {
12943
- if (evt.source instanceof _pdf_single_page_viewer.PDFSinglePageViewer) {
12944
- this.toolbarButtonContainer.classList.add("hiddenScrollModeButtons", "hiddenSpreadModeButtons");
12945
- } else {
12946
- this.toolbarButtonContainer.classList.remove("hiddenScrollModeButtons", "hiddenSpreadModeButtons");
12947
- }
12948
- });
12949
- }
12950
-
12951
- get isOpen() {
12952
- return this.opened;
12953
- }
12954
-
12955
- setPageNumber(pageNumber) {
12956
- this.pageNumber = pageNumber;
12957
-
12958
- this._updateUIState();
12959
- }
12960
-
12961
- setPagesCount(pagesCount) {
12962
- this.pagesCount = pagesCount;
12963
-
12964
- this._updateUIState();
12965
- }
12966
-
12967
- reset() {
12968
- this.pageNumber = 0;
12969
- this.pagesCount = 0;
12970
-
12971
- this._updateUIState();
12972
-
12973
- this.eventBus.dispatch("secondarytoolbarreset", {
12974
- source: this
12975
- });
12976
- }
12977
-
12978
- _updateUIState() {
12979
- this.items.firstPage.disabled = this.pageNumber <= 1;
12980
- this.items.lastPage.disabled = this.pageNumber >= this.pagesCount;
12981
- this.items.pageRotateCw.disabled = this.pagesCount === 0;
12982
- this.items.pageRotateCcw.disabled = this.pagesCount === 0;
12983
- }
12984
-
12985
- _bindClickListeners() {
12986
- this.toggleButton.addEventListener("click", this.toggle.bind(this));
12987
-
12988
- for (const {
12989
- element,
12990
- eventName,
12991
- close,
12992
- eventDetails
12993
- } of this.buttons) {
12994
- element.addEventListener("click", evt => {
12995
- if (eventName !== null) {
12996
- const details = {
12997
- source: this
12998
- };
12999
-
13000
- for (const property in eventDetails) {
13001
- details[property] = eventDetails[property];
13002
- }
13003
-
13004
- this.eventBus.dispatch(eventName, details);
13005
- }
13006
-
13007
- if (close) {
13008
- this.close();
13009
- }
13010
- });
13011
- }
13012
- }
13013
-
13014
- _bindCursorToolsListener(buttons) {
13015
- this.eventBus._on("cursortoolchanged", function ({
13016
- tool
13017
- }) {
13018
- buttons.cursorSelectToolButton.classList.toggle("toggled", tool === _pdf_cursor_tools.CursorTool.SELECT);
13019
- buttons.cursorHandToolButton.classList.toggle("toggled", tool === _pdf_cursor_tools.CursorTool.HAND);
13020
- });
13021
- }
13022
-
13023
- _bindScrollModeListener(buttons) {
13024
- function scrollModeChanged({
13025
- mode
13026
- }) {
13027
- buttons.scrollVerticalButton.classList.toggle("toggled", mode === _ui_utils.ScrollMode.VERTICAL);
13028
- buttons.scrollHorizontalButton.classList.toggle("toggled", mode === _ui_utils.ScrollMode.HORIZONTAL);
13029
- buttons.scrollWrappedButton.classList.toggle("toggled", mode === _ui_utils.ScrollMode.WRAPPED);
13030
- const isScrollModeHorizontal = mode === _ui_utils.ScrollMode.HORIZONTAL;
13031
- buttons.spreadNoneButton.disabled = isScrollModeHorizontal;
13032
- buttons.spreadOddButton.disabled = isScrollModeHorizontal;
13033
- buttons.spreadEvenButton.disabled = isScrollModeHorizontal;
13034
- }
13035
-
13036
- this.eventBus._on("scrollmodechanged", scrollModeChanged);
13037
-
13038
- this.eventBus._on("secondarytoolbarreset", evt => {
13039
- if (evt.source === this) {
13040
- scrollModeChanged({
13041
- mode: _ui_utils.ScrollMode.VERTICAL
13042
- });
13043
- }
13044
- });
13045
- }
13046
-
13047
- _bindSpreadModeListener(buttons) {
13048
- function spreadModeChanged({
13049
- mode
13050
- }) {
13051
- buttons.spreadNoneButton.classList.toggle("toggled", mode === _ui_utils.SpreadMode.NONE);
13052
- buttons.spreadOddButton.classList.toggle("toggled", mode === _ui_utils.SpreadMode.ODD);
13053
- buttons.spreadEvenButton.classList.toggle("toggled", mode === _ui_utils.SpreadMode.EVEN);
13054
- }
13055
-
13056
- this.eventBus._on("spreadmodechanged", spreadModeChanged);
13057
-
13058
- this.eventBus._on("secondarytoolbarreset", evt => {
13059
- if (evt.source === this) {
13060
- spreadModeChanged({
13061
- mode: _ui_utils.SpreadMode.NONE
13062
- });
13063
- }
13064
- });
13065
- }
13066
-
13067
- open() {
13068
- if (this.opened) {
13069
- return;
13070
- }
13071
-
13072
- this.opened = true;
13073
-
13074
- this._setMaxHeight();
13075
-
13076
- this.toggleButton.classList.add("toggled");
13077
- this.toggleButton.setAttribute("aria-expanded", "true");
13078
- this.toolbar.classList.remove("hidden");
13079
- }
13080
-
13081
- close() {
13082
- if (!this.opened) {
13083
- return;
13084
- }
13085
-
13086
- this.opened = false;
13087
- this.toolbar.classList.add("hidden");
13088
- this.toggleButton.classList.remove("toggled");
13089
- this.toggleButton.setAttribute("aria-expanded", "false");
13090
- }
13091
-
13092
- toggle() {
13093
- if (this.opened) {
13094
- this.close();
13095
- } else {
13096
- this.open();
13097
- }
13098
- }
13099
-
13100
- _setMaxHeight() {
13101
- if (!this.opened) {
13102
- return;
13103
- }
13104
-
13105
- this.containerHeight = this.mainContainer.clientHeight;
13106
-
13107
- if (this.containerHeight === this.previousContainerHeight) {
13108
- return;
13109
- }
13110
-
13111
- this.toolbarButtonContainer.style.maxHeight = `${this.containerHeight - _ui_utils.SCROLLBAR_PADDING}px`;
13112
- this.previousContainerHeight = this.containerHeight;
13113
- }
13114
-
13115
- }
13116
-
13117
- exports.SecondaryToolbar = SecondaryToolbar;
13118
-
13119
- /***/ }),
13120
- /* 36 */
13121
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
13122
-
13123
-
13124
-
13125
- Object.defineProperty(exports, "__esModule", ({
13126
- value: true
13127
- }));
13128
- exports.PDFSinglePageViewer = void 0;
13129
-
13130
- var _base_viewer = __webpack_require__(28);
13131
-
13132
- var _pdfjsLib = __webpack_require__(5);
13133
-
13134
- class PDFSinglePageViewer extends _base_viewer.BaseViewer {
13135
- constructor(options) {
13136
- super(options);
13137
-
13138
- this.eventBus._on("pagesinit", evt => {
13139
- this._ensurePageViewVisible();
13140
- });
13141
- }
13142
-
13143
- get _viewerElement() {
13144
- return (0, _pdfjsLib.shadow)(this, "_viewerElement", this._shadowViewer);
13145
- }
13146
-
13147
- get _pageWidthScaleFactor() {
13148
- return 1;
13149
- }
13150
-
13151
- _resetView() {
13152
- super._resetView();
13153
-
13154
- this._previousPageNumber = 1;
13155
- this._shadowViewer = document.createDocumentFragment();
13156
- this._updateScrollDown = null;
13157
- }
13158
-
13159
- _ensurePageViewVisible() {
13160
- const pageView = this._pages[this._currentPageNumber - 1];
13161
- const previousPageView = this._pages[this._previousPageNumber - 1];
13162
- const viewerNodes = this.viewer.childNodes;
13163
-
13164
- switch (viewerNodes.length) {
13165
- case 0:
13166
- this.viewer.appendChild(pageView.div);
13167
- break;
13168
-
13169
- case 1:
13170
- if (viewerNodes[0] !== previousPageView.div) {
13171
- throw new Error("_ensurePageViewVisible: Unexpected previously visible page.");
13172
- }
13173
-
13174
- if (pageView === previousPageView) {
13175
- break;
13176
- }
13177
-
13178
- this._shadowViewer.appendChild(previousPageView.div);
13179
-
13180
- this.viewer.appendChild(pageView.div);
13181
- this.container.scrollTop = 0;
13182
- break;
13183
-
13184
- default:
13185
- throw new Error("_ensurePageViewVisible: Only one page should be visible at a time.");
13186
- }
13187
-
13188
- this._previousPageNumber = this._currentPageNumber;
13189
- }
13190
-
13191
- _scrollUpdate() {
13192
- if (this._updateScrollDown) {
13193
- this._updateScrollDown();
13194
- }
13195
-
13196
- super._scrollUpdate();
13197
- }
13198
-
13199
- _scrollIntoView({
13200
- pageDiv,
13201
- pageSpot = null,
13202
- pageNumber = null
13203
- }) {
13204
- if (pageNumber) {
13205
- this._setCurrentPageNumber(pageNumber);
13206
- }
13207
-
13208
- const scrolledDown = this._currentPageNumber >= this._previousPageNumber;
13209
-
13210
- this._ensurePageViewVisible();
13211
-
13212
- this.update();
13213
-
13214
- super._scrollIntoView({
13215
- pageDiv,
13216
- pageSpot,
13217
- pageNumber
13218
- });
13219
-
13220
- this._updateScrollDown = () => {
13221
- this.scroll.down = scrolledDown;
13222
- this._updateScrollDown = null;
13223
- };
13224
- }
13225
-
13226
- _getVisiblePages() {
13227
- return this._getCurrentVisiblePage();
13228
- }
13229
-
13230
- _updateHelper(visiblePages) {}
13231
-
13232
- get _isScrollModeHorizontal() {
13233
- return (0, _pdfjsLib.shadow)(this, "_isScrollModeHorizontal", false);
13234
- }
13235
-
13236
- _updateScrollMode() {}
13237
-
13238
- _updateSpreadMode() {}
13239
-
13240
- _getPageAdvance() {
13241
- return 1;
13242
- }
13243
-
13244
- }
13245
-
13246
- exports.PDFSinglePageViewer = PDFSinglePageViewer;
13247
-
13248
- /***/ }),
13249
- /* 37 */
13250
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
13251
-
13252
-
13253
-
13254
- Object.defineProperty(exports, "__esModule", ({
13255
- value: true
13256
- }));
13257
- exports.Toolbar = void 0;
13258
-
13259
- var _ui_utils = __webpack_require__(4);
13260
-
13261
- const PAGE_NUMBER_LOADING_INDICATOR = "visiblePageIsLoading";
13262
- const SCALE_SELECT_CONTAINER_WIDTH = 140;
13263
- const SCALE_SELECT_WIDTH = 162;
13264
-
13265
- class Toolbar {
13266
- constructor(options, eventBus, l10n) {
13267
- this.toolbar = options.container;
13268
- this.eventBus = eventBus;
13269
- this.l10n = l10n;
13270
- this.buttons = [{
13271
- element: options.previous,
13272
- eventName: "previouspage"
13273
- }, {
13274
- element: options.next,
13275
- eventName: "nextpage"
13276
- }, {
13277
- element: options.zoomIn,
13278
- eventName: "zoomin"
13279
- }, {
13280
- element: options.zoomOut,
13281
- eventName: "zoomout"
13282
- }, {
13283
- element: options.openFile,
13284
- eventName: "openfile"
13285
- }, {
13286
- element: options.print,
13287
- eventName: "print"
13288
- }, {
13289
- element: options.presentationModeButton,
13290
- eventName: "presentationmode"
13291
- }, {
13292
- element: options.download,
13293
- eventName: "download"
13294
- }, {
13295
- element: options.viewBookmark,
13296
- eventName: null
13297
- }];
13298
- this.items = {
13299
- numPages: options.numPages,
13300
- pageNumber: options.pageNumber,
13301
- scaleSelectContainer: options.scaleSelectContainer,
13302
- scaleSelect: options.scaleSelect,
13303
- customScaleOption: options.customScaleOption,
13304
- previous: options.previous,
13305
- next: options.next,
13306
- zoomIn: options.zoomIn,
13307
- zoomOut: options.zoomOut
13308
- };
13309
- this._wasLocalized = false;
13310
- this.reset();
13311
-
13312
- this._bindListeners();
13313
- }
13314
-
13315
- setPageNumber(pageNumber, pageLabel) {
13316
- this.pageNumber = pageNumber;
13317
- this.pageLabel = pageLabel;
13318
-
13319
- this._updateUIState(false);
13320
- }
13321
-
13322
- setPagesCount(pagesCount, hasPageLabels) {
13323
- this.pagesCount = pagesCount;
13324
- this.hasPageLabels = hasPageLabels;
13325
-
13326
- this._updateUIState(true);
13327
- }
13328
-
13329
- setPageScale(pageScaleValue, pageScale) {
13330
- this.pageScaleValue = (pageScaleValue || pageScale).toString();
13331
- this.pageScale = pageScale;
13332
-
13333
- this._updateUIState(false);
13334
- }
13335
-
13336
- reset() {
13337
- this.pageNumber = 0;
13338
- this.pageLabel = null;
13339
- this.hasPageLabels = false;
13340
- this.pagesCount = 0;
13341
- this.pageScaleValue = _ui_utils.DEFAULT_SCALE_VALUE;
13342
- this.pageScale = _ui_utils.DEFAULT_SCALE;
13343
-
13344
- this._updateUIState(true);
13345
-
13346
- this.updateLoadingIndicatorState();
13347
- }
13348
-
13349
- _bindListeners() {
13350
- const {
13351
- pageNumber,
13352
- scaleSelect
13353
- } = this.items;
13354
- const self = this;
13355
-
13356
- for (const {
13357
- element,
13358
- eventName
13359
- } of this.buttons) {
13360
- element.addEventListener("click", evt => {
13361
- if (eventName !== null) {
13362
- this.eventBus.dispatch(eventName, {
13363
- source: this
13364
- });
13365
- }
13366
- });
13367
- }
13368
-
13369
- pageNumber.addEventListener("click", function () {
13370
- this.select();
13371
- });
13372
- pageNumber.addEventListener("change", function () {
13373
- self.eventBus.dispatch("pagenumberchanged", {
13374
- source: self,
13375
- value: this.value
13376
- });
13377
- });
13378
- scaleSelect.addEventListener("change", function () {
13379
- if (this.value === "custom") {
13380
- return;
13381
- }
13382
-
13383
- self.eventBus.dispatch("scalechanged", {
13384
- source: self,
13385
- value: this.value
13386
- });
13387
- });
13388
- scaleSelect.addEventListener("click", function (evt) {
13389
- const target = evt.target;
13390
-
13391
- if (this.value === self.pageScaleValue && target.tagName.toUpperCase() === "OPTION") {
13392
- this.blur();
13393
- }
13394
- });
13395
- scaleSelect.oncontextmenu = _ui_utils.noContextMenuHandler;
13396
-
13397
- this.eventBus._on("localized", () => {
13398
- this._wasLocalized = true;
13399
-
13400
- this._adjustScaleWidth();
13401
-
13402
- this._updateUIState(true);
13403
- });
13404
- }
13405
-
13406
- _updateUIState(resetNumPages = false) {
13407
- if (!this._wasLocalized) {
13408
- return;
13409
- }
13410
-
13411
- const {
13412
- pageNumber,
13413
- pagesCount,
13414
- pageScaleValue,
13415
- pageScale,
13416
- items
13417
- } = this;
13418
-
13419
- if (resetNumPages) {
13420
- if (this.hasPageLabels) {
13421
- items.pageNumber.type = "text";
13422
- } else {
13423
- items.pageNumber.type = "number";
13424
- this.l10n.get("of_pages", {
13425
- pagesCount
13426
- }).then(msg => {
13427
- items.numPages.textContent = msg;
13428
- });
13429
- }
13430
-
13431
- items.pageNumber.max = pagesCount;
13432
- }
13433
-
13434
- if (this.hasPageLabels) {
13435
- items.pageNumber.value = this.pageLabel;
13436
- this.l10n.get("page_of_pages", {
13437
- pageNumber,
13438
- pagesCount
13439
- }).then(msg => {
13440
- items.numPages.textContent = msg;
13441
- });
13442
- } else {
13443
- items.pageNumber.value = pageNumber;
13444
- }
13445
-
13446
- items.previous.disabled = pageNumber <= 1;
13447
- items.next.disabled = pageNumber >= pagesCount;
13448
- items.zoomOut.disabled = pageScale <= _ui_utils.MIN_SCALE;
13449
- items.zoomIn.disabled = pageScale >= _ui_utils.MAX_SCALE;
13450
- this.l10n.get("page_scale_percent", {
13451
- scale: Math.round(pageScale * 10000) / 100
13452
- }).then(msg => {
13453
- let predefinedValueFound = false;
13454
-
13455
- for (const option of items.scaleSelect.options) {
13456
- if (option.value !== pageScaleValue) {
13457
- option.selected = false;
13458
- continue;
13459
- }
13460
-
13461
- option.selected = true;
13462
- predefinedValueFound = true;
13463
- }
13464
-
13465
- if (!predefinedValueFound) {
13466
- items.customScaleOption.textContent = msg;
13467
- items.customScaleOption.selected = true;
13468
- }
13469
- });
13470
- }
13471
-
13472
- updateLoadingIndicatorState(loading = false) {
13473
- const pageNumberInput = this.items.pageNumber;
13474
- pageNumberInput.classList.toggle(PAGE_NUMBER_LOADING_INDICATOR, loading);
13475
- }
13476
-
13477
- async _adjustScaleWidth() {
13478
- const {
13479
- items,
13480
- l10n
13481
- } = this;
13482
- const predefinedValuesPromise = Promise.all([l10n.get("page_scale_auto"), l10n.get("page_scale_actual"), l10n.get("page_scale_fit"), l10n.get("page_scale_width")]);
13483
- let canvas = document.createElement("canvas");
13484
- canvas.mozOpaque = true;
13485
- let ctx = canvas.getContext("2d", {
13486
- alpha: false
13487
- });
13488
- await _ui_utils.animationStarted;
13489
- const {
13490
- fontSize,
13491
- fontFamily
13492
- } = getComputedStyle(items.scaleSelect);
13493
- ctx.font = `${fontSize} ${fontFamily}`;
13494
- let maxWidth = 0;
13495
-
13496
- for (const predefinedValue of await predefinedValuesPromise) {
13497
- const {
13498
- width
13499
- } = ctx.measureText(predefinedValue);
13500
-
13501
- if (width > maxWidth) {
13502
- maxWidth = width;
13503
- }
13504
- }
13505
-
13506
- const overflow = SCALE_SELECT_WIDTH - SCALE_SELECT_CONTAINER_WIDTH;
13507
- maxWidth += 2 * overflow;
13508
-
13509
- if (maxWidth > SCALE_SELECT_CONTAINER_WIDTH) {
13510
- items.scaleSelect.style.width = `${maxWidth + overflow}px`;
13511
- items.scaleSelectContainer.style.width = `${maxWidth}px`;
13512
- }
13513
-
13514
- canvas.width = 0;
13515
- canvas.height = 0;
13516
- canvas = ctx = null;
13517
- }
13518
-
13519
- }
13520
-
13521
- exports.Toolbar = Toolbar;
13522
-
13523
- /***/ }),
13524
- /* 38 */
13525
- /***/ ((__unused_webpack_module, exports) => {
13526
-
13527
-
13528
-
13529
- Object.defineProperty(exports, "__esModule", ({
13530
- value: true
13531
- }));
13532
- exports.ViewHistory = void 0;
13533
- const DEFAULT_VIEW_HISTORY_CACHE_SIZE = 20;
13534
-
13535
- class ViewHistory {
13536
- constructor(fingerprint, cacheSize = DEFAULT_VIEW_HISTORY_CACHE_SIZE) {
13537
- this.fingerprint = fingerprint;
13538
- this.cacheSize = cacheSize;
13539
- this._initializedPromise = this._readFromStorage().then(databaseStr => {
13540
- const database = JSON.parse(databaseStr || "{}");
13541
- let index = -1;
13542
-
13543
- if (!Array.isArray(database.files)) {
13544
- database.files = [];
13545
- } else {
13546
- while (database.files.length >= this.cacheSize) {
13547
- database.files.shift();
13548
- }
13549
-
13550
- for (let i = 0, ii = database.files.length; i < ii; i++) {
13551
- const branch = database.files[i];
13552
-
13553
- if (branch.fingerprint === this.fingerprint) {
13554
- index = i;
13555
- break;
13556
- }
13557
- }
13558
- }
13559
-
13560
- if (index === -1) {
13561
- index = database.files.push({
13562
- fingerprint: this.fingerprint
13563
- }) - 1;
13564
- }
13565
-
13566
- this.file = database.files[index];
13567
- this.database = database;
13568
- });
13569
- }
13570
-
13571
- async _writeToStorage() {
13572
- const databaseStr = JSON.stringify(this.database);
13573
- localStorage.setItem("pdfjs.history", databaseStr);
13574
- }
13575
-
13576
- async _readFromStorage() {
13577
- return localStorage.getItem("pdfjs.history");
13578
- }
13579
-
13580
- async set(name, val) {
13581
- await this._initializedPromise;
13582
- this.file[name] = val;
13583
- return this._writeToStorage();
13584
- }
13585
-
13586
- async setMultiple(properties) {
13587
- await this._initializedPromise;
13588
-
13589
- for (const name in properties) {
13590
- this.file[name] = properties[name];
13591
- }
13592
-
13593
- return this._writeToStorage();
13594
- }
13595
-
13596
- async get(name, defaultValue) {
13597
- await this._initializedPromise;
13598
- const val = this.file[name];
13599
- return val !== undefined ? val : defaultValue;
13600
- }
13601
-
13602
- async getMultiple(properties) {
13603
- await this._initializedPromise;
13604
- const values = Object.create(null);
13605
-
13606
- for (const name in properties) {
13607
- const val = this.file[name];
13608
- values[name] = val !== undefined ? val : properties[name];
13609
- }
13610
-
13611
- return values;
13612
- }
13613
-
13614
- }
13615
-
13616
- exports.ViewHistory = ViewHistory;
13617
-
13618
- /***/ }),
13619
- /* 39 */
13620
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
13621
-
13622
-
13623
-
13624
- Object.defineProperty(exports, "__esModule", ({
13625
- value: true
13626
- }));
13627
- exports.GenericCom = void 0;
13628
-
13629
- var _app = __webpack_require__(3);
13630
-
13631
- var _preferences = __webpack_require__(40);
13632
-
13633
- var _download_manager = __webpack_require__(41);
13634
-
13635
- var _genericl10n = __webpack_require__(42);
13636
-
13637
- var _generic_scripting = __webpack_require__(44);
13638
-
13639
- ;
13640
- const GenericCom = {};
13641
- exports.GenericCom = GenericCom;
13642
-
13643
- class GenericPreferences extends _preferences.BasePreferences {
13644
- async _writeToStorage(prefObj) {
13645
- localStorage.setItem("pdfjs.preferences", JSON.stringify(prefObj));
13646
- }
13647
-
13648
- async _readFromStorage(prefObj) {
13649
- return JSON.parse(localStorage.getItem("pdfjs.preferences"));
13650
- }
13651
-
13652
- }
13653
-
13654
- class GenericExternalServices extends _app.DefaultExternalServices {
13655
- static createDownloadManager(options) {
13656
- return new _download_manager.DownloadManager();
13657
- }
13658
-
13659
- static createPreferences() {
13660
- return new GenericPreferences();
13661
- }
13662
-
13663
- static createL10n({
13664
- locale = "en-US"
13665
- }) {
13666
- return new _genericl10n.GenericL10n(locale);
13667
- }
13668
-
13669
- static createScripting({
13670
- sandboxBundleSrc
13671
- }) {
13672
- return new _generic_scripting.GenericScripting(sandboxBundleSrc);
13673
- }
13674
-
13675
- }
13676
-
13677
- _app.PDFViewerApplication.externalServices = GenericExternalServices;
13678
-
13679
- /***/ }),
13680
- /* 40 */
13681
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
13682
-
13683
-
13684
-
13685
- Object.defineProperty(exports, "__esModule", ({
13686
- value: true
13687
- }));
13688
- exports.BasePreferences = void 0;
13689
-
13690
- var _app_options = __webpack_require__(1);
13691
-
13692
- class BasePreferences {
13693
- constructor() {
13694
- if (this.constructor === BasePreferences) {
13695
- throw new Error("Cannot initialize BasePreferences.");
13696
- }
13697
-
13698
- Object.defineProperty(this, "defaults", {
13699
- value: Object.freeze({
13700
- "cursorToolOnLoad": 0,
13701
- "defaultZoomValue": "",
13702
- "disablePageLabels": false,
13703
- "enablePermissions": false,
13704
- "enablePrintAutoRotate": true,
13705
- "enableScripting": true,
13706
- "externalLinkTarget": 0,
13707
- "historyUpdateUrl": false,
13708
- "ignoreDestinationZoom": false,
13709
- "pdfBugEnabled": false,
13710
- "renderer": "canvas",
13711
- "renderInteractiveForms": true,
13712
- "sidebarViewOnLoad": -1,
13713
- "scrollModeOnLoad": -1,
13714
- "spreadModeOnLoad": -1,
13715
- "textLayerMode": 1,
13716
- "useOnlyCssZoom": false,
13717
- "viewerCssTheme": 0,
13718
- "viewOnLoad": 0,
13719
- "disableAutoFetch": false,
13720
- "disableFontFace": false,
13721
- "disableRange": false,
13722
- "disableStream": false,
13723
- "enableXfa": false
13724
- }),
13725
- writable: false,
13726
- enumerable: true,
13727
- configurable: false
13728
- });
13729
- this.prefs = Object.create(null);
13730
- this._initializedPromise = this._readFromStorage(this.defaults).then(prefs => {
13731
- for (const name in this.defaults) {
13732
- const prefValue = prefs?.[name];
13733
-
13734
- if (typeof prefValue === typeof this.defaults[name]) {
13735
- this.prefs[name] = prefValue;
13736
- }
13737
- }
13738
- });
13739
- }
13740
-
13741
- async _writeToStorage(prefObj) {
13742
- throw new Error("Not implemented: _writeToStorage");
13743
- }
13744
-
13745
- async _readFromStorage(prefObj) {
13746
- throw new Error("Not implemented: _readFromStorage");
13747
- }
13748
-
13749
- async reset() {
13750
- await this._initializedPromise;
13751
- this.prefs = Object.create(null);
13752
- return this._writeToStorage(this.defaults);
13753
- }
13754
-
13755
- async set(name, value) {
13756
- await this._initializedPromise;
13757
- const defaultValue = this.defaults[name];
13758
-
13759
- if (defaultValue === undefined) {
13760
- throw new Error(`Set preference: "${name}" is undefined.`);
13761
- } else if (value === undefined) {
13762
- throw new Error("Set preference: no value is specified.");
13763
- }
13764
-
13765
- const valueType = typeof value;
13766
- const defaultType = typeof defaultValue;
13767
-
13768
- if (valueType !== defaultType) {
13769
- if (valueType === "number" && defaultType === "string") {
13770
- value = value.toString();
13771
- } else {
13772
- throw new Error(`Set preference: "${value}" is a ${valueType}, expected a ${defaultType}.`);
13773
- }
13774
- } else {
13775
- if (valueType === "number" && !Number.isInteger(value)) {
13776
- throw new Error(`Set preference: "${value}" must be an integer.`);
13777
- }
13778
- }
13779
-
13780
- this.prefs[name] = value;
13781
- return this._writeToStorage(this.prefs);
13782
- }
13783
-
13784
- async get(name) {
13785
- await this._initializedPromise;
13786
- const defaultValue = this.defaults[name],
13787
- prefValue = this.prefs[name];
13788
-
13789
- if (defaultValue === undefined) {
13790
- throw new Error(`Get preference: "${name}" is undefined.`);
13791
- }
13792
-
13793
- return prefValue !== undefined ? prefValue : defaultValue;
13794
- }
13795
-
13796
- async getAll() {
13797
- await this._initializedPromise;
13798
- const obj = Object.create(null);
13799
-
13800
- for (const name in this.defaults) {
13801
- const prefValue = this.prefs[name];
13802
- obj[name] = prefValue !== undefined ? prefValue : this.defaults[name];
13803
- }
13804
-
13805
- return obj;
13806
- }
13807
-
13808
- }
13809
-
13810
- exports.BasePreferences = BasePreferences;
13811
-
13812
- /***/ }),
13813
- /* 41 */
13814
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
13815
-
13816
-
13817
-
13818
- Object.defineProperty(exports, "__esModule", ({
13819
- value: true
13820
- }));
13821
- exports.DownloadManager = void 0;
13822
-
13823
- var _pdfjsLib = __webpack_require__(5);
13824
-
13825
- var _viewer_compatibility = __webpack_require__(2);
13826
-
13827
- ;
13828
-
13829
- function download(blobUrl, filename) {
13830
- const a = document.createElement("a");
13831
-
13832
- if (!a.click) {
13833
- throw new Error('DownloadManager: "a.click()" is not supported.');
13834
- }
13835
-
13836
- a.href = blobUrl;
13837
- a.target = "_parent";
13838
-
13839
- if ("download" in a) {
13840
- a.download = filename;
13841
- }
13842
-
13843
- (document.body || document.documentElement).appendChild(a);
13844
- a.click();
13845
- a.remove();
13846
- }
13847
-
13848
- class DownloadManager {
13849
- constructor() {
13850
- this._openBlobUrls = new WeakMap();
13851
- }
13852
-
13853
- downloadUrl(url, filename) {
13854
- if (!(0, _pdfjsLib.createValidAbsoluteUrl)(url, "http://example.com")) {
13855
- return;
13856
- }
13857
-
13858
- download(url + "#pdfjs.action=download", filename);
13859
- }
13860
-
13861
- downloadData(data, filename, contentType) {
13862
- const blobUrl = (0, _pdfjsLib.createObjectURL)(data, contentType, _viewer_compatibility.viewerCompatibilityParams.disableCreateObjectURL);
13863
- download(blobUrl, filename);
13864
- }
13865
-
13866
- openOrDownloadData(element, data, filename) {
13867
- const isPdfData = (0, _pdfjsLib.isPdfFile)(filename);
13868
- const contentType = isPdfData ? "application/pdf" : "";
13869
-
13870
- if (isPdfData && !_viewer_compatibility.viewerCompatibilityParams.disableCreateObjectURL) {
13871
- let blobUrl = this._openBlobUrls.get(element);
13872
-
13873
- if (!blobUrl) {
13874
- blobUrl = URL.createObjectURL(new Blob([data], {
13875
- type: contentType
13876
- }));
13877
-
13878
- this._openBlobUrls.set(element, blobUrl);
13879
- }
13880
-
13881
- let viewerUrl;
13882
- viewerUrl = "?file=" + encodeURIComponent(blobUrl + "#" + filename);
13883
-
13884
- try {
13885
- window.open(viewerUrl);
13886
- return true;
13887
- } catch (ex) {
13888
- console.error(`openOrDownloadData: ${ex}`);
13889
- URL.revokeObjectURL(blobUrl);
13890
-
13891
- this._openBlobUrls.delete(element);
13892
- }
13893
- }
13894
-
13895
- this.downloadData(data, filename, contentType);
13896
- return false;
13897
- }
13898
-
13899
- download(blob, url, filename, sourceEventType = "download") {
13900
- if (_viewer_compatibility.viewerCompatibilityParams.disableCreateObjectURL) {
13901
- this.downloadUrl(url, filename);
13902
- return;
13903
- }
13904
-
13905
- const blobUrl = URL.createObjectURL(blob);
13906
- download(blobUrl, filename);
13907
- }
13908
-
13909
- }
13910
-
13911
- exports.DownloadManager = DownloadManager;
13912
-
13913
- /***/ }),
13914
- /* 42 */
13915
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
13916
-
13917
-
13918
-
13919
- Object.defineProperty(exports, "__esModule", ({
13920
- value: true
13921
- }));
13922
- exports.GenericL10n = void 0;
13923
-
13924
- __webpack_require__(43);
13925
-
13926
- var _l10n_utils = __webpack_require__(30);
13927
-
13928
- const webL10n = document.webL10n;
13929
-
13930
- class GenericL10n {
13931
- constructor(lang) {
13932
- this._lang = lang;
13933
- this._ready = new Promise((resolve, reject) => {
13934
- webL10n.setLanguage((0, _l10n_utils.fixupLangCode)(lang), () => {
13935
- resolve(webL10n);
13936
- });
13937
- });
13938
- }
13939
-
13940
- async getLanguage() {
13941
- const l10n = await this._ready;
13942
- return l10n.getLanguage();
13943
- }
13944
-
13945
- async getDirection() {
13946
- const l10n = await this._ready;
13947
- return l10n.getDirection();
13948
- }
13949
-
13950
- async get(key, args = null, fallback = (0, _l10n_utils.getL10nFallback)(key, args)) {
13951
- const l10n = await this._ready;
13952
- return l10n.get(key, args, fallback);
13953
- }
13954
-
13955
- async translate(element) {
13956
- const l10n = await this._ready;
13957
- return l10n.translate(element);
13958
- }
13959
-
13960
- }
13961
-
13962
- exports.GenericL10n = GenericL10n;
13963
-
13964
- /***/ }),
13965
- /* 43 */
13966
- /***/ (() => {
13967
-
13968
-
13969
-
13970
- document.webL10n = function (window, document, undefined) {
13971
- var gL10nData = {};
13972
- var gTextData = '';
13973
- var gTextProp = 'textContent';
13974
- var gLanguage = '';
13975
- var gMacros = {};
13976
- var gReadyState = 'loading';
13977
- var gAsyncResourceLoading = true;
13978
-
13979
- function getL10nResourceLinks() {
13980
- return document.querySelectorAll('link[type="application/l10n"]');
13981
- }
13982
-
13983
- function getL10nDictionary() {
13984
- var script = document.querySelector('script[type="application/l10n"]');
13985
- return script ? JSON.parse(script.innerHTML) : null;
13986
- }
13987
-
13988
- function getTranslatableChildren(element) {
13989
- return element ? element.querySelectorAll('*[data-l10n-id]') : [];
13990
- }
13991
-
13992
- function getL10nAttributes(element) {
13993
- if (!element) return {};
13994
- var l10nId = element.getAttribute('data-l10n-id');
13995
- var l10nArgs = element.getAttribute('data-l10n-args');
13996
- var args = {};
13997
-
13998
- if (l10nArgs) {
13999
- try {
14000
- args = JSON.parse(l10nArgs);
14001
- } catch (e) {
14002
- console.warn('could not parse arguments for #' + l10nId);
14003
- }
14004
- }
14005
-
14006
- return {
14007
- id: l10nId,
14008
- args: args
14009
- };
14010
- }
14011
-
14012
- function xhrLoadText(url, onSuccess, onFailure) {
14013
- onSuccess = onSuccess || function _onSuccess(data) {};
14014
-
14015
- onFailure = onFailure || function _onFailure() {};
14016
-
14017
- var xhr = new XMLHttpRequest();
14018
- xhr.open('GET', url, gAsyncResourceLoading);
14019
-
14020
- if (xhr.overrideMimeType) {
14021
- xhr.overrideMimeType('text/plain; charset=utf-8');
14022
- }
14023
-
14024
- xhr.onreadystatechange = function () {
14025
- if (xhr.readyState == 4) {
14026
- if (xhr.status == 200 || xhr.status === 0) {
14027
- onSuccess(xhr.responseText);
14028
- } else {
14029
- onFailure();
14030
- }
14031
- }
14032
- };
14033
-
14034
- xhr.onerror = onFailure;
14035
- xhr.ontimeout = onFailure;
14036
-
14037
- try {
14038
- xhr.send(null);
14039
- } catch (e) {
14040
- onFailure();
14041
- }
14042
- }
14043
-
14044
- function parseResource(href, lang, successCallback, failureCallback) {
14045
- var baseURL = href.replace(/[^\/]*$/, '') || './';
14046
-
14047
- function evalString(text) {
14048
- if (text.lastIndexOf('\\') < 0) return text;
14049
- return text.replace(/\\\\/g, '\\').replace(/\\n/g, '\n').replace(/\\r/g, '\r').replace(/\\t/g, '\t').replace(/\\b/g, '\b').replace(/\\f/g, '\f').replace(/\\{/g, '{').replace(/\\}/g, '}').replace(/\\"/g, '"').replace(/\\'/g, "'");
14050
- }
14051
-
14052
- function parseProperties(text, parsedPropertiesCallback) {
14053
- var dictionary = {};
14054
- var reBlank = /^\s*|\s*$/;
14055
- var reComment = /^\s*#|^\s*$/;
14056
- var reSection = /^\s*\[(.*)\]\s*$/;
14057
- var reImport = /^\s*@import\s+url\((.*)\)\s*$/i;
14058
- var reSplit = /^([^=\s]*)\s*=\s*(.+)$/;
14059
-
14060
- function parseRawLines(rawText, extendedSyntax, parsedRawLinesCallback) {
14061
- var entries = rawText.replace(reBlank, '').split(/[\r\n]+/);
14062
- var currentLang = '*';
14063
- var genericLang = lang.split('-', 1)[0];
14064
- var skipLang = false;
14065
- var match = '';
14066
-
14067
- function nextEntry() {
14068
- while (true) {
14069
- if (!entries.length) {
14070
- parsedRawLinesCallback();
14071
- return;
14072
- }
14073
-
14074
- var line = entries.shift();
14075
- if (reComment.test(line)) continue;
14076
-
14077
- if (extendedSyntax) {
14078
- match = reSection.exec(line);
14079
-
14080
- if (match) {
14081
- currentLang = match[1].toLowerCase();
14082
- skipLang = currentLang !== '*' && currentLang !== lang && currentLang !== genericLang;
14083
- continue;
14084
- } else if (skipLang) {
14085
- continue;
14086
- }
14087
-
14088
- match = reImport.exec(line);
14089
-
14090
- if (match) {
14091
- loadImport(baseURL + match[1], nextEntry);
14092
- return;
14093
- }
14094
- }
14095
-
14096
- var tmp = line.match(reSplit);
14097
-
14098
- if (tmp && tmp.length == 3) {
14099
- dictionary[tmp[1]] = evalString(tmp[2]);
14100
- }
14101
- }
14102
- }
14103
-
14104
- nextEntry();
14105
- }
14106
-
14107
- function loadImport(url, callback) {
14108
- xhrLoadText(url, function (content) {
14109
- parseRawLines(content, false, callback);
14110
- }, function () {
14111
- console.warn(url + ' not found.');
14112
- callback();
14113
- });
14114
- }
14115
-
14116
- parseRawLines(text, true, function () {
14117
- parsedPropertiesCallback(dictionary);
14118
- });
14119
- }
14120
-
14121
- xhrLoadText(href, function (response) {
14122
- gTextData += response;
14123
- parseProperties(response, function (data) {
14124
- for (var key in data) {
14125
- var id,
14126
- prop,
14127
- index = key.lastIndexOf('.');
14128
-
14129
- if (index > 0) {
14130
- id = key.substring(0, index);
14131
- prop = key.substring(index + 1);
14132
- } else {
14133
- id = key;
14134
- prop = gTextProp;
14135
- }
14136
-
14137
- if (!gL10nData[id]) {
14138
- gL10nData[id] = {};
14139
- }
14140
-
14141
- gL10nData[id][prop] = data[key];
14142
- }
14143
-
14144
- if (successCallback) {
14145
- successCallback();
14146
- }
14147
- });
14148
- }, failureCallback);
14149
- }
14150
-
14151
- /* function loadLocale(lang, callback) {
14152
- if (lang) {
14153
- lang = lang.toLowerCase();
14154
- }
14155
-
14156
- callback = callback || function _callback() {};
14157
-
14158
- clear();
14159
- gLanguage = lang;
14160
- var langLinks = getL10nResourceLinks();
14161
- var langCount = langLinks.length;
14162
-
14163
- if (langCount === 0) {
14164
- var dict = getL10nDictionary();
14165
-
14166
- if (dict && dict.locales && dict.default_locale) {
14167
- console.log('using the embedded JSON directory, early way out');
14168
- gL10nData = dict.locales[lang];
14169
-
14170
- if (!gL10nData) {
14171
- var defaultLocale = dict.default_locale.toLowerCase();
14172
-
14173
- for (var anyCaseLang in dict.locales) {
14174
- anyCaseLang = anyCaseLang.toLowerCase();
14175
-
14176
- if (anyCaseLang === lang) {
14177
- gL10nData = dict.locales[lang];
14178
- break;
14179
- } else if (anyCaseLang === defaultLocale) {
14180
- gL10nData = dict.locales[defaultLocale];
14181
- }
14182
- }
14183
- }
14184
-
14185
- callback();
14186
- } else {
14187
- console.log('no resource to load, early way out');
14188
- }
14189
-
14190
- gReadyState = 'complete';
14191
- return;
14192
- }
14193
-
14194
- var onResourceLoaded = null;
14195
- var gResourceCount = 0;
14196
-
14197
- onResourceLoaded = function () {
14198
- gResourceCount++;
14199
-
14200
- if (gResourceCount >= langCount) {
14201
- callback();
14202
- gReadyState = 'complete';
14203
- }
14204
- };
14205
-
14206
- function L10nResourceLink(link) {
14207
- var href = link.href;
14208
-
14209
- this.load = function (lang, callback) {
14210
- parseResource(href, lang, callback, function () {
14211
- console.warn(href + ' not found.');
14212
- console.warn('"' + lang + '" resource not found');
14213
- gLanguage = '';
14214
- callback();
14215
- });
14216
- };
14217
- }
14218
-
14219
- for (var i = 0; i < langCount; i++) {
14220
- var resource = new L10nResourceLink(langLinks[i]);
14221
- resource.load(lang, onResourceLoaded);
14222
- }
14223
- } */
14224
-
14225
- function clear() {
14226
- gL10nData = {};
14227
- gTextData = '';
14228
- gLanguage = '';
14229
- }
14230
-
14231
- function getPluralRules(lang) {
14232
- var locales2rules = {
14233
- 'af': 3,
14234
- 'ak': 4,
14235
- 'am': 4,
14236
- 'ar': 1,
14237
- 'asa': 3,
14238
- 'az': 0,
14239
- 'be': 11,
14240
- 'bem': 3,
14241
- 'bez': 3,
14242
- 'bg': 3,
14243
- 'bh': 4,
14244
- 'bm': 0,
14245
- 'bn': 3,
14246
- 'bo': 0,
14247
- 'br': 20,
14248
- 'brx': 3,
14249
- 'bs': 11,
14250
- 'ca': 3,
14251
- 'cgg': 3,
14252
- 'chr': 3,
14253
- 'cs': 12,
14254
- 'cy': 17,
14255
- 'da': 3,
14256
- 'de': 3,
14257
- 'dv': 3,
14258
- 'dz': 0,
14259
- 'ee': 3,
14260
- 'el': 3,
14261
- 'en': 3,
14262
- 'eo': 3,
14263
- 'es': 3,
14264
- 'et': 3,
14265
- 'eu': 3,
14266
- 'fa': 0,
14267
- 'ff': 5,
14268
- 'fi': 3,
14269
- 'fil': 4,
14270
- 'fo': 3,
14271
- 'fr': 5,
14272
- 'fur': 3,
14273
- 'fy': 3,
14274
- 'ga': 8,
14275
- 'gd': 24,
14276
- 'gl': 3,
14277
- 'gsw': 3,
14278
- 'gu': 3,
14279
- 'guw': 4,
14280
- 'gv': 23,
14281
- 'ha': 3,
14282
- 'haw': 3,
14283
- 'he': 2,
14284
- 'hi': 4,
14285
- 'hr': 11,
14286
- 'hu': 0,
14287
- 'id': 0,
14288
- 'ig': 0,
14289
- 'ii': 0,
14290
- 'is': 3,
14291
- 'it': 3,
14292
- 'iu': 7,
14293
- 'ja': 0,
14294
- 'jmc': 3,
14295
- 'jv': 0,
14296
- 'ka': 0,
14297
- 'kab': 5,
14298
- 'kaj': 3,
14299
- 'kcg': 3,
14300
- 'kde': 0,
14301
- 'kea': 0,
14302
- 'kk': 3,
14303
- 'kl': 3,
14304
- 'km': 0,
14305
- 'kn': 0,
14306
- 'ko': 0,
14307
- 'ksb': 3,
14308
- 'ksh': 21,
14309
- 'ku': 3,
14310
- 'kw': 7,
14311
- 'lag': 18,
14312
- 'lb': 3,
14313
- 'lg': 3,
14314
- 'ln': 4,
14315
- 'lo': 0,
14316
- 'lt': 10,
14317
- 'lv': 6,
14318
- 'mas': 3,
14319
- 'mg': 4,
14320
- 'mk': 16,
14321
- 'ml': 3,
14322
- 'mn': 3,
14323
- 'mo': 9,
14324
- 'mr': 3,
14325
- 'ms': 0,
14326
- 'mt': 15,
14327
- 'my': 0,
14328
- 'nah': 3,
14329
- 'naq': 7,
14330
- 'nb': 3,
14331
- 'nd': 3,
14332
- 'ne': 3,
14333
- 'nl': 3,
14334
- 'nn': 3,
14335
- 'no': 3,
14336
- 'nr': 3,
14337
- 'nso': 4,
14338
- 'ny': 3,
14339
- 'nyn': 3,
14340
- 'om': 3,
14341
- 'or': 3,
14342
- 'pa': 3,
14343
- 'pap': 3,
14344
- 'pl': 13,
14345
- 'ps': 3,
14346
- 'pt': 3,
14347
- 'rm': 3,
14348
- 'ro': 9,
14349
- 'rof': 3,
14350
- 'ru': 11,
14351
- 'rwk': 3,
14352
- 'sah': 0,
14353
- 'saq': 3,
14354
- 'se': 7,
14355
- 'seh': 3,
14356
- 'ses': 0,
14357
- 'sg': 0,
14358
- 'sh': 11,
14359
- 'shi': 19,
14360
- 'sk': 12,
14361
- 'sl': 14,
14362
- 'sma': 7,
14363
- 'smi': 7,
14364
- 'smj': 7,
14365
- 'smn': 7,
14366
- 'sms': 7,
14367
- 'sn': 3,
14368
- 'so': 3,
14369
- 'sq': 3,
14370
- 'sr': 11,
14371
- 'ss': 3,
14372
- 'ssy': 3,
14373
- 'st': 3,
14374
- 'sv': 3,
14375
- 'sw': 3,
14376
- 'syr': 3,
14377
- 'ta': 3,
14378
- 'te': 3,
14379
- 'teo': 3,
14380
- 'th': 0,
14381
- 'ti': 4,
14382
- 'tig': 3,
14383
- 'tk': 3,
14384
- 'tl': 4,
14385
- 'tn': 3,
14386
- 'to': 0,
14387
- 'tr': 0,
14388
- 'ts': 3,
14389
- 'tzm': 22,
14390
- 'uk': 11,
14391
- 'ur': 3,
14392
- 've': 3,
14393
- 'vi': 0,
14394
- 'vun': 3,
14395
- 'wa': 4,
14396
- 'wae': 3,
14397
- 'wo': 0,
14398
- 'xh': 3,
14399
- 'xog': 3,
14400
- 'yo': 0,
14401
- 'zh': 0,
14402
- 'zu': 3
14403
- };
14404
-
14405
- function isIn(n, list) {
14406
- return list.indexOf(n) !== -1;
14407
- }
14408
-
14409
- function isBetween(n, start, end) {
14410
- return start <= n && n <= end;
14411
- }
14412
-
14413
- var pluralRules = {
14414
- '0': function (n) {
14415
- return 'other';
14416
- },
14417
- '1': function (n) {
14418
- if (isBetween(n % 100, 3, 10)) return 'few';
14419
- if (n === 0) return 'zero';
14420
- if (isBetween(n % 100, 11, 99)) return 'many';
14421
- if (n == 2) return 'two';
14422
- if (n == 1) return 'one';
14423
- return 'other';
14424
- },
14425
- '2': function (n) {
14426
- if (n !== 0 && n % 10 === 0) return 'many';
14427
- if (n == 2) return 'two';
14428
- if (n == 1) return 'one';
14429
- return 'other';
14430
- },
14431
- '3': function (n) {
14432
- if (n == 1) return 'one';
14433
- return 'other';
14434
- },
14435
- '4': function (n) {
14436
- if (isBetween(n, 0, 1)) return 'one';
14437
- return 'other';
14438
- },
14439
- '5': function (n) {
14440
- if (isBetween(n, 0, 2) && n != 2) return 'one';
14441
- return 'other';
14442
- },
14443
- '6': function (n) {
14444
- if (n === 0) return 'zero';
14445
- if (n % 10 == 1 && n % 100 != 11) return 'one';
14446
- return 'other';
14447
- },
14448
- '7': function (n) {
14449
- if (n == 2) return 'two';
14450
- if (n == 1) return 'one';
14451
- return 'other';
14452
- },
14453
- '8': function (n) {
14454
- if (isBetween(n, 3, 6)) return 'few';
14455
- if (isBetween(n, 7, 10)) return 'many';
14456
- if (n == 2) return 'two';
14457
- if (n == 1) return 'one';
14458
- return 'other';
14459
- },
14460
- '9': function (n) {
14461
- if (n === 0 || n != 1 && isBetween(n % 100, 1, 19)) return 'few';
14462
- if (n == 1) return 'one';
14463
- return 'other';
14464
- },
14465
- '10': function (n) {
14466
- if (isBetween(n % 10, 2, 9) && !isBetween(n % 100, 11, 19)) return 'few';
14467
- if (n % 10 == 1 && !isBetween(n % 100, 11, 19)) return 'one';
14468
- return 'other';
14469
- },
14470
- '11': function (n) {
14471
- if (isBetween(n % 10, 2, 4) && !isBetween(n % 100, 12, 14)) return 'few';
14472
- if (n % 10 === 0 || isBetween(n % 10, 5, 9) || isBetween(n % 100, 11, 14)) return 'many';
14473
- if (n % 10 == 1 && n % 100 != 11) return 'one';
14474
- return 'other';
14475
- },
14476
- '12': function (n) {
14477
- if (isBetween(n, 2, 4)) return 'few';
14478
- if (n == 1) return 'one';
14479
- return 'other';
14480
- },
14481
- '13': function (n) {
14482
- if (isBetween(n % 10, 2, 4) && !isBetween(n % 100, 12, 14)) return 'few';
14483
- if (n != 1 && isBetween(n % 10, 0, 1) || isBetween(n % 10, 5, 9) || isBetween(n % 100, 12, 14)) return 'many';
14484
- if (n == 1) return 'one';
14485
- return 'other';
14486
- },
14487
- '14': function (n) {
14488
- if (isBetween(n % 100, 3, 4)) return 'few';
14489
- if (n % 100 == 2) return 'two';
14490
- if (n % 100 == 1) return 'one';
14491
- return 'other';
14492
- },
14493
- '15': function (n) {
14494
- if (n === 0 || isBetween(n % 100, 2, 10)) return 'few';
14495
- if (isBetween(n % 100, 11, 19)) return 'many';
14496
- if (n == 1) return 'one';
14497
- return 'other';
14498
- },
14499
- '16': function (n) {
14500
- if (n % 10 == 1 && n != 11) return 'one';
14501
- return 'other';
14502
- },
14503
- '17': function (n) {
14504
- if (n == 3) return 'few';
14505
- if (n === 0) return 'zero';
14506
- if (n == 6) return 'many';
14507
- if (n == 2) return 'two';
14508
- if (n == 1) return 'one';
14509
- return 'other';
14510
- },
14511
- '18': function (n) {
14512
- if (n === 0) return 'zero';
14513
- if (isBetween(n, 0, 2) && n !== 0 && n != 2) return 'one';
14514
- return 'other';
14515
- },
14516
- '19': function (n) {
14517
- if (isBetween(n, 2, 10)) return 'few';
14518
- if (isBetween(n, 0, 1)) return 'one';
14519
- return 'other';
14520
- },
14521
- '20': function (n) {
14522
- if ((isBetween(n % 10, 3, 4) || n % 10 == 9) && !(isBetween(n % 100, 10, 19) || isBetween(n % 100, 70, 79) || isBetween(n % 100, 90, 99))) return 'few';
14523
- if (n % 1000000 === 0 && n !== 0) return 'many';
14524
- if (n % 10 == 2 && !isIn(n % 100, [12, 72, 92])) return 'two';
14525
- if (n % 10 == 1 && !isIn(n % 100, [11, 71, 91])) return 'one';
14526
- return 'other';
14527
- },
14528
- '21': function (n) {
14529
- if (n === 0) return 'zero';
14530
- if (n == 1) return 'one';
14531
- return 'other';
14532
- },
14533
- '22': function (n) {
14534
- if (isBetween(n, 0, 1) || isBetween(n, 11, 99)) return 'one';
14535
- return 'other';
14536
- },
14537
- '23': function (n) {
14538
- if (isBetween(n % 10, 1, 2) || n % 20 === 0) return 'one';
14539
- return 'other';
14540
- },
14541
- '24': function (n) {
14542
- if (isBetween(n, 3, 10) || isBetween(n, 13, 19)) return 'few';
14543
- if (isIn(n, [2, 12])) return 'two';
14544
- if (isIn(n, [1, 11])) return 'one';
14545
- return 'other';
14546
- }
14547
- };
14548
- var index = locales2rules[lang.replace(/-.*$/, '')];
14549
-
14550
- if (!(index in pluralRules)) {
14551
- console.warn('plural form unknown for [' + lang + ']');
14552
- return function () {
14553
- return 'other';
14554
- };
14555
- }
14556
-
14557
- return pluralRules[index];
14558
- }
14559
-
14560
- gMacros.plural = function (str, param, key, prop) {
14561
- var n = parseFloat(param);
14562
- if (isNaN(n)) return str;
14563
- if (prop != gTextProp) return str;
14564
-
14565
- if (!gMacros._pluralRules) {
14566
- gMacros._pluralRules = getPluralRules(gLanguage);
14567
- }
14568
-
14569
- var index = '[' + gMacros._pluralRules(n) + ']';
14570
-
14571
- if (n === 0 && key + '[zero]' in gL10nData) {
14572
- str = gL10nData[key + '[zero]'][prop];
14573
- } else if (n == 1 && key + '[one]' in gL10nData) {
14574
- str = gL10nData[key + '[one]'][prop];
14575
- } else if (n == 2 && key + '[two]' in gL10nData) {
14576
- str = gL10nData[key + '[two]'][prop];
14577
- } else if (key + index in gL10nData) {
14578
- str = gL10nData[key + index][prop];
14579
- } else if (key + '[other]' in gL10nData) {
14580
- str = gL10nData[key + '[other]'][prop];
14581
- }
14582
-
14583
- return str;
14584
- };
14585
-
14586
- function getL10nData(key, args, fallback) {
14587
- var data = gL10nData[key];
14588
-
14589
- if (!data) {
14590
- console.warn('#' + key + ' is undefined.');
14591
-
14592
- if (!fallback) {
14593
- return null;
14594
- }
14595
-
14596
- data = fallback;
14597
- }
14598
-
14599
- var rv = {};
14600
-
14601
- for (var prop in data) {
14602
- var str = data[prop];
14603
- str = substIndexes(str, args, key, prop);
14604
- str = substArguments(str, args, key);
14605
- rv[prop] = str;
14606
- }
14607
-
14608
- return rv;
14609
- }
14610
-
14611
- function substIndexes(str, args, key, prop) {
14612
- var reIndex = /\{\[\s*([a-zA-Z]+)\(([a-zA-Z]+)\)\s*\]\}/;
14613
- var reMatch = reIndex.exec(str);
14614
- if (!reMatch || !reMatch.length) return str;
14615
- var macroName = reMatch[1];
14616
- var paramName = reMatch[2];
14617
- var param;
14618
-
14619
- if (args && paramName in args) {
14620
- param = args[paramName];
14621
- } else if (paramName in gL10nData) {
14622
- param = gL10nData[paramName];
14623
- }
14624
-
14625
- if (macroName in gMacros) {
14626
- var macro = gMacros[macroName];
14627
- str = macro(str, param, key, prop);
14628
- }
14629
-
14630
- return str;
14631
- }
14632
-
14633
- function substArguments(str, args, key) {
14634
- var reArgs = /\{\{\s*(.+?)\s*\}\}/g;
14635
- return str.replace(reArgs, function (matched_text, arg) {
14636
- if (args && arg in args) {
14637
- return args[arg];
14638
- }
14639
-
14640
- if (arg in gL10nData) {
14641
- return gL10nData[arg];
14642
- }
14643
-
14644
- console.log('argument {{' + arg + '}} for #' + key + ' is undefined.');
14645
- return matched_text;
14646
- });
14647
- }
14648
-
14649
- function translateElement(element) {
14650
- var l10n = getL10nAttributes(element);
14651
- if (!l10n.id) return;
14652
- var data = getL10nData(l10n.id, l10n.args);
14653
-
14654
- if (!data) {
14655
- console.warn('#' + l10n.id + ' is undefined.');
14656
- return;
14657
- }
14658
-
14659
- if (data[gTextProp]) {
14660
- if (getChildElementCount(element) === 0) {
14661
- element[gTextProp] = data[gTextProp];
14662
- } else {
14663
- var children = element.childNodes;
14664
- var found = false;
14665
-
14666
- for (var i = 0, l = children.length; i < l; i++) {
14667
- if (children[i].nodeType === 3 && /\S/.test(children[i].nodeValue)) {
14668
- if (found) {
14669
- children[i].nodeValue = '';
14670
- } else {
14671
- children[i].nodeValue = data[gTextProp];
14672
- found = true;
14673
- }
14674
- }
14675
- }
14676
-
14677
- if (!found) {
14678
- var textNode = document.createTextNode(data[gTextProp]);
14679
- element.insertBefore(textNode, element.firstChild);
14680
- }
14681
- }
14682
-
14683
- delete data[gTextProp];
14684
- }
14685
-
14686
- for (var k in data) {
14687
- element[k] = data[k];
14688
- }
14689
- }
14690
-
14691
- function getChildElementCount(element) {
14692
- if (element.children) {
14693
- return element.children.length;
14694
- }
14695
-
14696
- if (typeof element.childElementCount !== 'undefined') {
14697
- return element.childElementCount;
14698
- }
14699
-
14700
- var count = 0;
14701
-
14702
- for (var i = 0; i < element.childNodes.length; i++) {
14703
- count += element.nodeType === 1 ? 1 : 0;
14704
- }
14705
-
14706
- return count;
14707
- }
14708
-
14709
- function translateFragment(element) {
14710
- element = element || document.documentElement;
14711
- var children = getTranslatableChildren(element);
14712
- var elementCount = children.length;
14713
-
14714
- for (var i = 0; i < elementCount; i++) {
14715
- translateElement(children[i]);
14716
- }
14717
-
14718
- translateElement(element);
14719
- }
14720
-
14721
- return {
14722
- get: function (key, args, fallbackString) {
14723
- var index = key.lastIndexOf('.');
14724
- var prop = gTextProp;
14725
-
14726
- if (index > 0) {
14727
- prop = key.substring(index + 1);
14728
- key = key.substring(0, index);
14729
- }
14730
-
14731
- var fallback;
14732
-
14733
- if (fallbackString) {
14734
- fallback = {};
14735
- fallback[prop] = fallbackString;
14736
- }
14737
-
14738
- var data = getL10nData(key, args, fallback);
14739
-
14740
- if (data && prop in data) {
14741
- return data[prop];
14742
- }
14743
-
14744
- return '{{' + key + '}}';
14745
- },
14746
- getData: function () {
14747
- return gL10nData;
14748
- },
14749
- getText: function () {
14750
- return gTextData;
14751
- },
14752
- getLanguage: function () {
14753
- return gLanguage;
14754
- },
14755
- setLanguage: function (lang, callback) {
14756
- // loadLocale(lang, function () {
14757
- // if (callback) callback();
14758
- // });
14759
- },
14760
- getDirection: function () {
14761
- var rtlList = ['ar', 'he', 'fa', 'ps', 'ur'];
14762
- var shortCode = gLanguage.split('-', 1)[0];
14763
- return rtlList.indexOf(shortCode) >= 0 ? 'rtl' : 'ltr';
14764
- },
14765
- translate: translateFragment,
14766
- getReadyState: function () {
14767
- return gReadyState;
14768
- },
14769
- ready: function (callback) {
14770
- if (!callback) {
14771
- return;
14772
- } else if (gReadyState == 'complete' || gReadyState == 'interactive') {
14773
- window.setTimeout(function () {
14774
- callback();
14775
- });
14776
- } else if (document.addEventListener) {
14777
- document.addEventListener('localized', function once() {
14778
- document.removeEventListener('localized', once);
14779
- callback();
14780
- });
14781
- }
14782
- }
14783
- };
14784
- }(window, document);
14785
-
14786
- /***/ }),
14787
- /* 44 */
14788
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
14789
-
14790
-
14791
-
14792
- Object.defineProperty(exports, "__esModule", ({
14793
- value: true
14794
- }));
14795
- exports.docPropertiesLookup = docPropertiesLookup;
14796
- exports.GenericScripting = void 0;
14797
-
14798
- var _pdfjsLib = __webpack_require__(5);
14799
-
14800
- async function docPropertiesLookup(pdfDocument) {
14801
- const url = "",
14802
- baseUrl = url.split("#")[0];
14803
- let {
14804
- info,
14805
- metadata,
14806
- contentDispositionFilename,
14807
- contentLength
14808
- } = await pdfDocument.getMetadata();
14809
-
14810
- if (!contentLength) {
14811
- const {
14812
- length
14813
- } = await pdfDocument.getDownloadInfo();
14814
- contentLength = length;
14815
- }
14816
-
14817
- return { ...info,
14818
- baseURL: baseUrl,
14819
- filesize: contentLength,
14820
- filename: contentDispositionFilename || (0, _pdfjsLib.getPdfFilenameFromUrl)(url),
14821
- metadata: metadata?.getRaw(),
14822
- authors: metadata?.get("dc:creator"),
14823
- numPages: pdfDocument.numPages,
14824
- URL: url
14825
- };
14826
- }
14827
-
14828
- class GenericScripting {
14829
- constructor(sandboxBundleSrc) {
14830
- this._ready = (0, _pdfjsLib.loadScript)(sandboxBundleSrc, true).then(() => {
14831
- return window.pdfjsSandbox.QuickJSSandbox();
14832
- });
14833
- }
14834
-
14835
- async createSandbox(data) {
14836
- const sandbox = await this._ready;
14837
- sandbox.create(data);
14838
- }
14839
-
14840
- async dispatchEventInSandbox(event) {
14841
- const sandbox = await this._ready;
14842
- sandbox.dispatchEvent(event);
14843
- }
14844
-
14845
- async destroySandbox() {
14846
- const sandbox = await this._ready;
14847
- sandbox.nukeSandbox();
14848
- }
14849
-
14850
- }
14851
-
14852
- exports.GenericScripting = GenericScripting;
14853
-
14854
- /***/ }),
14855
- /* 45 */
14856
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
14857
-
14858
-
14859
-
14860
- Object.defineProperty(exports, "__esModule", ({
14861
- value: true
14862
- }));
14863
- exports.PDFPrintService = PDFPrintService;
14864
-
14865
- var _app = __webpack_require__(3);
14866
-
14867
- var _print_utils = __webpack_require__(46);
14868
-
14869
- var _viewer_compatibility = __webpack_require__(2);
14870
-
14871
- let activeService = null;
14872
- let overlayManager = null;
14873
-
14874
- function renderPage(activeServiceOnEntry, pdfDocument, pageNumber, size, printResolution, optionalContentConfigPromise) {
14875
- const scratchCanvas = activeService.scratchCanvas;
14876
- const PRINT_UNITS = printResolution / 72.0;
14877
- scratchCanvas.width = Math.floor(size.width * PRINT_UNITS);
14878
- scratchCanvas.height = Math.floor(size.height * PRINT_UNITS);
14879
- const ctx = scratchCanvas.getContext("2d");
14880
- ctx.save();
14881
- ctx.fillStyle = "rgb(255, 255, 255)";
14882
- ctx.fillRect(0, 0, scratchCanvas.width, scratchCanvas.height);
14883
- ctx.restore();
14884
- return pdfDocument.getPage(pageNumber).then(function (pdfPage) {
14885
- const renderContext = {
14886
- canvasContext: ctx,
14887
- transform: [PRINT_UNITS, 0, 0, PRINT_UNITS, 0, 0],
14888
- viewport: pdfPage.getViewport({
14889
- scale: 1,
14890
- rotation: size.rotation
14891
- }),
14892
- intent: "print",
14893
- includeAnnotationStorage: true,
14894
- optionalContentConfigPromise
14895
- };
14896
- return pdfPage.render(renderContext).promise;
14897
- });
14898
- }
14899
-
14900
- function PDFPrintService(pdfDocument, pagesOverview, printContainer, printResolution, optionalContentConfigPromise = null, l10n) {
14901
- this.pdfDocument = pdfDocument;
14902
- this.pagesOverview = pagesOverview;
14903
- this.printContainer = printContainer;
14904
- this._printResolution = printResolution || 150;
14905
- this._optionalContentConfigPromise = optionalContentConfigPromise || pdfDocument.getOptionalContentConfig();
14906
- this.l10n = l10n;
14907
- this.currentPage = -1;
14908
- this.scratchCanvas = document.createElement("canvas");
14909
- }
14910
-
14911
- PDFPrintService.prototype = {
14912
- layout() {
14913
- this.throwIfInactive();
14914
- const body = document.querySelector("body");
14915
- body.setAttribute("data-pdfjsprinting", true);
14916
- const hasEqualPageSizes = this.pagesOverview.every(function (size) {
14917
- return size.width === this.pagesOverview[0].width && size.height === this.pagesOverview[0].height;
14918
- }, this);
14919
-
14920
- if (!hasEqualPageSizes) {
14921
- console.warn("Not all pages have the same size. The printed " + "result may be incorrect!");
14922
- }
14923
-
14924
- this.pageStyleSheet = document.createElement("style");
14925
- const pageSize = this.pagesOverview[0];
14926
- this.pageStyleSheet.textContent = "@page { size: " + pageSize.width + "pt " + pageSize.height + "pt;}";
14927
- body.appendChild(this.pageStyleSheet);
14928
- },
14929
-
14930
- destroy() {
14931
- if (activeService !== this) {
14932
- return;
14933
- }
14934
-
14935
- this.printContainer.textContent = "";
14936
- const body = document.querySelector("body");
14937
- body.removeAttribute("data-pdfjsprinting");
14938
-
14939
- if (this.pageStyleSheet) {
14940
- this.pageStyleSheet.remove();
14941
- this.pageStyleSheet = null;
14942
- }
14943
-
14944
- this.scratchCanvas.width = this.scratchCanvas.height = 0;
14945
- this.scratchCanvas = null;
14946
- activeService = null;
14947
- ensureOverlay().then(function () {
14948
- if (overlayManager.active !== "printServiceOverlay") {
14949
- return;
14950
- }
14951
-
14952
- overlayManager.close("printServiceOverlay");
14953
- });
14954
- },
14955
-
14956
- renderPages() {
14957
- if (this.pdfDocument.isPureXfa) {
14958
- (0, _print_utils.getXfaHtmlForPrinting)(this.printContainer, this.pdfDocument);
14959
- return Promise.resolve();
14960
- }
14961
-
14962
- const pageCount = this.pagesOverview.length;
14963
-
14964
- const renderNextPage = (resolve, reject) => {
14965
- this.throwIfInactive();
14966
-
14967
- if (++this.currentPage >= pageCount) {
14968
- renderProgress(pageCount, pageCount, this.l10n);
14969
- resolve();
14970
- return;
14971
- }
14972
-
14973
- const index = this.currentPage;
14974
- renderProgress(index, pageCount, this.l10n);
14975
- renderPage(this, this.pdfDocument, index + 1, this.pagesOverview[index], this._printResolution, this._optionalContentConfigPromise).then(this.useRenderedPage.bind(this)).then(function () {
14976
- renderNextPage(resolve, reject);
14977
- }, reject);
14978
- };
14979
-
14980
- return new Promise(renderNextPage);
14981
- },
14982
-
14983
- useRenderedPage() {
14984
- this.throwIfInactive();
14985
- const img = document.createElement("img");
14986
- const scratchCanvas = this.scratchCanvas;
14987
-
14988
- if ("toBlob" in scratchCanvas && !_viewer_compatibility.viewerCompatibilityParams.disableCreateObjectURL) {
14989
- scratchCanvas.toBlob(function (blob) {
14990
- img.src = URL.createObjectURL(blob);
14991
- });
14992
- } else {
14993
- img.src = scratchCanvas.toDataURL();
14994
- }
14995
-
14996
- const wrapper = document.createElement("div");
14997
- wrapper.className = "printedPage";
14998
- wrapper.appendChild(img);
14999
- this.printContainer.appendChild(wrapper);
15000
- return new Promise(function (resolve, reject) {
15001
- img.onload = resolve;
15002
- img.onerror = reject;
15003
- });
15004
- },
15005
-
15006
- performPrint() {
15007
- this.throwIfInactive();
15008
- return new Promise(resolve => {
15009
- setTimeout(() => {
15010
- if (!this.active) {
15011
- resolve();
15012
- return;
15013
- }
15014
-
15015
- print.call(window);
15016
- setTimeout(resolve, 20);
15017
- }, 0);
15018
- });
15019
- },
15020
-
15021
- get active() {
15022
- return this === activeService;
15023
- },
15024
-
15025
- throwIfInactive() {
15026
- if (!this.active) {
15027
- throw new Error("This print request was cancelled or completed.");
15028
- }
15029
- }
15030
-
15031
- };
15032
- const print = window.print;
15033
-
15034
- window.print = function () {
15035
- if (activeService) {
15036
- console.warn("Ignored window.print() because of a pending print job.");
15037
- return;
15038
- }
15039
-
15040
- ensureOverlay().then(function () {
15041
- if (activeService) {
15042
- overlayManager.open("printServiceOverlay");
15043
- }
15044
- });
15045
-
15046
- try {
15047
- dispatchEvent("beforeprint");
15048
- } finally {
15049
- if (!activeService) {
15050
- console.error("Expected print service to be initialized.");
15051
- ensureOverlay().then(function () {
15052
- if (overlayManager.active === "printServiceOverlay") {
15053
- overlayManager.close("printServiceOverlay");
15054
- }
15055
- });
15056
- return;
15057
- }
15058
-
15059
- const activeServiceOnEntry = activeService;
15060
- activeService.renderPages().then(function () {
15061
- return activeServiceOnEntry.performPrint();
15062
- }).catch(function () {}).then(function () {
15063
- if (activeServiceOnEntry.active) {
15064
- abort();
15065
- }
15066
- });
15067
- }
15068
- };
15069
-
15070
- function dispatchEvent(eventType) {
15071
- const event = document.createEvent("CustomEvent");
15072
- event.initCustomEvent(eventType, false, false, "custom");
15073
- window.dispatchEvent(event);
15074
- }
15075
-
15076
- function abort() {
15077
- if (activeService) {
15078
- activeService.destroy();
15079
- dispatchEvent("afterprint");
15080
- }
15081
- }
15082
-
15083
- function renderProgress(index, total, l10n) {
15084
- const progressContainer = document.getElementById("printServiceOverlay");
15085
- const progress = Math.round(100 * index / total);
15086
- const progressBar = progressContainer.querySelector("progress");
15087
- const progressPerc = progressContainer.querySelector(".relative-progress");
15088
- progressBar.value = progress;
15089
- l10n.get("print_progress_percent", {
15090
- progress
15091
- }).then(msg => {
15092
- progressPerc.textContent = msg;
15093
- });
15094
- }
15095
-
15096
- window.addEventListener("keydown", function (event) {
15097
- if (event.keyCode === 80 && (event.ctrlKey || event.metaKey) && !event.altKey && (!event.shiftKey || window.chrome || window.opera)) {
15098
- window.print();
15099
- event.preventDefault();
15100
-
15101
- if (event.stopImmediatePropagation) {
15102
- event.stopImmediatePropagation();
15103
- } else {
15104
- event.stopPropagation();
15105
- }
15106
- }
15107
- }, true);
15108
-
15109
- if ("onbeforeprint" in window) {
15110
- const stopPropagationIfNeeded = function (event) {
15111
- if (event.detail !== "custom" && event.stopImmediatePropagation) {
15112
- event.stopImmediatePropagation();
15113
- }
15114
- };
15115
-
15116
- window.addEventListener("beforeprint", stopPropagationIfNeeded);
15117
- window.addEventListener("afterprint", stopPropagationIfNeeded);
15118
- }
15119
-
15120
- let overlayPromise;
15121
-
15122
- function ensureOverlay() {
15123
- if (!overlayPromise) {
15124
- overlayManager = _app.PDFViewerApplication.overlayManager;
15125
-
15126
- if (!overlayManager) {
15127
- throw new Error("The overlay manager has not yet been initialized.");
15128
- }
15129
-
15130
- overlayPromise = overlayManager.register("printServiceOverlay", document.getElementById("printServiceOverlay"), abort, true);
15131
- document.getElementById("printCancel").onclick = abort;
15132
- }
15133
-
15134
- return overlayPromise;
15135
- }
15136
-
15137
- _app.PDFPrintServiceFactory.instance = {
15138
- supportsPrinting: true,
15139
-
15140
- createPrintService(pdfDocument, pagesOverview, printContainer, printResolution, optionalContentConfigPromise, l10n) {
15141
- if (activeService) {
15142
- throw new Error("The print service is created and active.");
15143
- }
15144
-
15145
- activeService = new PDFPrintService(pdfDocument, pagesOverview, printContainer, printResolution, optionalContentConfigPromise, l10n);
15146
- return activeService;
15147
- }
15148
-
15149
- };
15150
-
15151
- /***/ }),
15152
- /* 46 */
15153
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
15154
-
15155
-
15156
-
15157
- Object.defineProperty(exports, "__esModule", ({
15158
- value: true
15159
- }));
15160
- exports.getXfaHtmlForPrinting = getXfaHtmlForPrinting;
15161
-
15162
- var _ui_utils = __webpack_require__(4);
15163
-
15164
- var _xfa_layer_builder = __webpack_require__(34);
15165
-
15166
- var _pdfjsLib = __webpack_require__(5);
15167
-
15168
- function getXfaHtmlForPrinting(printContainer, pdfDocument) {
15169
- const xfaHtml = pdfDocument.allXfaHtml;
15170
- const factory = new _xfa_layer_builder.DefaultXfaLayerFactory();
15171
- const scale = Math.round(_ui_utils.CSS_UNITS * 100) / 100;
15172
-
15173
- for (const xfaPage of xfaHtml.children) {
15174
- const page = document.createElement("div");
15175
- page.className = "xfaPrintedPage";
15176
- printContainer.appendChild(page);
15177
- const builder = factory.createXfaLayerBuilder(page, null, pdfDocument.annotationStorage, xfaPage);
15178
- const viewport = (0, _pdfjsLib.getXfaPageViewport)(xfaPage, {
15179
- scale
15180
- });
15181
- builder.render(viewport, "print");
15182
- }
15183
- }
15184
-
15185
- /***/ })
15186
- /******/ ]);
15187
- /************************************************************************/
15188
- /******/ // The module cache
15189
- /******/ var __webpack_module_cache__ = {};
15190
- /******/
15191
- /******/ // The require function
15192
- /******/ function __webpack_require__(moduleId) {
15193
- /******/ // Check if module is in cache
15194
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
15195
- /******/ if (cachedModule !== undefined) {
15196
- /******/ return cachedModule.exports;
15197
- /******/ }
15198
- /******/ // Create a new module (and put it into the cache)
15199
- /******/ var module = __webpack_module_cache__[moduleId] = {
15200
- /******/ // no module.id needed
15201
- /******/ // no module.loaded needed
15202
- /******/ exports: {}
15203
- /******/ };
15204
- /******/
15205
- /******/ // Execute the module function
15206
- /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
15207
- /******/
15208
- /******/ // Return the exports of the module
15209
- /******/ return module.exports;
15210
- /******/ }
15211
- /******/
15212
- /************************************************************************/
15213
- var __webpack_exports__ = {};
15214
- // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
15215
- (() => {
15216
- var exports = __webpack_exports__;
15217
-
15218
-
15219
- Object.defineProperty(exports, "__esModule", ({
15220
- value: true
15221
- }));
15222
- Object.defineProperty(exports, "PDFViewerApplicationOptions", ({
15223
- enumerable: true,
15224
- get: function () {
15225
- return _app_options.AppOptions;
15226
- }
15227
- }));
15228
- Object.defineProperty(exports, "PDFViewerApplication", ({
15229
- enumerable: true,
15230
- get: function () {
15231
- return _app.PDFViewerApplication;
15232
- }
15233
- }));
15234
-
15235
- var _app_options = __webpack_require__(1);
15236
-
15237
- var _app = __webpack_require__(3);
15238
-
15239
- const pdfjsVersion = '2.10.377';
15240
- const pdfjsBuild = '156762c48';
15241
- window.PDFViewerApplication = _app.PDFViewerApplication;
15242
- window.PDFViewerApplicationOptions = _app_options.AppOptions;
15243
- ;
15244
- ;
15245
- {
15246
- __webpack_require__(39);
15247
- }
15248
- ;
15249
- {
15250
- __webpack_require__(45);
15251
- }
15252
-
15253
- function getViewerConfiguration() {
15254
- let errorWrapper = null;
15255
- errorWrapper = {
15256
- container: document.getElementById("errorWrapper"),
15257
- errorMessage: document.getElementById("errorMessage"),
15258
- closeButton: document.getElementById("errorClose"),
15259
- errorMoreInfo: document.getElementById("errorMoreInfo"),
15260
- moreInfoButton: document.getElementById("errorShowMore"),
15261
- lessInfoButton: document.getElementById("errorShowLess")
15262
- };
15263
- return {
15264
- appContainer: document.body,
15265
- mainContainer: document.getElementById("viewerContainer"),
15266
- viewerContainer: document.getElementById("viewer"),
15267
- eventBus: null,
15268
- toolbar: {
15269
- container: document.getElementById("toolbarViewer"),
15270
- numPages: document.getElementById("numPages"),
15271
- pageNumber: document.getElementById("pageNumber"),
15272
- scaleSelectContainer: document.getElementById("scaleSelectContainer"),
15273
- scaleSelect: document.getElementById("scaleSelect"),
15274
- customScaleOption: document.getElementById("customScaleOption"),
15275
- previous: document.getElementById("previous"),
15276
- next: document.getElementById("next"),
15277
- zoomIn: document.getElementById("zoomIn"),
15278
- zoomOut: document.getElementById("zoomOut"),
15279
- viewFind: document.getElementById("viewFind"),
15280
- openFile: document.getElementById("openFile"),
15281
- print: document.getElementById("print"),
15282
- presentationModeButton: document.getElementById("presentationMode"),
15283
- download: document.getElementById("download"),
15284
- viewBookmark: document.getElementById("viewBookmark")
15285
- },
15286
- secondaryToolbar: {
15287
- toolbar: document.getElementById("secondaryToolbar"),
15288
- toggleButton: document.getElementById("secondaryToolbarToggle"),
15289
- toolbarButtonContainer: document.getElementById("secondaryToolbarButtonContainer"),
15290
- presentationModeButton: document.getElementById("secondaryPresentationMode"),
15291
- openFileButton: document.getElementById("secondaryOpenFile"),
15292
- printButton: document.getElementById("secondaryPrint"),
15293
- downloadButton: document.getElementById("secondaryDownload"),
15294
- viewBookmarkButton: document.getElementById("secondaryViewBookmark"),
15295
- firstPageButton: document.getElementById("firstPage"),
15296
- lastPageButton: document.getElementById("lastPage"),
15297
- pageRotateCwButton: document.getElementById("pageRotateCw"),
15298
- pageRotateCcwButton: document.getElementById("pageRotateCcw"),
15299
- cursorSelectToolButton: document.getElementById("cursorSelectTool"),
15300
- cursorHandToolButton: document.getElementById("cursorHandTool"),
15301
- scrollVerticalButton: document.getElementById("scrollVertical"),
15302
- scrollHorizontalButton: document.getElementById("scrollHorizontal"),
15303
- scrollWrappedButton: document.getElementById("scrollWrapped"),
15304
- spreadNoneButton: document.getElementById("spreadNone"),
15305
- spreadOddButton: document.getElementById("spreadOdd"),
15306
- spreadEvenButton: document.getElementById("spreadEven"),
15307
- documentPropertiesButton: document.getElementById("documentProperties")
15308
- },
15309
- sidebar: {
15310
- outerContainer: document.getElementById("outerContainer"),
15311
- viewerContainer: document.getElementById("viewerContainer"),
15312
- toggleButton: document.getElementById("sidebarToggle"),
15313
- thumbnailButton: document.getElementById("viewThumbnail"),
15314
- outlineButton: document.getElementById("viewOutline"),
15315
- attachmentsButton: document.getElementById("viewAttachments"),
15316
- layersButton: document.getElementById("viewLayers"),
15317
- thumbnailView: document.getElementById("thumbnailView"),
15318
- outlineView: document.getElementById("outlineView"),
15319
- attachmentsView: document.getElementById("attachmentsView"),
15320
- layersView: document.getElementById("layersView"),
15321
- outlineOptionsContainer: document.getElementById("outlineOptionsContainer"),
15322
- currentOutlineItemButton: document.getElementById("currentOutlineItem")
15323
- },
15324
- sidebarResizer: {
15325
- outerContainer: document.getElementById("outerContainer"),
15326
- resizer: document.getElementById("sidebarResizer")
15327
- },
15328
- findBar: {
15329
- bar: document.getElementById("findbar"),
15330
- toggleButton: document.getElementById("viewFind"),
15331
- findField: document.getElementById("findInput"),
15332
- highlightAllCheckbox: document.getElementById("findHighlightAll"),
15333
- caseSensitiveCheckbox: document.getElementById("findMatchCase"),
15334
- entireWordCheckbox: document.getElementById("findEntireWord"),
15335
- findMsg: document.getElementById("findMsg"),
15336
- findResultsCount: document.getElementById("findResultsCount"),
15337
- findPreviousButton: document.getElementById("findPrevious"),
15338
- findNextButton: document.getElementById("findNext")
15339
- },
15340
- passwordOverlay: {
15341
- overlayName: "passwordOverlay",
15342
- container: document.getElementById("passwordOverlay"),
15343
- label: document.getElementById("passwordText"),
15344
- input: document.getElementById("password"),
15345
- submitButton: document.getElementById("passwordSubmit"),
15346
- cancelButton: document.getElementById("passwordCancel")
15347
- },
15348
- documentProperties: {
15349
- overlayName: "documentPropertiesOverlay",
15350
- container: document.getElementById("documentPropertiesOverlay"),
15351
- closeButton: document.getElementById("documentPropertiesClose"),
15352
- fields: {
15353
- fileName: document.getElementById("fileNameField"),
15354
- fileSize: document.getElementById("fileSizeField"),
15355
- title: document.getElementById("titleField"),
15356
- author: document.getElementById("authorField"),
15357
- subject: document.getElementById("subjectField"),
15358
- keywords: document.getElementById("keywordsField"),
15359
- creationDate: document.getElementById("creationDateField"),
15360
- modificationDate: document.getElementById("modificationDateField"),
15361
- creator: document.getElementById("creatorField"),
15362
- producer: document.getElementById("producerField"),
15363
- version: document.getElementById("versionField"),
15364
- pageCount: document.getElementById("pageCountField"),
15365
- pageSize: document.getElementById("pageSizeField"),
15366
- linearized: document.getElementById("linearizedField")
15367
- }
15368
- },
15369
- errorWrapper,
15370
- printContainer: document.getElementById("printContainer"),
15371
- openFileInputName: "fileInput",
15372
- debuggerScriptPath: "./debugger.js"
15373
- };
15374
- }
15375
-
15376
- function webViewerLoad() {
15377
- const config = getViewerConfiguration();
15378
- const event = document.createEvent("CustomEvent");
15379
- event.initCustomEvent("webviewerloaded", true, true, {
15380
- source: window
15381
- });
15382
-
15383
- try {
15384
- parent.document.dispatchEvent(event);
15385
- } catch (ex) {
15386
- console.error(`webviewerloaded: ${ex}`);
15387
- document.dispatchEvent(event);
15388
- }
15389
-
15390
- _app.PDFViewerApplication.run(config);
15391
- }
15392
-
15393
- if (document.blockUnblockOnload) {
15394
- document.blockUnblockOnload(true);
15395
- }
15396
-
15397
- if (document.readyState === "interactive" || document.readyState === "complete") {
15398
- webViewerLoad();
15399
- } else {
15400
- document.addEventListener("DOMContentLoaded", webViewerLoad, true);
15401
- }
15402
- })();
15403
-
15404
- /******/ })()
15405
- ;
15406
- //# sourceMappingURL=viewer.js.map
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
changelog.txt CHANGED
@@ -1,6 +1,11 @@
1
- = 3.3.2 - 6 December 2021 =
2
 
3
- - Fix: Plugin causing fatal error for some users
 
 
 
 
 
4
 
5
  = 3.3.1 - 6 December 2021 =
6
 
1
+ = 3.3.3 - 12 December 2021 =
2
 
3
+ - Fix: Social icon missing for viber
4
+ - Tweak: Pdf view add support for page selection
5
+
6
+ = 3.3.2 - 8 December 2021 =
7
+
8
+ - Code improvement
9
 
10
  = 3.3.1 - 6 December 2021 =
11
 
classes/assets-manager.php CHANGED
@@ -258,18 +258,11 @@ class Assets_Manager {
258
  true
259
  );
260
 
261
- // Happy addons script
262
- // wp_register_script(
263
- // 'pdf-js',
264
- // HAPPY_ADDONS_ASSETS . 'vendor/pdfjs/lib/webviewer.min.js',
265
- // [],
266
- // HAPPY_ADDONS_VERSION,
267
- // false
268
- // );
269
- // Happy addons PDF JS Express
270
  wp_register_script(
271
  'pdf-js',
272
- 'https://cdn.jsdelivr.net/npm/@pdftron/pdfjs-express@8.1.1/webviewer.min.js',
273
  [],
274
  HAPPY_ADDONS_VERSION,
275
  false
258
  true
259
  );
260
 
261
+
262
+ // Happy addons PDF JS
 
 
 
 
 
 
 
263
  wp_register_script(
264
  'pdf-js',
265
+ '//cdnjs.cloudflare.com/ajax/libs/pdfobject/2.2.7/pdfobject.min.js',
266
  [],
267
  HAPPY_ADDONS_VERSION,
268
  false
classes/extensions-manager.php CHANGED
@@ -142,7 +142,7 @@ class Extensions_Manager {
142
  ],
143
  'shape-divider' => [
144
  'title' => __( 'Shape Divider', 'happy-elementor-addons' ),
145
- 'icon' => 'hm hm-minus-large',
146
  'demo' => 'https://happyaddons.com/happy-shape-divider/',
147
  'is_pro' => false,
148
  ],
142
  ],
143
  'shape-divider' => [
144
  'title' => __( 'Shape Divider', 'happy-elementor-addons' ),
145
+ 'icon' => 'hm hm-map',
146
  'demo' => 'https://happyaddons.com/happy-shape-divider/',
147
  'is_pro' => false,
148
  ],
classes/widgets-manager.php CHANGED
@@ -985,7 +985,7 @@ class Widgets_Manager
985
  'cat' => 'creative',
986
  'is_active' => true,
987
  'title' => __('PDF View', 'happy-elementor-addons'),
988
- 'icon' => 'hm hm-lens',
989
  'css' => ['pdf'],
990
  'js' => [],
991
  'vendor' => [
985
  'cat' => 'creative',
986
  'is_active' => true,
987
  'title' => __('PDF View', 'happy-elementor-addons'),
988
+ 'icon' => 'hm hm-file',
989
  'css' => ['pdf'],
990
  'js' => [],
991
  'vendor' => [
plugin.php CHANGED
@@ -4,11 +4,11 @@
4
  * Plugin Name: Happy Elementor Addons
5
  * Plugin URI: https://happyaddons.com/
6
  * Description: <a href="https://happyaddons.com/">Happy Addons for Elementor</a> Is the Best Elementor Addons Comes With 44+ Free Elementor Widgets Including Table Builder, Testimonial, Event Calendar,Slider,News Ticker, Image Grid, etc & Features Like Elementor Equal Height, Text Stroke, Shape Dividers, Floating Effect, Grid Layout, 500+ Elementor Icons, 450+ Template Packs & More.
7
- * Version: 3.3.2
8
  * Author: weDevs
9
  * Author URI: https://happyaddons.com/
10
  * Elementor tested up to: 3.4.8
11
- * Elementor Pro tested up to: 3.5.1
12
  * License: GPLv2
13
  * License URI: https://www.gnu.org/licenses/gpl-2.0.html
14
  * Text Domain: happy-elementor-addons
@@ -37,7 +37,7 @@ Copyright 2019 HappyMonster <http://happymonster.me>
37
 
38
  defined('ABSPATH') || die();
39
 
40
- define('HAPPY_ADDONS_VERSION', '3.3.2');
41
  define('HAPPY_ADDONS__FILE__', __FILE__);
42
  define('HAPPY_ADDONS_DIR_PATH', plugin_dir_path(HAPPY_ADDONS__FILE__));
43
  define('HAPPY_ADDONS_DIR_URL', plugin_dir_url(HAPPY_ADDONS__FILE__));
4
  * Plugin Name: Happy Elementor Addons
5
  * Plugin URI: https://happyaddons.com/
6
  * Description: <a href="https://happyaddons.com/">Happy Addons for Elementor</a> Is the Best Elementor Addons Comes With 44+ Free Elementor Widgets Including Table Builder, Testimonial, Event Calendar,Slider,News Ticker, Image Grid, etc & Features Like Elementor Equal Height, Text Stroke, Shape Dividers, Floating Effect, Grid Layout, 500+ Elementor Icons, 450+ Template Packs & More.
7
+ * Version: 3.3.3
8
  * Author: weDevs
9
  * Author URI: https://happyaddons.com/
10
  * Elementor tested up to: 3.4.8
11
+ * Elementor Pro tested up to: 3.5.2
12
  * License: GPLv2
13
  * License URI: https://www.gnu.org/licenses/gpl-2.0.html
14
  * Text Domain: happy-elementor-addons
37
 
38
  defined('ABSPATH') || die();
39
 
40
+ define('HAPPY_ADDONS_VERSION', '3.3.3');
41
  define('HAPPY_ADDONS__FILE__', __FILE__);
42
  define('HAPPY_ADDONS_DIR_PATH', plugin_dir_path(HAPPY_ADDONS__FILE__));
43
  define('HAPPY_ADDONS_DIR_URL', plugin_dir_url(HAPPY_ADDONS__FILE__));
readme.txt CHANGED
@@ -1,6 +1,6 @@
1
- === Happy Addons for Elementor ===
2
- Plugin Name: Happy Addons for Elementor (Mega Menu, Testimonial, Tooltip, Post Grid, Woocommerce Product Grid, Table, Event Calendar, Slider Elementor Widget)
3
- Version: 3.3.2
4
  Author: weDevs
5
  Author URI: https://happyaddons.com/
6
  Contributors: happyaddons, thehappymonster, wedevs
@@ -12,15 +12,14 @@ Requires PHP: 5.4
12
  License: GPLv2
13
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
14
 
15
- [Happy Addons for Elementor](https://happyaddons.com/) Is the Best Elementor Addons Comes With 44+ Free Elementor Widgets Including Table Builder, Testimonial, Event Calendar,Slider,News Ticker, Image Grid, etc & Features Like Elementor Equal Height, Text Stroke, Shape Dividers, Floating Effect, Grid Layout, 500+ Elementor Icons, 450+ Template Packs & More.
16
 
 
17
 
18
- ## **Description**
19
 
20
- [Happy Addons for Elementor page builder](https://happyaddons.com/) Is One of the Best Elementor Addons That Comes With **90+ Elementor Free & Pro Widgets and 20+ Problem-Solving Elementor Features**. And HappyAddons Elementor widgets are not limited to customizations. All the Elementor widget is stand out from other third-party elementor addons widgets in terms of flexibility of customizations. Also, we are not locking the features of Elementor widgets in the free versions. All the free Elementor widgets are like our premium elementor widgets. HappyAddons for Elementor (**Mega Menu Builder, Elementor Template, Post Grid, Woocommerce Product Grid, Table, Tooltips, Slider Elementor Widget**) will broaden your elementor related designing skills. Our **70+ full-page Elementor Templates and 400+ readymade elementor blocks** will help you to kickstart your works swiftly. So try Happy Elementor Addon to create amazing Elementor Websites.
21
 
22
-
23
- ### **WHY SHOULD YOU CHOOSE HAPPYADDONS FOR ELEMENTOR?**
24
 
25
  HappyAddons is the pioneer of adding exclusive problem-solving Elementor features. Also, we have added premium quality Elementor Widgets in the Elementor Widget Library. Reasons for choosing Happyaddons over any other Elementor Addons:
26
 
@@ -47,16 +46,16 @@ HappyAddons is the pioneer of adding exclusive problem-solving Elementor feature
47
  19. Unfold any elementor element with HappyAddons Elementor unfold widget
48
  20. Toggle your content with the Elementor content switcher widget.
49
  21. 500+ elementor line icons for your elementor sites.
50
- 22. 400+ Readymade Elementor Template Kits to Use,
51
  23. Moreover, You Can Copy Happy Elementor Addons Demo Contents Directly from Our [demo site](https://demo.happyaddons.com/) and much more.
52
  24. Officially recommended by Elementor Page Builder! We are now listed on their [official addons page](https://elementor.com/addons/).
53
  25. This Elementor Page Builder Addon is the latest addition to the list of [weDevs](https://wedevs.com/) premium product libraries. **weDevs is famous for reliable after-sales service**.
54
 
55
- ###
56
- **WHAT YOU WILL GET IN HAPPY ELEMENTOR ADDONS FREE VERSION**
57
 
58
 
59
- **44 Free Elementor Widgets Are Available in the HappyAddons Free**
60
 
61
  HappyAddons comes with plenty of Elementor Widgets in the free version. And all of the elementor widgets are full of customization. Also, we have created elementor design inspiration for each and every single elementor widget. Let’s have a look at what you will get in our free version of HappyAddons for Elementor:
62
 
@@ -104,6 +103,9 @@ Our elementor card widget will help you to create mesmerizing card items within
104
  * **[Creative Button](https://demo.happyaddons.com/elementor-creative-button-demo/)** – Are you wondering about creating an outstanding, eye-catching look by adding exclusive button styles & effects to your website? Create a marvelous Call To Action through HappyAddons Creative Buttons Elementor Widget and redirect visitors to the right place. There is now a limitation to creating amazing buttons for your Elementor website. Also, the team happy elementor addons added the magnetic effect to the elementor creative button. So that you can grab your elementor website’s visitor’s attention to click the elementor creative button. And don’t forget to check the demo of the elementor creative button widget, created by the team happy elementor addons.
105
  * **[Image Accordion](https://demo.happyaddons.com/elementor-image-accordion-demo/)** – HappyAddons Image Accordion widget for Elementor comes with interactive design looks. You can create unique accordions for images. It will help you keep your users longer on the website. Sometimes you will need to show some amazing interactive image accordions to your elementor website to create a wow effect for the visitors, then the Happy Elementor addons image accordion elementor widget will be the life savior for you. As you can add an amazing effect to the images by using the happy elementor addons image accordion elementor widget. Don’t forget to check the demos of the Elementor Image Accordion, created by the team Happy Elementor Addons. And after that try Happy Elementor Addons Image Accordion Elementor Widget.
106
  * **[Contact Form 7](https://demo.happyaddons.com/elementor-contact-form-7-widget-demo/)** – This utility widget helps you to integrate existing forms built using the CF7 plugin across your web pages without spending too much time. It’s tough to manage the default contact form 7 without using any CSS. But Team Happy elementor Addons added all kinds of designing facilities to the contact form 7. Happy Addons for elementor added a free elementor contact form 7 widget to the elementor widget library. You can easily embed your contact form 7 at any place on your Elementor website. Also, you have the facility to customize the contact form 7 elementor widget. You don’t need the knowledge of CSS to customize your contact form 7 forms if you use the Happy Elementor Addons contact form 7 widget. And it comes in the free version of the HappyAddons for elementor.
 
 
 
107
  * **[Caldera Forms](https://demo.happyaddons.com/elementor-caldera-forms-widget-demo/)** – This widget can help you to display your caldera forms to display on your web pages designed with Elementor. By default, the design customization of the caldera form is quite tough. You have to be an expert in CSS. But team Happy Elementor Addons solve the problem. Now you can customize your caldera form by using the Happy Addons caldera form elementor widget. It’s free to use. Before using elementor caldera form widget you can check the demos created by team Happy Elementor Addons.
108
  * **[weForms](https://demo.happyaddons.com/elementor-we-forms-widget-demo/)** – Designed forms using the weForms plugin and looking for a way to display those on your Elementor powered pages? This is the answer to that. You can now use the Happy elementor addons weForms widget for elementor to customize your weForms forms without leaving your elementor website. Check the demos of the Elementor weForms widget created by the team Happy Elementor Addons.
109
  * **[Ninja Forms](https://demo.happyaddons.com/elementor-ninja-form-widget-demo/)** – Use this widget to embed forms created using Ninja Forms to display seamlessly on your web pages. Various styling options will help you to look at them even better. Ninja Forms is one of the popular form builder plugins. But you have to pay extra for having the customization feature in the default version of Ninja forms. But the team Happy Elementor Addons comes with an easy solution for Ninja Forms users. You will get a Ninja form elementor widget for free in the Happy Addons for elementor. We have added every possible customization facility to the Elementor Ninja Forms widget. You can check the demo from the happy elementor addons demo page.
@@ -141,7 +143,7 @@ The team Happy Elementor Addons comes with Full Page Elementor Templates. You wi
141
 
142
  – HappyAddons Gradient Heading Widget
143
 
144
- Here are some design inspirations for you. **[Demo](https://demo.happyaddons.com/text-outline/)**
145
 
146
  If you are looking for the awesome handy tool (Elementor Text Outline)to make a difference in your elementor website then don’t miss out on the chance to try it free as this Elementor Text Outline feature comes with the free version of the Happy Elementor Addons. And the Elementor Text outline feature is a very lightweight Elementor feature to create amazing design aspects within your elementor website.
147
 
@@ -149,7 +151,7 @@ If you are looking for the awesome handy tool (Elementor Text Outline)to make a
149
 
150
  **[Happy Icons](https://happyaddons.com/happy-icon/)** – This will help you embellish your web page with an army of free happy elementor line icons. To do so, you have to choose a widget that supports happy elementor line icons. Currently, the custom fonts library contains 500+ icons. Usually, you will get font awesome icon library with your elementor icon pack. But the line icons are now trendy. You can add line icons to every possible icon-supported elementor widget. HappyAddons elementor line icons come with the free version of Happy Elementor addons. So that you can use these Happy line icons to HappyAddons free and Happy elementor addons pro. It will reduce your pain to upload SVG icons each and every time. Don’t miss out on the chance to make your elementor site a different one from the regular font awesome using Elementor Website.
151
 
152
- **[Managing Column Order on Mobile Responsive Mood ](https://happyaddons.com/happy-column-control/)**– Your designed elementor web page may contain some columns that may require reorder in the mobile device view. By using the Happy Elementor Addons, you can rearrange the order of the column. It’s very easy to use. You don’t need any extra knowledge to order your columns on mobile and tablet devices. Actually, you have to just set the number chronologically to the column ordering feature of the HappyAddons. It will help you to get the desired column order in the small screen of the elementor sites.
153
 
154
  **[Manage Column Width by Adding Pixels](https://happyaddons.com/happy-column-control/)** – You can control the column width of your widgets with percentage parameters in Elementor. However, sometimes, you need to adjust the column width to meet your design aesthetics. The Happy Elementor Addons will let you do so with ease.
155
 
@@ -163,13 +165,13 @@ If you are looking for the awesome handy tool (Elementor Text Outline)to make a
163
 
164
  **[Floating Effects](https://happyaddons.com/elementor-floating-effect-demo-2/)** – Now you can create stunning animations for any Elementor widget using Floating Effects. Translate, Rotate, or Scale Imagination is the limit! HappyAddons floating effect will help you to Translate, Rotate or Scale any elements and elementor widgets without using CSS directly. Don’t miss the chance to make eye-catchy design elements to your WordPress elementor website.
165
 
166
- [https://youtu.be/LmtacsLcFPU](https://youtu.be/LmtacsLcFPU)
167
 
168
- **Floating Effects used for Space effect illustration: **
169
 
170
  With the help of the Happy elementor addons floating effect extension, you can create this kind of amazing Space effect.
171
 
172
- [https://youtu.be/F33g3zqkeog](https://youtu.be/F33g3zqkeog)
173
 
174
  **[CSS Transform](https://happyaddons.com/elementor-css-transform-demo-3/)** – Another missing piece, a great enhancement over core Elementor that works seamlessly with every widget. You can now apply various CSS transforms like translate, rotate, scale and skew without any limitations within any Elementor Widget also with any other third-party elementor addons. It’s a global feature of elementor created by Happy Addons for elementor. Don’t miss the chance to use the Happy Elementor addons CSS transform elementor module to create an extraordinary look for your elementor website.
175
 
@@ -178,12 +180,12 @@ With the help of the Happy elementor addons floating effect extension, you can c
178
 
179
  The Happy Elementor Addons ships not only with some unique premium features but also with premium widgets. The premium features are 100% unique and exclusive and the premium widgets are there to give you professional assistance to craft any design of your webpage.
180
 
181
- [https://youtu.be/QwJrFMtfO2U](https://youtu.be/QwJrFMtfO2U)
182
 
183
  _Introducing Happy Addons Pro (Check What You Will Get in the Pro Version of Happyaddons)_
184
 
185
 
186
- ### **** 46 PREMIUM ELEMENTOR WIDGETS OF HAPPY ADDONS FOR ELEMENTOR (PRO)****
187
 
188
  If you are still craving more Elementor widgets, then the following premium elementor widgets are there to quench your thirst. The best part is that you can copy and paste the design source code so you won’t have to make any design from scratch. Let’s explore the world of Happy Elementor Addons Pro Widgets:
189
 
@@ -262,7 +264,7 @@ With this Happy mega menu builder elementor widget, you can create any kind of m
262
 
263
  Want to learn How to Create a MegaMenu for Elementor? Watch this detailed tutorial of creating mega menus within Elementor,
264
 
265
- [https://youtu.be/7qmCZFsDkmg](https://youtu.be/7qmCZFsDkmg)
266
 
267
 
268
  ### **CROSS-DOMAIN COPY-PASTE: APPLY THE SAME DESIGN TO MULTIPLE DOMAINS WITH A SINGLE CLICK**
@@ -311,7 +313,7 @@ Sometimes, a square or circular-shaped image is not enough to create a good desi
311
 
312
  [Check Demo](https://happyaddons.com/image-masking-demo/)
313
 
314
- [https://youtu.be/0U3wq3oxy2k](https://youtu.be/0U3wq3oxy2k)
315
 
316
 
317
  ### **HAPPY PARTICLE EFFECT: ADD EXCLUSIVE BACKGROUND PARTICLE EFFECTS TO YOUR WEBSITE!**
@@ -320,7 +322,7 @@ Team, happy elementor addons has added three predefined particle effects, which
320
 
321
  [Check Demo](https://demo.happyaddons.com/happy-particle-demo/)
322
 
323
- [https://youtu.be/iD83Sr4pFSw](https://youtu.be/iD83Sr4pFSw)
324
 
325
 
326
  ### **DISPLAY CONDITION: SHOW, HIDE AND SCHEDULE CONTENT TO DISPLAY ON YOUR SITE ACCORDING TO YOUR NEED!**
@@ -329,7 +331,7 @@ This feature will help you to display your content depending on different kinds
329
 
330
  [Check Demo](https://happyaddons.com/display-condition/)
331
 
332
- [https://youtu.be/kiGj1ZyX6T4](https://youtu.be/kiGj1ZyX6T4)
333
 
334
 
335
  ### **ENJOY EXTRA BENEFITS FROM HAPPY ELEMENTOR ADDONS!**
@@ -435,9 +437,14 @@ For a more detailed explanation check out the following documentation
435
 
436
  == Changelog ==
437
 
438
- = 3.3.2 - 6 December 2021 =
 
 
 
 
 
439
 
440
- - Fix: Plugin causing fatal error for some users
441
 
442
  = 3.3.1 - 6 December 2021 =
443
 
1
+ === Happy Addons for Elementor (Mega Menu, Post Grid, Woocommerce Product Grid, Table, Event Calendar, Slider Elementor Widget) ===
2
+ Plugin Name: Happy Addons for Elementor (Mega Menu, Post Grid, Woocommerce Product Grid, Table, Event Calendar, Slider Elementor Widget)
3
+ Version: 3.3.3
4
  Author: weDevs
5
  Author URI: https://happyaddons.com/
6
  Contributors: happyaddons, thehappymonster, wedevs
12
  License: GPLv2
13
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
14
 
15
+ [Happy Addons for Elementor](https://happyaddons.com/) Is the Best Elementor Addons Comes With 48+ Free Elementor Widgets Including Table Builder, Testimonial, Event Calendar,Slider,News Ticker, Image Grid, etc & Features Like Elementor Equal Height, Text Stroke, Shape Dividers, Floating Effect, Grid Layout, 500+ Elementor Icons, 450+ Template Packs & More.
16
 
17
+ == Description ==
18
 
19
+ [Happy Addons for Elementor page builder](https://happyaddons.com/) Is One of the Best Elementor Addons That Comes With **97+ Elementor Free & Pro Widgets and 20+ Problem-Solving Elementor Features**. And HappyAddons Elementor widgets are not limited to customizations. All the Elementor widget is stand out from other third-party elementor addons widgets in terms of flexibility of customizations. Also, we are not locking the features of Elementor widgets in the free versions. All the free Elementor widgets are like our premium elementor widgets. HappyAddons for Elementor (**Mega Menu Builder, Elementor Template, Post Grid, Woocommerce Product Grid, Table, Tooltips, Slider Elementor Widget**) will broaden your elementor related designing skills. Our **70+ full-page Elementor Templates and 400+ readymade elementor blocks** will help you to kickstart your works swiftly. So try Happy Elementor Addon to create amazing Elementor Websites.
20
 
 
21
 
22
+ **WHY SHOULD YOU CHOOSE HAPPYADDONS FOR ELEMENTOR?**
 
23
 
24
  HappyAddons is the pioneer of adding exclusive problem-solving Elementor features. Also, we have added premium quality Elementor Widgets in the Elementor Widget Library. Reasons for choosing Happyaddons over any other Elementor Addons:
25
 
46
  19. Unfold any elementor element with HappyAddons Elementor unfold widget
47
  20. Toggle your content with the Elementor content switcher widget.
48
  21. 500+ elementor line icons for your elementor sites.
49
+ 22. 450+ Readymade Elementor Template Kits to Use,
50
  23. Moreover, You Can Copy Happy Elementor Addons Demo Contents Directly from Our [demo site](https://demo.happyaddons.com/) and much more.
51
  24. Officially recommended by Elementor Page Builder! We are now listed on their [official addons page](https://elementor.com/addons/).
52
  25. This Elementor Page Builder Addon is the latest addition to the list of [weDevs](https://wedevs.com/) premium product libraries. **weDevs is famous for reliable after-sales service**.
53
 
54
+
55
+ **WHAT YOU WILL GET IN HAPPY ELEMENTOR ADDONS FREE VERSION**
56
 
57
 
58
+ **48 Free Elementor Widgets Are Available in the HappyAddons Free**
59
 
60
  HappyAddons comes with plenty of Elementor Widgets in the free version. And all of the elementor widgets are full of customization. Also, we have created elementor design inspiration for each and every single elementor widget. Let’s have a look at what you will get in our free version of HappyAddons for Elementor:
61
 
103
  * **[Creative Button](https://demo.happyaddons.com/elementor-creative-button-demo/)** – Are you wondering about creating an outstanding, eye-catching look by adding exclusive button styles & effects to your website? Create a marvelous Call To Action through HappyAddons Creative Buttons Elementor Widget and redirect visitors to the right place. There is now a limitation to creating amazing buttons for your Elementor website. Also, the team happy elementor addons added the magnetic effect to the elementor creative button. So that you can grab your elementor website’s visitor’s attention to click the elementor creative button. And don’t forget to check the demo of the elementor creative button widget, created by the team happy elementor addons.
104
  * **[Image Accordion](https://demo.happyaddons.com/elementor-image-accordion-demo/)** – HappyAddons Image Accordion widget for Elementor comes with interactive design looks. You can create unique accordions for images. It will help you keep your users longer on the website. Sometimes you will need to show some amazing interactive image accordions to your elementor website to create a wow effect for the visitors, then the Happy Elementor addons image accordion elementor widget will be the life savior for you. As you can add an amazing effect to the images by using the happy elementor addons image accordion elementor widget. Don’t forget to check the demos of the Elementor Image Accordion, created by the team Happy Elementor Addons. And after that try Happy Elementor Addons Image Accordion Elementor Widget.
105
  * **[Contact Form 7](https://demo.happyaddons.com/elementor-contact-form-7-widget-demo/)** – This utility widget helps you to integrate existing forms built using the CF7 plugin across your web pages without spending too much time. It’s tough to manage the default contact form 7 without using any CSS. But Team Happy elementor Addons added all kinds of designing facilities to the contact form 7. Happy Addons for elementor added a free elementor contact form 7 widget to the elementor widget library. You can easily embed your contact form 7 at any place on your Elementor website. Also, you have the facility to customize the contact form 7 elementor widget. You don’t need the knowledge of CSS to customize your contact form 7 forms if you use the Happy Elementor Addons contact form 7 widget. And it comes in the free version of the HappyAddons for elementor.
106
+ * **[PDF View Elementor Widget](https://demo.happyaddons.com/elementor-pdf-view-widget-demo/)** - If you are looking for a PDF embedder or PDF Viewer WordPress plugin for your website to embed your PDF files, you are in the right place. Happy Elementor Addons comes with the ultimate PDF embedder solution for you. We have added Elementor PDF View Widget, a new Elementor widget in the Happy Elementor Free Version 3.3.1. We are the pioneer in the Elementor Addons community who have added a PDF view Elementor widget in the Elementor Widget Library. \
107
+ \
108
+ Using the Happy Elementor Addons PDF View widget for Elementor, you can embed or view PDF files from external links or upload them directly to your website as PDF Media File. Also, in this Elementor PDF View widget, you will get plenty of customization options. Now you can show Resume PDF, Invoice PDF, Ebook PDF version, Magazine PDF version, and more with the help of the PDF View Elementor Widget by Happy Elementor Addons.
109
  * **[Caldera Forms](https://demo.happyaddons.com/elementor-caldera-forms-widget-demo/)** – This widget can help you to display your caldera forms to display on your web pages designed with Elementor. By default, the design customization of the caldera form is quite tough. You have to be an expert in CSS. But team Happy Elementor Addons solve the problem. Now you can customize your caldera form by using the Happy Addons caldera form elementor widget. It’s free to use. Before using elementor caldera form widget you can check the demos created by team Happy Elementor Addons.
110
  * **[weForms](https://demo.happyaddons.com/elementor-we-forms-widget-demo/)** – Designed forms using the weForms plugin and looking for a way to display those on your Elementor powered pages? This is the answer to that. You can now use the Happy elementor addons weForms widget for elementor to customize your weForms forms without leaving your elementor website. Check the demos of the Elementor weForms widget created by the team Happy Elementor Addons.
111
  * **[Ninja Forms](https://demo.happyaddons.com/elementor-ninja-form-widget-demo/)** – Use this widget to embed forms created using Ninja Forms to display seamlessly on your web pages. Various styling options will help you to look at them even better. Ninja Forms is one of the popular form builder plugins. But you have to pay extra for having the customization feature in the default version of Ninja forms. But the team Happy Elementor Addons comes with an easy solution for Ninja Forms users. You will get a Ninja form elementor widget for free in the Happy Addons for elementor. We have added every possible customization facility to the Elementor Ninja Forms widget. You can check the demo from the happy elementor addons demo page.
143
 
144
  – HappyAddons Gradient Heading Widget
145
 
146
+ Here are some design inspirations for you. **[Demo](https://demo.happyaddons.com/text-outline/)**
147
 
148
  If you are looking for the awesome handy tool (Elementor Text Outline)to make a difference in your elementor website then don’t miss out on the chance to try it free as this Elementor Text Outline feature comes with the free version of the Happy Elementor Addons. And the Elementor Text outline feature is a very lightweight Elementor feature to create amazing design aspects within your elementor website.
149
 
151
 
152
  **[Happy Icons](https://happyaddons.com/happy-icon/)** – This will help you embellish your web page with an army of free happy elementor line icons. To do so, you have to choose a widget that supports happy elementor line icons. Currently, the custom fonts library contains 500+ icons. Usually, you will get font awesome icon library with your elementor icon pack. But the line icons are now trendy. You can add line icons to every possible icon-supported elementor widget. HappyAddons elementor line icons come with the free version of Happy Elementor addons. So that you can use these Happy line icons to HappyAddons free and Happy elementor addons pro. It will reduce your pain to upload SVG icons each and every time. Don’t miss out on the chance to make your elementor site a different one from the regular font awesome using Elementor Website.
153
 
154
+ **[Managing Column Order on Mobile Responsive Mood ](https://happyaddons.com/happy-column-control/)** Your designed elementor web page may contain some columns that may require reorder in the mobile device view. By using the Happy Elementor Addons, you can rearrange the order of the column. It’s very easy to use. You don’t need any extra knowledge to order your columns on mobile and tablet devices. Actually, you have to just set the number chronologically to the column ordering feature of the HappyAddons. It will help you to get the desired column order in the small screen of the elementor sites.
155
 
156
  **[Manage Column Width by Adding Pixels](https://happyaddons.com/happy-column-control/)** – You can control the column width of your widgets with percentage parameters in Elementor. However, sometimes, you need to adjust the column width to meet your design aesthetics. The Happy Elementor Addons will let you do so with ease.
157
 
165
 
166
  **[Floating Effects](https://happyaddons.com/elementor-floating-effect-demo-2/)** – Now you can create stunning animations for any Elementor widget using Floating Effects. Translate, Rotate, or Scale Imagination is the limit! HappyAddons floating effect will help you to Translate, Rotate or Scale any elements and elementor widgets without using CSS directly. Don’t miss the chance to make eye-catchy design elements to your WordPress elementor website.
167
 
168
+ [youtube https://www.youtube.com/watch?v=LmtacsLcFPU&ab_channel=HappyAddons]
169
 
170
+ ### Floating Effects used for Space effect illustration:
171
 
172
  With the help of the Happy elementor addons floating effect extension, you can create this kind of amazing Space effect.
173
 
174
+ [youtube https://www.youtube.com/watch?v=F33g3zqkeog&ab_channel=HappyAddons]
175
 
176
  **[CSS Transform](https://happyaddons.com/elementor-css-transform-demo-3/)** – Another missing piece, a great enhancement over core Elementor that works seamlessly with every widget. You can now apply various CSS transforms like translate, rotate, scale and skew without any limitations within any Elementor Widget also with any other third-party elementor addons. It’s a global feature of elementor created by Happy Addons for elementor. Don’t miss the chance to use the Happy Elementor addons CSS transform elementor module to create an extraordinary look for your elementor website.
177
 
180
 
181
  The Happy Elementor Addons ships not only with some unique premium features but also with premium widgets. The premium features are 100% unique and exclusive and the premium widgets are there to give you professional assistance to craft any design of your webpage.
182
 
183
+ [youtube https://www.youtube.com/watch?v=QwJrFMtfO2U&ab_channel=HappyAddons]
184
 
185
  _Introducing Happy Addons Pro (Check What You Will Get in the Pro Version of Happyaddons)_
186
 
187
 
188
+ ### 46 PREMIUM ELEMENTOR WIDGETS OF HAPPY ADDONS FOR ELEMENTOR (PRO)
189
 
190
  If you are still craving more Elementor widgets, then the following premium elementor widgets are there to quench your thirst. The best part is that you can copy and paste the design source code so you won’t have to make any design from scratch. Let’s explore the world of Happy Elementor Addons Pro Widgets:
191
 
264
 
265
  Want to learn How to Create a MegaMenu for Elementor? Watch this detailed tutorial of creating mega menus within Elementor,
266
 
267
+ [youtube https://www.youtube.com/watch?v=7qmCZFsDkmg&ab_channel=HappyAddons]
268
 
269
 
270
  ### **CROSS-DOMAIN COPY-PASTE: APPLY THE SAME DESIGN TO MULTIPLE DOMAINS WITH A SINGLE CLICK**
313
 
314
  [Check Demo](https://happyaddons.com/image-masking-demo/)
315
 
316
+ [youtube https://www.youtube.com/watch?v=0U3wq3oxy2k&t=2s&ab_channel=HappyAddons]
317
 
318
 
319
  ### **HAPPY PARTICLE EFFECT: ADD EXCLUSIVE BACKGROUND PARTICLE EFFECTS TO YOUR WEBSITE!**
322
 
323
  [Check Demo](https://demo.happyaddons.com/happy-particle-demo/)
324
 
325
+ [youtube https://www.youtube.com/watch?v=iD83Sr4pFSw&ab_channel=HappyAddons]
326
 
327
 
328
  ### **DISPLAY CONDITION: SHOW, HIDE AND SCHEDULE CONTENT TO DISPLAY ON YOUR SITE ACCORDING TO YOUR NEED!**
331
 
332
  [Check Demo](https://happyaddons.com/display-condition/)
333
 
334
+ [youtube https://www.youtube.com/watch?v=kiGj1ZyX6T4&ab_channel=HappyAddons]
335
 
336
 
337
  ### **ENJOY EXTRA BENEFITS FROM HAPPY ELEMENTOR ADDONS!**
437
 
438
  == Changelog ==
439
 
440
+ = 3.3.3 - 12 December 2021 =
441
+
442
+ - Fix: Social icon missing for viber
443
+ - Tweak: Pdf view add support for page selection
444
+
445
+ = 3.3.2 - 8 December 2021 =
446
 
447
+ - Code improvement
448
 
449
  = 3.3.1 - 6 December 2021 =
450
 
widgets/image-grid/widget.php CHANGED
@@ -758,6 +758,16 @@ class Image_Grid extends Base {
758
  return compact( 'menu', 'items' );
759
  }
760
 
 
 
 
 
 
 
 
 
 
 
761
  protected function render() {
762
  $settings = $this->get_settings_for_display();
763
  $gallery = $this->get_gallery_data();
@@ -766,6 +776,11 @@ class Image_Grid extends Base {
766
  return;
767
  }
768
 
 
 
 
 
 
769
  $this->add_render_attribute( 'grid_wrap', 'class', 'ha-image-grid__wrap hajs-isotope' );
770
 
771
  if ( \Elementor\Plugin::$instance->editor->is_edit_mode() ) {
758
  return compact( 'menu', 'items' );
759
  }
760
 
761
+ protected function image_missing_alert() {
762
+ if( ha_elementor()->editor ){
763
+ printf(
764
+ '<div %s>%s</div>',
765
+ 'style="margin: 1rem;padding: 1rem 1.25rem;border-left: 5px solid #f5c848;color: #856404;background-color: #fff3cd;"',
766
+ __( 'Please select an image first to render the grid properly', 'happy-elementor-addons' )
767
+ );
768
+ }
769
+ }
770
+
771
  protected function render() {
772
  $settings = $this->get_settings_for_display();
773
  $gallery = $this->get_gallery_data();
776
  return;
777
  }
778
 
779
+ if ( count( $gallery['items'] ) <= 0 ) {
780
+ $this->image_missing_alert();
781
+ return;
782
+ }
783
+
784
  $this->add_render_attribute( 'grid_wrap', 'class', 'ha-image-grid__wrap hajs-isotope' );
785
 
786
  if ( \Elementor\Plugin::$instance->editor->is_edit_mode() ) {
widgets/justified-gallery/widget.php CHANGED
@@ -830,6 +830,16 @@ class Justified_Gallery extends Base {
830
  return compact( 'menu', 'items' );
831
  }
832
 
 
 
 
 
 
 
 
 
 
 
833
  protected function render() {
834
  $settings = $this->get_settings_for_display();
835
  $gallery = $this->get_gallery_data();
@@ -838,6 +848,11 @@ class Justified_Gallery extends Base {
838
  return;
839
  }
840
 
 
 
 
 
 
841
  $this->add_render_attribute( 'grid_wrap', 'class', [
842
  'ha-justified-grid__wrap',
843
  'hajs-justified-grid',
830
  return compact( 'menu', 'items' );
831
  }
832
 
833
+ protected function image_missing_alert() {
834
+ if( ha_elementor()->editor ){
835
+ printf(
836
+ '<div %s>%s</div>',
837
+ 'style="margin: 1rem;padding: 1rem 1.25rem;border-left: 5px solid #f5c848;color: #856404;background-color: #fff3cd;"',
838
+ __( 'Please select an image first to render the grid properly', 'happy-elementor-addons' )
839
+ );
840
+ }
841
+ }
842
+
843
  protected function render() {
844
  $settings = $this->get_settings_for_display();
845
  $gallery = $this->get_gallery_data();
848
  return;
849
  }
850
 
851
+ if ( count( $gallery['items'] ) <= 0 ) {
852
+ $this->image_missing_alert();
853
+ return;
854
+ }
855
+
856
  $this->add_render_attribute( 'grid_wrap', 'class', [
857
  'ha-justified-grid__wrap',
858
  'hajs-justified-grid',
widgets/pdf-view/widget.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Photo Stack widget class
4
  *
5
  * @package Happy_Addons
6
  */
@@ -43,7 +43,7 @@ class PDF_View extends Base {
43
  * @return string Widget icon.
44
  */
45
  public function get_icon() {
46
- return 'hm hm-slider-doc';
47
  }
48
 
49
  public function get_keywords() {
@@ -67,45 +67,7 @@ class PDF_View extends Base {
67
  ]
68
  );
69
 
70
- $this->add_control(
71
- 'pdf_view_type',
72
- [
73
- 'label' => __( 'PDFjs View', 'happy-elementor-addons' ),
74
- 'type' => Controls_Manager::SWITCHER,
75
- 'label_on' => __( 'Yes', 'happy-elementor-addons' ),
76
- 'label_off' => __( 'No', 'happy-elementor-addons' ),
77
- 'return_value' => 'yes',
78
- 'default' => '',
79
- ]
80
- );
81
-
82
- $this->add_control(
83
- 'important_note',
84
- [
85
- 'label' => __( 'Important Note', 'happy-elementor-addons' ),
86
- 'type' => Controls_Manager::RAW_HTML,
87
- 'raw' => __( 'To show PDF file in PDFjs.express. please signup and get free license key. <a target="_blank" href="https://pdfjs.express/signup">Sign up</a>', 'happy-elementor-addons' ),
88
- 'content_classes' => 'elementor-control-field-description',
89
- 'condition' => [
90
- 'pdf_view_type' => 'yes',
91
- ]
92
-
93
- ]
94
- );
95
-
96
- $this->add_control(
97
- 'pdf_license',
98
- [
99
- 'label' => __( 'PDFjs.express License', 'happy-elementor-addons' ),
100
- 'type' => Controls_Manager::TEXT,
101
- 'label_block' => true,
102
- 'placeholder' => __( 'MBgnIWi14J', 'happy-elementor-addons' ),
103
- 'condition' => [
104
- 'pdf_view_type' => 'yes',
105
- ]
106
-
107
- ]
108
- );
109
 
110
  $this->add_control(
111
  'file_type',
@@ -116,10 +78,7 @@ class PDF_View extends Base {
116
  'url' => __('URL', 'happy-elementor-addons'),
117
  'upload_file' => __('Upload File', 'happy-elementor-addons'),
118
  ],
119
- 'default' => 'url',
120
- 'condition' => [
121
- 'pdf_view_type' => '',
122
- ]
123
  ]
124
  );
125
 
@@ -130,26 +89,14 @@ class PDF_View extends Base {
130
  'type' => Controls_Manager::URL,
131
  'placeholder' => __( 'http://www.example.com/sample.pdf', 'happy-elementor-addons'),
132
  'default' => [
133
- 'url' => 'http://www.pdf995.com/samples/pdf.pdf'
134
  ],
135
  'show_external' => false,
136
  'dynamic' => [
137
  'active' => false,
138
  ],
139
- 'conditions' => [
140
- 'relation' => 'and',
141
- 'terms' => [
142
- [
143
- 'name' => 'pdf_view_type',
144
- 'operator' => '==',
145
- 'value' => '',
146
- ],
147
- [
148
- 'name' => 'file_type',
149
- 'operator' => '==',
150
- 'value' => 'url',
151
- ],
152
- ],
153
  ],
154
  ]
155
  );
@@ -166,23 +113,20 @@ class PDF_View extends Base {
166
  'dynamic' => [
167
  'active' => true,
168
  ],
169
- 'conditions' => [
170
- 'relation' => 'or',
171
- 'terms' => [
172
- [
173
- 'name' => 'pdf_view_type',
174
- 'operator' => '==',
175
- 'value' => 'yes',
176
- ],
177
- [
178
- 'name' => 'file_type',
179
- 'operator' => '==',
180
- 'value' => 'upload_file',
181
- ],
182
- ],
183
  ],
184
  ]
185
  );
 
 
 
 
 
 
 
 
 
186
 
187
  $this->add_control(
188
  'pdf_title',
@@ -263,11 +207,7 @@ class PDF_View extends Base {
263
  'default' => [
264
  'size' => 100,
265
  'unit' => '%',
266
- ],
267
- 'selectors' => [
268
- '{{WRAPPER}} .pdf_viewer_container iframe' => 'width: {{SIZE}}{{UNIT}};',
269
- '{{WRAPPER}} .ha-google-iframe' => 'width: {{SIZE}}{{UNIT}};'
270
- ]
271
  ]
272
  );
273
 
@@ -438,6 +378,7 @@ class PDF_View extends Base {
438
  'type' => Controls_Manager::COLOR,
439
  'selectors' => [
440
  '{{WRAPPER}} .pdf-icon' => 'color: {{VALUE}}',
 
441
  ],
442
  ]
443
  );
@@ -639,8 +580,8 @@ class PDF_View extends Base {
639
  $unique_id = wp_unique_id('viewer-');
640
  $file_type = $settings['file_type'];
641
 
642
- // $pdf_url = ('yes' == $settings['pdf_view_type'] && is_array($settings['pdf_file'])) ? $settings['pdf_file']['url'] : '';
643
- // $pdf_url_i = '';
644
  if('url' == $file_type){
645
  $pdf_url_i = $settings['pdf_url']['url'];
646
  }else{
@@ -648,39 +589,45 @@ class PDF_View extends Base {
648
  }
649
 
650
  if (isset($settings['pdf_width'])) {
651
- $width = ' width: ' . $settings['pdf_width']['size'] . $settings['pdf_width']['unit'] . ';';
652
  }
653
  if (isset($settings['pdf_height'])) {
654
- $height = ' height: ' . $settings['pdf_height']['size'] . $settings['pdf_height']['unit'] . ';';
655
  }
656
 
657
  if(empty($pdf_url_i)){
658
  $pdf_url_i = HAPPY_ADDONS_ASSETS . 'vendor/pdfjs/sample.pdf';
659
  }
660
 
661
- $json_settings = [
662
- 'unique_id' => $unique_id,
663
- 'pdf_url' => $pdf_url_i,
664
- 'license' => (! empty($settings['pdf_license']) ) ? $settings['pdf_license'] : '',
665
- 'pdfjs_expres' => $settings['pdf_view_type']
 
 
666
  ];
667
- $this->add_render_attribute( 'pdf_viewer_container', 'data-pdf-settings', wp_json_encode( $json_settings ) );
 
 
 
 
668
  ?>
669
- <div class="pdf_viewer_container" <?php echo $this->print_render_attribute_string('pdf_viewer_container'); ?>>
670
- <div class="pdf_viewer_options">
671
- <span class="ha-title-flex">
672
- <span class="pdf-icon">
673
- <?php Icons_Manager::render_icon($settings['icon'], ['aria-hidden' => 'true']); ?>
674
- </span>
675
- <?php
676
- if($settings['pdf_title']){
677
- echo sprintf( '<h2 class="ha-pdf-title">%s</h2>',
678
- esc_html( $settings['pdf_title'] )
679
- );
680
- }
681
- ?>
682
- </span>
683
- <?php
684
  ?>
685
  <div class="pdf-button">
686
  <?php
@@ -694,21 +641,11 @@ class PDF_View extends Base {
694
  ?>
695
  </div>
696
  </div>
697
- <?php if('yes' == $settings['pdf_view_type']) :
698
-
699
- if(! empty($settings['pdf_license']) ){
700
- printf( '<div id="%1$s" style="height:%2$s;"></div>',
701
- esc_attr( $unique_id ),
702
- esc_attr($settings['pdf_height']['size'].$settings['pdf_height']['unit'])
703
- );
704
- }else{
705
- printf( '<h1>%1$s</h1>', __('Please set your PDFjs.express License', 'happy-elementor-addons'));
706
- }
707
- elseif('yes' != $settings['pdf_view_type'] && 'upload_file' == $file_type):
708
- echo '<iframe class="ha-google-iframe" src="'. HAPPY_ADDONS_ASSETS . 'vendor/pdfjs/mozila/web/viewer.html?file=' . $pdf_url_i . '&embedded=true" frameborder="1" marginheight="0px" marginwidth="0px" style="'. $height . '" allowfullscreen></iframe>';
709
- else:
710
- echo '<iframe class="ha-google-iframe" src="https://docs.google.com/viewer?url='. $pdf_url_i .'&amp;embedded=true" frameborder="1" style="'. $height .'" marginheight="0px" marginwidth="0px" allowfullscreen></iframe>';
711
- endif; ?>
712
  </div>
713
  <?php
714
  }
1
  <?php
2
  /**
3
+ * PDF View widget class
4
  *
5
  * @package Happy_Addons
6
  */
43
  * @return string Widget icon.
44
  */
45
  public function get_icon() {
46
+ return 'hm hm-file';
47
  }
48
 
49
  public function get_keywords() {
67
  ]
68
  );
69
 
70
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
 
72
  $this->add_control(
73
  'file_type',
78
  'url' => __('URL', 'happy-elementor-addons'),
79
  'upload_file' => __('Upload File', 'happy-elementor-addons'),
80
  ],
81
+ 'default' => 'url'
 
 
 
82
  ]
83
  );
84
 
89
  'type' => Controls_Manager::URL,
90
  'placeholder' => __( 'http://www.example.com/sample.pdf', 'happy-elementor-addons'),
91
  'default' => [
92
+ 'url' => 'https://file-examples-com.github.io/uploads/2017/10/file-sample_150kB.pdf'
93
  ],
94
  'show_external' => false,
95
  'dynamic' => [
96
  'active' => false,
97
  ],
98
+ 'condition' => [
99
+ 'file_type' => 'url'
 
 
 
 
 
 
 
 
 
 
 
 
100
  ],
101
  ]
102
  );
113
  'dynamic' => [
114
  'active' => true,
115
  ],
116
+ 'condition' => [
117
+ 'file_type' => 'upload_file'
 
 
 
 
 
 
 
 
 
 
 
 
118
  ],
119
  ]
120
  );
121
+
122
+ $this->add_control(
123
+ 'page_number',
124
+ [
125
+ 'label' => __( 'Page Number', 'happy-elementor-addons' ),
126
+ 'type' => Controls_Manager::NUMBER,
127
+ 'default' => '1',
128
+ ]
129
+ );
130
 
131
  $this->add_control(
132
  'pdf_title',
207
  'default' => [
208
  'size' => 100,
209
  'unit' => '%',
210
+ ]
 
 
 
 
211
  ]
212
  );
213
 
378
  'type' => Controls_Manager::COLOR,
379
  'selectors' => [
380
  '{{WRAPPER}} .pdf-icon' => 'color: {{VALUE}}',
381
+ '{{WRAPPER}} .pdf-icon svg' => 'fill: {{VALUE}}',
382
  ],
383
  ]
384
  );
580
  $unique_id = wp_unique_id('viewer-');
581
  $file_type = $settings['file_type'];
582
 
583
+ $pdf_url_i = '';
584
+
585
  if('url' == $file_type){
586
  $pdf_url_i = $settings['pdf_url']['url'];
587
  }else{
589
  }
590
 
591
  if (isset($settings['pdf_width'])) {
592
+ $width = $settings['pdf_width']['size'] . $settings['pdf_width']['unit'];
593
  }
594
  if (isset($settings['pdf_height'])) {
595
+ $height = $settings['pdf_height']['size'] . $settings['pdf_height']['unit'];
596
  }
597
 
598
  if(empty($pdf_url_i)){
599
  $pdf_url_i = HAPPY_ADDONS_ASSETS . 'vendor/pdfjs/sample.pdf';
600
  }
601
 
602
+ $json_settings = [
603
+ 'unique_id' => $unique_id,
604
+ 'pdf_url' => $pdf_url_i,
605
+ 'file_type' => $file_type,
606
+ 'page_number' => $settings['page_number'],
607
+ 'width' => $width,
608
+ 'height' => $height,
609
  ];
610
+
611
+
612
+
613
+ $this->add_render_attribute( 'pdf_settings', 'data-pdf-settings', wp_json_encode( $json_settings ) );
614
+
615
  ?>
616
+ <div class="pdf_viewer_container">
617
+ <div class="pdf_viewer_options" <?php $this->print_render_attribute_string( 'pdf_settings' ) ?>>
618
+ <span class="ha-title-flex">
619
+ <span class="pdf-icon">
620
+ <?php Icons_Manager::render_icon($settings['icon'], ['aria-hidden' => 'true']); ?>
621
+ </span>
622
+ <?php
623
+ if($settings['pdf_title']){
624
+ echo sprintf( '<h2 class="ha-pdf-title">%s</h2>',
625
+ esc_html( $settings['pdf_title'] )
626
+ );
627
+ }
628
+ ?>
629
+ </span>
630
+ <?php
631
  ?>
632
  <div class="pdf-button">
633
  <?php
641
  ?>
642
  </div>
643
  </div>
644
+
645
+ <div>
646
+ <div id="pdf-container"></div>
647
+ </div>
648
+
 
 
 
 
 
 
 
 
 
 
649
  </div>
650
  <?php
651
  }
widgets/social-share/widget.php CHANGED
@@ -770,19 +770,20 @@ class Social_Share extends Base {
770
  <li <?php $this->print_render_attribute_string( 'list_classes' ); ?>>
771
  <a <?php $this->print_render_attribute_string( 'link_classes' ); ?>>
772
  <?php
 
 
 
773
  if ( 'icon_and_text' == $network_view ) {
774
- $social_media_name = $social_media_name == 'email' ? 'envelope' : $social_media_name;
775
  ?>
776
- <i class="fa fa-<?php echo esc_attr( $social_media_name ); ?>" aria-hidden="true"></i>
777
  <?php
778
  if ( ! empty( $share_on_text ) && '' != $share_on_text ) {
779
  printf( "<span class='ha-share-label'>%s</span>", $share_on_text );
780
  }
781
  }
782
  if ( 'icon_only' == $network_view ) {
783
- $social_media_name = $social_media_name == 'email' ? 'envelope' : $social_media_name;
784
  ?>
785
- <i class="fa fa-<?php echo esc_attr( $social_media_name ); ?>" aria-hidden="true"></i>
786
  <?php
787
  }
788
  if ( 'text_only' == $network_view ) {
770
  <li <?php $this->print_render_attribute_string( 'list_classes' ); ?>>
771
  <a <?php $this->print_render_attribute_string( 'link_classes' ); ?>>
772
  <?php
773
+ $social_media_name = $social_media_name == 'email' ? 'envelope' : $social_media_name;
774
+ $ico_library = $social_media_name == 'envelope' ? 'fa' : 'fab';
775
+
776
  if ( 'icon_and_text' == $network_view ) {
 
777
  ?>
778
+ <i class="<?=$ico_library?> fa-<?php echo esc_attr( $social_media_name ); ?>" aria-hidden="true"></i>
779
  <?php
780
  if ( ! empty( $share_on_text ) && '' != $share_on_text ) {
781
  printf( "<span class='ha-share-label'>%s</span>", $share_on_text );
782
  }
783
  }
784
  if ( 'icon_only' == $network_view ) {
 
785
  ?>
786
+ <i class="<?=$ico_library?> fa-<?php echo esc_attr( $social_media_name ); ?>" aria-hidden="true"></i>
787
  <?php
788
  }
789
  if ( 'text_only' == $network_view ) {