@pdftron/webviewer 11.9.0 → 11.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/package.json +1 -1
  2. package/public/core/19.chunk.js +7 -7
  3. package/public/core/20.chunk.js +1 -1
  4. package/public/core/21.chunk.js +1 -1
  5. package/public/core/22.chunk.js +7 -7
  6. package/public/core/AndroidContentPartRetriever.chunk.js +2 -2
  7. package/public/core/ArrayBufferPdfPartRetriever.chunk.js +1 -1
  8. package/public/core/AzurePartRetriever.chunk.js +2 -2
  9. package/public/core/ExternalAnnotationMerger.chunk.js +14 -14
  10. package/public/core/ExternalPdfPartRetriever.chunk.js +6 -6
  11. package/public/core/HttpPartRetriever.chunk.js +12 -12
  12. package/public/core/IOSPartRetriever.chunk.js +2 -2
  13. package/public/core/LocalPartRetriever.chunk.js +4 -4
  14. package/public/core/LocalPdfPartRetriever.chunk.js +3 -3
  15. package/public/core/PDFInfoVersion1.chunk.js +12 -12
  16. package/public/core/SelectionInfoOld.chunk.js +14 -14
  17. package/public/core/StreamingPartRetriever.chunk.js +9 -9
  18. package/public/core/WebDBPartRetriever.chunk.js +2 -2
  19. package/public/core/WebViewerServerPartRetriever.chunk.js +43 -43
  20. package/public/core/WinRTPartRetriever.chunk.js +2 -2
  21. package/public/core/legacyOffice/WebB2XOfficeWorker.br.mem +0 -0
  22. package/public/core/legacyOffice/WebB2XOfficeWorker.gz.js.mem +0 -0
  23. package/public/core/legacyOffice/WebB2XOfficeWorker.gz.mem +0 -0
  24. package/public/core/legacyOffice/WebB2XOfficeWorkerWasm.br.wasm +0 -0
  25. package/public/core/legacyOffice/WebB2XOfficeWorkerWasm.gz.js.mem +0 -0
  26. package/public/core/legacyOffice/WebB2XOfficeWorkerWasm.gz.wasm +0 -0
  27. package/public/core/office/WebOfficeWorker.br.js.mem +0 -0
  28. package/public/core/office/WebOfficeWorker.br.mem +0 -0
  29. package/public/core/office/WebOfficeWorker.gz.js.mem +0 -0
  30. package/public/core/office/WebOfficeWorker.gz.mem +0 -0
  31. package/public/core/office/WebOfficeWorkerWasm.br.wasm +0 -0
  32. package/public/core/office/WebOfficeWorkerWasm.gz.js.mem +0 -0
  33. package/public/core/office/WebOfficeWorkerWasm.gz.wasm +0 -0
  34. package/public/core/officeEditor/OfficeEditorWorkerWasm.br.wasm +0 -0
  35. package/public/core/pdf/full/PDFNetC.br.js.mem +0 -0
  36. package/public/core/pdf/full/PDFNetC.br.mem +0 -0
  37. package/public/core/pdf/full/PDFNetC.gz.js.mem +0 -0
  38. package/public/core/pdf/full/PDFNetCWasm.br.js.mem +0 -0
  39. package/public/core/pdf/full/PDFNetCWasm.br.wasm +0 -0
  40. package/public/core/pdf/full/PDFNetCWasm.gz.js.mem +0 -0
  41. package/public/core/pdf/full/PDFNetCWasm.js +1 -1
  42. package/public/core/pdf/full/PDFNetThreadedWasm.br.js.mem +0 -0
  43. package/public/core/pdf/full/PDFNetThreadedWasm.br.wasm +0 -0
  44. package/public/core/pdf/full/optimized/PDFNetCWasm.br.js.mem +0 -0
  45. package/public/core/pdf/full/optimized/PDFNetCWasm.br.wasm +0 -0
  46. package/public/core/pdf/full/optimized/PDFNetCWasm.gz.js.mem +0 -0
  47. package/public/core/pdf/full/optimized/PDFNetCWasm.js +1 -1
  48. package/public/core/pdf/full/optimized/PDFNetThreadedWasm.br.js.mem +0 -0
  49. package/public/core/pdf/full/optimized/PDFNetThreadedWasm.br.wasm +0 -0
  50. package/public/core/pdf/lean/PDFNetC.br.js.mem +0 -0
  51. package/public/core/pdf/lean/PDFNetC.br.mem +0 -0
  52. package/public/core/pdf/lean/PDFNetC.gz.js.mem +0 -0
  53. package/public/core/pdf/lean/PDFNetCWasm.br.js.mem +0 -0
  54. package/public/core/pdf/lean/PDFNetCWasm.br.wasm +0 -0
  55. package/public/core/pdf/lean/PDFNetCWasm.gz.js.mem +0 -0
  56. package/public/core/pdf/lean/PDFNetCWasm.js +1 -1
  57. package/public/core/pdf/lean/PDFNetThreadedWasm.br.js.mem +0 -0
  58. package/public/core/pdf/lean/PDFNetThreadedWasm.br.wasm +0 -0
  59. package/public/core/pdf/lean/optimized/PDFNetCWasm.br.js.mem +0 -0
  60. package/public/core/pdf/lean/optimized/PDFNetCWasm.br.wasm +0 -0
  61. package/public/core/pdf/lean/optimized/PDFNetCWasm.gz.js.mem +0 -0
  62. package/public/core/pdf/lean/optimized/PDFNetCWasm.js +1 -1
  63. package/public/core/pdf/lean/optimized/PDFNetThreadedWasm.br.js.mem +0 -0
  64. package/public/core/pdf/lean/optimized/PDFNetThreadedWasm.br.wasm +0 -0
  65. package/public/core/pikaday.chunk.js +17 -17
  66. package/public/core/vendors.ascii85.chunk.js +6 -6
  67. package/public/core/vendors.pako.chunk.js +81 -81
  68. package/public/core/webviewer-core.min.js +4485 -4475
  69. package/public/ui/webviewer-ui.min.js +2 -2
  70. package/public/ui/webviewer-ui.min.js.map +1 -1
  71. package/types.d.ts +22 -7
  72. package/webviewer.min.js +1 -1
package/types.d.ts CHANGED
@@ -39,10 +39,10 @@ export declare namespace Core.PDFNet {
39
39
  static createEPUBOutputOptions(): Promise<PDFNet.Convert.EPUBOutputOptions>;
40
40
  /**
41
41
  * Method to create a OfficeToPDFOptions object.
42
- * @param JSON - data containing options values for OfficeToPDFOptions.
42
+ * @param json - JSON data containing options values for OfficeToPDFOptions.
43
43
  * @returns A promise that resolves to a PDFNet.Convert.OfficeToPDFOptions.
44
44
  */
45
- static createOfficeToPDFOptions(JSON: string): Promise<PDFNet.Convert.OfficeToPDFOptions>;
45
+ static createOfficeToPDFOptions(json: string): Promise<PDFNet.Convert.OfficeToPDFOptions>;
46
46
  /**
47
47
  * Convert the specified XPS document contained in memory to PDF
48
48
  and append converted pages to the specified PDF document.
@@ -21986,10 +21986,10 @@ export declare namespace Core.PDFNet {
21986
21986
  }
21987
21987
  /**
21988
21988
  * An object containing options for wordToPdf functions.
21989
- * @param JSON - data containing options values for OfficeToPDFOptions.
21989
+ * @param json - JSON data containing options values for OfficeToPDFOptions.
21990
21990
  */
21991
21991
  class OfficeToPDFOptions {
21992
- constructor(JSON: string);
21992
+ constructor(json: string);
21993
21993
  /**
21994
21994
  * Gets the value AnimationHandling from the options object.
21995
21995
  * Specifies the handling of animations present in the PowerPoint
@@ -22924,10 +22924,10 @@ export declare namespace Core.PDFNet {
22924
22924
  * For example, if a word is removed from document B, we can highlight the location of the original word in document A,
22925
22925
  * but there is no word to highlight in B (it's removed). In this case a small "placeholder" annotation is placed in B
22926
22926
  * to identify the location of the removal.
22927
- * @param whether - to show placeholder annotations. On by default.
22927
+ * @param value - whether to show placeholder annotations. On by default.
22928
22928
  * @returns this object, for call chaining
22929
22929
  */
22930
- setShowPlaceholders(whether: boolean): PDFNet.PDFDoc.TextDiffOptions;
22930
+ setShowPlaceholders(value: boolean): PDFNet.PDFDoc.TextDiffOptions;
22931
22931
  /**
22932
22932
  * Gets the value CompareStyles from the options object
22933
22933
  * Whether to highlight text style differences. Off by default.
@@ -34506,7 +34506,22 @@ export declare namespace Core {
34506
34506
  */
34507
34507
  disableViewportRenderMode(): void;
34508
34508
  /**
34509
- * Returns a boolean to denote if viewer is in viewport rendering mode
34509
+ * Enables a memory-restricted rendering mode optimized for constrained environments.
34510
+ * Note: this mode is not supported in Spreadsheet Editor.
34511
+ * This applies aggressive limits to canvas size/count, disables caching/viewport rendering, and caps zoom.
34512
+ */
34513
+ enableMemoryRestrictedMode(): void;
34514
+ /**
34515
+ * Disables the memory-restricted rendering mode and restores normal rendering limits.
34516
+ */
34517
+ disableMemoryRestrictedMode(): void;
34518
+ /**
34519
+ * Returns a boolean to denote if viewer is in memory restricted rendering mode.
34520
+ * @returns The boolean to denote if in memory restricted rendering mode.
34521
+ */
34522
+ isMemoryRestrictedModeEnabled(): boolean;
34523
+ /**
34524
+ * Returns a boolean to denote if viewer is in viewport rendering mode.
34510
34525
  * @returns the boolean to denote if in viewport render mode
34511
34526
  */
34512
34527
  isInViewportRenderMode(): boolean;
package/webviewer.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(window,(function(){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(o,i,function(t){return e[t]}.bind(null,i));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=1)}([function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){n(2),e.exports=n(6)},function(e,t,n){(function(o,i){var r,a;function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(o,i){"object"==s(t)&&void 0!==e?i():void 0===(a="function"==typeof(r=i)?r.call(t,n,t,e):r)||(e.exports=a)}(0,(function(){"use strict";function e(e){var t=this.constructor;return this.then((function(n){return t.resolve(e()).then((function(){return n}))}),(function(n){return t.resolve(e()).then((function(){return t.reject(n)}))}))}function t(){}function n(e){if(!(this instanceof n))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],d(e,this)}function r(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,n._immediateFn((function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var o;try{o=n(e._value)}catch(e){return void c(t.promise,e)}a(t.promise,o)}else(1===e._state?a:c)(t.promise,e._value)}))):e._deferreds.push(t)}function a(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==s(t)||"function"==typeof t)){var o=t.then;if(t instanceof n)return e._state=3,e._value=t,void l(e);if("function"==typeof o)return void d(function(e,t){return function(){e.apply(t,arguments)}}(o,t),e)}e._state=1,e._value=t,l(e)}catch(t){c(e,t)}}function c(e,t){e._state=2,e._value=t,l(e)}function l(e){2===e._state&&0===e._deferreds.length&&n._immediateFn((function(){e._handled||n._unhandledRejectionFn(e._value)}));for(var t=0,o=e._deferreds.length;o>t;t++)r(e,e._deferreds[t]);e._deferreds=null}function d(e,t){var n=!1;try{e((function(e){n||(n=!0,a(t,e))}),(function(e){n||(n=!0,c(t,e))}))}catch(e){if(n)return;n=!0,c(t,e)}}var u=setTimeout;n.prototype.catch=function(e){return this.then(null,e)},n.prototype.then=function(e,n){var o=new this.constructor(t);return r(this,new function(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}(e,n,o)),o},n.prototype.finally=e,n.all=function(e){return new n((function(t,n){function o(e,a){try{if(a&&("object"==s(a)||"function"==typeof a)){var c=a.then;if("function"==typeof c)return void c.call(a,(function(t){o(e,t)}),n)}i[e]=a,0==--r&&t(i)}catch(e){n(e)}}if(!e||void 0===e.length)throw new TypeError("Promise.all accepts an array");var i=Array.prototype.slice.call(e);if(0===i.length)return t([]);for(var r=i.length,a=0;i.length>a;a++)o(a,i[a])}))},n.resolve=function(e){return e&&"object"==s(e)&&e.constructor===n?e:new n((function(t){t(e)}))},n.reject=function(e){return new n((function(t,n){n(e)}))},n.race=function(e){return new n((function(t,n){for(var o=0,i=e.length;i>o;o++)e[o].then(t,n)}))},n._immediateFn="function"==typeof o&&function(e){o(e)}||function(e){u(e,0)},n._unhandledRejectionFn=function(e){void 0!==console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};var f=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==i)return i;throw Error("unable to locate global object")}();"Promise"in f?f.Promise.prototype.finally||(f.Promise.prototype.finally=e):f.Promise=n}))}).call(this,n(3).setImmediate,n(0))},function(e,t,n){(function(e){var o=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function r(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new r(i.call(setTimeout,o,arguments),clearTimeout)},t.setInterval=function(){return new r(i.call(setInterval,o,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},r.prototype.unref=r.prototype.ref=function(){},r.prototype.close=function(){this._clearFn.call(o,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(4),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(0))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var o,i,r,a,s,c=1,l={},d=!1,u=e.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(e);f=f&&f.setTimeout?f:e,"[object process]"==={}.toString.call(e.process)?o=function(e){t.nextTick((function(){m(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((r=new MessageChannel).port1.onmessage=function(e){m(e.data)},o=function(e){r.port2.postMessage(e)}):u&&"onreadystatechange"in u.createElement("script")?(i=u.documentElement,o=function(e){var t=u.createElement("script");t.onreadystatechange=function(){m(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):o=function(e){setTimeout(m,0,e)}:(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&m(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),o=function(t){e.postMessage(a+t,"*")}),f.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var i={callback:e,args:t};return l[c]=i,o(c),c++},f.clearImmediate=p}function p(e){delete l[e]}function m(e){if(d)setTimeout(m,0,e);else{var t=l[e];if(t){d=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(void 0,n)}}(t)}finally{p(e),d=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,n(0),n(5))},function(e,t){var n,o,i=e.exports={};function r(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===r||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:r}catch(e){n=r}try{o="function"==typeof clearTimeout?clearTimeout:a}catch(e){o=a}}();var c,l=[],d=!1,u=-1;function f(){d&&c&&(d=!1,c.length?l=c.concat(l):u=-1,l.length&&p())}function p(){if(!d){var e=s(f);d=!0;for(var t=l.length;t;){for(c=l,l=[];++u<t;)c&&c[u].run();u=-1,t=l.length}c=null,d=!1,function(e){if(o===clearTimeout)return clearTimeout(e);if((o===a||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(e);try{o(e)}catch(t){try{return o.call(null,e)}catch(t){return o.call(this,e)}}}(e)}}function m(e,t){this.fun=e,this.array=t}function h(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new m(e,t)),1!==l.length||d||s(p)},m.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=h,i.addListener=h,i.once=h,i.off=h,i.removeListener=h,i.removeAllListeners=h,i.emit=h,i.prependListener=h,i.prependOnceListener=h,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t,n){"use strict";n.r(t),n.d(t,"getInstance",(function(){return L})),n.d(t,"setInstanceForWebComponent",(function(){return W})),n.d(t,"clearInstanceForWebComponent",(function(){return x}));var o={ASM:"asm",WASM:"ems",JS_WORKER:"jsworker",THREADED_WASM:"wasm-threads"};function i(e,t){if("string"!=typeof e||!t)return e;var n=t.substr(0,t.lastIndexOf("/"));return/^(\/|%2F|[a-z0-9-]+:)/i.test(e)?e:"".concat(n,"/").concat(e)}function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,c(o.key),o)}}function c(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}function l(e,t,n){return t=m(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,f()?Reflect.construct(t,n||[],m(e).constructor):t.apply(e,n))}function d(e){var t="function"==typeof Map?new Map:void 0;return(d=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return u(e,arguments,m(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),p(n,e)})(e)}function u(e,t,n){if(f())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,t);var i=new(e.bind.apply(e,o));return n&&p(i,n.prototype),i}function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(f=function(){return!!e})()}function p(e,t){return(p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var h=0,v=function(){var e=localStorage.getItem("wv_instanceIds");if((e=e?e.split(","):[]).length&&e[h]){var t=e[h];return h++,t}var n=Math.random().toString(36).slice(-6);return-1===e.findIndex((function(e){return e===n}))?(e.push(n),localStorage.setItem("wv_instanceIds",e),h++,n):v()},b=function(e){function t(){return a(this,t),l(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&p(e,t)}(t,e),n=t,(o=[{key:"connectedCallback",value:function(){if(!this.shadowRoot){var e=this.attachShadow({mode:"open"}),t=this.getAttribute("path"),n=this.getAttribute("uiPath");window.apryseCoreScriptPromise&&window.Core||(window.Core&&(window.apryseCoreScriptPromise=Promise.resolve()),window.apryseCoreScriptLoading||(window.apryseCoreScriptLoading=!0,window.apryseCoreScriptPromise=new Promise((function(e){var n=document.createElement("script");n.src="".concat(t,"/core/webviewer-core.min.js"),n.onload=function(){window.apryseCoreScriptLoading=!1,e()},window.document.head.appendChild(n)}))));var o="ui/index-wc.html";n&&(o=n),window.isApryseWebViewerWebComponent=!0,window.webViewerPath=t,this.id=this.getAttribute("id")||v()||"default",window.apryseCoreScriptPromise.then((function(){fetch("".concat(t,"/").concat(o)).then((function(e){return e.text()})).then((function(n){e.innerHTML=n,function e(t,n){if(!0===function(e){return"SCRIPT"===e.tagName}(t))t.parentNode.replaceChild(function(e,t){var n=document.createElement("script");n.text=e.innerHTML;for(var o=-1,i=e.attributes;++o<i.length;){var r=i[o];"src"===r.name?n.setAttribute("src","".concat(t).concat(r.value)):n.setAttribute(r.name,r.value)}return n.async=!1,n}(t,n),t);else for(var o=-1,i=t.childNodes;++o<i.length;)e(i[o],n);return t}(e,t),window.dispatchEvent(new Event("webviewerloaded"))}))})).catch((function(e){return console.error(e)}))}}}])&&s(n.prototype,o),i&&s(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,o,i}(d(HTMLElement));try{customElements.define("apryse-webviewer",b)}catch(e){console.warn("This environment does not allow for usage of the WebComponent version of WebViewer: ".concat(e))}var w=function(e,t){return new Promise((function(n,o){var i,r,a,s=document.createElement("apryse-webviewer");s.setAttribute("id","wc-".concat(t.id)),e.l=e.l||e.licenseKey,e.azureWorkaround=e.azureWorkaround||e.enableAzureWorkaround,e.annotationAdmin=e.annotationAdmin||e.isAdminUser,e.enableReadOnlyMode=e.enableReadOnlyMode||e.isReadOnly,e.showLocalFilePicker=e.showLocalFilePicker||e.enableFilePicker,e.useSharedWorker=e.workerTransportPromise?"true":"false",e.path=e.path||"/lib",e.officeEditorOptions=JSON.stringify(e.officeEditorOptions||{}),e.css&&(i=t,r=e.css,(a=document.createElement("link")).setAttribute("rel","stylesheet"),a.setAttribute("href","".concat(r)),i.appendChild(a)),e.workerTransportPromise&&(window.apryseWorkerTransportPromise=e.workerTransportPromise),e.l&&(window.apryse_l=btoa(e.l));var c=["disableLogs","highContrastMode"];for(var l in["autoCreate","autoFocusNoteOnAnnotationSelection","enableOptimizedWorkers","enableAnnotations","preloadPDFWorker","useDownloader","showInvalidBookmarks"].forEach((function(t){void 0===(null==e?void 0:e[t])&&(e[t]=!0)})),e)if(void 0!==(null==e?void 0:e[l])&&null!==(null==e?void 0:e[l]))if(c.includes(l)&&!1===e[l])s.removeAttribute(l);else if("encryption"===l)s.setAttribute("auto_load",!1);else if("licenseKey"!==l&&"l"!==l){var d=Array.isArray(e[l])?JSON.stringify(e[l]):e[l];s.setAttribute(l,d)}s.setAttribute("webviewerjsversion","11.9.0");var u=function(t){"requestl"===t.data&&t.source&&t.source.postMessage({type:"responsel",value:e.l||e.licenseKey},"*")};t.appendChild(s),s.addEventListener("ready",(function(){if(e.config){var o=document.createElement("script");o.src=e.config,document.body.appendChild(o)}if(e.encryption){var i=e.initialDoc,r={decrypt:s.instance.Core.Encryption.decrypt,decryptOptions:e.encryption,documentId:e.documentId,extension:"xod"};s.instance.UI.loadDocument(i,r)}if(e.additionalTranslations){var a=e.additionalTranslations;s.instance.UI.setTranslations(a.language,a.translations)}W(t,s.instance),s.instance.UI.dispose=function(){return new Promise((function(e){x(t),window.removeEventListener("message",u),s.shadowRoot.getElementById("app").dispatchEvent(new Event("webcomponentUnmounted")),console.clear(),s.instance.Core.documentViewer.closeDocument().then((function(){e()}))}))},n(s.instance)})),window.addEventListener("message",u,!1)}))};function y(e){return(y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach((function(t){T(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function T(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=y(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=y(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==y(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}window.WebViewerWebComponent=w;var P={},E=0;"undefined"==typeof console&&(window.console={log:function(){},warn:function(){},error:function(){}});var I=function(){for(var e=1;e<arguments.length;e++)for(var t=Object.keys(arguments[e]),n=0;n<t.length;n++)arguments[0][t[n]]=arguments[e][t[n]];return arguments[0]},S=function(e){var t=[];return e.forEach((function(e){t.push(e)})),t},_=function(e,t){var n;try{n=new CustomEvent(e,{detail:t,bubbles:!0,cancelable:!0})}catch(o){(n=document.createEvent("Event")).initEvent(e,!0,!0),n.detail=t}return n};window.PDFNet&&!P.skipPDFNetWebViewerWarning&&console.warn("PDFNet.js and WebViewer.js have been included in the same context. See https://community.apryse.com/t/what-is-the-best-location-to-call-pdfnet-apis-when-used-in-conjunction-with-webviewer/5210 for an explanation of why this could be an error in your application.");var A=new Map,C=new Map;P.WebViewer=function(e,t){var n=this;if(C.get(t))throw new Error("Two instances of WebViewer were created on the same HTML element. Please create a new element for each instance of WebViewer");C.set(t,!0);var o=function(){A.get(t).instance=n.getCompleteInstance(),t.removeEventListener("ready",o)};t.addEventListener("ready",o),this._validateOptions(e);var i=e.webviewerServerURL||e.pdftronServer;e.fullAPI&&i&&(e.forceClientSideInit||console.warn("The fullAPI and webviewerServerURL options have both been set so the forceClientSideInit option is now enabled. This means that WebViewer will switch to client side rendering and processing to allow use of the full API."),e.forceClientSideInit=!0),this.options=I({},P.WebViewer.Options,e);var r=this.options.path.length-1;r>0&&"/"!==this.options.path[r]&&(this.options.path+="/"),this.options.uiPath=this.options.path+this.options.uiPath,t||console.error("ViewerElement is not defined. This may be caused by calling the WebViewer constructor before the DOM is loaded, or an invalid selector. Please see https://docs.apryse.com/documentation/web/get-started/ for an example."),this.element=t,this.element.style.overflow="hidden";var a=this;this.messageHandler=function(t){if("requestl"===t.data&&t.source&&t.source.postMessage({type:"responsel",value:e.l||e.licenseKey},"*"),"requestConfig"===t.data.type&&t.data.id===a.id&&t.source){var n=e.config?a._correctRelativePath(e.config):"";t.source.postMessage({type:"responseConfig",value:n},"*")}},window.addEventListener("message",this.messageHandler,!1),this.options.autoCreate&&this.create()};var k={licenseKey:void 0,enableAzureWorkaround:!1,isAdminUser:!1,isReadOnly:!1};P.WebViewer.prototype={version:"11.9.0",create:function(){if(this.options.initialDoc){var e=this._correctRelativePath(this.options.initialDoc);e=encodeURIComponent(JSON.stringify(e)),this.options.initialDoc=e}this._create()},_create:function(){this.id=++E,void 0===this._trigger&&(this._trigger=function(e,t){var n=_(e,t);this.element.dispatchEvent(n)});var e=this.options.type.replace(" ","").split(",");e.length<1&&(e[0]="html5"),this._createViewer(e)},_validateOptions:function(e){for(var t=Object.keys(e),n=0;n<t.length;n++){var o=t[n];o in I({},k,P.WebViewer.Options)||console.warn("".concat(o," is not a valid option name. See https://docs.apryse.com/api/web/global.html#WebViewerOptions for all available options."))}var i=e.webviewerServerURL||e.pdftronServer;!e.enableRedaction||e.fullAPI||i||console.warn("FullAPI or WebViewer Server is needed to apply redactions")},_notSupportedMobile:function(){var e=document.createElement("div");e.id="webviewer-browser-unsupported",e.textContent="PDF document viewing is not supported by this browser.",this.element.appendChild(e)},_createViewer:function(e){var t,n=this;if(n.selectedType=null,this.isMobileDevice()){if(this.options.documentType&&"xod"!==this.options.documentType&&!this._testWebAssembly())return void this._notSupportedMobile();if(e=Array("html5Mobile"),n.selectedType="html5Mobile",this.options.mobileRedirect)return t=this.options.uiPath+this._getHTML5OptionsURL(),void(window.location=t)}for(var o=!1,i=!1,r=0;r<e.length;r++){if("html5mobile"===e[r].toLowerCase()){if(this.options.documentType&&"xod"!==this.options.documentType&&!this._testWebAssembly())continue;if(o=!0,n._testHTML5()){if(this.options.mobileRedirect)return n.selectedType="html5Mobile",t=this.options.uiPath+this._getHTML5OptionsURL(),void(window.location=t);if(this.options.xdomainProxyUrl||n.isSameOrigin(decodeURIComponent(n.options.initialDoc))||n._testCORS()){n.selectedType="html5Mobile";break}i=!0}}if("html5"===e[r].toLowerCase()&&(o=!0,n._testHTML5())){var a=n.isSameOrigin(decodeURIComponent(n.options.initialDoc));if(this.options.xdomainProxyUrl||a||n._testCORS()){n.selectedType="html5";break}i=!0}}if("html5"===n.selectedType)n._createHTML5();else if("html5Mobile"===n.selectedType)n._createHTML5Mobile();else{var s;if(i?s="This browser does not support cross origin requests. Please configure xdomain to support CORS.":o&&(s="Please use an HTML5 compatible browser."),s){var c=document.createElement("div");c.id="webviewer-browser-unsupported",c.textContent=s,n.element.appendChild(c)}}},_viewerLoaded:function(e){this._trigger("ready");try{var t=e.contentWindow;if(t.postMessage({type:"viewerLoaded"},"*"),void 0!==this.options.encryption){var n=decodeURIComponent(this.options.initialDoc);this.options.initialDoc&&(n=JSON.parse(n));var o={decrypt:t.Core.Encryption.decrypt,decryptOptions:this.options.encryption,documentId:this.options.documentId,extension:"xod"};this.getInstance().UI.loadDocument(n,o)}}catch(e){console.warn("Viewer is on a different domain, the promise from WebViewer function is rejected and API functions will not work because of cross domain permissions. See https://docs.apryse.com/documentation/web/guides/wv-inside/#loading-webviewer-from-another-domain for more information.")}},_getHTML5OptionsURL:function(){var e,t,n,o=this.options,i=o.webviewerServerURL||o.pdftronServer,r="";if(o.initialDoc&&(r+="#d=".concat(o.initialDoc)),void 0===o.backendType&&(o.backendType=o.pdfBackend),o.documentType&&"xod"===o.documentType&&(e=o.documentType),o.preloadWorker&&"xod"===o.preloadWorker&&(e=o.preloadWorker),o.extension&&(e=o.extension),e&&(r+="&extension=".concat(e)),o.documentType&&"xod"!==o.documentType&&(t=o.documentType),o.preloadWorker&&"xod"!==o.preloadWorker&&(t=o.preloadWorker),t&&(r+="&preloadWorker=".concat(t)),o.backendType&&(r+="&pdf=".concat(o.backendType,"&office=").concat(o.backendType,"&legacyOffice=").concat(o.backendType)),o.filename&&(r+="&filename=".concat(o.filename)),void 0!==o.streaming&&(r+="&streaming=".concat(o.streaming)),o.externalPath){var a=this._correctRelativePath(o.externalPath);a=encodeURIComponent(a),r+="&p=".concat(a)}if(o.encryption&&(r+="&auto_load=false"),o.enableAnnotations&&(r+="&a=1"),o.disabledElements){var s=encodeURIComponent(o.disabledElements.join(","));r+="&disabledElements=".concat(s)}if(o.serverUrl){var c=this._correctRelativePath(o.serverUrl);c=encodeURIComponent(c),r+="&server_url=".concat(c)}if(o.serverUrlHeaders&&(r+="&serverUrlHeaders=".concat(JSON.stringify(o.serverUrlHeaders))),o.documentId&&(r+="&did=".concat(o.documentId)),o.css){var l=this._correctRelativePath(o.css);l=encodeURIComponent(l),r+="&css=".concat(l)}(o.disableI18n&&(r+="&disableI18n=1"),o.enableOfflineMode&&(r+="&offline=1"),o.startOffline&&(r+="&startOffline=1"),(o.enableReadOnlyMode||o.isReadOnly)&&(r+="&readonly=1"),o.hideAnnotationPanel&&(r+="&hideAnnotationPanel=1"),o.disableToolGroupReordering&&(r+="&disableToolGroupReordering=1"),void 0!==o.annotationUser&&(r+="&user=".concat(o.annotationUser)),void 0===o.annotationAdmin&&void 0===o.isAdminUser||(r+="&admin=".concat(o.annotationAdmin||o.isAdminUser?1:0)),void 0!==o.custom&&(r+="&custom=".concat(encodeURIComponent(o.custom))),void 0===o.showLocalFilePicker&&void 0===o.enableFilePicker||(r+="&filepicker=".concat(o.showLocalFilePicker||o.enableFilePicker?1:0)),void 0!==o.fullAPI&&(r+="&pdfnet=".concat(o.fullAPI?1:0)),void 0!==o.enableRedaction&&(r+="&enableRedaction=".concat(o.enableRedaction?1:0)),void 0!==o.disableVirtualDisplayMode&&(r+="&disableVirtualDisplayMode=".concat(o.disableVirtualDisplayMode?1:0)),void 0!==o.hideDetachedReplies&&(r+="&hideDetachedReplies=".concat(o.hideDetachedReplies?1:0)),void 0!==o.enableMeasurement&&(r+="&enableMeasurement=".concat(o.enableMeasurement?1:0)),void 0!==o.showToolbarControl&&(r+="&toolbar=".concat(o.showToolbarControl?"true":"false")),void 0!==o.notesInLeftPanel&&(r+="&notesInLeftPanel=".concat(o.notesInLeftPanel?1:0)),void 0!==o.autoExpandOutlines&&(r+="&autoExpandOutlines=".concat(o.autoExpandOutlines?1:0)),void 0!==o.enableAnnotationNumbering&&(r+="&enableAnnotationNumbering=".concat(o.enableAnnotationNumbering?1:0)),void 0!==o.enableOfficeEditing&&(r+="&enableOfficeEditing=".concat(o.enableOfficeEditing?1:0)),o.officeEditorOptions&&(r+="&officeEditorOptions=".concat(JSON.stringify(o.officeEditorOptions))),void 0!==o.spreadsheetEditorOptions&&(r+="&spreadsheetEditorOptions=".concat(JSON.stringify(o.spreadsheetEditorOptions))),void 0!==o.xdomainProxyUrl)&&(n="string"==typeof o.xdomainProxyUrl?{url:o.xdomainProxyUrl}:o.xdomainProxyUrl,r+="&xdomain_urls=".concat(encodeURIComponent(JSON.stringify(n))));return(o.azureWorkaround||o.enableAzureWorkaround)&&(r+="&azureWorkaround=1"),o.enableOptimizedWorkers||(r+="&enableOptimizedWorkers=0"),o.useDownloader||(r+="&useDownloader=0"),o.disableWebsockets&&(r+="&disableWebsockets=1"),o.defaultLanguage&&(r+="&defaultLanguage=".concat(o.defaultLanguage)),o.disableStreaming&&(r+="&disableStreaming=1"),o.forceClientSideInit&&(r+="&forceClientSideInit=1"),o.loadAsPDF&&(r+="&loadAsPDF=1"),void 0!==o.workerTransportPromise&&(r+="&useSharedWorker=".concat(o.workerTransportPromise?"true":"false")),void 0!==i&&i&&(r+="&webviewerServerURL=".concat(encodeURIComponent(i))),o.fallbackToClientSide&&(r+="&fallbackToClientSide=1"),void 0!==o.singleServerMode&&(r+="&singleServerMode=".concat(o.singleServerMode?"true":"false")),void 0!==o.webviewerServerRangeRequests&&(r+="&wvsRange=".concat(o.webviewerServerRangeRequests?"true":"false")),void 0!==o.accessibleMode&&(r+="&accessibleMode=".concat(o.accessibleMode?1:0)),o.disableLogs&&(r+="&disableLogs=1"),o.enableViewStateAnnotations&&(r+="&enableViewStateAnnotations=1"),o.disableFlattenedAnnotations&&(r+="&disableFlattenedAnnotations=1"),o.highContrastMode&&(r+="&highContrastMode=1"),void 0!==o.selectAnnotationOnCreation&&(r+="&selectAnnotationOnCreation=".concat(o.selectAnnotationOnCreation?1:0)),void 0!==o.autoFocusNoteOnAnnotationSelection&&(r+="&autoFocusNoteOnAnnotationSelection=".concat(o.autoFocusNoteOnAnnotationSelection?1:0)),o.disableIndexedDB&&(r+="&disableIndexedDB=1"),o.disableMultiViewerComparison&&(r+="&disableMultiViewerComparison=1"),o.showInvalidBookmarks&&(r+="&showInvalidBookmarks=1"),o.disableObjectURLBlobs&&(r+="&disableObjectURLBlobs=".concat(o.disableObjectURLBlobs)),r+="&id=".concat(this.id),(r+="&basePath=".concat(encodeURIComponent(window.location.pathname))).length>0&&"&"===r[0]&&(r="#".concat(r.slice(1))),r+="&webViewerJSVersion=".concat(this.version),o.ui&&(r+="&ui=".concat(o.ui)),o.uiConfig&&(r+="&uiConfig=".concat(o.uiConfig)),o.initialMode&&(r+="&initialMode=".concat(o.initialMode)),o.chunkSize&&(r+="&chunkSize=".concat(o.chunkSize)),"undefined"!==o.enableCompositionInput&&(r+="&enableCompositionInput=".concat(o.enableCompositionInput?1:0)),r},setInstanceData:function(e){A.set(this.element,{iframe:e,l:this.options.l||this.options.licenseKey,workerTransportPromise:this.options.workerTransportPromise})},_createHTML5:function(){var e=this,t=this.options.uiPath+this._getHTML5OptionsURL(),n=document.createElement("iframe");this.setInstanceData(n),n.id="webviewer-".concat(this.id),n.src=t,n.title="webviewer",n.frameBorder=0,n.width="100%",n.height="100%",n.setAttribute("allowfullscreen",!0),n.setAttribute("webkitallowfullscreen",!0),n.setAttribute("mozallowfullscreen",!0),this.iframe=n,this.options.backgroundColor&&n.setAttribute("data-bgcolor",this.options.backgroundColor),this.options.assetPath&&n.setAttribute("data-assetpath",encodeURIComponent(this.options.assetPath)),this.element.appendChild(n);var o=function(t){if("viewerLoaded"===t.data.type&&t.data.id===e.id)try{e.instance=e.iframe.contentWindow.instance}catch(e){}finally{window.removeEventListener("message",o),e._viewerLoaded(e.iframe)}};window.addEventListener("message",o)},_createHTML5Mobile:function(){var e=this,t=this.options.uiPath+this._getHTML5OptionsURL(),n=document.createElement("iframe");this.setInstanceData(n),n.id="webviewer-".concat(this.id),n.src=t,n.frameborder=0,this.options.assetPath&&n.setAttribute("data-assetpath",encodeURIComponent(this.options.assetPath)),n.style.width="100%",n.style.height="100%",this.iframe=n,this.element.appendChild(n);var o=function(t){if("viewerLoaded"===t.data.type&&t.data.id===e.id)try{e.instance=e.iframe.contentWindow.instance}catch(e){}finally{window.removeEventListener("message",o),e._viewerLoaded(e.iframe)}};window.addEventListener("message",o)},dispose:function(){var e=this;return new Promise((function(t){A.delete(e.element),C.delete(e.element),window.removeEventListener("message",e.messageHandler),e.iframe=null,console.clear(),e.instance.Core.documentViewer.unmount().then((function(){t()}))}))},getInstance:function(){return this.instance},setCompleteInstance:function(e){this.completeInstance=e},getCompleteInstance:function(){return this.completeInstance},_correctRelativePath:function(e){var t=window.location.pathname;return Array.isArray(e)?e.map((function(e){return i(e,t)})):i(e,t)},_testHTML5:function(){try{var e=document.createElement("canvas");return e&&e.getContext("2d")}catch(e){return!1}},_testWebAssembly:function(){return!(!window.WebAssembly||!window.WebAssembly.validate)},_testCORS:function(){return"XMLHttpRequest"in window&&"withCredentials"in new XMLHttpRequest},isIE:function(){var e=navigator.userAgent.toLowerCase(),t=/(msie) ([\w.]+)/.exec(e)||/(trident)(?:.*? rv:([\w.]+)|)/.exec(e);return t?parseInt(t[2],10):t},isMobileDevice:function(){return!this.isIE()&&(0===this.scrollbarWidth()&&navigator.userAgent.match(/Edge/i)||navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/webOS/i)||navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPod/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Touch/i)||navigator.userAgent.match(/IEMobile/i)||navigator.userAgent.match(/Silk/i))},scrollbarWidth:function(){var e=document.createElement("div");e.style.cssText="width:100px;height:100px;overflow:scroll !important;position:absolute;top:-9999px",document.body.appendChild(e);var t=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),t},isSameOrigin:function(e){var t=window.location,n=document.createElement("a");n.href=e,""===n.host&&(n.href=n.href);var o=window.location.port,i=n.port;return"http:"===n.protocol?(i=i||"80",o=o||"80"):"https:"===n.protocol&&(i=i||"443",o=o||"443"),n.hostname===t.hostname&&n.protocol===t.protocol&&i===o}},P.WebViewer.Options={initialDoc:void 0,annotationAdmin:void 0,isAdminUser:void 0,annotationUser:void 0,assetPath:void 0,autoCreate:!0,autoFocusNoteOnAnnotationSelection:!0,azureWorkaround:!1,additionalTranslations:void 0,enableAzureWorkaround:!1,enableOptimizedWorkers:!0,backgroundColor:void 0,backendType:void 0,css:void 0,config:void 0,custom:void 0,documentId:void 0,documentType:void 0,preloadWorker:void 0,extension:void 0,enableAnnotations:!0,filename:void 0,disableI18n:!1,disabledElements:void 0,disableWebsockets:!1,enableOfflineMode:!1,enableReadOnlyMode:!1,isReadOnly:!1,enableRedaction:!1,disableVirtualDisplayMode:!1,enableMeasurement:!1,encryption:void 0,externalPath:void 0,hideAnnotationPanel:!1,disableToolGroupReordering:!1,uiPath:"./ui/index.html",l:void 0,licenseKey:void 0,mobileRedirect:!1,path:"",pdfBackend:void 0,webviewerServerURL:void 0,webviewerServerRangeRequests:!0,fallbackToClientSide:!1,singleServerMode:!1,fullAPI:!1,preloadPDFWorker:!0,serverUrl:void 0,serverUrlHeaders:void 0,showLocalFilePicker:!1,enableFilePicker:!1,showToolbarControl:void 0,startOffline:!1,streaming:void 0,type:"html5",useDownloader:!0,workerTransportPromise:void 0,xdomainProxyUrl:void 0,ui:void 0,uiConfig:void 0,forceClientSideInit:!1,loadAsPDF:!1,accessibleMode:void 0,disableLogs:!1,enableViewStateAnnotations:!1,highContrastMode:!1,selectAnnotationOnCreation:!1,notesInLeftPanel:!1,autoExpandOutlines:!1,enableAnnotationNumbering:!1,enableOfficeEditing:!1,officeEditorOptions:{},spreadsheetEditorOptions:{},documentXFDFRetriever:void 0,disableMultiViewerComparison:void 0,showInvalidBookmarks:!0,disableObjectURLBlobs:!1,initialMode:void 0,defaultLanguage:"en",chunkSize:void 0,enableCompositionInput:!1,disableFlattenedAnnotations:!1,disableStreaming:!1};var M=function(e){for(var t=S(A),n=0;n<t.length;n++){var o=t[n];if(o.iframe===e)return o}return null},R=w;R.l=function(e){var t=M(e);return t&&t.l},R.workerTransportPromise=function(e){var t=M(e);return t&&t.workerTransportPromise},R.WorkerTypes={ALL:"all",OFFICE:"office",LEGACY_OFFICE:"legacyOffice",PDF:"pdf",CONTENT_EDIT:"contentEdit",OFFICE_EDITOR:"officeEditor"},R.BackendTypes=o,R.Modes={DEFAULT:"default",DOCX_EDITOR:"docxEditor",SPREADSHEET_EDITOR:"spreadsheetEditor"};var L=function(e){var t=S(A);if(!t.length||!t.filter((function(e){return e.instance})).length)return console.warn("WebViewer.getInstance() was called before any instances were available"),null;if(t.length>1&&!e)throw new Error("More than one instance of WebViewer was found, and no element was passed into getInstance(). Please specify which instance you want to get.");return e?(A.get(e)||{}).instance:(t[0]||{}).instance},W=function(e,t){A.set(e,{instance:t})},x=function(e){A.delete(e),C.delete(e)};R.getInstance=L,window.WebViewer=R,R.WebComponent=R,R.Iframe=function(e,t){return new Promise((function(n,o){e.l=e.l||e.licenseKey,e.azureWorkaround=e.azureWorkaround||e.enableAzureWorkaround,e.annotationAdmin=e.annotationAdmin||e.isAdminUser,e.enableReadOnlyMode=e.enableReadOnlyMode||e.isReadOnly,e.showLocalFilePicker=e.showLocalFilePicker||e.enableFilePicker;var i=function(){t.removeEventListener("ready",i);try{var a=t.querySelector("iframe").contentWindow;if(void 0===a.Core.Tools)throw new Error("Viewer isn't instantiated correctly. It could be caused by the 'path' option in the WebViewer constructor not being defined correctly. The 'path' option should be relative to the HTML file you're loading the script on and the lib folder needs to be publicly accessible.");var s=r.getInstance(),c={iframeWindow:a,dispose:r.dispose.bind(r)},l=I({},s,T({},s.UI_NAMESPACE_KEY,O(O({},s[s.UI_NAMESPACE_KEY]),c)));r.setCompleteInstance(l);var d=Promise.resolve();if(e.documentXFDFRetriever&&(d=l[s.CORE_NAMESPACE_KEY].documentViewer.setDocumentXFDFRetriever(e.documentXFDFRetriever)),e.additionalTranslations){var u=e.additionalTranslations;l[s.UI_NAMESPACE_KEY].setTranslations(u.language,u.translations)}d.then((function(){n(l)}))}catch(t){if("config"in e&&""!==e.config)return n();o("Viewer is on a different domain, the promise from WebViewer function is rejected and API functions will not work because of cross domain permissions. See https://docs.apryse.com/documentation/web/guides/wv-inside/#loading-webviewer-from-another-domain for more information.")}};t.addEventListener("ready",i);var r=new P.WebViewer(e,t)}))};t.default=R}])}));
1
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(window,(function(){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(o,i,function(t){return e[t]}.bind(null,i));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=1)}([function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){n(2),e.exports=n(6)},function(e,t,n){(function(o,i){var r,a;function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(o,i){"object"==s(t)&&void 0!==e?i():void 0===(a="function"==typeof(r=i)?r.call(t,n,t,e):r)||(e.exports=a)}(0,(function(){"use strict";function e(e){var t=this.constructor;return this.then((function(n){return t.resolve(e()).then((function(){return n}))}),(function(n){return t.resolve(e()).then((function(){return t.reject(n)}))}))}function t(){}function n(e){if(!(this instanceof n))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],d(e,this)}function r(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,n._immediateFn((function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var o;try{o=n(e._value)}catch(e){return void c(t.promise,e)}a(t.promise,o)}else(1===e._state?a:c)(t.promise,e._value)}))):e._deferreds.push(t)}function a(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==s(t)||"function"==typeof t)){var o=t.then;if(t instanceof n)return e._state=3,e._value=t,void l(e);if("function"==typeof o)return void d(function(e,t){return function(){e.apply(t,arguments)}}(o,t),e)}e._state=1,e._value=t,l(e)}catch(t){c(e,t)}}function c(e,t){e._state=2,e._value=t,l(e)}function l(e){2===e._state&&0===e._deferreds.length&&n._immediateFn((function(){e._handled||n._unhandledRejectionFn(e._value)}));for(var t=0,o=e._deferreds.length;o>t;t++)r(e,e._deferreds[t]);e._deferreds=null}function d(e,t){var n=!1;try{e((function(e){n||(n=!0,a(t,e))}),(function(e){n||(n=!0,c(t,e))}))}catch(e){if(n)return;n=!0,c(t,e)}}var u=setTimeout;n.prototype.catch=function(e){return this.then(null,e)},n.prototype.then=function(e,n){var o=new this.constructor(t);return r(this,new function(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}(e,n,o)),o},n.prototype.finally=e,n.all=function(e){return new n((function(t,n){function o(e,a){try{if(a&&("object"==s(a)||"function"==typeof a)){var c=a.then;if("function"==typeof c)return void c.call(a,(function(t){o(e,t)}),n)}i[e]=a,0==--r&&t(i)}catch(e){n(e)}}if(!e||void 0===e.length)throw new TypeError("Promise.all accepts an array");var i=Array.prototype.slice.call(e);if(0===i.length)return t([]);for(var r=i.length,a=0;i.length>a;a++)o(a,i[a])}))},n.resolve=function(e){return e&&"object"==s(e)&&e.constructor===n?e:new n((function(t){t(e)}))},n.reject=function(e){return new n((function(t,n){n(e)}))},n.race=function(e){return new n((function(t,n){for(var o=0,i=e.length;i>o;o++)e[o].then(t,n)}))},n._immediateFn="function"==typeof o&&function(e){o(e)}||function(e){u(e,0)},n._unhandledRejectionFn=function(e){void 0!==console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};var f=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==i)return i;throw Error("unable to locate global object")}();"Promise"in f?f.Promise.prototype.finally||(f.Promise.prototype.finally=e):f.Promise=n}))}).call(this,n(3).setImmediate,n(0))},function(e,t,n){(function(e){var o=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function r(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new r(i.call(setTimeout,o,arguments),clearTimeout)},t.setInterval=function(){return new r(i.call(setInterval,o,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},r.prototype.unref=r.prototype.ref=function(){},r.prototype.close=function(){this._clearFn.call(o,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(4),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(0))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var o,i,r,a,s,c=1,l={},d=!1,u=e.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(e);f=f&&f.setTimeout?f:e,"[object process]"==={}.toString.call(e.process)?o=function(e){t.nextTick((function(){m(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((r=new MessageChannel).port1.onmessage=function(e){m(e.data)},o=function(e){r.port2.postMessage(e)}):u&&"onreadystatechange"in u.createElement("script")?(i=u.documentElement,o=function(e){var t=u.createElement("script");t.onreadystatechange=function(){m(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):o=function(e){setTimeout(m,0,e)}:(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&m(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),o=function(t){e.postMessage(a+t,"*")}),f.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var i={callback:e,args:t};return l[c]=i,o(c),c++},f.clearImmediate=p}function p(e){delete l[e]}function m(e){if(d)setTimeout(m,0,e);else{var t=l[e];if(t){d=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(void 0,n)}}(t)}finally{p(e),d=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,n(0),n(5))},function(e,t){var n,o,i=e.exports={};function r(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===r||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:r}catch(e){n=r}try{o="function"==typeof clearTimeout?clearTimeout:a}catch(e){o=a}}();var c,l=[],d=!1,u=-1;function f(){d&&c&&(d=!1,c.length?l=c.concat(l):u=-1,l.length&&p())}function p(){if(!d){var e=s(f);d=!0;for(var t=l.length;t;){for(c=l,l=[];++u<t;)c&&c[u].run();u=-1,t=l.length}c=null,d=!1,function(e){if(o===clearTimeout)return clearTimeout(e);if((o===a||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(e);try{o(e)}catch(t){try{return o.call(null,e)}catch(t){return o.call(this,e)}}}(e)}}function m(e,t){this.fun=e,this.array=t}function h(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new m(e,t)),1!==l.length||d||s(p)},m.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=h,i.addListener=h,i.once=h,i.off=h,i.removeListener=h,i.removeAllListeners=h,i.emit=h,i.prependListener=h,i.prependOnceListener=h,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t,n){"use strict";n.r(t),n.d(t,"getInstance",(function(){return L})),n.d(t,"setInstanceForWebComponent",(function(){return W})),n.d(t,"clearInstanceForWebComponent",(function(){return x}));var o={ASM:"asm",WASM:"ems",JS_WORKER:"jsworker",THREADED_WASM:"wasm-threads"};function i(e,t){if("string"!=typeof e||!t)return e;var n=t.substr(0,t.lastIndexOf("/"));return/^(\/|%2F|[a-z0-9-]+:)/i.test(e)?e:"".concat(n,"/").concat(e)}function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,c(o.key),o)}}function c(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}function l(e,t,n){return t=m(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,f()?Reflect.construct(t,n||[],m(e).constructor):t.apply(e,n))}function d(e){var t="function"==typeof Map?new Map:void 0;return(d=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return u(e,arguments,m(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),p(n,e)})(e)}function u(e,t,n){if(f())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,t);var i=new(e.bind.apply(e,o));return n&&p(i,n.prototype),i}function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(f=function(){return!!e})()}function p(e,t){return(p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var h=0,v=function(){var e=localStorage.getItem("wv_instanceIds");if((e=e?e.split(","):[]).length&&e[h]){var t=e[h];return h++,t}var n=Math.random().toString(36).slice(-6);return-1===e.findIndex((function(e){return e===n}))?(e.push(n),localStorage.setItem("wv_instanceIds",e),h++,n):v()},b=function(e){function t(){return a(this,t),l(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&p(e,t)}(t,e),n=t,(o=[{key:"connectedCallback",value:function(){if(!this.shadowRoot){var e=this.attachShadow({mode:"open"}),t=this.getAttribute("path"),n=this.getAttribute("uiPath");window.apryseCoreScriptPromise&&window.Core||(window.Core&&(window.apryseCoreScriptPromise=Promise.resolve()),window.apryseCoreScriptLoading||(window.apryseCoreScriptLoading=!0,window.apryseCoreScriptPromise=new Promise((function(e){var n=document.createElement("script");n.src="".concat(t,"/core/webviewer-core.min.js"),n.onload=function(){window.apryseCoreScriptLoading=!1,e()},window.document.head.appendChild(n)}))));var o="ui/index-wc.html";n&&(o=n),window.isApryseWebViewerWebComponent=!0,window.webViewerPath=t,this.id=this.getAttribute("id")||v()||"default",window.apryseCoreScriptPromise.then((function(){fetch("".concat(t,"/").concat(o)).then((function(e){return e.text()})).then((function(n){e.innerHTML=n,function e(t,n){if(!0===function(e){return"SCRIPT"===e.tagName}(t))t.parentNode.replaceChild(function(e,t){var n=document.createElement("script");n.text=e.innerHTML;for(var o=-1,i=e.attributes;++o<i.length;){var r=i[o];"src"===r.name?n.setAttribute("src","".concat(t).concat(r.value)):n.setAttribute(r.name,r.value)}return n.async=!1,n}(t,n),t);else for(var o=-1,i=t.childNodes;++o<i.length;)e(i[o],n);return t}(e,t),window.dispatchEvent(new Event("webviewerloaded"))}))})).catch((function(e){return console.error(e)}))}}}])&&s(n.prototype,o),i&&s(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,o,i}(d(HTMLElement));try{customElements.define("apryse-webviewer",b)}catch(e){console.warn("This environment does not allow for usage of the WebComponent version of WebViewer: ".concat(e))}var w=function(e,t){return new Promise((function(n,o){var i,r,a,s=document.createElement("apryse-webviewer");s.setAttribute("id","wc-".concat(t.id)),e.l=e.l||e.licenseKey,e.azureWorkaround=e.azureWorkaround||e.enableAzureWorkaround,e.annotationAdmin=e.annotationAdmin||e.isAdminUser,e.enableReadOnlyMode=e.enableReadOnlyMode||e.isReadOnly,e.showLocalFilePicker=e.showLocalFilePicker||e.enableFilePicker,e.useSharedWorker=e.workerTransportPromise?"true":"false",e.path=e.path||"/lib",e.officeEditorOptions=JSON.stringify(e.officeEditorOptions||{}),e.css&&(i=t,r=e.css,(a=document.createElement("link")).setAttribute("rel","stylesheet"),a.setAttribute("href","".concat(r)),i.appendChild(a)),e.workerTransportPromise&&(window.apryseWorkerTransportPromise=e.workerTransportPromise),e.l&&(window.apryse_l=btoa(e.l));var c=["disableLogs","highContrastMode"];for(var l in["autoCreate","autoFocusNoteOnAnnotationSelection","enableOptimizedWorkers","enableAnnotations","preloadPDFWorker","useDownloader","showInvalidBookmarks"].forEach((function(t){void 0===(null==e?void 0:e[t])&&(e[t]=!0)})),e)if(void 0!==(null==e?void 0:e[l])&&null!==(null==e?void 0:e[l]))if(c.includes(l)&&!1===e[l])s.removeAttribute(l);else if("encryption"===l)s.setAttribute("auto_load",!1);else if("licenseKey"!==l&&"l"!==l){var d=Array.isArray(e[l])?JSON.stringify(e[l]):e[l];s.setAttribute(l,d)}s.setAttribute("webviewerjsversion","11.9.1");var u=function(t){"requestl"===t.data&&t.source&&t.source.postMessage({type:"responsel",value:e.l||e.licenseKey},"*")};t.appendChild(s),s.addEventListener("ready",(function(){if(e.config){var o=document.createElement("script");o.src=e.config,document.body.appendChild(o)}if(e.encryption){var i=e.initialDoc,r={decrypt:s.instance.Core.Encryption.decrypt,decryptOptions:e.encryption,documentId:e.documentId,extension:"xod"};s.instance.UI.loadDocument(i,r)}if(e.additionalTranslations){var a=e.additionalTranslations;s.instance.UI.setTranslations(a.language,a.translations)}W(t,s.instance),s.instance.UI.dispose=function(){return new Promise((function(e){x(t),window.removeEventListener("message",u),s.shadowRoot.getElementById("app").dispatchEvent(new Event("webcomponentUnmounted")),console.clear(),s.instance.Core.documentViewer.closeDocument().then((function(){e()}))}))},n(s.instance)})),window.addEventListener("message",u,!1)}))};function y(e){return(y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach((function(t){T(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function T(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=y(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=y(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==y(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}window.WebViewerWebComponent=w;var P={},E=0;"undefined"==typeof console&&(window.console={log:function(){},warn:function(){},error:function(){}});var I=function(){for(var e=1;e<arguments.length;e++)for(var t=Object.keys(arguments[e]),n=0;n<t.length;n++)arguments[0][t[n]]=arguments[e][t[n]];return arguments[0]},S=function(e){var t=[];return e.forEach((function(e){t.push(e)})),t},_=function(e,t){var n;try{n=new CustomEvent(e,{detail:t,bubbles:!0,cancelable:!0})}catch(o){(n=document.createEvent("Event")).initEvent(e,!0,!0),n.detail=t}return n};window.PDFNet&&!P.skipPDFNetWebViewerWarning&&console.warn("PDFNet.js and WebViewer.js have been included in the same context. See https://community.apryse.com/t/what-is-the-best-location-to-call-pdfnet-apis-when-used-in-conjunction-with-webviewer/5210 for an explanation of why this could be an error in your application.");var A=new Map,C=new Map;P.WebViewer=function(e,t){var n=this;if(C.get(t))throw new Error("Two instances of WebViewer were created on the same HTML element. Please create a new element for each instance of WebViewer");C.set(t,!0);var o=function(){A.get(t).instance=n.getCompleteInstance(),t.removeEventListener("ready",o)};t.addEventListener("ready",o),this._validateOptions(e);var i=e.webviewerServerURL||e.pdftronServer;e.fullAPI&&i&&(e.forceClientSideInit||console.warn("The fullAPI and webviewerServerURL options have both been set so the forceClientSideInit option is now enabled. This means that WebViewer will switch to client side rendering and processing to allow use of the full API."),e.forceClientSideInit=!0),this.options=I({},P.WebViewer.Options,e);var r=this.options.path.length-1;r>0&&"/"!==this.options.path[r]&&(this.options.path+="/"),this.options.uiPath=this.options.path+this.options.uiPath,t||console.error("ViewerElement is not defined. This may be caused by calling the WebViewer constructor before the DOM is loaded, or an invalid selector. Please see https://docs.apryse.com/documentation/web/get-started/ for an example."),this.element=t,this.element.style.overflow="hidden";var a=this;this.messageHandler=function(t){if("requestl"===t.data&&t.source&&t.source.postMessage({type:"responsel",value:e.l||e.licenseKey},"*"),"requestConfig"===t.data.type&&t.data.id===a.id&&t.source){var n=e.config?a._correctRelativePath(e.config):"";t.source.postMessage({type:"responseConfig",value:n},"*")}},window.addEventListener("message",this.messageHandler,!1),this.options.autoCreate&&this.create()};var k={licenseKey:void 0,enableAzureWorkaround:!1,isAdminUser:!1,isReadOnly:!1};P.WebViewer.prototype={version:"11.9.1",create:function(){if(this.options.initialDoc){var e=this._correctRelativePath(this.options.initialDoc);e=encodeURIComponent(JSON.stringify(e)),this.options.initialDoc=e}this._create()},_create:function(){this.id=++E,void 0===this._trigger&&(this._trigger=function(e,t){var n=_(e,t);this.element.dispatchEvent(n)});var e=this.options.type.replace(" ","").split(",");e.length<1&&(e[0]="html5"),this._createViewer(e)},_validateOptions:function(e){for(var t=Object.keys(e),n=0;n<t.length;n++){var o=t[n];o in I({},k,P.WebViewer.Options)||console.warn("".concat(o," is not a valid option name. See https://docs.apryse.com/api/web/global.html#WebViewerOptions for all available options."))}var i=e.webviewerServerURL||e.pdftronServer;!e.enableRedaction||e.fullAPI||i||console.warn("FullAPI or WebViewer Server is needed to apply redactions")},_notSupportedMobile:function(){var e=document.createElement("div");e.id="webviewer-browser-unsupported",e.textContent="PDF document viewing is not supported by this browser.",this.element.appendChild(e)},_createViewer:function(e){var t,n=this;if(n.selectedType=null,this.isMobileDevice()){if(this.options.documentType&&"xod"!==this.options.documentType&&!this._testWebAssembly())return void this._notSupportedMobile();if(e=Array("html5Mobile"),n.selectedType="html5Mobile",this.options.mobileRedirect)return t=this.options.uiPath+this._getHTML5OptionsURL(),void(window.location=t)}for(var o=!1,i=!1,r=0;r<e.length;r++){if("html5mobile"===e[r].toLowerCase()){if(this.options.documentType&&"xod"!==this.options.documentType&&!this._testWebAssembly())continue;if(o=!0,n._testHTML5()){if(this.options.mobileRedirect)return n.selectedType="html5Mobile",t=this.options.uiPath+this._getHTML5OptionsURL(),void(window.location=t);if(this.options.xdomainProxyUrl||n.isSameOrigin(decodeURIComponent(n.options.initialDoc))||n._testCORS()){n.selectedType="html5Mobile";break}i=!0}}if("html5"===e[r].toLowerCase()&&(o=!0,n._testHTML5())){var a=n.isSameOrigin(decodeURIComponent(n.options.initialDoc));if(this.options.xdomainProxyUrl||a||n._testCORS()){n.selectedType="html5";break}i=!0}}if("html5"===n.selectedType)n._createHTML5();else if("html5Mobile"===n.selectedType)n._createHTML5Mobile();else{var s;if(i?s="This browser does not support cross origin requests. Please configure xdomain to support CORS.":o&&(s="Please use an HTML5 compatible browser."),s){var c=document.createElement("div");c.id="webviewer-browser-unsupported",c.textContent=s,n.element.appendChild(c)}}},_viewerLoaded:function(e){this._trigger("ready");try{var t=e.contentWindow;if(t.postMessage({type:"viewerLoaded"},"*"),void 0!==this.options.encryption){var n=decodeURIComponent(this.options.initialDoc);this.options.initialDoc&&(n=JSON.parse(n));var o={decrypt:t.Core.Encryption.decrypt,decryptOptions:this.options.encryption,documentId:this.options.documentId,extension:"xod"};this.getInstance().UI.loadDocument(n,o)}}catch(e){console.warn("Viewer is on a different domain, the promise from WebViewer function is rejected and API functions will not work because of cross domain permissions. See https://docs.apryse.com/documentation/web/guides/wv-inside/#loading-webviewer-from-another-domain for more information.")}},_getHTML5OptionsURL:function(){var e,t,n,o=this.options,i=o.webviewerServerURL||o.pdftronServer,r="";if(o.initialDoc&&(r+="#d=".concat(o.initialDoc)),void 0===o.backendType&&(o.backendType=o.pdfBackend),o.documentType&&"xod"===o.documentType&&(e=o.documentType),o.preloadWorker&&"xod"===o.preloadWorker&&(e=o.preloadWorker),o.extension&&(e=o.extension),e&&(r+="&extension=".concat(e)),o.documentType&&"xod"!==o.documentType&&(t=o.documentType),o.preloadWorker&&"xod"!==o.preloadWorker&&(t=o.preloadWorker),t&&(r+="&preloadWorker=".concat(t)),o.backendType&&(r+="&pdf=".concat(o.backendType,"&office=").concat(o.backendType,"&legacyOffice=").concat(o.backendType)),o.filename&&(r+="&filename=".concat(o.filename)),void 0!==o.streaming&&(r+="&streaming=".concat(o.streaming)),o.externalPath){var a=this._correctRelativePath(o.externalPath);a=encodeURIComponent(a),r+="&p=".concat(a)}if(o.encryption&&(r+="&auto_load=false"),o.enableAnnotations&&(r+="&a=1"),o.disabledElements){var s=encodeURIComponent(o.disabledElements.join(","));r+="&disabledElements=".concat(s)}if(o.serverUrl){var c=this._correctRelativePath(o.serverUrl);c=encodeURIComponent(c),r+="&server_url=".concat(c)}if(o.serverUrlHeaders&&(r+="&serverUrlHeaders=".concat(JSON.stringify(o.serverUrlHeaders))),o.documentId&&(r+="&did=".concat(o.documentId)),o.css){var l=this._correctRelativePath(o.css);l=encodeURIComponent(l),r+="&css=".concat(l)}(o.disableI18n&&(r+="&disableI18n=1"),o.enableOfflineMode&&(r+="&offline=1"),o.startOffline&&(r+="&startOffline=1"),(o.enableReadOnlyMode||o.isReadOnly)&&(r+="&readonly=1"),o.hideAnnotationPanel&&(r+="&hideAnnotationPanel=1"),o.disableToolGroupReordering&&(r+="&disableToolGroupReordering=1"),void 0!==o.annotationUser&&(r+="&user=".concat(o.annotationUser)),void 0===o.annotationAdmin&&void 0===o.isAdminUser||(r+="&admin=".concat(o.annotationAdmin||o.isAdminUser?1:0)),void 0!==o.custom&&(r+="&custom=".concat(encodeURIComponent(o.custom))),void 0===o.showLocalFilePicker&&void 0===o.enableFilePicker||(r+="&filepicker=".concat(o.showLocalFilePicker||o.enableFilePicker?1:0)),void 0!==o.fullAPI&&(r+="&pdfnet=".concat(o.fullAPI?1:0)),void 0!==o.enableRedaction&&(r+="&enableRedaction=".concat(o.enableRedaction?1:0)),void 0!==o.disableVirtualDisplayMode&&(r+="&disableVirtualDisplayMode=".concat(o.disableVirtualDisplayMode?1:0)),void 0!==o.hideDetachedReplies&&(r+="&hideDetachedReplies=".concat(o.hideDetachedReplies?1:0)),void 0!==o.enableMeasurement&&(r+="&enableMeasurement=".concat(o.enableMeasurement?1:0)),void 0!==o.showToolbarControl&&(r+="&toolbar=".concat(o.showToolbarControl?"true":"false")),void 0!==o.notesInLeftPanel&&(r+="&notesInLeftPanel=".concat(o.notesInLeftPanel?1:0)),void 0!==o.autoExpandOutlines&&(r+="&autoExpandOutlines=".concat(o.autoExpandOutlines?1:0)),void 0!==o.enableAnnotationNumbering&&(r+="&enableAnnotationNumbering=".concat(o.enableAnnotationNumbering?1:0)),void 0!==o.enableOfficeEditing&&(r+="&enableOfficeEditing=".concat(o.enableOfficeEditing?1:0)),o.officeEditorOptions&&(r+="&officeEditorOptions=".concat(JSON.stringify(o.officeEditorOptions))),void 0!==o.spreadsheetEditorOptions&&(r+="&spreadsheetEditorOptions=".concat(JSON.stringify(o.spreadsheetEditorOptions))),void 0!==o.xdomainProxyUrl)&&(n="string"==typeof o.xdomainProxyUrl?{url:o.xdomainProxyUrl}:o.xdomainProxyUrl,r+="&xdomain_urls=".concat(encodeURIComponent(JSON.stringify(n))));return(o.azureWorkaround||o.enableAzureWorkaround)&&(r+="&azureWorkaround=1"),o.enableOptimizedWorkers||(r+="&enableOptimizedWorkers=0"),o.useDownloader||(r+="&useDownloader=0"),o.disableWebsockets&&(r+="&disableWebsockets=1"),o.defaultLanguage&&(r+="&defaultLanguage=".concat(o.defaultLanguage)),o.disableStreaming&&(r+="&disableStreaming=1"),o.forceClientSideInit&&(r+="&forceClientSideInit=1"),o.loadAsPDF&&(r+="&loadAsPDF=1"),void 0!==o.workerTransportPromise&&(r+="&useSharedWorker=".concat(o.workerTransportPromise?"true":"false")),void 0!==i&&i&&(r+="&webviewerServerURL=".concat(encodeURIComponent(i))),o.fallbackToClientSide&&(r+="&fallbackToClientSide=1"),void 0!==o.singleServerMode&&(r+="&singleServerMode=".concat(o.singleServerMode?"true":"false")),void 0!==o.webviewerServerRangeRequests&&(r+="&wvsRange=".concat(o.webviewerServerRangeRequests?"true":"false")),void 0!==o.accessibleMode&&(r+="&accessibleMode=".concat(o.accessibleMode?1:0)),o.disableLogs&&(r+="&disableLogs=1"),o.enableViewStateAnnotations&&(r+="&enableViewStateAnnotations=1"),o.disableFlattenedAnnotations&&(r+="&disableFlattenedAnnotations=1"),o.highContrastMode&&(r+="&highContrastMode=1"),void 0!==o.selectAnnotationOnCreation&&(r+="&selectAnnotationOnCreation=".concat(o.selectAnnotationOnCreation?1:0)),void 0!==o.autoFocusNoteOnAnnotationSelection&&(r+="&autoFocusNoteOnAnnotationSelection=".concat(o.autoFocusNoteOnAnnotationSelection?1:0)),o.disableIndexedDB&&(r+="&disableIndexedDB=1"),o.disableMultiViewerComparison&&(r+="&disableMultiViewerComparison=1"),o.showInvalidBookmarks&&(r+="&showInvalidBookmarks=1"),o.disableObjectURLBlobs&&(r+="&disableObjectURLBlobs=".concat(o.disableObjectURLBlobs)),r+="&id=".concat(this.id),(r+="&basePath=".concat(encodeURIComponent(window.location.pathname))).length>0&&"&"===r[0]&&(r="#".concat(r.slice(1))),r+="&webViewerJSVersion=".concat(this.version),o.ui&&(r+="&ui=".concat(o.ui)),o.uiConfig&&(r+="&uiConfig=".concat(o.uiConfig)),o.initialMode&&(r+="&initialMode=".concat(o.initialMode)),o.chunkSize&&(r+="&chunkSize=".concat(o.chunkSize)),"undefined"!==o.enableCompositionInput&&(r+="&enableCompositionInput=".concat(o.enableCompositionInput?1:0)),r},setInstanceData:function(e){A.set(this.element,{iframe:e,l:this.options.l||this.options.licenseKey,workerTransportPromise:this.options.workerTransportPromise})},_createHTML5:function(){var e=this,t=this.options.uiPath+this._getHTML5OptionsURL(),n=document.createElement("iframe");this.setInstanceData(n),n.id="webviewer-".concat(this.id),n.src=t,n.title="webviewer",n.frameBorder=0,n.width="100%",n.height="100%",n.setAttribute("allowfullscreen",!0),n.setAttribute("webkitallowfullscreen",!0),n.setAttribute("mozallowfullscreen",!0),this.iframe=n,this.options.backgroundColor&&n.setAttribute("data-bgcolor",this.options.backgroundColor),this.options.assetPath&&n.setAttribute("data-assetpath",encodeURIComponent(this.options.assetPath)),this.element.appendChild(n);var o=function(t){if("viewerLoaded"===t.data.type&&t.data.id===e.id)try{e.instance=e.iframe.contentWindow.instance}catch(e){}finally{window.removeEventListener("message",o),e._viewerLoaded(e.iframe)}};window.addEventListener("message",o)},_createHTML5Mobile:function(){var e=this,t=this.options.uiPath+this._getHTML5OptionsURL(),n=document.createElement("iframe");this.setInstanceData(n),n.id="webviewer-".concat(this.id),n.src=t,n.frameborder=0,this.options.assetPath&&n.setAttribute("data-assetpath",encodeURIComponent(this.options.assetPath)),n.style.width="100%",n.style.height="100%",this.iframe=n,this.element.appendChild(n);var o=function(t){if("viewerLoaded"===t.data.type&&t.data.id===e.id)try{e.instance=e.iframe.contentWindow.instance}catch(e){}finally{window.removeEventListener("message",o),e._viewerLoaded(e.iframe)}};window.addEventListener("message",o)},dispose:function(){var e=this;return new Promise((function(t){A.delete(e.element),C.delete(e.element),window.removeEventListener("message",e.messageHandler),e.iframe=null,console.clear(),e.instance.Core.documentViewer.unmount().then((function(){t()}))}))},getInstance:function(){return this.instance},setCompleteInstance:function(e){this.completeInstance=e},getCompleteInstance:function(){return this.completeInstance},_correctRelativePath:function(e){var t=window.location.pathname;return Array.isArray(e)?e.map((function(e){return i(e,t)})):i(e,t)},_testHTML5:function(){try{var e=document.createElement("canvas");return e&&e.getContext("2d")}catch(e){return!1}},_testWebAssembly:function(){return!(!window.WebAssembly||!window.WebAssembly.validate)},_testCORS:function(){return"XMLHttpRequest"in window&&"withCredentials"in new XMLHttpRequest},isIE:function(){var e=navigator.userAgent.toLowerCase(),t=/(msie) ([\w.]+)/.exec(e)||/(trident)(?:.*? rv:([\w.]+)|)/.exec(e);return t?parseInt(t[2],10):t},isMobileDevice:function(){return!this.isIE()&&(0===this.scrollbarWidth()&&navigator.userAgent.match(/Edge/i)||navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/webOS/i)||navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPod/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Touch/i)||navigator.userAgent.match(/IEMobile/i)||navigator.userAgent.match(/Silk/i))},scrollbarWidth:function(){var e=document.createElement("div");e.style.cssText="width:100px;height:100px;overflow:scroll !important;position:absolute;top:-9999px",document.body.appendChild(e);var t=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),t},isSameOrigin:function(e){var t=window.location,n=document.createElement("a");n.href=e,""===n.host&&(n.href=n.href);var o=window.location.port,i=n.port;return"http:"===n.protocol?(i=i||"80",o=o||"80"):"https:"===n.protocol&&(i=i||"443",o=o||"443"),n.hostname===t.hostname&&n.protocol===t.protocol&&i===o}},P.WebViewer.Options={initialDoc:void 0,annotationAdmin:void 0,isAdminUser:void 0,annotationUser:void 0,assetPath:void 0,autoCreate:!0,autoFocusNoteOnAnnotationSelection:!0,azureWorkaround:!1,additionalTranslations:void 0,enableAzureWorkaround:!1,enableOptimizedWorkers:!0,backgroundColor:void 0,backendType:void 0,css:void 0,config:void 0,custom:void 0,documentId:void 0,documentType:void 0,preloadWorker:void 0,extension:void 0,enableAnnotations:!0,filename:void 0,disableI18n:!1,disabledElements:void 0,disableWebsockets:!1,enableOfflineMode:!1,enableReadOnlyMode:!1,isReadOnly:!1,enableRedaction:!1,disableVirtualDisplayMode:!1,enableMeasurement:!1,encryption:void 0,externalPath:void 0,hideAnnotationPanel:!1,disableToolGroupReordering:!1,uiPath:"./ui/index.html",l:void 0,licenseKey:void 0,mobileRedirect:!1,path:"",pdfBackend:void 0,webviewerServerURL:void 0,webviewerServerRangeRequests:!0,fallbackToClientSide:!1,singleServerMode:!1,fullAPI:!1,preloadPDFWorker:!0,serverUrl:void 0,serverUrlHeaders:void 0,showLocalFilePicker:!1,enableFilePicker:!1,showToolbarControl:void 0,startOffline:!1,streaming:void 0,type:"html5",useDownloader:!0,workerTransportPromise:void 0,xdomainProxyUrl:void 0,ui:void 0,uiConfig:void 0,forceClientSideInit:!1,loadAsPDF:!1,accessibleMode:void 0,disableLogs:!1,enableViewStateAnnotations:!1,highContrastMode:!1,selectAnnotationOnCreation:!1,notesInLeftPanel:!1,autoExpandOutlines:!1,enableAnnotationNumbering:!1,enableOfficeEditing:!1,officeEditorOptions:{},spreadsheetEditorOptions:{},documentXFDFRetriever:void 0,disableMultiViewerComparison:void 0,showInvalidBookmarks:!0,disableObjectURLBlobs:!1,initialMode:void 0,defaultLanguage:"en",chunkSize:void 0,enableCompositionInput:!1,disableFlattenedAnnotations:!1,disableStreaming:!1};var M=function(e){for(var t=S(A),n=0;n<t.length;n++){var o=t[n];if(o.iframe===e)return o}return null},R=w;R.l=function(e){var t=M(e);return t&&t.l},R.workerTransportPromise=function(e){var t=M(e);return t&&t.workerTransportPromise},R.WorkerTypes={ALL:"all",OFFICE:"office",LEGACY_OFFICE:"legacyOffice",PDF:"pdf",CONTENT_EDIT:"contentEdit",OFFICE_EDITOR:"officeEditor"},R.BackendTypes=o,R.Modes={DEFAULT:"default",DOCX_EDITOR:"docxEditor",SPREADSHEET_EDITOR:"spreadsheetEditor"};var L=function(e){var t=S(A);if(!t.length||!t.filter((function(e){return e.instance})).length)return console.warn("WebViewer.getInstance() was called before any instances were available"),null;if(t.length>1&&!e)throw new Error("More than one instance of WebViewer was found, and no element was passed into getInstance(). Please specify which instance you want to get.");return e?(A.get(e)||{}).instance:(t[0]||{}).instance},W=function(e,t){A.set(e,{instance:t})},x=function(e){A.delete(e),C.delete(e)};R.getInstance=L,window.WebViewer=R,R.WebComponent=R,R.Iframe=function(e,t){return new Promise((function(n,o){e.l=e.l||e.licenseKey,e.azureWorkaround=e.azureWorkaround||e.enableAzureWorkaround,e.annotationAdmin=e.annotationAdmin||e.isAdminUser,e.enableReadOnlyMode=e.enableReadOnlyMode||e.isReadOnly,e.showLocalFilePicker=e.showLocalFilePicker||e.enableFilePicker;var i=function(){t.removeEventListener("ready",i);try{var a=t.querySelector("iframe").contentWindow;if(void 0===a.Core.Tools)throw new Error("Viewer isn't instantiated correctly. It could be caused by the 'path' option in the WebViewer constructor not being defined correctly. The 'path' option should be relative to the HTML file you're loading the script on and the lib folder needs to be publicly accessible.");var s=r.getInstance(),c={iframeWindow:a,dispose:r.dispose.bind(r)},l=I({},s,T({},s.UI_NAMESPACE_KEY,O(O({},s[s.UI_NAMESPACE_KEY]),c)));r.setCompleteInstance(l);var d=Promise.resolve();if(e.documentXFDFRetriever&&(d=l[s.CORE_NAMESPACE_KEY].documentViewer.setDocumentXFDFRetriever(e.documentXFDFRetriever)),e.additionalTranslations){var u=e.additionalTranslations;l[s.UI_NAMESPACE_KEY].setTranslations(u.language,u.translations)}d.then((function(){n(l)}))}catch(t){if("config"in e&&""!==e.config)return n();o("Viewer is on a different domain, the promise from WebViewer function is rejected and API functions will not work because of cross domain permissions. See https://docs.apryse.com/documentation/web/guides/wv-inside/#loading-webviewer-from-another-domain for more information.")}};t.addEventListener("ready",i);var r=new P.WebViewer(e,t)}))};t.default=R}])}));