filesbox/web/dist/pdfjs/build/pdf.sandbox.js

6081 lines
695 KiB
JavaScript
Raw Permalink Normal View History

2024-07-26 06:10:54 +00:00
(function(_,S){typeof exports=="object"&&typeof module=="object"?module.exports=S():typeof define=="function"&&define.amd?define("pdfjs-dist/build/pdf.sandbox",[],S):typeof exports=="object"?exports["pdfjs-dist/build/pdf.sandbox"]=S():_["pdfjs-dist/build/pdf.sandbox"]=_.pdfjsSandbox=S()})(this,function(){return(()=>{"use strict";var BA=[,(K,y)=>{Object.defineProperty(y,"__esModule",{value:!0}),y.default=void 0;function R(U){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?R=function(A){return typeof A}:R=function(A){return A&&typeof Symbol=="function"&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},R(U)}var Z=function(){var U=typeof document!="undefined"&&document.currentScript?document.currentScript.src:void 0;return function(G){G=G||{};var A;A||(A=typeof G!="undefined"?G:{});var Y,k;A.ready=new Promise(function(g,I){Y=g,k=I});var f={},M;for(M in A)A.hasOwnProperty(M)&&(f[M]=A[M]);var h="";typeof document!="undefined"&&document.currentScript&&(h=document.currentScript.src),U&&(h=U),h.indexOf("blob:")!==0?h=h.substr(0,h.lastIndexOf("/")+1):h="";var b=A.print||console.log.bind(console),F=A.printErr||console.warn.bind(console);for(M in f)f.hasOwnProperty(M)&&(A[M]=f[M]);f=null;var p;A.wasmBinary&&(p=A.wasmBinary);var e=A.noExitRuntime||!0;(typeof WebAssembly=="undefined"?"undefined":R(WebAssembly))!=="object"&&x("no native wasm support detected");var a,i=!1;function r(g){var I=A["_"+g];return I||x("Assertion failed: Cannot call unknown function "+(g+", make sure it is exported")),I}function n(g,I,Q,C){var E={string:function(l){var N=0;if(l!=null&&l!==0){var hA=(l.length<<2)+1;N=QA(hA),s(l,m,N,hA)}return N},array:function(l){var N=QA(l.length);return j.set(l,N),N}},D=r(g),c=[];if(g=0,C)for(var u=0;u<C.length;u++){var q=E[Q[u]];q?(g===0&&(g=cA()),c[u]=q(C[u])):c[u]=C[u]}return Q=D.apply(null,c),Q=function(d){return I==="string"?t(d):I==="boolean"?!!d:d}(Q),g!==0&&yA(g),Q}var B=typeof TextDecoder!="undefined"?new TextDecoder("utf8"):void 0;function o(g,I,Q){var C=I+Q;for(Q=I;g[Q]&&!(Q>=C);)++Q;if(16<Q-I&&g.subarray&&B)return B.decode(g.subarray(I,Q));for(C="";I<Q;){var E=g[I++];if(E&128){var D=g[I++]&63;if((E&224)==192)C+=String.fromCharCode((E&31)<<6|D);else{var c=g[I++]&63;E=(E&240)==224?(E&15)<<12|D<<6|c:(E&7)<<18|D<<12|c<<6|g[I++]&63,65536>E?C+=String.fromCharCode(E):(E-=65536,C+=String.fromCharCode(55296|E>>10,56320|E&1023))}}else C+=String.fromCharCode(E)}return C}function t(g){return g?o(m,g,void 0):""}function s(g,I,Q,C){if(0<C){C=Q+C-1;for(var E=0;E<g.length;++E){var D=g.charCodeAt(E);if(55296<=D&&57343>=D){var c=g.charCodeAt(++E);D=65536+((D&1023)<<10)|c&1023}if(127>=D){if(Q>=C)break;I[Q++]=D}else{if(2047>=D){if(Q+1>=C)break;I[Q++]=192|D>>6}else{if(65535>=D){if(Q+2>=C)break;I[Q++]=224|D>>12}else{if(Q+3>=C)break;I[Q++]=240|D>>18,I[Q++]=128|D>>12&63}I[Q++]=128|D>>6&63}I[Q++]=128|D&63}}I[Q]=0}}function J(g){for(var I=0,Q=0;Q<g.length;++Q){var C=g.charCodeAt(Q);55296<=C&&57343>=C&&(C=65536+((C&1023)<<10)|g.charCodeAt(++Q)&1023),127>=C?++I:I=2047>=C?I+2:65535>=C?I+3:I+4}return I}function P(g){var I=J(g)+1,Q=gA(I);return Q&&s(g,j,Q,I),Q}var O,j,m,w;function nA(){var g=a.buffer;O=g,A.HEAP8=j=new Int8Array(g),A.HEAP16=new Int16Array(g),A.HEAP32=w=new Int32Array(g),A.HEAPU8=m=new Uint8Array(g),A.HEAPU16=new Uint16Array(g),A.HEAPU32=new Uint32Array(g),A.HEAPF32=new Float32Array(g),A.HEAPF64=new Float64Array(g)}var z,iA=[],oA=[],FA=[],eA=[];function RA(){var g=A.preRun.shift();iA.unshift(g)}var H=0,$=null,W=null;A.preloadedImages={},A.preloadedAudios={};function x(g){throw A.onAbort&&A.onAbort(g),F(g),i=!0,g=new WebAssembly.RuntimeError("abort("+g+"). Build with -s ASSERTIONS=1 for more info."),k(g),g}function AA(g){return String.prototype.startsWith?g.startsWith("data:application/octet-stream;base64,"):g.indexOf("data:application/octet-stream;base64,")===0}var L="data:application/octet-stream;base64,AGFzbQEAAAABxQZsYAR/fn9/AX5gA39/fwF/YAJ/fwF/YAJ/fwBgAX8Bf2AFf35/f38BfmADf39/AGABfAF8YAF/AGACf34BfmACf34AYAR/f39/AX9gAn9/AX5gAn9+AX9gA39/fgF/YAN/fn8BfmABfgF/YAN/fn8AYAZ/fn9/f38BfmADf35/AX9gBX9/f3
`).concat(C),E!==0?window.alert(C):window.console.error(C)}};(function(){function g(E){A.asm=E.exports,a=A.asm.k,nA(),z=A.asm.t,oA.unshift(A.asm.l),H--,A.monitorRunDependencies&&A.monitorRunDependencies(H),H==0&&($!==null&&(clearInterval($),$=null),W&&(E=W,W=null,E()))}function I(E){g(E.instance)}function Q(E){return GA().then(function(D){return WebAssembly.instantiate(D,C)}).then(E,function(D){F("failed to asynchronously prepare wasm: "+D),x(D)})}var C={a:uA};if(H++,A.monitorRunDependencies&&A.monitorRunDependencies(H),A.instantiateWasm)try{return A.instantiateWasm(C,g)}catch(E){return F("Module.instantiateWasm callback failed with error: "+E),!1}return function(){return p||typeof WebAssembly.instantiateStreaming!="function"||AA(L)||typeof fetch!="function"?Q(I):fetch(L,{credentials:"same-origin"}).then(function(E){return WebAssembly.instantiateStreaming(E,C).then(I,function(D){return F("wasm streaming compile failed: "+D),F("falling back to ArrayBuffer instantiation"),Q(I)})})}().catch(k),{}})(),A.___wasm_call_ctors=function(){return(A.___wasm_call_ctors=A.asm.l).apply(null,arguments)},A._evalInSandbox=function(){return(A._evalInSandbox=A.asm.m).apply(null,arguments)},A._nukeSandbox=function(){return(A._nukeSandbox=A.asm.n).apply(null,arguments)},A._init=function(){return(A._init=A.asm.o).apply(null,arguments)},A._commFun=function(){return(A._commFun=A.asm.p).apply(null,arguments)},A._dumpMemoryUse=function(){return(A._dumpMemoryUse=A.asm.q).apply(null,arguments)};var gA=A._malloc=function(){return(gA=A._malloc=A.asm.r).apply(null,arguments)};A._free=function(){return(A._free=A.asm.s).apply(null,arguments)};var v=A.__get_tzname=function(){return(v=A.__get_tzname=A.asm.u).apply(null,arguments)},sA=A.__get_daylight=function(){return(sA=A.__get_daylight=A.asm.v).apply(null,arguments)},wA=A.__get_timezone=function(){return(wA=A.__get_timezone=A.asm.w).apply(null,arguments)},cA=A.stackSave=function(){return(cA=A.stackSave=A.asm.x).apply(null,arguments)},yA=A.stackRestore=function(){return(yA=A.stackRestore=A.asm.y).apply(null,arguments)},QA=A.stackAlloc=function(){return(QA=A.stackAlloc=A.asm.z).apply(null,arguments)};A.ccall=n,A.cwrap=function(g,I,Q,C){Q=Q||[];var E=Q.every(function(D){return D==="number"});return I!=="string"&&E&&!C?r(g):function(){return n(g,I,Q,arguments,C)}},A.stringToNewUTF8=IA;var T;W=function g(){T||CA(),T||(W=g)};function CA(){function g(){if(!T&&(T=!0,A.calledRun=!0,!i)){if(X(oA),X(FA),Y(A),A.onRuntimeInitialized&&A.onRuntimeInitialized(),A.postRun)for(typeof A.postRun=="function"&&(A.postRun=[A.postRun]);A.postRun.length;){var I=A.postRun.shift();eA.unshift(I)}X(eA)}}if(!(0<H)){if(A.preRun)for(typeof A.preRun=="function"&&(A.preRun=[A.preRun]);A.preRun.length;)RA();X(iA),0<H||(A.setStatus?(A.setStatus("Running..."),setTimeout(function(){setTimeout(function(){A.setStatus("")},1),g()},1)):g())}}if(A.run=CA,A.preInit)for(typeof A.preInit=="function"&&(A.preInit=[A.preInit]);0<A.preInit.length;)A.preInit.pop()();return CA(),G.ready}}(),V=Z;y.default=V},(K,y)=>{function R(e){return U(e)||V(e)||Y(e)||Z()}function Z(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function V(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function U(e){if(Array.isArray(e))return k(e)}function G(e,a){return M(e)||f(e,a)||Y(e,a)||A()}function A(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Y(e,a){if(!!e){if(typeof e=="string")return k(e,a);var i=Object.prototype.toString.call(e).slice(8,-1);if(i==="Object"&&e.constructor&&(i=e.constructor.name),i==="Map"||i==="Set")return Array.from(e);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return k(e,a)}}function k(e,a){(a==null||a>e.length)&&(a=e.length);for(var i=0,r=new Array(a);i<a;i++)r[i]=e[i];return r}function f(e,a){var i=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(i!=null){var r=[],n=!0,B=!1,o,t;try{for(i=i.call(e);!(n=(o=i.next()).done)&&(r.push(o.value),!(a&&r.length===a));n=!0);}catch(s){B=!0,t=s}finally{try{!n&&i.return!=null&&i.return()}finally{if(B)throw t}}return r}}function M(e){if(Array.isArray(e))return e}function h(e,a){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}function b(e,a){for(var i=0;i<a.length;i++){var r=a[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function F(e,a,i){return a&&b(e.prototype,a),i&&b(e,i),e}var p=function(){function e(a){h(this,e),this.win=a,this.timeoutIds=new Map,this.commFun=null}return F(e,[{key:"destroy",value:function(){var i=this;this.commFunc=null,this.timeoutIds.forEach(function(r){var n=G(r,2),B=n[0],o=n[1];return i.win.clearTimeout(o)}),this.timeoutIds=null}},{key:"exportValueToSandbox",value:function(i){throw new Error("Not implemented")}},{key:"importValueFromSandbox",value:function(i){throw new Error("Not implemented")}},{key:"createErrorForSandbox",value:function(i){throw new Error("Not implemented")}},{key:"callSandboxFunction",value:function(i,r){try{r=this.exportValueToSandbox(r),this.commFun(i,r)}catch(n){this.win.console.error(n)}}},{key:"createSandboxExternals",value:function(){var i=this,r={setTimeout:function(B,o){if(!(typeof B!="number"||typeof o!="number")){var t=i.win.setTimeout(function(){i.timeoutIds.delete(B),i.callSandboxFunction("timeoutCb",{callbackId:B,interval:!1})},o);i.timeoutIds.set(B,t)}},clearTimeout:function(B){i.win.clearTimeout(i.timeoutIds.get(B)),i.timeoutIds.delete(B)},setInterval:function(B,o){if(!(typeof B!="number"||typeof o!="number")){var t=i.win.setInterval(function(){i.callSandboxFunction("timeoutCb",{callbackId:B,interval:!0})},o);i.timeoutIds.set(B,t)}},clearInterval:function(B){i.win.clearInterval(i.timeoutIds.get(B)),i.timeoutIds.delete(B)},alert:function(B){typeof B=="string"&&i.win.alert(B)},confirm:function(B){return typeof B!="string"?!1:i.win.confirm(B)},prompt:function(B,o){return typeof B!="string"||typeof o!="string"?null:i.win.prompt(B,o)},parseURL:function(B){var o=new i.win.URL(B),t=["hash","host","hostname","href","origin","password","pathname","port","protocol","search","searchParams","username"];return Object.fromEntries(t.map(function(s){return[s,o[s].toString()]}))},send:function(B){if(!!B){var o=new i.win.CustomEvent("updatefromsandbox",{detail:i.importValueFromSandbox(B)});i.win.dispatchEvent(o)}}};return Object.setPrototypeOf(r,null),function(n,B){try{var o=r[n].apply(r,R(B));return i.exportValueToSandbox(o)}catch(s){var t;throw i.createErrorForSandbox((t=s==null?void 0:s.toString())!==null&&t!==void 0?t:"")}}}}]),e}();y.SandboxSupportBase=p}],_={};function S(K){var y=_[K];if(y!==void 0)return y.exports;var R=_[K]={exports:{}};return BA[K](R,R.exports,S),R.exports}var EA={};return(()=>{var K=EA;function y(n){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?y=function(o){return typeof o}:y=function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},y(n)}Object.defineProperty(K,"__esModule",{value:!0}),K.QuickJSSandbox=r;var R=V(S(1)),Z=S(2);function V(n){return n&&n.__esModule?n:{default:n}}function U(n,B){if(!(n instanceof B))throw new TypeError("Cannot call a class as a function")}function G(n,B){for(var o=0;o<B.length;o++){var t=B[o];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.define
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define("pdfjs-dist/build/pdf.scripting", [], factory);
else if(typeof exports === 'object')
exports["pdfjs-dist/build/pdf.scripting"] = factory();
else
root.pdfjsScripting = factory();
})(this, function() {
return /******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ([
/* 0 */,
/* 1 */
/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.initSandbox = initSandbox;
var _constants = __w_pdfjs_require__(2);
var _field = __w_pdfjs_require__(3);
var _aform = __w_pdfjs_require__(8);
var _app = __w_pdfjs_require__(9);
var _color = __w_pdfjs_require__(5);
var _console = __w_pdfjs_require__(13);
var _doc = __w_pdfjs_require__(14);
var _proxy = __w_pdfjs_require__(16);
var _util = __w_pdfjs_require__(17);
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function initSandbox(params) {
delete globalThis.pdfjsScripting;
var externalCall = globalThis.callExternalFunction;
delete globalThis.callExternalFunction;
var globalEval = function globalEval(code) {
return globalThis.eval(code);
};
var send = function send(data) {
return externalCall("send", [data]);
};
var proxyHandler = new _proxy.ProxyHandler();
var data = params.data;
var doc = new _doc.Doc(_objectSpread({
send: send,
globalEval: globalEval
}, data.docInfo));
var _document = {
obj: doc,
wrapped: new Proxy(doc, proxyHandler)
};
var app = new _app.App(_objectSpread({
send: send,
globalEval: globalEval,
externalCall: externalCall,
_document: _document,
calculationOrder: data.calculationOrder,
proxyHandler: proxyHandler
}, data.appInfo));
var util = new _util.Util({
externalCall: externalCall
});
var appObjects = app._objects;
if (data.objects) {
var annotations = [];
for (var _i = 0, _Object$entries = Object.entries(data.objects); _i < _Object$entries.length; _i++) {
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
name = _Object$entries$_i[0],
objs = _Object$entries$_i[1];
annotations.length = 0;
var container = null;
var _iterator = _createForOfIteratorHelper(objs),
_step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var _obj = _step.value;
if (_obj.type !== "") {
annotations.push(_obj);
} else {
container = _obj;
}
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
var obj = container;
if (annotations.length > 0) {
obj = annotations[0];
obj.send = send;
}
obj.globalEval = globalEval;
obj.doc = _document;
obj.fieldPath = name;
obj.appObjects = appObjects;
var field = void 0;
switch (obj.type) {
case "radiobutton":
{
var otherButtons = annotations.slice(1);
field = new _field.RadioButtonField(otherButtons, obj);
break;
}
case "checkbox":
{
var _otherButtons = annotations.slice(1);
field = new _field.CheckboxField(_otherButtons, obj);
break;
}
case "text":
if (annotations.length <= 1) {
field = new _field.Field(obj);
break;
}
obj.siblings = annotations.map(function (x) {
return x.id;
}).slice(1);
field = new _field.Field(obj);
break;
default:
field = new _field.Field(obj);
}
var wrapped = new Proxy(field, proxyHandler);
doc._addField(name, wrapped);
var _object = {
obj: field,
wrapped: wrapped
};
var _iterator2 = _createForOfIteratorHelper(objs),
_step2;
try {
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
var object = _step2.value;
appObjects[object.id] = _object;
}
} catch (err) {
_iterator2.e(err);
} finally {
_iterator2.f();
}
if (container) {
appObjects[container.id] = _object;
}
}
}
var color = new _color.Color();
globalThis.event = null;
globalThis.global = Object.create(null);
globalThis.app = new Proxy(app, proxyHandler);
globalThis.color = new Proxy(color, proxyHandler);
globalThis.console = new Proxy(new _console.Console({
send: send
}), proxyHandler);
globalThis.util = new Proxy(util, proxyHandler);
globalThis.border = _constants.Border;
globalThis.cursor = _constants.Cursor;
globalThis.display = _constants.Display;
globalThis.font = _constants.Font;
globalThis.highlight = _constants.Highlight;
globalThis.position = _constants.Position;
globalThis.scaleHow = _constants.ScaleHow;
globalThis.scaleWhen = _constants.ScaleWhen;
globalThis.style = _constants.Style;
globalThis.trans = _constants.Trans;
globalThis.zoomtype = _constants.ZoomType;
globalThis.ADBE = {
Reader_Value_Asked: true,
Viewer_Value_Asked: true
};
var aform = new _aform.AForm(doc, app, util, color);
var _iterator3 = _createForOfIteratorHelper(Object.getOwnPropertyNames(_aform.AForm.prototype)),
_step3;
try {
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
var _name2 = _step3.value;
if (_name2 !== "constructor" && !_name2.startsWith("_")) {
globalThis[_name2] = aform[_name2].bind(aform);
}
}
} catch (err) {
_iterator3.e(err);
} finally {
_iterator3.f();
}
for (var _i2 = 0, _Object$entries2 = Object.entries(_constants.GlobalConstants); _i2 < _Object$entries2.length; _i2++) {
var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i2], 2),
_name = _Object$entries2$_i[0],
value = _Object$entries2$_i[1];
Object.defineProperty(globalThis, _name, {
value: value,
writable: false
});
}
Object.defineProperties(globalThis, {
ColorConvert: {
value: color.convert.bind(color),
writable: true
},
ColorEqual: {
value: color.equal.bind(color),
writable: true
}
});
var properties = Object.create(null);
var _iterator4 = _createForOfIteratorHelper(Object.getOwnPropertyNames(_doc.Doc.prototype)),
_step4;
try {
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
var _name3 = _step4.value;
if (_name3 === "constructor" || _name3.startsWith("_")) {
continue;
}
var descriptor = Object.getOwnPropertyDescriptor(_doc.Doc.prototype, _name3);
if (descriptor.get) {
properties[_name3] = {
get: descriptor.get.bind(doc),
set: descriptor.set.bind(doc)
};
} else {
properties[_name3] = {
value: _doc.Doc.prototype[_name3].bind(doc)
};
}
}
} catch (err) {
_iterator4.e(err);
} finally {
_iterator4.f();
}
Object.defineProperties(globalThis, properties);
var functions = {
dispatchEvent: app._dispatchEvent.bind(app),
timeoutCb: app._evalCallback.bind(app)
};
return function (name, args) {
try {
functions[name](args);
} catch (error) {
var _value = "".concat(error.toString(), "\\n").concat(error.stack);
send({
command: "error",
value: _value
});
}
};
}
/***/ }),
/* 2 */
/***/ ((__unused_webpack_module, exports) => {
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.ZoomType = exports.Trans = exports.Style = exports.ScaleWhen = exports.ScaleHow = exports.Position = exports.Highlight = exports.GlobalConstants = exports.Font = exports.Display = exports.Cursor = exports.Border = void 0;
var Border = Object.freeze({
s: "solid",
d: "dashed",
b: "beveled",
i: "inset",
u: "underline"
});
exports.Border = Border;
var Cursor = Object.freeze({
visible: 0,
hidden: 1,
delay: 2
});
exports.Cursor = Cursor;
var Display = Object.freeze({
visible: 0,
hidden: 1,
noPrint: 2,
noView: 3
});
exports.Display = Display;
var Font = Object.freeze({
Times: "Times-Roman",
TimesB: "Times-Bold",
TimesI: "Times-Italic",
TimesBI: "Times-BoldItalic",
Helv: "Helvetica",
HelvB: "Helvetica-Bold",
HelvI: "Helvetica-Oblique",
HelvBI: "Helvetica-BoldOblique",
Cour: "Courier",
CourB: "Courier-Bold",
CourI: "Courier-Oblique",
CourBI: "Courier-BoldOblique",
Symbol: "Symbol",
ZapfD: "ZapfDingbats",
KaGo: "HeiseiKakuGo-W5-UniJIS-UCS2-H",
KaMi: "HeiseiMin-W3-UniJIS-UCS2-H"
});
exports.Font = Font;
var Highlight = Object.freeze({
n: "none",
i: "invert",
p: "push",
o: "outline"
});
exports.Highlight = Highlight;
var Position = Object.freeze({
textOnly: 0,
iconOnly: 1,
iconTextV: 2,
textIconV: 3,
iconTextH: 4,
textIconH: 5,
overlay: 6
});
exports.Position = Position;
var ScaleHow = Object.freeze({
proportional: 0,
anamorphic: 1
});
exports.ScaleHow = ScaleHow;
var ScaleWhen = Object.freeze({
always: 0,
never: 1,
tooBig: 2,
tooSmall: 3
});
exports.ScaleWhen = ScaleWhen;
var Style = Object.freeze({
ch: "check",
cr: "cross",
di: "diamond",
ci: "circle",
st: "star",
sq: "square"
});
exports.Style = Style;
var Trans = Object.freeze({
blindsH: "BlindsHorizontal",
blindsV: "BlindsVertical",
boxI: "BoxIn",
boxO: "BoxOut",
dissolve: "Dissolve",
glitterD: "GlitterDown",
glitterR: "GlitterRight",
glitterRD: "GlitterRightDown",
random: "Random",
replace: "Replace",
splitHI: "SplitHorizontalIn",
splitHO: "SplitHorizontalOut",
splitVI: "SplitVerticalIn",
splitVO: "SplitVerticalOut",
wipeD: "WipeDown",
wipeL: "WipeLeft",
wipeR: "WipeRight",
wipeU: "WipeUp"
});
exports.Trans = Trans;
var ZoomType = Object.freeze({
none: "NoVary",
fitP: "FitPage",
fitW: "FitWidth",
fitH: "FitHeight",
fitV: "FitVisibleWidth",
pref: "Preferred",
refW: "ReflowWidth"
});
exports.ZoomType = ZoomType;
var GlobalConstants = Object.freeze({
IDS_GREATER_THAN: "Invalid value: must be greater than or equal to % s.",
IDS_GT_AND_LT: "Invalid value: must be greater than or equal to % s " + "and less than or equal to % s.",
IDS_LESS_THAN: "Invalid value: must be less than or equal to % s.",
IDS_INVALID_MONTH: "** Invalid **",
IDS_INVALID_DATE: "Invalid date / time: please ensure that the date / time exists.Field",
IDS_INVALID_DATE2: " should match format ",
IDS_INVALID_VALUE: "The value entered does not match the format of the field",
IDS_AM: "am",
IDS_PM: "pm",
IDS_MONTH_INFO: "January[1] February[2] March[3] April[4] May[5] " + "June[6] July[7] August[8] September[9] October[10] " + "November[11] December[12] Sept[9] Jan[1] Feb[2] Mar[3] " + "Apr[4] Jun[6] Jul[7] Aug[8] Sep[9] Oct[10] Nov[11] Dec[12]",
IDS_STARTUP_CONSOLE_MSG: "** ^ _ ^ **",
RE_NUMBER_ENTRY_DOT_SEP: ["[+-]?\\\\d*\\\\.?\\\\d*"],
RE_NUMBER_COMMIT_DOT_SEP: ["[+-]?\\\\d+(\\\\.\\\\d+)?", "[+-]?\\\\.\\\\d+", "[+-]?\\\\d+\\\\."],
RE_NUMBER_ENTRY_COMMA_SEP: ["[+-]?\\\\d*,?\\\\d*"],
RE_NUMBER_COMMIT_COMMA_SEP: ["[+-]?\\\\d+([.,]\\\\d+)?", "[+-]?[.,]\\\\d+", "[+-]?\\\\d+[.,]"],
RE_ZIP_ENTRY: ["\\\\d{0,5}"],
RE_ZIP_COMMIT: ["\\\\d{5}"],
RE_ZIP4_ENTRY: ["\\\\d{0,5}(\\\\.|[- ])?\\\\d{0,4}"],
RE_ZIP4_COMMIT: ["\\\\d{5}(\\\\.|[- ])?\\\\d{4}"],
RE_PHONE_ENTRY: ["\\\\d{0,3}(\\\\.|[- ])?\\\\d{0,3}(\\\\.|[- ])?\\\\d{0,4}", "\\\\(\\\\d{0,3}", "\\\\(\\\\d{0,3}\\\\)(\\\\.|[- ])?\\\\d{0,3}(\\\\.|[- ])?\\\\d{0,4}", "\\\\(\\\\d{0,3}(\\\\.|[- ])?\\\\d{0,3}(\\\\.|[- ])?\\\\d{0,4}", "\\\\d{0,3}\\\\)(\\\\.|[- ])?\\\\d{0,3}(\\\\.|[- ])?\\\\d{0,4}", "011(\\\\.|[- \\\\d])*"],
RE_PHONE_COMMIT: ["\\\\d{3}(\\\\.|[- ])?\\\\d{4}", "\\\\d{3}(\\\\.|[- ])?\\\\d{3}(\\\\.|[- ])?\\\\d{4}", "\\\\(\\\\d{3}\\\\)(\\\\.|[- ])?\\\\d{3}(\\\\.|[- ])?\\\\d{4}", "011(\\\\.|[- \\\\d])*"],
RE_SSN_ENTRY: ["\\\\d{0,3}(\\\\.|[- ])?\\\\d{0,2}(\\\\.|[- ])?\\\\d{0,4}"],
RE_SSN_COMMIT: ["\\\\d{3}(\\\\.|[- ])?\\\\d{2}(\\\\.|[- ])?\\\\d{4}"]
});
exports.GlobalConstants = GlobalConstants;
/***/ }),
/* 3 */
/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.RadioButtonField = exports.Field = exports.CheckboxField = void 0;
var _common = __w_pdfjs_require__(4);
var _color = __w_pdfjs_require__(5);
var _pdf_object = __w_pdfjs_require__(7);
function set(target, property, value, receiver) { if (typeof Reflect !== "undefined" && Reflect.set) { set = Reflect.set; } else { set = function set(target, property, value, receiver) { var base = _superPropBase(target, property); var desc; if (base) { desc = Object.getOwnPropertyDescriptor(base, property); if (desc.set) { desc.set.call(receiver, value); return true; } else if (!desc.writable) { return false; } } desc = Object.getOwnPropertyDescriptor(receiver, property); if (desc) { if (!desc.writable) { return false; } desc.value = value; Object.defineProperty(receiver, property, desc); } else { _defineProperty(receiver, property, value); } return true; }; } return set(target, property, value, receiver); }
function _set(target, property, value, receiver, isStrict) { var s = set(target, property, value, receiver || target); if (!s && isStrict) { throw new Error('failed to set property'); } return value; }
function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }
function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
var Field = /*#__PURE__*/function (_PDFObject) {
_inherits(Field, _PDFObject);
var _super = _createSuper(Field);
function Field(data) {
var _this;
_classCallCheck(this, Field);
_this = _super.call(this, data);
_this.alignment = data.alignment || "left";
_this.borderStyle = data.borderStyle || "";
_this.buttonAlignX = data.buttonAlignX || 50;
_this.buttonAlignY = data.buttonAlignY || 50;
_this.buttonFitBounds = data.buttonFitBounds;
_this.buttonPosition = data.buttonPosition;
_this.buttonScaleHow = data.buttonScaleHow;
_this.ButtonScaleWhen = data.buttonScaleWhen;
_this.calcOrderIndex = data.calcOrderIndex;
_this.charLimit = data.charLimit;
_this.comb = data.comb;
_this.commitOnSelChange = data.commitOnSelChange;
_this.currentValueIndices = data.currentValueIndices;
_this.defaultStyle = data.defaultStyle;
_this.defaultValue = data.defaultValue;
_this.doNotScroll = data.doNotScroll;
_this.doNotSpellCheck = data.doNotSpellCheck;
_this.delay = data.delay;
_this.display = data.display;
_this.doc = data.doc.wrapped;
_this.editable = data.editable;
_this.exportValues = data.exportValues;
_this.fileSelect = data.fileSelect;
_this.hidden = data.hidden;
_this.highlight = data.highlight;
_this.lineWidth = data.lineWidth;
_this.multiline = data.multiline;
_this.multipleSelection = !!data.multipleSelection;
_this.name = data.name;
_this.password = data.password;
_this.print = data.print;
_this.radiosInUnison = data.radiosInUnison;
_this.readonly = data.readonly;
_this.rect = data.rect;
_this.required = data.required;
_this.richText = data.richText;
_this.richValue = data.richValue;
_this.rotation = data.rotation;
_this.style = data.style;
_this.submitName = data.submitName;
_this.textFont = data.textFont;
_this.textSize = data.textSize;
_this.type = data.type;
_this.userName = data.userName;
_this._actions = (0, _common.createActionsMap)(data.actions);
_this._browseForFileToSubmit = data.browseForFileToSubmit || null;
_this._buttonCaption = null;
_this._buttonIcon = null;
_this._children = null;
_this._currentValueIndices = data.currentValueIndices || 0;
_this._document = data.doc;
_this._fieldPath = data.fieldPath;
_this._fillColor = data.fillColor || ["T"];
_this._isChoice = Array.isArray(data.items);
_this._items = data.items || [];
_this._page = data.page || 0;
_this._strokeColor = data.strokeColor || ["G", 0];
_this._textColor = data.textColor || ["G", 0];
_this._value = data.value || "";
_this._kidIds = data.kidIds || null;
_this._fieldType = (0, _common.getFieldType)(_this._actions);
_this._siblings = data.siblings || null;
_this._globalEval = data.globalEval;
_this._appObjects = data.appObjects;
_this.valueAsString = data.valueAsString || _this._value;
return _this;
}
_createClass(Field, [{
key: "currentValueIndices",
get: function get() {
if (!this._isChoice) {
return 0;
}
return this._currentValueIndices;
},
set: function set(indices) {
var _this2 = this;
if (!this._isChoice) {
return;
}
if (!Array.isArray(indices)) {
indices = [indices];
}
if (!indices.every(function (i) {
return typeof i === "number" && Number.isInteger(i) && i >= 0 && i < _this2.numItems;
})) {
return;
}
indices.sort();
if (this.multipleSelection) {
this._currentValueIndices = indices;
this._value = [];
indices.forEach(function (i) {
_this2._value.push(_this2._items[i].displayValue);
});
} else {
if (indices.length > 0) {
indices = indices.splice(1, indices.length - 1);
this._currentValueIndices = indices[0];
this._value = this._items[this._currentValueIndices];
}
}
this._send({
id: this._id,
indices: indices
});
}
}, {
key: "fillColor",
get: function get() {
return this._fillColor;
},
set: function set(color) {
if (_color.Color._isValidColor(color)) {
this._fillColor = color;
}
}
}, {
key: "bgColor",
get: function get() {
return this.fillColor;
},
set: function set(color) {
this.fillColor = color;
}
}, {
key: "numItems",
get: function get() {
if (!this._isChoice) {
throw new Error("Not a choice widget");
}
return this._items.length;
},
set: function set(_) {
throw new Error("field.numItems is read-only");
}
}, {
key: "strokeColor",
get: function get() {
return this._strokeColor;
},
set: function set(color) {
if (_color.Color._isValidColor(color)) {
this._strokeColor = color;
}
}
}, {
key: "borderColor",
get: function get() {
return this.strokeColor;
},
set: function set(color) {
this.strokeColor = color;
}
}, {
key: "page",
get: function get() {
return this._page;
},
set: function set(_) {
throw new Error("field.page is read-only");
}
}, {
key: "textColor",
get: function get() {
return this._textColor;
},
set: function set(color) {
if (_color.Color._isValidColor(color)) {
this._textColor = color;
}
}
}, {
key: "fgColor",
get: function get() {
return this.textColor;
},
set: function set(color) {
this.textColor = color;
}
}, {
key: "value",
get: function get() {
return this._value;
},
set: function set(value) {
var _this3 = this;
if (value === "") {
this._value = "";
} else if (typeof value === "string") {
switch (this._fieldType) {
case _common.FieldType.number:
case _common.FieldType.percent:
value = parseFloat(value);
if (!isNaN(value)) {
this._value = value;
}
break;
default:
this._value = value;
}
} else {
this._value = value;
}
if (this._isChoice) {
if (this.multipleSelection) {
var values = new Set(value);
this._currentValueIndices.length = 0;
this._items.forEach(function (_ref, i) {
var displayValue = _ref.displayValue;
if (values.has(displayValue)) {
_this3._currentValueIndices.push(i);
}
});
} else {
this._currentValueIndices = this._items.findIndex(function (_ref2) {
var displayValue = _ref2.displayValue;
return value === displayValue;
});
}
}
}
}, {
key: "valueAsString",
get: function get() {
if (this._valueAsString === undefined) {
this._valueAsString = this._value ? this._value.toString() : "";
}
return this._valueAsString;
},
set: function set(val) {
this._valueAsString = val ? val.toString() : "";
}
}, {
key: "browseForFileToSubmit",
value: function browseForFileToSubmit() {
if (this._browseForFileToSubmit) {
this._browseForFileToSubmit();
}
}
}, {
key: "buttonGetCaption",
value: function buttonGetCaption() {
var nFace = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
if (this._buttonCaption) {
return this._buttonCaption[nFace];
}
return "";
}
}, {
key: "buttonGetIcon",
value: function buttonGetIcon() {
var nFace = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
if (this._buttonIcon) {
return this._buttonIcon[nFace];
}
return null;
}
}, {
key: "buttonImportIcon",
value: function buttonImportIcon() {
var cPath = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
var nPave = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
}
}, {
key: "buttonSetCaption",
value: function buttonSetCaption(cCaption) {
var nFace = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
if (!this._buttonCaption) {
this._buttonCaption = ["", "", ""];
}
this._buttonCaption[nFace] = cCaption;
}
}, {
key: "buttonSetIcon",
value: function buttonSetIcon(oIcon) {
var nFace = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
if (!this._buttonIcon) {
this._buttonIcon = [null, null, null];
}
this._buttonIcon[nFace] = oIcon;
}
}, {
key: "checkThisBox",
value: function checkThisBox(nWidget) {
var bCheckIt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
}
}, {
key: "clearItems",
value: function clearItems() {
if (!this._isChoice) {
throw new Error("Not a choice widget");
}
this._items = [];
this._send({
id: this._id,
clear: null
});
}
}, {
key: "deleteItemAt",
value: function deleteItemAt() {
var nIdx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
if (!this._isChoice) {
throw new Error("Not a choice widget");
}
if (!this.numItems) {
return;
}
if (nIdx === null) {
nIdx = Array.isArray(this._currentValueIndices) ? this._currentValueIndices[0] : this._currentValueIndices;
nIdx = nIdx || 0;
}
if (nIdx < 0 || nIdx >= this.numItems) {
nIdx = this.numItems - 1;
}
this._items.splice(nIdx, 1);
if (Array.isArray(this._currentValueIndices)) {
var index = this._currentValueIndices.findIndex(function (i) {
return i >= nIdx;
});
if (index !== -1) {
if (this._currentValueIndices[index] === nIdx) {
this._currentValueIndices.splice(index, 1);
}
for (var ii = this._currentValueIndices.length; index < ii; index++) {
--this._currentValueIndices[index];
}
}
} else {
if (this._currentValueIndices === nIdx) {
this._currentValueIndices = this.numItems > 0 ? 0 : -1;
} else if (this._currentValueIndices > nIdx) {
--this._currentValueIndices;
}
}
this._send({
id: this._id,
remove: nIdx
});
}
}, {
key: "getItemAt",
value: function getItemAt() {
var nIdx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;
var bExportValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
if (!this._isChoice) {
throw new Error("Not a choice widget");
}
if (nIdx < 0 || nIdx >= this.numItems) {
nIdx = this.numItems - 1;
}
var item = this._items[nIdx];
return bExportValue ? item.exportValue : item.displayValue;
}
}, {
key: "getArray",
value: function getArray() {
var _this4 = this;
if (this._kidIds) {
return this._kidIds.map(function (id) {
return _this4._appObjects[id].wrapped;
});
}
if (this._children === null) {
this._children = this._document.obj._getChildren(this._fieldPath);
}
return this._children;
}
}, {
key: "getLock",
value: function getLock() {
return undefined;
}
}, {
key: "isBoxChecked",
value: function isBoxChecked(nWidget) {
return false;
}
}, {
key: "isDefaultChecked",
value: function isDefaultChecked(nWidget) {
return false;
}
}, {
key: "insertItemAt",
value: function insertItemAt(cName) {
var cExport = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
var nIdx = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
if (!this._isChoice) {
throw new Error("Not a choice widget");
}
if (!cName) {
return;
}
if (nIdx < 0 || nIdx > this.numItems) {
nIdx = this.numItems;
}
if (this._items.some(function (_ref3) {
var displayValue = _ref3.displayValue;
return displayValue === cName;
})) {
return;
}
if (cExport === undefined) {
cExport = cName;
}
var data = {
displayValue: cName,
exportValue: cExport
};
this._items.splice(nIdx, 0, data);
if (Array.isArray(this._currentValueIndices)) {
var index = this._currentValueIndices.findIndex(function (i) {
return i >= nIdx;
});
if (index !== -1) {
for (var ii = this._currentValueIndices.length; index < ii; index++) {
++this._currentValueIndices[index];
}
}
} else if (this._currentValueIndices >= nIdx) {
++this._currentValueIndices;
}
this._send({
id: this._id,
insert: _objectSpread({
index: nIdx
}, data)
});
}
}, {
key: "setAction",
value: function setAction(cTrigger, cScript) {
if (typeof cTrigger !== "string" || typeof cScript !== "string") {
return;
}
if (!(cTrigger in this._actions)) {
this._actions[cTrigger] = [];
}
this._actions[cTrigger].push(cScript);
}
}, {
key: "setFocus",
value: function setFocus() {
this._send({
id: this._id,
focus: true
});
}
}, {
key: "setItems",
value: function setItems(oArray) {
if (!this._isChoice) {
throw new Error("Not a choice widget");
}
this._items.length = 0;
var _iterator = _createForOfIteratorHelper(oArray),
_step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var element = _step.value;
var displayValue = void 0,
exportValue = void 0;
if (Array.isArray(element)) {
var _element$, _element$2;
displayValue = ((_element$ = element[0]) === null || _element$ === void 0 ? void 0 : _element$.toString()) || "";
exportValue = ((_element$2 = element[1]) === null || _element$2 === void 0 ? void 0 : _element$2.toString()) || "";
} else {
displayValue = exportValue = (element === null || element === void 0 ? void 0 : element.toString()) || "";
}
this._items.push({
displayValue: displayValue,
exportValue: exportValue
});
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
this._currentValueIndices = 0;
this._send({
id: this._id,
items: this._items
});
}
}, {
key: "setLock",
value: function setLock() {}
}, {
key: "signatureGetModifications",
value: function signatureGetModifications() {}
}, {
key: "signatureGetSeedValue",
value: function signatureGetSeedValue() {}
}, {
key: "signatureInfo",
value: function signatureInfo() {}
}, {
key: "signatureSetSeedValue",
value: function signatureSetSeedValue() {}
}, {
key: "signatureSign",
value: function signatureSign() {}
}, {
key: "signatureValidate",
value: function signatureValidate() {}
}, {
key: "_isButton",
value: function _isButton() {
return false;
}
}, {
key: "_reset",
value: function _reset() {
this.value = this.valueAsString = this.defaultValue;
}
}, {
key: "_runActions",
value: function _runActions(event) {
var eventName = event.name;
if (!this._actions.has(eventName)) {
return false;
}
var actions = this._actions.get(eventName);
try {
var _iterator2 = _createForOfIteratorHelper(actions),
_step2;
try {
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
var action = _step2.value;
this._globalEval(action);
}
} catch (err) {
_iterator2.e(err);
} finally {
_iterator2.f();
}
} catch (error) {
event.rc = false;
throw error;
}
return true;
}
}]);
return Field;
}(_pdf_object.PDFObject);
exports.Field = Field;
var RadioButtonField = /*#__PURE__*/function (_Field) {
_inherits(RadioButtonField, _Field);
var _super2 = _createSuper(RadioButtonField);
function RadioButtonField(otherButtons, data) {
var _this5;
_classCallCheck(this, RadioButtonField);
_this5 = _super2.call(this, data);
_this5.exportValues = [_this5.exportValues];
_this5._radioIds = [_this5._id];
_this5._radioActions = [_this5._actions];
var _iterator3 = _createForOfIteratorHelper(otherButtons),
_step3;
try {
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
var radioData = _step3.value;
_this5.exportValues.push(radioData.exportValues);
_this5._radioIds.push(radioData.id);
_this5._radioActions.push((0, _common.createActionsMap)(radioData.actions));
if (_this5._value === radioData.exportValues) {
_this5._id = radioData.id;
}
}
} catch (err) {
_iterator3.e(err);
} finally {
_iterator3.f();
}
return _this5;
}
_createClass(RadioButtonField, [{
key: "value",
get: function get() {
return this._value;
},
set: function set(value) {
if (value === null || value === undefined) {
this._value = "";
}
var i = this.exportValues.indexOf(value);
if (0 <= i && i < this._radioIds.length) {
this._id = this._radioIds[i];
this._value = value;
} else if (value === "Off" && this._radioIds.length === 2) {
var nextI = (1 + this._radioIds.indexOf(this._id)) % 2;
this._id = this._radioIds[nextI];
this._value = this.exportValues[nextI];
}
}
}, {
key: "checkThisBox",
value: function checkThisBox(nWidget) {
var bCheckIt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
if (nWidget < 0 || nWidget >= this._radioIds.length || !bCheckIt) {
return;
}
this._id = this._radioIds[nWidget];
this._value = this.exportValues[nWidget];
this._send({
id: this._id,
value: this._value
});
}
}, {
key: "isBoxChecked",
value: function isBoxChecked(nWidget) {
return nWidget >= 0 && nWidget < this._radioIds.length && this._id === this._radioIds[nWidget];
}
}, {
key: "isDefaultChecked",
value: function isDefaultChecked(nWidget) {
return nWidget >= 0 && nWidget < this.exportValues.length && this.defaultValue === this.exportValues[nWidget];
}
}, {
key: "_getExportValue",
value: function _getExportValue(state) {
var i = this._radioIds.indexOf(this._id);
return this.exportValues[i];
}
}, {
key: "_runActions",
value: function _runActions(event) {
var i = this._radioIds.indexOf(this._id);
this._actions = this._radioActions[i];
return _get(_getPrototypeOf(RadioButtonField.prototype), "_runActions", this).call(this, event);
}
}, {
key: "_isButton",
value: function _isButton() {
return true;
}
}]);
return RadioButtonField;
}(Field);
exports.RadioButtonField = RadioButtonField;
var CheckboxField = /*#__PURE__*/function (_RadioButtonField) {
_inherits(CheckboxField, _RadioButtonField);
var _super3 = _createSuper(CheckboxField);
function CheckboxField() {
_classCallCheck(this, CheckboxField);
return _super3.apply(this, arguments);
}
_createClass(CheckboxField, [{
key: "value",
get: function get() {
return this._value;
},
set: function set(value) {
if (!value || value === "Off") {
this._value = "Off";
} else {
_set(_getPrototypeOf(CheckboxField.prototype), "value", value, this, true);
}
}
}, {
key: "_getExportValue",
value: function _getExportValue(state) {
return state ? _get(_getPrototypeOf(CheckboxField.prototype), "_getExportValue", this).call(this, state) : "Off";
}
}, {
key: "isBoxChecked",
value: function isBoxChecked(nWidget) {
if (this._value === "Off") {
return false;
}
return _get(_getPrototypeOf(CheckboxField.prototype), "isBoxChecked", this).call(this, nWidget);
}
}, {
key: "isDefaultChecked",
value: function isDefaultChecked(nWidget) {
if (this.defaultValue === "Off") {
return this._value === "Off";
}
return _get(_getPrototypeOf(CheckboxField.prototype), "isDefaultChecked", this).call(this, nWidget);
}
}, {
key: "checkThisBox",
value: function checkThisBox(nWidget) {
var bCheckIt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
if (nWidget < 0 || nWidget >= this._radioIds.length) {
return;
}
this._id = this._radioIds[nWidget];
this._value = bCheckIt ? this.exportValues[nWidget] : "Off";
this._send({
id: this._id,
value: this._value
});
}
}]);
return CheckboxField;
}(RadioButtonField);
exports.CheckboxField = CheckboxField;
/***/ }),
/* 4 */
/***/ ((__unused_webpack_module, exports) => {
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.FieldType = void 0;
exports.createActionsMap = createActionsMap;
exports.getFieldType = getFieldType;
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
var FieldType = {
none: 0,
number: 1,
percent: 2,
date: 3,
time: 4
};
exports.FieldType = FieldType;
function createActionsMap(actions) {
var actionsMap = new Map();
if (actions) {
for (var _i = 0, _Object$entries = Object.entries(actions); _i < _Object$entries.length; _i++) {
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
eventType = _Object$entries$_i[0],
actionsForEvent = _Object$entries$_i[1];
actionsMap.set(eventType, actionsForEvent);
}
}
return actionsMap;
}
function getFieldType(actions) {
var format = actions.get("Format");
if (!format) {
return FieldType.none;
}
format = format[0];
format = format.trim();
if (format.startsWith("AFNumber_")) {
return FieldType.number;
}
if (format.startsWith("AFPercent_")) {
return FieldType.percent;
}
if (format.startsWith("AFDate_")) {
return FieldType.date;
}
if (format.startsWith("AFTime__")) {
return FieldType.time;
}
return FieldType.none;
}
/***/ }),
/* 5 */
/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.Color = void 0;
var _scripting_utils = __w_pdfjs_require__(6);
var _pdf_object = __w_pdfjs_require__(7);
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
var Color = /*#__PURE__*/function (_PDFObject) {
_inherits(Color, _PDFObject);
var _super = _createSuper(Color);
function Color() {
var _this;
_classCallCheck(this, Color);
_this = _super.call(this, {});
_this.transparent = ["T"];
_this.black = ["G", 0];
_this.white = ["G", 1];
_this.red = ["RGB", 1, 0, 0];
_this.green = ["RGB", 0, 1, 0];
_this.blue = ["RGB", 0, 0, 1];
_this.cyan = ["CMYK", 1, 0, 0, 0];
_this.magenta = ["CMYK", 0, 1, 0, 0];
_this.yellow = ["CMYK", 0, 0, 1, 0];
_this.dkGray = ["G", 0.25];
_this.gray = ["G", 0.5];
_this.ltGray = ["G", 0.75];
return _this;
}
_createClass(Color, [{
key: "convert",
value: function convert(colorArray, cColorSpace) {
if (!Color._isValidSpace(cColorSpace)) {
return this.black;
}
if (cColorSpace === "T") {
return ["T"];
}
colorArray = Color._getCorrectColor(colorArray);
if (colorArray[0] === cColorSpace) {
return colorArray;
}
if (colorArray[0] === "T") {
return this.convert(this.black, cColorSpace);
}
return _scripting_utils.ColorConverters["".concat(colorArray[0], "_").concat(cColorSpace)](colorArray.slice(1));
}
}, {
key: "equal",
value: function equal(colorArray1, colorArray2) {
colorArray1 = Color._getCorrectColor(colorArray1);
colorArray2 = Color._getCorrectColor(colorArray2);
if (colorArray1[0] === "T" || colorArray2[0] === "T") {
return colorArray1[0] === "T" && colorArray2[0] === "T";
}
if (colorArray1[0] !== colorArray2[0]) {
colorArray2 = this.convert(colorArray2, colorArray1[0]);
}
return colorArray1.slice(1).every(function (c, i) {
return c === colorArray2[i + 1];
});
}
}], [{
key: "_isValidSpace",
value: function _isValidSpace(cColorSpace) {
return typeof cColorSpace === "string" && (cColorSpace === "T" || cColorSpace === "G" || cColorSpace === "RGB" || cColorSpace === "CMYK");
}
}, {
key: "_isValidColor",
value: function _isValidColor(colorArray) {
if (!Array.isArray(colorArray) || colorArray.length === 0) {
return false;
}
var space = colorArray[0];
if (!Color._isValidSpace(space)) {
return false;
}
switch (space) {
case "T":
if (colorArray.length !== 1) {
return false;
}
break;
case "G":
if (colorArray.length !== 2) {
return false;
}
break;
case "RGB":
if (colorArray.length !== 4) {
return false;
}
break;
case "CMYK":
if (colorArray.length !== 5) {
return false;
}
break;
default:
return false;
}
return colorArray.slice(1).every(function (c) {
return typeof c === "number" && c >= 0 && c <= 1;
});
}
}, {
key: "_getCorrectColor",
value: function _getCorrectColor(colorArray) {
return Color._isValidColor(colorArray) ? colorArray : ["G", 0];
}
}]);
return Color;
}(_pdf_object.PDFObject);
exports.Color = Color;
/***/ }),
/* 6 */
/***/ ((__unused_webpack_module, exports) => {
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.ColorConverters = void 0;
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
function makeColorComp(n) {
return Math.floor(Math.max(0, Math.min(1, n)) * 255).toString(16).padStart(2, "0");
}
var ColorConverters = /*#__PURE__*/function () {
function ColorConverters() {
_classCallCheck(this, ColorConverters);
}
_createClass(ColorConverters, null, [{
key: "CMYK_G",
value: function CMYK_G(_ref) {
var _ref2 = _slicedToArray(_ref, 4),
c = _ref2[0],
y = _ref2[1],
m = _ref2[2],
k = _ref2[3];
return ["G", 1 - Math.min(1, 0.3 * c + 0.59 * m + 0.11 * y + k)];
}
}, {
key: "G_CMYK",
value: function G_CMYK(_ref3) {
var _ref4 = _slicedToArray(_ref3, 1),
g = _ref4[0];
return ["CMYK", 0, 0, 0, 1 - g];
}
}, {
key: "G_RGB",
value: function G_RGB(_ref5) {
var _ref6 = _slicedToArray(_ref5, 1),
g = _ref6[0];
return ["RGB", g, g, g];
}
}, {
key: "G_HTML",
value: function G_HTML(_ref7) {
var _ref8 = _slicedToArray(_ref7, 1),
g = _ref8[0];
var G = makeColorComp(g);
return "#".concat(G).concat(G).concat(G);
}
}, {
key: "RGB_G",
value: function RGB_G(_ref9) {
var _ref10 = _slicedToArray(_ref9, 3),
r = _ref10[0],
g = _ref10[1],
b = _ref10[2];
return ["G", 0.3 * r + 0.59 * g + 0.11 * b];
}
}, {
key: "RGB_HTML",
value: function RGB_HTML(_ref11) {
var _ref12 = _slicedToArray(_ref11, 3),
r = _ref12[0],
g = _ref12[1],
b = _ref12[2];
var R = makeColorComp(r);
var G = makeColorComp(g);
var B = makeColorComp(b);
return "#".concat(R).concat(G).concat(B);
}
}, {
key: "T_HTML",
value: function T_HTML() {
return "#00000000";
}
}, {
key: "CMYK_RGB",
value: function CMYK_RGB(_ref13) {
var _ref14 = _slicedToArray(_ref13, 4),
c = _ref14[0],
y = _ref14[1],
m = _ref14[2],
k = _ref14[3];
return ["RGB", 1 - Math.min(1, c + k), 1 - Math.min(1, m + k), 1 - Math.min(1, y + k)];
}
}, {
key: "CMYK_HTML",
value: function CMYK_HTML(components) {
return this.RGB_HTML(this.CMYK_RGB(components));
}
}, {
key: "RGB_CMYK",
value: function RGB_CMYK(_ref15) {
var _ref16 = _slicedToArray(_ref15, 3),
r = _ref16[0],
g = _ref16[1],
b = _ref16[2];
var c = 1 - r;
var m = 1 - g;
var y = 1 - b;
var k = Math.min(c, m, y);
return ["CMYK", c, m, y, k];
}
}]);
return ColorConverters;
}();
exports.ColorConverters = ColorConverters;
/***/ }),
/* 7 */
/***/ ((__unused_webpack_module, exports) => {
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.PDFObject = void 0;
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var PDFObject = function PDFObject(data) {
_classCallCheck(this, PDFObject);
this._expandos = Object.create(null);
this._send = data.send || null;
this._id = data.id || null;
};
exports.PDFObject = PDFObject;
/***/ }),
/* 8 */
/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.AForm = void 0;
var _constants = __w_pdfjs_require__(2);
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
var AForm = /*#__PURE__*/function () {
function AForm(document, app, util, color) {
_classCallCheck(this, AForm);
this._document = document;
this._app = app;
this._util = util;
this._color = color;
this._dateFormats = ["m/d", "m/d/yy", "mm/dd/yy", "mm/yy", "d-mmm", "d-mmm-yy", "dd-mmm-yy", "yy-mm-dd", "mmm-yy", "mmmm-yy", "mmm d, yyyy", "mmmm d, yyyy", "m/d/yy h:MM tt", "m/d/yy HH:MM"];
this._timeFormats = ["HH:MM", "h:MM tt", "HH:MM:ss", "h:MM:ss tt"];
this._emailRegex = new RegExp("^[a-zA-Z0-9.!#$%&'*+\\\\/=?^_\`{|}~-]+" + "@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?" + "(?:\\\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$");
}
_createClass(AForm, [{
key: "_mkTargetName",
value: function _mkTargetName(event) {
return event.target ? "[ ".concat(event.target.name, " ]") : "";
}
}, {
key: "_parseDate",
value: function _parseDate(cFormat, cDate) {
var ddate = Date.parse(cDate);
if (isNaN(ddate)) {
try {
return this._util.scand(cFormat, cDate);
} catch (error) {
return null;
}
} else {
return new Date(ddate);
}
}
}, {
key: "AFMergeChange",
value: function AFMergeChange() {
var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : globalThis.event;
if (event.willCommit) {
return event.value.toString();
}
return this._app._eventDispatcher.mergeChange(event);
}
}, {
key: "AFParseDateEx",
value: function AFParseDateEx(cString, cOrder) {
return this._parseDate(cOrder, cString);
}
}, {
key: "AFExtractNums",
value: function AFExtractNums(str) {
if (typeof str === "number") {
return [str];
}
if (!str || typeof str !== "string") {
return null;
}
var first = str.charAt(0);
if (first === "." || first === ",") {
str = "0".concat(str);
}
var numbers = str.match(/(\\d+)/g);
if (numbers.length === 0) {
return null;
}
return numbers;
}
}, {
key: "AFMakeNumber",
value: function AFMakeNumber(str) {
if (typeof str === "number") {
return str;
}
if (typeof str !== "string") {
return null;
}
str = str.trim().replace(",", ".");
var number = parseFloat(str);
if (isNaN(number) || !isFinite(number)) {
return null;
}
return number;
}
}, {
key: "AFMakeArrayFromList",
value: function AFMakeArrayFromList(string) {
if (typeof string === "string") {
return string.split(/, ?/g);
}
return string;
}
}, {
key: "AFNumber_Format",
value: function AFNumber_Format(nDec, sepStyle, negStyle, currStyle, strCurrency, bCurrencyPrepend) {
var event = globalThis.event;
if (!event.value) {
return;
}
var value = this.AFMakeNumber(event.value);
if (value === null) {
event.value = "";
return;
}
var sign = Math.sign(value);
var buf = [];
var hasParen = false;
if (sign === -1 && bCurrencyPrepend && negStyle === 0) {
buf.push("-");
}
if ((negStyle === 2 || negStyle === 3) && sign === -1) {
buf.push("(");
hasParen = true;
}
if (bCurrencyPrepend) {
buf.push(strCurrency);
}
sepStyle = Math.min(Math.max(0, Math.floor(sepStyle)), 4);
buf.push("%,", sepStyle, ".", nDec.toString(), "f");
if (!bCurrencyPrepend) {
buf.push(strCurrency);
}
if (hasParen) {
buf.push(")");
}
if (negStyle === 1 || negStyle === 3) {
event.target.textColor = sign === 1 ? this._color.black : this._color.red;
}
if ((negStyle !== 0 || bCurrencyPrepend) && sign === -1) {
value = -value;
}
var formatStr = buf.join("");
event.value = this._util.printf(formatStr, value);
}
}, {
key: "AFNumber_Keystroke",
value: function AFNumber_Keystroke(nDec, sepStyle, negStyle, currStyle, strCurrency, bCurrencyPrepend) {
var event = globalThis.event;
var value = this.AFMergeChange(event);
if (!value) {
return;
}
value = value.trim();
var pattern;
if (sepStyle > 1) {
pattern = event.willCommit ? /^[+-]?(\\d+(,\\d*)?|,\\d+)$/ : /^[+-]?\\d*,?\\d*$/;
} else {
pattern = event.willCommit ? /^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)$/ : /^[+-]?\\d*\\.?\\d*$/;
}
if (!pattern.test(value)) {
if (event.willCommit) {
var err = "".concat(_constants.GlobalConstants.IDS_INVALID_VALUE, " ").concat(this._mkTargetName(event));
this._app.alert(err);
}
event.rc = false;
}
if (event.willCommit && sepStyle > 1) {
event.value = parseFloat(value.replace(",", "."));
}
}
}, {
key: "AFPercent_Format",
value: function AFPercent_Format(nDec, sepStyle) {
var percentPrepend = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
if (typeof nDec !== "number") {
return;
}
if (typeof sepStyle !== "number") {
return;
}
if (nDec < 0) {
throw new Error("Invalid nDec value in AFPercent_Format");
}
var event = globalThis.event;
if (nDec > 512) {
event.value = "%";
return;
}
nDec = Math.floor(nDec);
sepStyle = Math.min(Math.max(0, Math.floor(sepStyle)), 4);
var value = this.AFMakeNumber(event.value);
if (value === null) {
event.value = "%";
return;
}
var formatStr = "%,".concat(sepStyle, ".").concat(nDec, "f");
value = this._util.printf(formatStr, value * 100);
if (percentPrepend) {
event.value = "%".concat(value);
} else {
event.value = "".concat(value, "%");
}
}
}, {
key: "AFPercent_Keystroke",
value: function AFPercent_Keystroke(nDec, sepStyle) {
this.AFNumber_Keystroke(nDec, sepStyle, 0, 0, "", true);
}
}, {
key: "AFDate_FormatEx",
value: function AFDate_FormatEx(cFormat) {
var event = globalThis.event;
var value = event.value;
if (!value) {
return;
}
var date = this._parseDate(cFormat, value);
if (date !== null) {
event.value = this._util.printd(cFormat, date);
}
}
}, {
key: "AFDate_Format",
value: function AFDate_Format(pdf) {
if (pdf >= 0 && pdf < this._dateFormats.length) {
this.AFDate_FormatEx(this._dateFormats[pdf]);
}
}
}, {
key: "AFDate_KeystrokeEx",
value: function AFDate_KeystrokeEx(cFormat) {
var event = globalThis.event;
if (!event.willCommit) {
return;
}
var value = this.AFMergeChange(event);
if (!value) {
return;
}
if (this._parseDate(cFormat, value) === null) {
var invalid = _constants.GlobalConstants.IDS_INVALID_DATE;
var invalid2 = _constants.GlobalConstants.IDS_INVALID_DATE2;
var err = "".concat(invalid, " ").concat(this._mkTargetName(event)).concat(invalid2).concat(cFormat);
this._app.alert(err);
event.rc = false;
}
}
}, {
key: "AFDate_Keystroke",
value: function AFDate_Keystroke(pdf) {
if (pdf >= 0 && pdf < this._dateFormats.length) {
this.AFDate_KeystrokeEx(this._dateFormats[pdf]);
}
}
}, {
key: "AFRange_Validate",
value: function AFRange_Validate(bGreaterThan, nGreaterThan, bLessThan, nLessThan) {
var event = globalThis.event;
if (!event.value) {
return;
}
var value = this.AFMakeNumber(event.value);
if (value === null) {
return;
}
bGreaterThan = !!bGreaterThan;
bLessThan = !!bLessThan;
if (bGreaterThan) {
nGreaterThan = this.AFMakeNumber(nGreaterThan);
if (nGreaterThan === null) {
return;
}
}
if (bLessThan) {
nLessThan = this.AFMakeNumber(nLessThan);
if (nLessThan === null) {
return;
}
}
var err = "";
if (bGreaterThan && bLessThan) {
if (value < nGreaterThan || value > nLessThan) {
err = this._util.printf(_constants.GlobalConstants.IDS_GT_AND_LT, nGreaterThan, nLessThan);
}
} else if (bGreaterThan) {
if (value < nGreaterThan) {
err = this._util.printf(_constants.GlobalConstants.IDS_GREATER_THAN, nGreaterThan);
}
} else if (value > nLessThan) {
err = this._util.printf(_constants.GlobalConstants.IDS_LESS_THAN, nLessThan);
}
if (err) {
this._app.alert(err);
event.rc = false;
}
}
}, {
key: "AFSimple",
value: function AFSimple(cFunction, nValue1, nValue2) {
var value1 = this.AFMakeNumber(nValue1);
if (value1 === null) {
throw new Error("Invalid nValue1 in AFSimple");
}
var value2 = this.AFMakeNumber(nValue2);
if (value2 === null) {
throw new Error("Invalid nValue2 in AFSimple");
}
switch (cFunction) {
case "AVG":
return (value1 + value2) / 2;
case "SUM":
return value1 + value2;
case "PRD":
return value1 * value2;
case "MIN":
return Math.min(value1, value2);
case "MAX":
return Math.max(value1, value2);
}
throw new Error("Invalid cFunction in AFSimple");
}
}, {
key: "AFSimple_Calculate",
value: function AFSimple_Calculate(cFunction, cFields) {
var actions = {
AVG: function AVG(args) {
return args.reduce(function (acc, value) {
return acc + value;
}, 0) / args.length;
},
SUM: function SUM(args) {
return args.reduce(function (acc, value) {
return acc + value;
}, 0);
},
PRD: function PRD(args) {
return args.reduce(function (acc, value) {
return acc * value;
}, 1);
},
MIN: function MIN(args) {
return args.reduce(function (acc, value) {
return Math.min(acc, value);
}, Number.MAX_VALUE);
},
MAX: function MAX(args) {
return args.reduce(function (acc, value) {
return Math.max(acc, value);
}, Number.MIN_VALUE);
}
};
if (!(cFunction in actions)) {
throw new TypeError("Invalid function in AFSimple_Calculate");
}
var event = globalThis.event;
var values = [];
var _iterator = _createForOfIteratorHelper(cFields),
_step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var cField = _step.value;
var field = this._document.getField(cField);
var number = this.AFMakeNumber(field.value);
if (number !== null) {
values.push(number);
}
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
if (values.length === 0) {
event.value = cFunction === "PRD" ? 1 : 0;
return;
}
var res = actions[cFunction](values);
event.value = Math.round(1e6 * res) / 1e6;
}
}, {
key: "AFSpecial_Format",
value: function AFSpecial_Format(psf) {
var event = globalThis.event;
if (!event.value) {
return;
}
psf = this.AFMakeNumber(psf);
if (psf === null) {
throw new Error("Invalid psf in AFSpecial_Format");
}
var formatStr = "";
switch (psf) {
case 0:
formatStr = "99999";
break;
case 1:
formatStr = "99999-9999";
break;
case 2:
if (this._util.printx("9999999999", event.value).length >= 10) {
formatStr = "(999) 999-9999";
} else {
formatStr = "999-9999";
}
break;
case 3:
formatStr = "999-99-9999";
break;
default:
throw new Error("Invalid psf in AFSpecial_Format");
}
event.value = this._util.printx(formatStr, event.value);
}
}, {
key: "AFSpecial_KeystrokeEx",
value: function AFSpecial_KeystrokeEx(cMask) {
if (!cMask) {
return;
}
var event = globalThis.event;
var value = this.AFMergeChange(event);
var checkers = new Map([["9", function (_char) {
return _char >= "0" && _char <= "9";
}], ["A", function (_char2) {
return "a" <= _char2 && _char2 <= "z" || "A" <= _char2 && _char2 <= "Z";
}], ["O", function (_char3) {
return "a" <= _char3 && _char3 <= "z" || "A" <= _char3 && _char3 <= "Z" || "0" <= _char3 && _char3 <= "9";
}], ["X", function (_char4) {
return true;
}]]);
function _checkValidity(_value, _cMask) {
for (var i = 0, ii = value.length; i < ii; i++) {
var mask = _cMask.charAt(i);
var _char5 = _value.charAt(i);
var checker = checkers.get(mask);
if (checker) {
if (!checker(_char5)) {
return false;
}
} else if (mask !== _char5) {
return false;
}
}
return true;
}
if (!value) {
return;
}
var err = "".concat(_constants.GlobalConstants.IDS_INVALID_VALUE, " = \\"").concat(cMask, "\\"");
if (value.length > cMask.length) {
this._app.alert(err);
event.rc = false;
return;
}
if (event.willCommit) {
if (value.length < cMask.length) {
this._app.alert(err);
event.rc = false;
return;
}
if (!_checkValidity(value, cMask)) {
this._app.alert(err);
event.rc = false;
return;
}
event.value += cMask.substring(value.length);
return;
}
if (value.length < cMask.length) {
cMask = cMask.substring(0, value.length);
}
if (!_checkValidity(value, cMask)) {
this._app.alert(err);
event.rc = false;
}
}
}, {
key: "AFSpecial_Keystroke",
value: function AFSpecial_Keystroke(psf) {
var event = globalThis.event;
if (!event.value) {
return;
}
psf = this.AFMakeNumber(psf);
if (psf === null) {
throw new Error("Invalid psf in AFSpecial_Keystroke");
}
var formatStr;
switch (psf) {
case 0:
formatStr = "99999";
break;
case 1:
formatStr = "99999-9999";
break;
case 2:
var finalLen = event.value.length + event.change.length + event.selStart - event.selEnd;
if (finalLen >= 8) {
formatStr = "(999) 999-9999";
} else {
formatStr = "999-9999";
}
break;
case 3:
formatStr = "999-99-9999";
break;
default:
throw new Error("Invalid psf in AFSpecial_Keystroke");
}
this.AFSpecial_KeystrokeEx(formatStr);
}
}, {
key: "AFTime_FormatEx",
value: function AFTime_FormatEx(cFormat) {
this.AFDate_FormatEx(cFormat);
}
}, {
key: "AFTime_Format",
value: function AFTime_Format(pdf) {
if (pdf >= 0 && pdf < this._timeFormats.length) {
this.AFDate_FormatEx(this._timeFormats[pdf]);
}
}
}, {
key: "AFTime_KeystrokeEx",
value: function AFTime_KeystrokeEx(cFormat) {
this.AFDate_KeystrokeEx(cFormat);
}
}, {
key: "AFTime_Keystroke",
value: function AFTime_Keystroke(pdf) {
if (pdf >= 0 && pdf < this._timeFormats.length) {
this.AFDate_KeystrokeEx(this._timeFormats[pdf]);
}
}
}, {
key: "eMailValidate",
value: function eMailValidate(str) {
return this._emailRegex.test(str);
}
}]);
return AForm;
}();
exports.AForm = AForm;
/***/ }),
/* 9 */
/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.App = void 0;
var _color = __w_pdfjs_require__(5);
var _event = __w_pdfjs_require__(10);
var _fullscreen = __w_pdfjs_require__(11);
var _pdf_object = __w_pdfjs_require__(7);
var _thermometer = __w_pdfjs_require__(12);
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
var VIEWER_TYPE = "PDF.js";
var VIEWER_VARIATION = "Full";
var VIEWER_VERSION = 21.00720099;
var FORMS_VERSION = 21.00720099;
var App = /*#__PURE__*/function (_PDFObject) {
_inherits(App, _PDFObject);
var _super = _createSuper(App);
function App(data) {
var _this;
_classCallCheck(this, App);
_this = _super.call(this, data);
_this._constants = null;
_this._focusRect = true;
_this._fs = null;
_this._language = App._getLanguage(data.language);
_this._openInPlace = false;
_this._platform = App._getPlatform(data.platform);
_this._runtimeHighlight = false;
_this._runtimeHighlightColor = ["T"];
_this._thermometer = null;
_this._toolbar = false;
_this._document = data._document;
_this._proxyHandler = data.proxyHandler;
_this._objects = Object.create(null);
_this._eventDispatcher = new _event.EventDispatcher(_this._document, data.calculationOrder, _this._objects);
_this._timeoutIds = new WeakMap();
if (typeof FinalizationRegistry !== "undefined") {
_this._timeoutIdsRegistry = new FinalizationRegistry(_this._cleanTimeout.bind(_assertThisInitialized(_this)));
} else {
_this._timeoutIdsRegistry = null;
}
_this._timeoutCallbackIds = new Map();
_this._timeoutCallbackId = 0;
_this._globalEval = data.globalEval;
_this._externalCall = data.externalCall;
_this._document = data._document;
return _this;
}
_createClass(App, [{
key: "_dispatchEvent",
value: function _dispatchEvent(pdfEvent) {
this._eventDispatcher.dispatch(pdfEvent);
}
}, {
key: "_registerTimeoutCallback",
value: function _registerTimeoutCallback(cExpr) {
var id = this._timeoutCallbackId++;
this._timeoutCallbackIds.set(id, cExpr);
return id;
}
}, {
key: "_unregisterTimeoutCallback",
value: function _unregisterTimeoutCallback(id) {
this._timeoutCallbackIds["delete"](id);
}
}, {
key: "_evalCallback",
value: function _evalCallback(_ref) {
var callbackId = _ref.callbackId,
interval = _ref.interval;
var expr = this._timeoutCallbackIds.get(callbackId);
if (!interval) {
this._unregisterTimeoutCallback(callbackId);
}
if (expr) {
this._globalEval(expr);
}
}
}, {
key: "_registerTimeout",
value: function _registerTimeout(callbackId, interval) {
var timeout = Object.create(null);
var id = {
callbackId: callbackId,
interval: interval
};
this._timeoutIds.set(timeout, id);
if (this._timeoutIdsRegistry) {
this._timeoutIdsRegistry.register(timeout, id);
}
return timeout;
}
}, {
key: "_unregisterTimeout",
value: function _unregisterTimeout(timeout) {
if (this._timeoutIdsRegistry) {
this._timeoutIdsRegistry.unregister(timeout);
}
var data = this._timeoutIds.get(timeout);
if (!data) {
return;
}
this._timeoutIds["delete"](timeout);
this._cleanTimeout(data);
}
}, {
key: "_cleanTimeout",
value: function _cleanTimeout(_ref2) {
var callbackId = _ref2.callbackId,
interval = _ref2.interval;
this._unregisterTimeoutCallback(callbackId);
if (interval) {
this._externalCall("clearInterval", [callbackId]);
} else {
this._externalCall("clearTimeout", [callbackId]);
}
}
}, {
key: "activeDocs",
get: function get() {
return [this._document.wrapped];
},
set: function set(_) {
throw new Error("app.activeDocs is read-only");
}
}, {
key: "calculate",
get: function get() {
return this._document.obj.calculate;
},
set: function set(calculate) {
this._document.obj.calculate = calculate;
}
}, {
key: "constants",
get: function get() {
if (!this._constants) {
this._constants = Object.freeze({
align: Object.freeze({
left: 0,
center: 1,
right: 2,
top: 3,
bottom: 4
})
});
}
return this._constants;
},
set: function set(_) {
throw new Error("app.constants is read-only");
}
}, {
key: "focusRect",
get: function get() {
return this._focusRect;
},
set: function set(val) {
this._focusRect = val;
}
}, {
key: "formsVersion",
get: function get() {
return FORMS_VERSION;
},
set: function set(_) {
throw new Error("app.formsVersion is read-only");
}
}, {
key: "fromPDFConverters",
get: function get() {
return [];
},
set: function set(_) {
throw new Error("app.fromPDFConverters is read-only");
}
}, {
key: "fs",
get: function get() {
if (this._fs === null) {
this._fs = new Proxy(new _fullscreen.FullScreen({
send: this._send
}), this._proxyHandler);
}
return this._fs;
},
set: function set(_) {
throw new Error("app.fs is read-only");
}
}, {
key: "language",
get: function get() {
return this._language;
},
set: function set(_) {
throw new Error("app.language is read-only");
}
}, {
key: "media",
get: function get() {
return undefined;
},
set: function set(_) {
throw new Error("app.media is read-only");
}
}, {
key: "monitors",
get: function get() {
return [];
},
set: function set(_) {
throw new Error("app.monitors is read-only");
}
}, {
key: "numPlugins",
get: function get() {
return 0;
},
set: function set(_) {
throw new Error("app.numPlugins is read-only");
}
}, {
key: "openInPlace",
get: function get() {
return this._openInPlace;
},
set: function set(val) {
this._openInPlace = val;
}
}, {
key: "platform",
get: function get() {
return this._platform;
},
set: function set(_) {
throw new Error("app.platform is read-only");
}
}, {
key: "plugins",
get: function get() {
return [];
},
set: function set(_) {
throw new Error("app.plugins is read-only");
}
}, {
key: "printColorProfiles",
get: function get() {
return [];
},
set: function set(_) {
throw new Error("app.printColorProfiles is read-only");
}
}, {
key: "printerNames",
get: function get() {
return [];
},
set: function set(_) {
throw new Error("app.printerNames is read-only");
}
}, {
key: "runtimeHighlight",
get: function get() {
return this._runtimeHighlight;
},
set: function set(val) {
this._runtimeHighlight = val;
}
}, {
key: "runtimeHighlightColor",
get: function get() {
return this._runtimeHighlightColor;
},
set: function set(val) {
if (_color.Color._isValidColor(val)) {
this._runtimeHighlightColor = val;
}
}
}, {
key: "thermometer",
get: function get() {
if (this._thermometer === null) {
this._thermometer = new Proxy(new _thermometer.Thermometer({
send: this._send
}), this._proxyHandler);
}
return this._thermometer;
},
set: function set(_) {
throw new Error("app.thermometer is read-only");
}
}, {
key: "toolbar",
get: function get() {
return this._toolbar;
},
set: function set(val) {
this._toolbar = val;
}
}, {
key: "toolbarHorizontal",
get: function get() {
return this.toolbar;
},
set: function set(value) {
this.toolbar = value;
}
}, {
key: "toolbarVertical",
get: function get() {
return this.toolbar;
},
set: function set(value) {
this.toolbar = value;
}
}, {
key: "viewerType",
get: function get() {
return VIEWER_TYPE;
},
set: function set(_) {
throw new Error("app.viewerType is read-only");
}
}, {
key: "viewerVariation",
get: function get() {
return VIEWER_VARIATION;
},
set: function set(_) {
throw new Error("app.viewerVariation is read-only");
}
}, {
key: "viewerVersion",
get: function get() {
return VIEWER_VERSION;
},
set: function set(_) {
throw new Error("app.viewerVersion is read-only");
}
}, {
key: "addMenuItem",
value: function addMenuItem() {}
}, {
key: "addSubMenu",
value: function addSubMenu() {}
}, {
key: "addToolButton",
value: function addToolButton() {}
}, {
key: "alert",
value: function alert(cMsg) {
var nIcon = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
var nType = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
var cTitle = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "PDF.js";
var oDoc = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
var oCheckbox = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : null;
if (_typeof(cMsg) === "object") {
nType = cMsg.nType;
cMsg = cMsg.cMsg;
}
cMsg = (cMsg || "").toString();
nType = typeof nType !== "number" || isNaN(nType) || nType < 0 || nType > 3 ? 0 : nType;
if (nType >= 2) {
return this._externalCall("confirm", [cMsg]) ? 4 : 3;
}
this._externalCall("alert", [cMsg]);
return 1;
}
}, {
key: "beep",
value: function beep() {}
}, {
key: "beginPriv",
value: function beginPriv() {}
}, {
key: "browseForDoc",
value: function browseForDoc() {}
}, {
key: "clearInterval",
value: function clearInterval(oInterval) {
this._unregisterTimeout(oInterval);
}
}, {
key: "clearTimeOut",
value: function clearTimeOut(oTime) {
this._unregisterTimeout(oTime);
}
}, {
key: "endPriv",
value: function endPriv() {}
}, {
key: "execDialog",
value: function execDialog() {}
}, {
key: "execMenuItem",
value: function execMenuItem(item) {
switch (item) {
case "SaveAs":
case "FirstPage":
case "LastPage":
case "NextPage":
case "PrevPage":
case "ZoomViewIn":
case "ZoomViewOut":
this._send({
command: item
});
break;
case "FitPage":
this._send({
command: "zoom",
value: "page-fit"
});
break;
case "Print":
this._send({
command: "print"
});
break;
}
}
}, {
key: "getNthPlugInName",
value: function getNthPlugInName() {}
}, {
key: "getPath",
value: function getPath() {}
}, {
key: "goBack",
value: function goBack() {}
}, {
key: "goForward",
value: function goForward() {}
}, {
key: "hideMenuItem",
value: function hideMenuItem() {}
}, {
key: "hideToolbarButton",
value: function hideToolbarButton() {}
}, {
key: "launchURL",
value: function launchURL() {}
}, {
key: "listMenuItems",
value: function listMenuItems() {}
}, {
key: "listToolbarButtons",
value: function listToolbarButtons() {}
}, {
key: "loadPolicyFile",
value: function loadPolicyFile() {}
}, {
key: "mailGetAddrs",
value: function mailGetAddrs() {}
}, {
key: "mailMsg",
value: function mailMsg() {}
}, {
key: "newDoc",
value: function newDoc() {}
}, {
key: "newCollection",
value: function newCollection() {}
}, {
key: "newFDF",
value: function newFDF() {}
}, {
key: "openDoc",
value: function openDoc() {}
}, {
key: "openFDF",
value: function openFDF() {}
}, {
key: "popUpMenu",
value: function popUpMenu() {}
}, {
key: "popUpMenuEx",
value: function popUpMenuEx() {}
}, {
key: "removeToolButton",
value: function removeToolButton() {}
}, {
key: "response",
value: function response(cQuestion) {
var cTitle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
var cDefault = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "";
var bPassword = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "";
var cLabel = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : "";
if (_typeof(cQuestion) === "object") {
cDefault = cQuestion.cDefault;
cQuestion = cQuestion.cQuestion;
}
cQuestion = (cQuestion || "").toString();
cDefault = (cDefault || "").toString();
return this._externalCall("prompt", [cQuestion, cDefault || ""]);
}
}, {
key: "setInterval",
value: function setInterval(cExpr) {
var nMilliseconds = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
if (_typeof(cExpr) === "object") {
nMilliseconds = cExpr.nMilliseconds || 0;
cExpr = cExpr.cExpr;
}
if (typeof cExpr !== "string") {
throw new TypeError("First argument of app.setInterval must be a string");
}
if (typeof nMilliseconds !== "number") {
throw new TypeError("Second argument of app.setInterval must be a number");
}
var callbackId = this._registerTimeoutCallback(cExpr);
this._externalCall("setInterval", [callbackId, nMilliseconds]);
return this._registerTimeout(callbackId, true);
}
}, {
key: "setTimeOut",
value: function setTimeOut(cExpr) {
var nMilliseconds = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
if (_typeof(cExpr) === "object") {
nMilliseconds = cExpr.nMilliseconds || 0;
cExpr = cExpr.cExpr;
}
if (typeof cExpr !== "string") {
throw new TypeError("First argument of app.setTimeOut must be a string");
}
if (typeof nMilliseconds !== "number") {
throw new TypeError("Second argument of app.setTimeOut must be a number");
}
var callbackId = this._registerTimeoutCallback(cExpr);
this._externalCall("setTimeout", [callbackId, nMilliseconds]);
return this._registerTimeout(callbackId, false);
}
}, {
key: "trustedFunction",
value: function trustedFunction() {}
}, {
key: "trustPropagatorFunction",
value: function trustPropagatorFunction() {}
}], [{
key: "_getPlatform",
value: function _getPlatform(platform) {
if (typeof platform === "string") {
platform = platform.toLowerCase();
if (platform.includes("win")) {
return "WIN";
} else if (platform.includes("mac")) {
return "MAC";
}
}
return "UNIX";
}
}, {
key: "_getLanguage",
value: function _getLanguage(language) {
var _language$toLowerCase = language.toLowerCase().split(/[-_]/),
_language$toLowerCase2 = _slicedToArray(_language$toLowerCase, 2),
main = _language$toLowerCase2[0],
sub = _language$toLowerCase2[1];
switch (main) {
case "zh":
if (sub === "cn" || sub === "sg") {
return "CHS";
}
return "CHT";
case "da":
return "DAN";
case "de":
return "DEU";
case "es":
return "ESP";
case "fr":
return "FRA";
case "it":
return "ITA";
case "ko":
return "KOR";
case "ja":
return "JPN";
case "nl":
return "NLD";
case "no":
return "NOR";
case "pt":
if (sub === "br") {
return "PTB";
}
return "ENU";
case "fi":
return "SUO";
case "SV":
return "SVE";
default:
return "ENU";
}
}
}]);
return App;
}(_pdf_object.PDFObject);
exports.App = App;
/***/ }),
/* 10 */
/***/ ((__unused_webpack_module, exports) => {
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.EventDispatcher = exports.Event = void 0;
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var Event = function Event(data) {
_classCallCheck(this, Event);
this.change = data.change || "";
this.changeEx = data.changeEx || null;
this.commitKey = data.commitKey || 0;
this.fieldFull = data.fieldFull || false;
this.keyDown = data.keyDown || false;
this.modifier = data.modifier || false;
this.name = data.name;
this.rc = true;
this.richChange = data.richChange || [];
this.richChangeEx = data.richChangeEx || [];
this.richValue = data.richValue || [];
this.selEnd = data.selEnd || -1;
this.selStart = data.selStart || -1;
this.shift = data.shift || false;
this.source = data.source || null;
this.target = data.target || null;
this.targetName = "";
this.type = "Field";
this.value = data.value || "";
this.willCommit = data.willCommit || false;
};
exports.Event = Event;
var EventDispatcher = /*#__PURE__*/function () {
function EventDispatcher(document, calculationOrder, objects) {
_classCallCheck(this, EventDispatcher);
this._document = document;
this._calculationOrder = calculationOrder;
this._objects = objects;
this._document.obj._eventDispatcher = this;
}
_createClass(EventDispatcher, [{
key: "mergeChange",
value: function mergeChange(event) {
var value = event.value;
if (typeof value !== "string") {
value = value.toString();
}
var prefix = event.selStart >= 0 ? value.substring(0, event.selStart) : "";
var postfix = event.selEnd >= 0 && event.selEnd <= value.length ? value.substring(event.selEnd) : "";
return "".concat(prefix).concat(event.change).concat(postfix);
}
}, {
key: "dispatch",
value: function dispatch(baseEvent) {
var id = baseEvent.id;
if (!(id in this._objects)) {
var _event;
if (id === "doc" || id === "page") {
_event = globalThis.event = new Event(baseEvent);
_event.source = _event.target = this._document.wrapped;
_event.name = baseEvent.name;
}
if (id === "doc") {
this._document.obj._dispatchDocEvent(_event.name);
} else if (id === "page") {
this._document.obj._dispatchPageEvent(_event.name, baseEvent.actions, baseEvent.pageNumber);
} else if (id === "app" && baseEvent.name === "ResetForm") {
var _iterator = _createForOfIteratorHelper(baseEvent.ids),
_step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var fieldId = _step.value;
var obj = this._objects[fieldId];
if (obj) {
obj.obj._reset();
}
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
}
return;
}
var name = baseEvent.name;
var source = this._objects[id];
var event = globalThis.event = new Event(baseEvent);
var savedChange;
if (source.obj._isButton()) {
source.obj._id = id;
event.value = source.obj._getExportValue(event.value);
if (name === "Action") {
source.obj._value = event.value;
}
}
switch (name) {
case "Keystroke":
savedChange = {
value: event.value,
change: event.change,
selStart: event.selStart,
selEnd: event.selEnd
};
break;
case "Blur":
case "Focus":
Object.defineProperty(event, "value", {
configurable: false,
writable: false,
enumerable: true,
value: event.value
});
break;
case "Validate":
this.runValidation(source, event);
return;
case "Action":
this.runActions(source, source, event, name);
if (this._document.obj.calculate) {
this.runCalculate(source, event);
}
return;
}
this.runActions(source, source, event, name);
if (name === "Keystroke") {
if (event.rc) {
if (event.willCommit) {
this.runValidation(source, event);
} else if (event.change !== savedChange.change || event.selStart !== savedChange.selStart || event.selEnd !== savedChange.selEnd) {
source.wrapped.value = this.mergeChange(event);
}
} else if (!event.willCommit) {
source.obj._send({
id: source.obj._id,
value: savedChange.value,
selRange: [savedChange.selStart, savedChange.selEnd]
});
}
}
}
}, {
key: "runValidation",
value: function runValidation(source, event) {
var hasRan = this.runActions(source, source, event, "Validate");
if (event.rc) {
if (hasRan) {
source.wrapped.value = event.value;
source.wrapped.valueAsString = event.value;
} else {
source.obj.value = event.value;
source.obj.valueAsString = event.value;
}
if (this._document.obj.calculate) {
this.runCalculate(source, event);
}
event.value = source.obj.value;
this.runActions(source, source, event, "Format");
source.wrapped.valueAsString = event.value;
}
}
}, {
key: "runActions",
value: function runActions(source, target, event, eventName) {
event.source = source.wrapped;
event.target = target.wrapped;
event.name = eventName;
event.targetName = target.obj.name;
event.rc = true;
return target.obj._runActions(event);
}
}, {
key: "calculateNow",
value: function calculateNow() {
if (!this._calculationOrder) {
return;
}
var first = this._calculationOrder[0];
var source = this._objects[first];
globalThis.event = new Event({});
this.runCalculate(source, globalThis.event);
}
}, {
key: "runCalculate",
value: function runCalculate(source, event) {
if (!this._calculationOrder) {
return;
}
var _iterator2 = _createForOfIteratorHelper(this._calculationOrder),
_step2;
try {
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
var targetId = _step2.value;
if (!(targetId in this._objects)) {
continue;
}
if (!this._document.obj.calculate) {
continue;
}
event.value = null;
var target = this._objects[targetId];
this.runActions(source, target, event, "Calculate");
if (!event.rc) {
continue;
}
if (event.value !== null) {
target.wrapped.value = event.value;
}
event.value = target.obj.value;
this.runActions(target, target, event, "Validate");
if (!event.rc) {
continue;
}
event.value = target.obj.value;
this.runActions(target, target, event, "Format");
if (event.value !== null) {
target.wrapped.valueAsString = event.value;
}
}
} catch (err) {
_iterator2.e(err);
} finally {
_iterator2.f();
}
}
}]);
return EventDispatcher;
}();
exports.EventDispatcher = EventDispatcher;
/***/ }),
/* 11 */
/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.FullScreen = void 0;
var _constants = __w_pdfjs_require__(2);
var _pdf_object = __w_pdfjs_require__(7);
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
var FullScreen = /*#__PURE__*/function (_PDFObject) {
_inherits(FullScreen, _PDFObject);
var _super = _createSuper(FullScreen);
function FullScreen(data) {
var _this;
_classCallCheck(this, FullScreen);
_this = _super.call(this, data);
_this._backgroundColor = [];
_this._clickAdvances = true;
_this._cursor = _constants.Cursor.hidden;
_this._defaultTransition = "";
_this._escapeExits = true;
_this._isFullScreen = true;
_this._loop = false;
_this._timeDelay = 3600;
_this._usePageTiming = false;
_this._useTimer = false;
return _this;
}
_createClass(FullScreen, [{
key: "backgroundColor",
get: function get() {
return this._backgroundColor;
},
set: function set(_) {}
}, {
key: "clickAdvances",
get: function get() {
return this._clickAdvances;
},
set: function set(_) {}
}, {
key: "cursor",
get: function get() {
return this._cursor;
},
set: function set(_) {}
}, {
key: "defaultTransition",
get: function get() {
return this._defaultTransition;
},
set: function set(_) {}
}, {
key: "escapeExits",
get: function get() {
return this._escapeExits;
},
set: function set(_) {}
}, {
key: "isFullScreen",
get: function get() {
return this._isFullScreen;
},
set: function set(_) {}
}, {
key: "loop",
get: function get() {
return this._loop;
},
set: function set(_) {}
}, {
key: "timeDelay",
get: function get() {
return this._timeDelay;
},
set: function set(_) {}
}, {
key: "transitions",
get: function get() {
return ["Replace", "WipeRight", "WipeLeft", "WipeDown", "WipeUp", "SplitHorizontalIn", "SplitHorizontalOut", "SplitVerticalIn", "SplitVerticalOut", "BlindsHorizontal", "BlindsVertical", "BoxIn", "BoxOut", "GlitterRight", "GlitterDown", "GlitterRightDown", "Dissolve", "Random"];
},
set: function set(_) {
throw new Error("fullscreen.transitions is read-only");
}
}, {
key: "usePageTiming",
get: function get() {
return this._usePageTiming;
},
set: function set(_) {}
}, {
key: "useTimer",
get: function get() {
return this._useTimer;
},
set: function set(_) {}
}]);
return FullScreen;
}(_pdf_object.PDFObject);
exports.FullScreen = FullScreen;
/***/ }),
/* 12 */
/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.Thermometer = void 0;
var _pdf_object = __w_pdfjs_require__(7);
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
var Thermometer = /*#__PURE__*/function (_PDFObject) {
_inherits(Thermometer, _PDFObject);
var _super = _createSuper(Thermometer);
function Thermometer(data) {
var _this;
_classCallCheck(this, Thermometer);
_this = _super.call(this, data);
_this._cancelled = false;
_this._duration = 100;
_this._text = "";
_this._value = 0;
return _this;
}
_createClass(Thermometer, [{
key: "cancelled",
get: function get() {
return this._cancelled;
},
set: function set(_) {
throw new Error("thermometer.cancelled is read-only");
}
}, {
key: "duration",
get: function get() {
return this._duration;
},
set: function set(val) {
this._duration = val;
}
}, {
key: "text",
get: function get() {
return this._text;
},
set: function set(val) {
this._text = val;
}
}, {
key: "value",
get: function get() {
return this._value;
},
set: function set(val) {
this._value = val;
}
}, {
key: "begin",
value: function begin() {}
}, {
key: "end",
value: function end() {}
}]);
return Thermometer;
}(_pdf_object.PDFObject);
exports.Thermometer = Thermometer;
/***/ }),
/* 13 */
/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.Console = void 0;
var _pdf_object = __w_pdfjs_require__(7);
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
var Console = /*#__PURE__*/function (_PDFObject) {
_inherits(Console, _PDFObject);
var _super = _createSuper(Console);
function Console() {
_classCallCheck(this, Console);
return _super.apply(this, arguments);
}
_createClass(Console, [{
key: "clear",
value: function clear() {
this._send({
id: "clear"
});
}
}, {
key: "hide",
value: function hide() {}
}, {
key: "println",
value: function println(msg) {
if (typeof msg === "string") {
this._send({
command: "println",
value: "PDF.js Console:: " + msg
});
}
}
}, {
key: "show",
value: function show() {}
}]);
return Console;
}(_pdf_object.PDFObject);
exports.Console = Console;
/***/ }),
/* 14 */
/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.Doc = void 0;
var _common = __w_pdfjs_require__(4);
var _pdf_object = __w_pdfjs_require__(7);
var _print_params = __w_pdfjs_require__(15);
var _constants = __w_pdfjs_require__(2);
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
var InfoProxyHandler = /*#__PURE__*/function () {
function InfoProxyHandler() {
_classCallCheck(this, InfoProxyHandler);
}
_createClass(InfoProxyHandler, null, [{
key: "get",
value: function get(obj, prop) {
return obj[prop.toLowerCase()];
}
}, {
key: "set",
value: function set(obj, prop, value) {
throw new Error("doc.info.".concat(prop, " is read-only"));
}
}]);
return InfoProxyHandler;
}();
var Doc = /*#__PURE__*/function (_PDFObject) {
_inherits(Doc, _PDFObject);
var _super = _createSuper(Doc);
function Doc(data) {
var _this;
_classCallCheck(this, Doc);
_this = _super.call(this, data);
_this._expandos = globalThis;
_this._baseURL = data.baseURL || "";
_this._calculate = true;
_this._delay = false;
_this._dirty = false;
_this._disclosed = false;
_this._media = undefined;
_this._metadata = data.metadata || "";
_this._noautocomplete = undefined;
_this._nocache = undefined;
_this._spellDictionaryOrder = [];
_this._spellLanguageOrder = [];
_this._printParams = null;
_this._fields = new Map();
_this._fieldNames = [];
_this._event = null;
_this._author = data.Author || "";
_this._creator = data.Creator || "";
_this._creationDate = _this._getDate(data.CreationDate) || null;
_this._docID = data.docID || ["", ""];
_this._documentFileName = data.filename || "";
_this._filesize = data.filesize || 0;
_this._keywords = data.Keywords || "";
_this._layout = data.layout || "";
_this._modDate = _this._getDate(data.ModDate) || null;
_this._numFields = 0;
_this._numPages = data.numPages || 1;
_this._pageNum = data.pageNum || 0;
_this._producer = data.Producer || "";
_this._securityHandler = data.EncryptFilterName || null;
_this._subject = data.Subject || "";
_this._title = data.Title || "";
_this._URL = data.URL || "";
_this._info = new Proxy({
title: _this._title,
author: _this._author,
authors: data.authors || [_this._author],
subject: _this._subject,
keywords: _this._keywords,
creator: _this._creator,
producer: _this._producer,
creationdate: _this._creationDate,
moddate: _this._modDate,
trapped: data.Trapped || "Unknown"
}, InfoProxyHandler);
_this._zoomType = _constants.ZoomType.none;
_this._zoom = data.zoom || 100;
_this._actions = (0, _common.createActionsMap)(data.actions);
_this._globalEval = data.globalEval;
_this._pageActions = new Map();
return _this;
}
_createClass(Doc, [{
key: "_dispatchDocEvent",
value: function _dispatchDocEvent(name) {
if (name === "Open") {
var dontRun = new Set(["WillClose", "WillSave", "DidSave", "WillPrint", "DidPrint", "OpenAction"]);
var _iterator = _createForOfIteratorHelper(this._actions.keys()),
_step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var actionName = _step.value;
if (!dontRun.has(actionName)) {
this._runActions(actionName);
}
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
this._runActions("OpenAction");
} else {
this._runActions(name);
}
}
}, {
key: "_dispatchPageEvent",
value: function _dispatchPageEvent(name, actions, pageNumber) {
var _this$_pageActions$ge;
if (name === "PageOpen") {
if (!this._pageActions.has(pageNumber)) {
this._pageActions.set(pageNumber, (0, _common.createActionsMap)(actions));
}
this._pageNum = pageNumber - 1;
}
actions = (_this$_pageActions$ge = this._pageActions.get(pageNumber)) === null || _this$_pageActions$ge === void 0 ? void 0 : _this$_pageActions$ge.get(name);
if (actions) {
var _iterator2 = _createForOfIteratorHelper(actions),
_step2;
try {
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
var action = _step2.value;
this._globalEval(action);
}
} catch (err) {
_iterator2.e(err);
} finally {
_iterator2.f();
}
}
}
}, {
key: "_runActions",
value: function _runActions(name) {
var actions = this._actions.get(name);
if (actions) {
var _iterator3 = _createForOfIteratorHelper(actions),
_step3;
try {
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
var action = _step3.value;
this._globalEval(action);
}
} catch (err) {
_iterator3.e(err);
} finally {
_iterator3.f();
}
}
}
}, {
key: "_addField",
value: function _addField(name, field) {
this._fields.set(name, field);
this._fieldNames.push(name);
this._numFields++;
}
}, {
key: "_getDate",
value: function _getDate(date) {
if (!date || date.length < 15 || !date.startsWith("D:")) {
return date;
}
date = date.substring(2);
var year = date.substring(0, 4);
var month = date.substring(4, 6);
var day = date.substring(6, 8);
var hour = date.substring(8, 10);
var minute = date.substring(10, 12);
var o = date.charAt(12);
var second, offsetPos;
if (o === "Z" || o === "+" || o === "-") {
second = "00";
offsetPos = 12;
} else {
second = date.substring(12, 14);
offsetPos = 14;
}
var offset = date.substring(offsetPos).replaceAll("'", "");
return new Date("".concat(year, "-").concat(month, "-").concat(day, "T").concat(hour, ":").concat(minute, ":").concat(second).concat(offset));
}
}, {
key: "author",
get: function get() {
return this._author;
},
set: function set(_) {
throw new Error("doc.author is read-only");
}
}, {
key: "baseURL",
get: function get() {
return this._baseURL;
},
set: function set(baseURL) {
this._baseURL = baseURL;
}
}, {
key: "bookmarkRoot",
get: function get() {
return undefined;
},
set: function set(_) {
throw new Error("doc.bookmarkRoot is read-only");
}
}, {
key: "calculate",
get: function get() {
return this._calculate;
},
set: function set(calculate) {
this._calculate = calculate;
}
}, {
key: "creator",
get: function get() {
return this._creator;
},
set: function set(_) {
throw new Error("doc.creator is read-only");
}
}, {
key: "dataObjects",
get: function get() {
return [];
},
set: function set(_) {
throw new Error("doc.dataObjects is read-only");
}
}, {
key: "delay",
get: function get() {
return this._delay;
},
set: function set(delay) {
this._delay = delay;
}
}, {
key: "dirty",
get: function get() {
return this._dirty;
},
set: function set(dirty) {
this._dirty = dirty;
}
}, {
key: "disclosed",
get: function get() {
return this._disclosed;
},
set: function set(disclosed) {
this._disclosed = disclosed;
}
}, {
key: "docID",
get: function get() {
return this._docID;
},
set: function set(_) {
throw new Error("doc.docID is read-only");
}
}, {
key: "documentFileName",
get: function get() {
return this._documentFileName;
},
set: function set(_) {
throw new Error("doc.documentFileName is read-only");
}
}, {
key: "dynamicXFAForm",
get: function get() {
return false;
},
set: function set(_) {
throw new Error("doc.dynamicXFAForm is read-only");
}
}, {
key: "external",
get: function get() {
return true;
},
set: function set(_) {
throw new Error("doc.external is read-only");
}
}, {
key: "filesize",
get: function get() {
return this._filesize;
},
set: function set(_) {
throw new Error("doc.filesize is read-only");
}
}, {
key: "hidden",
get: function get() {
return false;
},
set: function set(_) {
throw new Error("doc.hidden is read-only");
}
}, {
key: "hostContainer",
get: function get() {
return undefined;
},
set: function set(_) {
throw new Error("doc.hostContainer is read-only");
}
}, {
key: "icons",
get: function get() {
return undefined;
},
set: function set(_) {
throw new Error("doc.icons is read-only");
}
}, {
key: "info",
get: function get() {
return this._info;
},
set: function set(_) {
throw new Error("doc.info is read-only");
}
}, {
key: "innerAppWindowRect",
get: function get() {
return [0, 0, 0, 0];
},
set: function set(_) {
throw new Error("doc.innerAppWindowRect is read-only");
}
}, {
key: "innerDocWindowRect",
get: function get() {
return [0, 0, 0, 0];
},
set: function set(_) {
throw new Error("doc.innerDocWindowRect is read-only");
}
}, {
key: "isModal",
get: function get() {
return false;
},
set: function set(_) {
throw new Error("doc.isModal is read-only");
}
}, {
key: "keywords",
get: function get() {
return this._keywords;
},
set: function set(_) {
throw new Error("doc.keywords is read-only");
}
}, {
key: "layout",
get: function get() {
return this._layout;
},
set: function set(value) {
if (typeof value !== "string") {
return;
}
if (value !== "SinglePage" && value !== "OneColumn" && value !== "TwoColumnLeft" && value !== "TwoPageLeft" && value !== "TwoColumnRight" && value !== "TwoPageRight") {
value = "SinglePage";
}
this._send({
command: "layout",
value: value
});
this._layout = value;
}
}, {
key: "media",
get: function get() {
return this._media;
},
set: function set(media) {
this._media = media;
}
}, {
key: "metadata",
get: function get() {
return this._metadata;
},
set: function set(metadata) {
this._metadata = metadata;
}
}, {
key: "modDate",
get: function get() {
return this._modDate;
},
set: function set(_) {
throw new Error("doc.modDate is read-only");
}
}, {
key: "mouseX",
get: function get() {
return 0;
},
set: function set(_) {
throw new Error("doc.mouseX is read-only");
}
}, {
key: "mouseY",
get: function get() {
return 0;
},
set: function set(_) {
throw new Error("doc.mouseY is read-only");
}
}, {
key: "noautocomplete",
get: function get() {
return this._noautocomplete;
},
set: function set(noautocomplete) {
this._noautocomplete = noautocomplete;
}
}, {
key: "nocache",
get: function get() {
return this._nocache;
},
set: function set(nocache) {
this._nocache = nocache;
}
}, {
key: "numFields",
get: function get() {
return this._numFields;
},
set: function set(_) {
throw new Error("doc.numFields is read-only");
}
}, {
key: "numPages",
get: function get() {
return this._numPages;
},
set: function set(_) {
throw new Error("doc.numPages is read-only");
}
}, {
key: "numTemplates",
get: function get() {
return 0;
},
set: function set(_) {
throw new Error("doc.numTemplates is read-only");
}
}, {
key: "outerAppWindowRect",
get: function get() {
return [0, 0, 0, 0];
},
set: function set(_) {
throw new Error("doc.outerAppWindowRect is read-only");
}
}, {
key: "outerDocWindowRect",
get: function get() {
return [0, 0, 0, 0];
},
set: function set(_) {
throw new Error("doc.outerDocWindowRect is read-only");
}
}, {
key: "pageNum",
get: function get() {
return this._pageNum;
},
set: function set(value) {
if (typeof value !== "number" || value < 0 || value >= this._numPages) {
return;
}
this._send({
command: "page-num",
value: value
});
this._pageNum = value;
}
}, {
key: "pageWindowRect",
get: function get() {
return [0, 0, 0, 0];
},
set: function set(_) {
throw new Error("doc.pageWindowRect is read-only");
}
}, {
key: "path",
get: function get() {
return "";
},
set: function set(_) {
throw new Error("doc.path is read-only");
}
}, {
key: "permStatusReady",
get: function get() {
return true;
},
set: function set(_) {
throw new Error("doc.permStatusReady is read-only");
}
}, {
key: "producer",
get: function get() {
return this._producer;
},
set: function set(_) {
throw new Error("doc.producer is read-only");
}
}, {
key: "requiresFullSave",
get: function get() {
return false;
},
set: function set(_) {
throw new Error("doc.requiresFullSave is read-only");
}
}, {
key: "securityHandler",
get: function get() {
return this._securityHandler;
},
set: function set(_) {
throw new Error("doc.securityHandler is read-only");
}
}, {
key: "selectedAnnots",
get: function get() {
return [];
},
set: function set(_) {
throw new Error("doc.selectedAnnots is read-only");
}
}, {
key: "sounds",
get: function get() {
return [];
},
set: function set(_) {
throw new Error("doc.sounds is read-only");
}
}, {
key: "spellDictionaryOrder",
get: function get() {
return this._spellDictionaryOrder;
},
set: function set(spellDictionaryOrder) {
this._spellDictionaryOrder = spellDictionaryOrder;
}
}, {
key: "spellLanguageOrder",
get: function get() {
return this._spellLanguageOrder;
},
set: function set(spellLanguageOrder) {
this._spellLanguageOrder = spellLanguageOrder;
}
}, {
key: "subject",
get: function get() {
return this._subject;
},
set: function set(_) {
throw new Error("doc.subject is read-only");
}
}, {
key: "templates",
get: function get() {
return [];
},
set: function set(_) {
throw new Error("doc.templates is read-only");
}
}, {
key: "title",
get: function get() {
return this._title;
},
set: function set(_) {
throw new Error("doc.title is read-only");
}
}, {
key: "URL",
get: function get() {
return this._URL;
},
set: function set(_) {
throw new Error("doc.URL is read-only");
}
}, {
key: "viewState",
get: function get() {
return undefined;
},
set: function set(_) {
throw new Error("doc.viewState is read-only");
}
}, {
key: "xfa",
get: function get() {
return this._xfa;
},
set: function set(_) {
throw new Error("doc.xfa is read-only");
}
}, {
key: "XFAForeground",
get: function get() {
return false;
},
set: function set(_) {
throw new Error("doc.XFAForeground is read-only");
}
}, {
key: "zoomType",
get: function get() {
return this._zoomType;
},
set: function set(type) {
if (typeof type !== "string") {
return;
}
switch (type) {
case _constants.ZoomType.none:
this._send({
command: "zoom",
value: 1
});
break;
case _constants.ZoomType.fitP:
this._send({
command: "zoom",
value: "page-fit"
});
break;
case _constants.ZoomType.fitW:
this._send({
command: "zoom",
value: "page-width"
});
break;
case _constants.ZoomType.fitH:
this._send({
command: "zoom",
value: "page-height"
});
break;
case _constants.ZoomType.fitV:
this._send({
command: "zoom",
value: "auto"
});
break;
case _constants.ZoomType.pref:
case _constants.ZoomType.refW:
break;
default:
return;
}
this._zoomType = type;
}
}, {
key: "zoom",
get: function get() {
return this._zoom;
},
set: function set(value) {
if (typeof value !== "number" || value < 8.33 || value > 6400) {
return;
}
this._send({
command: "zoom",
value: value / 100
});
}
}, {
key: "addAnnot",
value: function addAnnot() {}
}, {
key: "addField",
value: function addField() {}
}, {
key: "addIcon",
value: function addIcon() {}
}, {
key: "addLink",
value: function addLink() {}
}, {
key: "addRecipientListCryptFilter",
value: function addRecipientListCryptFilter() {}
}, {
key: "addRequirement",
value: function addRequirement() {}
}, {
key: "addScript",
value: function addScript() {}
}, {
key: "addThumbnails",
value: function addThumbnails() {}
}, {
key: "addWatermarkFromFile",
value: function addWatermarkFromFile() {}
}, {
key: "addWatermarkFromText",
value: function addWatermarkFromText() {}
}, {
key: "addWeblinks",
value: function addWeblinks() {}
}, {
key: "bringToFront",
value: function bringToFront() {}
}, {
key: "calculateNow",
value: function calculateNow() {
this._eventDispatcher.calculateNow();
}
}, {
key: "closeDoc",
value: function closeDoc() {}
}, {
key: "colorConvertPage",
value: function colorConvertPage() {}
}, {
key: "createDataObject",
value: function createDataObject() {}
}, {
key: "createTemplate",
value: function createTemplate() {}
}, {
key: "deletePages",
value: function deletePages() {}
}, {
key: "deleteSound",
value: function deleteSound() {}
}, {
key: "embedDocAsDataObject",
value: function embedDocAsDataObject() {}
}, {
key: "embedOutputIntent",
value: function embedOutputIntent() {}
}, {
key: "encryptForRecipients",
value: function encryptForRecipients() {}
}, {
key: "encryptUsingPolicy",
value: function encryptUsingPolicy() {}
}, {
key: "exportAsFDF",
value: function exportAsFDF() {}
}, {
key: "exportAsFDFStr",
value: function exportAsFDFStr() {}
}, {
key: "exportAsText",
value: function exportAsText() {}
}, {
key: "exportAsXFDF",
value: function exportAsXFDF() {}
}, {
key: "exportAsXFDFStr",
value: function exportAsXFDFStr() {}
}, {
key: "exportDataObject",
value: function exportDataObject() {}
}, {
key: "exportXFAData",
value: function exportXFAData() {}
}, {
key: "extractPages",
value: function extractPages() {}
}, {
key: "flattenPages",
value: function flattenPages() {}
}, {
key: "getAnnot",
value: function getAnnot() {}
}, {
key: "getAnnots",
value: function getAnnots() {}
}, {
key: "getAnnot3D",
value: function getAnnot3D() {}
}, {
key: "getAnnots3D",
value: function getAnnots3D() {}
}, {
key: "getColorConvertAction",
value: function getColorConvertAction() {}
}, {
key: "getDataObject",
value: function getDataObject() {}
}, {
key: "getDataObjectContents",
value: function getDataObjectContents() {}
}, {
key: "getField",
value: function getField(cName) {
if (_typeof(cName) === "object") {
cName = cName.cName;
}
if (typeof cName !== "string") {
throw new TypeError("Invalid field name: must be a string");
}
var searchedField = this._fields.get(cName);
if (searchedField) {
return searchedField;
}
var parts = cName.split("#");
var childIndex = NaN;
if (parts.length === 2) {
childIndex = Math.floor(parseFloat(parts[1]));
cName = parts[0];
}
var _iterator4 = _createForOfIteratorHelper(this._fields.entries()),
_step4;
try {
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
var _step4$value = _slicedToArray(_step4.value, 2),
name = _step4$value[0],
field = _step4$value[1];
if (name.endsWith(cName)) {
if (!isNaN(childIndex)) {
var children = this._getChildren(name);
if (childIndex < 0 || childIndex >= children.length) {
childIndex = 0;
}
if (childIndex < children.length) {
this._fields.set(cName, children[childIndex]);
return children[childIndex];
}
}
this._fields.set(cName, field);
return field;
}
}
} catch (err) {
_iterator4.e(err);
} finally {
_iterator4.f();
}
return null;
}
}, {
key: "_getChildren",
value: function _getChildren(fieldName) {
var len = fieldName.length;
var children = [];
var pattern = /^\\.[^.]+$/;
var _iterator5 = _createForOfIteratorHelper(this._fields.entries()),
_step5;
try {
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
var _step5$value = _slicedToArray(_step5.value, 2),
name = _step5$value[0],
field = _step5$value[1];
if (name.startsWith(fieldName)) {
var finalPart = name.slice(len);
if (finalPart.match(pattern)) {
children.push(field);
}
}
}
} catch (err) {
_iterator5.e(err);
} finally {
_iterator5.f();
}
return children;
}
}, {
key: "getIcon",
value: function getIcon() {}
}, {
key: "getLegalWarnings",
value: function getLegalWarnings() {}
}, {
key: "getLinks",
value: function getLinks() {}
}, {
key: "getNthFieldName",
value: function getNthFieldName(nIndex) {
if (_typeof(nIndex) === "object") {
nIndex = nIndex.nIndex;
}
if (typeof nIndex !== "number") {
throw new TypeError("Invalid field index: must be a number");
}
if (0 <= nIndex && nIndex < this.numFields) {
return this._fieldNames[Math.trunc(nIndex)];
}
return null;
}
}, {
key: "getNthTemplate",
value: function getNthTemplate() {
return null;
}
}, {
key: "getOCGs",
value: function getOCGs() {}
}, {
key: "getOCGOrder",
value: function getOCGOrder() {}
}, {
key: "getPageBox",
value: function getPageBox() {}
}, {
key: "getPageLabel",
value: function getPageLabel() {}
}, {
key: "getPageNthWord",
value: function getPageNthWord() {}
}, {
key: "getPageNthWordQuads",
value: function getPageNthWordQuads() {}
}, {
key: "getPageNumWords",
value: function getPageNumWords() {}
}, {
key: "getPageRotation",
value: function getPageRotation() {}
}, {
key: "getPageTransition",
value: function getPageTransition() {}
}, {
key: "getPrintParams",
value: function getPrintParams() {
if (!this._printParams) {
this._printParams = new _print_params.PrintParams({
lastPage: this._numPages - 1
});
}
return this._printParams;
}
}, {
key: "getSound",
value: function getSound() {}
}, {
key: "getTemplate",
value: function getTemplate() {}
}, {
key: "getURL",
value: function getURL() {}
}, {
key: "gotoNamedDest",
value: function gotoNamedDest() {}
}, {
key: "importAnFDF",
value: function importAnFDF() {}
}, {
key: "importAnXFDF",
value: function importAnXFDF() {}
}, {
key: "importDataObject",
value: function importDataObject() {}
}, {
key: "importIcon",
value: function importIcon() {}
}, {
key: "importSound",
value: function importSound() {}
}, {
key: "importTextData",
value: function importTextData() {}
}, {
key: "importXFAData",
value: function importXFAData() {}
}, {
key: "insertPages",
value: function insertPages() {}
}, {
key: "mailDoc",
value: function mailDoc() {}
}, {
key: "mailForm",
value: function mailForm() {}
}, {
key: "movePage",
value: function movePage() {}
}, {
key: "newPage",
value: function newPage() {}
}, {
key: "openDataObject",
value: function openDataObject() {}
}, {
key: "print",
value: function print() {
var bUI = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
var nStart = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
var nEnd = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : -1;
var bSilent = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
var bShrinkToFit = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
var bPrintAsImage = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
var bReverse = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
var bAnnotations = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : true;
var printParams = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : null;
if (_typeof(bUI) === "object") {
nStart = bUI.nStart;
nEnd = bUI.nEnd;
bSilent = bUI.bSilent;
bShrinkToFit = bUI.bShrinkToFit;
bPrintAsImage = bUI.bPrintAsImage;
bReverse = bUI.bReverse;
bAnnotations = bUI.bAnnotations;
printParams = bUI.printParams;
bUI = bUI.bUI;
}
if (printParams) {
nStart = printParams.firstPage;
nEnd = printParams.lastPage;
}
if (typeof nStart === "number") {
nStart = Math.max(0, Math.trunc(nStart));
} else {
nStart = 0;
}
if (typeof nEnd === "number") {
nEnd = Math.max(0, Math.trunc(nEnd));
} else {
nEnd = -1;
}
this._send({
command: "print",
start: nStart,
end: nEnd
});
}
}, {
key: "removeDataObject",
value: function removeDataObject() {}
}, {
key: "removeField",
value: function removeField() {}
}, {
key: "removeIcon",
value: function removeIcon() {}
}, {
key: "removeLinks",
value: function removeLinks() {}
}, {
key: "removeRequirement",
value: function removeRequirement() {}
}, {
key: "removeScript",
value: function removeScript() {}
}, {
key: "removeTemplate",
value: function removeTemplate() {}
}, {
key: "removeThumbnails",
value: function removeThumbnails() {}
}, {
key: "removeWeblinks",
value: function removeWeblinks() {}
}, {
key: "replacePages",
value: function replacePages() {}
}, {
key: "resetForm",
value: function resetForm() {
var aFields = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
if (aFields && !Array.isArray(aFields) && _typeof(aFields) === "object") {
aFields = aFields.aFields;
}
var mustCalculate = false;
if (aFields) {
var _iterator6 = _createForOfIteratorHelper(aFields),
_step6;
try {
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
var fieldName = _step6.value;
if (!fieldName) {
continue;
}
var field = this.getField(fieldName);
if (!field) {
continue;
}
field.value = field.defaultValue;
field.valueAsString = field.value;
mustCalculate = true;
}
} catch (err) {
_iterator6.e(err);
} finally {
_iterator6.f();
}
} else {
mustCalculate = this._fields.size !== 0;
var _iterator7 = _createForOfIteratorHelper(this._fields.values()),
_step7;
try {
for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
var _field = _step7.value;
_field.value = _field.defaultValue;
_field.valueAsString = _field.value;
}
} catch (err) {
_iterator7.e(err);
} finally {
_iterator7.f();
}
}
if (mustCalculate) {
this.calculateNow();
}
}
}, {
key: "saveAs",
value: function saveAs() {}
}, {
key: "scroll",
value: function scroll() {}
}, {
key: "selectPageNthWord",
value: function selectPageNthWord() {}
}, {
key: "setAction",
value: function setAction() {}
}, {
key: "setDataObjectContents",
value: function setDataObjectContents() {}
}, {
key: "setOCGOrder",
value: function setOCGOrder() {}
}, {
key: "setPageAction",
value: function setPageAction() {}
}, {
key: "setPageBoxes",
value: function setPageBoxes() {}
}, {
key: "setPageLabels",
value: function setPageLabels() {}
}, {
key: "setPageRotations",
value: function setPageRotations() {}
}, {
key: "setPageTabOrder",
value: function setPageTabOrder() {}
}, {
key: "setPageTransitions",
value: function setPageTransitions() {}
}, {
key: "spawnPageFromTemplate",
value: function spawnPageFromTemplate() {}
}, {
key: "submitForm",
value: function submitForm() {}
}, {
key: "syncAnnotScan",
value: function syncAnnotScan() {}
}]);
return Doc;
}(_pdf_object.PDFObject);
exports.Doc = Doc;
/***/ }),
/* 15 */
/***/ ((__unused_webpack_module, exports) => {
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.PrintParams = void 0;
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var PrintParams = function PrintParams(data) {
_classCallCheck(this, PrintParams);
this.binaryOk = true;
this.bitmapDPI = 150;
this.booklet = {
binding: 0,
duplexMode: 0,
subsetFrom: 0,
subsetTo: -1
};
this.colorOverride = 0;
this.colorProfile = "";
this.constants = Object.freeze({
bookletBindings: Object.freeze({
Left: 0,
Right: 1,
LeftTall: 2,
RightTall: 3
}),
bookletDuplexMode: Object.freeze({
BothSides: 0,
FrontSideOnly: 1,
BasicSideOnly: 2
}),
colorOverrides: Object.freeze({
auto: 0,
gray: 1,
mono: 2
}),
fontPolicies: Object.freeze({
everyPage: 0,
jobStart: 1,
pageRange: 2
}),
handling: Object.freeze({
none: 0,
fit: 1,
shrink: 2,
tileAll: 3,
tileLarge: 4,
nUp: 5,
booklet: 6
}),
interactionLevel: Object.freeze({
automatic: 0,
full: 1,
silent: 2
}),
nUpPageOrders: Object.freeze({
Horizontal: 0,
HorizontalReversed: 1,
Vertical: 2
}),
printContents: Object.freeze({
doc: 0,
docAndComments: 1,
formFieldsOnly: 2
}),
flagValues: Object.freeze({
applyOverPrint: 1,
applySoftProofSettings: 1 << 1,
applyWorkingColorSpaces: 1 << 2,
emitHalftones: 1 << 3,
emitPostScriptXObjects: 1 << 4,
emitFormsAsPSForms: 1 << 5,
maxJP2KRes: 1 << 6,
setPageSize: 1 << 7,
suppressBG: 1 << 8,
suppressCenter: 1 << 9,
suppressCJKFontSubst: 1 << 10,
suppressCropClip: 1 << 1,
suppressRotate: 1 << 12,
suppressTransfer: 1 << 13,
suppressUCR: 1 << 14,
useTrapAnnots: 1 << 15,
usePrintersMarks: 1 << 16
}),
rasterFlagValues: Object.freeze({
textToOutline: 1,
strokesToOutline: 1 << 1,
allowComplexClip: 1 << 2,
preserveOverprint: 1 << 3
}),
subsets: Object.freeze({
all: 0,
even: 1,
odd: 2
}),
tileMarks: Object.freeze({
none: 0,
west: 1,
east: 2
}),
usages: Object.freeze({
auto: 0,
use: 1,
noUse: 2
})
});
this.downloadFarEastFonts = false;
this.fileName = "";
this.firstPage = 0;
this.flags = 0;
this.fontPolicy = 0;
this.gradientDPI = 150;
this.interactive = 1;
this.lastPage = data.lastPage;
this.npUpAutoRotate = false;
this.npUpNumPagesH = 2;
this.npUpNumPagesV = 2;
this.npUpPageBorder = false;
this.npUpPageOrder = 0;
this.pageHandling = 0;
this.pageSubset = 0;
this.printAsImage = false;
this.printContent = 0;
this.printerName = "";
this.psLevel = 0;
this.rasterFlags = 0;
this.reversePages = false;
this.tileLabel = false;
this.tileMark = 0;
this.tileOverlap = 0;
this.tileScale = 1.0;
this.transparencyLevel = 75;
this.usePrinterCRD = 0;
this.useT1Conversion = 0;
};
exports.PrintParams = PrintParams;
/***/ }),
/* 16 */
/***/ ((__unused_webpack_module, exports) => {
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.ProxyHandler = void 0;
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
var ProxyHandler = /*#__PURE__*/function () {
function ProxyHandler() {
_classCallCheck(this, ProxyHandler);
this.nosend = new Set(["delay"]);
}
_createClass(ProxyHandler, [{
key: "get",
value: function get(obj, prop) {
if (prop in obj._expandos) {
var val = obj._expandos[prop];
if (typeof val === "function") {
return val.bind(obj);
}
return val;
}
if (typeof prop === "string" && !prop.startsWith("_") && prop in obj) {
var _val = obj[prop];
if (typeof _val === "function") {
return _val.bind(obj);
}
return _val;
}
return undefined;
}
}, {
key: "set",
value: function set(obj, prop, value) {
if (obj._kidIds) {
obj._kidIds.forEach(function (id) {
obj._appObjects[id].wrapped[prop] = value;
});
}
if (typeof prop === "string" && !prop.startsWith("_") && prop in obj) {
var old = obj[prop];
obj[prop] = value;
if (!this.nosend.has(prop) && obj._send && obj._id !== null && typeof old !== "function") {
var data = {
id: obj._id
};
data[prop] = obj[prop];
if (!obj._siblings) {
obj._send(data);
} else {
data.siblings = obj._siblings;
obj._send(data);
}
}
} else {
obj._expandos[prop] = value;
}
return true;
}
}, {
key: "has",
value: function has(obj, prop) {
return prop in obj._expandos || typeof prop === "string" && !prop.startsWith("_") && prop in obj;
}
}, {
key: "getPrototypeOf",
value: function getPrototypeOf(obj) {
return null;
}
}, {
key: "setPrototypeOf",
value: function setPrototypeOf(obj, proto) {
return false;
}
}, {
key: "isExtensible",
value: function isExtensible(obj) {
return true;
}
}, {
key: "preventExtensions",
value: function preventExtensions(obj) {
return false;
}
}, {
key: "getOwnPropertyDescriptor",
value: function getOwnPropertyDescriptor(obj, prop) {
if (prop in obj._expandos) {
return {
configurable: true,
enumerable: true,
value: obj._expandos[prop]
};
}
if (typeof prop === "string" && !prop.startsWith("_") && prop in obj) {
return {
configurable: true,
enumerable: true,
value: obj[prop]
};
}
return undefined;
}
}, {
key: "defineProperty",
value: function defineProperty(obj, key, descriptor) {
Object.defineProperty(obj._expandos, key, descriptor);
return true;
}
}, {
key: "deleteProperty",
value: function deleteProperty(obj, prop) {
if (prop in obj._expandos) {
delete obj._expandos[prop];
}
}
}, {
key: "ownKeys",
value: function ownKeys(obj) {
var fromExpandos = Reflect.ownKeys(obj._expandos);
var fromObj = Reflect.ownKeys(obj).filter(function (k) {
return !k.startsWith("_");
});
return fromExpandos.concat(fromObj);
}
}]);
return ProxyHandler;
}();
exports.ProxyHandler = ProxyHandler;
/***/ }),
/* 17 */
/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.Util = void 0;
var _pdf_object = __w_pdfjs_require__(7);
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
var Util = /*#__PURE__*/function (_PDFObject) {
_inherits(Util, _PDFObject);
var _super = _createSuper(Util);
function Util(data) {
var _this;
_classCallCheck(this, Util);
_this = _super.call(this, data);
_this._scandCache = new Map();
_this._months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
_this._days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
_this.MILLISECONDS_IN_DAY = 86400000;
_this.MILLISECONDS_IN_WEEK = 604800000;
_this._externalCall = data.externalCall;
return _this;
}
_createClass(Util, [{
key: "printf",
value: function printf() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
if (args.length === 0) {
throw new Error("Invalid number of params in printf");
}
if (typeof args[0] !== "string") {
throw new TypeError("First argument of printf must be a string");
}
var pattern = /%(,[0-4])?([+ 0#]+)?(\\d+)?(\\.\\d+)?(.)/g;
var PLUS = 1;
var SPACE = 2;
var ZERO = 4;
var HASH = 8;
var i = 0;
return args[0].replace(pattern, function (match, nDecSep, cFlags, nWidth, nPrecision, cConvChar) {
if (cConvChar !== "d" && cConvChar !== "f" && cConvChar !== "s" && cConvChar !== "x") {
var buf = ["%"];
for (var _i = 0, _arr = [nDecSep, cFlags, nWidth, nPrecision, cConvChar]; _i < _arr.length; _i++) {
var str = _arr[_i];
if (str) {
buf.push(str);
}
}
return buf.join("");
}
i++;
if (i === args.length) {
throw new Error("Not enough arguments in printf");
}
var arg = args[i];
if (cConvChar === "s") {
return arg.toString();
}
var flags = 0;
if (cFlags) {
var _iterator = _createForOfIteratorHelper(cFlags),
_step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var flag = _step.value;
switch (flag) {
case "+":
flags |= PLUS;
break;
case " ":
flags |= SPACE;
break;
case "0":
flags |= ZERO;
break;
case "#":
flags |= HASH;
break;
}
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
}
cFlags = flags;
if (nWidth) {
nWidth = parseInt(nWidth);
}
var intPart = Math.trunc(arg);
if (cConvChar === "x") {
var hex = Math.abs(intPart).toString(16).toUpperCase();
if (nWidth !== undefined) {
hex = hex.padStart(nWidth, cFlags & ZERO ? "0" : " ");
}
if (cFlags & HASH) {
hex = "0x".concat(hex);
}
return hex;
}
if (nPrecision) {
nPrecision = parseInt(nPrecision.substring(1));
}
nDecSep = nDecSep ? nDecSep.substring(1) : "0";
var separators = {
0: [",", "."],
1: ["", "."],
2: [".", ","],
3: ["", ","],
4: ["'", "."]
};
var _separators$nDecSep = _slicedToArray(separators[nDecSep], 2),
thousandSep = _separators$nDecSep[0],
decimalSep = _separators$nDecSep[1];
var decPart = "";
if (cConvChar === "f") {
if (nPrecision !== undefined) {
decPart = Math.abs(arg - intPart).toFixed(nPrecision);
} else {
decPart = Math.abs(arg - intPart).toString();
}
if (decPart.length > 2) {
decPart = "".concat(decimalSep).concat(decPart.substring(2));
} else if (cFlags & HASH) {
decPart = ".";
} else {
decPart = "";
}
}
var sign = "";
if (intPart < 0) {
sign = "-";
intPart = -intPart;
} else if (cFlags & PLUS) {
sign = "+";
} else if (cFlags & SPACE) {
sign = " ";
}
if (thousandSep && intPart >= 1000) {
var _buf = [];
while (true) {
_buf.push((intPart % 1000).toString().padStart(3, "0"));
intPart = Math.trunc(intPart / 1000);
if (intPart < 1000) {
_buf.push(intPart.toString());
break;
}
}
intPart = _buf.reverse().join(thousandSep);
} else {
intPart = intPart.toString();
}
var n = "".concat(intPart).concat(decPart);
if (nWidth !== undefined) {
n = n.padStart(nWidth - sign.length, cFlags & ZERO ? "0" : " ");
}
return "".concat(sign).concat(n);
});
}
}, {
key: "iconStreamFromIcon",
value: function iconStreamFromIcon() {}
}, {
key: "printd",
value: function printd(cFormat, oDate) {
var _this2 = this;
switch (cFormat) {
case 0:
return this.printd("D:yyyymmddHHMMss", oDate);
case 1:
return this.printd("yyyy.mm.dd HH:MM:ss", oDate);
case 2:
return this.printd("m/d/yy h:MM:ss tt", oDate);
}
var handlers = {
mmmm: function mmmm(data) {
return _this2._months[data.month];
},
mmm: function mmm(data) {
return _this2._months[data.month].substring(0, 3);
},
mm: function mm(data) {
return (data.month + 1).toString().padStart(2, "0");
},
m: function m(data) {
return (data.month + 1).toString();
},
dddd: function dddd(data) {
return _this2._days[data.dayOfWeek];
},
ddd: function ddd(data) {
return _this2._days[data.dayOfWeek].substring(0, 3);
},
dd: function dd(data) {
return data.day.toString().padStart(2, "0");
},
d: function d(data) {
return data.day.toString();
},
yyyy: function yyyy(data) {
return data.year.toString();
},
yy: function yy(data) {
return (data.year % 100).toString().padStart(2, "0");
},
HH: function HH(data) {
return data.hours.toString().padStart(2, "0");
},
H: function H(data) {
return data.hours.toString();
},
hh: function hh(data) {
return (1 + (data.hours + 11) % 12).toString().padStart(2, "0");
},
h: function h(data) {
return (1 + (data.hours + 11) % 12).toString();
},
MM: function MM(data) {
return data.minutes.toString().padStart(2, "0");
},
M: function M(data) {
return data.minutes.toString();
},
ss: function ss(data) {
return data.seconds.toString().padStart(2, "0");
},
s: function s(data) {
return data.seconds.toString();
},
tt: function tt(data) {
return data.hours < 12 ? "am" : "pm";
},
t: function t(data) {
return data.hours < 12 ? "a" : "p";
}
};
var data = {
year: oDate.getFullYear(),
month: oDate.getMonth(),
day: oDate.getDate(),
dayOfWeek: oDate.getDay(),
hours: oDate.getHours(),
minutes: oDate.getMinutes(),
seconds: oDate.getSeconds()
};
var patterns = /(mmmm|mmm|mm|m|dddd|ddd|dd|d|yyyy|yy|HH|H|hh|h|MM|M|ss|s|tt|t|\\\\.)/g;
return cFormat.replace(patterns, function (match, pattern) {
if (pattern in handlers) {
return handlers[pattern](data);
}
return pattern.charCodeAt(1);
});
}
}, {
key: "printx",
value: function printx(cFormat, cSource) {
var handlers = [function (x) {
return x;
}, function (x) {
return x.toUpperCase();
}, function (x) {
return x.toLowerCase();
}];
var buf = [];
var i = 0;
var ii = cSource.length;
var currCase = handlers[0];
var escaped = false;
var _iterator2 = _createForOfIteratorHelper(cFormat),
_step2;
try {
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
var command = _step2.value;
if (escaped) {
buf.push(command);
escaped = false;
continue;
}
if (i >= ii) {
break;
}
switch (command) {
case "?":
buf.push(currCase(cSource.charAt(i++)));
break;
case "X":
while (i < ii) {
var _char = cSource.charAt(i++);
if ("a" <= _char && _char <= "z" || "A" <= _char && _char <= "Z" || "0" <= _char && _char <= "9") {
buf.push(currCase(_char));
break;
}
}
break;
case "A":
while (i < ii) {
var _char2 = cSource.charAt(i++);
if ("a" <= _char2 && _char2 <= "z" || "A" <= _char2 && _char2 <= "Z") {
buf.push(currCase(_char2));
break;
}
}
break;
case "9":
while (i < ii) {
var _char3 = cSource.charAt(i++);
if ("0" <= _char3 && _char3 <= "9") {
buf.push(_char3);
break;
}
}
break;
case "*":
while (i < ii) {
buf.push(currCase(cSource.charAt(i++)));
}
break;
case "\\\\":
escaped = true;
break;
case ">":
currCase = handlers[1];
break;
case "<":
currCase = handlers[2];
break;
case "=":
currCase = handlers[0];
break;
default:
buf.push(command);
}
}
} catch (err) {
_iterator2.e(err);
} finally {
_iterator2.f();
}
return buf.join("");
}
}, {
key: "scand",
value: function scand(cFormat, cDate) {
if (cDate === "") {
return new Date();
}
switch (cFormat) {
case 0:
return this.scand("D:yyyymmddHHMMss", cDate);
case 1:
return this.scand("yyyy.mm.dd HH:MM:ss", cDate);
case 2:
return this.scand("m/d/yy h:MM:ss tt", cDate);
}
if (!this._scandCache.has(cFormat)) {
var months = this._months;
var days = this._days;
var handlers = {
mmmm: {
pattern: "(".concat(months.join("|"), ")"),
action: function action(value, data) {
data.month = months.indexOf(value);
}
},
mmm: {
pattern: "(".concat(months.map(function (month) {
return month.substring(0, 3);
}).join("|"), ")"),
action: function action(value, data) {
data.month = months.findIndex(function (month) {
return month.substring(0, 3) === value;
});
}
},
mm: {
pattern: "(\\\\d{2})",
action: function action(value, data) {
data.month = parseInt(value) - 1;
}
},
m: {
pattern: "(\\\\d{1,2})",
action: function action(value, data) {
data.month = parseInt(value) - 1;
}
},
dddd: {
pattern: "(".concat(days.join("|"), ")"),
action: function action(value, data) {
data.day = days.indexOf(value);
}
},
ddd: {
pattern: "(".concat(days.map(function (day) {
return day.substring(0, 3);
}).join("|"), ")"),
action: function action(value, data) {
data.day = days.findIndex(function (day) {
return day.substring(0, 3) === value;
});
}
},
dd: {
pattern: "(\\\\d{2})",
action: function action(value, data) {
data.day = parseInt(value);
}
},
d: {
pattern: "(\\\\d{1,2})",
action: function action(value, data) {
data.day = parseInt(value);
}
},
yyyy: {
pattern: "(\\\\d{4})",
action: function action(value, data) {
data.year = parseInt(value);
}
},
yy: {
pattern: "(\\\\d{2})",
action: function action(value, data) {
data.year = 2000 + parseInt(value);
}
},
HH: {
pattern: "(\\\\d{2})",
action: function action(value, data) {
data.hours = parseInt(value);
}
},
H: {
pattern: "(\\\\d{1,2})",
action: function action(value, data) {
data.hours = parseInt(value);
}
},
hh: {
pattern: "(\\\\d{2})",
action: function action(value, data) {
data.hours = parseInt(value);
}
},
h: {
pattern: "(\\\\d{1,2})",
action: function action(value, data) {
data.hours = parseInt(value);
}
},
MM: {
pattern: "(\\\\d{2})",
action: function action(value, data) {
data.minutes = parseInt(value);
}
},
M: {
pattern: "(\\\\d{1,2})",
action: function action(value, data) {
data.minutes = parseInt(value);
}
},
ss: {
pattern: "(\\\\d{2})",
action: function action(value, data) {
data.seconds = parseInt(value);
}
},
s: {
pattern: "(\\\\d{1,2})",
action: function action(value, data) {
data.seconds = parseInt(value);
}
},
tt: {
pattern: "([aApP][mM])",
action: function action(value, data) {
var _char4 = value.charAt(0);
data.am = _char4 === "a" || _char4 === "A";
}
},
t: {
pattern: "([aApP])",
action: function action(value, data) {
data.am = value === "a" || value === "A";
}
}
};
var escapedFormat = cFormat.replace(/[.*+\\-?^\${}()|[\\]\\\\]/g, "\\\\$&");
var patterns = /(mmmm|mmm|mm|m|dddd|ddd|dd|d|yyyy|yy|HH|H|hh|h|MM|M|ss|s|tt|t)/g;
var _actions = [];
var _re = escapedFormat.replace(patterns, function (match, patternElement) {
var _handlers$patternElem = handlers[patternElement],
pattern = _handlers$patternElem.pattern,
action = _handlers$patternElem.action;
_actions.push(action);
return pattern;
});
this._scandCache.set(cFormat, [_re, _actions]);
}
var _this$_scandCache$get = this._scandCache.get(cFormat),
_this$_scandCache$get2 = _slicedToArray(_this$_scandCache$get, 2),
re = _this$_scandCache$get2[0],
actions = _this$_scandCache$get2[1];
var matches = new RegExp(re, "g").exec(cDate);
if (!matches || matches.length !== actions.length + 1) {
return null;
}
var data = {
year: 0,
month: 0,
day: 0,
hours: 0,
minutes: 0,
seconds: 0,
am: null
};
actions.forEach(function (action, i) {
return action(matches[i + 1], data);
});
if (data.am !== null) {
data.hours = data.hours % 12 + (data.am ? 0 : 12);
}
return new Date(data.year, data.month, data.day, data.hours, data.minutes, data.seconds);
}
}, {
key: "spansToXML",
value: function spansToXML() {}
}, {
key: "stringFromStream",
value: function stringFromStream() {}
}, {
key: "xmlToSpans",
value: function xmlToSpans() {}
}]);
return Util;
}(_pdf_object.PDFObject);
exports.Util = Util;
/***/ })
/******/ ]);
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __w_pdfjs_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __w_pdfjs_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
(() => {
var exports = __webpack_exports__;
Object.defineProperty(exports, "__esModule", ({
value: true
}));
Object.defineProperty(exports, "initSandbox", ({
enumerable: true,
get: function get() {
return _initialization.initSandbox;
}
}));
var _initialization = __w_pdfjs_require__(1);
var pdfjsVersion = '2.12.313';
var pdfjsBuild = 'a2ae56f39';
})();
/******/ return __webpack_exports__;
/******/ })()
;
});`];t.push("delete dump;");var s=!1,J=0;try{var P=JSON.stringify(o);t.push("pdfjsScripting.initSandbox({ data: ".concat(P," })")),J=this._module.stringToNewUTF8(t.join(`
`)),s=!!this._module.ccall("init","number",["number","number"],[J,this._alertOnError])}catch(O){console.error(O)}finally{J&&this._module.ccall("free","number",["number"],[J])}if(s)this.support.commFun=this._module.cwrap("commFun",null,["string","string"]);else throw this.nukeSandbox(),new Error("Cannot start sandbox")}},{key:"dispatchEvent",value:function(o){this.support.callSandboxFunction("dispatchEvent",o)}},{key:"dumpMemoryUse",value:function(){this._module&&this._module.ccall("dumpMemoryUse",null,[])}},{key:"nukeSandbox",value:function(){this._module!==null&&(this.support.destroy(),this.support=null,this._module.ccall("nukeSandbox",null,[]),this._module=null)}},{key:"evalForTesting",value:function(o,t){throw new Error("Not implemented: evalForTesting")}}]),n}();function r(){return(0,R.default)().then(function(n){return new i(window,n)})}})(),EA})()});